Communications Miniwindow

Posted by Aralia Faal on Sat 30 Jun 2012 07:27 PM — 15 posts, 49,493 views.

#0
I've got a plugin to move all OOC conversation to a miniwindow. It does this but on ocasion the prompt does not force a new line sending the following to the miniwindow:

[Health] 64077/67369 [Movement] 2000/2000 [Money] 1,000,420 > (=OOC=) Gilbert: Yea thats what I said.

I was wondering if there was a way to make it so it removes the prompt bits before sending it to the miniwindow.

I use the plugin from http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=10728

with the following edited:

From:


<triggers>
    <trigger
    enabled="y"
    match="You say '*'"
    script="chats"
    omit_from_output="y"
    sequence="100"
    ></trigger>

    <trigger
    enabled="y"
    match="You tell * '*'"
    script="chats"
    omit_from_output="y"
    sequence="100"
    ></trigger>

    <trigger
    enabled="y"
    match="You OOC '*'"
    script="chats"
    omit_from_output="y"
    sequence="100"
    ></trigger>
</triggers>


to:


<triggers>
    <trigger
    enabled="y"
    match="(=OOC=) *: *"
    script="chats"
    omit_from_output="y"
    sequence="100"
    ></trigger>

    <trigger
    enabled="y"
    match="(=IMM:OOC=) *: *"
    script="chats"
    omit_from_output="y"
    sequence="100"
    ></trigger>

    <trigger
    enabled="y"
    match="(NEWBIE) *: *"
    script="chats"
    omit_from_output="y"
    sequence="100"
    ></trigger>
</triggers>
Amended on Sat 30 Jun 2012 07:32 PM by Aralia Faal
Australia Forum Administrator #1
It can be done. Probably I would edit the plugin, look for the "chats" function, and before it puts the styles into rawlines, check that the style starts with "(" and if not, remove it.
#2
Nick Gammon said:

It can be done. Probably I would edit the plugin, look for the "chats" function


I was following you up to this point.

Quote:
and before it puts the styles into rawlines, check that the style starts with "(" and if not, remove it.


And then I got lost.
Australia Forum Administrator #3
Is the part starting (=OOC=) a different colour to the stuff in the prompt? Or not? That will affect the way we tackle this.
Australia Forum Administrator #4
If the text you want to keep is in a different colour (and hence starts a new style run) you can add the lines shown to the chats function:


-- Main capture routine
function chats (name, line, wildcards, styles)
    
    -- echo in this world as well if the user wants
    if echo then
        for _, v in ipairs (styles) do
            ColourTell (RGBColourToName (v.textcolour),RGBColourToName (v.backcolour),v.text)
        end -- for each style run
        Note ("")  -- wrap up line
    end -- echo wanted

    // add this ----------------->
    while next (styles) do
      if styles [1].text:sub (1, 1) == "(" then
        break
      end -- if
      table.remove (styles, 1)
    end -- for

#5
I added the edit and ran tests by command stacking which I know would cause it to print after the prompt, which it still did.

I don't know if this will help but i'm going to include the line styles from the prompt and OOC.
#6
Line 180 (180), Sunday, July 01, 7:18:37 AM
 Flags = End para: no, Note: no, User input: no, Log: YES, Bookmark: no
 Length = 75, last space = 75
 Text = "[Health] 43620/66595  [Movement] 2000/2000  [Money] 1,179 > (=OOC=) Aralia:"

27 style runs

1: Offset = 0, Length = 1, Text = "["
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

2: Offset = 1, Length = 6, Text = "Health"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

3: Offset = 7, Length = 2, Text = "] "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

4: Offset = 9, Length = 5, Text = "43620"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

5: Offset = 14, Length = 1, Text = "/"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

6: Offset = 15, Length = 7, Text = "66595  "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

7: Offset = 22, Length = 1, Text = "["
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

8: Offset = 23, Length = 8, Text = "Movement"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

9: Offset = 31, Length = 2, Text = "] "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

10: Offset = 33, Length = 4, Text = "2000"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

11: Offset = 37, Length = 1, Text = "/"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

12: Offset = 38, Length = 6, Text = "2000  "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

13: Offset = 44, Length = 1, Text = "["
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

14: Offset = 45, Length = 5, Text = "Money"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

15: Offset = 50, Length = 2, Text = "] "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

16: Offset = 52, Length = 5, Text = "1,179"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

17: Offset = 57, Length = 2, Text = " >"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

18: Offset = 59, Length = 1, Text = " "
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 7 (White)
 Background colour ANSI  : 0 (Black)

19: Offset = 60, Length = 1, Text = "("
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 2 (Green)
 Background colour ANSI  : 0 (Black)

20: Offset = 61, Length = 1, Text = "="
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

21: Offset = 62, Length = 1, Text = "O"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

22: Offset = 63, Length = 1, Text = "O"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

23: Offset = 64, Length = 1, Text = "C"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

24: Offset = 65, Length = 1, Text = "="
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

25: Offset = 66, Length = 2, Text = ") "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 2 (Green)
 Background colour ANSI  : 0 (Black)

26: Offset = 68, Length = 6, Text = "Aralia"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

27: Offset = 74, Length = 1, Text = ":"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

75 columns in 27 style runs

------ (end line information) ------
#7
Line 181 (181), Sunday, July 01, 7:18:37 AM
 Flags = End para: YES, Note: no, User input: no, Log: YES, Bookmark: no
 Length = 7, last space = -1
 Text = " test 2"

1 style run

1: Offset = 0, Length = 7, Text = " test 2"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 2 (Green)
 Background colour ANSI  : 0 (Black)

7 columns in 1 style run

------ (end line information) ------
Australia Forum Administrator #8
Did you reinstall the plugin after making the change? That should have worked.
#9
I had reinstalled after editing and it didn't work. But when I loaded up today it seemed to work perfectly. Unfortunately one of the immortals took it upon themselves to change the output of OOC slightly. It now shows up as:

[Health] 33442/63676 [Movement] 2000/2000 [Money] 455,445 > [OOC] You say, 'Yea that messed it up'

All the [ from the prompt and [OOC] are the same color. With the edit you provided it how shows nothing but the timestamps in the miniwindow:

[02:56:39]
[02:56:43]
[02:56:45]
#10
Here is a new list of line styles:

Line 2045 (2045), Monday, July 02, 2:50:24 AM
 Flags = End para: YES, Note: no, User input: no, Log: YES, Bookmark: no
 Length = 84, last space = 75
 Text = "[Health] 33442/63676  [Movement] 2000/2000  [Money] 455,445 > [OOC] You say, 'Test2'"

27 style runs

1: Offset = 0, Length = 1, Text = "["
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

2: Offset = 1, Length = 6, Text = "Health"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

3: Offset = 7, Length = 2, Text = "] "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

4: Offset = 9, Length = 5, Text = "33442"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

5: Offset = 14, Length = 1, Text = "/"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

6: Offset = 15, Length = 7, Text = "63676  "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

7: Offset = 22, Length = 1, Text = "["
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

8: Offset = 23, Length = 8, Text = "Movement"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

9: Offset = 31, Length = 2, Text = "] "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

10: Offset = 33, Length = 4, Text = "2000"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

11: Offset = 37, Length = 1, Text = "/"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

12: Offset = 38, Length = 6, Text = "2000  "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

13: Offset = 44, Length = 1, Text = "["
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

14: Offset = 45, Length = 5, Text = "Money"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 0 (Black)
 Background colour ANSI  : 0 (Black)

15: Offset = 50, Length = 2, Text = "] "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

16: Offset = 52, Length = 7, Text = "455,445"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

17: Offset = 59, Length = 2, Text = " >"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

18: Offset = 61, Length = 1, Text = " "
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 7 (White)
 Background colour ANSI  : 0 (Black)

19: Offset = 62, Length = 1, Text = "["
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

20: Offset = 63, Length = 1, Text = "O"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

21: Offset = 64, Length = 1, Text = "O"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

22: Offset = 65, Length = 1, Text = "C"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

23: Offset = 67, Length = 2, Text = "] "
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

24: Offset = 68, Length = 7, Text = "You say"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

25: Offset = 75, Length = 3, Text = ", '"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

26: Offset = 78, Length = 5, Text = "Test2"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

27: Offset = 83, Length = 1, Text = "'"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 4 (Blue)
 Background colour ANSI  : 0 (Black)

84 columns in 27 style runs

------ (end line information) ------
Australia Forum Administrator #11
Aralia Faal said:

Unfortunately one of the immortals took it upon themselves to change the output of OOC slightly.


They have to be reading this forum. That can't be a coincidence. :)
Australia Forum Administrator #12
How about:


    while next (styles) and #styles >= 2 do
      if styles [1].text:sub (1, 1) == "[" and
         styles [2].text:sub (1, 1) == "O"
         then
        break
      end -- if
      table.remove (styles, 1)
    end -- for



If they change it back, they are onto you. ;)
Amended on Mon 02 Jul 2012 08:56 AM by Nick Gammon
#13
Let’s hope not... :)

Unfortunately that did not solve the problem.
Amended on Mon 02 Jul 2012 04:55 PM by Aralia Faal
#14
Ok, so I closed mushclient all together and opened it again and it works now.