Page 1 of 1

SVN 96: new rest function

Posted: Mon Jul 27, 2009 5:42 am
by d003232
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!!!

Re: SVN 96: new rest function

Posted: Mon Jul 27, 2009 7:28 am
by marcspc
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

Re: SVN 96: new rest function

Posted: Mon Jul 27, 2009 7:39 am
by d003232
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;

Re: SVN 96: new rest function

Posted: Mon Jul 27, 2009 9:45 am
by marcspc
im doing something wrong, my svn doesnt update unless i delete the red ! file before, there isnt some way for update all?

Re: SVN 96: new rest function

Posted: Mon Jul 27, 2009 9:48 am
by d003232
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 !!!