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 

locking !cmd to a channel

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Fri Jun 02, 2006 5:59 pm    Post subject: locking !cmd to a channel Reply with quote

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


Joined: 21 Aug 2004
Posts: 76
Location: /pub/beer

PostPosted: Fri Jun 02, 2006 9:19 pm    Post subject: Reply with quote

Code:
proc pub:servers {nick uhost hand chan text} {
  set chan [string tolower $chan]
  if {$chan == "#foo" || $chan == "#bar"} {


|| == "OR"
&& == "AND"
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Fri Jun 02, 2006 10:14 pm    Post subject: Reply with quote

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


Joined: 21 May 2006
Posts: 103

PostPosted: Sat Jun 03, 2006 12:18 am    Post subject: Reply with quote

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


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sat Jun 03, 2006 12:42 am    Post subject: Reply with quote

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


Joined: 21 May 2006
Posts: 103

PostPosted: Sat Jun 03, 2006 1:37 am    Post subject: Reply with quote

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


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Jun 03, 2006 7:00 am    Post subject: Reply with quote

Read what the previous posts say, you didn't include the setudef.
Back to top
View user's profile Send private message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Sat Jun 03, 2006 7:58 am    Post subject: Reply with quote

works great now - thanks for pointing that part out Razz silly me
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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