egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

rules tcls

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Sedition
Voice


Joined: 14 Dec 2011
Posts: 16
Location: Bolivia, Beni, Trinidad / DALnet

PostPosted: Sat Feb 13, 2016 10:14 pm    Post subject: rules tcls Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Feb 14, 2016 3:34 pm    Post subject: Reply with quote

You could try this script http://forum.egghelp.org/viewtopic.php?t=19313&highlight=create+trigger
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Sedition
Voice


Joined: 14 Dec 2011
Posts: 16
Location: Bolivia, Beni, Trinidad / DALnet

PostPosted: Sun Feb 14, 2016 7:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber