1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
# Command name: /hilo
# Description: This command changes upper chars to lower chars
# and vice versa.
# This is just a demo-script. You can see
# here how you can add your own tkirc-scripts!
#
# Date: 03.03.98
# Author: Andreas Gelhausen, atte@gecko.north.de
#
# Changes: 03.03.98 Now this script can automatically be loaded
# from tkirc (~.tkirc/autoload/) and you
# don't need to change your tkircrc!
# Install:
# 1. copy this file to `~/.tkirc/autoload/hilo.tcl'
# 2. reload your tkircrc or restart tkirc
proc on_command_hilo {window arguments} {
set len [lLength "$arguments"]
if {$len < 1} {
print2crap "+++ Usage: /hilo <message>"
return
}
set command "" ; set newline ""
if {[regexp -- {^(/msg|/notice|/describe) .*} "$arguments"]} {
set command "[leftwords "$arguments" 2] "
set arguments "[cutwords "$arguments" 2]"
}
for {set i 0} {$i < [string length "$arguments"]} {incr i} {
set char "[string index "$arguments" $i]"
if {"$char" < "a"} {
append newline "[string tolower "$char"]"
} else {
append newline "[string toupper "$char"]"
}
}
send2tkirc $window "$command$newline"
}
|