mIRC Home    About    Download    Register    News    Help

Print Thread
Changing output of text in game #267542 04/08/20 08:18 AM
Joined: Aug 2020
Posts: 1
W
weasleish Offline OP
Mostly harmless
OP Offline
Mostly harmless
W
Joined: Aug 2020
Posts: 1
Hey, i use mIRC to play an old text RPG and use the scripts to, well, script some of the stuff. I want to try and clean up some of my screen while playing by shortening descriptions of moves/items in game. Is there a way so that when it 'sees' a certain phrase, it will replace it with my personal one?

For example, if in game you saw : A man in white shoots upward, dodging rapidly, darting about, before precisely, hitting you.
Can i make it so when that pops up, instead i get : A man in white upshoots, hitting you.

Where the underline bit is the 'move' or 'item' in question, and i just want to shorten it so it doesn't spam me constantly. Would ease up on the reading when some of these moves have 4-5 lines worth of text...

Re: Changing output of text in game [Re: weasleish] #267543 04/08/20 09:55 AM
Joined: Jan 2004
Posts: 1,385
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,385
can you clarify that this game's messages are normal channel messages sent by other nicks in a channel? If so, you can use the ON TEXT event to intercept messages containing a string, either literal or wildcard or regex, then halt the original message, then replace it with an echo of your design. You could do something like
Code
on ^*:TEXT:pattern goes here:#channelname:{
var %old_pattern text here
var %new_pattern text here
if (%old_pattern isin $1-) {
echo $chan $+(<,$nick,>) $replace($1-,%old_pattern,%new_pattern) | haltdef
  }
}


It's much simpler to use variables like this when the text contains commas, otherwise you need to use $chr(44)'s instead of literal commas.

If your situation is different, then you need to better explain what your RPG game entails.