storage item under X

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
sobad123
Human
Human
Posts: 48
Joined: 17 Mar 2015, 06:48
Noob?: Yes

storage item under X

#1 Post 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 :/

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: storage item under X

#2 Post 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
}
Please use pin function for uploading your file contents!

sobad123
Human
Human
Posts: 48
Joined: 17 Mar 2015, 06:48
Noob?: Yes

Re: storage item under X

#3 Post 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?

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: storage item under X

#4 Post 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

sobad123
Human
Human
Posts: 48
Joined: 17 Mar 2015, 06:48
Noob?: Yes

Re: storage item under X

#5 Post 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!

Locked