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

[eventMacros] Help to talk to npc with continuing dialogue while it's true #1768

Closed hibbot closed 6 years ago

hibbot commented 6 years ago

Hi guys! I would just like to know if it would be possible to code an efficient automacro with eventMacros? What I'm hoping to to get is something like, 1) Automacro triggered in certain map 2) Kore will go near the npc at random cell to talk to it 3) Will evaluate an "inventory item"; pass its quantity with condition and get the result as count to loop that many times. (Sorry with this description, can't really elaborate efficiently with English)

Example: do talknpc x y c c r0 c c (npc determined you have this many item, will loop as determined how many was it) do "send instructions this many with this variable" c c r0 n (can this be made into an array?)

Here is my code:

automacro talk {
    CharCurrentWeight < 90%
    InInventory "item_name" > 2
    InventoryCurrentSize < 50%
    StorageOpened 0
    IsInMapAndCoordinate map_name x y
    run-once 1
        call {
        $tlk = c r0 c c $tlk1  ##this is the code that I want to be determined automatically by kore##
        $tlk1 = c r0 c c c $tlk2
        $tlk2 = c r0 c tlk3
        $tlk3 = tlk2 ##my attempt to loop it to continue and just repeat the conversation instruction##
        $TalkNPC = x y c c r2 c c $tlk
    while (@invamount(item_name) > 2) as loop 
        do talknpc $TalkNPC
    end loop    

    log releasing talk!
    release $.caller
    }
}

Hope you can help me with some coding ideas. Thank you all for your time and help.

Fadreus commented 6 years ago

http://forums.openkore.com/viewforum.php?f=32 Use forum. Git for fix, not help. Need help, go forum.

sctnightcore commented 6 years ago

@Nipodemos god of eventmarco

Nipodemos commented 6 years ago

when you create the post in the forum, send link here, and i can help you by the way, this eventMacro the way it is looks like it will not work