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.

[SOLVED] bind pub

Help for those learning Tcl or writing their own scripts.
Post Reply
v
veblen
Voice
Posts: 18
Joined: Tue Mar 13, 2007 11:23 am

[SOLVED] bind pub

Post by veblen »

can i make pub binds channel specific..

or do i have to use in the proc something like, if {$chan == #chan} ?
Last edited by veblen on Thu Mar 22, 2007 6:44 pm, edited 1 time in total.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: bind pub

Post by user »

doc/tcl-commands.doc wrote: (4) PUB
bind pub <flags> <command> <proc>
procname <nick> <user@host> <handle> <channel> <text>

Description: used for commands given on a channel. The first word
becomes the command
and everything else is the text argument.
Module: irc


(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
Have you ever read "The Manual"?
v
veblen
Voice
Posts: 18
Joined: Tue Mar 13, 2007 11:23 am

Post by veblen »

ok i have a different question then, i have a script that reacts to channel commands.. but i want the bot to sit in more channels, without the commands being triggered in some.

whats the best way to edit my script to only allow selected channels to trigger pub procs? and i really want to be able to edit this easily so i can add & remove channels from the ones i want to allow the commands in.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Code: Select all

# add this to the top of your script:
setudef flag YOURCHANNELSETTINGNAME

# add this as the first line inside the proc triggered by your pub bind:
if {![channel get $chan YOURCHANNELSETTINGNAME]} return

# then .rehash and do .chanset #theChannelWhereYouWantTheScriptToWork +YOURCHANNELSETTINGNAME
Have you ever read "The Manual"?
v
veblen
Voice
Posts: 18
Joined: Tue Mar 13, 2007 11:23 am

Post by veblen »

is there any documentation about setudf? could u point me in its direction.. i cant seem to find much.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Look in the tcl-commands.doc that comes with eggdrop (a google search for 'setudef eggdrop' would've found it as well):

http://www.eggheads.org/support/egghtml ... mands.html

setuser <handle> <entry-type> [extra info]
Description: this is the counterpart of getuser. It lets you set the various values. Other then the ones listed below, the entry-types are the same as getuser's.
PASS - sets a users password (no third arg will clear it)
HOSTS - if used with no third arg, all hosts for the user will be
be cleared. Otherwise, *1* hostmask is added :P
LASTON - This setting has 3 forms. "setuser <handle> LASTON
<unixtime> <place>" sets global LASTON time, "setuser
<handle> LASTON <unixtime>" sets global LASTON time
(leaving the place field empty), and "setuser <handle>
LASTON <unixtime> <channel>" sets a users LASTON time for a channel (if it is a valid channel).
Returns: nothing
Module: core
v
veblen
Voice
Posts: 18
Joined: Tue Mar 13, 2007 11:23 am

Post by veblen »

hehe sorry, my mistake.. i was searching for setudf, instead of setudef :shock:

no wonder i couldnt find anything.

thanks alot guys.
Post Reply