• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Script manager

RunarM

Finally back
Joined
Jul 17, 2008
Messages
1,636
Reaction score
32
Location
Norway/Tromsø
Hello Otland, i made a simple script manager for ots and thought someone here might like it.

Image:
SMbRM.png


Download:
Speedyshare: Script manager zip
Megaupload: MEGAUPLOAD - The leading online storage and file delivery service

Scan (.zip): VirusTotal - Free Online Virus, Malware and URL Scanner
Scan (.exe): VirusTotal - Free Online Virus, Malware and URL Scanner


Tell me what you want to see in a future version, if there's a bug please report it and if you want the source just pm and i'll send you it. The project is made in Visual basic 2010 so if you want the source you'll need that program.

Hope you like it :)
-RunarM
 
Add .xml files checker that will verify which files are not used [doesn't exist in actions.xml, talkactions.xml...] and which files are missing [are in .xml, but aren't in folder, check letter size].
Add in first post [of new version thread] link to [.NET 4]:
Download details: Microsoft .NET Framework 4 (Web Installer)
Some examples of files verifiers you can see here:
LUA: http://otland.net/f81/get-files-arent-being-used-scripts-folders-127701/
PHP online zipped monsters folder verifier:
PHP:
<?PHP
function colorChanges($orginal, $changed)
{
	$ret = '';
	for($l = 0; $l < strlen($orginal); $l++)
		if($orginal[$l] == $changed[$l])
			$ret .= $orginal[$l];
		else
			$ret .= '<font size="6" color="blue">' . $changed[$l] . '</font>';
	return $ret;
}
$monstersErrorsList = array();
$spawnsErrorsList = array();
if(isset($_FILES['monsters_file']['tmp_name']))
{
	$monstersPaths = array();
	$monstersZIP = new ZipArchive();;
	if($monstersZIP->open($_FILES['monsters_file']['tmp_name']))
	{
		for($i = 0; $i < $monstersZIP->numFiles; $i++)
			if(!in_array(substr($monstersZIP->getNameIndex($i), -1, 1), array('/', '\\')))
				$monstersPaths[$monstersZIP->getNameIndex($i)] = $monstersZIP->getNameIndex($i);
		$removeMonsterDir = true;
		foreach($monstersPaths as $monsterPath)
		{
			if(substr($monsterPath, 0, 8) != 'monster/')
				$removeMonsterDir = false;
		}
		if($removeMonsterDir)
		{
			$monstersFilePath = 'monster/monsters.xml';
			foreach($monstersPaths as $key => $value)
			{
				$monstersPaths[substr($key, 8)] = substr($key, 8);
				unset($monstersPaths[$key]);
			}
		}
		else
			$monstersFilePath = 'monsters.xml';
		$monstersPathsLowercase = $monstersPaths;
		foreach($monstersPathsLowercase as $key => $value)
			$monstersPathsLowercase[strtolower($key)] = strtolower($value);
	}
	else
		die('bad file monster.zip');
	$monstersXML = new DOMDocument();
	$monstersXML->loadXML($monstersZIP->getFromName($monstersFilePath));
	$monstersList = array();
	$monstersElements = $monstersXML->getElementsByTagName('monster');
	for($m = 0; $m < $monstersElements->length; $m++)
	{
		if($monstersElements->item($m)->hasAttributes() && $monstersElements->item($m)->attributes->getNamedItem('name') && $monstersElements->item($m)->attributes->getNamedItem('file'))
			$monstersList[$monstersElements->item($m)->attributes->getNamedItem('name')->nodeValue] = $monstersElements->item($m)->attributes->getNamedItem('file')->nodeValue;
	}
	$i = 0;
	$monsterPathId = array_values($monstersPaths);
	foreach($monstersList as $name => $file)
	{
		if(!isset($monstersPaths[$file]))
		{
			$doesnt_exist = '<b>' . $name . '</b> - ';
			if(isset($monstersPathsLowercase[strtolower($file)]))
				$doesnt_exist .= 'NOW: <i>' . colorChanges($monsterPathId[$i], $file)  . '</i> - Proposition: <i>' . colorChanges($file, $monsterPathId[$i]) . '</i>';
			else
				$doesnt_exist .= 'Proposition: <b>NONE</b>';
			$monstersErrorsList[] = $doesnt_exist;
		}
		$i++;
	}
	
	
	if(isset($_FILES['spawns_file']['tmp_name']))
	{
		$spawnsXML = new DOMDocument();
		$spawnsXML->load($_FILES['spawns_file']['tmp_name']);
		$spawnMonstersList = array();
		$spawnsMonsters = $spawnsXML->getElementsByTagName('monster');
		for($s = 0; $s < $spawnsMonsters->length; $s++)
			if($spawnsMonsters->item($s)->hasAttributes() && $spawnsMonsters->item($s)->attributes->getNamedItem('name'))
				$spawnMonstersList[$spawnsMonsters->item($s)->attributes->getNamedItem('name')->nodeValue] = $spawnsMonsters->item($s)->attributes->getNamedItem('name')->nodeValue;
		foreach($spawnMonstersList as $name)
			if(!isset($monstersList[$name]))
				$spawnsErrorsList[] = '<b>' . $name . '</b>';
	}
}

echo '<html><head><title>Monsters & Spawn files verifier</title></head><body>';
echo '<font size="5"><form action="index.php" method="post" enctype="multipart/form-data"> 
Monsters file: <input type="file" name="monsters_file" /> [monster.zip]<br />
Spawns file: <input type="file" name="spawns_file" /> [..-spawn.xml]<br />
<input type="submit" value="Send & verify" /> 
</form></font>';
echo '<font size="8" color="red">Wrong paths to monsters in monsters.xml:</font><font size="5"><br/>' . implode('<br />', $monstersErrorsList) . '</font>
<br /><font size="8" color="red">Monsters from spawns file that can\'t be loaded:</font><font size="5"><br/>' . implode('<br />', $spawnsErrorsList) . '</font></body></html>';

?>
 
Add .xml files checker that will verify which files are not used [doesn't exist in actions.xml, talkactions.xml...] and which files are missing [are in .xml, but aren't in folder, check letter size].
Add in first post [of new version thread] link to [.NET 4]:
Download details: Microsoft .NET Framework 4 (Web Installer)
Some examples of files verifiers you can see here:
LUA: http://otland.net/f81/get-files-arent-being-used-scripts-folders-127701/
PHP online zipped monsters folder verifier:
PHP:
<?PHP
function colorChanges($orginal, $changed)
{
	$ret = '';
	for($l = 0; $l < strlen($orginal); $l++)
		if($orginal[$l] == $changed[$l])
			$ret .= $orginal[$l];
		else
			$ret .= '<font size="6" color="blue">' . $changed[$l] . '</font>';
	return $ret;
}
$monstersErrorsList = array();
$spawnsErrorsList = array();
if(isset($_FILES['monsters_file']['tmp_name']))
{
	$monstersPaths = array();
	$monstersZIP = new ZipArchive();;
	if($monstersZIP->open($_FILES['monsters_file']['tmp_name']))
	{
		for($i = 0; $i < $monstersZIP->numFiles; $i++)
			if(!in_array(substr($monstersZIP->getNameIndex($i), -1, 1), array('/', '\\')))
				$monstersPaths[$monstersZIP->getNameIndex($i)] = $monstersZIP->getNameIndex($i);
		$removeMonsterDir = true;
		foreach($monstersPaths as $monsterPath)
		{
			if(substr($monsterPath, 0, 8) != 'monster/')
				$removeMonsterDir = false;
		}
		if($removeMonsterDir)
		{
			$monstersFilePath = 'monster/monsters.xml';
			foreach($monstersPaths as $key => $value)
			{
				$monstersPaths[substr($key, 8)] = substr($key, 8);
				unset($monstersPaths[$key]);
			}
		}
		else
			$monstersFilePath = 'monsters.xml';
		$monstersPathsLowercase = $monstersPaths;
		foreach($monstersPathsLowercase as $key => $value)
			$monstersPathsLowercase[strtolower($key)] = strtolower($value);
	}
	else
		die('bad file monster.zip');
	$monstersXML = new DOMDocument();
	$monstersXML->loadXML($monstersZIP->getFromName($monstersFilePath));
	$monstersList = array();
	$monstersElements = $monstersXML->getElementsByTagName('monster');
	for($m = 0; $m < $monstersElements->length; $m++)
	{
		if($monstersElements->item($m)->hasAttributes() && $monstersElements->item($m)->attributes->getNamedItem('name') && $monstersElements->item($m)->attributes->getNamedItem('file'))
			$monstersList[$monstersElements->item($m)->attributes->getNamedItem('name')->nodeValue] = $monstersElements->item($m)->attributes->getNamedItem('file')->nodeValue;
	}
	$i = 0;
	$monsterPathId = array_values($monstersPaths);
	foreach($monstersList as $name => $file)
	{
		if(!isset($monstersPaths[$file]))
		{
			$doesnt_exist = '<b>' . $name . '</b> - ';
			if(isset($monstersPathsLowercase[strtolower($file)]))
				$doesnt_exist .= 'NOW: <i>' . colorChanges($monsterPathId[$i], $file)  . '</i> - Proposition: <i>' . colorChanges($file, $monsterPathId[$i]) . '</i>';
			else
				$doesnt_exist .= 'Proposition: <b>NONE</b>';
			$monstersErrorsList[] = $doesnt_exist;
		}
		$i++;
	}
	
	
	if(isset($_FILES['spawns_file']['tmp_name']))
	{
		$spawnsXML = new DOMDocument();
		$spawnsXML->load($_FILES['spawns_file']['tmp_name']);
		$spawnMonstersList = array();
		$spawnsMonsters = $spawnsXML->getElementsByTagName('monster');
		for($s = 0; $s < $spawnsMonsters->length; $s++)
			if($spawnsMonsters->item($s)->hasAttributes() && $spawnsMonsters->item($s)->attributes->getNamedItem('name'))
				$spawnMonstersList[$spawnsMonsters->item($s)->attributes->getNamedItem('name')->nodeValue] = $spawnsMonsters->item($s)->attributes->getNamedItem('name')->nodeValue;
		foreach($spawnMonstersList as $name)
			if(!isset($monstersList[$name]))
				$spawnsErrorsList[] = '<b>' . $name . '</b>';
	}
}

echo '<html><head><title>Monsters & Spawn files verifier</title></head><body>';
echo '<font size="5"><form action="index.php" method="post" enctype="multipart/form-data"> 
Monsters file: <input type="file" name="monsters_file" /> [monster.zip]<br />
Spawns file: <input type="file" name="spawns_file" /> [..-spawn.xml]<br />
<input type="submit" value="Send & verify" /> 
</form></font>';
echo '<font size="8" color="red">Wrong paths to monsters in monsters.xml:</font><font size="5"><br/>' . implode('<br />', $monstersErrorsList) . '</font>
<br /><font size="8" color="red">Monsters from spawns file that can\'t be loaded:</font><font size="5"><br/>' . implode('<br />', $spawnsErrorsList) . '</font></body></html>';

?>

Great ideas, i'll try to add them to the next version =)
 
Nice tool, found small bug. If rar file found in the folder, and you click on it, the tool will crash^^
 
Thanks for reporting that bug (i'll fix it soon), i am working on script generator now and then i'll start with the file/folder clean up but i'm going out for 2-3 hours now.
I hope to get 1.1 up today, have a nice day.

Script generator:
If you have many scripts you want to release you can use Script manager 1.1+ to make a short link people can use to add the scripts to the server in seconds.

-RunarM
 
because not everyone have 4.0 and doesn't want to update? also you aren't using 4.0 features...
 
Why not simply use 4.0?
Maybe because of that:
Hardware Requirements:

Recommended Minimum: Pentium 1 GHz or higher with 512 MB RAM or more
Minimum disk space:
x86 – 850 MB
x64 – 2 GB

EDIT:
Check code again, because there is memory leak. On my WinXP SP 3 it uses 16KB ram more/second.
 
Last edited:
I am still working on this, just not as much as i should :p

Quick question, is the colors right?
[video=youtube;uAFpS90xNd8]http://www.youtube.com/watch?v=uAFpS90xNd8[/video]
 
Back
Top