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.

Bind, messages from bot itself [SOLVED]

Help for those learning Tcl or writing their own scripts.
Post Reply
a
arune
Voice
Posts: 2
Joined: Tue Nov 20, 2007 2:12 pm

Bind, messages from bot itself [SOLVED]

Post by arune »

Hello, I'm new to eggdrop scripts and tcl in general.

I have the following eggdrop script
http://pastebin.ca/933527 (This pastebin will work for a couple of month)
It's a logger that outputs in mirc format.
Can't seem to find where I got the script from anymore.

Now the problem is that my bot posts messages from the "partyline" now and then (when anything changes in my wiki: http://www.arune.se/script:dokuwiki-com ... to-eggdrop and when somebody makes commits to subversion), the logging script does not seem to catch the messages from the bot itself.

The binds of the script at the bottom of this post.
Is the script missing something? Could a raw be used and then filter on messages from the bot somehow?

Code: Select all

### Events
bind join - "#* *!*@*" logger:join
bind part - "#* *!*@*" logger:part
bind sign - "#* *!*@*" logger:quit
bind pubm - "#* *" logger:text
bind nick - "#* *" logger:nick
bind kick - "#* *" logger:kick
bind mode - "#* *" logger:mode
bind topc - "#* *" logger:topic
bind raw - "333" logger:topic-author
bind ctcp - "ACTION" logger:action
Last edited by arune on Mon Mar 10, 2008 2:08 am, edited 2 times in total.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

The bot does not trigger events from its own text/actions...
Instead, write wrapper functions for all the server queues...

eg.

Code: Select all

# rename putserv command
rename putserv orig_putserv
# create new putserv command
proc putserv {text {options ""}} {
  # log the event, or do whatever it is you want done
  putlog "$text"
  # call the original putserv
  orig_putserv $text $options
}
Just a rough example... You'll need to do similar for all the other server queue functions as well, such as puthelp, pushmode, etc..

If all you want is to log all outbound eggdrop events to a regular eggdrop logfile, see this thread. There are probably scripts to convert eggdrop log files to mirc format.
a
arune
Voice
Posts: 2
Joined: Tue Nov 20, 2007 2:12 pm

Post by arune »

Thanks for the help.
As a newbie I'll stick with a "fix", I'll make a second bot for logging, this will also save me some trouble with op in channels (loosing op when my connection is bad).

My hope before posting my previous post was that there were a simple bind that I've missed. Thanks again.
Post Reply