Page 1 of 1

Recall when stuck instead of logging out

Posted: Thu Nov 18, 2010 8:00 pm
by checkii
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.

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;
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

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;
Is this a good idea? would this work?

Re: Recall when stuck instead of logging out

Posted: Thu Nov 18, 2010 11:03 pm
by rock5
The major problem with this is recall may still be on cooldown. What will it do then?

Also it only seems useful for people who only ever run 1 waypoint file, although there is probably a few people out there like that.

Still... doesn't seem like it would be too difficult to add. Why don't you try it and see how well it works and how useful it seems.

Re: Recall when stuck instead of logging out

Posted: Sun Nov 21, 2010 2:47 pm
by checkii
Yeah i was thinking about that, is there no way to check for CD on a spell?

Re: Recall when stuck instead of logging out

Posted: Sun Nov 21, 2010 3:48 pm
by jduartedj
checkii wrote:Yeah i was thinking about that, is there no way to check for CD on a spell?
You can include it on the SKILLS file and make it have a Cooldown, Then when you use it use as a skill!

Re: Recall when stuck instead of logging out

Posted: Tue Nov 23, 2010 8:39 pm
by Alkaiser
Shouldn't the cooldown be stored in client memory somewhere? Is it just a matter of finding the pointer for it? Or was it deemed unreliable?

Re: Recall when stuck instead of logging out

Posted: Tue Nov 23, 2010 9:14 pm
by jduartedj
Alkaiser wrote:Shouldn't the cooldown be stored in client memory somewhere? Is it just a matter of finding the pointer for it? Or was it deemed unreliable?
It's not like it makes a big diff for the bot to count the cooldown him self...

Re: Recall when stuck instead of logging out

Posted: Tue Nov 23, 2010 10:29 pm
by Alkaiser
jduartedj wrote:It's not like it makes a big diff for the bot to count the cooldown him self...
Sometimes a skill won't fire properly and the bot doesn't consider this. As a result, it won't use the skill again until it thinks it is cooled down, even though the skill was ready to use the whole time due to miscast. I've seen this happen specifically with Enhanced Armor and Holy Seal. To resolve this problem I added code to the <onSkillCast> block to always use those skills if the respective buff isn't already active.

Re: Recall when stuck instead of logging out

Posted: Wed Nov 24, 2010 7:37 am
by rock5
Alkaiser wrote:Shouldn't the cooldown be stored in client memory somewhere? Is it just a matter of finding the pointer for it? Or was it deemed unreliable?
Well yes. Voidmain was working on using the memory for skills but he never finished it. It would have been cool.