Openkore.com

OpenKore Forums
It is currently 27 May 2018, 04:06

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [EventMacro] Refreshing Vending When Item is Sold out
PostPosted: 02 Feb 2018, 12:23 
Offline
Noob
Noob

Joined: 08 Aug 2015, 12:01
Posts: 3
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:
#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:
Creamy Card      4,000,000                 3


Top
 Profile  
 
 Post subject: Re: [EventMacro] Refreshing Vending When Item is Sold out
PostPosted: 03 Feb 2018, 01:01 
Offline
Cybernatic Entity
Cybernatic Entity
User avatar

Joined: 17 Nov 2017, 23:32
Posts: 268
Location: Malaysia
I use normal macro (not eventMacro)

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

_________________

Wiki & Google are your best allies.
iRO server supporter.
Image


Top
 Profile  
 
 Post subject: Re: [EventMacro] Refreshing Vending When Item is Sold out
PostPosted: 03 Feb 2018, 01:46 
Offline
Noob
Noob

Joined: 08 Aug 2015, 12:01
Posts: 3
Thanks, looks simpler


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group