| View previous topic :: View next topic |
| Author |
Message |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Fri Jun 02, 2006 5:59 pm Post subject: locking !cmd to a channel |
|
|
i have the following working just fine thanks to dragnlorn
| Code: | proc pub:servers {nick uhost hand chan text} {
set chan [string tolower $chan]
if {$chan == "#inc"} { |
how can i set this to work on two / three channels only? i tried #chan1, #chan2 but it did not work on any channel then?
Suggestions please?
Cheers |
|
| Back to top |
|
 |
dwickie Halfop
Joined: 21 Aug 2004 Posts: 76 Location: /pub/beer
|
Posted: Fri Jun 02, 2006 9:19 pm Post subject: |
|
|
| Code: | proc pub:servers {nick uhost hand chan text} {
set chan [string tolower $chan]
if {$chan == "#foo" || $chan == "#bar"} {
|
|| == "OR"
&& == "AND" |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Fri Jun 02, 2006 10:14 pm Post subject: |
|
|
| Code: | setudef flag servers
proc pub:servers {nick uhost hand chan text} {
set chan [string tolower $chan]
if {[channel get $chan servers]} { |
Now to apply script to any channel, merely use:
| Code: | | .chanset #channel +servers | from the partyline |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Sat Jun 03, 2006 12:18 am Post subject: |
|
|
hey dragnlord
thanks buddy
i did as you said (pasted the wrong proc but meh )
I have this for lobby
bind pub - !sections pub:sections
| Code: |
bind pub - !sections pub:sections
proc pub:sections {nick uhost hand chan arg} {
set chan [string tolower $chan]
if {[channel get $chan inc]}
putserv "PRIVMSG $chan :4SERVER SECTION LIST"
putserv "PRIVMSG $chan :4Apollo :: TV MOVIES GAMES MUSIC PORN"
putserv "PRIVMSG $chan :4Hades :: APPS APPS_ISO OS REQUESTS"
putserv "PRIVMSG $chan :4Poseidon :: APPS EBOOKS MOVIES OS 0-DAY REQUESTS"
}
|
in idx i did this
| Code: |
(23:13:08) (Quest) .chanset #dump chanmode +inc
(23:13:08) (FServ) Successfully set modes { chanmode { +inc } } on #dump. |
when I go into #dum and run the !sections command - nothing happens.
Any suggestions buddy? am i missing a set of braces maybe? |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sat Jun 03, 2006 12:42 am Post subject: |
|
|
I didn't say anything about chanmode.
it would be:
| Code: | | .chanset #dump +inc | from your last given example
(if you included the "setudef flag inc" in the script, not in the proc) |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Sat Jun 03, 2006 1:37 am Post subject: |
|
|
hey man
that code as above is exactly how i have it in the tcl page.
this is what i get
| Code: | (00:37:17) (Quest) .chanset #dump +sections
(00:37:17) (FServ) Error trying to set +sections for #dump, invalid mode.
|
|
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Jun 03, 2006 7:00 am Post subject: |
|
|
| Read what the previous posts say, you didn't include the setudef. |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Sat Jun 03, 2006 7:58 am Post subject: |
|
|
works great now - thanks for pointing that part out silly me |
|
| Back to top |
|
 |
|