mIRC Home    About    Download    Register    News    Help

Print Thread
#17853 02/04/03 08:56 PM
Joined: Jan 2003
Posts: 11
E
Ecks Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: Jan 2003
Posts: 11
I've got a small script that I've gotten to work except it gives an error at the same time, could someone please spot the error I have in my code? smile

Code:
sessionid {
  $regsub($server, .*\.(.*\..*)$, \1, %test)
  //echo #ase  %test
}


All it does is trucate the server name down to dnsname.com, so if anyone has an alternate method to do that, I'll just use that instead quite happily. The error I get is inside my status screen, it says:

1 Unknown command

Any help is much appreciated.

-Ecks

#17854 02/04/03 10:02 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Since you put $regsub on a lonely line, its output - in this time 1 - is interpreted as a command. and since mIRC doesn't have a command called /1, it's sent to the server, which replies with the expected 'unknown command' message.

The cleaner way to work around this, is:
Code:

!.echo -q $regsub(...)

In this way, the output will not be shown or executed because of the -q switch, that silences /echo output when the command is prefixed by a period.

#17855 03/04/03 12:55 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You can just use $gettok($server,-2-,46)


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

Link Copied to Clipboard