So Frohes Fest,
Habe da ein kleines Geschenk für die Community, habe 7 Bögen erstellt, diese versende ich aber wegen göße nur per Email.
Bögen nach „c:“ kopieren
Dazu ein selbst rein kopierendes Skript (funktioniert nur wenn der media Pfad c:\IP-Symcon\media ist, sonst in zeile 16 anpassen)
<?
$ScriptNAME = 'Media Kopierer';
//****************************************************************************
$ScriptTEXT1 =
'<?
//$farbe = "\Dunkelblau";// Farbe
$ordner = "c:\Lcars";//Lcars Ordner
$anzahl = 27;//anzahl bilder
$mediaordner = "c:\IP-Symcon\media";
$anders = "00";
//******************************************
$pfad = "$ordner$farbe";
$bild = "$farbe-L";
$zahl = 1;
$anzahl = $anzahl+1;
$format = ".png";
$name = "$pfad$bild$zahl$format";
$CatID = @IPS_GetCategoryIDByName("$farbe", 0);
if ($CatID === false)
{
$CatID = IPS_CreateCategory();
IPS_SetName($CatID, "$farbe");
}
$anzahl1 = $anzahl;
$zahl1 = $zahl;
for ($count=1;$count<$anzahl;$count++)
{
If ($zahl<10)
{
$zahl = "0$zahl";
}
$name = "$pfad$bild$zahl$format";
$zielname = "$mediaordner$bild$anders$zahl$format";
$ParentID = $IPS_SELF;
echo $ParentID;
$ScriptID = @IPS_GetScriptIDByName("T2", $ParentID);
echo $ScriptID;
IPS_RunScriptWaitEx($ScriptID , Array("zielname" => "$zielname","name" => "$name"));
copy("$name","$zielname");
$zielname2 = "$bild$anders$zahl$format";
$MediaID = @IPS_GetMediaIDByFile("media$zielname2");
IPS_SetParent($MediaID,$CatID);
$zahl = $zahl+1;
}
?>';
//****************************************************************************
$ScriptID = IPS_CreateScript(0);
IPS_SetName($ScriptID, $ScriptNAME);
IPS_SetInfo($ScriptID, "This script was created by: #$IPS_SELF#");
$fh = fopen(IPS_GetKernelDir()."scripts\\".$ScriptID.".ips.php", 'w') or die("can't open file");
fwrite($fh, $ScriptTEXT1);
//fwrite($fh, 0);
fclose($fh);
$ScriptPath = $ScriptID.".ips.php"; //Skriptdatei
IPS_SetScriptFile($ScriptID, $ScriptPath);
//IPS_SetVariableCustomAction(0, $ScriptID);
IPS_SetParent($ScriptID, $IPS_SELF);
$Peter = $ScriptID;
$ScriptNAME = 'T2';
//****************************************************************************
$ScriptTEXT1 =
'<?
copy("$name","$zielname");
?>';
//****************************************************************************
$ScriptID = IPS_CreateScript(0);
IPS_SetName($ScriptID, $ScriptNAME);
IPS_SetInfo($ScriptID, "This script was created by: #$IPS_SELF#");
$fh = fopen(IPS_GetKernelDir()."scripts\\".$ScriptID.".ips.php", 'w') or die("can't open file");
fwrite($fh, $ScriptTEXT1);
fclose($fh);
$ScriptPath = $ScriptID.".ips.php"; //Skriptdatei
IPS_SetScriptFile($ScriptID, $ScriptPath);
IPS_SetParent($ScriptID, $Peter);
$ScriptNAME = 'run';
//****************************************************************************
$ScriptTEXT1 =
'<?
$ScriptID=';
$ScriptTEXT3 =
';
IPS_RunScriptWaitEx($ScriptID , Array("farbe" => "\Blau"));
IPS_RunScriptWaitEx($ScriptID , Array("farbe" => "\Gelb"));
IPS_RunScriptWaitEx($ScriptID , Array("farbe" => "\Rot"));
IPS_RunScriptWaitEx($ScriptID , Array("farbe" => "\Lila"));
IPS_RunScriptWaitEx($ScriptID , Array("farbe" => "\Dunkelblau"));
IPS_RunScriptWaitEx($ScriptID , Array("farbe" => "\Grün"));
IPS_RunScriptWaitEx($ScriptID , Array("farbe" => "\Orange"));
?>';
//****************************************************************************
$ScriptID = IPS_CreateScript(0);
IPS_SetName($ScriptID, $ScriptNAME);
IPS_SetInfo($ScriptID, "This script was created by: #$IPS_SELF#");
$fh = fopen(IPS_GetKernelDir()."scripts\\".$ScriptID.".ips.php", 'w') or die("can't open file");
fwrite($fh, $ScriptTEXT1);
fwrite($fh, $Peter);
fwrite($fh, $ScriptTEXT3);
fclose($fh);
$ScriptPath = $ScriptID.".ips.php"; //Skriptdatei
IPS_SetScriptFile($ScriptID, $ScriptPath);
IPS_SetParent($ScriptID, $Peter);
Ips_runscript ($ScriptID);
?>
einfach ausführen und schon bekommt Ihr 7x27 Lcars Vorlagen zum selber bauen. anbei noch ein bild wie es aussieht.
Viel Spas und ein frohes Fest