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 

setudef tips plesae

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


Joined: 08 Sep 2010
Posts: 61

PostPosted: Fri Sep 10, 2010 11:40 pm    Post subject: setudef tips plesae Reply with quote

Code:

setudef flag relaycommand
bind pub - !command cmd:proc

proc cmd:proc { nick uhost hand chan args } {
  if {[channel get $chan relaycommand]} {
  putlog "detected !command and +relaycommand was set to this channel - $chan"
  }
}


is it possible in some way that i'm not able to figure out or find out by reading available documentation, to be able to add, beneath that "putlog" command, to use putallbots WITHOUT specifying a channel within the putall bots command .. and be able to have the other bot that receives the putallbots command be able to know which channel to send text to base off of 'setudef'

hopefully this make sense.. Sad i really hope it does and that someone can shine some lite for me Wink


Last edited by kenh83 on Sat Sep 11, 2010 8:29 am; edited 1 time in total
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sat Sep 11, 2010 4:42 am    Post subject: Reply with quote

Replace:
Code:

setudef +relaycommand

with:
Code:

setudef flag relaycommand

You can replace relaycommand with anything as long as isn't used already.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
kenh83
Halfop


Joined: 08 Sep 2010
Posts: 61

PostPosted: Sat Sep 11, 2010 8:29 am    Post subject: Reply with quote

yes, ceasar thank you for correcting that, but that is not my question or why I posted. Please re-read.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Sep 11, 2010 9:28 am    Post subject: Reply with quote

kenh,
You could loop through all available channels, test each for the "relaycommand" status, and if set, issue the needed commands on that channel..

On a side-note, avoid using the name "args" in your argument list, as this word is handled in a different manner by tcl.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
kenh83
Halfop


Joined: 08 Sep 2010
Posts: 61

PostPosted: Sat Sep 11, 2010 10:13 am    Post subject: Reply with quote

What should be used instead of args?
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Sep 11, 2010 11:01 am    Post subject: Reply with quote

Pretty much anything...
"arg" or "text" would do just fine.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
kenh83
Halfop


Joined: 08 Sep 2010
Posts: 61

PostPosted: Sat Sep 11, 2010 12:42 pm    Post subject: Reply with quote

nml, i'm confused as to what you mean by loop through all the channels..


Could you kindly share an example?

I've dropped using 'args' in all of my scripts. Thanks for the tip!
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Sep 11, 2010 1:22 pm    Post subject: Reply with quote

Something along these lines:
Code:
...
foreach channel [channels] {
  if {[channel get $channel relaycommand]} {
    #This channel is set +relaycommand, so do something here...
    puthelp "PRIVMSG $channel :Woobie!"
  }
}

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
kenh83
Halfop


Joined: 08 Sep 2010
Posts: 61

PostPosted: Sat Sep 11, 2010 5:29 pm    Post subject: Reply with quote

Incredible! I am still learning a lot and haven't gotten to the "loops" yet

I really appreciate you guiding me with this nml375.
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