1. !advert => http://www.egghelp.org/cgi-bin/tcl_arch ... ad&id=1308jonlar wrote:Hello to the Board.
i ask everybody to help me. My Channel is looking for 2 Scripts.
1. is a rules script where we can add some Text in a text File that will be posted by writing something like ?rules (maybe some spamcheck and the text as notice or Private)
2. is a, hmmm how to explain it, a script where we can add users and this will be printed in the chan as Helper or admins.
so what i mean is, somebody types !admins and he get a list of People (s)he can contact. maybe its possible to use a trigger system to add Admins, Helpers and so on.
Thanks to all of you for the view and maybe Help
Have a nice Day.
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!
# 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 {
"line 1"
"line 2"
}
bind pub o !rules pub:t
proc pub:t {nick uhost hand chan text} {
global chanrules
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
}
foreach line $chanrules {puthelp "PRIVMSG $chan :$line" }
}
Code: Select all
# 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!
Code: Select all
###
# trigger
set waffles(cmd) "!admin"
# Admins list
set waffles(list) "nick1 nick2 nick3 ... nick8"
###
bind pub - $waffles(cmd) pub:needadmin
proc pub:needadmin { nick host hand chan arg } {
global waffles
set counter 0
foreach ad [split $waffles(list)] {
if {[onchan $ad $chan]} {
putquick "PRIVMSG $ad :\037$nick\017 need help of an admin."
incr counter
}
}
if {$counter == 0} {
putquick "PRIVMSG $chan :sorry $nick, No such Admin Online."
} else {
putquick "PRIVMSG $chan :$nick, your resquest has been send to admins. (admins: $waffles(list)."
}
}
Use LoL Toolz, by leonini, search here: http://egghelp.org/tcl.htmjonlar wrote:First of all, thank u for this. But is it possible to add a spamcheck and cant it be used it this way
!add admin <name>
!del admin <name>
thanks a lot
Code: Select all
####################################################################################
##
## CheckMasters
## Version 1.0
## by xiv
##
## This script will display the handles of the bot owners & channel masters.
## It will also check who are on at the moment.
##
## For security reasons, I added a flood protection
##
# do you want the bot to make a differance between owners & masters?
set display_owners 0
# set here the trigger for flood
set masters_flood 1:20
bind pub - !admins pub_masters
bind pub m|m !deladmin proc_deluser
bind pub m|m !addadmin proc_adduser
# -- don't edit below unless you know what you are doing --
proc pub_masters {nick uhost hand channel args} {
# detect flood
if {[masters_detectflood]} {
putcmdlog "<$nick@$channel> !$hand! masters (flood... not answering!)"
putserv "NOTICE $nick :don't flood the bots"
return 0
}
# Initializing variables
global botnick display_owners
set count_owners 0
set count_owners_on 0
set count_masters 0
set count_masters_on 0
set owners ""
set owners_on ""
set masters ""
set masters_on ""
# finding all owners in userlist if 'display_owners' setting is set to 1
if { $display_owners } {
foreach user [userlist] {
if [matchattr $user n $channel] {
set owners [string trim "$owners, $user" ", "]
incr count_owners 1
}
}
if {[string length $owners] > 0} {
putchan $channel "$count_owners owner(s) of the bots: $owners."
}
}
# finding all masters in userlist
foreach user [userlist] {
if [matchattr $user |R $channel] {
if { (![matchattr $user n]) || ($display_owners == 0) } {
set masters [string trim "$masters, $user" ", "]
incr count_masters 1
}
}
}
if {[string length $masters] > 0} {
putchan $channel "$count_masters Admin(s) defined for $channel: $masters."
} else {
putchan $channel "There are currently no Admin's defined for $channel."
}
# displaying owners that are on if 'display_owners' setting is set to 1
if { $display_owners } {
foreach owner_on [chanlist $channel n] {
set owners_on [string trim "$owners_on, $owner_on" ", "]
incr count_owners_on 1
}
if {[string length $owners_on] > 0} {
putchan $channel "Wohoo, $count_owners_on owner(s) of the bots currently on: $owners_on."
}
}
# displaying masters that are on
foreach master_on [chanlist $channel |R] {
if { (![matchattr $master_on n]) || ($display_owners == 0) } {
set masters_on [string trim "$masters_on, $master_on" ", "]
incr count_masters_on 1
}
}
if {[string length $masters_on] > 0} {
putchan $channel "$count_masters_on Admin(s) currently on: $masters_on."
} else {
putchan $channel "There are currently no Admin on $channel."
}
}
# Avoids flooding
proc masters_detectflood { } {
global masters_flood
global masters_floodtrigger
set thr [lindex [split $masters_flood ":"] 0]
set lapse [lindex [split $masters_flood ":"] 1]
if {$thr == "" || $thr == 0} { return 0 }
if {![info exist masters_floodtrigger]} {
# First time called
set masters_floodtrigger [list [unixtime] 1]
return 0
}
if {[expr [lindex $masters_floodtrigger 0] + $lapse] <= [unixtime]} {
# Trigger time has passed, reset counter
set masters_floodtrigger [list [unixtime] 1]
return 0
}
set lasttime [lindex $masters_floodtrigger 0]
set times [lindex $masters_floodtrigger 1]
if {$times >= $thr} {
# Flood!
return 1
}
set masters_floodtrigger [list $lasttime [expr $times + 1]]
return 0
}
proc proc_adduser { nick uhost hand chan text } {
set newnick [lindex $text 0]
set addusernick [nick2hand $newnick]
if {[validuser $addusernick]} {
putserv "PRIVMSG $chan :\002$newnick\002 Is Already an ADMIN Database As \002$addusernick\002"
} else {
unset addusernick
set addusermask [maskhost $newnick![getchanhost $newnick $chan]]
adduser $newnick $addusermask
set addusernick [nick2hand $newnick]
chattr $addusernick |+R $chan
putlog "\002$nick\002 Added \002$addusernick\($newnick - $addusernick\)\002 To ADMIN Database"
putserv "PRIVMSG $chan :\002$text\002 Added To ADMIN Database As \002$addusernick\002"
unset addusermask
unset newnick
unset addusernick
}
}
proc proc_deluser { nick uhost hand chan text } {
set delusernick [lindex $text 0]
if {[validuser $delusernick]} {
deluser $delusernick
putserv "PRIVMSG $chan :\002$text \($delusernick\)\002 Has Been Removed From ADMIN Database"
putlog "$nick Removed $delusernick From user Database"
} else { putserv "PRIVMSG $chan :\002$text\002 Not Found In ADMIN Database, Use !whois <nickname>" }
}
putlog "--- CheckMasters 1.0 by xiv loaded ---"
Code: Select all
####################################################################################
##
## CheckMasters
## Version 1.0
## by xiv
##
## This script will display the handles of the bot owners & channel masters.
## It will also check who are on at the moment.
##
## For security reasons, I added a flood protection
##
# do you want the bot to make a differance between owners & masters?
set display_owners 0
# set here the trigger for flood
set masters_flood 1:20
bind pub - !admins pub_masters
bind pub m|m !deladmin proc_deluser
bind pub m|m !addadmin proc_adduser
bind pub m|m !admin admin:switch
setudef flag helpadmin
# -- don't edit below unless you know what you are doing --
proc pub_masters {nick uhost hand channel args} {
global helpadmin
if {![channel get $channel helpadmin]} {
return
}
if {[masters_detectflood]} {
putcmdlog "<$nick@$channel> !$hand! masters (flood... not answering!)"
putserv "NOTICE $nick :don't flood the bots"
return 0
}
# Initializing variables
global botnick display_owners
set count_owners 0
set count_owners_on 0
set count_masters 0
set count_masters_on 0
set owners ""
set owners_on ""
set masters ""
set masters_on ""
# finding all owners in userlist if 'display_owners' setting is set to 1
if { $display_owners } {
foreach user [userlist] {
if [matchattr $user n $channel] {
set owners [string trim "$owners, $user" ", "]
incr count_owners 1
}
}
if {[string length $owners] > 0} {
putchan $channel "$count_owners owner(s) of the bots: $owners."
}
}
# finding all masters in userlist
foreach user [userlist] {
if [matchattr $user |T $channel] {
if { (![matchattr $user n]) || ($display_owners == 0) } {
set masters [string trim "$masters, $user" ", "]
incr count_masters 1
}
}
}
if {[string length $masters] > 0} {
putchan $channel "$count_masters admins on $channel: $masters."
} else {
putchan $channel "In this moment don't have admins on $channel."
}
# displaying owners that are on if 'display_owners' setting is set to 1
if { $display_owners } {
foreach owner_on [chanlist $channel n] {
set owners_on [string trim "$owners_on, $owner_on" ", "]
incr count_owners_on 1
}
if {[string length $owners_on] > 0} {
putchan $channel "Wohoo, $count_owners_on owner(s) of the bots currently on: $owners_on."
}
}
# displaying masters that are on
foreach master_on [chanlist $channel |T] {
if { (![matchattr $master_on n]) || ($display_owners == 0) } {
set masters_on [string trim "$masters_on, $master_on" ", "]
incr count_masters_on 1
}
}
if {[string length $masters_on] > 0} {
putchan $channel "$count_masters_on Admins currently ON: $masters_on."
} else {
putchan $channel "don't have admins online now."
}
}
# Avoids flooding
proc masters_detectflood { } {
global masters_flood
global masters_floodtrigger
set thr [lindex [split $masters_flood ":"] 0]
set lapse [lindex [split $masters_flood ":"] 1]
if {$thr == "" || $thr == 0} { return 0 }
if {![info exist masters_floodtrigger]} {
# First time called
set masters_floodtrigger [list [unixtime] 1]
return 0
}
if {[expr [lindex $masters_floodtrigger 0] + $lapse] <= [unixtime]} {
# Trigger time has passed, reset counter
set masters_floodtrigger [list [unixtime] 1]
return 0
}
set lasttime [lindex $masters_floodtrigger 0]
set times [lindex $masters_floodtrigger 1]
if {$times >= $thr} {
# Flood!
return 1
}
set masters_floodtrigger [list $lasttime [expr $times + 1]]
return 0
}
proc proc_adduser { nick uhost hand chan text } {
global helpadmin
if {![channel get $chan helpadmin]} { return }
set newnick [lindex $text 0]
set addusernick [nick2hand $newnick]
if {[validuser $addusernick]} {
putserv "PRIVMSG $chan :\002$newnick\002 Is Already an ADMIN Database As \002$addusernick\002"
} else {
unset addusernick
set addusermask [maskhost $newnick![getchanhost $newnick $chan]]
adduser $newnick $addusermask
set addusernick [nick2hand $newnick]
chattr $addusernick |+T $chan
putlog "\002$nick\002 Added \002$addusernick\($newnick - $addusernick\)\002 To ADMIN Database"
putserv "PRIVMSG $chan :\002$text\002 Added To ADMIN Database As \002$addusernick\002"
unset addusermask
unset newnick
unset addusernick
}
}
proc proc_deluser { nick uhost hand chan text } {
global helpadmin
if {![channel get $chan helpadmin]} { return }
set delusernick [lindex $text 0]
if {[validuser $delusernick]} {
deluser $delusernick
putserv "PRIVMSG $chan :\002$text \($delusernick\)\002 Has Been Removed From ADMIN Database"
putlog "$nick Removed $delusernick From user Database"
} else { putserv "PRIVMSG $chan :\002$text\002 Not Found In ADMIN Database, Use !whois <nickname>" }
}
proc admin:switch {nickname hostname channel handle text} {
set cmd [lindex [split $text] 1]
set adminchan [lindex [split $text] 0]
switch -exact $cmd {
"on" {
channel set $adminchan +helpadmin
puthelp "NOTICE $nickname :Admins Channel is now ON in $adminchan"
}
"off" {
channel set $adminchan -helpadmin
puthelp "NOTICE $nickname :Admins Channel is now OFF in $adminchan"
}
}
}
putlog "--- CheckMasters 1.0 by xiv loaded ---"