mIRC Home    About    Download    Register    News    Help

Topic Options
#227613 - 16/11/10 03:33 AM scon bug
Talon Offline
Vogon poet

Registered: 09/12/02
Posts: 197
Loc: Ohio, USA
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!


Edited by Talon (16/11/10 03:37 AM)

Top
#227614 - 16/11/10 03:54 AM Re: scon bug [Re: Talon]
Collective Offline
Planetary brain

Registered: 10/12/02
Posts: 3138
Loc: London, UK
"%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

Top
#227615 - 16/11/10 04:28 AM Re: scon bug [Re: Collective]
Talon Offline
Vogon poet

Registered: 09/12/02
Posts: 197
Loc: Ohio, USA
ah so its a var bug, either way, its still a bug to me.

Top
#227618 - 16/11/10 05:55 AM Re: scon bug [Re: Talon]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
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"

Top
#227623 - 16/11/10 08:22 AM Re: scon bug [Re: argv0]
Knoeki Offline
Vogon poet

Registered: 28/01/09
Posts: 116
Loc: Amsterdam, The Netherlands
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)

Top
#227634 - 16/11/10 08:03 PM Re: scon bug [Re: argv0]
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
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

Top
#227646 - 17/11/10 07:55 AM Re: scon bug [Re: Collective]
Sephiroth_ Offline
Fjord artisan

Registered: 26/10/03
Posts: 213
Loc: Germany, Arnstadt
nvm


Edited by Sephiroth_ (17/11/10 07:56 AM)
_________________________
one step closer to world domination

Top
#227648 - 17/11/10 09:10 AM Re: scon bug [Re: qwerty]
jaytea Offline
Fjord artisan

Registered: 23/02/06
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

Top