[Cartographer] [PHP] Rare NPC LUA list maker menu

User Tag List

Results 1 to 3 of 3
  1. #1
    rimalah's Avatar Active Member
    Reputation
    16
    Join Date
    Oct 2008
    Posts
    75
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Cartographer] [PHP] Rare NPC LUA list maker


    Ahoy!

    Even though there is "a few" addons for tracking rare mobs, I decided to write one more.

    Following program will generate a LUA-list of all rare mobs, who drops Abandoned Adventurer's Satchel (so basically almost every Northrend Rare NPC) so you can see those farming areas better without alt-tabbing. This file is for Cartographer. The data will be gathered from wowhead, so whenever you create a list, it's automatically up-to-date.

    I was planning to use Routes with this, but need to check if that's possible.

    Here is pre-generated list pastebin - collaborative debugging tool
    and here is the code for later development if needed.


    Code:
    <?
    header('Content-type: text/css');
    
    echo "\nCartographerDB = {\n\t" . '["namespaces"] = {'. "\n\t\t" . '["Notes"] = {' . "\n\t\t\t";
    echo '["account"] = {' . "\n\t\t\t\t" . '["pois"] = {' ."\n\t\t\t\t\t" . '["version"] = 3,' ."\n";
    
    	
    	EnterZone("Borean Tundra");	NPCScan(32357); NPCScan(32361); NPCScan(32358); LeaveZone();
    	EnterZone("Dragonblight");	NPCScan(32409); NPCScan(32417); NPCScan(32400);	LeaveZone();
    	EnterZone("Grizzly Hills");	NPCScan(32438);	NPCScan(32429);	NPCScan(32422);	LeaveZone();
    	EnterZone("Howling Fjord");	NPCScan(32377);	NPCScan(32386);	NPCScan(32398);	LeaveZone();
    	EnterZone("Icecrown");		NPCScan(32501);	NPCScan(32495);	NPCScan(32487);	LeaveZone();
    	EnterZone("Sholazar Basin");	NPCScan(32517);	NPCScan(32485);	NPCScan(32481);	LeaveZone();
    	EnterZone("The Storm Peaks");	NPCScan(32491);	NPCScan(32500);	NPCScan(32630);	LeaveZone();
    	EnterZone("Zul'Drak");		NPCScan(33776);	NPCScan(32471);	NPCScan(32447);	NPCScan(32475); LeaveZone();
    
    function EnterZone($zone) { echo "\t\t\t\t\t" . '["' . $zone . '"] = {' ."\n"; }
    function LeaveZone() { echo "\t\t\t\t\t},\n"; }
    function NPCScan($npcid)
    {
    	$whurl = 	"http://www.wowhead.com/?npc=";
    	$surl = 	$whurl . $npcid;
            $lines =	file($surl);
    	$npcname = 	trim(strip_tags($lines[87]));
    	if ( substr($npcname,0,5) == "Loque" ) { $npcname = "Loque'nahak"; }
    	$sanat =	split(" ", $lines[89]);
    	$remove =	array("[","]","{","}",");","0:");
    	$coords =	str_replace($remove,"",$sanat[12]);
    	$c =		explode(",",$coords);
    
    	for ( $a=0; $a <= count($c)/2-1; $a++ )
    	{
    		$carto = $c[$a*2] * 100 + $c[$a*2+1] * 1000100;
    		echo "\t\t\t\t\t\t[" . $carto . "] = {\n";
    		echo "\t\t\t\t\t\t\t" . '["title"] = "'. $npcname . '",' . "\n";
    		echo "\t\t\t\t\t\t\t" . '["icon"] = "TrackAuctioneer",' . "\n";
    		echo "\t\t\t\t\t\t\t" . '["creator"] = "MMOwned",' . "\n\t\t\t\t\t\t},\n";
    	}
    }
    
    
    echo "\t\t\t\t" . '},' . "\n\t\t\t" . '},' . "\n\t\t" . '},' . "\n\t\t" . '["LookNFeel"] = {' ."\n\t\t\t" . '["profiles"] = {';
    echo "\n\t\t\t\t" . '["Default"] = {' . "\n\t\t\t\t\t" . '["scale"] = 0.65,' ."\n\t\t\t\t\t" . '["alpha"] = 0.6000000000000001,';
    echo "\n\t\t\t\t\t" . '["x"] = -253.6362390107879,' . "\n\t\t\t\t\t" . '["y"] = 161.9187638547222,' . "\n\t\t\t\t" . '},';
    echo "\n\t\t\t" . '},' . "\n\t\t" . '},' . "\n\t" . '},' . "\n\t" . '["account"] = {' ."\n\t\t" . '["firstTimeWoW21"] = true,';
    echo "\n\t},\n}";
    
    ?>
    Usage: Copy/Generate the list, and save it as /WTF/Account/ACCOUNTNAME/SavedVariables/Cartographer.lua

    Note: If you fancy trying this, then please make a backup from your current Cartographer.lua, since this file is supposed to overwrite your current file.


    Added outland rares:
    (pre-generated list with them: http://pastebin.com/f33d3d060 )
    Code:
    <?
    header('Content-type: text/css');
    
    echo "\nCartographerDB = {\n\t" . '["namespaces"] = {'. "\n\t\t" . '["Notes"] = {' . "\n\t\t\t";
    echo '["account"] = {' . "\n\t\t\t\t" . '["pois"] = {' ."\n\t\t\t\t\t" . '["version"] = 3,' ."\n";
    
    	
    	EnterZone("Borean Tundra");		NPCScan(32357); NPCScan(32361); NPCScan(32358); LeaveZone();
    	EnterZone("Dragonblight");		NPCScan(32409); NPCScan(32417); NPCScan(32400);	LeaveZone();
    	EnterZone("Grizzly Hills");		NPCScan(32438);	NPCScan(32429);	NPCScan(32422);	LeaveZone();
    	EnterZone("Howling Fjord");		NPCScan(32377);	NPCScan(32386);	NPCScan(32398);	LeaveZone();
    	EnterZone("Icecrown");			NPCScan(32501);	NPCScan(32495);	NPCScan(32487);	LeaveZone();
    	EnterZone("Sholazar Basin");		NPCScan(32517);	NPCScan(32485);	NPCScan(32481);	LeaveZone();
    	EnterZone("The Storm Peaks");		NPCScan(32491);	NPCScan(32500);	NPCScan(32630);	LeaveZone();
    	EnterZone("Zul'Drak");			NPCScan(33776);	NPCScan(32471);	NPCScan(32447);	NPCScan(32475); LeaveZone();
    
    	EnterZone("Blade's Edge Mountains");	NPCScan(18692); NPCScan(18690); NPCScan(18693); LeaveZone();
    	EnterZone("Hellfire Peninsula");	NPCScan(18678); NPCScan(18677); NPCScan(18679); LeaveZone();
    	EnterZone("Nagrand");			NPCScan(18684); NPCScan(17144); NPCScan(18683); LeaveZone();
    	EnterZone("Netherstorm");		NPCScan(18697); NPCScan(18698); NPCScan(20932); LeaveZone();
    	EnterZone("Shadowmoon Valley");		NPCScan(18695); NPCScan(18694); NPCScan(18696); LeaveZone();
    	EnterZone("Terokkar Forest");		NPCScan(18689); NPCScan(18686); NPCScan(18685); LeaveZone();
    	EnterZone("Zangarmarsh");		NPCScan(18682); NPCScan(18681); NPCScan(18680); LeaveZone();
    
    function EnterZone($zone) { echo "\t\t\t\t\t" . '["' . $zone . '"] = {' ."\n"; }
    function LeaveZone() { echo "\t\t\t\t\t},\n"; }
    function NPCScan($npcid)
    {
    	$whurl = 	"http://www.wowhead.com/?npc=";
    	$surl = 	$whurl . $npcid;
            $lines =	file($surl);
    	$npcname = 	trim(strip_tags($lines[87]));
    
    	if ( substr($npcname,0,5) == "Loque" ) { $npcname = "Loque'nahak"; }
    	if ( substr($npcname,0,5) == "Ambas" ) { $npcname = "Ambassador Jerrikar"; }
    	if ( substr($npcname,0,5) == "Vorak" ) { $npcname = "Vorakem Doomspeaker"; }
    
    	$sanat =	split(" ", $lines[89]);
    	$remove =	array("[","]","{","}",");","0:");
    	$coords =	str_replace($remove,"",$sanat[12]);
    	$c =		explode(",",$coords);
    
    	for ( $a=0; $a <= count($c)/2-1; $a++ )
    	{
    		$carto = $c[$a*2] * 100 + $c[$a*2+1] * 1000100;
    		echo "\t\t\t\t\t\t[" . $carto . "] = {\n";
    		echo "\t\t\t\t\t\t\t" . '["title"] = "'. $npcname . '",' . "\n";
    		echo "\t\t\t\t\t\t\t" . '["icon"] = "TrackAuctioneer",' . "\n";
    		echo "\t\t\t\t\t\t\t" . '["creator"] = "MMOwned",' . "\n\t\t\t\t\t\t},\n";
    	}
    }
    
    
    echo "\t\t\t\t" . '},' . "\n\t\t\t" . '},' . "\n\t\t" . '},' . "\n\t\t" . '["LookNFeel"] = {' ."\n\t\t\t" . '["profiles"] = {';
    echo "\n\t\t\t\t" . '["Default"] = {' . "\n\t\t\t\t\t" . '["scale"] = 0.65,' ."\n\t\t\t\t\t" . '["alpha"] = 0.6000000000000001,';
    echo "\n\t\t\t\t\t" . '["x"] = -253.6362390107879,' . "\n\t\t\t\t\t" . '["y"] = 161.9187638547222,' . "\n\t\t\t\t" . '},';
    echo "\n\t\t\t" . '},' . "\n\t\t" . '},' . "\n\t" . '},' . "\n\t" . '["account"] = {' ."\n\t\t" . '["firstTimeWoW21"] = true,';
    echo "\n\t},\n}";
    
    ?>
    Last edited by rimalah; 07-22-2009 at 05:20 AM.

    [Cartographer] [PHP] Rare NPC LUA list maker
  2. #2
    Gili's Avatar Member
    Reputation
    5
    Join Date
    Feb 2007
    Posts
    79
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks very much. Rare hunting will take up my vast amount of spare time.


  3. #3
    gr3ger's Avatar Member
    Reputation
    1
    Join Date
    Mar 2009
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot for this one mate
    I'll check it out as soon as I get off work.

    Edit:
    Worked like a charm, got a rare 5min after I installed it
    Thanks a lot mate! +rep for this one.
    One thing to help the others is to pick the "download" button in the link that's supplied to download the entire textfile and name it Cartographer.lua.
    I didn't get it to work by copy-pasting.
    Last edited by gr3ger; 07-25-2009 at 03:12 AM.

Similar Threads

  1. [Cartographer] [PHP] Rare NPC LUA list maker
    By rimalah in forum World of Warcraft Bots and Programs
    Replies: 1
    Last Post: 07-22-2009, 11:31 PM
  2. [Release]Instant 70 Npc Lua
    By Noobcraft in forum WoW EMU General Releases
    Replies: 27
    Last Post: 09-08-2008, 11:28 PM
  3. Teleporter NPC LUA
    By Performer in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 08-21-2008, 08:04 AM
  4. [Release] Info NPC -- LUA
    By Babbaa in forum WoW EMU General Releases
    Replies: 6
    Last Post: 08-17-2008, 02:29 PM
  5. Will this teleporter npc lua script work?
    By Bapes in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 05-22-2008, 11:50 AM
All times are GMT -5. The time now is 07:56 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search