This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Reading colored text?

Old posts that have not been replied to for several years.
Locked
w
whoracle
Voice
Posts: 2
Joined: Thu Sep 22, 2005 11:50 am

Reading colored text?

Post by whoracle »

This is my first script so im totally new to this.

Anyhow, I try to make a script that will read certain messages (filter out from mainchat), and if it matches, copy a string from the message (not the whole message) and put it in a file. I think everything is done and working except that the script wont get any data when I try it in the real channel where parts of the message is colored. I have tried it myself with all black text and then it worked.

How should I specify the string that the script will look for?

"Thank you" is colored, and then it changes color to number 07. should it look like:

Code: Select all

bind pubm o "#channel *Thank you<\00307*" log:log
or:

Code: Select all

bind pubm o "#channel *Thank you<07*" log:log
as it says when i view the botchatthingy (./eggdrop -n)?

the same problem in this code:

Code: Select all

set checktext [string first "Points<\00315Filled:" $logging]
I have read, and searched but did not find anything. please help!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You can strip the text using the [stripcodes] command (read tcl-commands.doc) and then using [string match] to match the text.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

[stripcodes] will work on 1.6.17 only

this will work on any eggdrop:

Code: Select all

regsub -all {([\002\017\026\037]|[\003]{1}[0-9]{0,2}[\,]{0,1}[0-9]{0,2})} $str {} str
(not on ANSI colors though, but those aren't used much on IRC anyway)
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
w
whoracle
Voice
Posts: 2
Joined: Thu Sep 22, 2005 11:50 am

Post by whoracle »

ok, thanks. I will try this as soon as i get some spare time...
Locked