reactOnNPC v.2.0.2 by hakore

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
luocongo
Human
Human
Posts: 22
Joined: 02 Aug 2009, 13:00
Noob?: Yes

Re: reactOnNPC v.2.0.2 by hakore

#421 Post by luocongo »

is there a way to make openkore console show the color code without using the plugin?
I tried to modify the receivie.pm and disabled remove color code link and still not working.

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: reactOnNPC v.2.0.2 by hakore

#422 Post by c4c1n6kr3m1 »

useColors 1 inside your config block

https://github.com/OpenKore/openkore/bl ... README.txt

headlesscarmen
Noob
Noob
Posts: 17
Joined: 08 Oct 2018, 15:54
Noob?: Yes
Location: Kuala Lumpur,Malaysia

Re: reactOnNPC v.2.0.2 by hakore

#423 Post by headlesscarmen »

headlesscarmen wrote:Hi, i seems to having problem determining addition and subtraction for my code.

Console log

Code: Select all

You are now: state: Frozen
Welcome to Rise Ragnarok! Enjoy! Please report any bugs you find.
Map Change: morocc.gat (157, 92)
You have new unread rodex mails.
Packet Parser: Unknown switch: 097B
Unknown #110065841: [ Anti BOT System ]
[reactOnNPC] NPC message saved (0): "[ Anti BOT System ]".
Unknown #110065841: If A = 87   B = 3
[reactOnNPC] NPC message saved (1): "If A = 87   B = 3".
Unknown #110065841: 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)] [color=#0000FF]"[ Anti BOT System ]" to "/[ Anti BOT System ]/" ... regexp ok.
[reactOnNPC] Matching [msg (1)] "If A = 87   B = 3" 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 "talk num 87" after 5 seconds.[/color]
itself: Type 'talk num <number #>' to input a number.
[reactOnNPC] Reacting to NPC. Executing command "talk num 87".
Unknown #110065841: ------------------------
[reactOnNPC] NPC message saved (0): "------------------------".
Unknown #110065841: Wrong
[reactOnNPC] NPC message saved (1): "Wrong".
Incoming data left in the buffer:
my reactOnNPC code

Code: Select all

reactOnNPC_debug 1
reactOnNPC talk num @eval(#0~1 #1~1 #0~2) {
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 ?/
}
it register/matching well but it seems i failed at the most important step, the math it self.Any help is much appericiated.
anyone has a solution, for 3 days im dreading this.haha

luocongo
Human
Human
Posts: 22
Joined: 02 Aug 2009, 13:00
Noob?: Yes

Re: reactOnNPC v.2.0.2 by hakore

#424 Post by luocongo »

Someone please help with this debug

screenshot
https://gyazo.com/00073060b69516e3939e85271925e7e1

Code: Select all

debug info

[Nov 19 01:03:09 2018.16] [reactOnNPC] NPC message saved (0): "[ 验证提示 ] : ".
[Nov 19 01:03:09 2018.19] [reactOnNPC] NPC message saved (1): "你已经累积打怪数量达到[5000]只,根据规定现在开始进行验证!!".
[Nov 19 01:03:09 2018.23] [reactOnNPC] NPC message saved (2): "总共有[^0000FF3^000000]次机会进行验证,现在进行第[^FF00001^000000]次验证!!".
[Nov 19 01:03:09 2018.25] [reactOnNPC] onNPCAction type is: continue.
[Nov 19 01:03:09 2018.27] [reactOnNPC] Conditions for reactOnNPC_0 (npc:continue, rect:number) 'type' not met.
[Nov 19 01:03:09 2018.28] : 输入 'talk cont' 继续对话
[Nov 19 01:03:09 2018.91] You are no longer: Action Delay
[Nov 19 01:03:10 2018.65] [reactOnNPC] NPC message saved (0): "请输入^0000FF此颜色^000000的一组验证码!!".
[Nov 19 01:03:10 2018.77] [reactOnNPC] NPC message saved (1): "^FF0000验证码:[ 5766 ]^000000".
[Nov 19 01:03:10 2018.83] [reactOnNPC] NPC message saved (2): "^0000FF验证码:[ 9964 ]^000000".
[Nov 19 01:03:10 2018.87] [reactOnNPC] NPC message saved (3): "^00FF00验证码:[ 1131 ]^000000".
[Nov 19 01:03:10 2018.92] [reactOnNPC] NPC message saved (4): "^D02090验证码:[ 8367 ]^000000".
[Nov 19 01:03:10 2018.94] [reactOnNPC] onNPCAction type is: number.
[Nov 19 01:03:10 2018.97] [reactOnNPC] Conditions for reactOnNPC_0 (npc:number , rect:number) is met.
[Nov 19 01:03:10 2018.99] [reactOnNPC] Matching [msg (0)] "请输入^0000FF此颜色^000000的一组验证码!!" to "/请输入(\^[0-9a-fA-F]{6})此颜色/" ... regexp ok.
[Nov 19 01:03:11 2018.15] [reactOnNPC] Matching [msg (1)] "^FF0000验证码:[ 5766 ]^000000" to "/(\^[0-9a-fA-F]{6})验证码:\[ (\d+) \]/" ... regexp ok.
[Nov 19 01:03:11 2018.38] [reactOnNPC] Matching [msg (2)] "^0000FF验证码:[ 9964 ]^000000" to "/(\^[0-9a-fA-F]{6})验证码:\[ (\d+) \]/" ... regexp ok.
[Nov 19 01:03:11 2018.61] [reactOnNPC] Matching [msg (3)] "^00FF00验证码:[ 1131 ]^000000" to "/(\^[0-9a-fA-F]{6})验证码:\[ (\d+) \]/" ... regexp ok.
[Nov 19 01:03:11 2018.85] [reactOnNPC] Matching [msg (4)] "^D02090验证码:[ 8367 ]^000000" to "/(\^[0-9a-fA-F]{6})验证码:\[ (\d+) \]/" ... regexp ok.
[Nov 19 01:03:11 2018.12] [reactOnNPC] React to NPC with delay. Execute command "talk num 0" after 5 seconds.
[Nov 19 01:03:11 2018.14] itself: 输入 'talk num <nomer #>' 指定对话内容.
[Nov 19 01:03:16 2018.37] [reactOnNPC] Reacting to NPC. Executing command "talk num 0".
[Nov 19 01:03:16 2018.16] Unknown #110025506: 你输入的验证码为[ 1000 ]!!
[Nov 19 01:03:16 2018.23] [reactOnNPC] NPC message saved (0): "你输入的验证码为[ 1000 ]!!".
[Nov 19 01:03:16 2018.30] Unknown #110025506: 对不起,验证码输入错误!!
[Nov 19 01:03:16 2018.34] [reactOnNPC] NPC message saved (1): "^FF0000对不起,验证码输入错误!!^000000".



My Script
reactOnNPC talk num @eval(my $color1 = #1~1;my $color2 = #2~1;my $color3 = #3~1;my $color4 = #4~1;my $num1 = #1~2;my $num2 = #2~2;my $num3 = #3~2;my $num4 = #4~2;my $output = 0;if ($color1 eq '#0-1'@) {$output = $num1;}if ($color2 eq '#0-1'@) {$output = $num2;}if ($color3 eq '#0-1'@) {$output = $num3;}if ($color4 eq '#0-1'@) {$output = $num4;}return $output;) {
	type number
	useColors 1
	delay 5
	msg_0 /请输入(\^[0-9a-fA-F]{6})此颜色/
	msg_1 /(\^[0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_2 /(\^[0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_3 /(\^[0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_4 /(\^[0-9a-fA-F]{6})验证码:\[ (\d+) \]/
}

luocongo
Human
Human
Posts: 22
Joined: 02 Aug 2009, 13:00
Noob?: Yes

Re: reactOnNPC v.2.0.2 by hakore

#425 Post by luocongo »

try put \ before +

Code: Select all

reactOnNPC_debug 1
reactOnNPC talk num @eval(#0~1 #1~1 #0~2) {
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 ?/
}

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: reactOnNPC v.2.0.2 by hakore

#426 Post by c4c1n6kr3m1 »

i never play ps
:heh
headlesscarmen wrote:

Code: Select all

reactOnNPC_debug 1
reactOnNPC talk num @eval(my $number1 = '#1~1';my $number2 = '#1~2';return $number1 + $number2) {
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 ?/
}
or reactOnNPC talk num @eval(#1~1 + #1~2) {

or read the readme.txt inside your plugin
there is an example similar with yours

luocongo
Human
Human
Posts: 22
Joined: 02 Aug 2009, 13:00
Noob?: Yes

Re: reactOnNPC v.2.0.2 by hakore

#427 Post by luocongo »

problem soloved
here is the fix

Code: Select all

reactOnNPC talk num @eval(my $color1 = '#1~1';my $color2 = '#2~1';my $color3 = '#3~1';my $color4 = '#4~1';my $number1 = #1~2;my $number2 = #2~2;my $number3 = #3~2;my $number4 = #4~2;my $anwser = 0;if ($color1 eq '#0~1'@) {$anwser = $number1;}if ($color2 eq '#0~1'@) {$anwser = $number2;}if ($color3 eq '#0~1'@) {$anwser = $number3;}if ($color4 eq '#0~1'@) {$anwser = $number4;} return $anwser) {
	type number
	useColors 1
	delay 5
	msg_0 /请输入\^([0-9a-fA-F]{6})/
	msg_1 /\^([0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_2 /\^([0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_3 /\^([0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_4 /\^([0-9a-fA-F]{6})验证码:\[ (\d+) \]/
}

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: reactOnNPC v.2.0.2 by hakore

#428 Post by c4c1n6kr3m1 »

luocongo wrote:problem soloved
here is the fix

Code: Select all

reactOnNPC talk num @eval(my $color1 = '#1~1';my $color2 = '#2~1';my $color3 = '#3~1';my $color4 = '#4~1';my $number1 = #1~2;my $number2 = #2~2;my $number3 = #3~2;my $number4 = #4~2;my $anwser = 0;if ($color1 eq '#0~1'@) {$anwser = $number1;}if ($color2 eq '#0~1'@) {$anwser = $number2;}if ($color3 eq '#0~1'@) {$anwser = $number3;}if ($color4 eq '#0~1'@) {$anwser = $number4;} return $anwser) {
	type number
	useColors 1
	delay 5
	msg_0 /请输入\^([0-9a-fA-F]{6})/
	msg_1 /\^([0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_2 /\^([0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_3 /\^([0-9a-fA-F]{6})验证码:\[ (\d+) \]/
	msg_4 /\^([0-9a-fA-F]{6})验证码:\[ (\d+) \]/
}
hi
i know you solved yours , but can u test this one, the difference on reactOnNPC command , others are same
replace your reactOnNPC command with this

Code: Select all

reactOnNPC eval {my $color0 = "#0~1";my $color1 = "#1~1";my $color2 = "#2~1";my $color3 = "#3~1";my $color4 = "#4~1";my $number1 = "#1~2";my $number2 = "#2~2";my $number3 = "#3~2";my $number4 = "#4~2";my $anwser = 0;if ($color1 eq $color0) {$anwser = $number1;}if ($color2 eq $color0) {$anwser = $number2;}if ($color3 eq $color0) {$anwser = $number3;}if ($color4 eq $color0) {$anwser = $number4;} Commands::run("talk num $anwser")} {

because i don't like the "@)"

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: reactOnNPC v.2.0.2 by hakore

#429 Post by c4c1n6kr3m1 »

headlesscarmen wrote: anyone has a solution, for 3 days im dreading this.haha
can you test this style? this one accept plus minus sign or others math operator

Code: 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 ?/
}

headlesscarmen
Noob
Noob
Posts: 17
Joined: 08 Oct 2018, 15:54
Noob?: Yes
Location: Kuala Lumpur,Malaysia

Re: reactOnNPC v.2.0.2 by hakore

#430 Post by headlesscarmen »

c4c1n6kr3m1 wrote:i never play ps
:heh
headlesscarmen wrote:

Code: Select all

reactOnNPC_debug 1
reactOnNPC talk num @eval(my $number1 = '#1~1';my $number2 = '#1~2';return $number1 + $number2) {
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 ?/
}


or reactOnNPC talk num @eval(#1~1 + #1~2) {

or read the readme.txt inside your plugin
there is an example similar with yours
thanks it is working for addition question :D
what are the reg exp math symbol for either + or - ,the anti bot system only have addition and subtraction question.

Post Reply