Author Topic: Pack Tracker s/a  (Read 2774 times)

0 Members and 1 Guest are viewing this topic.

Sinister

  • Uber Menace
  • *******
  • Posts: 1,125
  • Reputation: +0/-0
    • http://www.stormpages.com/snowmann69
Pack Tracker s/a
« on: August 4, 2004 10:54 pm CDT »
Hey T, can you re-write that pack tracker to work standalone?  Here is the original code if you need it.  It wont work properly when I'm at my job.  Doesn't give me any syntax errors, but when someone says blahblahblah "my pack" it doesn't track it for them like it does when included in the bot script.



// Pack Tracker
%packreceived = Match::String(%msg, "[li] * \"*\"");
if (%packreceived) {
%packzone = Match::Result(0);
%packperson = Match::Result(1);
%packmsg = Match::Result(2);

if (String::FindSubStr(%packmsg, " my pack") != -1) {
remoteEval(2048, fetchData, "zonedesc");
say(0, "#trackpack " @ %packperson);
$LookinForPack = "1";
schedule("$LookinForPack = \"\";", 3);
} // end if

} // end if


%nopack = Match::String(%msg, "* doesn't have any dropped backpacks.");
if (%nopack && $LookinForPack == "1") {
%nopackperson = Match::Result(0);
say(0, "#tell " @ %nopackperson @ ", Sorry, but someone must have picked up your pack. It is gone.");
$LookinForPack = "";
} // end if

%gotpack = Match::String(%msg, "*'s nearest backpack is * of here, * meters away.");
if (%gotpack && $LookinForPack == "1") {
%gotpackperson = Match::Result(0);
%direction = Match::Result(1);
%distance = Match::Result(2);
%town = $RPGdata[zonedesc];
say(0, "#tell " @ %gotpackperson @ ", I am tracking one of your packs! It is " @ %distance @ " meters " @ %direction @ " of where I am (" @ %town @ "). Good luck.");
$LookinForPack = "";
} // end if



// End Pack Tracker
« Last Edit: December 31, 1969 06:00 pm CST by Sinister »

Lidge Farkley

  • Uber Menace
  • *******
  • Posts: 1,357
  • Reputation: +2/-3
    • http://www.angelfire.com/ca2/psychosworld2/
(No subject)
« Reply #1 on: August 5, 2004 01:30 am CDT »
hmm.... do you want this to work from yourself for everyone else?

//just trying to figure any extra info out for the person taking the task.
:-D
« Last Edit: December 31, 1969 06:00 pm CST by Lidge Farkley »
Lend your heart unto the divine mineral TOPAZ;
from which our reverent hearts and minds sprang.
Also Known As:  Alcoholic 007
My Page of tribes Tools and Helpful "FAQ" Stuff

Sinister

  • Uber Menace
  • *******
  • Posts: 1,125
  • Reputation: +0/-0
    • http://www.stormpages.com/snowmann69
(No subject)
« Reply #2 on: August 7, 2004 10:46 am CDT »
You read this one yet Taurik?
« Last Edit: December 31, 1969 06:00 pm CST by Sinister »

Corona

  • Elvin Legion
  • *****
  • Posts: 486
  • Reputation: +6/-1
    • http://www.Linneberg.com
(No subject)
« Reply #3 on: August 7, 2004 01:10 pm CDT »
Sorry, I'm.......really lazy. :\

This should work, though I can't test it because the server is down.

It requires Presto. It also requires deus pack or my script pack for the "where I am" bit to work... if you can't get either of these, let me know and I'll edit it



// Pack Tracker (standalone)

event::Attach(eventClientMessage, PackMonitor);
function PackMonitor (%cl, %msg) {

%packreceived = Match::String(%msg, "[li] * \"*\"");
if (%packreceived) {
%packzone = Match::Result(0);
%packperson = Match::Result(1);
%packmsg = Match::Result(2);

if (String::FindSubStr(%packmsg, "my pack") != -1) {
remoteEval(2048, fetchData, "zonedesc");
say(0, "#trackpack " @ %packperson);
$LookinForPack = "1";
schedule("$LookinForPack = \"\";", 3);
} // end if

} // end if


%nopack = Match::String(%msg, "* doesn't have any dropped backpacks.");
if (%nopack && $LookinForPack == "1") {
%nopackperson = Match::Result(0);
say(0, "#tell " @ %nopackperson @ ", Sorry, but someone must have picked up your pack. It is gone.");
$LookinForPack = "";
} // end if

%gotpack = Match::String(%msg, "*'s nearest backpack is * of here, * meters away.");
if (%gotpack && $LookinForPack == "1") {
%gotpackperson = Match::Result(0);
%direction = Match::Result(1);
%distance = Match::Result(2);
%town = $RPGdata[zonedesc];
say(0, "#tell " @ %gotpackperson @ ", I am tracking one of your packs! It is " @ %distance @ " meters " @ %direction @ " of where I am (" @ %town @ "). Good luck.");
$LookinForPack = "";
} // end if

} // End PackMonitor

// End Pack Tracker
« Last Edit: December 31, 1969 06:00 pm CST by Corona »

Sinister

  • Uber Menace
  • *******
  • Posts: 1,125
  • Reputation: +0/-0
    • http://www.stormpages.com/snowmann69
(No subject)
« Reply #4 on: August 7, 2004 01:50 pm CDT »
works like a charm.  Thanks.  Time to update my website.  I like having all these stand alone scripts.  Kinda nice that way.
« Last Edit: December 31, 1969 06:00 pm CST by Sinister »

Sinister

  • Uber Menace
  • *******
  • Posts: 1,125
  • Reputation: +0/-0
    • http://www.stormpages.com/snowmann69
(No subject)
« Reply #5 on: August 9, 2004 07:33 pm CDT »
Kinda funny on this one too.  Now that Particle made changes to the server to take care of the thieving issues, this script is half-a$$ working.  It will pick up the part about "my pack" and then it will say they dont have any dropped packs or that they do, but it wont respond about 50% of the time.  Do you think this is because of the recent lag attacking the server?  That's kinda what I'm guessing, and if so, how can i make the script change to compensate for the lag.
« Last Edit: December 31, 1969 06:00 pm CST by Sinister »