Hi,thanks for the god's work u doing here answering question.c4c1n6kr3m1 wrote:can you test this style? this one accept plus minus sign or others math operatorheadlesscarmen wrote: anyone has a solution, for 3 days im dreading this.hahaCode: Select all
reactOnNPC_debug 1 reactOnNPC eval {my $number1 = "#1~1";my $number2 = "#1~1";my $opsign = "#2~1";my $answer = eval("$number1 $opsign $number2");message("The answer is $answer\n","info");Commands::run("talk num $anwser")} { type number useColors 1 delay 5 msg_0 /\[ Anti BOT System \]/ msg_1 /If A = (\d+)\s+B = (\d+)/ msg_2 /How many is A (.) B ?/ }
here is the debug code after i tested it.
You are now: state: Frozen
Options changed.
You are now immune to attacks.
You are now: Endure
You are now: Berserk (Duration: 1000000s)
Unknown #110014448: [ Anti BOT System ]
[reactOnNPC] NPC message saved (0): "[ Anti BOT System ]".
Unknown #110014448: If A = 67 B = 5
[reactOnNPC] NPC message saved (1): "If A = 67 B = 5".
Unknown #110014448: How many is A - B ?
[reactOnNPC] NPC message saved (2): "How many is A - B ?".
[reactOnNPC] onNPCAction type is: number.
[reactOnNPC] Conditions for reactOnNPC_0 (npc:number , rect:number) is met.
[reactOnNPC] Matching [msg (0)] "[ Anti BOT System ]" to "/\[ Anti BOT System \]/" ... regexp ok.
[reactOnNPC] Matching [msg (1)] "If A = 67 B = 5" to "/If A = (\d+)\s+B = (\d+)/" ... regexp ok.
[reactOnNPC] Matching [msg (2)] "How many is A - B ?" to "/How many is A (.) B ?/" ... regexp ok.
[reactOnNPC] React to NPC with delay. Execute command "eval {my $number1 = "67";my $number2 = "67";my $opsign = "-";my $answer = eval("$number1 $opsign $number2");message("The answer is $answer\n","info");Commands::run("talk num $anwser")}" after 5 seconds.
: Type 'talk num <number #>' to input a number.
Allowed other player invite to Party
Other players are not allowed to view your Equipment.
[reactOnNPC] Reacting to NPC. Executing command "eval {my $number1 = "67";my $number2 = "67";my $opsign = "-";my $answer = eval("$number1 $opsign $number2");message("The answer is $answer\n","info");Commands::run("talk num $anwser")}".
The answer is 0
Syntax Error in function 'talk' (Talk to NPC)
Usage: talk <NPC # | "NPC name" | cont | resp | num | text > [<response #>|<number #>]
this work very well but only for addition question. The anti bot system ask addition and subtraction question.