This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

rules tcls

Help for those learning Tcl or writing their own scripts.
Post Reply
S
Sedition
Voice
Posts: 17
Joined: Wed Dec 14, 2011 10:04 pm
Location: Bolivia, Beni, Trinidad / DALnet

rules tcls

Post by Sedition »

Hi all
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"
Last edited by Sedition on Thu Mar 10, 2016 9:28 pm, edited 1 time in total.
good I wait for all that he learns more on tcl thanks for shaping a solid group of help
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

S
Sedition
Voice
Posts: 17
Joined: Wed Dec 14, 2011 10:04 pm
Location: Bolivia, Beni, Trinidad / DALnet

Post by Sedition »

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
Post Reply