Recall when stuck instead of logging out
Posted: Thu Nov 18, 2010 8:00 pm
I am trying to get the bot to recall and get a return path way point once he gets stuck. Looking at bot.lua the current setting shows.
We will add two more settings and one spell to our profiles. May have to add recall to skill.xml or use RoMScript to cast the spell, but since everyone has recall it shouldn't be a problem. RECALL_WHEN_STUCK = true and PATH_AFTER_RECALL = back_to_work
Is this a good idea? would this work?
Code: Select all
-- Too many tries, logout
if( settings.profile.options.MAX_UNSTICK_TRIALS > 0 and
player.Unstick_counter > settings.profile.options.MAX_UNSTICK_TRIALS ) then
cprintf(cli.yellow, language[55],
player.Unstick_counter,
settings.profile.options.MAX_UNSTICK_TRIALS ); -- max unstick reached
if( settings.profile.options.LOGOUT_WHEN_STUCK ) then
player:logout();
else
-- pause or stop ?
player.Sleeping = true; -- go to sleep
--stopPE(); -- pause the bot
-- we should play a sound !
player.Unstick_counter = 0;
end
end;
Code: Select all
-- Too many tries, logout
if( settings.profile.options.MAX_UNSTICK_TRIALS > 0 and
player.Unstick_counter > settings.profile.options.MAX_UNSTICK_TRIALS ) then
cprintf(cli.yellow, language[55],
player.Unstick_counter,
settings.profile.options.MAX_UNSTICK_TRIALS ); -- max unstick reached
if( settings.profile.options.LOGOUT_WHEN_STUCK ) then
player:logout();
end
if( settings.profile.options.RECALL_WHEN_STUCK ) then
player:cast("RECALL:); -- may need yrest for loading or waitload function
loadPaths("settings.profile.options.PATH_AFTER_RECALL);
end
-- pause or stop ?
player.Sleeping = true; -- go to sleep
--stopPE(); -- pause the bot
-- we should play a sound !
player.Unstick_counter = 0;
end;