UI & Macro Discussions Talk about User Interface upgrades and World of Warcraft Macros here.[Questions allowed here]
07-22-2009
Corporal
Join Date: Oct 2008
Posts: 32
Reputation: 16
Level up: 8%, 460 Points needed
[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 [Only registered and activated users can see links. ]
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:
[Only registered and activated users can see links. ] )
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 07:20 AM .
Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx.
07-23-2009
Master Sergeant
Join Date: Feb 2007
Location: Under your bed.
Posts: 83
Reputation: 5
Level up: 25%, 376 Points needed
Thanks very much. Rare hunting will take up my vast amount of spare time.
07-24-2009
New User
Join Date: Mar 2009
Posts: 23
Reputation: 1
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 05:12 AM .
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -4. The time now is 07:32 PM .