mIRC Home    About    Download    Register    News    Help

Print Thread
Unkown Command error #266276 03/11/19 06:16 AM
Joined: Nov 2019
Posts: 3
A
acidblue Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Nov 2019
Posts: 3
I copied and past this form:
https://en.wikichip.org/wiki/mirc/identifiers/$chan

So it should work, but mIRC gives "Unknown Command"

Script:
Code
alias getDetails {
  if ($active ischan) {
    var %c = $active
    window @getDetails 350 350 650 200
    clear @getDetails
    echo @getDetails Channel: %c
    echo @getDetails $crlf $crlf
    echo @getDetails Topic: $chan(%c).topic
    echo @getDetails $crlf $crlf
    echo @getDetails Modes: $chan(%c).mode
    echo @getDetails $crlf $crlf
    echo @getDetails Key: $iif($chan(%c).key,$v1,No key set)
  }
}


Even loaded example scripts but gives same error.

Please help.

Re: Unkown Command error [Re: acidblue] #266277 03/11/19 12:56 PM
Joined: Jul 2006
Posts: 3,584
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,584
mirc is executing a command which starts with a tab it seems. Either you miscopied the code or there is an issue with that exemple on wikichip, i'm on mobile...
Replaces all the blank spaces but newlines before commands and see if that works.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Unkown Command error [Re: acidblue] #266278 03/11/19 02:25 PM
Joined: Dec 2002
Posts: 4,584
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,584
Did you paste it into the Aliases section or the Remote section in the Scripts dialog?

This type of script needs to be pasted into the Remote section.

Re: Unkown Command error [Re: Khaled] #266279 03/11/19 03:45 PM
Joined: Nov 2019
Posts: 3
A
acidblue Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Nov 2019
Posts: 3
Thanks.
I posted in aliases section, after moving to remote section it works.

So all custom commands should be in remote section??

Re: Unkown Command error [Re: acidblue] #266281 03/11/19 05:50 PM
Joined: Dec 2015
Posts: 123
Dazuz Offline
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 123
Not necessarily, but scripts starting with "alias" belong in remote.

You can make your script work in alias by taking "alias" off of it and adding a slash, like this:
Code
/getDetails {
  if ($active ischan) {
    var %c = $active
    window @getDetails 350 350 650 200
    clear @getDetails
    echo @getDetails Channel: %c
    echo @getDetails $crlf $crlf
    echo @getDetails Topic: $chan(%c).topic
    echo @getDetails $crlf $crlf
    echo @getDetails Modes: $chan(%c).mode
    echo @getDetails $crlf $crlf
    echo @getDetails Key: $iif($chan(%c).key,$v1,No key set)
  }
}

Re: Unkown Command error [Re: Dazuz] #266283 04/11/19 03:34 AM
Joined: Nov 2019
Posts: 3
A
acidblue Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Nov 2019
Posts: 3
Thanks Daz.