#/spy, /unspy if {![llength [info commands align]]} { proc align {str num} { return [format %*s $num] } } set spylinks "" proc rflist {list element} { return [lrem $list $element] } proc b args {return } #squirt command alias squirt { if {[raw_args] == ""} {set nick lizard_} {set nick [raw_args]} say "\[$nick\] OHHH YES# *SQUIRT*" complete } # squirt mods alias spy { global spylinks if {![string length [lindex [args] 0]]} { if {[llength $spylinks]} { echo "[kano] [b]Spylinks Listing[b] ((links: [b][llength $spylinks][b]))" echo "[kano] [b]# [b]Redirecting From: [b][b]Redirecting To: [b]" set num 0 foreach link $spylinks { incr num echo "[kano] [b][align "$num" 2][b][align [lindex $link 0] 30][align [lindex $link 1] 30]" } echo "[kano] [b]Spylinks Listing[b] ((links: [b][llength $spylinks][b]))" } { echo "[kano] You currently have no spylinks established..." } } elseif ![string length [lindex [args] 1]] { echo "[kano] You must specify a location to direct information to..." } { foreach link $spylinks { if {[lindex $link 0] == [lindex [args] 0] && [lindex $link 1] == [lindex [args] 1]} { echo "Already redirecting info from [lindex [args] 0] to [lindex [args] 1]..." complete return } } lappend spylinks [list [string tolower [lindex [args] 0]] [string tolower [lindex [args] 1]]] echo "[kano] Established link from [string tolower [lindex [args] 0]] to [string tolower [lindex [args] 1]]..." } complete } proc spylink {loc text {nick ""}} { global spylinks set text [strip $text c] foreach link $spylinks { if {[string tolower [lindex $link 0]] == [string tolower $loc]} { set dest [strip [lindex $link 1]] /msg $dest \[spy:$loc\] $nick $text } } } alias unspy { if ![string length [lindex [args] 0]] { echo "[kano] You must specify a location to remove the link from..." } { foreach link $spylinks { if {[lindex $link 0] == [string tolower [lindex [args] 0]]} { echo "[kano] Spylink broken from [string tolower [lindex [args] 0]] to [lindex $link 1]..." set spylinks [rflist $spylinks $link] set flag 1 } } if [info exists flag] {unset flag} {echo "[kano] No matching spylinks found..."} } complete } on privmsg { spylink [lindex [args] 0] [lindex [args] 1] <[nick]> } alias privmsg { spylink [lindex [args] 0] [lrange [args] 1 end] <[my_nick]> } on ctcp { if {[string tolower [lindex [args] 1]] == "action"} { spylink [lindex [args] 0] [lindex [args] 1] "* [nick]" } } alias me { spylink [channel][query] [raw_args] "* [my_nick]" } addname *SQUIRT* addecho "[kano] loaded *SQUIRT* by mrsbrisby" kaddhelp spy "Opens a spylink from one nick/channel to another nick/channel. This relays all text and actions sent and recieved from the source to the destination." "/spy " "Add Spylink" /unspy kaddhelp unspy "Closes a spylink." "/unspy " "Remove Spylink" /spy