Openkore.com

OpenKore Forums
It is currently 28 Apr 2017, 23:37

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: storage item under X
PostPosted: 10 Feb 2017, 09:23 
Offline
Human
Human

Joined: 17 Mar 2015, 06:48
Posts: 48
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 :/


Top
 Profile  
 
 Post subject: Re: storage item under X
PostPosted: 10 Feb 2017, 10:28 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 225
u must chek it with if statement :/

Code:
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!


Top
 Profile  
 
 Post subject: Re: storage item under X
PostPosted: 11 Feb 2017, 11:33 
Offline
Human
Human

Joined: 17 Mar 2015, 06:48
Posts: 48
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?


Top
 Profile  
 
 Post subject: Re: storage item under X
PostPosted: 11 Feb 2017, 14:37 
Offline
Plain Yogurt
Plain Yogurt

Joined: 24 Mar 2012, 04:13
Posts: 74
Code:
@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


Top
 Profile  
 
 Post subject: Re: storage item under X
PostPosted: 11 Feb 2017, 14:53 
Offline
Human
Human

Joined: 17 Mar 2015, 06:48
Posts: 48
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group