mIRC Home    About    Download    Register    News    Help

Print Thread
hmmmm... while #75640 18/03/04 05:53 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
$mods...... makes mirc freeze... i know its the while but i just dont know why it doesnt work
Code:
alias mods {
  set %i 1
  while ($read(onlinemods1.txt,%i)) {
    if (@ iswm $read(onlinemods1.txt,%i)) {
      if (%@s == $null) {
        set %@s  $read(onlinemods1.txt,%i) $+ ,
        inc %i
      }
      elseif (%@s != $null) {
        set %@s %@s $read(onlinemods1.txt,%i) $+ ,
        inc %i
      }
    }
    if ($chr(33) iswm $read(onlinemods1.txt.%i)) {
      if (%!s == $null) {
        set %!s  $read(onlinemods1.txt,%i) $+ ,
        inc %i
      }
      elseif (%!s != $null) {
        set %!s %!s $read(onlinemods1.txt,%i) $+ ,
        inc %i
      }
    }
    if ($chr(37) iswm $read(onlinemods1.txt,%i)) {
      if (%hs == $null) {
        set %hs  $read(onlinemods1.txt,%i) $+ ,
        inc %i
      }
      elseif (%hs != $null) {
        set %hs %hs $read(onlinemods1.txt,%i) $+ ,
        inc %i
      }
    }
    if ($chr(43) iswm $read(onlinemods1.txt,%i)) {
      if (%+s == $null) {
        set %+s  $read(onlinemods1.txt,%i) $+ ,
        inc %i
      }
      elseif (%+s != $null) {
        set %+s %+s $read(onlinemods1.txt,%i) $+ ,
        inc %i
      }
    }
  }
  return %!s %@s %hs %+s
  unset %!s 
  unset %@s 
  unset %hs 
  unset %+s
}


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
Re: hmmmm... while #75641 18/03/04 05:54 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
btw the onlinemods.txt is:
!name
@name
%name
+name
like that


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
Re: hmmmm... while #75642 18/03/04 08:17 AM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
It's not recommended to do $read loops because they involve intensive (and relatively slow) hard disk access. This script dumps the whole file to a hidden @window in one instance and enables you to use $fline (a bonus by itself):
  • alias mods {
    window -h @@
    loadbuf @@ onlinemods.txt
    var %result = $fline(@@,!*,0) $fline(@@,@*,0) $fline(@@,% $+ *,0) $fline(@@,+*,0)
    close -@ @@
    return %result
    }

Re: hmmmm... while #75643 18/03/04 09:07 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
shocked how simple!


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
Re: hmmmm... while #75644 18/03/04 09:46 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
btw, i think your problem was, if all if () statements were $false, then %i wouldn't be inc'd wink


New username: hixxy