mIRC Home    About    Download    Register    News    Help

Print Thread
#266276 03/11/19 06:16 AM
Joined: Nov 2019
Posts: 3
A
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.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Joined: Nov 2019
Posts: 3
A
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??

Joined: Dec 2015
Posts: 148
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 148
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)
  }
}

Joined: Nov 2019
Posts: 3
A
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Nov 2019
Posts: 3
Thanks Daz.


Link Copied to Clipboard