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.
Old posts that have not been replied to for several years.
b
bozo
Post
by bozo » Thu Sep 18, 2003 12:59 pm
i was trying to use the var $strip in my tcl , but the eggdrop returns that this variable doesn't is avaiable not configured yet or something like that
how i set this variable in the tcl to my eggdrop reads the lines in the chanel without any codes , color codes , bold , underline etc .....
i want that works like scripting language $strip($i)
$i is already the full line (and already configured) in the channel that my eggdrop reads , i want it striped
thanks
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Sep 18, 2003 2:00 pm
use something like:
and this:
Code: Select all
proc ctrl:filter {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
Thanks to ppslim for the strip code.
Once the game is over, the king and the pawn go back in the same box.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Sep 18, 2003 2:00 pm
do a forum search, you will find a procedure provided by Ppslim that strips all control characters from the text.
b
bozo
Post
by bozo » Thu Sep 18, 2003 2:33 pm
just added what you said to my tcl , and the eggdrop returned this
Code: Select all
[15:26] Tcl error in file 'eggdrop.conf':
[15:26] can't read "text": no such variable
while executing
"ctrl:filter $text"
invoked from within
"set text [ctrl:filter $text] "
(file "scripts/aprender.tcl" line 130)
invoked from within
"source scripts/aprender.tcl
"
(file "eggdrop.conf" line 1363)
[15:26] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
[/code]
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Thu Sep 18, 2003 2:51 pm
caesar wrote: use something like: ...
Filtering "a\003,\0030,\0030,0b" should result in "a,,b", not "ab" (like the proc you pasted)
Try
Code: Select all
proc ctrlfilter {str} {
regsub -all {\002|\003([0-9]{1,2}(,[0-9]{1,2})?)?|\017|\026|\037} $str "" str
return $str
}
and btw: \006 & \007 ain't mirc control codes
Have you ever read "The Manual"?
b
bozo
Post
by bozo » Thu Sep 18, 2003 2:54 pm
the problem is here
the eggdrop says that can't find "text" variable ...
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Thu Sep 18, 2003 2:57 pm
bozo wrote: the eggdrop says that can't find "text" variable ...
if your text is in "i", why are you trying to filter "text"?
Have you ever read "The Manual"?
b
bozo
Post
by bozo » Thu Sep 18, 2003 3:14 pm
thanks everybody
i tryed put the code you guys send to me every place in the tcl
and finally it worked
the bot doesnt acept color codes , bold etc , but , i have problems with case sensitive .....
how i resolve this?
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Thu Sep 18, 2003 3:20 pm
bozo wrote: i have problems with case sensitive .....
how i resolve this?
Some commands have a -nocase option. (check the
manual ) If the command you're using doesn't have this, convert the strings to lowercase using '
string tolower '
Have you ever read "The Manual"?
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Sep 18, 2003 4:01 pm
Bugg ppslim with the ctrl:filter proc
I'm using it and is working fine at me.. also, doh! I've gave you an example with the
set text [ctrl:filter $text] .. don't take it *ad literam*
PS: Here is a lil test to proove that ppslim control filter thing is working fine:
Code: Select all
bind pub - !bla pub:bla
proc pub:bla {nick uhost hand chan text} {
putserv "PRIVMSG $chan :result: [ctrl:filter $text]"
}
proc ctrl:filter {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
Just do a !bla something with bold or whatever you want and then see by yourself what is the result..
Once the game is over, the king and the pawn go back in the same box.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Thu Sep 18, 2003 4:20 pm
caesar wrote: I'm using it and is working fine at me.
Sure..if you don't care about losing stuff that is not part of the color code
Try my example and you'll see what I mean.
Have you ever read "The Manual"?
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Sep 18, 2003 4:46 pm
What you mean by "losing stuff that is not part of the color code" ? I'll have a look on yours tomorow, not I'm off to bed.
Once the game is over, the king and the pawn go back in the same box.
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Thu Sep 18, 2003 5:00 pm
I havn't got chance to check, however, is the bugger version actualy included in no!spam, or have you altered yours on accident?
The loss of such things is trivial, though it is still incorrect.
As for the non-mirc codes. Correct, however, both are two well used codes.
007 is BEL.
006 is used by other client, which I can't remember.
I should also have 011 in as mIRC will render it as a tab with certain fonts.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Fri Sep 19, 2003 12:30 pm
I'ts the same code as you've *sugested* to me in a post long time ago.. Thanks for pointing that out.
Once the game is over, the king and the pawn go back in the same box.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sat Sep 20, 2003 1:53 pm
Funny.. I do see that the same proc as I've posted above is still used in the no!spam 1.7.2.. so, wich is wich? I'm a bit confused..
Once the game is over, the king and the pawn go back in the same box.