Subwindows

Posted by BlueEyes on Fri 14 Aug 2009 02:09 AM — 13 posts, 43,289 views.

#0
I have made a seperate Mushclient window that captures all my says/tells/yells/city/etc. now in my chat window rather than having a space between each "segment" it gets all bunched together like this.

(Skeleton Hearth): -- says, "Cause I forgot about the sub."
(Skeleton Hearth): -- says, "So if I said you were a cow you wouldn't be offended?"
(Market): -- says, "Adept alchemist for hire!"
(Skeleton Hearth): -- says, "I can't even tell if you said I was a crow."
(Skeleton Hearth): -- says, "Or a cow."
(Dawneye Tribe): -- says, "I bet -- did it!"


Now what I want to do is have it put a space between it all..... also I have made another window that captures stuff when I am attacking my own target so I'm not consumed with spam. The problem I am having is the trigger in window everything is sent to works.. I can sent the text, but I want it to ColourNote or something so I can see it easier.
#1
What do you mean segment?
#2
So it would look like




(Talky): Talk talk talk

(Talky): Talk talk talk

(Talky): Talk talk talk

(Talky): Talk talk talk

(Talky): Talk talk talk
#3
Can you post what you have so far?

It looks like you just want a blank line after each message?
Amended on Fri 14 Aug 2009 04:33 AM by Blainer
#4
Exactly


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, August 13, 2009, 5:40 AM -->
<!-- MuClient version 4.40 -->

<!-- Plugin "Chats" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Chats"
   author="Liam"
   id="a4384ef6e87b564e4d9a9396"
   language="Lua"
   purpose="Chat funnel"
   date_written="2009-08-13 05:39:57"
   requires="4.40"
   version="1.0"
   >

</plugin>


<!--  Get our standard constants -->

<include name="constants.lua"/>

<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="(*): *"
   omit_from_output="y"
   script="chat"
   send_to="12"
   sequence="100"
  >
  <send>a
</send>
  </trigger>
  <trigger
   enabled="y"
   match="*, &quot;*&quot;"
   omit_from_output="y"
   script="chat"
   send_to="12"
   sequence="100"
  >
  <send>a
</send>
  </trigger>
</triggers>

<!--  Script  -->


<script>
<![CDATA[
function chat (name, line, wildcards, styles)

local w = GetWorld ("chat")

if w then
  for _, v in ipairs (styles) do
    w:ColourTell (RGBColourToName (v.textcolour), 
                  RGBColourToName (v.backcolour), 
                  v.text)  
  end -- for each style run
  w:Note ("")  -- wrap up line

end -- world found

end

]]>
</script>


</muclient>
Amended on Fri 14 Aug 2009 05:19 AM by BlueEyes
USA #5
Instead of w:Note(""), try w:Note("\n"), or just have two w:Note() calls. That'll effectively put out two newlines.
#6
Didn't work. I tryed it with the triggers and with the script.
Australia Forum Administrator #7
This does a single line:


if w then
  for _, v in ipairs (styles) do
    w:ColourTell (RGBColourToName (v.textcolour), 
                  RGBColourToName (v.backcolour), 
                  v.text)  
  end -- for each style run
  w:Note ("")  -- wrap up line

end -- world found


Adding a new Note should add a blank line. It *will* add a blank line. ;)


if w then
  for _, v in ipairs (styles) do
    w:ColourTell (RGBColourToName (v.textcolour), 
                  RGBColourToName (v.backcolour), 
                  v.text)  
  end -- for each style run
  w:Note ("")  -- wrap up line
  w:Note ("")  -- add a blank line

end -- world found
#8
Ah there we go, it wasn't working for a bit, but I forgot to reinstall the plugin, thanks for the help! Now is it possible for me chat world to capture triggers and do like a ColourNote or something?
Australia Forum Administrator #9
Triggers are not triggered on notes, so that wouldn't work directly (otherwise they might go into a loop, if a trigger fired on a note, and did another note).

If you want the chat messages in a different colour you could do that in the main world plugin. In other words, instead of RGBColourToName (v.textcolour) you could do something like see what sort of chat it is and change the colour to something else.
#10
Well what I want is for combat so here is an example.


<triggers>
  <trigger
   enabled="y"
   match="^(.*?) knocking him to the ground\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>colourtell "red", "black", "--------------"
colourtell "red", "black", " KNOCKDOWN!!!!! "
colourtell "red", "black", "--------------"
colourtell "red", "black", " "</send>
  </trigger>
</triggers>


Thats my trigger for my main world... now I want it to show up in a seperate window so I dont get spammed to death.
Amended on Sun 16 Aug 2009 04:30 AM by Nick Gammon
Australia Forum Administrator #11
Have you switched to VBscript, or is that just a very rough example? ColourTell has to be spelt with the correct capitalization.

And you probably want ColourNote anyway, otherwise it all goes on the same line.

Anyway, you just can do the same general idea:


local w = GetWorld ("chat")
if w then
  w:ColourNote ( "red", "black", "--------------")
  w:ColourNote ( "red", "black", " KNOCKDOWN!!!!! ")
  w:ColourNote ( "red", "black", "--------------")
  w:ColourNote ( "red", "black", " ")
end -- if world exists
#12
Sorry about the scripting mix up. I forgot my main world was in VB script were I was testing ideas, I'm making a new one with Lua and starting from nothing to cure faster... etc.etc.