Page 1 of 1
Bug or not a bug
Posted: Thu Jan 31, 2013 8:17 am
by BlubBlab
I don't know if this 2 lines are a bug in the bot.lua or be intended this way:
Code: Select all
if( type(settings.profile.events.onUnstickFailure) == "function" ) and
player.Unstick_counter == settings.profile.options.MAX_UNSTICK_TRIALS + 1 then --this Line
pcall(settings.profile.events.onUnstickFailure);
should be
Code: Select all
if( type(settings.profile.events.onUnstickFailure) == "function" ) and
player.Unstick_counter >= settings.profile.options.MAX_UNSTICK_TRIALS + 1 then --this line
pcall(settings.profile.events.onUnstickFailure);
Because under very rare circumstances player.Unstick_counter can be bigger then settings.profile.options.MAX_UNSTICK_TRIALS + 1 , had that 2 times, my bot was running mad.
the other is:
Code: Select all
-- if next waypoint is 'in front' of current waypoint
if( math.deg(angleDif) > settings.profile.options.WAYPOINT_PASS_DEGR ) then -- default 90
if (settings.profile.options.DEBUG_WAYPOINT) then
cprintf(cli.yellow, "[DEBUG] We overrun waypoint #%d, skip it and move on to #%d\n",currentWp.wpnum, nextWp.wpnum);
end
I got irritating by reading this the Debug message says you want to skip the WP in front, i'm not sure what is right 0 or 90 degree for is "front", but that means anyway you are not skip a quarter but all of the rest. if 90 degree is in front of you, it won't skip it because it must be then" angleDif) >= settings.profile.options.WAYPOINT_PASS_DEGR" for that.
Re: Bug or not a bug
Posted: Thu Jan 31, 2013 8:55 am
by rock5
The first is done, but I used
Code: Select all
player.Unstick_counter > settings.profile.options.MAX_UNSTICK_TRIALS then
removing the '+ 1'. Seemed logical.
The second thing, I didn't quite follow you. Are you saying you don't understand it or you think something is wrong or you want to get rid of one of the duplicated messages?
Re: Bug or not a bug
Posted: Thu Jan 31, 2013 10:11 am
by BlubBlab
rock5 wrote:The first is done, but I used
Code: Select all
player.Unstick_counter > settings.profile.options.MAX_UNSTICK_TRIALS then
removing the '+ 1'. Seemed logical.
The second thing, I didn't quite follow you. Are you saying you don't understand it or you think something is wrong or you want to get rid of one of the duplicated messages?
First that wouldn't help every time because it happens when the bot reached a new Waypoint File and had already x fail tries, I changed the MAX_UNSTICK_TRIALS in the new File and than MAX_UNSTICK_TRIALS could be x-1, yes than it will work, but It could also x-2,x-3, x-n....., because of this the bot would not run the onUnstickFailure event.
The second thing I only assume to look over and may rethink again whether you really want to skip 3/4 of the unit circle and 1/4 not.
But I have a real problem can you test what these DEBUG Messages Print by(at) you?
Code: Select all
local lootIgnoreList = {};
local lootIgnoreListPos = 0;
function evalTargetLootable(address, target)
if not target or not target.HP then
target = CPawn.new(address)
end
-- Check if still valid target
if not target:exists() then
return false
end
-- Check if lootable
target:updateLootable()
if not ( target.Lootable ) then
return false;
end
cprintf(cli.yellow, "[DEBUG] Eval Lootignore pre seach.\n");
-- Check if in lootIgnoreList
for __, addr in pairs(lootIgnoreList) do
cprintf(cli.yellow, "[DEBUG] Eval Lootignore seach.\n");
if target.Address == addr then
cprintf(cli.yellow, "[DEBUG] Eval Lootignore found it.\n");
return false
end
end
?
Re: Bug or not a bug
Posted: Thu Jan 31, 2013 11:55 am
by rock5
Code: Select all
player.Unstick_counter > settings.profile.options.MAX_UNSTICK_TRIALS then
Is exactly the same as what you wrote
Code: Select all
player.Unstick_counter >= settings.profile.options.MAX_UNSTICK_TRIALS + 1 then
just a bit shorter.
BlubBlab wrote:The second thing I only assume to look over and may rethink again whether you really want to skip 3/4 of the unit circle and 1/4 not.
Maybe you don't understand what 'angleDif' is. It's the angle between the player and the next wp and the player and the waypoint after that. Here's a diagram.
If the player ends a fight at position A then the angle from the player between the next waypoint and the one after that will be less than 90 so it will still go to the 'next WP'. If the player ends up at position B then the angle will be more than 90 so it will skip the 'next WP' and head to the 'next WP +1'. I hope that clears it up.
BlubBlab wrote:But I have a real problem can you test what these DEBUG Messages Print by(at) you?
I'm not sure what you wanted me to do but I forced a failed loot, then when it killed something else it printed
Code: Select all
[DEBUG] Eval Lootignore pre seach.
[DEBUG] Eval Lootignore seach.
[DEBUG] Eval Lootignore found it.
Re: Bug or not a bug
Posted: Thu Jan 31, 2013 4:58 pm
by BlubBlab
thx