mIRC Home    About    Download    Register    News    Help

Print Thread
scon bug #227613 16/11/10 03:33 AM
Joined: Dec 2002
Posts: 198
T
Talon Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 198
mIRC 7.15 clean...


take the example as an alias
alias wins { var %x = $scon(0) , %wins | while (%x) { scon %x | %wins = $+(%wins,$regsubex($str(.,$window(*,0)),/(.)/g,$+(%x,:,$window(*,\n),.))) | dec %x } | scon -r echo -a %wins }

do /wins

works great... now try it in an editbox

//var %x = $scon(0) , %wins | while (%x) { scon %x | %wins = $+(%wins,$regsubex($str(.,$window(*,0)),/(.)/g,$+(%x,:,$window(*,\n),.))) | dec %x } | scon -r echo -a %wins

nothing!

Last edited by Talon; 16/11/10 03:37 AM.
Re: scon bug [Re: Talon] #227614 16/11/10 03:54 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
"%var = value" syntax does not work from the editbox, use this instead:

//var %x = $scon(0) , %wins | while (%x) { scon %x | var %wins = $+(%wins,$regsubex($str(.,$window(*,0)),/(.)/g,$+(%x,:,$window(*,\n),.))) | dec %x } | scon -r echo -a %wins

Re: scon bug [Re: Collective] #227615 16/11/10 04:28 AM
Joined: Dec 2002
Posts: 198
T
Talon Offline OP
Vogon poet
OP Offline
Vogon poet
T
Joined: Dec 2002
Posts: 198
ah so its a var bug, either way, its still a bug to me.

Re: scon bug [Re: Talon] #227618 16/11/10 05:55 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
It's not a bug, %x = value doesn't work from the editbox, it's a limitation of the parser.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: scon bug [Re: argv0] #227623 16/11/10 08:22 AM
Joined: Jan 2009
Posts: 116
Knoeki Offline
Vogon poet
Offline
Vogon poet
Joined: Jan 2009
Posts: 116
I thought not prefixing a variable definition with var/set in general had some quirks and/or is not reccomended?


http://zowb.net

/server -m irc.p2p-network.net -j #zomgwtfbbq
(ssl on port 6697 and 7000)
Re: scon bug [Re: argv0] #227634 16/11/10 08:03 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Probably a side-effect of the fact that (by design, for security purposes) in the editbox you can't use an identifier/variable as a command.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: scon bug [Re: Collective] #227646 17/11/10 07:55 AM
Joined: Oct 2003
Posts: 214
S
Sephiroth_ Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
nvm

Last edited by Sephiroth_; 17/11/10 07:56 AM.

one step closer to world domination
Re: scon bug [Re: qwerty] #227648 17/11/10 09:10 AM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
sure seems like it!

apparently it's checking for nothing more than a literal '%' or '$' at the front of the command, so we can sneakily bypass it with:

Code:
//[ %var = value ]


or even

Code:
//#$(%var = value)


for identifiers


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde