Code: Select all
proc pub_hello {nick uhost hand channel arg} {
global botnick
putquick "PRIVMSG $channel :\001ACTION waves hello to $nick.\001"
return 0
}
bind pubm - "*hello*" pub_hello
Code: Select all
bind pubm - "word1" pub_word1
bind pubm - "word*" pub_word2
Code: Select all
putquick "PRIVMSG $channel :\001ACTION waves hello to $nick.\001"
Code: Select all
# 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 {
"*add word here*|*|notice #channelnamehere :Relay: <%n %c>%i"
"*add word here*|*|notice #channelnamehere :Relay: <%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."
BigToe wrote:How do I set it to relay the whole line in case my trigger is "*Hello*"?
I only got it to relay from that word and on, and not the whole sentence
Code: Select all
"*add word here*|*|notice #channelnamehere :Relay: <%n %c>%i %2"
Code: Select all
# 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.