mIRC Home    About    Download    Register    News    Help

Print Thread
#30494 17/06/03 11:06 PM
Joined: Mar 2003
Posts: 437
M
MTech Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
i have never done a loop but im trying somthing
why isnt this working?
it is supposed to write the numbers 1 - 5000 in a text file and then stop
i get * /goto: 'go' not found (line 16, script.mrc)
alias num {
#go
if (%num >= 5000) {
goto stop
}
else {
inc %num
write num.txt %num
goto go
}
#stop
}
never mind i mis typed i need to use ':' not '#'

heh that took 5 seconds and froze mirc to do...

Last edited by MTech; 17/06/03 11:08 PM.
#30495 17/06/03 11:43 PM
Joined: Jun 2003
Posts: 2
C
Bowl of petunias
Offline
Bowl of petunias
C
Joined: Jun 2003
Posts: 2
use a : instead of # in your target statments so you would ahve :stop and :go to start your lines where the loop goes to

#30496 17/06/03 11:49 PM
Joined: May 2003
Posts: 730
S
Hoopy frood
Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
Quote:
never mind i mis typed i need to use ':' not '#'

#30497 18/06/03 05:59 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
if mirc freezes, and you don't want to have to crl+alt+Del it, use ctrl+PAUSE/BREAK button twixe, and mirc will halt laugh Will even give u the line where the loop occured.


-KingTomato
#30498 18/06/03 06:01 AM
Joined: Mar 2003
Posts: 437
M
MTech Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
so i dont fall into an infinite void?
smile sounds nice hehehe

#30499 18/06/03 06:04 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
alias myloop {
var %a = 1
while (%a < 2) {
.echo -q loop
}
}

Run that, wait a few seconds, and press ctrl+pause/break (above page up) >:D


-KingTomato
#30500 18/06/03 06:42 AM
Joined: Mar 2003
Posts: 437
M
MTech Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
it broke here:
while (%a < 2) {

#30501 18/06/03 06:44 AM
Joined: Mar 2003
Posts: 437
M
MTech Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
here are the onlt places it breaks
while (%a < 2) {
.echo -q loop

#30502 18/06/03 06:45 AM
Joined: Mar 2003
Posts: 437
M
MTech Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
u try this:
alias num { unset %num | :go | if (%num >= 50000) { goto stop } | else { inc %num | msg $chan %num | goto go } | :stop halt }


just a lil sumthin i whipped up...

Last edited by MTech; 18/06/03 06:46 AM.
#30503 18/06/03 07:12 AM
Joined: Mar 2003
Posts: 437
M
MTech Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
heh try that code i said above and use 50,000,000 not 50,000

my mirc got to 174095
before it froze and stopped responding

#30504 18/06/03 09:37 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
the point of my code was to create an infinate loop, to give the opportunity to use ctr+break.


-KingTomato
#30505 18/06/03 05:16 PM
Joined: Mar 2003
Posts: 437
M
MTech Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
this give u an uninfinite loop but also has the chance to break, i did


Link Copied to Clipboard