mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2015
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2015
Posts: 14
I found a 2001 "Acronym Replacement" script by Martyr2 which I'd like to try in mIRC.

The script in question is this:

on *:INPUT:*:{
if (/* !iswm $1) {
var %replace.acro = $1-
:restart
if ($istok(%replace.acro,lol,32)) { %replace.acro = $reptok(%replace.acro,lol,laugh out loud,32) | goto restart }
if ($istok(%replace.acro,brb,32)) { %replace.acro = $reptok(%replace.acro,brb,be right back,32) | goto restart }
if ($istok(%replace.acro,roflmao,32)) { %replace.acro = $reptok(%replace.acro,roflmao,rolling on the floor laughing my ass off,32) | goto restart }
echo -a %replace.acro | halt
}
}

It all works fine except my nick name does not show in the message when posted on main.

So now I get this for lol: Laugh Out Loud
and what I want is this: <MickMick> Laugh Out Loud

Could somebody could please advise what to change in the script to show my nick.

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
Change this line

echo -a %replace.acro | halt

msg # %replace.acro | halt

Joined: Feb 2015
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2015
Posts: 14
That fixed it.

Thanks very much, Sakana.

Joined: Feb 2015
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2015
Posts: 14
Further assistance please.

Whilst the above script replaces acronyms correctly, it somehow prevents me from initiating, or receiving requests for Private Chat.
When I attempt a private conversation, I get the "insufficient parameters" message, referring to the last line of the script.
My chat request is not received by the other party either, nor their chat request by me.

If I totally remove the script, I can private chat without any issues.

Is there something in this script that needs to be changed or added to allow private chat.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
It's because the last line refers to "MESSAGE CHANNEL: .."
Since there is no channel you're missing a parameter.
Code:
on *:INPUT:*:{ 
if (/* !iswm $1) {
var %replace.acro = $1-
var %target $iif($chan,$chan,$nick) 
:restart
if ($istok(%replace.acro,lol,32)) { %replace.acro = $reptok(%replace.acro,lol,laugh out loud,32) | goto restart } 
if ($istok(%replace.acro,brb,32)) { %replace.acro = $reptok(%replace.acro,brb,be right back,32) | goto restart }
if ($istok(%replace.acro,roflmao,32)) { %replace.acro = $reptok(%replace.acro,roflmao,rolling on the floor laughing my ass off,32) | goto restart }
msg %target %replace.acro | halt
}
}

What I did there is set a variable called %target to become either $chan if there is a channel parameter. Or $nick if there is no channel parameter.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Feb 2015
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2015
Posts: 14
Thanks Nillen,
I have tested your suggestion and now I can receive and see PM's from others, but they can't receive PM's from me, either directly or in reply to theirs.

In my message box, rather than getting:
<MickMick> my message
I'm now getting:
- > *MickMick* my message

There seems to be a conflict somewhere.

Joined: Feb 2015
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2015
Posts: 14
I've solved the problem by replacing this script with another.

Obviously there is a fault in the above script.

Thanks guys.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
That looks like you're messaging yourself?
In an open query window, $nick is set. msg $nick should send a message to that user without fail. Are you trying to send messages to yourself?

I tried the script, even while sending messages to myself it worked as intended.

Does the new script you got by any chance use "msg $active .." ?


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Feb 2015
Posts: 14
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Feb 2015
Posts: 14
This is the script I am now using:

on *:INPUT:#:{
if ((/* iswm $1) || ($ctrlenter)) return
var %1- = $1-
while ($istok(%1-, lol, 32)) %1- = $reptok(%1-, lol, 5L12aughing 5O12ut 5L12oud, 1, 32)
say %1-
halt

I'd like to give credit to whoever wrote it but its creator is unknown to me.


Link Copied to Clipboard