mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2014
Posts: 2
Z
zithen Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Z
Joined: Jul 2014
Posts: 2
I am just playing around with mirc scripts and ran into something and not sure what I did wrong to cause this.

just doing a simple $len on $1- > 10 to send a message

Code:
on *:TEXT:*:#:{
  IF ($len($1-) > 10) { 
    msg $chan testing
  }
}


with this is get a error in the status window saying #channelName Unknown command

but if i change the msg line to

Code:
msg msg $chan testing


it work fine.

Just not sure what it wrong to need the double msg commands to output the text.

Joined: Aug 2013
Posts: 81
I
Babel fish
Offline
Babel fish
I
Joined: Aug 2013
Posts: 81
That script is fine. Assuming you copied and pasted it exactly as it is in your scripts editor, do you perhaps have a custom alias for /msg?

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
As lire said, this is typical. You must have a custom /msg alias, that custom alias is failing somehow, trying to execute the first parameter passed as the command, which is why giving msg as the first parameter works.
You can find the location of the file containing the alias using //echo -a $isalias(msg).fname in mIRC


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2014
Posts: 2
Z
zithen Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Z
Joined: Jul 2014
Posts: 2
I copied the echo command and it outputs

Quote:
/echo: insufficient parameters


I had rewrote the code a few times still end up with the same issue.

I installed mirc again on another drive and did the portable option and wrote the same code on there and it seems to be working fine. I am not sure what is with the other install, but it wouldn't be a big issue to move over if it keeps working since the only thing I have changed was the font size.

Still very interesting, but hopefully it was just something with the one install.

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Weird, if you didn't delete the other installation of mIRC, can you try to replace your on text event with:
Code:
on *:TEXT:*:#:{
  IF ($len($1-) > 10) { 
    !msg $chan testing
  }
}
Where the ! in front forces mIRC to call the built-in /msg command. If that works, you do have a custom /msg alias somehow, it's possible you have a local custom /msg alias, which I think $isalias wouldn't have found, but that's unlikely.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard