mIRC Home    About    Download    Register    News    Help

Print Thread
#251935 10/03/15 01:07 AM
Joined: Dec 2013
Posts: 779
N
Nillen Offline OP
Hoopy frood
OP Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
I'd like to be see something like this

/timer3+ off
;Turns off all timers from 3 and above.
/timer3- off
;Turns off all timers from 3 and below.
/timer3-7 off
;Turns off all timers from 3 to 7.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Nillen #251936 10/03/15 01:25 AM
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
What purpose would this serve other than cosmetics?
How would this be beneficial to scripters?
Can you give an actual use-case of the suggestion?
--
This suggestion has the possibility of breaking backwards compatability with older scripts. Someone could code a timer with the name "1-2", your suggestion would either interfer with that or work in an unintended way.

Last edited by FroggieDaFrog; 10/03/15 01:32 AM.

I am SReject
My Stuff
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
If you want this ability use named timers and wildcards

Joined: Dec 2013
Posts: 779
N
Nillen Offline OP
Hoopy frood
OP Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
I use multiple timers to check market API on a game I play. I'd like to be able to close numbers of them at a time.

Even if I were to use named timers, I'd have to script something nice that would close all $timer(name,%i) while %i != my target

Note that at times I can have up to 70 timers at once, and it's not something as simple to combine all the timers to be more concise.
This is all controlled remotely by not only me, but other users as well.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Nillen #251942 10/03/15 02:47 AM
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Code:
alias extimer {
if (!$1) { 
echo -st /extimer error: wrong format
}
else {
if ($right($1,1) == +) {
if ($gettok($1,1,43) isnum 1-$timer(0)) {
var %x = $gettok($1,1,43)
while (%x <= $timer(0)) {
$+(.timer,%x) off 
inc %x
}
echo -st Halted Timers $gettok($1,1,43) and up
}
elseif ($gettok($1,1,43) !isnum 1-$timer(0)) {
echo -st /extimer error: The Active Timers Are $timer(0)
}
}
elseif ($right($1,1) == -) {
if ($numtok($1,45) == 1) {
if ($gettok($1,1,45) isnum 1-$timer(0)) {
var %x = 1 
while (%x <= $gettok($1,1,45)) {
$+(.timer,%x) off
inc %x 
}
echo -st Halted Timers $gettok($1,1,45) and down 
}
elseif ($gettok($1,1,43) !isnum 1-$timer(0)) {
echo -st /extimer error: the active timers are $timer(0) 
}
}
elseif ($numtok($1,43) == 2) {
if ($gettok($1,1,43) isnum 1-$timer(0)) || ($gettok($1,2,43) isnum 1-$timer(0)) {
var %x = $gettok($1,1,43)
while (%x <= $gettok($1,2,43)) {
$+(.timer,%x) off
}
echo -st Halted Timers From $gettok($1,1,43) to $gettok($1,2,43)
}
else {
if ($gettok($1,1,43) !isnum 1-$timer(0)) || ($gettok($1,2,43) !isnum 1-$timer(0)) {
echo -st /timerex error: Wrong Format ( $1 )
}
}
}
}
}

i cant test it on my own cause im not on my pc.
May Khaled be with you :p
Not exactly the format you asked for but i think it could work for now :p

Last edited by OrFeAsGr; 10/03/15 02:54 AM.
OrFeAsGr #251943 10/03/15 03:06 AM
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Hmmm i just saw i made a terrible mistake..
elseif ($right($1,1) == -)
This just cancels one part of the script.. ill try correcting later cause im gonna sleep on my phone ... if you like my temporary idea ..:p see ya!!!
ZzzzZzZzzZz

OrFeAsGr #251946 10/03/15 01:34 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline OP
Hoopy frood
OP Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
I could script it myself. I'd most likely script some sort of ui on my personal mIRC that pulls info from the bot through a notice or privmsg and then populate a list in the ui where I can control them easier. I just don't like that solution since it's not nearly as fast nor productive as it would have been if it was natively available in mIRC.

It would require me to loop through the number of timers each time creating a new timer.
When TimerGather2 is available but 3,4,5 is already taken I'd have to break the loop and put the new timer on the first slot available.
Then I'd have to loop through the timers to send info to the other UI. I'd then have to loop through the timers to close all within specified range.
It's just not a pretty script, and it could be so much faster and easier to control if it was natively supported. Hence my request.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Nillen #251951 10/03/15 09:18 PM
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Originally Posted By: Nillen
Note that at times I can have up to 70 timers at once, and it's not something as simple to combine all the timers to be more concise.
Why would you have so many timers running. What reasons would stop you from being able to batch timers?

Originally Posted By: Nillen
Even if I were to use named timers, I'd have to script something nice that would close all $timer(name,%i) while %i != my target
If you want to keep all but one timer running, why not just store the timer's (reps, delay, time-left, command), disable all timers, and then reinitialize the one you want.

With named timers you could also group certain timers together, so /timergroupA* off would turn of only timers from groupA


I am SReject
My Stuff
Joined: Dec 2013
Posts: 779
N
Nillen Offline OP
Hoopy frood
OP Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
The timers are all remotely controlled by members of a channel. The script starts a timer based on the users preference and checks the market every so often based on preference. The bot is hosted on a server remotelly and I want to control which timers are active and not. Some of them I deem are unneccesary and I want easier controls to close them.

For instance. User A wants to check the market price for Tritanium in three different regions of the universe every 600 seconds. This starts one timer with specifications to check those 3 regions for Tritanium on the market and report the sale price to him.

Another user wants to check one single system's prices of a certain ship, cause he knows someone will put up multiple of them in a short while, so he starts a timer to check a certain system every 10 seconds for a certain ship. This replies with the specified sale price for that item under those specifications.

Imagine putting 70 of these together under the same alias and calling it once per every 10 seconds. Simply not practically doable.
Some users require checks for short durations while other just want to keep updated on the market price of what they're manufacturing and can keep timers only per hour. But the consensus is that they all need their own timer.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Link Copied to Clipboard