5.0.6 problem with bag-items

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
C3PO
Posts: 109
Joined: Sun Jul 10, 2011 2:45 pm

5.0.6 problem with bag-items

#1 Post by C3PO »

Hello community,

since the last patch I get problems with same scripts that uses

Code: Select all

inventory:useItem(id)
It worked fine before. May someone has the same problem, or better someone has a solution ...

thx
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 5.0.6 problem with bag-items

#2 Post by lisa »

works fine for me.

Code: Select all

Type in 'q' (without quotes) to quit.
Command> if inventory:useItem(207203) then print("it works fine") end
it works fine
Command>
it used the item and I got the luck pot buff, maybe the item you are using has changed Id?
they have done that in previous patches, might be a good idea to check the item Ids.
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
C3PO
Posts: 109
Joined: Sun Jul 10, 2011 2:45 pm

Re: 5.0.6 problem with bag-items

#3 Post by C3PO »

I will try that! thanks

PS: is there a code to find the ID? (I always used Runesdatabase to find out the id's)
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 5.0.6 problem with bag-items

#4 Post by rock5 »

I don't believe there is any simple command that returns item ids. There are addons that can give you ids. I use DailyNotes but I believe the option to show item ids is not usually available. ItemPreview is always a good addon to have. You can search for any items you want, even ones you don't have.

Of course you can also use the bot. Put the item in the first bag slot, start the commandline and type the following

Code: Select all

print(inventory.BagSlot[61].Name, inventory.BagSlot[61].Id)
  • 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
C3PO
Posts: 109
Joined: Sun Jul 10, 2011 2:45 pm

Re: 5.0.6 problem with bag-items

#5 Post by C3PO »

Of course you can also use the bot. Put the item in the first bag slot, start the commandline and type the following
print(inventory.BagSlot[61].Name, inventory.BagSlot[61].Id)
thx, thats all I need
C3PO
Posts: 109
Joined: Sun Jul 10, 2011 2:45 pm

Re: 5.0.6 problem with bag-items

#6 Post by C3PO »

maybe someone has another idea ...

The ID's are still the same.

Edit: I also tried Lisa's

Code: Select all

if inventory:useItem(207203) then print("it works fine") end
and it didn't work
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 5.0.6 problem with bag-items

#7 Post by rock5 »

Hey I did figure out a command that you can use in game.

Code: Select all

/script SendSystemChat(tonumber("0x"..string.match(GetBagItemLink(GetBagItemInfo(1)),"item:(%x*)")))
That prints the id of the first bag slot item but like I said, not simple.

Anyway, what I can tell you is, if Lisas command didn't print "it works fine" then it thinks it didn't find the item. Why, I don't know.
  • 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
C3PO
Posts: 109
Joined: Sun Jul 10, 2011 2:45 pm

Re: 5.0.6 problem with bag-items

#8 Post by C3PO »

you are right. the bot isn't able to find the item ... but the bot could get the itemTotalCount() ...

at the moment I'm debugging inventory.lua findItem() and it looks like one of the boolean in the first "if" are false ...
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 5.0.6 problem with bag-items

#9 Post by lisa »

I am thinking things like profile autosell from and to numbers but I thought the inventory class didn't use those, it just checks what bag slots are actually available.

Maybe start up with commandline and do this function

Code: Select all

function printinventory()
	local bags = {}
	inventory:update()
	for slot = 61, 240 do
		item = inventory.BagSlot[slot]
 	    if item.Available and  item.Name ~= "<EMPTY>" then
			table.insert(bags, {Name = item.Name, Id = item.Id, Rlevel = item.RequiredLvl, stats = item.Stats})
		end;
	end;
	table.print(bags)
end
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
C3PO
Posts: 109
Joined: Sun Jul 10, 2011 2:45 pm

Re: 5.0.6 problem with bag-items

#10 Post by C3PO »

I think I found the reason. It's not the first "if" but the second.

os.clock get's -2031146.139
lastuse 0
reuse 1

and that's why ((os - lastuse) > reuse) is false ...

After restarting micromacro os.clock returns correct values and the item useage worked again.

thanks for your help
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 5.0.6 problem with bag-items

#11 Post by lisa »

os.clock() is the time in seconds since the programme was started, in this case micromacro.

So to get a negative maybe your operating system clock went backwards?
I am thinking day light savings or maybe you just adjusted the time?
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
C3PO
Posts: 109
Joined: Sun Jul 10, 2011 2:45 pm

Re: 5.0.6 problem with bag-items

#12 Post by C3PO »

no more simple ... I had started micromacro a very very long time ago :)
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 5.0.6 problem with bag-items

#13 Post by lisa »

C3PO wrote:no more simple ... I had started micromacro a very very long time ago :)
So I am guessing you restarted MM and it all works fine now =)
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
Post Reply