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.

One for speechless

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

One for speechless

Post by blake »

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: 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 {
  "*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."
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: One for speechless

Post by speechles »

Code: Select all

# 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 ;)
Last edited by speechles on Tue Dec 29, 2009 5:31 pm, edited 1 time in total.
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Code: Select all

_-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: Select all

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: Select all

variable mycommand_flag "*|J"
to

Code: Select all

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
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

speechless

Post by blake »

Code: Select all

# 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
Post Reply