| View previous topic :: View next topic |
| Author |
Message |
Sedition Voice
Joined: 14 Dec 2011 Posts: 16 Location: Bolivia, Beni, Trinidad / DALnet
|
Posted: Sat Feb 13, 2016 10:14 pm Post subject: rules tcls |
|
|
Hi all
This TCL serves me
but I want it reviewed
Please : )
| Code: |
# 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"
|
_________________ good I wait for all that he learns more on tcl thanks for shaping a solid group of help
Last edited by Sedition on Thu Mar 10, 2016 9:28 pm; edited 1 time in total |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
|
| Back to top |
|
 |
Sedition Voice
Joined: 14 Dec 2011 Posts: 16 Location: Bolivia, Beni, Trinidad / DALnet
|
Posted: Sun Feb 14, 2016 7:06 pm Post subject: |
|
|
his tcl is extensive thanks anyway
It is not what I wanted...
thanks madalin
my question is if the writing is correct ..
so far does not give me mistakes
anyone can check the tcl... please _________________ good I wait for all that he learns more on tcl thanks for shaping a solid group of help |
|
| Back to top |
|
 |
|