| View previous topic :: View next topic |
| Author |
Message |
kenh83 Halfop
Joined: 08 Sep 2010 Posts: 61
|
Posted: Fri Sep 10, 2010 11:40 pm Post subject: setudef tips plesae |
|
|
| 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.. i really hope it does and that someone can shine some lite for me 
Last edited by kenh83 on Sat Sep 11, 2010 8:29 am; edited 1 time in total |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Sep 11, 2010 4:42 am Post subject: |
|
|
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 |
|
 |
kenh83 Halfop
Joined: 08 Sep 2010 Posts: 61
|
Posted: Sat Sep 11, 2010 8:29 am Post subject: |
|
|
| yes, ceasar thank you for correcting that, but that is not my question or why I posted. Please re-read. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Sep 11, 2010 9:28 am Post subject: |
|
|
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 |
|
 |
kenh83 Halfop
Joined: 08 Sep 2010 Posts: 61
|
Posted: Sat Sep 11, 2010 10:13 am Post subject: |
|
|
| What should be used instead of args? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Sep 11, 2010 11:01 am Post subject: |
|
|
Pretty much anything...
"arg" or "text" would do just fine. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
kenh83 Halfop
Joined: 08 Sep 2010 Posts: 61
|
Posted: Sat Sep 11, 2010 12:42 pm Post subject: |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Sep 11, 2010 1:22 pm Post subject: |
|
|
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 |
|
 |
kenh83 Halfop
Joined: 08 Sep 2010 Posts: 61
|
Posted: Sat Sep 11, 2010 5:29 pm Post subject: |
|
|
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 |
|
 |
|