|
Joined: Jul 2003
Posts: 742
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2003
Posts: 742 |
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
D3m0nnet.com
|
|
|
|
Joined: Jul 2003
Posts: 742
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2003
Posts: 742 |
how would i do that? i still say mirc needs /away -g
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
$scon(0) give the network connection count $scon(1) returns name of 1st network using a while loop u can then loop thru all netorks and set yourself away. its simple scripting and if u cant do it im sure someone could give u a lesson in its uses, if u want to learn type /help $scon and for while loops /help while loops
D3m0nnet.com
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
Or you could just use /scon -at1 away Pokemon
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
yeah again i forget about that -a being there for all networks ty for the reminder again
D3m0nnet.com
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
alias away { if ($1 != -g) { !away $1- } elseif ($1 == -g) { scon -a !away $2- } else { !away } }
new username: tidy_trax
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
You don't need that last else statement (picky, lol :tongue:)
* cold edits his posts 24/7
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
without the else { } i would need: alias away { if ($1 != -g) { !away $1- | return } elseif ($1 == -g) { scon -a !away $2- | return } !away } because if i just had: alias away { if ($1 != -g) { !away $1- } elseif ($1 == -g) { scon -a !away $2- } !away } that would set me as away then set me as back, or just set me as back .
new username: tidy_trax
|
|
|
|
Joined: Oct 2003
Posts: 273
Fjord artisan
|
Fjord artisan
Joined: Oct 2003
Posts: 273 |
or ...
alias away $iif($1 == -g,scon -at1 !away $2-,!away $1-)
/away -g this is my multi-net away
Last edited by EVH; 30/10/03 04:51 PM.
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
But I didn't say you'd need that last !away either. I mentioned the else statement (meaning, the whole line). alias away {
if ($1 != -g) { !away $1- }
elseif ($1 == -g) { scon -a !away $2- }
} Your last else statement would cover $1 being $null, however the if statement already covers this ($null != -g). That's what I was talking about..
* cold edits his posts 24/7
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
oh: if ($1 != -g) works even if $1 doesn't exist?
new username: tidy_trax
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
Yup.. you might want to optimize some of your code if you didn't know about this one. BTW, take a look at EVH's alternative, that would be a better one in similar cases.
Last edited by cold; 30/10/03 05:03 PM.
* cold edits his posts 24/7
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
i thought: if ($1 != -g) { /this would only work if $1 existed } i never use stuff like that, i just use /return. i don't have a single else { } in my script.
new username: tidy_trax
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
That /return method is not always as efficiently applicable, so I'd rather use /else(if), but it's ok doing the job anyway I think, as long as it's some personal stuff and/or code readability and speed aren't needed for everyone to use. If the latter is the case, however, I'd say give a chance to /else(if) and $iif() :tongue:
PS: my signature doesn't lie..
* cold edits his posts 24/7
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
i use $iif at least 60 times in my picwin project =d
new username: tidy_trax
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
I'd use this: alias away {
if $1 == -g {
var %a = $2-
scon -at1 !away % $+ a
}
else away $1-
} 1) I can't stress this enough... using $1-, $2-, $did(), $input() and generally variables/identifiers of unknown content in /scon -a is not a good idea. /scon adds an extra evaluation level. This can lead to unwanted evaluations which, in the worst case, can even be dangerous. For example, if one typed //away $!me is away, one would expect the away message to be "$me is away" but in fact it will be "cold is away". Now imagine that with something as nasty as $findfile()... I used % $+ a, so that the command executed across networks will be "!away %a" and not "!away <evaluated $2->". 2) The -t1 switch is necessary if you don't want mirc to halt with an error if one of the sessions isn't connected. 3) Minor detail, but you don't need the exclamation mark for the first /away, as it is a fact that an alias cannot call itself directly. So any /away command within the alias will be treated as the default mirc command. This is not the case with /scon though, so the ! is necessary there.
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: Feb 2003
Posts: 810
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 810 |
Thanks, I was aware of the extra evaluation thing. I forgot to warn them because I was talking only about the else statement thing, not really looking at anything else (i.e. the -t1 switch, which was already mentioned above). Good for everyone to read this though.. Personally, I wouldn't use a -g switch anyway
* cold edits his posts 24/7
|
|
|
|
|