-
C3PO
- Posts: 109
- Joined: Sun Jul 10, 2011 2:45 pm
#1
Post
by C3PO » Fri Dec 21, 2012 11:53 am
Hello community,
since the last patch I get problems with same scripts that uses
It worked fine before. May someone has the same problem, or better someone has a solution ...
thx
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#2
Post
by lisa » Fri Dec 21, 2012 6:22 pm
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.
-
C3PO
- Posts: 109
- Joined: Sun Jul 10, 2011 2:45 pm
#3
Post
by C3PO » Fri Dec 21, 2012 8:25 pm
I will try that! thanks
PS: is there a code to find the ID? (I always used Runesdatabase to find out the id's)
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#4
Post
by rock5 » Fri Dec 21, 2012 8:38 pm
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.”
-
C3PO
- Posts: 109
- Joined: Sun Jul 10, 2011 2:45 pm
#5
Post
by C3PO » Fri Dec 21, 2012 8:46 pm
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
#6
Post
by C3PO » Fri Dec 21, 2012 8:57 pm
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
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#7
Post
by rock5 » Fri Dec 21, 2012 9:22 pm
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.”
-
C3PO
- Posts: 109
- Joined: Sun Jul 10, 2011 2:45 pm
#8
Post
by C3PO » Fri Dec 21, 2012 9:36 pm
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 ...
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#9
Post
by lisa » Fri Dec 21, 2012 9:44 pm
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
-
C3PO
- Posts: 109
- Joined: Sun Jul 10, 2011 2:45 pm
#10
Post
by C3PO » Fri Dec 21, 2012 10:05 pm
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
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#11
Post
by lisa » Fri Dec 21, 2012 10:48 pm
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?
-
C3PO
- Posts: 109
- Joined: Sun Jul 10, 2011 2:45 pm
#12
Post
by C3PO » Sat Dec 22, 2012 1:43 am
no more simple ... I had started micromacro a very very long time ago
-
lisa
- Posts: 8332
- Joined: Tue Nov 09, 2010 11:46 pm
- Location: Australia
#13
Post
by lisa » Sat Dec 22, 2012 1:49 am
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 =)
Who is online
Users browsing this forum: Google [Bot] and 4 guests