mIRC Home    About    Download    Register    News    Help

Print Thread
timer/inc -c and goto/while #92149 29/07/04 06:18 PM
Joined: Apr 2004
Posts: 73
Z
Zelda4ever32 Offline OP
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)
Re: timer/inc -c and goto/while #92150 30/07/04 05:41 AM
Joined: Feb 2004
Posts: 206
D
Darwin_Koala Offline
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!
Re: timer/inc -c and goto/while #92151 30/07/04 09:20 AM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
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.

Re: timer/inc -c and goto/while #92152 31/07/04 12:22 AM
Joined: Apr 2004
Posts: 73
Z
Zelda4ever32 Offline OP
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)
Re: timer/inc -c and goto/while #92153 31/07/04 11:20 PM
Joined: Feb 2004
Posts: 206
D
Darwin_Koala Offline
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!