mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 44
C
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Aug 2003
Posts: 44
try this: //echo $uptime
...and mIRC will tell you this:
* /echo: insufficient parameters.

I think mIRC should be able to echo this number....especially because it's mostly not a valid color-value.
Of course I could use -a or -s everytime.
But it would be more handy.

P.S.: I'm using this 'workaround' atm:
Quote:
echo {
if (!$2) && ($1 isnum) { echo -a $1- | halt }
!echo $1-
}

Last edited by ChosenOne; 07/03/04 12:25 AM.
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
I agree. If the only parameter is a number, mIRC should be smart enough to understand we want to display it.

Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
/halt would halt the whole process.. you should use /return, or better, just use an /else statement instead of using any of the two.

Edit:
The 'isnum' operator shouldn't be used in this way, it'd validate negative and decimal numbers too. Also, (!$2) could validate $2 as 0 or $false too.
Code:
alias echo {
  if ($1- isnum 0-) && (. !isin $1) echo -a $1
  else echo $1-
}

Last edited by cold; 07/03/04 01:05 AM.

* cold edits his posts 24/7
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Or just: if $0 == 1 { echo -a $1 } | else echo $1-

laugh

Joined: Feb 2003
Posts: 307
T
Fjord artisan
Offline
Fjord artisan
T
Joined: Feb 2003
Posts: 307
i also agree

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Also, you might want to provide support for the "." prefix:
Code:
if $0 == 1 { $iif($show,echo,.echo) -a $1 } | else $iif($show,echo,.echo) $1-




/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
No need to provide that, it works internally.


* cold edits his posts 24/7
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
True, I just did that way because personally I wouldn't like it to support "echo -a" alone and similar stuff.


* cold edits his posts 24/7
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
What do you mean by "works internally" ?


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
it doesn't work internally unless you use the original echo alias.

Code:
alias echo { echo $1- }

.echo -q hello still makes it echo hello


New username: hixxy
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
mIRC does this checking itself. If $show is $true in an alias, the commands called from it will act like the '.' prefix was used for them too.
If you try using that /echo alias without the $show checking, you'll see that /.echo -q will act accordingly.


* cold edits his posts 24/7
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Quote:
it doesn't work internally unless you use the original echo alias.
Code:
alias echo { echo $1- }

.echo -q hello still makes it echo hello

It *doesn't* make it echo. Not here, in a clean copy, at least. And I've always used it like that with no problems at all.
Code:
alias echo { echo $1- }
[color:green]; /.echo -q hello (from the editbox) - nothing is echoed[/color]

alias echo { echo $1- }
alias test { .echo -q hello }
[color:green]; /test - nothing is echoed[/color]

alias echo { echo $1- }
alias test { echo -q hello }
[color:brown]; /test - 'hello' is echoed[/color]
[color:green]; /.test - nothing is echoed[/color]
It works the opposite of what you said.
Code:
alias show1 { echo -ag show1 $show | show2 }
alias show2 { echo -ag show2 $show | show3 }
alias show3 { echo -ag show3 $show }
[color:brown]/* Results for /.show1:
show1 $false
[color:green]show2 $false
show3 $false[/color]
You could even try including the -q switch in some echo command;
it won't be echoed anymore.
*/[/color]


* cold edits his posts 24/7
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
i tried it again and it didn't echo so i must of done something wrong last time blush


New username: hixxy
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Aha, I didn't know that, thanks for clarifying smile


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard