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.

Halt default output

Old posts that have not been replied to for several years.
Locked
T
TomSommer

Halt default output

Post by TomSommer »

Hi, I'm looking for a way to halt the default output...

like, if someone msg's the bot, it will be shown in the partyline, but I want to halt this (only halt some msg's) in my script, any way to do this?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yes and no.

it all depends what sort of messages.

Give an example of the messages.
I
Iridium

Post by Iridium »

Code: Select all

    (17) RAW (stackable)
         bind raw <flags> <keyword-mask> <proc>
         procname <from> <keyword> <text>

         Description: previous versions of Eggdrop required a special compile
           option to enable this binding, but it's now standard. The mask
           is checked against the keyword (either a numeric, like "368",
           or a keyword, like "PRIVMSG"). from will be the server name or
           the source user (depending on the keyword); flags are ignored.
           The order of the arguments is identical to the order that the
           IRC server sends to the bot. The pre-processing only splits it
           apart enough to determine the keyword. If the proc returns 1,
           Eggdrop will not process the line any further (this could cause
           your bot to behave oddly in some cases).
         Module: server
Example: (tested)

Code: Select all

bind raw - "PRIVMSG" mycommand
proc mycommand {from keyword txt} { 
  global botnick
  if {[lindex [split $txt] 0]==$botnick} { 
   putlog "Blah | $from | $keyword | $txt"
   return 1
  } 
}
$txt is in the form:

Code: Select all

$botnick :text sent to bot
$keyword just contains "PRIVMSG"
and $from contains the full userhost of the person who sent the message
T
TomSommer

Post by TomSommer »

What I'm talking about is when somebody opens a query and sends a msg to the bot

Code: Select all

/msg [bot] hi, whats up?
This will be shown in the log/telnet as

Code: Select all

[16:52] [TomSommer!~tomsommer@sdnat1.dk-tv.net] hi, whats up?
But, my script responds to these msg's and so I don't need to see the raw log from the bot in the telnet/log... so I want to halt these default outputs

I really don't understand your code Iridium, because your code will still show the default output made by the bot when it receives a msg?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

See tcl-commands.doc for information regarding return values.

These will help you.
T
TomSommer

Post by TomSommer »

WOW, Thanks... Just what I was looking for, could you give me an example of the syntax to supress msg's?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

return <number goes here>

As I said, read tcl-commands.doc.

It has information on what return value you should give to log information, supress information, make eggdrop ignore it or make eggdrop continue prcessing the command itself.
T
TomSommer

Post by TomSommer »

I've read it.. and I've used return lots of times before...

But it has no effect on the log output...
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Have you tried using

Code: Select all

return 0
T
TomSommer

Post by TomSommer »

Code: Select all

bind msgm - * test

proc test {nick uhand handle text} {
return 0
}
should work? right?

Yes I've tried return 0
I
Iridium

Post by Iridium »

My code supresses the bot's output..
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You should note, if you look in tcl-commands.doc, that it only applies to msg, and not msgm.

As for the raw bind, you should never use this tactic.

It will prevent any incoming PRIVMSG tagged as detined for the eggdrop.

This will include any CTCP or PRIVMSG commands.

This, people will not receive replies to CTCP ping, or DCC chats.

It defeasts the whole idea of allowing users to trigger commands, while not displaying a putlog line, as it will prevent both.
I
Iridium

Post by Iridium »

Heh, I only meant it to be some example code.. I should have said that you should only use it if you choose what to return 1 on.
Locked