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.

calling a procedure when bot begins

Old posts that have not been replied to for several years.
Locked
G
Guest

Post by Guest »

I'm creating a trivia bot and I have sorted out all the commands like !start to start the game once the bot is in the channel.. but how do I make it start as soon as it enters the channel as i turn on the eggdrop??

When it enters it should run the procedure (triviastart) exactly as !start entered in the channel does.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

As such, this is not 100% possible.

It is possible to run a script as such as the bot is sterted, as soon as it connects to a server and on many other events. But running a script when the bot joins the channel, is not currently a supported event in eggdrop (allthough, it should).

If the script where to be run during any of other events mentioned above, then output to the server may either be lost, return a error, or cause eggdrop to barf.

What I am about to say, come from one of my most hated areas of eggdrop, so some1 else will need to get there fingers out.

It is possible to get around this problem with a raw bind. Using a raw bind, to detact the return replies of commands sent to the server, just after eggdrop joined a channel, should allow you to detect the point where you want to run your script.
g
guppy
eggdrop engineer
Posts: 199
Joined: Mon Sep 24, 2001 8:00 pm
Location: Canada
Contact:

Post by guppy »

why not use bind join?

bind join - * blah

proc blah {nick uhost hand chan} {
if {[isbotnick $nick]} {
putlog "I just joined $chan"
}
}
Locked