responseOnASCIInumber.pl #for response BotKiller(ASCII)

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
Mucilon
Cybernatic Entity
Cybernatic Entity
Posts: 249
Joined: 04 Apr 2008, 13:15
Noob?: Yes
Location: Brazil

responseOnASCIInumber.pl #for response BotKiller(ASCII)

#1 Post by Mucilon »

Topic contents:
NPC with more than 5 lines for ASCII graphics

Just for the record, I never used this plugin, but can try to help!
This plugin was made and post at the old forum by windows98SE@thaikore. You can find a lot of useful information at this link: http://bibian.ath.cx/openkore/viewtopic.php?t=32782.

What it does:
You use it for response BotKiller #1 - Method 4: ASCII number, working together to the hakore's reactOnNPC plugin.
(http://www.eathena.ws/board/index.php?showtopic=120522)
Version of Openkore Required: OpenKore 1.9.x (tested in Opk 2.0.5.1)

v.3 by 4epT (24/08/2013)
- optimized plugin
- remove the extra variables
- add new number

v.2.2.1 by Windows98SE (08/06/2008)
- change name&prefix from responseOnASCIInumber to ASCIInumberKiller (b'cus my anti-bot set is name "ACkiller, ActorKiller" ^^")
- update note (you must read my note in plugin befor use "ASCIInumberKiller")
- can set background color in config block by regexp or hexcode (can use 'regexp|color1|color2|color3' for fix some color)

v.2.2 by Mucilon (04/06/2008)
- Add options to the config.txt file
- Add colorCode, to support more than 1 server color pattern

v.2.1
- Fix "Error in function 'talk num' (Respond to NPC) You must specify a number." - fix
- *resp multi line [ex. img]

v.1.3
- Fix Regex
- add %digit

v.1.2
- Fix Regex

v1.1
- add note03
- support 0-9,A-Z
- add sub onDebug
- fix some code

v1.0
- support only digit 0-9 : (if you read my note or the mini tutorial, you can add it by yourself ^^)

How to install:
1) Place this plugin in your plugins folder (see the Plugins FAQ how or macro plugin manual at my signature).
2) Don't forget to also download the reactOnNPC plugin and place it at the plugins folder, without it won't work!
3) 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.

How to use:
At config.txt use this:

Code: Select all

ASCIInumberKiller {
 lengthCharNumber 8
 BgColor ^[D-Fd-f][A-Fa-f0-9][D-Fd-f][A-Fa-f0-9]{3}
}
Where:
lengthCharNumber = length of characters at each line of each number
BgColor = background color pattern of your server, you can use other colors like this:
BgColor ^[D-Fd-f][A-Fa-f0-9][D-Fd-f][A-Fa-f0-9]{3}|^FFFFFF|^FFFFFA|code hexcolor you server|color_brabra|..
Just the background color pattern ^[D-Fd-f][A-Fa-f0-9][D-Fd-f][A-Fa-f0-9]{3} will work for most of the servers.
The operator | is the operator or, so you can add other color codes at your will. Don't forget to use the ^ at the begining.
If you tried some codes and you still can't read clearly the numbers, post your console, so I can create another color pattern to your server.

And something like this: (still at config.txt file)

Code: Select all

#Use this when you need to answer a number
reactOnNPC ASCIInumberKiller num {
	type number
		msg_0 /.*/
		msg_1 /.*/
		msg_2 /.*/
		msg_3 /.*/
}

#Use this when you need to answer a text
reactOnNPC ASCIInumberKiller text {
	type text
		msg_0 /.*/
		msg_1 /.*/
		msg_2 /.*/
		msg_3 /.*/
}
Image
Image

TIP 1: You can find useful information about HEX code colors at: http://www.drpeterjones.com/colorcalc/
TIP 2: If after all, your bot got the error Error in function 'talk num' (Respond to NPC). You must specify a number, this means that you need to input your server's numbers to the plugin, so there is a mini Tutorial of how input your server numbers to the plugin file.
TIP 3: And if you can't see any number at your console, you probable forgot to add the ASCIInumberKiller block at your config.txt file.
TIP 4: You can find useful information about regexp (the code used to compare the colors) at the quick regexp tutorial or at the complete regexp tutorial. Regexp = Perl Regular Expression.
TIP 5: Beware, during the procedure of inputing your server's numbers to the plugin, you may lost some accounts banned or chars jailed to get the correct number and / or letters.


reactOnNPC.pl
responseOnASCIInumber.pl

I hope you enjoy it! ;)


== NOTE ==

Here we must take into account the peculiarity of the plugin. He is looking for numbers, consisting of 5 lines, and in your NPC is used 7 lines:
1: ############==#####################
2: ############==####==###############

3: ############==####==###############
4: ############==####==###############
5: ############=========##############
6: ##################==###############
7: ##################==###############

1: ############========###############
2: ############==####==###############
3: ################==#################
4: ###############==##################
5: ###############==##################
6: ###############==##################
7: ###############==##################
But you can use a trick! You can cut our numbers up to 5 lines (above, below or one line from above and one line from below - it does not matter):
3: ############==####==###############
4: ############==####==###############
5: ############=========##############
6: ##################==###############
7: ##################==###############

1: ############========###############
2: ############==####==###############
3: ################==#################
4: ###############==##################
5: ###############==##################
Then need to select our number consisting of 5 lines and 9 characters:
3: ==####==#
4: ==####==#
5: =========
6: ######==#
7: ######==#

1: ========#
2: ==####==#
3: ####==###
4: ###==####
5: ###==####
Then convert that number in one line:
'==####==#==####==#=========######==#######==#' => 4,

'========#==####==#####==######==#######==####' => 7,
Last edited by Mucilon on 17 Oct 2008, 15:08, edited 12 times in total.

dembuonvn
Noob
Noob
Posts: 3
Joined: 25 Apr 2008, 10:12

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#2 Post by dembuonvn »

the plugin not work in version 2.0.6 . Please fix it :(

Mucilon
Cybernatic Entity
Cybernatic Entity
Posts: 249
Joined: 04 Apr 2008, 13:15
Noob?: Yes
Location: Brazil

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#3 Post by Mucilon »

OK...
It had a problem... I change the first post, you can download again.
I assure that it run at 2.0.5.1, don't know at the SVN version.

kingkevz
Human
Human
Posts: 25
Joined: 04 Apr 2008, 22:55

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#4 Post by kingkevz »

i cant solve it please help me

Image

#Use this when you need to answer a number
reactOnNPC ASCIInumber num {
type number
msg_0 /.*/
msg_1 /.*/
msg_2 /.*/
msg_3 /.*/
msg_4 /.*/
msg_5 /.*/
msg_6 /.*/
}

#Use this when you need to answer a text
reactOnNPC ASCIInumber text {
type text
msg_0 /.*/
msg_1 /.*/
msg_2 /.*/
msg_3 /.*/
msg_4 /.*/
msg_5 /.*/
msg_6 /.*/
}

and what i will right in the ASCII number text and num

dembuonvn
Noob
Noob
Posts: 3
Joined: 25 Apr 2008, 10:12

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#5 Post by dembuonvn »

i was try it on version 2.0.5. it not work because method run and register, unregister can not exported from Command module .

dembuonvn
Noob
Noob
Posts: 3
Joined: 25 Apr 2008, 10:12

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#6 Post by dembuonvn »

sorry muscino i were tested the latest pl files. its ok on version 2.0.5 thank you so much

Mucilon
Cybernatic Entity
Cybernatic Entity
Posts: 249
Joined: 04 Apr 2008, 13:15
Noob?: Yes
Location: Brazil

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#7 Post by Mucilon »

kingkevz,
first of all, did you install the plugin? And used the block below at config.txt file?
Next time post the console like a text... turn on the logConsole at config.txt, like this: logConsole 0 change it to logConsole 1 and search the file console.txt at your logs folder. Like this, you don't have to edit image files...

Code: Select all

reactOnNPC ASCIInumber num {
type number
msg_0 /.*/
msg_1 /.*/
msg_2 /.*/
msg_3 /.*/
msg_4 /.*/
msg_5 /.*/
msg_6 /.*/
}
dembuonvn, no problem!

kingkevz
Human
Human
Posts: 25
Joined: 04 Apr 2008, 22:55

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#8 Post by kingkevz »

yes i already did it but i dont know what will i write in that reactOnNPC ASCIInumber num

Mucilon
Cybernatic Entity
Cybernatic Entity
Posts: 249
Joined: 04 Apr 2008, 13:15
Noob?: Yes
Location: Brazil

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#9 Post by Mucilon »

You don't need to write nothing... ASCIInumber num already is a command registered at the responseOnASCIInumber plugin.
When the text received from the NPC matchs the msg_X, the plugin will run!

kingkevz
Human
Human
Posts: 25
Joined: 04 Apr 2008, 22:55

Re: responseOnASCIInumber.pl #for response BotKiller(ASCII)

#10 Post by kingkevz »

why mine is not running???

Locked