| View previous topic :: View next topic |
| Author |
Message |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Mon Dec 28, 2009 9:01 pm Post subject: One for speechless |
|
|
Is it possible to get this script to ignore users that i add I want it to ignore some admin nicknames and some other eggdrops that run games on my server also how can I get it to show the whole sentence
| Code: | # Multi-Bind Messaging (the easy way to do this)
# AKA, PutServ-O-Matic v1.0
# by speechles (w/help from egghelp! yay!)
# Construct your triggers|channel|message
# here using the format below:
# "TRIGGER|#CHANNEL|METHOD AND MESSAGE"
# add as little, or as many as you want but you
# MUST use the format described above!
# You also have a few variables to use
# %b - will be replaced with $::botnick (bots current nickname)
# %n - will be replaced with $nick (person triggering)
# %c - will be replaced with $chan (channel triggered in)
# %u - will be replaced with $uhost (person triggering unique host)
# %h - will be replaced with $hand (person triggering handle)
# %i - will be replaced with user $input (entire thing)
# %i1 - will be replaced with user $input (just the first word)
# %i2 - will be replaced with user $input (second to last words)
# below are merely some examples.
variable mycommands {
"*credit card*|*|notice #CWStats :CWStats-Spam-Report: <%n %c>%i"
"*creditcard*|*|notice #CWStats :CWStats-Spam-Report: <%n %c>%i"
}
# Script begins - change nothing below here
bind pubm -|- "*" mycommands_proc
proc mycommands_proc {nick uhand hand chan input} {
foreach item $::mycommands {
set trig [lindex [split $item \|] 0]
regsub -all -nocase {%b} $trig $::botnick trig
regsub -all -nocase {%n} $trig $nick trig
regsub -all -nocase {%c} $trig $chan trig
regsub -all -nocase {%u} $trig $uhand trig
regsub -all -nocase {%h} $trig $hand trig
regsub -all -nocase {%i1} $trig [lindex [split $input] 1] trig
regsub -all -nocase {%i2} $trig [join [lrange [split $input] 2 end]]] trig
regsub -all -nocase {%i} $trig [join [lrange [split $input] 1 end]]] trig
if {[string match -nocase $trig $input]} {
if {[string match -nocase [lindex [split $item \|] 1] $chan]} {
set message [join [lrange [split $item \|] 2 end]]
regsub -all -nocase {%b} $message $::botnick message
regsub -all -nocase {%n} $message $nick message
regsub -all -nocase {%c} $message $chan message
regsub -all -nocase {%u} $message $uhand message
regsub -all -nocase {%h} $message $hand message
regsub -all -nocase {%i1} $message [lindex [split $input] 1] message
regsub -all -nocase {%i2} $message [join [lrange [split $input] 2 end]]] message
regsub -all -nocase {%i} $message [join [lrange [split $input] 1 end]]] message
putserv "$message"
}
}
}
}
putlog "Multi-bind messaging with action missles script loaded." |
_________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Dec 29, 2009 7:33 am Post subject: Re: One for speechless |
|
|
| Code: | # Multi-Bind Messaging (the easy way to do this)
# AKA, PutServ-O-Matic v1.1
# by speechles (w/help from egghelp! yay!)
# Construct your triggers|channel|message
# here using the format below:
# "TRIGGER|#CHANNEL|METHOD AND MESSAGE"
# add as little, or as many as you want but you
# MUST use the format described above!
# You also have a few variables to use
# %b - will be replaced with $::botnick (bots current nickname)
# %n - will be replaced with $nick (person triggering)
# %c - will be replaced with $chan (channel triggered in)
# %u - will be replaced with $uhost (person triggering unique host)
# %h - will be replaced with $hand (person triggering handle)
# %t - will be replaced with $trigger (aka 0 lindex)
# %i - will be replaced with user $input (entire thing aka 1-end lrange)
# %i1 - will be replaced with user $input (just the first word aka 1 lindex)
# %i2 - will be replaced with user $input (second to last words aka 2-end lrange)
# below are merely some examples.
variable mycommands {
"*credit card*|*|notice #CWStats :CWStats-Spam-Report: <%n %c> %t%i"
"*creditcard*|*|notice #CWStats :CWStats-Spam-Report: <%n %c> %t%i"
}
# set the flagmask here that you will use to ignore users.
# use ".chattr hand +J" to add users, you can change this flag below.
# be careful which flags you use, they are matched against channel.
variable mycommand_flag "*|J"
# Script begins - change nothing below here
bind pubm -|- "*" mycommands_proc
proc mycommands_proc {nick uhand hand chan input} {
if {![matchattr $hand $::mycommand_flag $chan]} {
foreach item $::mycommands {
set trig [lindex [split $item \|] 0]
regsub -all -nocase {%b} $trig $::botnick trig
regsub -all -nocase {%n} $trig $nick trig
regsub -all -nocase {%c} $trig $chan trig
regsub -all -nocase {%u} $trig $uhand trig
regsub -all -nocase {%h} $trig $hand trig
regsub -all -nocase {%t} $trig [lindex [split $input] 0] trig
regsub -all -nocase {%i1} $trig [lindex [split $input] 1] trig
regsub -all -nocase {%i2} $trig [join [lrange [split $input] 2 end]]] trig
regsub -all -nocase {%i} $trig [join [lrange [split $input] 1 end]]] trig
if {[string match -nocase $trig $input]} {
if {[string match -nocase [lindex [split $item \|] 1] $chan]} {
set message [join [lrange [split $item \|] 2 end]]
regsub -all -nocase {%b} $message $::botnick message
regsub -all -nocase {%n} $message $nick message
regsub -all -nocase {%c} $message $chan message
regsub -all -nocase {%u} $message $uhand message
regsub -all -nocase {%h} $message $hand message
regsub -all -nocase {%t} $message [lindex [split $input] 0] message
regsub -all -nocase {%i1} $message [lindex [split $input] 1] message
regsub -all -nocase {%i2} $message [join [lrange [split $input] 2 end]]] message
regsub -all -nocase {%i} $message [join [lrange [split $input] 1 end]]] message
putserv "$message"
}
}
}
}
}
putlog "Multi-bind messaging with action missles script loaded." |
Try this one out  _________________ speechles' eggdrop tcl archive
Last edited by speechles on Tue Dec 29, 2009 5:31 pm; edited 1 time in total |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Dec 29, 2009 10:38 am Post subject: |
|
|
| Code: | _-2:36pm-_ <ChanGuardian> [14:36] Tcl error [mycommands_proc]: can't read "message": no such variable
_-2:36pm-_ <ChanGuardian> [14:36] Tcl error [mycommands_proc]: can't read "message": no such variable
_-2:36pm-_ <ChanGuardian> [14:36] Tcl error [mycommands_proc]: can't read "message": no such variable |
Get this error message on bots partyline im assuming its this line
| Code: | | regsub -all -nocase {%t} $message [lindex [split $input] 0] message |
should i change $message to $trig
Edited changed the above now works but still only outputs second to last word its set to show whole line set +J on myself and its still showing what ive said
Changed | Code: | | variable mycommand_flag "*|J" |
to | Code: | | variable mycommand_flag "J|J" |
Now working just the issue with showing whole sentence
Further edit sorted it just needed both %t %i adding and seperated _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Wed Aug 25, 2010 8:04 pm Post subject: speechless |
|
|
| Code: | # Multi-Bind Messaging (the easy way to do this)
# AKA, PutServ-O-Matic v1.1
# by speechles (w/help from egghelp! yay!)
# Construct your triggers|channel|message
# here using the format below:
# "TRIGGER|#CHANNEL|METHOD AND MESSAGE"
# add as little, or as many as you want but you
# MUST use the format described above!
# You also have a few variables to use
# %b - will be replaced with $::botnick (bots current nickname)
# %n - will be replaced with $nick (person triggering)
# %c - will be replaced with $chan (channel triggered in)
# %u - will be replaced with $uhost (person triggering unique host)
# %h - will be replaced with $hand (person triggering handle)
# %t - will be replaced with $trigger (aka 0 lindex)
# %i - will be replaced with user $input (entire thing aka 1-end lrange)
# %i1 - will be replaced with user $input (just the first word aka 1 lindex)
# %i2 - will be replaced with user $input (second to last words aka 2-end lrange)
# below are merely some examples.
variable mycommands {
"*credit card*|*|notice #CWStats :CWStats-Spam-Report: <%n %c> %t %i"
"*creditcard*|*|notice #CWStats :CWStats-Spam-Report: <%n %c> %t %i"
}
# set the flagmask here that you will use to ignore users.
# use ".chattr hand +J" to add users, you can change this flag below.
# be careful which flags you use, they are matched against channel.
variable mycommand_flag "J|J"
# Script begins - change nothing below here
bind pubm -|- "*" mycommands_proc
proc mycommands_proc {nick uhand hand chan input} {
if {![matchattr $hand $::mycommand_flag $chan]} {
foreach item $::mycommands {
set trig [lindex [split $item \|] 0]
regsub -all -nocase {%b} $trig $::botnick trig
regsub -all -nocase {%n} $trig $nick trig
regsub -all -nocase {%c} $trig $chan trig
regsub -all -nocase {%u} $trig $uhand trig
regsub -all -nocase {%h} $trig $hand trig
regsub -all -nocase {%t} $trig [lindex [split $input] 0] trig
regsub -all -nocase {%i1} $trig [lindex [split $input] 1] trig
regsub -all -nocase {%i2} $trig [join [lrange [split $input] 2 end]]] trig
regsub -all -nocase {%i} $trig [join [lrange [split $input] 1 end]]] trig
if {[string match -nocase $trig $input]} {
if {[string match -nocase [lindex [split $item \|] 1] $chan]} {
set message [join [lrange [split $item \|] 2 end]]
regsub -all -nocase {%b} $message $::botnick message
regsub -all -nocase {%n} $message $nick message
regsub -all -nocase {%c} $message $chan message
regsub -all -nocase {%u} $message $uhand message
regsub -all -nocase {%h} $message $hand message
regsub -all -nocase {%t} $trig [lindex [split $input] 0] message
regsub -all -nocase {%i1} $message [lindex [split $input] 1] message
regsub -all -nocase {%i2} $message [join [lrange [split $input] 2 end]]] message
regsub -all -nocase {%i} $message [join [lrange [split $input] 1 end]]] message
putserv "$message"
}
}
}
}
}
putlog "Multi-bind messaging with action missles script loaded." |
Hi speecless the above script no longer seems to work with the new eggdrop if possible is their any way to get it to work
Many thanks _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
|