MappingFOR
Web Developer
- Joined
- Jul 12, 2010
- Messages
- 35
- Reaction score
- 0
v2.0
+ LUA FILES CHECK! // I think it working good [TESTED]
+ Better look
- One night ^.^
39648 f**k'n chars
Hope you enjoy. Please send screens with your Item prices errors.
UPDATE (v0.8b / v1.2) -> v2.0
Change all between
and
to
NOT INSTALED YET?
Change
to
+ LUA FILES CHECK! // I think it working good [TESTED]
+ Better look
- One night ^.^
39648 f**k'n chars
Hope you enjoy. Please send screens with your Item prices errors.
UPDATE (v0.8b / v1.2) -> v2.0
Change all between
Code:
//NPC CHECK by MappingFOR // www.mayu11.webd.pl // PL & EN
Code:
// END NPC CHECK
to
Code:
if($action == "npc_check_by_mappingfor") {
$language['en']['none'] = "NONE";
$language['en']['name'] = "Name";
$language['en']['script'] = "Script";
$language['en']['mod_off'] = "The shop module is off.";
$language['en']['error_none'] = "<font color=\"red\"><b>ERROR!</b></font> NPC which has switched shop module should have at least one item to buy or sell.";
$language['en']['errors'] = "Now, I'll show You errors ;]";
$language['en']['error'] = "<center><small>I can buy item %s from %s for %s and sell at %s for %s. I'd like it :D</small></center>";
$language['en']['added'] = "Added as '%s' type.";
$language['en']['iit'] = "%s items in '%s' type.";
$language['en']['checked'] = "%s rows checked.";
$language['en']['no_erros'] = "<small>Like no errors here ;[</small>";
$language['pl']['none'] = "BRAK";
$language['pl']['name'] = "Nazwa";
$language['pl']['script'] = "Skrypt";
$language['pl']['mod_off'] = "Moduł sklepu jest wyłączony.";
$language['pl']['error_none'] = "<font color=\"red\">BŁĄD!</font> NPC z włączonym modułem sklepu powinien posiadać przynajmniej jeden przedmiot do kupienia lub sprzedania.";
$language['pl']['errors'] = "Teraz pokaże Ci błędy ;]";
$language['pl']['error'] = "<center><small>Mogę kupić przedmiot %s u %s za %s i sprzedać u %s za %s. Lubię to :D</small></center>";
$language['pl']['added'] = "Dodane jako typ '%s'.";
$language['pl']['iit'] = "%s przedmiotów w typie '%s'.";
$language['pl']['checked'] = "Sprawdzono %s linijek.";
$language['pl']['no_erros'] = "<small>Wygląda na to, że nie ma tutaj błędów ;[</small>";
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>Add Files</B></TD></TR>';
// Magic cutting function by MappingFOR ("change_c($back_g,$bgcolor);" to use)
function change_c(&$back_g,&$bgcolor){
if(is_int($back_g / 2))
$bgcolor = "#D4C0A1";
else
$bgcolor = "#F1E0C6";
$back_g++;
}
if(isset($_GET['lng'])){$lng = $_GET['lng'];}else{$lng = 'pl';} // Change language
$scdost = $config['site']['server_path']."data/npc"; // data/npc Path
$a = 0;
$dir = opendir($scdost);
while(false !== ($file = readdir($dir)))
if($file != '.' && $file != '..' && preg_match("([a-zA-Z0-9].xml)" , $file)){
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>+ ['.$scdost.'/'.$file.']</small></td></tr>';
$npcs[$a] = $file;
$a++;
}
$b = 0;
/* "Teraz nastąpi dodanie wszystkich możliwych do kupiienia i sprzedania przedmiotów. " */
$main_content .= '</table><br/><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>Raport</B></TD></TR>';
while($b + 1 != $a){ // Sprawdzenie wszystkich plików
$infoXML = simplexml_load_file(''.$scdost.'\\'.$npcs[$b].''); // Wczytanie piku XML do zbadania.
$npc['name'] = $infoXML[name]; // Pobranie nazwy NPC
$npc['script'] = $infoXML[script]; // Pobranie skryptu który obsługuje
if(empty($npc['script']))
{
$npc['script'] = '<b>'.$language[$lng]['none'].'</b>';
}
else
{
$scripts[] = $infoXML[script];
}// Wczytanie do ogólnej zmiennej}
## Pobranie wszystkich możliwych parametrów.
$z = 0;
while(isset($infoXML->parameters->parameter[$z][key])){
$npc['param'][''.$infoXML->parameters->parameter[$z][key].''] = $infoXML->parameters->parameter[$z][value];
$z++;
}
## Jeśli modół sklepu jest włączony to pobierz wszystkie przedmioty.
if($npc['param']['module_shop'] == 1){
if(isset($npc['param']['shop_sellable'])){
## Wpisanie wszystkich przedmiotów, które można sprzedać.
$npc['sell_able'] = $npc['param']['shop_sellable'];
$npc['sell_able_array'] = explode(';',$npc['sell_able']);
$npc['sell_count'] = count($npc['sell_able_array']);
$c = 0;
while($npc['sell_able_array'][$c] != ""){
$npc['sell_able_array_positions'][$c] = explode(',',$npc['sell_able_array'][$c]);
$c++;
}
## Wyświetlenie informacji o tym, że nie ma żadnego przedmiotu który można sprzedać.
}else{$npc['sell_count'] = "None";}
if(isset($npc['param']['shop_buyable'])){
## Wpisanie wszystkich przedmiotów, które można kupić.
$npc['buy_able'] = $npc['param']['shop_buyable'];
$npc['buy_able_array'] = explode(';',$npc['buy_able']);
$npc['buy_count'] = count($npc['buy_able_array']);
$c = 0;
while($npc['buy_able_array'][$c] != ""){
$npc['buy_able_array_positions'][$c] = explode(',',$npc['buy_able_array'][$c]);
$c++;
}
## Wyświetlenie informacji o tym, że nie ma żadnego przedmiotu który można kupić.
}else{$npc['buy_count'] = "None";}
## Wyświetlenie informacji o tym, że NPC ma włączony "module_shop", a nie posiada żadnego przedmiotu do kupienia lub sprzedaży.
if($npc['buy_count'] == "None" AND $npc['sell_count'] == "None"){
$npc['shop'] = "<br/>".$language[$lng]['error_none']."";
}else{
$npc['shop'] = '['.$npc['buy_count'].' b;s '.$npc['sell_count'].']';
}
}else{
## Wyświetlenie informacji o tym, że NPC ma wyłączony "module_shop".
$npc['shop'] = $language[$lng]['mod_off'];
}
## Wyświetlenie informacji o NPC (Nazwa, Skrypt, Ilość sprzedawanych;kupowanych rzeczy.
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.$language[$lng]['name'].': '.$npc['name'].'; '.$language[$lng]['script'].': '.$npc['script'].'; '.$npc['shop'].'</small></td></tr>';
## Wyświetlanie listy przedmiotów do kupienia i sprzedania.
$c = 0;
while($npc['sell_able_array_positions'][$c] != ""){
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td> * * * * * * * * * * * *- <small>';
$main_content .= print_r($npc['sell_able_array_positions'][$c],true);
$main_content .= ' [SELLABLE]</small></td></tr>';
$list['sell'][$npc['sell_able_array_positions'][$c][1]] = $npc['sell_able_array_positions'][$c][2];
$list['sell_npc'][$npc['sell_able_array_positions'][$c][1]] = $npc['name'];
$c++;
}
$c = 0;
while($npc['buy_able_array_positions'][$c] != ""){
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td> * * * * * * * * * * * *- <small>';
$main_content .= print_r($npc['buy_able_array_positions'][$c],true);
$main_content .= ' [BUYALBE]</small></td></tr>';
$list['buy'][$npc['buy_able_array_positions'][$c][1]] = $npc['buy_able_array_positions'][$c][2];
$list['buy_npc'][$npc['buy_able_array_positions'][$c][1]] = $npc['name'];
$c++;
}
$npc = null;
$b++;
}
foreach($list['buy'] as $id => $price){
if($list['buy'][$id] < $list['sell'][$id] AND $list['buy'][$id] != 0){
change_c($back_g,$bgcolor);
$errors_items .= '<tr BGCOLOR="'.$bgcolor.'"><td>'.sprintf($language[$lng]['error'],$id,$list['buy_npc'][$id],$list['buy'][$id],$list['sell_npc'][$id],$list['sell'][$id]).'</td></tr>';
}
}
$main_content .= '</table><br/><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>[NEW] XML Results</B></TD></TR>';
if(!empty($errors_items)){
$main_content .= $errors_items;
}else{
$main_content .= $language[$lng]['no_erros'];
}
$main_content .= '</table><br/><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>[NEW] Lua Results</B></TD></TR>';
## LUA LOOKUP
$item = "";
$a = 0;
$b = 0;
$c = 0;
while(is_file($scdost.'\\scripts\\'.$scripts[$a])){
$content = file($scdost.'\\scripts\\'.$scripts[$a]);
foreach($content as $data)
{
if(preg_match("/shopModule:addBuyableItem\(/",$data) == true){
$item['buy']['addBuyableItem'][] = preg_replace("/shopModule:addBuyableItem({'(.*)'}, (.*), (.*), '(.*)')/i", "$1.$2.$3", $data).', '.$scripts[$a];
$lua_testing .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['added'],'addBuyableItem').'</small></td></tr>';
$found = '<font color="green">[V]</font>';
}
if(preg_match("/shopModule:addSellableItem\(/",$data) == true){
$item['sell']['addSellableItem'][] = preg_replace("/shopModule:addSellableItem({'(.*)', '(.*)'}, (.*), (.*), '(.*)')/i", "$1.$2.$3.$4.$5", $data).', '.$scripts[$a];
$lua_testing .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['added'],'addSellableItem').'</small></td></tr>';
$found = '<font color="green">[V]</font>';
}
if(preg_match("/shopModule:addBuyableItemContainer\(/",$data) == true){
$item['buy']['addBuyableItemContainer'][] = preg_replace("/shopModule:addBuyableItemContainer({'(.*)'}, (.*), (.*), (.*), '(.*)')/i", "$1", $data).', '.$scripts[$a];
$data .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['added'],'addBuyableItemContainer').'</small></td></tr>';
$found = '<font color="green">[V]</font>';
}
change_c($back_g,$bgcolor);
$a++;
$lua_testing .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>[FILE: '.$a.'][ROW: '.$b.']'.$found.' '.$data.'</small></td></tr>';
$a--;
$found = "";
$b++;
$c++;
}
$a++;
$b = 0;
}
$count['addBuyableItem'] = count($item['buy']['addBuyableItem']);
$count['addSellableItem'] = count($item['sell']['addSellableItem']);
$count['addBuyableItemContainer'] = count($item['buy']['addBuyableItemContainer']);
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['iit'],$count['addBuyableItem'],'addBuyableItem').'</small></td></tr>';
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['iit'],$count['addSellableItem'],'addSellableItem').'</small></td></tr>';
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['iit'],$count['addBuyableItemContainer'],'addBuyableItemContainer').'</small></td></tr>';
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['checked'],$c).'</small></td></tr>';
// Czas na ścięcie.
$list = "";
foreach($item['buy']['addBuyableItem'] as $data){
//shopModule:addBuyableItem({'WYPOWIEDŹ'}, ID, CENA, 'NAZWA')
$step = explode(', ', $data);
$id = $step[1];
$cena = $step[2];
$npc = $step[5];
$list['buy'][$id] = $cena;
$list['buy_npc'][$id] = $npc;
}
foreach($item['sell']['addSellableItem'] as $data){
//shopModule:addSellableItem({'WYPOWIEDŹ', 'WYPOWIEDŹ'}, ID, CENA, 'NAZWA')
$step = explode(', ', $data);
$id = $step[2];
$cena = $step[3];
$npc = $step[5];
$list['sell'][$id] = $cena;
$list['sell_npc'][$id] = $npc;
}
foreach($item['buy']['addBuyableItemContainer'] as $data){
$step = explode(', ', $data);
$id = $step[2];
$cena = $step[3] / 20;
$npc = $step[6];
$list['buy'][$id] = $cena;
$list['buy_npc'][$id] = $npc;
}
$errors_items = '';
foreach($list['buy'] as $id => $price){
if($list['buy'][$id] < $list['sell'][$id] AND $list['buy'][$id] != 0){
change_c($back_g,$bgcolor);
$errors_items .= '<tr BGCOLOR="'.$bgcolor.'"><td>'.sprintf($language[$lng]['error'],$id,$list['buy_npc'][$id],$list['buy'][$id],$list['sell_npc'][$id],$list['sell'][$id]).'</td></tr>';
}
}
if(!empty($errors_items)){
$main_content .= $errors_items;
}else{
$main_content .= $language[$lng]['no_erros'];
}
$main_content .= '</table>';
## DO NOT DELETE FOOTER! // NIE USUWAĆ STOPKI!
$main_content .= '<p align="right"><small>Scripted by <b><a href="http://mayu11.webd.pl">MappingFOR</a> [<a href="http://otland.net/members/mappingfor/">OTLand Profile</a>]</b>. I <font size="5">♥</font> <a href="http://otland.net">OTLand.net</a></small></p>';
$main_content .= '<TABLE id="lua_report" BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>[NEW] Lua raport</B></TD></TR>';
$main_content .= $lua_testing;
$main_content .= '</table>';
}
NOT INSTALED YET?
Change
Code:
<tr bgcolor='.$config['site']['lightborder'].'><td width="150"><b><a href="?subtopic=adminpanel&action=install_monsters">Reload Monsters</a></b></td><td><b>Load information about monsters from directory "your_server_path/data/monsters/". Delete old mosters configuration!</b></td></tr>
<tr bgcolor='.$config['site']['darkborder'].'><td width="150"><b><a href="?subtopic=adminpanel&action=install_spells">Reload Spells</a></b></td><td><b>Load information about spells from file "your_server_path/data/spells/spells.xml". Delete old spells configuration!</b></td></tr>
</table>';
}
to
Code:
<tr bgcolor='.$config['site']['lightborder'].'><td width="150"><b><a href="?subtopic=adminpanel&action=install_monsters">Reload Monsters</a></b></td><td><b>Load information about monsters from directory "your_server_path/data/monsters/". Delete old mosters configuration!</b></td></tr>
<tr bgcolor='.$config['site']['darkborder'].'><td width="150"><b><a href="?subtopic=adminpanel&action=install_spells">Reload Spells</a></b></td><td><b>Load information about spells from file "your_server_path/data/spells/spells.xml". Delete old spells configuration!</b></td></tr>
<tr bgcolor='.$config['site']['lightborder'].'><td width="150"><b><a href="?subtopic=adminpanel&action=npc_check_by_mappingfor&lng=pl">Check NPCs</a> [PL]</b></td><td><b>Sprawdzanie cen przedmiotów.</b></td></tr>
<tr bgcolor='.$config['site']['darkborder'].'><td width="150"><b><a href="?subtopic=adminpanel&action=npc_check_by_mappingfor&lng=en">Check NPCs</a> [EN]</b></td><td><b>Check items prices.</b></td></tr>
</table>';
}
//NPC CHECK by MappingFOR // www.mayu11.webd.pl // PL & EN
if($action == "npc_check_by_mappingfor") {
$language['en']['none'] = "NONE";
$language['en']['name'] = "Name";
$language['en']['script'] = "Script";
$language['en']['mod_off'] = "The shop module is off.";
$language['en']['error_none'] = "<font color=\"red\"><b>ERROR!</b></font> NPC which has switched shop module should have at least one item to buy or sell.";
$language['en']['errors'] = "Now, I'll show You errors ;]";
$language['en']['error'] = "<center><small>I can buy item %s from %s for %s and sell at %s for %s. I'd like it :D</small></center>";
$language['en']['added'] = "Added as '%s' type.";
$language['en']['iit'] = "%s items in '%s' type.";
$language['en']['checked'] = "%s rows checked.";
$language['en']['no_erros'] = "<small>Like no errors here ;[</small>";
$language['pl']['none'] = "BRAK";
$language['pl']['name'] = "Nazwa";
$language['pl']['script'] = "Skrypt";
$language['pl']['mod_off'] = "Moduł sklepu jest wyłączony.";
$language['pl']['error_none'] = "<font color=\"red\">BŁĄD!</font> NPC z włączonym modułem sklepu powinien posiadać przynajmniej jeden przedmiot do kupienia lub sprzedania.";
$language['pl']['errors'] = "Teraz pokaże Ci błędy ;]";
$language['pl']['error'] = "<center><small>Mogę kupić przedmiot %s u %s za %s i sprzedać u %s za %s. Lubię to :D</small></center>";
$language['pl']['added'] = "Dodane jako typ '%s'.";
$language['pl']['iit'] = "%s przedmiotów w typie '%s'.";
$language['pl']['checked'] = "Sprawdzono %s linijek.";
$language['pl']['no_erros'] = "<small>Wygląda na to, że nie ma tutaj błędów ;[</small>";
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>Add Files</B></TD></TR>';
// Magic cutting function by MappingFOR ("change_c($back_g,$bgcolor);" to use)
function change_c(&$back_g,&$bgcolor){
if(is_int($back_g / 2))
$bgcolor = "#D4C0A1";
else
$bgcolor = "#F1E0C6";
$back_g++;
}
if(isset($_GET['lng'])){$lng = $_GET['lng'];}else{$lng = 'pl';} // Change language
$scdost = $config['site']['server_path']."data/npc"; // data/npc Path
$a = 0;
$dir = opendir($scdost);
while(false !== ($file = readdir($dir)))
if($file != '.' && $file != '..' && preg_match("([a-zA-Z0-9].xml)" , $file)){
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>+ ['.$scdost.'/'.$file.']</small></td></tr>';
$npcs[$a] = $file;
$a++;
}
$b = 0;
/* "Teraz nastąpi dodanie wszystkich możliwych do kupiienia i sprzedania przedmiotów. " */
$main_content .= '</table><br/><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>Raport</B></TD></TR>';
while($b + 1 != $a){ // Sprawdzenie wszystkich plików
$infoXML = simplexml_load_file(''.$scdost.'\\'.$npcs[$b].''); // Wczytanie piku XML do zbadania.
$npc['name'] = $infoXML[name]; // Pobranie nazwy NPC
$npc['script'] = $infoXML[script]; // Pobranie skryptu który obsługuje
if(empty($npc['script']))
{
$npc['script'] = '<b>'.$language[$lng]['none'].'</b>';
}
else
{
$scripts[] = $infoXML[script];
}// Wczytanie do ogólnej zmiennej}
## Pobranie wszystkich możliwych parametrów.
$z = 0;
while(isset($infoXML->parameters->parameter[$z][key])){
$npc['param'][''.$infoXML->parameters->parameter[$z][key].''] = $infoXML->parameters->parameter[$z][value];
$z++;
}
## Jeśli modół sklepu jest włączony to pobierz wszystkie przedmioty.
if($npc['param']['module_shop'] == 1){
if(isset($npc['param']['shop_sellable'])){
## Wpisanie wszystkich przedmiotów, które można sprzedać.
$npc['sell_able'] = $npc['param']['shop_sellable'];
$npc['sell_able_array'] = explode(';',$npc['sell_able']);
$npc['sell_count'] = count($npc['sell_able_array']);
$c = 0;
while($npc['sell_able_array'][$c] != ""){
$npc['sell_able_array_positions'][$c] = explode(',',$npc['sell_able_array'][$c]);
$c++;
}
## Wyświetlenie informacji o tym, że nie ma żadnego przedmiotu który można sprzedać.
}else{$npc['sell_count'] = "None";}
if(isset($npc['param']['shop_buyable'])){
## Wpisanie wszystkich przedmiotów, które można kupić.
$npc['buy_able'] = $npc['param']['shop_buyable'];
$npc['buy_able_array'] = explode(';',$npc['buy_able']);
$npc['buy_count'] = count($npc['buy_able_array']);
$c = 0;
while($npc['buy_able_array'][$c] != ""){
$npc['buy_able_array_positions'][$c] = explode(',',$npc['buy_able_array'][$c]);
$c++;
}
## Wyświetlenie informacji o tym, że nie ma żadnego przedmiotu który można kupić.
}else{$npc['buy_count'] = "None";}
## Wyświetlenie informacji o tym, że NPC ma włączony "module_shop", a nie posiada żadnego przedmiotu do kupienia lub sprzedaży.
if($npc['buy_count'] == "None" AND $npc['sell_count'] == "None"){
$npc['shop'] = "<br/>".$language[$lng]['error_none']."";
}else{
$npc['shop'] = '['.$npc['buy_count'].' b;s '.$npc['sell_count'].']';
}
}else{
## Wyświetlenie informacji o tym, że NPC ma wyłączony "module_shop".
$npc['shop'] = $language[$lng]['mod_off'];
}
## Wyświetlenie informacji o NPC (Nazwa, Skrypt, Ilość sprzedawanych;kupowanych rzeczy.
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.$language[$lng]['name'].': '.$npc['name'].'; '.$language[$lng]['script'].': '.$npc['script'].'; '.$npc['shop'].'</small></td></tr>';
## Wyświetlanie listy przedmiotów do kupienia i sprzedania.
$c = 0;
while($npc['sell_able_array_positions'][$c] != ""){
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td> * * * * * * * * * * * *- <small>';
$main_content .= print_r($npc['sell_able_array_positions'][$c],true);
$main_content .= ' [SELLABLE]</small></td></tr>';
$list['sell'][$npc['sell_able_array_positions'][$c][1]] = $npc['sell_able_array_positions'][$c][2];
$list['sell_npc'][$npc['sell_able_array_positions'][$c][1]] = $npc['name'];
$c++;
}
$c = 0;
while($npc['buy_able_array_positions'][$c] != ""){
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td> * * * * * * * * * * * *- <small>';
$main_content .= print_r($npc['buy_able_array_positions'][$c],true);
$main_content .= ' [BUYALBE]</small></td></tr>';
$list['buy'][$npc['buy_able_array_positions'][$c][1]] = $npc['buy_able_array_positions'][$c][2];
$list['buy_npc'][$npc['buy_able_array_positions'][$c][1]] = $npc['name'];
$c++;
}
$npc = null;
$b++;
}
foreach($list['buy'] as $id => $price){
if($list['buy'][$id] < $list['sell'][$id] AND $list['buy'][$id] != 0){
change_c($back_g,$bgcolor);
$errors_items .= '<tr BGCOLOR="'.$bgcolor.'"><td>'.sprintf($language[$lng]['error'],$id,$list['buy_npc'][$id],$list['buy'][$id],$list['sell_npc'][$id],$list['sell'][$id]).'</td></tr>';
}
}
$main_content .= '</table><br/><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>[NEW] XML Results</B></TD></TR>';
if(!empty($errors_items)){
$main_content .= $errors_items;
}else{
$main_content .= $language[$lng]['no_erros'];
}
$main_content .= '</table><br/><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>[NEW] Lua Results</B></TD></TR>';
## LUA LOOKUP
$item = "";
$a = 0;
$b = 0;
$c = 0;
while(is_file($scdost.'\\scripts\\'.$scripts[$a])){
$content = file($scdost.'\\scripts\\'.$scripts[$a]);
foreach($content as $data)
{
if(preg_match("/shopModule:addBuyableItem\(/",$data) == true){
$item['buy']['addBuyableItem'][] = preg_replace("/shopModule:addBuyableItem({'(.*)'}, (.*), (.*), '(.*)')/i", "$1.$2.$3", $data).', '.$scripts[$a];
$lua_testing .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['added'],'addBuyableItem').'</small></td></tr>';
$found = '<font color="green">[V]</font>';
}
if(preg_match("/shopModule:addSellableItem\(/",$data) == true){
$item['sell']['addSellableItem'][] = preg_replace("/shopModule:addSellableItem({'(.*)', '(.*)'}, (.*), (.*), '(.*)')/i", "$1.$2.$3.$4.$5", $data).', '.$scripts[$a];
$lua_testing .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['added'],'addSellableItem').'</small></td></tr>';
$found = '<font color="green">[V]</font>';
}
if(preg_match("/shopModule:addBuyableItemContainer\(/",$data) == true){
$item['buy']['addBuyableItemContainer'][] = preg_replace("/shopModule:addBuyableItemContainer({'(.*)'}, (.*), (.*), (.*), '(.*)')/i", "$1", $data).', '.$scripts[$a];
$data .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['added'],'addBuyableItemContainer').'</small></td></tr>';
$found = '<font color="green">[V]</font>';
}
change_c($back_g,$bgcolor);
$a++;
$lua_testing .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>[FILE: '.$a.'][ROW: '.$b.']'.$found.' '.$data.'</small></td></tr>';
$a--;
$found = "";
$b++;
$c++;
}
$a++;
$b = 0;
}
$count['addBuyableItem'] = count($item['buy']['addBuyableItem']);
$count['addSellableItem'] = count($item['sell']['addSellableItem']);
$count['addBuyableItemContainer'] = count($item['buy']['addBuyableItemContainer']);
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['iit'],$count['addBuyableItem'],'addBuyableItem').'</small></td></tr>';
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['iit'],$count['addSellableItem'],'addSellableItem').'</small></td></tr>';
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['iit'],$count['addBuyableItemContainer'],'addBuyableItemContainer').'</small></td></tr>';
change_c($back_g,$bgcolor);
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td><small>'.sprintf($language[$lng]['checked'],$c).'</small></td></tr>';
// Czas na ścięcie.
$list = "";
foreach($item['buy']['addBuyableItem'] as $data){
//shopModule:addBuyableItem({'WYPOWIEDŹ'}, ID, CENA, 'NAZWA')
$step = explode(', ', $data);
$id = $step[1];
$cena = $step[2];
$npc = $step[5];
$list['buy'][$id] = $cena;
$list['buy_npc'][$id] = $npc;
}
foreach($item['sell']['addSellableItem'] as $data){
//shopModule:addSellableItem({'WYPOWIEDŹ', 'WYPOWIEDŹ'}, ID, CENA, 'NAZWA')
$step = explode(', ', $data);
$id = $step[2];
$cena = $step[3];
$npc = $step[5];
$list['sell'][$id] = $cena;
$list['sell_npc'][$id] = $npc;
}
foreach($item['buy']['addBuyableItemContainer'] as $data){
$step = explode(', ', $data);
$id = $step[2];
$cena = $step[3] / 20;
$npc = $step[6];
$list['buy'][$id] = $cena;
$list['buy_npc'][$id] = $npc;
}
$errors_items = '';
foreach($list['buy'] as $id => $price){
if($list['buy'][$id] < $list['sell'][$id] AND $list['buy'][$id] != 0){
change_c($back_g,$bgcolor);
$errors_items .= '<tr BGCOLOR="'.$bgcolor.'"><td>'.sprintf($language[$lng]['error'],$id,$list['buy_npc'][$id],$list['buy'][$id],$list['sell_npc'][$id],$list['sell'][$id]).'</td></tr>';
}
}
if(!empty($errors_items)){
$main_content .= $errors_items;
}else{
$main_content .= $language[$lng]['no_erros'];
}
$main_content .= '</table>';
## DO NOT DELETE FOOTER! // NIE USUWAĆ STOPKI!
$main_content .= '<p align="right"><small>Scripted by <b><a href="http://mayu11.webd.pl">MappingFOR</a> [<a href="http://otland.net/members/mappingfor/">OTLand Profile</a>]</b>. I <font size="5">♥</font> <a href="http://otland.net">OTLand.net</a></small></p>';
$main_content .= '<TABLE id="lua_report" BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=80% style="border: 1px solid black;margin: 0px auto;"><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=1 CLASS=white><B>[NEW] Lua raport</B></TD></TR>';
$main_content .= $lua_testing;
$main_content .= '</table>';
}
// END NPC CHECK
Last edited by a moderator: