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.

Auto join on invite

General support and discussion of Eggdrop bots.
Post Reply
m
matt932
Voice
Posts: 1
Joined: Sun Oct 23, 2011 11:51 pm

Auto join on invite

Post by matt932 »

How can i make eggdrop auto join a channel when its invited to it
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Hi matt932,
This will require a custom script, as there is no native function for this:

To trigger on the invite, you'll need to use a raw binding, looking for the INVITE keyword.
To make your eggdrop join the channel, you'll need to use the "channel add" command.

A rough (rather unsafe) script would look somewhat like follows. Be adviced this script does no permission-checks whatsoever - You'll probably want to add something to restrict who may use it...

Code: Select all

bind raw - INVITE checkInvites

proc checkInvites {from keyword text} {
  set args [split $text]
  set channel [lindex $args 1]

  channel add $channel
  return 0
}
A version with some safetychecks, though it requires the inviter to have op privileges and be in a channel where your eggdrop can see them before accepting the invite:

Code: Select all

bind raw - INVITE checkInvites

proc checkInvites {from keyword text} {
  set args [split $text]
  set channel [lindex $args 1]
  set handle [nick2hand $from]

  if {$handle == "" || ![matchattr $handle +mno]} {
    return 0
  }

  channel add $channel
  return 0
}
NML_375
Post Reply