rev 513 error: Line 166 in inventory.lua

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

rev 513 error: Line 166 in inventory.lua

#1 Post 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
Last edited by Starrider on Wed Oct 27, 2010 4:41 am, edited 1 time in total.
swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: rev 511 error: Line 166 in inventory.lua

#2 Post by swietlowka »

;) there rev 513 currently so maybe update first :d
Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: rev 513 error: Line 166 in inventory.lua

#3 Post by Starrider »

sry meant rev513, still get this msg
hellburns
Posts: 19
Joined: Fri Mar 12, 2010 3:46 am

Re: rev 513 error: Line 166 in inventory.lua

#4 Post by hellburns »

use revision 512's inventory.lua till someone can fix the new one
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: rev 513 error: Line 166 in inventory.lua

#5 Post 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
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: rev 513 error: Line 166 in inventory.lua

#6 Post 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
checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: rev 513 error: Line 166 in inventory.lua

#7 Post 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.
User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: rev 513 error: Line 166 in inventory.lua

#8 Post by botje »

im running it now, and it works fine... O.o

uses potions, opens bags.

Botje
Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: rev 513 error: Line 166 in inventory.lua

#9 Post by Starrider »

this massage comes with your changes:

other error, sory this posted was my own fault, downt work anyway
Last edited by Starrider on Wed Oct 27, 2010 1:14 pm, edited 1 time in total.
hellburns
Posts: 19
Joined: Fri Mar 12, 2010 3:46 am

Re: rev 513 error: Line 166 in inventory.lua

#10 Post by hellburns »

revert the inventory.lua to rev 512. ive been using it with that all day with no problems
Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: rev 513 error: Line 166 in inventory.lua

#11 Post by Starrider »

ok step back to the rev505, last version when inventory.lua has been changed...
hellburns
Posts: 19
Joined: Fri Mar 12, 2010 3:46 am

Re: rev 513 error: Line 166 in inventory.lua

#12 Post by hellburns »

revert inventory.lua only... nothing else to rev 512
Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: rev 513 error: Line 166 in inventory.lua

#13 Post by Starrider »

yes i did, only using rev505 inventory.lua, rest is still rev. 513.
hellburns
Posts: 19
Joined: Fri Mar 12, 2010 3:46 am

Re: rev 513 error: Line 166 in inventory.lua

#14 Post by hellburns »

dont need to go back that far lol
Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: rev 513 error: Line 166 in inventory.lua

#15 Post 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.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: rev 513 error: Line 166 in inventory.lua

#16 Post by rock5 »

Sorry for the slip. :oops:

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?
  • 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
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: rev 513 error: Line 166 in inventory.lua

#17 Post by Alkaiser »

It works.
swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: rev 513 error: Line 166 in inventory.lua

#18 Post by swietlowka »

i'd commit it but i can't ;)
anyone interested get it from attachement
Attachments
inventory.lua
(21.33 KiB) Downloaded 205 times
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: rev 513 error: Line 166 in inventory.lua

#19 Post by rock5 »

Ok I've committed the fix to revision 514. I also fixed a couple of changed memory addresses.
  • 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
swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: rev 513 error: Line 166 in inventory.lua

#20 Post by swietlowka »

gr8 :P
anyway are there any permissions to commit some changes?
Post Reply