Getting stuck while fighting
Getting stuck while fighting
I've noticed a situation where the bot can get stuck and not be able to continue.
It's when you start a fight with a mob and it moves into a position where you are unable to attack it.
In this situation the mob will continuously attack you. After awhile the bot notices that it has stopped damaging the mob so it clears the target but immediately notices that it is in combat so waits for aggro. It then tries to attack the mob again starting the loop all over again.
At no point does the character move.
I think a simple fix for this is when the bot stops damaging the mob and clears the target, the first thing it should do is take a step or 2 forward before waiting for aggro again.
Or maybe, before clearing the target, it could try moving a bit to see if it is now able to damage the mob.
This has happened with at least 2 of my waypoint files so I hope it can be fixed.
It's when you start a fight with a mob and it moves into a position where you are unable to attack it.
In this situation the mob will continuously attack you. After awhile the bot notices that it has stopped damaging the mob so it clears the target but immediately notices that it is in combat so waits for aggro. It then tries to attack the mob again starting the loop all over again.
At no point does the character move.
I think a simple fix for this is when the bot stops damaging the mob and clears the target, the first thing it should do is take a step or 2 forward before waiting for aggro again.
Or maybe, before clearing the target, it could try moving a bit to see if it is now able to damage the mob.
This has happened with at least 2 of my waypoint files so I hope it can be fixed.
- 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
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Getting stuck while fighting
Open rom/classes/player.lua, go to (CTRL+G) line 404.
Directly under this line:
Add this:
Save and let me know if this fixes the problem or if it causes any other issues.
Directly under this line:
Code: Select all
self:clearTarget();
Code: Select all
self:unstick();
self:update();
Re: Getting stuck while fighting
Of the 4 times I tried it, it only worked 2 times. The 2 times it didn't work it still just stood there.
- 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: Getting stuck while fighting
Also, it should only do the unstick if in combat. But I've noticed that if you target a mob and can't attack it, but haven't attracted aggro yet, you still do the unstick move before continuing to the next waypoint.
- 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: Getting stuck while fighting
Is there a way to make bot use games own stuck report feature? It would be nice.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Getting stuck while fighting
You could change it to:
That should help some. I'm not sure what would cause it to 'not work'. You'll have to describe what you mean. Does it not move (ie. the unsticking isn't doing anything at all)? Is the player actually stuck and unable to move? Did it not move far enough to draw the monster out where it can be attacked? The more detail you give, the better.
Code: Select all
if( self.Battling ) then
yrest(1000);
self:unstick();
self:update();
yrest(500);
end
Re: Getting stuck while fighting
What I meant by 'not work' is it doesn't do the unstick. It clears the target, then waits for aggro without moving. I tried putting a print statement before it to see if it actually gets to that code. I didn't see the print statement so it never got to that code. Maybe there are certain circumstances where that code doesn't execute?Administrator wrote:You could change it to:That should help some. I'm not sure what would cause it to 'not work'. You'll have to describe what you mean. Does it not move (ie. the unsticking isn't doing anything at all)? Is the player actually stuck and unable to move? Did it not move far enough to draw the monster out where it can be attacked? The more detail you give, the better.Code: Select all
if( self.Battling ) then yrest(1000); self:unstick(); self:update(); yrest(500); end
I noticed there is another "Taking too long to damage target" loop around line 630. Maybe that's the one getting executed. What's the difference between the 2 loops?
As to whether the above code fixes unsticking when not in combat, I can't test that right now. Maybe tonight.
- 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: Getting stuck while fighting
I'm not sure what the difference is between the "Taking too long to damage target" loop in checkSkills and fight functions but I copied this code to both line 404 and around 630. Now it unsticks every time.Administrator wrote:You could change it to:That should help some. I'm not sure what would cause it to 'not work'. You'll have to describe what you mean. Does it not move (ie. the unsticking isn't doing anything at all)? Is the player actually stuck and unable to move? Did it not move far enough to draw the monster out where it can be attacked? The more detail you give, the better.Code: Select all
if( self.Battling ) then yrest(1000); self:unstick(); self:update(); yrest(500); end
I also tested to see if the "if self.battling" condition has stopped it from unsticking when not in battle. It has.
So it looks like that is all working. The only comment I would make is it moves too much.
When you are too close to the target it takes a couple of steps back. Is it possible to use that function instead?
I believe it is something along the lines of;
Code: Select all
keyboardHold( settings.hotkeys.MOVE_BACKWARD.key);
yrest(200);
keyboardRelease( settings.hotkeys.MOVE_BACKWARD.key);
- 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
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Getting stuck while fighting
I think that your character is moving forward again because it is attempting to use a melee skill (which causes your character to run towards the target with click-to-move turned on) or because the bot notices it is too far away from the target. Try resting for 1 second ( yrest(1000) should do the trick) after moving backwards. Let me know if you can get this to work sufficiently and I'll include it.
Re: Getting stuck while fighting
I added a 1 second pause after moving back and before the player:update(). It paused for 1 second after moving back but still moved forward. I even used a longer pause but it seems that before my priest castes any spells he moves forward first.Administrator wrote:I think that your character is moving forward again because it is attempting to use a melee skill (which causes your character to run towards the target with click-to-move turned on) or because the bot notices it is too far away from the target. Try resting for 1 second ( yrest(1000) should do the trick) after moving backwards. Let me know if you can get this to work sufficiently and I'll include it.
I think I figured it out. On closer inspection of the MM window I notice it's trying to loot after clearing the target. Looting uses the attack action correct?
That should give you something to follow up.
- 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
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Getting stuck while fighting
Try this. On line 840 of rom/classes/player.lua, you'll see this:
Change to:
Let me know how that works for you.
Code: Select all
if( settings.profile.options.LOOT == true and
Code: Select all
if( not break_fight and settings.profile.options.LOOT == true and
Re: Getting stuck while fighting
No change. Still looted.
I noticed, though, the only thing in that if statement was inventory:updateSlotsByTime(800);. How is not running this supposed to stop me looting?
I noticed, though, the only thing in that if statement was inventory:updateSlotsByTime(800);. How is not running this supposed to stop me looting?
- 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
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Getting stuck while fighting
My mistake. I posted that quite hastily. Look a few lines down and you'll have to wrap the loot call in an if statement.
Code: Select all
self:update();
if( not break_fight ) then
self:loot();
end
Re: Getting stuck while fighting
Ok, that works. So everything works now.Administrator wrote:My mistake. I posted that quite hastily. Look a few lines down and you'll have to wrap the loot call in an if statement.
Code: Select all
self:update(); if( not break_fight ) then self:loot(); end
So to summarize, I've added this code to around line 405 and 634;
Code: Select all
if( self.Battling ) then
yrest(1000);
keyboardHold( settings.hotkeys.MOVE_BACKWARD.key);
yrest(1000);
keyboardRelease( settings.hotkeys.MOVE_BACKWARD.key);
self:update();
end
And I've changed self:loot(); around line 863 to;
Code: Select all
if( not break_fight ) then
self:loot();
end
- 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
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Getting stuck while fighting
Ok, just committed this with r432. It should also resolve some more waypoint issues.
Re: Getting stuck while fighting
There were a couple of errors;Administrator wrote:OK, just committed this with r432. It should also resolve some more waypoint issues.
Line 858 of player.lua has an extra 'and';
Code: Select all
if( and settings.profile.options.LOOT == true and
Code: Select all
__RPL:setCurrentWaypoint __RPL:getNearestWaypoint(player.X, player.Z ) );
Obviously when starting the bot and loading the first waypoint file it's doing something different than when just using the loadPaths function. Hope you can resolve this because to start a waypoint file from the right place(l1t_start.xml for example) I have to move to waypoint 2 before starting it. It then goes to waypoint 1 then back to 2. If I don't do this it tries to take me to the last point first. LOL
- 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
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Getting stuck while fighting
Ok, I think I've finally got it all figured out. It should be working properly now. I've also removed setCurrentWaypoint (use setWaypointIndex() again).
Re: Getting stuck while fighting
Yep, tested all 3 and they seem to work.Administrator wrote:Ok, I think I've finally got it all figured out. It should be working properly now. I've also removed setCurrentWaypoint (use setWaypointIndex() again).
- Starting a new file goes to the nearest waypoint first.
- Loadpaths() takes you to the nearest waypoint.
- setWaypointIndex takes you to the correct waypoint.
Thanks for all your efforts.
- 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
Who is online
Users browsing this forum: No registered users and 10 guests