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.

Join Room Script (Modify)

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Join Room Script (Modify)

Post by cache »

Code: Select all

bind MSG -|- "join" msg:join 
bind MSG -|- "part" msg:part 

proc msg:join {nick uhost handle text} { 
        set chan [lindex [split $text] 0] 
        channel add $chan 
        putserv "PRIVMSG $chan :Invited by $nick" 
} 

proc msg:part {nick uhost handle text} { 
        set chan [lindex [split $text] 0] 
        channel remove $chan 
} 
Can someone please modify this so that when it adds a channel to the eggdrop.chan file and adds chansets like +weather +horoscope +alice ?

Thanks
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Re: Join Room Script (Modify)

Post by tomekk »

try:

Code: Select all

set chan_sets "+weather +horoscope +alice"

#################################################
bind MSG -|- "join" msg:join
bind MSG -|- "part" msg:part

proc msg:join {nick uhost handle text} {
        global chan_sets

        set chan [lindex [split $text] 0]
        channel add $chan
        channel set $chan $chan_sets
        putserv "PRIVMSG $chan :Invited by $nick"
}



proc msg:part {nick uhost handle text} {
        set chan [lindex [split $text] 0]
        channel remove $chan
}
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

That won't work, as "channel set" (contrary to "channel add") expects each setting as a separate argument rather than a list of settings.

The two examples below should work though (and also illustrates the difference between channel set and channel add

Code: Select all

...proc msg:join {nick uhost handle text} {
  set chan [lindex [split $text] 0]
  channel add $chan "+weather +horoscope +alice"
  putserv "PRIVMSG $chan :Invited by $nick"
}...
Or

Code: Select all

...proc msg:join {nick uhost handle text} {
  set chan [lindex [split $text] 0]
  channel add $chan
  channel set $chan +weather +horoscope +alice
  putserv "PRIVMSG $chan :Invited by $nick"
}...
NML_375
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

nml375 wrote:That won't work, as "channel set" (contrary to "channel add") expects each setting as a separate argument rather than a list of settings.

The two examples below should work though (and also illustrates the difference between channel set and channel add

Code: Select all

...proc msg:join {nick uhost handle text} {
  set chan [lindex [split $text] 0]
  channel add $chan "+weather +horoscope +alice"
  putserv "PRIVMSG $chan :Invited by $nick"
}...
Or

Code: Select all

...proc msg:join {nick uhost handle text} {
  set chan [lindex [split $text] 0]
  channel add $chan
  channel set $chan +weather +horoscope +alice
  putserv "PRIVMSG $chan :Invited by $nick"
}...
exactly,
to lazy to check before

Code: Select all

set chan_sets "+weather +horoscope +alice"

#################################################
bind MSG -|- "join" msg:join
bind MSG -|- "part" msg:part

proc msg:join {nick uhost handle text} {
        global chan_sets

        set chan [lindex [split $text] 0]
        channel add $chan

        foreach chan_set [split $chan_sets] {
                if {$chan_set != ""} {
                        channel set $chan $chan_set
                }
        }

        putserv "PRIVMSG $chan :Invited by $nick"
}

proc msg:part {nick uhost handle text} {
        set chan [lindex [split $text] 0]
        channel remove $chan
}
ty.
R
Rapfnny
Voice
Posts: 8
Joined: Sat May 16, 2009 8:31 pm
Location: irc.Bob-Omb.net
Contact:

Re:

Post by Rapfnny »

This is really familiar :P
Post Reply