mIRC Home    About    Download    Register    News    Help

Print Thread
#92149 29/07/04 06:18 PM
Joined: Apr 2004
Posts: 73
Z
Babel fish
OP Offline
Babel fish
Z
Joined: Apr 2004
Posts: 73
Hey everyone,

I tried using the following code:
Code:
alias ttst {
  var %y 0 
  inc -c %y 1
  :s
  if (%y < 9) goto s
  echo -a done!
}
  

It SHOULD delay the script (see /return suggestion), but it doesnt. Possibly a bug, or a feature just not implemented. Either way, I'd like to see it work. :^)

-Zelda4ever
aka "The Big 'Z'"


/tokenize 32 $gettok($1-,1-,32)
Joined: Feb 2004
Posts: 206
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
The problem is in your code to start off with, you need to move the label (s) to before the increment. The code as you have it makes %y = 1, then checks to see if it >9 and then end!

code:
--------------------------------------------------------------------------------
alias ttst {
var %y 0
:s
inc -c %y 1
if (%y < 9) goto s
echo -a done!
}


However, this pause may also delay any other activity in the background. If you search the boards you will see some code that I posted that gives a delay of "n" seconds, which is similar in concept to what you have posted. There are some additional technical comments from others as to why that was or was not a good idea!

Cheers,
DK

(Please excuse typo's as English is my first language!)


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
Did you even bother to look what the -c switch does.

The -c switch increases %var once per second.

Joined: Apr 2004
Posts: 73
Z
Babel fish
OP Offline
Babel fish
Z
Joined: Apr 2004
Posts: 73
Hey,

Of course I checked! It was an attempt at making a delay (if you clicked the link you shoulda known wink ) It should just keep looping until the inc -c %y goes to 9. Lets just say it looks good on paper, but not processed.

-Zelda4ever
ala "The Big 'Z'"


/tokenize 32 $gettok($1-,1-,32)
Joined: Feb 2004
Posts: 206
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Guilty as charged! There goes that old programmers logic again!

(/me thwaps himself with a used trout reading a 60lb Unix manual)

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!

Link Copied to Clipboard