mIRC Home    About    Download    Register    News    Help

Print Thread
#159638 19/09/06 11:56 AM
Joined: May 2006
Posts: 122
J
jizzy Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: May 2006
Posts: 122
How about a -l switch added to the timer switch where the timer can only because altrered by the current script?
That would stop timers that are important to a certain scripts functionalty from be accidently terminated.
Would also prevent common timer names conflicting with other scripts using the same timer name.


If only women came with popup menus and online help.
#159639 20/09/06 02:03 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
would also make terminating rouge timers damn hard!

#159640 20/09/06 07:48 AM
Joined: May 2006
Posts: 122
J
jizzy Offline OP
Vogon poet
OP Offline
Vogon poet
J
Joined: May 2006
Posts: 122
True what about if it was still accessable via the command line but the name was local


If only women came with popup menus and online help.
#159641 20/09/06 07:56 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
actually having them local accessable and locally named wouldnt be a problem, as long as there was an override flag that allowed access to them from any script or the command line, maybe your idea a -l for setting them and a -L to override and effect them from elsewhere.

There might of course be problems with that in that there are now duplicate names possable.
The solve for that isnt clear to me at the moment.

I however have never found it a problem to create unque names for my times, i start with my 3 initials DJC follow up with a dot then the name of the script or its acroname if its a long name (the.script.name = TSN) followed by a dot followed by the timername so i get DJC.TSN.FlasherControl as an example! The chance someone else is using that is gonna be as close to nil as you can get.

#159642 20/09/06 09:03 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
From now on i will do the exact same. Use your initials followed by a dot followed by the scripts name folowed by the timers name :tongue:


$maybe
#159643 21/09/06 08:32 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
mahahahahahahahaha

#159644 21/09/06 07:55 PM
Joined: Feb 2004
Posts: 201
J
Jae Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
Quote:
I however have never found it a problem to create unque names for my times, i start with my 3 initials DJC follow up with a dot then the name of the script or its acroname if its a long name (the.script.name = TSN) followed by a dot followed by the timername so i get DJC.TSN.FlasherControl as an example! The chance someone else is using that is gonna be as close to nil as you can get.


I am just hoping no-one out there have your initials and name their files the same.. $ticks anyone? :P

#159645 21/09/06 09:59 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Yeah someone is going to have My initals, use the same name script, and call there timer specific names the same thing..... right....

PS: $ticks is useless alone as you might set of several of them with in the same tick count, and then you also cant terminate the timer unless you store the name of it somewhere, so now you have to make unque vars etc

#159646 21/09/06 10:26 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
If DaveC's method doesn't do it for you, you could always use something like $md5($script) for a timer name. Obviously only one file can have any filepath, and the odds of two scripts with different filepaths having the same hash is 1 in 340,282,366,920,938,463,463,374,607,431,768,211,456. Or as I like to call it, "unlikely".


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#159647 22/09/06 12:36 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Another idea that comes to mind is an identifier that returns the name of the timer that was just set. That would allow you to use various methods to make a 'random' timer name and still be able to reference that timer later.

Example:

timer $+ $rand(0000,9999) 1 1 echo -a Timer $lasttimer
set %timername $lasttimer


or

timer 1 1 echo -a Timer $lasttimer
set %timername $lasttimer


I think it would be best if the $lasttimer identifier updated *as* the timer is being activated, so that the identifier can be used within the timer command (as shown above).

-genius_at_work

#159648 22/09/06 12:43 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
$ltimer already exists to provide this (although it's not set until after the /timer command).


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#159649 22/09/06 01:56 AM
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
to use the timer's name inside its command i'd recommend $ctimer. that'll allow you to use things like this safely:

Code:
.timer $+ $nick 1 5 echo -a $!ctimer


for cases where $nick could be anything, including { } or | that would otherwise disrupt the echo :P

i believe a combination of $ctimer and $ltimer solves your issues laugh


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
#159650 22/09/06 07:23 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Watch it someone well ask you what might happen is you had 340,282,366,920,938,463,463,374,607,431,768,211,457 scripts loaded!!!!!!!!!!!!!!!

#159651 30/09/06 04:37 AM
Joined: Feb 2004
Posts: 201
J
Jae Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2004
Posts: 201
What if you have 340,282,366,920,938,463,463,374,607,431,768,211,458 scripts open?

#159652 30/09/06 05:22 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Quite frankly, if you had that many scripts loaded, I'd be surprised if you could do anything on mIRC, as the scripts would probably take most (if not all) of the processing time to run...I mean, did you try to figure out how that number would be written in word format? I did, and ran out of prefixes that I know long before I ran out of sections that would need to be prefixed.

#159653 30/09/06 05:36 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
340,282,366,920,938,463,463,374,607,431,768,211,458

Code:
alias ½ if ($1) return $3 $+ $gettok(OneTwoThreeFourFiveSixS7EightNineTenEl7TwelveThir+Four+Fif+Six+S7+Eigh+Nine+,$1,2) $2
alias numconv {
  var %x,%o,%s,%i $remove($1-,$chr(44),$chr(32))
  if (!$regex(%i,/^(?=\S*\d)(\d{0,66}|0*)(\.\d*)?($| )/)) return $iif(%i != %o,Invalid)
  %i = 0 $+ $regml(1)
  while %i {
    %x = $½($mid(%i,-3,1),Hundred) $iif($mid(%i,-2) < 20,$½($int($ifmatch)),$+($½($calc($mid(%i,-2,1) -10)),ty,$½($mid(%i,-1),,-)))
    %o = %x $iif(%x && %s,$gettok(ThousandM.B.Tr.Quadr.Quint.Sext.Sept.Oct.Non.!Un!Duo!Tre!Quattuor!Quin!Sex!Septen!Octo!Novem!Vigint.,%s,2)) %o
    %i = $left(%i,-3)
    inc %s
  }
  return $iif(%o,$replace(%o,7,even,+t,t,lvet,nt,urt,rt,!,dec.,.,illion,+,teen),Zero)
}


Code:
echo -a $numconv(340,282,366,920,938,463,463,374,607,431,768,211,458)


Three Hundred Forty Undecillion Two Hundred Eighty-Two decillion Three Hundred Sixty-Six Nonillion Nine Hundred Twenty Octillion Nine Hundred Thirty-Eight Septillion Four Hundred Sixty-Three Sextillion Four Hundred Sixty-Three Quintillion Three Hundred Seventy-Four Quadrillion Six Hundred Seven Trillion Four Hundred Thirty-One Billion Seven Hundred Sixty-Eight Million Two Hundred Eleven Thousand Four Hundred Fifty-Eight

:P

-genius_at_work

#159654 30/09/06 09:30 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks. I'd managed to get it to (but not including) Three Hundred Forty Undecillion Two Hundred Eighty-Two decillion Three Hundred Sixty-Six Nonillion


Link Copied to Clipboard