View previous topic :: View next topic |
Author |
Message |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Thu Oct 06, 2005 12:42 pm Post subject: chanset check script |
|
|
Hello.
I need script which check every X min the channel flags what i wrote.
For example:
Code: | #flags to check
chanset #mychan +usecolors |
this is important to wright so "#chan flag" because I need several chans with different flags.
Code: | #check every X min
set chechtime=X |
so it check on #mychan flag +usecolors every X min. If its turn off script turn this on.
Thank you. Hope you understand my eng. |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Oct 06, 2005 3:28 pm Post subject: |
|
|
Code: | if {[timerexists check:flags]==""} {
timer 5 check:flags
}
proc check:flags {} {
foreach chan [channels] {
if {![channel get $chan usecolors]} {
channel set $chan +usercolors
}
}
timer 5 check:flags
} |
This will check for the flag on all channels every 5 minutes, if disabled it'll enable it.
PS: alltools.tcl should be loaded for the [timerexists] command to work. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Thu Oct 06, 2005 10:08 pm Post subject: |
|
|
Thank you, but if I need on chan #1 + usecolors on #2 - usecilors.
Can this be set by this way?
#anychan1 +usecolors
#anychan2 -usecolors
#anychan3 -udef...
first of all I need this script to save and check udef flags, because after restart they disappears and I have to wrote it again. |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Oct 08, 2005 9:18 am Post subject: |
|
|
Udefs don't usually get reset after rehash or restart unless you have some script that's doing so. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Sat Oct 08, 2005 10:52 am Post subject: |
|
|
but what should I do to prevent it?
first idea was to get a script what would be keep it. |
|
Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Oct 08, 2005 11:17 am Post subject: |
|
|
once defined by some script, udefs are saved in chanfile; they won't disappear unless your script(s) use [setudef] inconsistently (i.e. failing to re-define udefs each time) _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Sat Oct 08, 2005 1:34 pm Post subject: |
|
|
there is such patch what I cant setup, I think that this will be the analogous script.
little info about this patch you can read here |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Oct 08, 2005 10:56 pm Post subject: |
|
|
In this thread,
demond wrote: | you can fix it yourself just as I did, by editing src/mod/channels.mod/tclchan.c and substituting all occurances of the number 2048 with 4096, also 2047 with 4095 (these are in one function only, tcl_channel_add()); don't forget to recompile, reinstall & restart the bot after you are done with that  |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Sun Oct 09, 2005 1:32 am Post subject: |
|
|
thank you. |
|
Back to top |
|
 |
|