Page 1 of 1

Suggestion for stuck detection

Posted: Fri Feb 17, 2012 5:58 am
by romaniac
When the bot believes the char is stuck, it tries some evasive maneuvering to get it free. I recently observed some problems with this or let's say spotted some room for more intelligence. :-)

The bot seems to just track times without movement. In my case, the char was just stunned for a few seconds by a debuff. The bot misinterpreteded this as being stuck and tried to move sideways. As the character actually was right on track, this put it off and got it stuck for real - badly :-).

In other words, if the bot could detect the most common stun debuffs and not count them against the stuck timeout, it would perform much better in travelling enemy territory - and it would not give itself away as a bot.

maniac

Re: Suggestion for stuck detection

Posted: Fri Feb 17, 2012 6:12 am
by lisa
trouble is every "stun" has it's own name and Id. To work properly you would need to know every single Id or name.

Re: Suggestion for stuck detection

Posted: Fri Feb 17, 2012 6:41 am
by silinky
no need to get the names of all suns, we have a macro for that:

local debuff,_2,_3,_4,debuffType = UnitDebuff(thisunit, cnt)

debufftype is what we are looking for. these are thos that can restrict movement:

12 Immobilization
13 Stun
14 Special - not sure if this one restricts movements too
15 Fear

Code: Select all

local cnt = 1
	local debuff,_2,_3,_4,debuffType = UnitDebuff(thisunit, cnt)
	while debuff ~= nil do
		if (matchType == debuffType) then
			return true
		end
		cnt = cnt + 1
		debuff,_2,_3,_4,debuffType = UnitDebuff(thisunit, cnt)
	end
what this does, is making an array of all types of debuffs on you
i integrated this macro in my multiboxing addon, so that my priest and druid can dispel me whenever needed, no need to know the names of the debuffs.

suggestion: integrate this into the function that detects getting stuck, and if it finds the numbers 12-13-15 this means that your movement is screwed up, and this is no real stuckness.

hope this helps

Re: Suggestion for stuck detection

Posted: Fri Feb 17, 2012 10:21 am
by rock5
The problem with this is this is the sort of thing that needs to be checked continuously and RoMScripts are too slow for this. If it could be gotten from memory then it could be done. I had a quick look and it doesn't look like it is stored with the other buff info we already get from memory.

Re: Suggestion for stuck detection

Posted: Fri Feb 17, 2012 10:39 am
by lisa
rock5 wrote:I had a quick look and it doesn't look like it is stored with the other buff info we already get from memory.
I spent the last couple of hours looking at where we get buff info from memory and I can confirm the info for if rooted or not is not in that part of memory.

Going to post my findings incase they are useful at a later stage lol

0x4 -- String -- Name of what caused buff or debuff.
0x14 -- 07 and 08, couldn't get definitive conclusion on this 1 except to say it's always 00 when no buff or debuff and only had 07 and 08.
0x34 -- 00 has no timed effect --40 has a timed effect
0x38 -- float -- timer for the effects if 0x34 is 40
0x4A -- 80 buff or debuff is cast by player -- 00 not cast by player

Re: Suggestion for stuck detection

Posted: Fri Feb 17, 2012 11:53 am
by Alleexx
I have never really had any problems with stuns but what I have problem with is that, when I get lag (still moving but slow) the bot believes I'm stuck.
That sometimes look really suspicious but I don't know if there's a way to solve it.

Re: Suggestion for stuck detection

Posted: Fri Feb 17, 2012 9:19 pm
by lisa
We can get the ping value but the issue is that the info isn't a constant track of actual ping. It is a function that is called at intervals so when it says you have 5000ms that might have been 2 seconds ago and MM has already thought it was stuck.

I find most "stuns" only last a couple of seconds, especially after mob is dead which is only time it will try to move again.
Maybe have a a few seconds of leway after combat allowable before doing any unstuck?

So if just walking round then unstuck as usual but if just left combat and feels stuck then just pause a couple of seconds before trying to move again?

This won't help with lag but I can't think of a way to determine lag reliably at the moment.