| View previous topic :: View next topic |
| Author |
Message |
whoracle Voice
Joined: 22 Sep 2005 Posts: 2
|
Posted: Thu Sep 22, 2005 12:05 pm Post subject: Reading colored text? |
|
|
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: | | bind pubm o "#channel *Thank you<\00307*" log:log |
or:
| Code: | | 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: | | set checktext [string first "Points<\00315Filled:" $logging] |
I have read, and searched but did not find anything. please help! |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Sep 22, 2005 12:41 pm Post subject: |
|
|
You can strip the text using the [stripcodes] command (read tcl-commands.doc) and then using [string match] to match the text. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Sep 23, 2005 1:11 am Post subject: |
|
|
[stripcodes] will work on 1.6.17 only
this will work on any eggdrop:
| Code: |
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] tag when posting logs, code |
|
| Back to top |
|
 |
whoracle Voice
Joined: 22 Sep 2005 Posts: 2
|
Posted: Fri Sep 23, 2005 6:11 pm Post subject: |
|
|
| ok, thanks. I will try this as soon as i get some spare time... |
|
| Back to top |
|
 |
|