Altering text output

Posted by Tamalak on Wed 01 Aug 2001 01:55 AM — 4 posts, 16,272 views.

#0
Hi, this seems like a simple problem but it's really bugging me!
Sometimes the MUD I'm in sends me text in parentheses like:

(Raidon drops a small dagger.)

What I want to do is not only get rid of the parentheses, but move the rest of the text one character to the left so that it reads:

Raidon drops a small dagger.

I'd like to do this -without- making it a world.note, because world.note is a different color and format from normal output text, and since several of my programs depend on that being the case, I'd like to keep it that way. Is this possible?
Australia Forum Administrator #1
You can work around the world.note problem a bit by doing something like the following script. MUSHclient does not currently let you manipulate incoming text *and* preserve its colour, however you can do the following to stop it appearing in the note colour. What the script does is remember the note colour (foreground and background), then set note colour to normal output colour (white on black), display wildcard 1, then put the colours back.

The trigger would be:


Match on: (*)
Enabled: checked
Omit from output: checked
Label: Blahblah
Script: SpecialTrigger


The script is:



sub SpecialTrigger (strTriggerName, strTriggerLine, aryWildcards)
dim orignotefg
dim orignotebg

  ' remember note colours
  orignotefg = world.NoteColourFore
  orignotebg = world.NoteColourBack

  ' change note colour to world output colour
  world.NoteColourFore = world.NormalColour (8)
  world.NoteColourBack = world.NormalColour (1)

  ' display wildcard 1
  world.note aryWildcards (1)

  ' put colours back
  world.NoteColourFore = orignotefg 
  world.NoteColourBack = orignotebg 

end sub
Amended on Wed 01 Aug 2001 04:53 AM by Nick Gammon
#2
Hmm, it didn't work, I got the message that

"Object doesn't support this property or method:
'world.NoteColourFore'"

Do I need to store the colour in another kind of variable (other than a dim)? Do I need to upgrade my MUSHclient? I played around with it and still can't get it to work...
Australia Forum Administrator #3
Make sure you have the latest version of MUSHclient (3.15) - the world property "NoteColourFore" is a recent one.

Also, make sure you copy and paste the script exactly, colour is spelt the Australian way, not "color".

In VBscript there is only one variable type (dim) - which is a variant that stores all sorts of data types.

I tested that script before posting it so it should work.