replacement?
replacement?
hey im looking for a replacement for yrest(); and player:rest(); i want my bot to wait after each waypoint but remain to attack, not just defend itself if nessecary. any solutions?
Re: replacement?
player:restrnd([probability [, minrest [, maxrest]]]);
e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that.
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: replacement?
i want it to not just attack if attacked, but to attack if the enemy is within range.The bot will fight back if attacked while resting and continue after that.
Re: replacement?
So you want it kill mobs at a waypoint for a period of time before moving on? That should be easy enough but making sure you don't go astray will be a bit more tricky. The best way is to make a function that looks for and kills mobs that are within a certain distance from the waypoint.
Put this in the onload section of your waypoint (or make a userfunction out of it so that you can use it in more than one file). Then call it at the waypoints where you want it to wait and kill for awhile.
Eg.Will kill mobs for 30 seconds then move to next waypoint. It will only target mobs that are within "MAX_TARGET_DIST" from the waypoint and if it doesn't detect a mob, it will move back to the waypoint if farther than 100. I'm not sure if you wanted it to do that but I'm not sure how else to make sure it doesn't go too far.
Warning: This is untested.
Code: Select all
function KillMobsFor(_seconds)
-- Where you started
local currentwp= CWaypoint( player.X, player.Z)
local mob
local starttime = os.clock()
repeat
mob = player:findEnemy(nil,nil,evalTargetDefault)
if mob and settings.profile.options.MAX_TARGET_DIST > distance(mob.X,mob.Z,currentwp.X,currentwp.Z) then
player:target(mob)
player:update()
player:fight()
else
-- No mob found. Move back to wp if necessary.
if distance(player.X,player.Z,currentwp.X,currentwp.Z) > 100 then
player:moveTo(currentwp)
end
end
yrest(1000)
player:update()
until os.clock() - starttime > _seconds
end
Eg.
Code: Select all
KillMobsFor(30)
Warning: This is untested.
- 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
Re: replacement?
thanks rock5, pretty much what i wanted ill see if i can tweak it and put it to use. 

Who is online
Users browsing this forum: Google [Bot] and 1 guest