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

Im trying to add plugin hook into Corelogic.pm #1295

Closed oleokoong closed 6 years ago

oleokoong commented 6 years ago

This is my first time to add modification into src file. CoreLogic.pm i wish to add hook after this line

message T("Auto-sell sequence completed.\n"); Plugins::callHook("sell_complete"); "success";

which i refer from Attack.pm message T("Target died\n"), "ai_attack"; Plugins::callHook("target_died", {monster =>

unfortunally i got this error, did i miss something on the CoreLogin Line? [eventMacro] Event of type 'hook', and of name 'sell_complete' activated automacro 'test111111', calling macro 'tempMacro60' [eventMacro] Running macro 'tempMacro60' got orphaned, its orphan method is 'terminate'.

alisonrag commented 6 years ago

post your code here.

oleokoong commented 6 years ago

automacro clearout { SimpleHookEvent sell_complete timeout 30 call { do respawn log 123 relog } }

alisonrag commented 6 years ago

this should fix: CoreLogic, Line 1540:

message T("Auto-sell sequence completed.\n"), "success";
Plugins::callHook("sell_complete");

eventMacros.txt:

automacro clearout {
    SimpleHookEvent sell_complete
    exclusive 1
    call {
        do respawn
        log 123
        do relog
    }
}
oleokoong commented 6 years ago

it still produce same error.. i will get back to you later..quite busy recently

Mortimal commented 6 years ago

They are implemented already... #1139 ? why not them?

Nipodemos commented 6 years ago

@Mortimal no, he is trying to put a hook on auto_sell, not on deal i think its very good!!

alisonrag commented 6 years ago

try this CoreLogic, Line 1540:

message T("Auto-sell sequence completed.\n"), "success";
Plugins::callHook("sell_complete");

eventMacros.txt:

automacro clearout {
    SimpleHookEvent sell_complete
    exclusive 1
    call clearoutM
}
macro clearoutM {
        do respawn
        log 123
        do relog
    }
}
oleokoong commented 6 years ago

@mortimal last time you did the target _died macro for me, now I’m trying to make macro after autosell , or autobuy

The original sequence is bot back to town autosell, then autobuy , then call hook for macro...

But I don’t which line is autobuy done, only found autosell complete

sctnightcore commented 6 years ago

@Mortimal Do you have a discord.? I have something to talk to you. sctnightcore24hour#1063

oleokoong commented 6 years ago

1306