Hello mIRC help forums.

I've used IRC, particularly mIRC a fair amount over the years, but never had occasion to write some scripts before. Our channel occasionally uses spoilers and we are used to using rot13 elsewhere so I jumped in and started tinkering to get a remote function to encode and decode our spoilers safely.

This is what I have at the moment.

Code:
ctcp 1:encode*:/say #MarkSpoils $nick $iif($isid,return,msg #) $regsubex($1-,/([a-z])/gi,$chr($calc($asc(\1) $iif($asc($upper(\1)) < 78,+,-) 13)))
ctcp 1:decode*:/notice $nick $iif($isid,return,msg #) $regsubex($1-,/([a-z])/gi,$chr($calc($asc(\1) $iif($asc($upper(\1)) < 78,+,-) 13)))


It functions, but could be a bit nicer. Some of the things I'd like to help with:
  • Currently each message from rot13 starts with "msg rapbqr" or "msg qrpbqr". Is there a way to prevent this?
  • The encode option needs to go into the main chat and list who said it. My current solution works but I'd guess could be better.
  • The decode option ideally needs to go into the main chat but only seen by whoever requested it. Again, it does this right now but is there a better way?
  • The commands to encode and decode need to be kept simple, if possible. "/ctcp rot13 (encode/decode)" isn't bad, as most clients can have an Alias in there to shorten it, but if it can be cut down all the better.
  • Something really cool would be the ability to only encode/decode certain parts of your message, but this is wish-list stuff now.


I'll appreciate any help you can give me. I'm learning as I go for this, so my apologies if I've made any faux pas. The list is in descending order of what is most needed.

Many thanks, FPG.

Edit: A few things I forgot, might be helpful.
  • mIRC version: v7.42
  • We will probably want to add more varied functions to the remote script in the future, but for now this is all we need.

Last edited by FPG; 24/07/15 01:54 AM.