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.

How to make a chanset flag on a script?

Help for those learning Tcl or writing their own scripts.
Post Reply
M
Mysticales
Voice
Posts: 26
Joined: Tue Oct 18, 2011 5:33 pm

How to make a chanset flag on a script?

Post by Mysticales »

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?~
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: How to make a chanset flag on a script?

Post by willyw »

One way:

First, see: http://www.eggheads.org/support/egghtml ... mands.html
and find: setudef



Example would be something like:

Code: Select all

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

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.
M
Mysticales
Voice
Posts: 26
Joined: Tue Oct 18, 2011 5:33 pm

Post by Mysticales »

Thanks! Here is what I used. (For anyone else searching with this issue or question)

Code: Select all

setudef flag your_flag 
For the standard variable to add in the setup or config of a script.

Code: Select all

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?~
User avatar
spithash
Master
Posts: 248
Joined: Thu Jul 12, 2007 9:21 am
Location: Libera
Contact:

Post by spithash »

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
V
Valinath
Voice
Posts: 1
Joined: Mon Apr 09, 2012 12:36 pm

Post by Valinath »

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
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

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).
Post Reply