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.

Inviting the bot?

Old posts that have not been replied to for several years.
Locked
W
Wildfire
Voice
Posts: 11
Joined: Fri May 16, 2003 4:51 pm

Inviting the bot?

Post by Wildfire »

Okay, I'm quite willing to just be told I'm an idiot, but I have yet to figure this one out. The point of this bot is to provide a dice server for an RPG IRC server.

The main function I need it to be able to do is to join channels its invited to, ie the GM types "/msg bot invite #channel" and the bot joins the channel, the GM types "/msg bot leave #channel" and the bot leaves.

I can find a ton of scripts having to do with inviting users but nothing having to do with inviting the bot. BTW these will be bot users, not owners or ops who will be using this command, and I'd prefer to avoid having to use DCC for it
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

So from who would you like it to ask for an invite?
Once the game is over, the king and the pawn go back in the same box.
W
Wildfire
Voice
Posts: 11
Joined: Fri May 16, 2003 4:51 pm

Post by Wildfire »

The bot can't ask anyone as it won't be aware of the channels that exsist. There's no telling what channels will be created for various games, I simply want the bot to respond to a "invite #channel" command given to it by users with a certain flag by joining said channel.
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

If I understood what yout told us you want something like this...

Code: Select all

bind msg - invite invite_msg
bind msg - leave leave_msg

proc invite_msg {nick host handle args} {
if {[validuser $handle]} {
set args [lindex $args 0]
set chan [lindex $args 0]
putserv "NOTICE $nick :I will now join $chan"
channel add $chan
return 1
}

proc leave_msg {nick host handle args} {
if {[validuser $handle]} {
set args [lindex $args 0]
set chan [lindex $args 0]
putserv "NOTICE $nick :I will now leave $chan"
channel remove $chan
return 1
}
«A fantastic spaghetti is a spaghetti that does not exist»
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

i think you forgot a couple of "}" :)
photon?
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

hehe yes... Wildfire put a } at the end of each proc
«A fantastic spaghetti is a spaghetti that does not exist»
W
Wildfire
Voice
Posts: 11
Joined: Fri May 16, 2003 4:51 pm

Post by Wildfire »

Heh, thanks very much, that's exactly what I needed :)
Locked