eventMacro

From OpenKore Wiki
Revision as of 19:31, 28 February 2017 by Henrybkgg (talk | contribs) (Created page with "== Installation == * Download the eventMacro plugin. You can download it from the following link: ** [https://github.com/Henrybk/eventMacro '''Github''' Head version from the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Installation

  • Go to your OpenKore main folder (the folder which contains the file openkore.pl) and create a subfolder called plugins, if there isn't already one. Create a subfolder eventMacro in it.
  • Inside the eventMacro plugin's zipfile (normally eventMacro-master.zip), you will find the file eventMacro.pl, the folder eventMacro and other files and folders. Extract them to your plugins/eventMacro folder, so eventMacro.pl ends up in plugins/eventMacro/eventMacro.pl.
  • In your OpenKore control folder, create a blank file named eventMacros.txt. In this file you will put your macros/automacros.


After installation, your OpenKore file tree should look like this (ignoring OpenKore's own files):

openkore
|-- openkore.pl
|-- control
|   |-- eventMacros.txt
|-- fields
|-- logs
|-- plugins
|   |-- eventMacro
|   |   |-- eventMacro
|   |   |   |-- Automacro.pm
|   |   |   |-- Condition.pm
|   |   |   |-- Core.pm
|   |   |   |-- Data.pm
|   |   |   |-- FileParser.pm
|   |   |   |-- Lists.pm
|   |   |   |-- Macro.pm
|   |   |   |-- Runner.pm
|   |   |   |-- Utilities.pm
|   |   |   |-- Validator.pm
|   |   |   |-- Validator
|   |   |   |   |-- ListMemberCheck.pm
|   |   |   |   |-- NumericComparison.pm
|   |   |   |   |-- RegexCheck.pm
|   |   |   |-- Conditiontypes
|   |   |   |   |-- ListConditionEvent.pm
|   |   |   |   |-- ListConditionState.pm
|   |   |   |   |-- MultipleValidatorEvent.pm
|   |   |   |   |-- MultipleValidatorState.pm
|   |   |   |   |-- NumericConditionEvent.pm
|   |   |   |   |-- RegexConditionEvent.pm
|   |   |   |   |-- RegexConditionState.pm
|   |   |   |   |-- SimpleEvent.pm
|   |   |   |-- Condition
|   |   |   |   |-- AttackEnd.pm
|   |   |   |   |-- AttackStart.pm
|   |   |   |   |-- AttackStartRegex.pm
|   |   |   |   |-- BaseLevel.pm
|   |   |   |   |-- CartCurrentSize.pm
|   |   |   |   |-- CartCurrentWeight.pm
|   |   |   |   |-- CartMaxSize.pm
|   |   |   |   |-- More conditions...
|   |   |-- test
|   |   |   |-- unit_tests.pl
|   |   |   |-- RunnerStatementTest.pm
|   |   |   |-- RunnerParseCommandTest.pm
|   |   |   |-- LoadConditionsTest.pm
|   |   |   |-- GlobalVarRegexTest.pm
|   |   |   |-- FindVarTest.pm
|   |   |   |-- DynamicAutoVarsTest.pm
|   |   |   |-- CoreVarFunctionsTest.pm
|   |   |   |-- Validator
|   |   |   |   |-- ListMemberCheckTest.pm
|   |   |   |   |-- NumericComparisonTest.pm
|   |   |   |   |-- RegexCheckTest.pm
|   |   |   |-- textfiles
|   |   |   |   |-- DynamicAutoVarsTest.txt
|   |   |   |   |-- DynamicAutoVarsTest2.txt
|   |   |   |   |-- DynamicAutoVarsTest3.txt
|   |   |   |   |-- empty.txt
|   |   |   |   |-- LoadConditionsTest.txt
|   |   |-- eventMacro.pl
|-- src
|-- tables

Console Commands

Syntax

eventMacro [MACRO|auto|list|status|check|stop|pause|unpause|var_get|var_set|enable|disable] [extra]
eventMacro MACRO
Run macro MACRO

Runs macro <macroname>.

Option Value Description
-repeat n repeat the macro n times
-overrideAI none override openkore's AI
-macro_delay delay override global macro_delay for this macro
-exclusive none do not allow automacros to cancel this macro
-orphan method use method for handling orphaned macros


Parameters for the macro can be specified after a double dash (--). These parameters are saved to the variables $.param1 to $.paramN. Example:

macro foo {
 log Parameter 1 is $.param1
 log Parameter 2 is $.param2
}


When called as eventMacro foo -- foo bar it would print out

[eventmacro log] Parameter 1 is foo
[eventmacro log] Parameter 2 is bar
eventMacro auto AUTOMACRO
Get info on an automacro and it's conditions
eventMacro list
Lists available macros and automacros
eventMacro status [macro|automacro]
Shows current status of automacro, macro or both
eventMacro check [force_stop|force_start|resume]
Sets the state of automacros checking
eventMacro stop
Stops current running macro
eventMacro pause
Pauses current running macro
eventMacro unpause
Unpauses current running macro
eventMacro var_get
Shows the value of one or all variables
eventMacro var_set
Set the value of a variable
eventMacro enable [automacro]
Enable one or all automacros
eventMacro disable [automacro]
Disable one or all automacros


Configuration files

control/eventMacros.txt
Put your macros and automacros in here. You can change the file's name depending on what you configured on config eventMacro_file.
control/timeouts.txt
Add eventMacro_delay and set it to the number of seconds you want the plugin to pause between commands.
control/config.txt
Option Value Default Description
eventMacro_orphans terminate
reregister
reregister_safe
terminate_last_call
terminate How will openkore deal with macros that got cleanead out of AI queue
eventMacro_file file name eventMacros.txt file containing the macros and automacros