mIRC Home    About    Download    Register    News    Help

Print Thread
#74823 11/03/04 01:57 PM
Joined: Dec 2002
Posts: 8
A
Alltech Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Dec 2002
Posts: 8
on *:input:#:{
if (/* !iswm $1-) { var %i = 1,%str = d det r er | while ($gettok(%str,%i,32)) { while ($istok($1-,$gettok(%str,%i,32),32)) { tokenize 32 $reptok($1-,$gettok(%str,%i,32),$gettok(%str,$calc(%i + 1),32),1,32) } | inc %i 2
} | say $1- | halt } }


If you try to put all that in 1 line, it wont work.. No errors or anything, but it just dont do the reptok..

#74824 11/03/04 02:15 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
why would you want it all on one line?
it looks horrible


New username: hixxy
#74825 11/03/04 02:23 PM
Joined: Dec 2002
Posts: 8
A
Alltech Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Dec 2002
Posts: 8
hehe, thats not the point :P

I was gonna post it in a channel, so i wanted it all in one line, but I noticed that the $reptok didnt work when I did smirk confused

#74826 11/03/04 04:41 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Maybe it is related to this thread...

#74827 11/03/04 05:53 PM
Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
Works just fine here grin
I type in a channel d.. And it was replaced with det..
Also i type r.. And it was replaced with er..
So.. Script works fine.. But it is not very readable..
How about somethink like that ?

Code:
on *:input:#:{
  if (/* !iswm $1-) { 
    var %i = 1
    %str = d det r er 
    while ($gettok(%str,%i,32)) { 
      while ($istok($1-,$gettok(%str,%i,32),32)) {
        tokenize 32 $reptok($1-,$gettok(%str,%i,32),$gettok(%str,$calc(%i + 1),32),1,32) 
      } 
      inc %i 2
    }
    say $1- 
    halt 
  } 
}


mIRC Chm Help 6.16.0.3 Full Anchored!
#74828 11/03/04 05:53 PM
Joined: Dec 2002
Posts: 8
A
Alltech Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Dec 2002
Posts: 8
i did some testing and found out that mIRC skips the first while loop when the 2'nd is done.. i just dont think mIRC likes double while loops in one line... :tongue:

#74829 11/03/04 06:24 PM
Joined: Apr 2003
Posts: 414
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
Err.. Yap.. That not work in 1 line.. But if i copy&paste exact the script in first post(in 3 lines).. It work fine..
Ok.. Here is a more good version to demonstrate the bug.. (zzz sorry for english ;P)

on *:input:#:{ var %i = 1 | var %y = 1 | while (%i <= 100) { echo bheee | while (%y <= 100 ) { echo muuu | inc %y } | inc %i } | echo Cows Win ! }

That script(put all in one line) demonstrate what you say.. It will echo 100 times muuu and only one bheee wink


mIRC Chm Help 6.16.0.3 Full Anchored!
#74830 11/03/04 06:55 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Quote:
I was gonna post it in a channel, so i wanted it all in one line

<offtopic>
i'd like to introduce you to nomorepasting.com smile
</offtopic>


New username: hixxy
#74831 11/03/04 07:13 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
mIRC hasn't handled more that one while loop on a single line for at least several versions.


Link Copied to Clipboard