mIRC Homepage
Posted By: Aeron !Inc bug - 08/07/04 08:17 PM
I get this error:
* /inc: invalid parameters

To reproduce:
//var %a = 1 | while (%a != 5) !inc %a

How ever this works:
//var %a = 1 | while (%a != 5) inc %a
//var %a = 1 | while (%a != 5) { | !inc %a }

Win XP version 6.16 and 6.15 failed.
Posted By: mIRC_Scripter Re: !Inc bug - 09/07/04 07:00 AM
//var %a = 1 | while (%a != 5) !inc %a

your joking right?

this almost seems like a recipe to hang/crash the client...
luckily mIRC just says WTF??????
lets see %a =1 while it does not equal 5 then
dont increment %a ???
i dont know what !command should do...
//!echo -s $time
is same as //echo -s $time

hmmm seems like the waste of a keystroke..
if the while loop does not resolve that may not be good

whats wrong with???
==> //var %a = 1 | while (%a != 5) { inc %a | echo -a %a }
or //var %a = 1 | while (%a < 5) { inc %a | echo -a %a }

this works for me
//var %a = 1 | while (%a != 5) { echo -a = %a | !inc %a | echo -a - %a }

i can find no documentation for !command

i can understand ==> //timer 1 8 echo -a Time: $!time
Posted By: Online Re: !Inc bug - 09/07/04 07:37 AM
Yep, looks like a bug. It also happens if you use if instead of while.

You get an error because mIRC evaluates %a before it's passed to /inc, which results in an invalid /inc 1.

This works:

//var %a = 1 | while (%a != 5) !inc % [color:blue]$+ a[/color]
Posted By: Online Re: !Inc bug - 09/07/04 07:51 AM
From the help file, under Command Prefixes:
  • If you want to perform a command without it being processed as an alias, you can prefix it with a ! exclamation mark.
In this example you can see how !remote bypasses the (fake) /remote alias:

//alias remote echo -eca info * Remote is off | remote | !remote | alias remote
Posted By: mIRC_Scripter Re: !Inc bug - 09/07/04 08:16 AM
thanks i seen that many times and everytime i read that i wonder why i would want to do that and then forget it

every time i try to image a use for that that would not add
confusion or that would actually solve a problem i come up
empty

in otherwords to make use of !inc you have to make a custom
inc command (alias)?..


hmmmmm maybe i get it
so remote calls the custom alias and !remote calls the standard remote command? or the other way arround?
i guess it saves on trying to make up new command names
when you want to just add features to a command?


i must be missing something about !command prefix
Posted By: mIRC_Scripter Re: !Inc bug - 09/07/04 08:56 AM
ok i see.. this is one of those things where when you finally figure out what it does you need to change a bunch of command names?.. sorta rewrite commands but then still use default command with !command ????

example:

alias part part # this party is getting too rough! im pulling my pants up and going home!

but then to just part channel i could /!part ???
(like NOT my command???)

i think it makes sense now... thanks for pushing me to learn that..

i got a new question maybe a new thread...
why cant i...

on ^1:CLOSE:#:part # bbl.. i had a bigmac for breakfast and it wants to take a swim...

i think of kludging arround it with /debug -i
type thing but that method sorted involves
reading every line going out even if it does work
Posted By: Online Re: !Inc bug - 09/07/04 09:26 AM
Quote:
but then to just part channel i could /!part ???
(like NOT my command???)

Exactly.

If you hang around virus help channels on IRC you'll notice that when the helper tells the infected user to disable their mIRC remote, the suggested command is /[color:red]!remote off[/color] as to avoid fake 'remote' aliases which trick the user into thiking that the remote is disabled, while it's still alive and harmful.
Posted By: KingTomato Re: !Inc bug - 09/07/04 04:33 PM
You usually see it a lot when people get those mIRC debug worms that spread, and you instruct someone to remove them. Some of the "better quality" worms will write thier own unload alias, so when you type /unload -rs worm.mrc it'll just spoof an unload message but do nothing. in this case, you'de use /!unload -rs worm.mrc and it unloads successfully.
Posted By: qwerty Re: !Inc bug - 09/07/04 04:42 PM
It should be also noted that /!commands, when typed in an editbox, prevent any on INPUT events from triggering, so a malicious script that would use on INPUT to trap /commands wouldn't work.
Posted By: Kelder Re: !Inc bug - 09/07/04 04:46 PM
Just tested this because of this thread: using /!remote off doesn't trigger an on INPUT event, so you cannot halt it there either cool
Posted By: Aeron Re: !Inc bug - 09/07/04 05:22 PM
Quote:
Yep, looks like a bug. It also happens if you use if instead of while.

You get an error because mIRC evaluates %a before it's passed to /inc, which results in an invalid /inc 1.

This works:

//var %a = 1 | while (%a != 5) !inc % $+ a


Maybe, But if he does that then
!inc %a
must also fail.
Posted By: mIRC_Scripter Re: !Inc bug - 09/07/04 07:58 PM
good point qwerty

thanks Online and KingTomato
those are excelent examples of
the need for !command even if you dont
want to use it in scripting...

im looking at !command == use default command
(NOT the rewritten alias)

but of course now that i know how to use
it i just HAVE to work it into my script..
...that should keep me up late at night
:tongue:
© mIRC Discussion Forums