Error while trying to use HP potion
Error while trying to use HP potion
rombot give this error when try to use hp potions. i have potions in both bags.
Re: Error while trying to use HP potion
Line numbers don't match up. Line 75 is
No deltatime there. So maybe you have a corrupt rombot installation. Try Lisas sig instructions.
Code: Select all
if not self.InUse then
Can't get bot to work? follow these instructions before posting, thank you.
1. SVN update micromacro/scripts/rom folder
2. SVN revert micromacro/scripts/rom folder
3. delete Runes of Magic/Interface/Addons/ingamefunctions folder
4. copy micromacro/scripts/rom/devtools/ingamefunctions folder to Runes of Magic/Interface/Addons folder
5. restart game
- 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
-
- Posts: 446
- Joined: Wed Aug 03, 2011 7:37 pm
Re: Error while trying to use HP potion
hmm...thats an interesting one...
the code starting from line 75 (in my version at least) is :
obviously the error is on line 76 (the next line) where it is calling deltaTime(getTime(), self.LastTimeUsed)....and the LastTimeUsed must be nil. Not sure how that is happening, but if it is the first time the item is used, then that could be causing the problem - but only if the item is flagged as InUse as specified on the first line:
So...did you manually use the potion while the bot was fighting? Or were you moving the item?
hmmm...after re-reading the code, I don't see how the LastTimeUsed value can ever be nil. It is set to 0 when the object is constructed and only ever changed in the CInventoryItem:use() function.
Does this happen every time? or was it a one-off occurrence?
the code starting from line 75 (in my version at least) is :
Code: Select all
if not self.InUse then
if ( self.CoolDownTime > 0 and self.LastTimeUsed ~= 0 and
( deltaTime( getTime(), self.LastTimeUsed ) / 1000 ) < self.CoolDownTime ) then -- Item is on CoolDown we can't use it
canUse = false;
reason = "Cooldown";
end;
else -- Item is in use, locked, we can't use it
reason = "In use";
canUse = false;
end;
if ( canUse ) then
RoMScript("UseBagItem("..self.BagId..")");
self.LastTimeUsed = getTime();
yrest( 500 ); -- give time for server to respond with new item count
else
cprintf( cli.yellow, "DEBUG - Cannot use Item %s\t BagId: #%s ItemCount: %s\treason: %s\n", self.Name, self.BagId, self.ItemCount, reason );
logMessage( sprintf( "DEBUG - Cannot use Item %s\t BagId: #%s ItemCount: %s\treason: %s\n", self.Name, self.BagId, self.ItemCount, reason ) );
end;
Code: Select all
if not self.InUse then
hmmm...after re-reading the code, I don't see how the LastTimeUsed value can ever be nil. It is set to 0 when the object is constructed and only ever changed in the CInventoryItem:use() function.
Does this happen every time? or was it a one-off occurrence?
Re: Error while trying to use HP potion
i did everything u said and got error same propblem
Re: Error while trying to use HP potion
i try and same error.BillDoorNZ wrote:So...did you manually use the potion while the bot was fighting? Or were you moving the item?
also bot doesnt start if hp lower than %90
<option name="HP_LOW_POTION" value="90" />
it happens everytime
Rompvp private server
-
- Posts: 446
- Joined: Wed Aug 03, 2011 7:37 pm
Re: Error while trying to use HP potion
very odd.
can you change the code in inventoryitem.lua at line 75 to:
so, really, just adding that printf line in between the other two. This will probably spam you with lots of prints, but may point to the problem a bit more..or not
can you change the code in inventoryitem.lua at line 75 to:
Code: Select all
if not self.InUse then
printf("Item InUse: "..tostring(self.Name).." slot:"..tostring(self.SlotNumber).." bag:"..tostring(self.BagId).." LastTimeUsed:"..tostring(self.LastTimeUsed).."\n");
if ( self.CoolDownTime > 0 and self.LastTimeUsed ~= 0 and
-
- Posts: 446
- Joined: Wed Aug 03, 2011 7:37 pm
Re: Error while trying to use HP potion
and you definitely went through the steps Rock outlined?
one thing you could try (to make it work for now) is changing the code to:
(removing the debug line I gave you at the same time).
This may end up breaking things elsewhere, I'm not sure.
I'm asking, as I can't see any way that LastTimeUsed can be nil given the latest code. I thought the private servers ran off a different version of the bot? or an older version?rock5 wrote:Line numbers don't match up. Line 75 isNo deltatime there. So maybe you have a corrupt rombot installation. Try Lisas sig instructions.Code: Select all
if not self.InUse then
Can't get bot to work? follow these instructions before posting, thank you.
1. SVN update micromacro/scripts/rom folder
2. SVN revert micromacro/scripts/rom folder
3. delete Runes of Magic/Interface/Addons/ingamefunctions folder
4. copy micromacro/scripts/rom/devtools/ingamefunctions folder to Runes of Magic/Interface/Addons folder
5. restart game
one thing you could try (to make it work for now) is changing the code to:
Code: Select all
-- If the item can't be used now we should be able to set a timer or something like that to recall this function and check again...
if not self.InUse then
if ( self.CoolDownTime > 0 and self.LastTimeUsed ~= 0 and (self.LastTime)
( deltaTime( getTime(), self.LastTimeUsed ) / 1000 ) < self.CoolDownTime ) then -- Item is on CoolDown we can't use it
This may end up breaking things elsewhere, I'm not sure.
Re: Error while trying to use HP potion
Any time an item is defined with the item class the item.LastTimeUsed is defined as 0, the only way for it to be nil is if the bot is not the default bot and changes have been made or perhaps downloaded from another site where they made changes which obviously broke the bot, happened far to many times.BillDoorNZ wrote:and you definitely went through the steps Rock outlined?
rock5 wrote:Line numbers don't match up. Line 75 isNo deltatime there. So maybe you have a corrupt rombot installation. Try Lisas sig instructions.Code: Select all
if not self.InUse then
Can't get bot to work? follow these instructions before posting, thank you.
1. SVN update micromacro/scripts/rom folder
2. SVN revert micromacro/scripts/rom folder
3. delete Runes of Magic/Interface/Addons/ingamefunctions folder
4. copy micromacro/scripts/rom/devtools/ingamefunctions folder to Runes of Magic/Interface/Addons folder
5. restart game
I guess there is 1 other possibility, getTime() is returning nil but in that line of code the getTime() isn't returning nil, only the LastTimeUsed is.
Just do a SVN update and SVN revert to the bot folder.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Error while trying to use HP potion
i delete everything and download rombot update with svn and i have new error
rompvp private server version 5.0.2.2565
rompvp private server version 5.0.2.2565
Re: Error while trying to use HP potion
That already looks better to me, something to note it says you are using micromacro v1.0
Current version is
MicroMacro v1.02 Beta 4
So yeah you need to update micromacro aswell =)
I should have looked at the join date, yeah a lot has changed since you last used the bot, so starting fresh is a very good idea. I doubt any of your old profiles would work, maybe even old waypoints might have an issue.
Current version is
MicroMacro v1.02 Beta 4
So yeah you need to update micromacro aswell =)
I should have looked at the join date, yeah a lot has changed since you last used the bot, so starting fresh is a very good idea. I doubt any of your old profiles would work, maybe even old waypoints might have an issue.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Error while trying to use HP potion
thanks all.
its working now
its working now
Who is online
Users browsing this forum: Ahrefs [Bot] and 45 guests