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.

Trigger on text ignoring applied color codes

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Trigger on text ignoring applied color codes

Post by Arnold_X-P »

is possible that the tcl recognizes the colors in the command !version example !version or !version


bind pub - !version version

proc version {nick host hand chan arg} {
global botnick
puthelp "NOTICE $nick :I am a called $botnick. running in [lindex $version 0]"
}

that the tcl also recognizes the command in colors :P
Last edited by Arnold_X-P on Thu Oct 13, 2016 10:23 pm, edited 1 time in total.
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

I me do not work why my question is

command !version example !version or !version

that the command in open channel recognizes colors in bind pub - !version version

-----------------------------

bind pub - !version version

proc version {nick host hand chan arg} {
global botnick
puthelp "NOTICE $nick :I am a called $botnick. running in [lindex $version 0]"
}
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

proc striprivmsg

Post by SpiKe^^ »

Yes, exactly.

That code linked above is the only sure-fire way I know to have binds trigger on colored text.

The reason proc version is not replying is that glaring error you must be ignoring.

And yes, striprivmsg does in fact work great:) Try it something like this...

Code: Select all

catch {unbind raw - PRIVMSG *raw:irc:msg} 
bind raw - PRIVMSG striprivmsg 

proc striprivmsg {f k a} { 
  set a [string map [list \017 ""] [stripcodes abcgru $a]] 
  *raw:irc:msg $f $k $a 
} 

bind pub - !version version 

proc version {nick host hand chan arg} { 

  # !!!! If you are going to use the global $version, you must list it here !!!! #
  global botnick version

  puthelp "NOTICE $nick :I am a called $botnick. running in [lindex $version 0]" 
}

Last edited by SpiKe^^ on Fri Oct 14, 2016 7:10 pm, edited 2 times in total.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

I me do not work why my question is

command !version example !version or !version

that the command in open channel recognizes colors in bind pub - !version version

Code: Select all

bind pub - !version version

proc version {nick host hand chan arg} {
global botnick
puthelp "NOTICE $nick :I am a called $botnick. running in [lindex $version 0]"
}
Image
Last edited by Arnold_X-P on Tue Oct 18, 2016 7:56 pm, edited 2 times in total.
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Edited my above post to show your reasons and fix.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

perfect bros :))


I would like that now its tcl is a global general for all the tcl and that it works so .. is possible bros ?
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

friend works very quite thank you
I it added the .conf and its code is employed at global form
thank you
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

spike^^
notice that its tcl works only in open channel
but it does not work when it is in privately texts with colors in the bot
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

SpiKe^^it works very well, now the bot will ignore the colors in the texts.
the combining both tcl, (SpiKe^^ and caesar of -> http://forum.egghelp.org/viewtopic.php?t=19880)

the combination of both tcl, it gave like the result to which this works well, they do not pay attention of the colors in the texts in the open channel as well as also in the private one.
thanks SpiKe^^ and caesar for the help..


NOTE..

so that this tcl should work in global form it is necessary to add this one
tcl in the .conf like that the tcl will work in global form

Code: Select all

catch {unbind raw - PRIVMSG *raw:irc:msg}
catch {unbind raw - PRIVMSG *raw:PRIVMSG}

bind raw - PRIVMSG striprivmsg
proc striprivmsg {f k a} {
  set a [string map [list \017 ""] [stripcodes abcgru $a]]
  *raw:irc:msg $f $k $a
  *raw:PRIVMSG $f $k $a
}    
ignore colors in the texts, in the open channel

Image

ignore colors in the texts, in the private bot

Image
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

hi spike^^

the tcl works very well but it works by grabbing all the tcl it is possible that it only works in a tcl..

example
that works only in the tcl where it was added.
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
Post Reply