Page 1 of 1
Bug after rev448
Posted: Sun May 30, 2010 7:03 am
by Starrider
Hello, after the update of rev448 my bot wait's now after every fight for 85-93 seconds.
my HP Rest value:
<option name="HP_REST" value="20" />
<option name="MP_REST" value="20" />
also when it goes to the next waypoints it will pause until the HP is full
i also can not use rev 447, when i download it from
http://code.google.com/p/rom-bot/source/list
the I got this error message: scripts\rom\bot.lua:5: //micromacro.../classes/player.lua:4:unexpected symbol near "<"
Re: Bug after rev448
Posted: Sun May 30, 2010 9:40 am
by Administrator
Probably a bad update. Delete any bot.lua and the whole 'classes' folder, then run the update again.
Re: Bug after rev448
Posted: Sun May 30, 2010 1:40 pm
by Starrider
i still deleted all files and updated the complete bot with svn.
If I start the bot it begins with pause for xx seconds for manaregeneration, because it cast at the beginning enhanced armor an Holy Seal buff.
Then I had one fight and it paused for XX seconds for mana regeneration.
Update: I found another indicator. The bot paused directly after micromacro gives the massage stop waypoint, because another target has been found, then it paused for regeneration.
Re: Bug after rev448
Posted: Sun May 30, 2010 2:00 pm
by rock5
Now that I've updated to 448 I noticed this problem too.
It says "Resting up to nn to fill up mana and HP." even though my health and mana are 100 percent.
nn is always a big number about 50-90 but only rests for about 5 seconds
It always follows "Stopping waypoint: Target acquired" type message and before it starts to attack.
Re: Bug after rev448
Posted: Sun May 30, 2010 2:07 pm
by Starrider
i added manually this code from the documentation in the player.lua where it was before the release and it works again.
fast fix for all:
open player.lua
search for
Code: Select all
local hf_hp_rest = (player.MaxHP * settings.profile.options.HP_REST / 100); -- rest if HP is lower then
after add:
Code: Select all
if( player.Mana >= hf_mana_rest and player.HP >= hf_hp_rest and
_resttype == 'full' ) then -- nothing to do
return; --go back
end;
so the update rev448 is still buggy
Re: Bug after rev448
Posted: Sun May 30, 2010 2:55 pm
by rock5
Starrider wrote:i added manually this code from the documentation in the player.lua where it was before the release and it works again.
fast fix for all:
open player.lua
search for
Code: Select all
local hf_hp_rest = (player.MaxHP * settings.profile.options.HP_REST / 100); -- rest if HP is lower then
after add:
Code: Select all
if( player.Mana >= hf_mana_rest and player.HP >= hf_hp_rest and
_resttype == 'full' ) then -- nothing to do
return; --go back
end;
so the update rev448 is still buggy
Yep, this fix worked for me. Thanks.
Re: Bug after rev448
Posted: Sun May 30, 2010 9:46 pm
by Administrator
This should be fixed in r449. Revert the changes you've made (or just delete the file) and update again. Let me know how it works.
Re: Bug after rev448
Posted: Mon May 31, 2010 2:37 am
by rock5
Administrator wrote:This should be fixed in r449. Revert the changes you've made (or just delete the file) and update again. Let me know how it works.
Nope, still doesn't work. Does exactly the same thing.
Do you realize that you are assigning values to hf_mana_rest and hf_hp_rest but don't use them anywhere in your code?
Re: Bug after rev448
Posted: Mon May 31, 2010 3:32 am
by Administrator
The only change was to bot.lua. Specifically, this:
Code: Select all
if( player.Mana/player.MaxMana*100 >= settings.profile.options.MP_REST
and player.HP/player.MaxHP*100 >= settings.profile.options.HP_REST ) then
player:rest( 50, 99, "full", 10 ); -- rest befor next fight
end
Don't know how I messed that up, but the '>'s should be '<'. Try that.
Re: Bug after rev448
Posted: Mon May 31, 2010 3:49 am
by rock5
Administrator wrote:The only change was to bot.lua. Specifically, this:
Code: Select all
if( player.Mana/player.MaxMana*100 >= settings.profile.options.MP_REST
and player.HP/player.MaxHP*100 >= settings.profile.options.HP_REST ) then
player:rest( 50, 99, "full", 10 ); -- rest befor next fight
end
Don't know how I messed that up, but the '>'s should be '<'. Try that.
Seems to work correctly. I also changed the 'and' to an 'or' so the logic is correct.
The question remains, though, why do you assign values to 'hf_mana_rest' and 'hf_hp_rest' if you don't use them anywhere?
Re: Bug after rev448
Posted: Mon May 31, 2010 4:36 am
by Administrator
I've changed the code some more to prevent problems with dividing by zero.
Code: Select all
local manaRest, healthRest = false, false;
if( player.MaxMana > 0 ) then
manaRest = (player.Mana / player.MaxMana * 100) <= settings.profile.options.MP_REST;
end
healthRest = (player.HP / player.MaxHP * 100) <= settings.profile.options.HP_REST;
if( manaRest or healthRest ) then
player:rest( 50, 99, "full", 10 ); -- rest before next fight
end
I didn't even check if those variables were used. I had assumed they were used even if the "full" option wasn't given. I'm actually not sure why that code was in the rest function.
Re: Bug after rev448
Posted: Mon May 31, 2010 7:16 am
by Starrider
new version or where I have to change this code now?
Re: Bug after rev448
Posted: Mon May 31, 2010 8:19 am
by rock5
Starrider wrote:new version or where I have to change this code now?
I believe it hasn't been updated yet.
Find around line 464 of bot.lua
Code: Select all
if( player.Mana/player.MaxMana*100 >= settings.profile.options.MP_REST
and player.HP/player.MaxHP*100 >= settings.profile.options.HP_REST ) then
player:rest( 50, 99, "full", 10 ); -- rest befor next fight
end
Replace with
Code: Select all
local manaRest, healthRest = false, false;
if( player.MaxMana > 0 ) then
manaRest = (player.Mana / player.MaxMana * 100) <= settings.profile.options.MP_REST;
end
healthRest = (player.HP / player.MaxHP * 100) <= settings.profile.options.HP_REST;
if( manaRest or healthRest ) then
player:rest( 50, 99, "full", 10 ); -- rest before next fight
end
Re: Bug after rev448
Posted: Mon May 31, 2010 9:14 am
by Starrider
thx
Re: Bug after rev448
Posted: Mon May 31, 2010 9:45 am
by Administrator
Can you confirm this change to be working properly? Once you do, I'll commit the change.
Re: Bug after rev448
Posted: Mon May 31, 2010 9:47 am
by rock5
Administrator wrote:Can you confirm this change to be working properly? Once you do, I'll commit the change.
Yes, working for me.
Re: Bug after rev448
Posted: Mon May 31, 2010 2:16 pm
by Starrider
I can also confirm that this code works with the new player.lua for me