mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2015
Posts: 15
Buco Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Nov 2015
Posts: 15
Hello.

I'm still looking for someone who is capable of and with the knowledge to write simple little script that I will help in writing or chatting with mIRC.

All I want to script is doing is that we replace specific characters ..

A banal example: I typed "X" writes scripts "Y"

This should apply to mIRC channel and query window only. Not in the "Status" and not to "/" /command

I typed "W" ... Script "V"
I typed "X" ... Script "Y"
I typed "S" ... Script "sch"

I typed "Yes" ... the script write "No" laugh

Last a joke!

...I would like replace any letter from any one or more of them smile


That together we wrote and translated by me and Uncle Google... ...for which they both apologize and thank any kind of professional who wrote me this script.

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
This will make substitutions as per your examples. Add more to the $replacex identifier as desired.

Note that the modified text is sent to the server AFTER the user sees their original text as they typed it. They won't know it's been changed until someone says something.

It's possible to have them see the changed text using an on INPUT event instead, but as far as I know there's no way for a script to find out the state of the 'IRC>Show mode prefix' and 'IRC>Messages>Timestamp events' options. The output wouldn't look right if the default settings have been changed.

Code:
on *:PARSELINE:out:PRIVMSG*:{
  var %dest = $gettok($parseline,2,32)
  var %text = $gettok($parseline,3-,32)

  ; Case-insensitive version
  %text = PRIVMSG %dest $replacex(%text,x,y,w,v,s,sch,yes,no)

  ; Case-sensitive version
  ; %text = PRIVMSG %dest $replacexcs(%text,x,y,X,Y,w,v,W,V,s,sch,yes,no,Yes,No)

  if ($parseutf) %text = $utfencode(%text)
  parseline -otu0 %text
  return
}


Input text: 'Will this work? YEs yes YES Yes'

Case-sensitive sends: 'Vill thisch vork? YEsch no YES No'

Case-insensitive sends: 'vill thisch vork? no no no no'


I hope Uncle Google can translate this back ok smile

Joined: Nov 2015
Posts: 15
Buco Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Nov 2015
Posts: 15
tnx

Uncle Google is okay translated, although it is not something to translate

but the script does not work at all

Joined: Aug 2016
Posts: 36
Ameglian cow
Offline
Ameglian cow
Joined: Aug 2016
Posts: 36
What version of mIRC are you running? The PARSELINE event is a recent addition. You may need to update.

Joined: Nov 2015
Posts: 15
Buco Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Nov 2015
Posts: 15
v6.35

and I do not want to use newer
when it comes to this version, in order, otherwise nothing


Link Copied to Clipboard