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 

How to make a chanset flag on a script?

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


Joined: 18 Oct 2011
Posts: 26

PostPosted: Sat Oct 29, 2011 4:15 pm    Post subject: How to make a chanset flag on a script? Reply with quote

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


Joined: 15 Jan 2009
Posts: 970

PostPosted: Sat Oct 29, 2011 5:47 pm    Post subject: Re: How to make a chanset flag on a script? Reply with quote

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


Joined: 18 Oct 2011
Posts: 26

PostPosted: Sat Oct 29, 2011 7:08 pm    Post subject: Reply with quote

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


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Sun Oct 30, 2011 11:08 am    Post subject: Reply with quote

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?
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Valinath
Voice


Joined: 09 Apr 2012
Posts: 1

PostPosted: Mon Apr 09, 2012 3:56 pm    Post subject: Reply with quote

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


Joined: 15 Jan 2009
Posts: 970

PostPosted: Mon Apr 09, 2012 6:50 pm    Post subject: Reply with quote

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
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