Thread: Timer Problem
View Single Post
  #3  
Old 06-20-2009, 09:34 AM
Capheus
Hill Giant
 
Join Date: Apr 2008
Location: Milwaukee
Posts: 141
Default

Ok, trying to figure out what you are looking for. Here is another script that will allow you to use the client in sub EVENT_TIMER.

Code:
sub EVENT_SAY {

	if($text=~/hail/i) {
		
		quest::say("Would you like a [buff] or would you like to [goto] Crushbone?");
	}

	if($text=~/buff/i) {
		quest::say("Ok hold on while I get you the spell in my book.....");
		$theclienteid = $client->GetID();  #store client id
		$thename = $name;		   #store client name
		$theclient = $client;		   #store client
		quest::settimer("heal",10);
	}

	if($text=~/goto/i) {
		quest::say("Ok hold on while I find the right coordinates.....");
		quest::settimer("goto",10);
		$thename = $name;		   #store client name
		$theclient = $client;		   #store client
	}

}





sub EVENT_TIMER {

	if ($timer eq "heal") {
		quest::say("Found it! This should help $thename.");
		quest::stoptimer("heal");
		$theclient->CastSpell(26,$theclienteid); 	#casts skin like wood on self
	}
	
	if ($timer eq "goto") {
		quest::say("Off you go $thename!");
		quest::stoptimer("goto");
		$theclient->MovePC(58,143.4,-595.8,3.1,62.4);   #MovePC(zoneID, x, y, z, h)
	}
		
}
Reply With Quote