I've posted a couple questions around here and the help has been great! I just started trying to learn TCL. I've mostly learned from reading other peoples scripts, and trial & error.
This is my first attempt at a script and it works.. Sorta. Some commands don't work at all, and other do only once. Not sure what is wrong, can you take a look and help out please?
(I've compiled this from some of my own stuff, and copying out of some other scripts.)
Code: Select all
### BINDS ###
# All I can say is, change with caution.
bind pub o !op op_nick
bind pub o !deop deop_nick
bind pub o !voice voice_nick
bind pub o !devoice devoice_nick
bind pub o !kick kick_nick
bind pub o !topic set_topic
bind pub o !cycle cycle_bot
### CODE ###
# Don't edit my work, please.
#----- OP -----#
proc op_nick {nick host handle channel testes} {
putserv "MODE $channel +o $nick"
return 1
}
#----- DEOP -----#
proc deop_nick {nick host handle channel testes} {
putserv "MODE $channel -o $nick"
return 1
}
#----- VOICE -----#
proc voice_nick {nick host handle channel testes } {
putserv "MODE $channel +v $nick"
return 1
}
#----- DEVOICE -----#
proc devoice_nick {nick host handle channel testes} {
putserv "MODE $channel -v $nick"
return 1
}
#----- KICK -----#
proc kick_nick {nick uhost hand chan arg} {
global botnick
set who [lindex $arg 0]
set why [lrange $arg 1 end]
putserv "KICK $chan $who :$why 1 5,1•4•5•14,1.:X:. 14,1Gô15,1G14,1eR4,1.:X:. 5,1•4•5•"
return 1
}
#----- TOPIC -----#
proc set_topic {user host handle channel testes} {
set what [lrange $testes 0 end]
putserv "TOPIC $channel :$what"
return 1
}
#----- CYCLE -----#
proc cycle_bot {nick host handle channel testes} {
global botnick
set who [lindex $testes 0]
if {$who == ""} {
restart
return 1
}
}