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.

locking !cmd to a channel

Help for those learning Tcl or writing their own scripts.
Post Reply
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

locking !cmd to a channel

Post by whittinghamj »

i have the following working just fine thanks to dragnlorn

Code: Select all

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
d
dwickie
Halfop
Posts: 76
Joined: Sat Aug 21, 2004 8:53 am
Location: /pub/beer

Post by dwickie »

Code: Select all

proc pub:servers {nick uhost hand chan text} {
  set chan [string tolower $chan]
  if {$chan == "#foo" || $chan == "#bar"} {
|| == "OR"
&& == "AND"
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

Code: Select all

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: Select all

.chanset #channel +servers
from the partyline
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

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: Select all

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: Select all

(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?
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

I didn't say anything about chanmode.

it would be:

Code: Select all

.chanset #dump +inc
from your last given example

(if you included the "setudef flag inc" in the script, not in the proc)
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

hey man

that code as above is exactly how i have it in the tcl page.

this is what i get

Code: Select all

(00:37:17) (Quest) .chanset #dump +sections
(00:37:17) (FServ) Error trying to set +sections for #dump, invalid mode.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Read what the previous posts say, you didn't include the setudef.
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

Post by whittinghamj »

works great now - thanks for pointing that part out :P silly me
Post Reply