--- relay-2.1.4.tcl 2004-01-18 10:29:25.000000000 +0000 +++ relay-2.1.5.tcl 2004-01-18 10:30:56.000000000 +0000 @@ -1,7 +1,7 @@ -#// relay.tcl v2.1.4 - Send Channel Text/Acts/Join/Part/Quit/Topc/Nick/Kick/Ban +#// relay.tcl v2.1.5 - Send Channel Text/Acts/Join/Part/Quit/Topc/Nick/Kick/Ban #// Data to one or more networks #// -#// v2.1.4 By: `Kumba +#// v2.1.5 By: `Kumba #// v1.0.0 By: cl00bie #// #// TCL regsub code for mirc code stripping borrowed from mc.moretools by MC_8 @@ -348,22 +348,38 @@ if {$theopts(allow_names) == 1 && $theop #//-------------------------------------------------------------------------------------------------------------- -#// --- Color/Code Stripper --- +#// --- Startup Code --- -#// Strips Mirc Colors/Bold/Underline/Reverse from text -proc stripcodes {text} { - global theopts +#// Clear the Global Variables (If They Exist) +if {[info exists spltbuf] == 1} {array unset spltbuf} +if {[info exists rejnbuf] == 1} {array unset rejnbuf} +if {[info exists linkbuf] == 1} {array unset linkbuf} +if {[info exists discbuf] == 1} {array unset discbuf} +if {[info exists hurtbuf] == 1} {array unset hurtbuf} +if {[info exists replybuf] == 1} {array unset replybuf} +if {[info exists c] == 1} {array unset c} - if {$theopts(strip_codes) == 1} { - regsub -all -- "\003(\[0-9\]\[0-9\]?(,\[0-9\]\[0-9\]?)?)?" $text "" text; #// Color - regsub -all -- "\002" $text "" text; #// Bold - regsub -all -- "\026" $text "" text; #// Reverse - regsub -all -- "\037" $text "" text; #// Underline - } - return $text -} +#// Initialize our Global Variables +set spltbuf(init) "donotremoveme" +set rejnbuf(init) "donotremoveme" +set linkbuf(init) "donotremoveme" +set discbuf(init) "donotremoveme" +set hurtbuf(init) "donotremoveme" +set replybuf(init) "donotremoveme" + + +#// Fix our binds +set_binds + + +#// Configure Colors +configure_colors + + +#// Some people cannot follow directions at times. This prevents such people from screwing the script up +set therelay(channels) [string tolower $therelay(channels)] @@ -372,14 +388,14 @@ proc stripcodes {text} { #// Color Variable Names: -#// $c(%event%%type%) +#// $c() #// -#// Where %event% is equivalent to: +#// Where is equivalent to: #// 1 == pubm; 2 == act; 3 == nick; 4 == mode; 5 == join; 6 == quit; 7 == part #// 8 == topc; 9 == kick; 10 == ban; 11 == splt; 12 == rejn; 13 == link; #// 14 == disc; 15 == names; 16 == privmsg; 17 == gettopic; 18 == help #// -#// Where %type% is equivalent to: +#// Where is equivalent to: #// brac == Angle/Square Brackets/Paranthesis; nick == Nicknames; netw == Networks; #// star == Asterisk; oldn == Old Nickname; newn == New nickname; mode == Modes; #// chan == Channels; host == Userhosts; topc == Topics; kick == Kicks; @@ -417,265 +433,267 @@ proc stripcodes {text} { #// this format. -if {$theopts(master) == 1} { +proc configure_colors {} { + global therelay theopts thecolors c - #// Prefix Stripper - if {$thecolors(master) != 1} { - set therelay(prefix) [stripcodes $therelay(prefix)] - } + if {$theopts(master) == 1} { + #// Prefix Stripper + if {$thecolors(master) != 1} { + set therelay(prefix) [stripcodes $therelay(prefix)] + } - #// Public Chatter - if {$thecolors(pubm) == 1 && $thecolors(master) == 1} { - set c(1brac) "\00314"; #// Dark Grey - Angle Brackets - set c(1nick) ""; #// No Color - Nickname - set c(1netw) ""; #// No Color - Network - set c(1atch) "\00314"; #// Dark Grey - '@' Character - set c(1x) "\003"; #// Color Terminator - } else { - set c(1brac) ""; set c(1nick) ""; set c(1netw) ""; - set c(1atch) ""; set c(1x) ""; - } + #// Public Chatter + if {$thecolors(pubm) == 1 && $thecolors(master) == 1} { + set c(1brac) "\00314"; #// Dark Grey - Angle Brackets + set c(1nick) ""; #// No Color - Nickname + set c(1netw) ""; #// No Color - Network + set c(1atch) "\00314"; #// Dark Grey - '@' Character + set c(1x) "\003"; #// Color Terminator + } else { + set c(1brac) ""; set c(1nick) ""; set c(1netw) ""; + set c(1atch) ""; set c(1x) ""; + } - #// Public Actions - if {$thecolors(act) == 1 && $thecolors(master) == 1} { - set c(2star) "\00314"; #// Dark Grey - Asterisk - set c(2nick) ""; #// No Color - Nickname - set c(2netw) ""; #// No Color - Network - set c(2atch) "\00314"; #// Dark Grey - '@' Character - set c(2x) "\003"; #// Color Terminator - } else { - set c(2star) ""; set c(2nick) ""; set c(2netw) ""; - set c(2atch) ""; set c(2x) ""; - } + #// Public Actions + if {$thecolors(act) == 1 && $thecolors(master) == 1} { + set c(2star) "\00314"; #// Dark Grey - Asterisk + set c(2nick) ""; #// No Color - Nickname + set c(2netw) ""; #// No Color - Network + set c(2atch) "\00314"; #// Dark Grey - '@' Character + set c(2x) "\003"; #// Color Terminator + } else { + set c(2star) ""; set c(2nick) ""; set c(2netw) ""; + set c(2atch) ""; set c(2x) ""; + } - #// Nickname Changes - if {$thecolors(nick) == 1 && $thecolors(master) == 1} { - set c(3oldn) "\00310"; #// Dark Cyan - Old Nickname - set c(3netw) "\00310"; #// Dark Cyan - Network - set c(3newn) "\00303"; #// Dark Green - New Nickname - set c(3atch) "\00314"; #// Dark Grey - '@' Character - set c(3x) "\003"; #// Color Terminator - } else { - set c(3oldn) ""; set c(3netw) ""; set c(3newn) ""; - set c(3atch) ""; set c(3x) ""; - } + #// Nickname Changes + if {$thecolors(nick) == 1 && $thecolors(master) == 1} { + set c(3oldn) "\00310"; #// Dark Cyan - Old Nickname + set c(3netw) "\00310"; #// Dark Cyan - Network + set c(3newn) "\00303"; #// Dark Green - New Nickname + set c(3atch) "\00314"; #// Dark Grey - '@' Character + set c(3x) "\003"; #// Color Terminator + } else { + set c(3oldn) ""; set c(3netw) ""; set c(3newn) ""; + set c(3atch) ""; set c(3x) ""; + } - #// Mode Changes - if {$thecolors(mode) == 1 && $thecolors(master) == 1} { - set c(4mode) "\00310"; #// Dark Cyan - "Mode" - set c(4netw) "\00310"; #// Dark Cyan - Network - set c(4nick) "\00303"; #// Dark Green - Nick that made Mode Change - set c(4brac) "\00314"; #// Dark Grey - Square Brackets - set c(4slsh) "\00314"; #// Dark Grey - Forward Slash - set c(4x) "\003"; #// Color Terminator - } else { - set c(4mode) ""; set c(4netw) ""; set c(4nick) ""; - set c(4brac) ""; set c(4slsh) ""; set c(4x) ""; - } + #// Mode Changes + if {$thecolors(mode) == 1 && $thecolors(master) == 1} { + set c(4mode) "\00310"; #// Dark Cyan - "Mode" + set c(4netw) "\00310"; #// Dark Cyan - Network + set c(4nick) "\00303"; #// Dark Green - Nick that made Mode Change + set c(4brac) "\00314"; #// Dark Grey - Square Brackets + set c(4slsh) "\00314"; #// Dark Grey - Forward Slash + set c(4x) "\003"; #// Color Terminator + } else { + set c(4mode) ""; set c(4netw) ""; set c(4nick) ""; + set c(4brac) ""; set c(4slsh) ""; set c(4x) ""; + } - #// Joins - if {$thecolors(join) == 1 && $thecolors(master) == 1} { - set c(5chan) "\00303"; #// Dark Green - Channel - set c(5host) "\00306"; #// Dark Purple - Hostmask - set c(5nick) "\00310"; #// Dark Cyan - Nickname - set c(5netw) "\00310"; #// Dark Cyan - Network - set c(5brac) "\00314"; #// Dark Grey - Square Brackets - set c(5atch) "\00314"; #// Dark Grey - '@' Character - set c(5x) "\003"; #// Color Terminator - } else { - set c(5chan) ""; set c(5host) ""; set c(5nick) ""; - set c(5netw) ""; set c(5brac) ""; set c(5atch) ""; - set c(5x) ""; - } + #// Joins + if {$thecolors(join) == 1 && $thecolors(master) == 1} { + set c(5chan) "\00303"; #// Dark Green - Channel + set c(5host) "\00306"; #// Dark Purple - Hostmask + set c(5nick) "\00310"; #// Dark Cyan - Nickname + set c(5netw) "\00310"; #// Dark Cyan - Network + set c(5brac) "\00314"; #// Dark Grey - Square Brackets + set c(5atch) "\00314"; #// Dark Grey - '@' Character + set c(5x) "\003"; #// Color Terminator + } else { + set c(5chan) ""; set c(5host) ""; set c(5nick) ""; + set c(5netw) ""; set c(5brac) ""; set c(5atch) ""; + set c(5x) ""; + } + + + #// Quits/Signoffs + if {$thecolors(sign) == 1 && $thecolors(master) == 1} { + set c(6chan) "\00303"; #// Dark Green - Channel + set c(6nick) "\00310"; #// Dark Cyan - Nickname + set c(6netw) "\00310"; #// Dark Cyan - Network + set c(6brac) "\00314"; #// Dark Grey - Parenthesis + set c(6atch) "\00314"; #// Dark Grey - '@' Character + set c(6x) "\003"; #// Color Terminator + } else { + set c(6chan) ""; set c(6nick) ""; set c(6netw) ""; + set c(6brac) ""; set c(6atch) ""; set c(6x) ""; + } - #// Quits/Signoffs - if {$thecolors(sign) == 1 && $thecolors(master) == 1} { - set c(6chan) "\00303"; #// Dark Green - Channel - set c(6nick) "\00310"; #// Dark Cyan - Nickname - set c(6netw) "\00310"; #// Dark Cyan - Network - set c(6brac) "\00314"; #// Dark Grey - Parenthesis - set c(6atch) "\00314"; #// Dark Grey - '@' Character - set c(6x) "\003"; #// Color Terminator - } else { - set c(6chan) ""; set c(6nick) ""; set c(6netw) ""; - set c(6brac) ""; set c(6atch) ""; set c(6x) ""; - } + #// Parts + if {$thecolors(part) == 1 && $thecolors(master) == 1} { + set c(7chan) "\00303"; #// Dark Green - Channel + set c(7nick) "\00310"; #// Dark Cyan - Nickname + set c(7netw) "\00310"; #// Dark Cyan - Network + set c(7atch) "\00314"; #// Dark Grey - '@' Character + set c(7x) "\003"; #// Color Terminator + } else { + set c(7chan) ""; set c(7nick) ""; set c(7netw) ""; + set c(7atch) ""; set c(7x) ""; + } - #// Parts - if {$thecolors(part) == 1 && $thecolors(master) == 1} { - set c(7chan) "\00303"; #// Dark Green - Channel - set c(7nick) "\00310"; #// Dark Cyan - Nickname - set c(7netw) "\00310"; #// Dark Cyan - Network - set c(7atch) "\00314"; #// Dark Grey - '@' Character - set c(7x) "\003"; #// Color Terminator - } else { - set c(7chan) ""; set c(7nick) ""; set c(7netw) ""; - set c(7atch) ""; set c(7x) ""; - } + #// Topic Changes + if {$thecolors(topc) == 1 && $thecolors(master) == 1} { + set c(8topc) "\00310"; #// Dark Cyan - "Topic" + set c(8netw) "\00310"; #// Dark Cyan - Network + set c(8nick) "\00303"; #// Dark Green - Nickname + set c(8slsh) "\00314"; #// Dark Grey - Forward Slash + set c(8x) "\003"; #// Color Terminator + } else { + set c(8topc) ""; set c(8netw) ""; set c(8nick) ""; + set c(8slsh) ""; set c(8x) ""; + } - #// Topic Changes - if {$thecolors(topc) == 1 && $thecolors(master) == 1} { - set c(8topc) "\00310"; #// Dark Cyan - "Topic" - set c(8netw) "\00310"; #// Dark Cyan - Network - set c(8nick) "\00303"; #// Dark Green - Nickname - set c(8slsh) "\00314"; #// Dark Grey - Forward Slash - set c(8x) "\003"; #// Color Terminator - } else { - set c(8topc) ""; set c(8netw) ""; set c(8nick) ""; - set c(8slsh) ""; set c(8x) ""; - } + #// Kicks + if {$thecolors(kick) == 1 && $thecolors(master) == 1} { + set c(9kick) "\00310"; #// Dark Cyan - "Kick" + set c(9netw) "\00310"; #// Dark Cyan - Network + set c(9nick) "\00303"; #// Dark Green - Nickname that Kicked + set c(9vict) "\00306"; #// Dark Purple - Victim that was Kicked + set c(9brac) "\00314"; #// Dark Grey - Square Brackets + set c(9slsh) "\00314"; #// Dark Grey - Forward Slash + set c(9x) "\003"; #// Color Terminator + } else { + set c(9kick) ""; set c(9netw) ""; set c(9nick) ""; + set c(9vict) ""; set c(9brac) ""; set c(9slsh) ""; + set c(9x) ""; + } - #// Kicks - if {$thecolors(kick) == 1 && $thecolors(master) == 1} { - set c(9kick) "\00310"; #// Dark Cyan - "Kick" - set c(9netw) "\00310"; #// Dark Cyan - Network - set c(9nick) "\00303"; #// Dark Green - Nickname that Kicked - set c(9vict) "\00306"; #// Dark Purple - Victim that was Kicked - set c(9brac) "\00314"; #// Dark Grey - Square Brackets - set c(9slsh) "\00314"; #// Dark Grey - Forward Slash - set c(9x) "\003"; #// Color Terminator - } else { - set c(9kick) ""; set c(9netw) ""; set c(9nick) ""; - set c(9vict) ""; set c(9brac) ""; set c(9slsh) ""; - set c(9x) ""; - } + + #// Bans/Exempts/Invites + if {$thecolors(ban) == 1 && $thecolors(master) == 1} { + set c(10type) "\00310"; #// Dark Cyan - "Ban/Except/Invite" + set c(10netw) "\00310"; #// Dark Cyan - Network + set c(10mask) "\00303"; #// Dark Green - Hostmask + set c(10slsh) "\00314"; #// Dark Grey - Forward Slash + set c(10x) "\003"; #// Color Terminator + } else { + set c(10type) ""; set c(10netw) ""; set c(10mask) ""; + set c(10slsh) ""; set c(10x) ""; + } - #// Bans/Exempts/Invites - if {$thecolors(ban) == 1 && $thecolors(master) == 1} { - set c(10type) "\00310"; #// Dark Cyan - "Ban/Except/Invite" - set c(10netw) "\00310"; #// Dark Cyan - Network - set c(10mask) "\00303"; #// Dark Green - Hostmask - set c(10slsh) "\00314"; #// Dark Grey - Forward Slash - set c(10x) "\003"; #// Color Terminator - } else { - set c(10type) ""; set c(10netw) ""; set c(10mask) ""; - set c(10slsh) ""; set c(10x) ""; - } + #// Netsplits + if {$thecolors(splt) == 1 && $thecolors(master) == 1} { + set c(11splt) "\00310"; #// Dark Cyan - "Netsplit" + set c(11netw) "\00310"; #// Dark Cyan - Network + set c(11nick) "\00303"; #// Dark Green - Nickname + set c(11slsh) "\00314"; #// Dark Grey - Forward Slash + set c(11x) "\003"; #// Color Terminator + } else { + set c(11splt) ""; set c(11netw) ""; set c(11nick) ""; + set c(11slsh) ""; set c(11x) ""; + } - #// Netsplits - if {$thecolors(splt) == 1 && $thecolors(master) == 1} { - set c(11splt) "\00310"; #// Dark Cyan - "Netsplit" - set c(11netw) "\00310"; #// Dark Cyan - Network - set c(11nick) "\00303"; #// Dark Green - Nickname - set c(11slsh) "\00314"; #// Dark Grey - Forward Slash - set c(11x) "\003"; #// Color Terminator - } else { - set c(11splt) ""; set c(11netw) ""; set c(11nick) ""; - set c(11slsh) ""; set c(11x) ""; - } + #// Netmerges + if {$thecolors(rejn) == 1 && $thecolors(master) == 1} { + set c(12rejn) "\00310"; #// Dark Cyan - "Netmerge" + set c(12netw) "\00310"; #// Dark Cyan - Network + set c(12nick) "\00303"; #// Dark Green - Nickname + set c(12slsh) "\00314"; #// Dark Grey - Forward Slash + set c(12x) "\003"; #// Color Terminator + } else { + set c(12rejn) ""; set c(12netw) ""; set c(12nick) ""; + set c(12slsh) ""; set c(12x) ""; + } - #// Netmerges - if {$thecolors(rejn) == 1 && $thecolors(master) == 1} { - set c(12rejn) "\00310"; #// Dark Cyan - "Netmerge" - set c(12netw) "\00310"; #// Dark Cyan - Network - set c(12nick) "\00303"; #// Dark Green - Nickname - set c(12slsh) "\00314"; #// Dark Grey - Forward Slash - set c(12x) "\003"; #// Color Terminator - } else { - set c(12rejn) ""; set c(12netw) ""; set c(12nick) ""; - set c(12slsh) ""; set c(12x) ""; - } + #// Botnet Links + if {$thecolors(link) == 1 && $thecolors(master) == 1} { + set c(13link) "\00310"; #// Dark Cyan - "Linked Bot" + set c(13netw) "\00303"; #// Dark Cyan - Network + set c(13abot) "\00303"; #// Dark Green - Bot + set c(13atch) "\00314"; #// Dark Grey - '@' Character + set c(13x) "\003"; #// Color Terminator + } else { + set c(13link) ""; set c(13netw) ""; set c(13abot) ""; + set c(13atch) ""; set c(13x) ""; + } - #// Botnet Links - if {$thecolors(link) == 1 && $thecolors(master) == 1} { - set c(13link) "\00310"; #// Dark Cyan - "Linked Bot" - set c(13netw) "\00303"; #// Dark Cyan - Network - set c(13abot) "\00303"; #// Dark Green - Bot - set c(13atch) "\00314"; #// Dark Grey - '@' Character - set c(13x) "\003"; #// Color Terminator - } else { - set c(13link) ""; set c(13netw) ""; set c(13abot) ""; - set c(13atch) ""; set c(13x) ""; - } + #// Botnet Disconnects + if {$thecolors(disc) == 1 && $thecolors(master) == 1} { + set c(14disc) "\00310"; #// Dark Cyan - "Lost bot" + set c(14netw) "\00303"; #// Dark Cyan - Network + set c(14abot) "\00303"; #// Dark Green - Bot + set c(14atch) "\00314"; #// Dark Grey - '@' Character + set c(14x) "\003"; #// Color Terminator + } else { + set c(14disc) ""; set c(14netw) ""; set c(14abot) ""; + set c(14atch) ""; set c(14x) ""; + } - #// Botnet Disconnects - if {$thecolors(disc) == 1 && $thecolors(master) == 1} { - set c(14disc) "\00310"; #// Dark Cyan - "Lost bot" - set c(14netw) "\00303"; #// Dark Cyan - Network - set c(14abot) "\00303"; #// Dark Green - Bot - set c(14atch) "\00314"; #// Dark Grey - '@' Character - set c(14x) "\003"; #// Color Terminator - } else { - set c(14disc) ""; set c(14netw) ""; set c(14abot) ""; - set c(14atch) ""; set c(14x) ""; - } - - - #// !names Output - if {$thecolors(names) == 1 && $thecolors(master) == 1} { - set c(15chan) "\00310"; #// Dark Cyan - Channel - set c(15netw) "\00310"; #// Dark Cyan - Network - set c(15___o) "\00307"; #// Orange - "@" Symbol (Op) - set c(15___h) "\00303"; #// Dark Green - "%" Symbol (Halfop) - set c(15___v) "\00306"; #// Dark Purple - "+" Symbol (Voice) - set c(15numA) "\00303"; #// Dark Green - User Number Range A - set c(15numB) "\00303"; #// Dark Green - User Number Range B - set c(15totl) "\00310"; #// Dark Cyan - User Total - set c(15atch) "\00314"; #// Dark Grey - '@' Character - set c(15x) "\003"; #// Color Terminator - } else { - set c(15chan) ""; set c(15netw) ""; set c(15___o) ""; - set c(15___h) ""; set c(15___v) ""; set c(15numA) ""; - set c(15numB) ""; set c(15totl) ""; set c(15atch) ""; - set c(15x) ""; - } - - - #// Privmsg Output - if {$thecolors(privmsg) == 1 && $thecolors(master) == 1} { - set c(16brac) "\00314"; #// Dark Grey - Angle Brackets - set c(16nick) ""; #// No Color - Nickname - set c(16netw) ""; #// No Color - Network - set c(16atch) "\00314"; #// Dark Grey - '@' Character - set c(16x) "\003"; #// Color Terminator - } else { - set c(16brac) ""; set c(16nick) ""; set c(16netw) ""; - set c(16atch) ""; set c(16x) ""; - } - - - #// !gettopic Output - if {$thecolors(help) == 1 && $thecolors(master) == 1} { - set c(17chan) "\00310"; #// Dark Cyan - Channel - set c(17netw) "\00310"; #// Dark Cyan - Network - set c(17topc) "\00303"; #// Dark Green - Topic - set c(17atch) "\00314"; #// Dark Grey - '@' Character - set c(17x) "\003"; #// Color Terminator - } else { - set c(17chan) ""; set c(17netw) ""; set c(17topc) ""; - set c(17atch) ""; set c(17x) ""; - } - - - #// !help Output - if {$thecolors(help) == 1 && $thecolors(master) == 1} { - set c(18help) "\00303"; #// Dark Green - !help Options - set c(18cmds) "\00310"; #// Dark Cyan - Commands - set c(18args) "\00303"; #// Dark Green - Command Parameters - set c(18home) "\00307"; #// Orange - "Home" Network in !help network - set c(18x) "\003"; #// Color Terminator - } else { - set c(18help) ""; set c(18cmds) ""; set c(18args) ""; - set c(18home) ""; set c(18x) ""; - } + #// !names Output + if {$thecolors(names) == 1 && $thecolors(master) == 1} { + set c(15chan) "\00310"; #// Dark Cyan - Channel + set c(15netw) "\00310"; #// Dark Cyan - Network + set c(15___o) "\00307"; #// Orange - "@" Symbol (Op) + set c(15___h) "\00303"; #// Dark Green - "%" Symbol (Halfop) + set c(15___v) "\00306"; #// Dark Purple - "+" Symbol (Voice) + set c(15numA) "\00303"; #// Dark Green - User Number Range A + set c(15numB) "\00303"; #// Dark Green - User Number Range B + set c(15totl) "\00310"; #// Dark Cyan - User Total + set c(15atch) "\00314"; #// Dark Grey - '@' Character + set c(15x) "\003"; #// Color Terminator + } else { + set c(15chan) ""; set c(15netw) ""; set c(15___o) ""; + set c(15___h) ""; set c(15___v) ""; set c(15numA) ""; + set c(15numB) ""; set c(15totl) ""; set c(15atch) ""; + set c(15x) ""; + } -} + + #// Privmsg Output + if {$thecolors(privmsg) == 1 && $thecolors(master) == 1} { + set c(16brac) "\00314"; #// Dark Grey - Angle Brackets + set c(16nick) ""; #// No Color - Nickname + set c(16netw) ""; #// No Color - Network + set c(16atch) "\00314"; #// Dark Grey - '@' Character + set c(16x) "\003"; #// Color Terminator + } else { + set c(16brac) ""; set c(16nick) ""; set c(16netw) ""; + set c(16atch) ""; set c(16x) ""; + } + #// !gettopic Output + if {$thecolors(help) == 1 && $thecolors(master) == 1} { + set c(17chan) "\00310"; #// Dark Cyan - Channel + set c(17netw) "\00310"; #// Dark Cyan - Network + set c(17topc) "\00303"; #// Dark Green - Topic + set c(17atch) "\00314"; #// Dark Grey - '@' Character + set c(17x) "\003"; #// Color Terminator + } else { + set c(17chan) ""; set c(17netw) ""; set c(17topc) ""; + set c(17atch) ""; set c(17x) ""; + } + + + #// !help Output + if {$thecolors(help) == 1 && $thecolors(master) == 1} { + set c(18help) "\00303"; #// Dark Green - !help Options + set c(18cmds) "\00310"; #// Dark Cyan - Commands + set c(18args) "\00303"; #// Dark Green - Command Parameters + set c(18home) "\00307"; #// Orange - "Home" Network in !help network + set c(18x) "\003"; #// Color Terminator + } else { + set c(18help) ""; set c(18cmds) ""; set c(18args) ""; + set c(18home) ""; set c(18x) ""; + } + } +} + #//-------------------------------------------------------------------------------------------------------------- #// --- Reset Binds --- @@ -1181,35 +1199,6 @@ proc set_binds {} { return 0 } -#//-------------------------------------------------------------------------------------------------------------- -#// --- Startup Code --- - - -#// Clear the Global Variables (If They Exist) -if {[info exists spltbuf] == 1} {array unset spltbuf} -if {[info exists rejnbuf] == 1} {array unset rejnbuf} -if {[info exists linkbuf] == 1} {array unset linkbuf} -if {[info exists discbuf] == 1} {array unset discbuf} -if {[info exists hurtbuf] == 1} {array unset hurtbuf} -if {[info exists replybuf] == 1} {array unset replybuf} - - -#// Initialize our Global Variables -set spltbuf(init) "donotremoveme" -set rejnbuf(init) "donotremoveme" -set linkbuf(init) "donotremoveme" -set discbuf(init) "donotremoveme" -set hurtbuf(init) "donotremoveme" -set replybuf(init) "donotremoveme" - - -#// Fix our binds -set_binds - - -#// Some people cannot follow directions at times. This prevents such people from screwing the script up -set therelay(channels) [string tolower $therelay(channels)] - #//-------------------------------------------------------------------------------------------------------------- @@ -1257,6 +1246,26 @@ proc is_hurt {uhost} { #//-------------------------------------------------------------------------------------------------------------- +#// --- Color/Code Stripper --- + + +#// Strips Mirc Colors/Bold/Underline/Reverse from text +proc stripcodes {text} { + global theopts + + if {$theopts(strip_codes) == 1} { + regsub -all -- "\003(\[0-9\]\[0-9\]?(,\[0-9\]\[0-9\]?)?)?" $text "" text; #// Color + regsub -all -- "\002" $text "" text; #// Bold + regsub -all -- "\026" $text "" text; #// Reverse + regsub -all -- "\037" $text "" text; #// Underline + } + + return $text +} + + + +#//-------------------------------------------------------------------------------------------------------------- #// --- Public Chatter --- @@ -1917,13 +1926,17 @@ proc send_names {frm_bot command arg} { #// Go through the main Channel List, and determine Ops/Halfops/Voices/Normal Users foreach user $thelist { if {[isop $user $thechan] != 0} { - lappend olist "$c(15___o)\@$c(15x)$user"; #// Ops + #// Ops + lappend olist "$c(15___o)\@$c(15x)$user"; } elseif {[ishalfop $user $thechan] != 0} { - lappend hlist "$c(15___h)\%$c(15x)$user"; #// Halfops + #// Halfops + lappend hlist "$c(15___h)\%$c(15x)$user"; } elseif {[isvoice $user $thechan] != 0} { - lappend vlist "$c(15___v)\+$c(15x)$user"; #// Voice + #// Voice + lappend vlist "$c(15___v)\+$c(15x)$user"; } else { - lappend ulist "$user"; #// Normal Users + #// Normal Users + lappend ulist "$user"; } } @@ -1966,9 +1979,11 @@ proc recv_names {frm_bot command arg} { #// Determine if the message is split up into pieces or not if {$isSplit == "yes"} { putquick "PRIVMSG $thenick :$thechan$c(15atch)\@$c(15x)$thenetw: $thelist \ - \(\[Displaying $c(15numA)[expr $xStart + 1]$c(15x) to $c(15numB)$xEnd$c(15x)\] of $c(15totl)$usernum$c(15x) Users\)" + \(\[Displaying $c(15numA)[expr $xStart + 1]$c(15x) to \ + $c(15numB)$xEnd$c(15x)\] of $c(15totl)$usernum$c(15x) Users\)" } else { - putquick "PRIVMSG $thenick :$thechan$c(15atch)\@$c(15x)$thenetw: $thelist \($c(15totl)$usernum$c(15x) Users\)" + putquick "PRIVMSG $thenick :$thechan$c(15atch)\@$c(15x)$thenetw: $thelist \ + \($c(15totl)$usernum$c(15x) Users\)" } return 0 @@ -3206,4 +3221,4 @@ proc pub_listkick {nick uhost hand chan #//-------------------------------------------------------------------------------------------------------------- #// --- Our Tagline --- -putlog "$therelay(name) \[relay v2.1.4 by: `Kumba (Orig: cl00bie )\]" +putlog "$therelay(name) \[relay v2.1.5 by: `Kumba (Orig: cl00bie )\]"