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.

pubm

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
crux
Voice
Posts: 35
Joined: Fri Jan 05, 2007 12:41 pm
Location: Myanmar
Contact:

pubm

Post by crux »

this code doesn't work......
I think it's incorrect binding pubm
somethings need to do ...

pls help me to correct..

Code: Select all

bind pubm -|- "hello there" hello

proc hello {nickname hostname handle channel} {
  if {[string equal $channel #mychan]} {
    putquick "PRIVMSG $channel :Hello welcome to #mychan"
  }
}
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

(6) PUBM (stackable)
bind pubm <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel> <text>

Description: just like MSGM, except it's triggered by things said
on a channel instead of things /msg'd to the bot. The mask is
matched against the channel name followed by the text and can
| contain wildcards. If the proc returns 1, Eggdrop will not log
| the message that triggered this bind. PUBM binds are processed
| before PUB binds. If the exclusive-binds setting is enabled,
| PUB binds will not be trigged by text that a PUBM bind has
| already handled.
Module: irc
Obviously, you're missing a variable to handle the <text> argument. Modify your proc-head accordingly.

Also, as stated above, the mask is matched against "<channel> <text>", so your binding will never trigger. Something like "% sometext" would match "sometext" on any channel
NML_375
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Re: pubm

Post by rosc2112 »

Code: Select all

bind pubm -|- "% hello there" hello

proc hello {nickname hostname handle channel text} {
  if {$channel == "#mychan"} {
    putquick "PRIVMSG #mychan :Hello welcome to #mychan"
  }
  # set this to 'return 1' if you don't want the trigger being logged
   return 0
}
Should work..
Post Reply