OpenKore / openkore

A free/open source client and automation tool for Ragnarok Online
http://openkore.com
Other
1.28k stars 1.04k forks source link

eventMacro !Include #2848

Closed AdrianoAzuos closed 5 years ago

AdrianoAzuos commented 5 years ago

I am not quite understanding the! include in eventMacros. How do I call a macro that is inside the include file?

If anyone has an example I am very grateful.

Nipodemos commented 5 years ago

Hello! I'm gonna give you two examples to see if you can understand

1: Add a file based on a condition:

Lets suppose you have one file which have the eventMacro for rogue quest and another file that have the eventMacro for assassin quest: photo of eventMacro Files

the third file is the main, which you have other things that are equal to both classes, like eden quests or whatever. On that main eventMacros.txt file, you can specify if you gonna include Rogue eventMacro, OR assassin eventMacro, this way:

automacro checkClassRogue {
    JobID 17 #Rogue Class ID
    exclusive 1
    run-once 1
    call {
        !include eventMacro_rogue.txt
    }
}

automacro checkClassAssassin {
    JobID 12 #Assassin Class ID
    exclusive 1
    run-once 1
    call {
        !include eventMacro_assassin.txt
    }
}

this way, all eventMacros that is inside the other file will be added to openkore, and will work normally.

2: split eventMacros in varios files, then use !include to make it work

Let's say you have the following eventMacros: image it is actually pretty good to split up in several files, to keep organized and avoid one simple file to have more than 3k lines of macros.

since they are splitted, you need to merge then on the main eventMacros.txt file using the !include. Type this on main eventMacros.txt:

!include eventMacro_1-99_leveling_maps.txt
!include eventMacro_eden12Quest.txt
!include eventMacro_eden26Quest.txt
!include eventMacro_eden40Quest.txt
!include eventMacro_noviceField.txt

i hope this two examples can help you understand

Fadreus commented 5 years ago

Things that don't benefit openkore, use forum or IRC. Different platform serve different purpose. Github is mainly for openkore developement.

If you wanna ask stuff, use IRC or forum. I had to say this coz the other guy start asking stuff rather than reporting. This ain't place for that.