egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Join Room Script (Modify)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Tue Jul 21, 2009 2:59 pm    Post subject: Join Room Script (Modify) Reply with quote

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
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Tue Jul 21, 2009 5:07 pm    Post subject: Re: Join Room Script (Modify) Reply with quote

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
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Jul 21, 2009 6:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Wed Jul 22, 2009 4:05 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Rapfnny
Voice


Joined: 16 May 2009
Posts: 8
Location: irc.Bob-Omb.net

PostPosted: Wed Jul 22, 2009 10:04 am    Post subject: Re: Reply with quote

This is really familiar Razz
_________________
Bob-Omb
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber