Hello together,
is where anybody able to tell me a way to test if a bagslot is empty? I tried it thies way:
if ( inventory.bagslot[59] not null ) then ....
but it doesn't work.
Thx for help
test if a bagslot is empty
Re: test if a bagslot is empty
That's not proper lua code. Assuming inventory.bagslot[59] is correct(which I haven't checked) try;
if not (inventory.bagslot[59] == null ) then ....
or
if ( inventory.bagslot[59] ~= null ) then ....
or just
if inventory.bagslot[59] then ....
because if used in this way, a nul value is taken to be false and any other value is taken to be true. Read it as;
'if inventory.bagslot[59] has a value then ...'
if not (inventory.bagslot[59] == null ) then ....
or
if ( inventory.bagslot[59] ~= null ) then ....
or just
if inventory.bagslot[59] then ....
because if used in this way, a nul value is taken to be false and any other value is taken to be true. Read it as;
'if inventory.bagslot[59] has a value 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
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 138 guests