mIRC Home    About    Download    Register    News    Help

Print Thread
#195182 19/02/08 03:49 PM
Joined: Mar 2006
Posts: 395
T
The_JD Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
I wrote this as a little test.
It lists all hash tables and their child items, and the child item's contents.

Code:
alias co.listhash {
  co.while $hget(0) .timer -m 1 1 echo -a  $ $+ + $ $+ hget(&i) $ $+ +  $chr(124) co.while $ $+ hget(&i,0).item echo -a  $ $ $ $+ + + hget(&i,& $ $+ + i).item = $ $ $ $+ + + hget(&i,& $ $+ + i).data
}

alias -l co.while {
  var %i 1
  while (%i <= $1) {
    $eval($replace($2-,&i,%i),2)
    inc %i
  }
}


Now its got me wondering, Because of the timer, would it stop a while loop from freezing mIRC? I know the parent while loop wont, but would the child while?

If anyone can understand this code... Let me know :P (Kinda complex hey?). laugh


[02:16] * Titanic has quit IRC (Excess Flood)
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
No this wouldn't prevent a while loop locking mIRC. The timer would trigger, sending a message to mIRC telling it to execute the timer's code, but mIRC wouldn't process that message until the while loop had ended and the remainder of the script was executed.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2002
Posts: 2,032
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,032

Is it working correctly at all? I would think not since the timers are calling a local alias.

Joined: Mar 2006
Posts: 395
T
The_JD Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
You have a very good point, But it works perfectly... Write some hashes and try it out :S

Im using mIRC 6.31 - This may be a bug. Good noticing though.


[02:16] * Titanic has quit IRC (Excess Flood)
Joined: Mar 2006
Posts: 395
T
The_JD Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
So who thinks its a bug? Riamus?


[02:16] * Titanic has quit IRC (Excess Flood)
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
It's not a bug, timers initiated in the same script as the local alias have access to it (in fact timers have access to the entire script context, eg they recognize $script).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 2,032
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,032

This I did not know.

Joined: Mar 2006
Posts: 395
T
The_JD Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
Strange, I know for sure on older versions it was not possible to use a timer with a local alias.

Perhaps it was a "fix". Speaking of bugs... WTH is $evalnext and its format, I couldnt find anything in the help file... Im guessing mIRC uses it internally in a while loop in $eval


[02:16] * Titanic has quit IRC (Excess Flood)
Joined: Jul 2006
Posts: 4,172
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,172
$evalnext() is the same as $eval(,N+1).

//echo -a $eval($!!!me,3) $evalnext($!!!me,3)

smile

Last edited by Wims; 20/02/08 05:40 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Mar 2006
Posts: 395
T
The_JD Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
Thanks mate, Seems undocumented.


[02:16] * Titanic has quit IRC (Excess Flood)

Link Copied to Clipboard