[EventMacro] Refreshing Vending When Item is Sold out

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Message
Author
ReynoldShakster
Noob
Noob
Posts: 3
Joined: 08 Aug 2015, 12:01
Noob?: Yes

[EventMacro] Refreshing Vending When Item is Sold out

#1 Post by ReynoldShakster »

Can you test if my code works?
My server is in IRO Chaos Renewal
And here is my macro
Explanation: I want to wait 300seconds before reopening the shop. I am assuming that closing and reopening ("do closeshop" and "do openshop") will reset the vend to default number of items in shop.txt.

Code: Select all

#openkore vending refill - untested
automacro vendNFillFromCart {
    SimpleHookEvent vending_item_sold
    InCart “Creamy Card” > 0
    run-once 1
    call {
        if (&shopamount(Creamy Card) == 0) {
            delay 300
            do ai off
            pause 1
            do closeshop
            pause 1
            do stand
            pause 1
            do openshop
            pause 1
            do sit
            pause 1
            do ai on
            release vendNFillFromCart 
        } else {
            release vendNFillFromCart 
        }
    }
}
#In Shop.txt

Code: Select all

Creamy Card		4,000,000                 3

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: [EventMacro] Refreshing Vending When Item is Sold out

#2 Post by fadreus »

I use normal macro (not eventMacro)

Code: Select all

automacro Sold {
	cart "Creamy Card" > 0
	shop "Creamy Card" == 0
	run-once 1
	delay 300
	call ReShop
}

macro ReShop {
	do closeshop
	do openshop; release ReShop
}

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

ReynoldShakster
Noob
Noob
Posts: 3
Joined: 08 Aug 2015, 12:01
Noob?: Yes

Re: [EventMacro] Refreshing Vending When Item is Sold out

#3 Post by ReynoldShakster »

Thanks, looks simpler

Post Reply