SVN 96: new rest function

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

SVN 96: new rest function

#1 Post by d003232 » Mon Jul 27, 2009 5:42 am

New function to restore mana and healthpoints if under a certain level. This function could also be used, if you want to do a time based rest in a waypoint file, it will detect aggro while resting and fight back

Code: Select all

 player:rest( _restfix,[ _restrnd[, time|full[, _restaddrnd]]])
_restfix ( base time to rest in sec)
_restrnd ( max random addition to basetime in sec)
_resttype ( time | full ) time = rest the given time / full = stop resting after being full / default = time
_restaddrnd ( max random addition after being full in sec)

If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the new options:

Code: Select all

<option name="HP_REST" value="15" />
<option name="MP_REST" value="15" />
Default value if not defined is 15% both.

e.g.
player:rest(20) will rest for 20 seconds.
player:rest(60, 20) will rest between 60 and 80 seconds.
player:rest(90, 40, "full") will rest up to between 90 and 130 seconds, and stop resting if being full
player:rest(20, 40, "full, 20") will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds

To look not so bottish, please use the random time options!!!
The RoM Bot Online Wiki needs your help!

marcspc
Posts: 2
Joined: Mon Jul 27, 2009 7:27 am

Re: SVN 96: new rest function

#2 Post by marcspc » Mon Jul 27, 2009 7:28 am

already made the svn update, but i dont know where to place the lines for make it work, in the profile doesnt seem to work

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: SVN 96: new rest function

#3 Post by d003232 » Mon Jul 27, 2009 7:39 am

marcspc wrote:already made the svn update, but i dont know where to place the lines for make it work, in the profile doesnt seem to work
Just insert

Code: Select all

<option name="HP_REST" value="15" />
<option name="MP_REST" value="15" />
into your *charname*.xml file. And change the values if you like. If you don't have that lines in your profile, it should also work, because the default values for resting are 15% anyway.

If you want to check, if your SVN update was ok, pls check bot.lua line 246-250 for the lines:

Code: Select all

		-- rest after getting new target and before starting fight
		-- rest for 50 sec + rnd(39), at most until full, after that additional rnd(10)
		if( player:haveTarget() ) then	
			player:rest( 50, 39, "full", 10 );			-- rest befor next fight
		end;
The RoM Bot Online Wiki needs your help!

marcspc
Posts: 2
Joined: Mon Jul 27, 2009 7:27 am

Re: SVN 96: new rest function

#4 Post by marcspc » Mon Jul 27, 2009 9:45 am

im doing something wrong, my svn doesnt update unless i delete the red ! file before, there isnt some way for update all?

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: SVN 96: new rest function

#5 Post by d003232 » Mon Jul 27, 2009 9:48 am

marcspc wrote:im doing something wrong, my svn doesnt update unless i delete the red ! file before, there isnt some way for update all?
If you don't have any modifications. Just delete all files & folders in your '/rom/' bot script folder and do an update. Then everything will be new loaded. And save before your waypoints & profiles !!!
The RoM Bot Online Wiki needs your help!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest