PDA

View Full Version : Timer issues


Ozzara
01-24-2010, 10:27 PM
Is it possible to use summonitem(); inside a sub EVENT_TIMER routine based on a sub EVENT_ITEM routine? It just wont summon the item i want after the timer has expired.

Example:



sub EVENT_ITEM
{
if(($itemcount{16905} == 1) && ($itemcount{13006} == 1) && ($itemcount{12018} == 1) && ($platinum >= 80)) {

quest::say("Text goes here");
$theclienteid = $client->GetID(); #store client id
$thename = $name; #store client name
$theclient = $client; #store client
quest::settimer("1",10);

}


else {
plugin::return_items(\%itemcount);
quest::say("text goes here ");
}

}

sub EVENT_TIMER {

if ($timer eq "1") {
quest::say("text goes here $thename.");
quest::stoptimer("1");
$theclient->summonitem(5555,$theclienteid);
}

}

pfyon
01-24-2010, 10:33 PM
Pretty sure $theclient needs to be either declared such that it is accessible from EVENT_TIMER.

Ozzara
01-24-2010, 11:14 PM
This totally works if i use:


$theclient->CastSpell(26,$theclienteid);


But when i try to use:

$theclient->summonitem(5555,$theclienteid);


Everything works, except it never summons an item. So if the CastSpell is working would'nt that mean $theclient has been declared?

pfyon
01-24-2010, 11:57 PM
My mistake, I haven't done much work with perl yet.

The functions are case sensitive, it could be SummonItem() as opposed to summonitem().

trevius
01-24-2010, 11:57 PM
You are using the Quest Object wrong. See this wiki page for the full list:

http://www.eqemulator.net/wiki/wikka.php?wakka=QuestObjects


And here is the SummonItem() Object usages from that page:

SummonItem(item_id, charges= 0)

So, you are supposed to set charges in the second argument, not the client. You also have the S and I in lowercase, and Quest Objects are case sensitive and will not work if you don't use the correct case. I think this is probably how you would use it (though I have never tried it myself):

$theclient->SummonItem(5555, 1);

Ozzara
01-25-2010, 12:16 AM
It seems that while using Georges Tools, Quest Editor it changes my SummonItem to summonitem as soon as i step off the line of code.

I even tried quest::SummonItem(5555,1); again step of the line of code and it reverts it to summonitem(5555,1);

jkennedy
01-25-2010, 02:01 AM
just open your .pl file in ur quests folder and edit the quest to the uppercase version

GeorgeS
01-27-2010, 01:10 AM
I fixed the program to correct the case. Thanks for reporting it.

ver 1.2.4

GeorgeS