egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reading colored text?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
whoracle
Voice


Joined: 22 Sep 2005
Posts: 2

PostPosted: Thu Sep 22, 2005 12:05 pm    Post subject: Reading colored text? Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Sep 22, 2005 12:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Sep 23, 2005 1:11 am    Post subject: Reply with quote

[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
View user's profile Send private message Visit poster's website
whoracle
Voice


Joined: 22 Sep 2005
Posts: 2

PostPosted: Fri Sep 23, 2005 6:11 pm    Post subject: Reply with quote

ok, thanks. I will try this as soon as i get some spare time...
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber