How to install:1) Place this plugin in your plugins folder (see the Plugins FAQ how).2) Add a reactOnNPC config block in your config.txt which defines the command to use and the conditions of the NPC conversation which will trigger Openkore to use the command

reactOnNPC (command)This option specifies the command to use if all conditions are met for this block. Special keywords can be used on the specified commands (see below).

Attribute definitions:

type(close|continue|number|responses|text) This attribute specifies what type of NPC conversation will trigger this block.

1. close - The NPC message box has the "close" button. 2. continue - The NPC message box has the "next" button. 3. number - The NPC shows a number input box. 4. responses - The NPC shows a list of responses. 5. text - The NPC shows a text input box.

Note: If this option is not specified, the block will be triggered on any type of NPC conversation.

useColors(boolean flag)v.1.1.0 By default, matching of NPC messages with the specified patterns on the msg_ attributes exclues the color codes (e.g. ^FF0000). If this attribute is set to 1, the pattern matching will include the color codes so you can inspect these codes on the process.

respIgnoreColor (boolean flag) Remove RO color codes <npc response>

delay(seconds)v.2.0.0 This specifies the number of seconds to wait before executing the command. (Recommended for anti-bot NPCs that marks the time of response.)

msg_(number) (message|regexp) This is a list of attributes that specifies the lines of messages that should be checked on the NPC conversation. The number starts from 0 and increses in increments of 1. You can specify either a simple message or a regexp.

@eval(expression)This keyword can be used to evaluate simple expressions (e.g. math equations).

@resp(pattern)v.1.1.0This keyword can be used to search the response list for certain patterns and return the index of the found response. This is particularly useful for dynamically changing response list.The pattern can be a simple string or a regexp.

#(line number)~(match index)If you use capturing parenthsis in the regexp you specified on a msg_# attribute, this keyword will be resolved to the value of the captured string. The line number corresponds to the number of the msg_# attribute where the regexp is used, while the match index corresponds to the index of the captured string.

Nesting command keywords:v.1.1.0As of version 1.1.0, you can nest keywords like @resp(@eval(...)). Note however that the characters "@" and ")" are metacharacters and cannot be used normally inside the keywords. If you need to include such metacharacters in your keyword, escape them by preceding these characters with the "@" character (e.g. "@@", "@)").

Examples:The following example is the currently used NPC conversation of the AndzRO Anti-bot System. Use type number because the NPC asks for a numeric input. The 5 lines of messages are specified on the msg_# attributes with the 2nd and 4th lines using a regexp to capture the numbers. The command that will be used contains the keyword @eval() to add the captured numbers.If you wanna use any text or number from the text of NPC just use parentheses on it and address it as a variable on the code, like this:The #1~1 means: #1 = msg_1 -> variable is at line 1.~1 = first parentheses -> variable is the text, number or anything inside the first parentheses.

TIP2:Search at the old forum, there are a lot of made configs in there.

If you think the plugin does not respond to your NPC, you may have misconfigured your reactOnNPC block. Set debug to 1 in your config.txt and read how the reactOnNPC plugin works whenever you talk to the NPC.

DISCLAIMERTHIS PLUGIN IS DISTRIBUTED "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PLUGIN. <!--

Known Bugs: by MucilonThis nesting command wasn't work when I try to use it at a Brazilian server, so I had to change it to use, but what I made works just to nesting commands and isn't the one posted in here. I can post it further at discussion forum to try make it general, need advanced regexp knowledge!

hey mucilon.just asking, does this plugin screw up with the normal kore configs u have set for NPC responses? also, am i able to use this to react with an NPC which appears to be a monster to openkore. cus the situation now is that openkore thinks that npc (nine tail) is a monster and attacks it.den the nine tail will talk and i get stuck lol.so was wondering if this would work in solving the problem

Yes...You just need to configure the messages sent by the npc and select the answers. You could also make a macro to answer, using console to trigger and the talknpc command to answer, did you try it? I'm assuming the npc only ask questions, which the answers are: ok, next, select an answer, cancel, ...

You forgot somethings and made other things wrong...You used the same variable twice, forgot to end the return command, misplaced a lot of things at the msg_1 and _2, misplace the [] and at msg_2 was missing two blocks of [\s*\^([0-9a-fA-F]{6})(\d)\^[0-9a-fA-F]{6}\s*\].Try this one now:

it dosent respond at all and the number is random from a combination of 2 set of single number to 2 set of triplet numberthey didnt ask u to add the number up but rather just pair them together and type them as a whole number

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum