| View previous topic :: View next topic |
| Author |
Message |
Mysticales Voice
Joined: 18 Oct 2011 Posts: 26
|
Posted: Sat Oct 29, 2011 4:15 pm Post subject: How to make a chanset flag on a script? |
|
|
Hello, just wondering, for the script, Strategy or hell, anything else Id like. How would I make a chanset flag so the script would only run if I have it set to +? Looking to add the games to my bot, but dont want them active all the time. Thanks. =) _________________ ~Battlez-avec la Mystique?~ |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Oct 29, 2011 5:47 pm Post subject: Re: How to make a chanset flag on a script? |
|
|
One way:
First, see: http://www.eggheads.org/support/egghtml/1.6.20/tcl-commands.html
and find: setudef
Example would be something like:
| Code: |
setudef flag your_flag
|
Then, for the first line of any proc that you want to activate, only when you have:
.chanset #channel +your_flag
put this:
| Code: |
if {([lsearch -exact [channel info $chan] {+your_flag}] != -1)} {
### the rest of the procedure goes here
###
}
|
You can find:
channel info
in tcl-commands.doc too.
For
lsearch
go here: http://www.tcl.tk/man/tcl8.5/TclCmd/lsearch.htm
I hope this helps. |
|
| Back to top |
|
 |
Mysticales Voice
Joined: 18 Oct 2011 Posts: 26
|
Posted: Sat Oct 29, 2011 7:08 pm Post subject: |
|
|
Thanks! Here is what I used. (For anyone else searching with this issue or question)
| Code: | | setudef flag your_flag |
For the standard variable to add in the setup or config of a script.
| Code: | | if {![channel get $chan your_flag]} { return 0 } |
Put that line in the proc of a script (or the part of the script that starts the thing) added it BEFORE any other "if" lines of the script after proc.
Worked well. =)
(Added this atm to the Strategy script, very handy now to disable so people dont activate it mid busy time of the week in the room) _________________ ~Battlez-avec la Mystique?~ |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sun Oct 30, 2011 11:08 am Post subject: |
|
|
stop posting wherever you feel like. posts like this one and the other you made, should be in "scripting help". ever used a forum before? _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
Valinath Voice
Joined: 09 Apr 2012 Posts: 1
|
Posted: Mon Apr 09, 2012 3:56 pm Post subject: |
|
|
So.. as i cant get DCC to work, and .chanset doesnt work in my partyline for some reason..
Is it possible to remove those lines in the scripts to make it work?
(The question is if this is possible to reverse?)
/Valinath |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Mon Apr 09, 2012 6:50 pm Post subject: |
|
|
| Valinath wrote: | So.. as i cant get DCC to work, and .chanset doesnt work in my partyline for some reason..
|
Suggest that you start your own thread. You are much more likely to get help that way.
Before you try to do what you want, you should first get DCC chat to work with bot (or telnet) so that you can join the partyline.
Next, there must be some reason that .chanset does not work. You should figure that out, or get help figuring it out. It is a necessary command.
Those are the things you might want to ask about - first - when you start your new thread.
View the forum home here: http://forum.egghelp.org/
and choose the best section, depending on your question(s). |
|
| Back to top |
|
 |
|