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.

need some help with a script plz

Old posts that have not been replied to for several years.
Locked
S
SnOoPDoGg187

Post by SnOoPDoGg187 »

i'm using Capslock.tcl 0.1 by #egghelp@efnet (KuNgFo0)this is what i'd like it to do if it can be done : )

i want it to be able to set it to kick or ban the person it only kicks the person right now. and i want it so i can set the ban time in the script so any help anyone can give me i'd appreciate it.

heres the code:

# Set the next line as the kick msg you want to say
set capslock_msg "Please Don't Use Caps In This Room!"

# Set the next line as the minimum length of text to scan
set capslock_len 15

# Set the next line as the channels you want to run in
set capslock_chans ""

bind pubm - * pubm_capslock
bind ctcp - ACTION ctcp_capslock

putlog "*** Capslock.tcl 0.1 by #egghelp@efnet loaded"

proc testcapslock {arg} {
foreach i [string tolower [split $arg ""]] {
if {[string match *$i* "abcdefghijklmnopqrstuvwxyz"]} {
return 1
}
}
return 0
}

proc pubm_capslock {nick uhost hand chan arg} {
global capslock_msg capslock_len capslock_chans botnick
if {(([lsearch -exact [string tolower $capslock_chans] [string tolower $chan]] != -1) || ($capslock_chans == "*")) && (![matchattr $hand b]) && (![matchattr $hand f|f $chan]) && ($nick != $botnick) && ($arg == [string toupper $arg]) && ([string length $arg] >= $capslock_len) && ([testcapslock $arg])} {
putserv "KICK $chan $nick :$capslock_msg"
}
}

proc ctcp_capslock {nick uhost hand chan keyword arg} {
pubm_capslock $nick $uhost $hand $chan $arg
}

thanks for the help guys : )

SnOoP
S
SnOoPDoGg187

Post by SnOoPDoGg187 »

not sure if anyone wants this but if your using this script and want it to ban the person instead of just kicking them heres the code for it... i'm sure theres probally a better way to do it but i'm not that good at this stuff yet : )

note: i put comments where i changed or added stuff.. : )

##############################################
# Capslock.tcl 0.1 by #egghelp@efnet (KuNgFo0)
#
# Set the next line as the kick msg you want to say
set capslock_msg "Please Don't Use Caps In This Room!"

# Set the next line as the minimum length of text to scan
set capslock_len 15

# Set the next line as the channels you want to run in
set capslock_chans "#channel1 #channel2"

#note: i added this so u have the choice of #setting it to either kick or to ban the #person
# Do you want to kick or ban the person? set to 0 to just kick, or 1 to ban them
set caps_ban 1

#note: i added this so u can set how long u #want to ban the person for
# duration of ban in minutes, set to 0 for a perm ban
set caps_time 2

#******************************************
#* Do Not Change Anythang Below Here!!!!! *
#******************************************

bind pubm - * pubm_capslock
bind ctcp - ACTION ctcp_capslock

putlog "*** Capslock.tcl 0.1 by #egghelp@efnet loaded"

proc testcapslock {arg} {
foreach i [string tolower [split $arg ""]] {
if {[string match *$i* "abcdefghijklmnopqrstuvwxyz"]} {
return 1
}
}
return 0
}

proc pubm_capslock {nick uhost hand chan arg} {
global capslock_msg capslock_len capslock_chans botnick caps_ban caps_time
if {(([lsearch -exact [string tolower $capslock_chans] [string tolower $chan]] != -1) || ($capslock_chans == "*")) && (![matchattr $hand b]) && (![matchattr $hand f|f $chan]) && ($nick != $botnick) && ($arg == [string toupper $arg]) && ([string length $arg] >= $capslock_len) && ([testcapslock $arg])} {
putserv "KICK $chan $nick :$capslock_msg"
#note: i added the next line it checks to see if #u want to kick or ban the person
if { $caps_ban == 1 } {
newchanban $chan [string trimleft [maskhost [getchanhost $nick $chan]] ~] $capslock_msg" $caps_time
}
}
}

proc ctcp_capslock {nick uhost hand chan keyword arg} {
pubm_capslock $nick $uhost $hand $chan $arg
}

that's it just the 2 options and the 1 line of code and i did change the kick/ban msg to say what u have set for the set capslock_msg option

enjoy hope it helps someone out : )
sorry guys for being so long i should have just pasted the stuff i changed : (

SnOoP
Locked