Load code after every kill

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
richi
Posts: 8
Joined: Tue Jan 24, 2012 1:30 pm

Load code after every kill

#1 Post by richi » Sat Mar 17, 2012 3:48 pm

Is it possible to stop attacking on a WP without going to the next waypoint place ?
For example:
The player fight on waypoint 4:
<!-- # 4 --><waypoint x="-27537" z="24353" y="-83"></waypoint>
and I want to go to waypoint 8 if the quest is completed, but I don't want to wait until the bot goes to waypoint 5
I want to load

Code: Select all

queststate = getQuestStatus(425509)
if queststate == "complete" then
	     __WPL:setWaypointIndex(__WPL:findWaypointTag("complete"));
end
after every killing mob
(sory for my English)

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Load code after every kill

#2 Post by lisa » Sat Mar 17, 2012 8:12 pm

in the WP onload add this.

Code: Select all

	settings.profile.events.onLeaveCombat = function()
		queststate = getQuestStatus(425509)
		if queststate == "complete" then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("complete"));
		end
	end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Load code after every kill

#3 Post by MiesterMan » Tue Mar 20, 2012 8:09 pm

lisa, can you hook it by doing something like this:

Code: Select all

   settings.profile.events.onLeaveCombat = function()
      settings.profile.events.onLeaveCombat()
      queststate = getQuestStatus(425509)
      if queststate == "complete" then
         __WPL:setWaypointIndex(__WPL:findWaypointTag("complete"));
      end
   end
??

Or is there some other way to do it (I'm not sure that's how you do the function call)?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Load code after every kill

#4 Post by rock5 » Wed Mar 21, 2012 12:07 am

The proper way to hook would be to do something like this.

Code: Select all

   if not originalonLeaveCombat then
      originalonLeaveCombat = settings.profile.events.onLeaveCombat 
   end
   settings.profile.events.onLeaveCombat = function()
      originalonLeaveCombat()
      queststate = getQuestStatus(425509)
      if queststate == "complete" then
         __WPL:setWaypointIndex(__WPL:findWaypointTag("complete"));
      end
   end
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest