Openkore.com

OpenKore Forums
It is currently 18 Sep 2019, 13:47

All times are UTC - 5 hours [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to autodisconnect when spec item appears in inventory
PostPosted: 22 May 2015, 14:24 
Offline
Noob
Noob

Joined: 22 May 2015, 13:31
Posts: 2
Hello everyone

After reading all the faq and the guide I could find on the wiki, forum and some others posts. I still can't found how to do the specific action I want to.

I've to admit that I'm fairly new on Openkore but I did manage to do some bot by myself (mainly autobuff bots, and hunter bot for farming/xp) thank to all the guides you provided and I'm trying to do my best for understanding much complex scripts.

If anyone can help me, that would be greatly appreciated.

I'm struggling to make my bot auto disconnecting after he receives a particular item in inventory. According to me there is 2 way in which I can to this :

First of all, I could do a macro that would check console messages and make the bot disconnect when it appears.
Secondly, I could do an inventory check and make the bot disconnect if openkore detects the specific item on my inventory.


I did try to found a guide that would explain me how to interprate console messages (in term of scripts with if conditions) but no success and not easy to understand.

This is why I tried to do a simple macro, but not working, got some problems with if statement conditions.

Here is my macro:

Code:
macro start {
  do c @autoloot rate 2
  do c @autoloot item royal jelly
  do c @autoloot item honey
}

automacro dcdrop {
exclusive 1
call {

if inventory "Creamy Card" = 1 goto dc
if inventory "Creamy Card" != 1 goto continue

:dc
charselect

:continue
}
}


Don't bother on the first part of the macro, the second is the one I try to fix.

Is it better to use automacro that trigger for a specific event ?

If anyone can point out my mistakes and explain me how to use these statements correctly, it would be greatly appreciated, I'm learning.

Slamer


Top
 Profile  
 
 Post subject: Re: How to autodisconnect when spec item appears in inventory
PostPosted: 22 May 2015, 17:50 
Offline
Moderators
Moderators
User avatar

Joined: 16 Dec 2011, 02:53
Posts: 1215
Location: Brazil
Almost bro.

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

Quote:
inventory "<item>" <condition> <amount> [, ...]
Triggers when you have <condition> <amount> of <item> in your inventory.
Comma-separated arguments are treated as OR conditions.
Multiple lines are treated as AND conditions.


There is "console" condition.

Quote:
console ("<text>" | /<regexp>/[i])
Triggers when <text> is received on console or the text received matches <regexp>.
The i switch means the regexp is case-insensitive.

Set variables:

$.lastLogMsg - the console text that trigerred the automacro.
$.lastMatchN - backreference from regexp.


Use the search for advanced results. And basics too :D any question, creates another topic.

_________________
"'There are three things all wise men fear: the sea in storm, a night with no moon, and the anger of a gentle man.'" :P

viewtopic.php?f=10&t=16117

Thanks for this Eternal! =D <3<3


Top
 Profile  
 
 Post subject: Re: How to autodisconnect when spec item appears in inventory
PostPosted: 23 May 2015, 05:41 
Offline
Noob
Noob

Joined: 22 May 2015, 13:31
Posts: 2
Thank you for your answer SkylorD.


Code:
automacro dcdrop {
inventory "Creamy Card" = 1
call {

logout
}
}


I did check again on the automacro function and it seems like I did a mistake on conditions and complicated myself a bit :).

Now it's working with this simple macro, thank you dude


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group