Page 1 of 2
rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 4:34 am
by Starrider
Code: Select all
Wed Oct 27 11:32:05 2010 : scripts\rom/bot.lua:7: D:/micromacro/scripts/rom/classes/inventory.lua:166: '<eof>' expected near 'end'
Wed Oct 27 11:32:05 2010 : Execution error: Runtime error
Re: rev 511 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 4:38 am
by swietlowka

there rev 513 currently so maybe update first :d
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 4:42 am
by Starrider
sry meant rev513, still get this msg
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 7:16 am
by hellburns
use revision 512's inventory.lua till someone can fix the new one
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 7:19 am
by botje
im using 512 too, im looking intoo the 513 issue, but it seems its closed correctly, fuck if i know why it errors xd
botje
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 7:23 am
by botje
oh wait, i found it, there is a end to much there
Code: Select all
function CInventory:useItem(itemNameOrId)
self:update();
item = self:findItem(itemNameOrId)
if item then
item:use();
return true, item.Id, item.Name;
end;
return false;
end;
thats the code you have to replace ^^
edit:
hmm, on second thought, this will not error, but always return false, so i think it should be
Code: Select all
Function CInventory:useItem(itemNameOrId)
self:update();
item = self:findItem(itemNameOrId)
if item then
item:use();
return true, item.Id, item.Name;
else
return false;
end;
end;
yeah, after 5 edits this should work xd, sorry for that, lua is not my native coding language xd
Botje
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 11:26 am
by checkii
For some reason the bot won't use items in 513 with the above edited code. I think there is something wrong with the return value.
As of right now 512 inventory is working correctly as far as I can tell.
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 11:28 am
by botje
im running it now, and it works fine... O.o
uses potions, opens bags.
Botje
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 12:51 pm
by Starrider
this massage comes with your changes:
other error, sory this posted was my own fault, downt work anyway
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 12:54 pm
by hellburns
revert the inventory.lua to rev 512. ive been using it with that all day with no problems
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 1:16 pm
by Starrider
ok step back to the rev505, last version when inventory.lua has been changed...
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 1:18 pm
by hellburns
revert inventory.lua only... nothing else to rev 512
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 1:40 pm
by Starrider
yes i did, only using rev505 inventory.lua, rest is still rev. 513.
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 1:43 pm
by hellburns
dont need to go back that far lol
Re: rev 513 error: Line 166 in inventory.lua
Posted: Wed Oct 27, 2010 3:02 pm
by Starrider
i didn't check
http://code.google.com/p/rom-bot/source/list an you will understand...
rev505 is the version where inventory.lua has been changed the last time.
Re: rev 513 error: Line 166 in inventory.lua
Posted: Thu Oct 28, 2010 1:39 am
by rock5
Sorry for the slip.
This code should work. I've just added the local variable to botje's fix
Code: Select all
Function CInventory:useItem(itemNameOrId)
self:update();
local item = self:findItem(itemNameOrId)
if item then
item:use();
return true, item.Id, item.Name;
else
return false;
end;
end;
Unfortunately I've been busy all day and now the servers are down so I can't test it.
Does anyone else, besides checkii, find that botje's fix didn't work? Or does anyone find that it did work?
Unfortunately I wont be back online for about 20 hours so can't test it till then. Maybe someone else can commit the changes if it works before then?
Re: rev 513 error: Line 166 in inventory.lua
Posted: Thu Oct 28, 2010 6:47 am
by Alkaiser
It works.
Re: rev 513 error: Line 166 in inventory.lua
Posted: Thu Oct 28, 2010 9:06 am
by swietlowka
i'd commit it but i can't

anyone interested get it from attachement
Re: rev 513 error: Line 166 in inventory.lua
Posted: Thu Oct 28, 2010 11:48 pm
by rock5
Ok I've committed the fix to revision 514. I also fixed a couple of changed memory addresses.
Re: rev 513 error: Line 166 in inventory.lua
Posted: Fri Oct 29, 2010 1:48 am
by swietlowka
gr8

anyway are there any permissions to commit some changes?