$pack little probs to understand ...

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

User avatar
eqsolro
a ghoul
a ghoul
Posts: 113
Joined: Fri Sep 13, 2002 4:20 pm
Location: Germany

$pack little probs to understand ...

Post by eqsolro » Tue Sep 17, 2002 2:28 pm

How can i identify the item in bag 0 slot 1 - how can i say stop if a item is in the slot ?

if $pack 0 1 ="Sow Potion" /goto :End

... can anyone help a little bit ?

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Tue Sep 17, 2002 8:36 pm

Salutaitons,
/if $inv(0,1,name)=="10 dose blood of the wolf" /goto :End

User avatar
eqsolro
a ghoul
a ghoul
Posts: 113
Joined: Fri Sep 13, 2002 4:20 pm
Location: Germany

Post by eqsolro » Wed Sep 18, 2002 2:17 am

Sometimes ......
.... i cant see the forrest .... i see toooo mutch trees ;)

im blind THY !!!!!

User avatar
eqsolro
a ghoul
a ghoul
Posts: 113
Joined: Fri Sep 13, 2002 4:20 pm
Location: Germany

Post by eqsolro » Wed Sep 18, 2002 4:58 pm

L124RD wrote:Salutaitons,
/if $inv(0,1,name)=="10 dose blood of the wolf" /goto :End
hmm tried it with

/if $inv(0,1,name)=="Blood of the Wolf" /goto :Done
/if $pack(0,1,name)=="Blood of the Wolf" /goto :Done
/if $item(0,1,name)=="Blood of the Wolf" /goto :Done

and in Bag 0 Slot 1 was a Blood of the Wolf - but he ignores it :(
Im to silly .. i am ?

i tryed another Version

/if $inv(0,1,empty)==FALSE /goto :Done
/if $pack(0,1,empty)==FALSE /goto :Done

and

/if $inv(0,1,empty)==TRUE /goto :Done
/if $pack(0,1,empty)==TRUE /goto :Done

it wont work ........ *tears in my eyes* ... and i tought i
had the Solutin ... maybe i dont see it ....

its /click right inv 0 important ? Must the Bag open ore close to check this ? - My brain burns ;( .. I go to bed ... but i know .. i cant sleep
it goes around in my head .. and around and around

/goto :sleep

:sleep
/echo gdn8 ;)
/close eyes
/endthinking

User avatar
DeathSpiral
a ghoul
a ghoul
Posts: 95
Joined: Thu Aug 22, 2002 6:31 pm

Post by DeathSpiral » Wed Sep 18, 2002 7:48 pm

Important thing to understand about backpacks and inventory.... (in code backets, so fixed width spaced)

Code: Select all

inventory     pack
---------     ---------
| 0 | 4 |     | 0 | 1 |
| 1 | 5 |     | 2 | 3 |
| 2 | 6 |     | 4 | 5 |
| 3 | 7 |     | 6 | 7 | (if 8 slot)
---------     | 8 | 9 | (if 10 slot)
              ---------
So, I'm thinking its probably just a placement goofup on the check. If you want to know if you have an item in inventory, however, your best bet is to do a $count() on the item (ie, $count("Blood of the Wolf")). Count returns 0 if none, or the number you have if you have any. For picking, use /finditem. However, without knowing exactly where you are going with this, I can't offer more advice. Feel free to post a reply or PM me for more info.
I am orc pawn, hear me yell for centurians...

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Wed Sep 18, 2002 10:51 pm

Salutations,
also... if you are comaring the name parially, you need to use ~~'s not =='s

Code: Select all

/if $item(0,0,name)~~"Blood of the Wolf" /goto :Done

User avatar
DeathSpiral
a ghoul
a ghoul
Posts: 95
Joined: Thu Aug 22, 2002 6:31 pm

Post by DeathSpiral » Wed Sep 18, 2002 10:56 pm

Oooh, also, just noticed this... for string tests I always quote the $check as well, because I find it doesn't work properly. So you might want to try... (from your posted test...)

Code: Select all

/if "$item(0,1,name)"=="Blood of the Wolf" /goto :Done
or as L124RD suggested for partial matching

Code: Select all

/if "$item(0,1,name)"~~"Blood of the Wolf" /goto :Done
I am orc pawn, hear me yell for centurians...

User avatar
eqsolro
a ghoul
a ghoul
Posts: 113
Joined: Fri Sep 13, 2002 4:20 pm
Location: Germany

Post by eqsolro » Thu Sep 19, 2002 1:30 am

i try it after work, thx thx and allways thx - its good to be supportet from such friendly helper - i hope i can help too ... later ,, hehe
first i have to understand MQ in all his ways - thy for spending your time!

User avatar
eqsolro
a ghoul
a ghoul
Posts: 113
Joined: Fri Sep 13, 2002 4:20 pm
Location: Germany

Post by eqsolro » Thu Sep 19, 2002 2:23 pm

/if "$item(0,1,name)"~~"Blood of the Wolf" /goto :Done

is the right way .. THY

hmm only 5-6 little things .. and i have a leraning to Alchemy _macro ... buts now - its 6 scripts .. i should combine them .. but im out of time - and then .. HOLIDAY .. wooooot :)

thy ..

Magnus
a ghoul
a ghoul
Posts: 85
Joined: Sun Aug 11, 2002 3:50 pm

Post by Magnus » Thu Sep 19, 2002 2:47 pm

Since alot of that will be redundant for all 6 scripts.. you should add to or create your own Routines.mac and combine the scripts.

So when you do some of the buying/selling/packs etc...it will be called from the routines and then you just make 1 macro centered around your routines.


Mag