Code: Select all
proc relay:text {nick uhost handle chan text} {
global relay
if {[isop $nick $chan] == "1"} {
if {[string range "$nick" 0 0] != "^"} {return 0}
# if {[string match "*m*" [getchanmode $chan]] == "0"} { return 0 }
foreach badpub $relay(badpubs) { if {[string match "$badpub" [string tolower $text]] == "1"} { return 0 } }
regsub -all {FOUR} $text "10,09FOUR" text
regsub -all {SIX} $text "11,12SIX" text
regsub -all {OUT} $text "04,01OUT" text
if {[string range "$nick" 0 0] == "^"} { set nick "[string range "$nick" 1 end]" }
if {[llength [split $nick "_"]] == "2" && [lindex [split $nick "_"] 0] != "" && [lindex [split $nick "_"] 1] != ""} { set nick "[lindex [split $nick "_"] 0] VS [lindex [split $nick "_"] 1]" }
relay:send "PRIVMSG $relay(channel_out) :$nick: $text"
}
When the bot recieves the word FOUR SIX AND OUT, it changes the color pattern of it and shows in the channel. The way "FOUR, SIX & OUT" are added, I want something like:regsub -all {FOUR} $text "10,09FOUR" text
regsub -all {SIX} $text "11,12SIX" text
regsub -all {OUT} $text "04,01OUT" text
I tried that but giving me error.. What could be the best way adding numeric values?regsub -all {0} $text "NO RUN" text
regsub -all {1} $text "ONE RUN" text
regsub -all {2} $text "TWO RUNS" text
Question 2:
If you get a Nickname like :
NICK_NICK_ and I want to make it NICK VS NICK: how will you do that? can you help me out ?
Somethign like this:?
Code: Select all
if {[llength [split $nick "_"]] == "2" && [lindex [split $nick "_"] 0] != "" && [lindex [split $nick "_"] 1] != ""} { set nick "[lindex [split $nick "_"] 0] VS [lindex [split $nick "_"] 1]" }