[Help]How to stop brewing while storage is open.

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
noobie_21
Noob
Noob
Posts: 7
Joined: 06 Jun 2015, 09:44
Noob?: Yes

[Help]How to stop brewing while storage is open.

#1 Post by noobie_21 »

hi guys, I've came across some macros about stand-alone brewing that when materials are sufficient, it will brew the desired potion. The problem is, when it comes to autostoraging the macro will always run while the storage is still open, hence it cause error in console on the next autostorage with kore not being able to recognize it still has an open storage(leading to just doing nothing).

what I did as solutions:
I've added "overrideAI 0" to the script...failed
A setup that relog after storage...kore can't run the whole autostorage because macro runs overlapping kore's AI...failed
I also tried a script locking the "brew macro" when kore needs to autostorage, but it disabled the whole thing even after reload and unlocking of the "brew macro"...failed

Can you guys help me with some script to be added that will get the macro to recognize it's autostoraging and won't run after it ran the whole autostorage?

thank you in advace.

below is the brew macro:
automacro callBrew {
map ayothaya
status Blessing
status Gloria
status not Owg 90%
sp > 4%
run-once 1
call {
call brewNow
release all
}
}

macro brewNow {
$inv1 = @invamount(Medicine Bowl)
$inv2 = @invamount(Empty Potion Bottle)
$inv3 = @invamount(White Herb)
$invManual1 = @invamount(Potion Creation Guide)

if ($inv1 > 0 && $inv2 > 0 && inv3 > 0 && $invManual1 >= 1) goto WhitePotion
if ($inv1 = 0 && $inv2 = 0 && inv3 = 0) goto store

:WhitePotion
do ss 228 10
do send 8E 01 F8 01 00 00 00 00 00 00
pause 0.5
stop


:store
do autostorage
pause 0.5
stop
}

User avatar
SkylorD
Moderators
Moderators
Posts: 1167
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: [Help]How to stop brewing while storage is open.

#2 Post by SkylorD »

Hi.

You could try using a hook (Read in macro plugin about and how to use) :

http://wiki.openkore.com/index.php/Hook

'packet_storage_close' its enough to trigger when your storage is closed. Only if you have open then will trigger.
'packet_storage_open' its enough to recognize if the storage is open. Better: when you type your kafra password it'll trigger. Then while this is considered inconvenient. Gotcha ?

for example :
automacro IsOpened {
hook 'packet_storage_open'
run-once 1
call {
log Storaging my items...
}
}
automacro IsClosed {
hook 'packet_storage_closed'
run-once 1
call {
log Now i can do my potions
release $.caller
release IsOpened
}
}
But where's specified when you'll open and when'll close ? Did you set storageAuto to get items ?

Now you just need to use the hook in your automacros.

You have other alternative :
automacro Hello {
run-once 1
console /Storage opened/i
call {
log My storage is opened, i can't do nothing.
}
}
automacro Hello2 {
run-once 1
console /Storage closed/i
call {
log My storage was closed, i can do something.
release all
}
}
Learn rules

noobie_21
Noob
Noob
Posts: 7
Joined: 06 Jun 2015, 09:44
Noob?: Yes

Re: [Help]How to stop brewing while storage is open.

#3 Post by noobie_21 »

^thank you. ill try it and see how it goes.

User avatar
SkylorD
Moderators
Moderators
Posts: 1167
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: [Help]How to stop brewing while storage is open.

#4 Post by SkylorD »

Return to say if solved or not, to close this topic.
Learn rules

noobie_21
Noob
Noob
Posts: 7
Joined: 06 Jun 2015, 09:44
Noob?: Yes

Re: [Help]How to stop brewing while storage is open.

#5 Post by noobie_21 »

it's still now working, macro brew still overrun the ai. here is my whole macro regarding the issue btw.
can you spot my mistake and why my macro behave that way.
automacro IsOpened {
hook 'packet_storage_open'
console /Using storage steps defined in config./
exclusive 1
run-once 1
call {
log locking brewmacro, storaging items
lock brewBatch
}
}

automacro IsClosed {
hook 'packet_storage_closed'
console /Storage closed./
run-once 1
call {
log Now i can do my potions
release $.caller
release IsOpened
release brewBatch
}
}

automacro brewBatch {
sp > 4%
status Blessing
status Gloria
status not Owg 90%
status Soul Link
inventory "Potion Creation Guide" > 0
inventory "Medicine Bowl" = 200
inventory "Empty Potion Bottle" = 200
inventory "White Herb" = 200
timeout 5
run-once 1

call {
log creating batch whites now...
do ss AM_TWILIGHT1
pause 4
release $.caller
}
}

User avatar
SkylorD
Moderators
Moderators
Posts: 1167
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re: [Help]How to stop brewing while storage is open.

#6 Post by SkylorD »

hook 'packet_storage_open'

or

console /Using storage steps defined in config./
Learn rules

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

Re: [Help]How to stop brewing while storage is open.

#7 Post by c4c1n6kr3m1 »

or may be u can add this line as a condition for automacro brewBatch so it won't run while storage is open

Code: Select all

eval !$::storage{opened} && ( $::char->inventory->size() > 0)

noobie_21
Noob
Noob
Posts: 7
Joined: 06 Jun 2015, 09:44
Noob?: Yes

Re: [Help]How to stop brewing while storage is open.

#8 Post by noobie_21 »

c4c1n6kr3m1 wrote:or may be u can add this line as a condition for automacro brewBatch so it won't run while storage is open

Code: Select all

eval !$::storage{opened} && ( $::char->inventory->size() > 0)
this worked. please close. thanks for all the replies and effort. just working out some kinks on my macro code and soon to share.

Locked