| View previous topic :: View next topic |
| Author |
Message |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Tue Jul 21, 2009 2:59 pm Post subject: Join Room Script (Modify) |
|
|
| Code: | 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 |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Tue Jul 21, 2009 5:07 pm Post subject: Re: Join Room Script (Modify) |
|
|
try:
| Code: | 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
}
|
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Jul 21, 2009 6:01 pm Post subject: |
|
|
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: | ...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: | ...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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Wed Jul 22, 2009 4:05 am Post subject: |
|
|
| 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: | ...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: | ...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: | 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. |
|
| Back to top |
|
 |
Rapfnny Voice
Joined: 16 May 2009 Posts: 8 Location: irc.Bob-Omb.net
|
Posted: Wed Jul 22, 2009 10:04 am Post subject: Re: |
|
|
This is really familiar  _________________ Bob-Omb |
|
| Back to top |
|
 |
|