Page 1 of 1

storage item under X

Posted: 10 Feb 2017, 09:23
by sobad123
Hey I tried to do following things:
Make White Potions -> Sell them and buy new items.

Actually I tried this: but the condition with storage doesnt work. I searched and someone done it with bananas, but he only updated macro.pl and thats no solution for me. Or do someone have a macro.pl which is able to solve the problem?

automacro storageopen {
run-once 1
exclusive 1
call {
do c @storage
pause 2
Storage "White Herb" = 0
pause 1
do storage close
pause 1
call teleport
}
}

macro teleport {
do c @go 1
}

doesnt work too when storage check is on first position :/

Re: storage item under X

Posted: 10 Feb 2017, 10:28
by Mortimal
u must chek it with if statement :/

Code: Select all

macro storageopen {
   do c @storage
   pause 2
   if(@storage(White Herb) < 1) goto emptystorage     #if no white herb go to \/ 
      <here u do what you need>
:emptystorage                                         #no White Herb in storage just close and do "@go 1"
   do storage close
   pause 1
   do c @go 1
}

Re: storage item under X

Posted: 11 Feb 2017, 11:33
by sobad123
Thank you it works but how about I would use 2 If sentences like

if (@storage("White Herb") = 0) goto emptystorage
if (@storage("White Herb") > 30 && @storage("White Potion") > 1) goto sellout

in two lines should it not work. But what is better now add a seconde macro block or is there another way?

Re: storage item under X

Posted: 11 Feb 2017, 14:37
by c4c1n6kr3m1

Code: Select all

@storage (<item>)
 Returns storage item index of <item>. If <item> doesn't exist, it returns -1.

 @storamount (<item>)
 Returns the amount of the given <item> in storage.
http://wiki.openkore.com/index.php/Macro_plugin

Re: storage item under X

Posted: 11 Feb 2017, 14:53
by sobad123
Thank you for your hint, I will look what I can do with that :))
Okay actually I have this:
macro storageopen {
do c @storage
pause 1
if (@storamount("Item") < 1) goto emptystorage
pause 1
#if (@storamount("Item") < 29900 && @storamount("Item") == 1) goto emptystorage1
#pause 1
#if (@storamount("Item") == 30000 && @storamount("Item") > 100) goto sellout
#pause 1
if (@storamount("Item") == 30000 && @storamount("Item") < 100) goto brew
pause 1
if (@storamount("Item") < 29900 && @storamount("Item") > 100) goto brew1
pause 1
run-once 1
exclusive 1

Okay dont use "" :D found it out thanks. now it works without struggle!