This TCL serves me
but I want it reviewed
Please : )
Code: Select all
# rules1.0.tcl inspired by `Dracu|a`
# rewritten from tell1.1.tcl (Lassi Lahtinen lahtinen.lassi@nic.fi) by Wanderer|
# final debug by ShadowLord
# email me @: jjmacgregor@kscable.com
# version 1.0 a simple and to the point TCL :)
# You can ask help:
# 1. by emailing me
# 2. I'm on Dalnet in #VladTepes
# 3. Wanderer| is on UnderNET in #TCL
# thanks a lot to Wanderer| and ShadowLord!
# updated for sedition 1.-the method commands was extended example: !rules or .rules
# 2.-the message method was extended for the command: 0 = notice to nick, 1 = private message to channel, 2 = private message to nick.
# IRC: irc.dal.net channels #tcls #cremacamba my nick's sediton or supr
# email: reebot@outlook.com
# you can start to use rules1.0.tcl after you change "line1" and "line2" (btw
# you can add lines "line 3" "line 4" etc it's not restricted) to your
# channel's rules and write public command !rules or !rules <nick> on your chan!
# commands: !rules pastes the rules on open channel !rules <nick> will /notice a
# individual person the channel rules.
set chanrules {
"the channel rules are:"
"1. not insult"
"2. not bother anyone"
"*** end of the rules ***"
}
# Choose the method to use the bot
# 0 = notice to nick
# 1 = private message to channel
# 2 = private message to nick
set noticeoptionxp 1
#commands
set rules_command "!rules .rules"
#bind pub o !rules pub:t
foreach ruleschans [split $rules_command] {bind pub - $ruleschans pub:t}
proc pub:t {nick uhost hand chan text} {
global chanrules noticeoptionxp
set rulenick [lindex [split $text " "] 0]
if {$text != "" && [onchan $rulenick $chan]} {
puthelp "NOTICE $rulenick :these are the rules of our channel. Pay attention!"
foreach line $chanrules { puthelp "NOTICE $rulenick :$line" }
return 0
}
if {$noticeoptionxp == "0"} {
foreach line $chanrules {
puthelp "NOTICE $nick :$line" }
}
if {$noticeoptionxp == "1"} {
foreach line $chanrules {
puthelp "PRIVMSG $chan :$line" }
}
if {$noticeoptionxp == "2"} {
foreach line $chanrules {
puthelp "PRIVMSG $nick :$line" }
}
}
putlog "\002rules 2.0 by `Dracu|a` updated for sedition"