Legends of the Jedi Forums Share Yo’ Scripts how to capture vital information to a miniwindow
This topic has 8 replies, 4 voices, and was last updated 9 years, 10 months ago by Corey.
Viewing 9 posts - 1 through 9 (of 9 total)
    • Igabod Member
      November 5, 2013 at 1:14 am #22864

      I’m looking to create a script that will capture several bits of information and send it to a miniwindow. Very similar to the channel capture plugin, but I need it to be easy to add things to be captured. That way if I suddenly decide I want to add “You gain 3500 science experience.” I can just quickly add it. I have very little scripting experience so I wasn’t able to figure out how to do this by looking at the existing channel capture plugins. Any help that can be provided would be appreciated.

    • Flek Participant
      November 7, 2013 at 10:59 am #22870

      https://www.dropbox.com/s/he0q3zpagk4fgtf/Chat_capture.mcl

      https://www.dropbox.com/s/qjn7d9gd79o8po6/Chat_capture.XML

      Okay buddy got something for ya. Now im not as savy as Rav or Johnson but this will work.

      You need to save both of those in the same place you have your world file. add the plugin and it will autoload chat_capture.mcl when it sees a clan chat. I saved that by default.

      Next step to add what you like.

      Open the xml with notepad

      see the 3 triggers I put in there, your gonna make a new one.

      <trigger
      enabled=”y”
      match=”*{*}<*>[*]*”
      regexp=”n”
      script=”redirect”
      sequence=”100″
      >
      </trigger>

      Thats the clan chat trigger so copy that and past it somewhere to edit

      match=”*{*}<*>[*]*”
      that line in paticuler is for clan channel.

      The Empire {COMPNOR}<Agent>[Flek]( softly )<Zabraki>:Hello
      It looks for those brackets in that order

      So if you wanted say Talk
      CommNet 0 [Flek]( merrily ): What?

      match=”CommNet * [*]*”
      that would variable the name, pc name, and what ever tone / language that use.

      so adding the new trigger would be

      <trigger
      enabled=”y”
      match=”CommNet * [*]*”
      regexp=”n”
      script=”redirect”
      sequence=”100″
      >
      </trigger>

      Hope that helps

    • Igabod Member
      November 7, 2013 at 6:27 pm #22882

      That didn’t work, all it did was open a new world and didn’t copy the info to the new world at all. And I would prefer it to be a miniwindow that shows up while I am looking at the main mud window, like johnson’s channel capture script does. I do appreciate the help.

    • Flek Participant
      November 7, 2013 at 6:49 pm #22883

      Well you can do the same thing to johnsons.

      open his script, find the capture triggers and add one you are looking for.

      As for mine not working, I think a step was missed I would have to trouble shoot it
      ]

    • Igabod Member
      November 7, 2013 at 7:19 pm #22884

      Unfortunately, just adding a new trigger and changing the match line isn’t enough to add something to Johnson’s script. I tried that already and it didn’t give me any error messages at all but it didn’t capture the text either. ` <trigger
      enabled=”n”
      name=”test”
      match=”East – [YT-1000 Light Freighter – Common Area]”
      regexp=”n”
      script=”untagged_info”
      sequence=”100″
      >
      </trigger>`
      that’s the trigger I tried to test it with and when it didn’t work I figured maybe the brackets were doing it so I tried to match it off of a social. ` <trigger
      enabled=”n”
      name=”test”
      match=”Where are your manners?”
      regexp=”n”
      script=”untagged_info”
      sequence=”100″
      >
      </trigger>`
      that didn’t work either.

    • Igabod Member
      November 18, 2013 at 5:37 pm #23000

      ok, I’ve got a simple workaround to display variable data in a miniwindow. It does what I need it to do, but there are some things I’d like to change and am not quite sure how to go about it. Currently it displays:

      Target:
      Human

      but I want it to display on one line

      Target: Human

      Here is what I have so far.

      <timers>
      <timer enabled=”y” second=”5.00″ offset_second=”0.00″ send_to=”12″
      active_closed=”y” >
      <send>var = GetVariable (“target”)

      win = GetPluginID ( ) .. “:variable_contents”

      font = “f”

      disptext = “Target: ”

      WindowCreate ( win, 0, 0, 1, 1, miniwin.pos_top_left, 0, 0)

      WindowFont ( win, font, “Courier”, 10, true)

      height = WindowFontInfo ( win, font, 1) + 15

      width = WindowTextWidth ( win, font, disptext) + 5

      WindowCreate ( win, 0, 0, width, height , miniwin.pos_bottom_right, 0, ColourNameToRGB ( “gray” ))
      WindowText ( win, font, disptext, 5, 0, 0, 0, ColourNameToRGB ( “yellow” ) )
      WindowText ( win, font, var, 5, 12, 0, 0, ColourNameToRGB ( “yellow”) )

      WindowShow ( win )</send>

      </timer>
      </timers>

      Any help at combining the two lines would be much appreciated.

    • Johnson Participant
      November 23, 2013 at 4:01 am #23058

      WindowText ( win, font, var, 5, 12, 0, 0, ColourNameToRGB ( “yellow”) )

      The 12 in this line is displaying your text 12 pixels down from the top of your miniwindow, causing it to move down to a second line.

      Here is your original code modified to only show one line:

      <timers>
      <timer enabled="y" second="5.00" offset_second="0.00" send_to="12" active_closed="y" >
      <send>
      win = GetPluginID ( ) .. ":variable_contents"
      
      font = "f"
      
      disptext = "Target: " .. (GetVariable("target") or "No Target")
      
      WindowCreate ( win, 0, 0, 1, 1, miniwin.pos_top_left, 0, 0)
      
      WindowFont ( win, font, "Courier", 10, true)
      
      height = WindowFontInfo ( win, font, 1) + 2
      
      width = WindowTextWidth ( win, font, disptext) + 4
      
      WindowCreate ( win, 0, 0, width, height , miniwin.pos_bottom_right, 0, ColourNameToRGB ( "gray" ))
      WindowText ( win, font, disptext, 2, 1, 0, 0, ColourNameToRGB ( "yellow" ))
      
      WindowShow ( win )</send>
      
      </timer>
      </timers>
      
    • Igabod Member
      November 23, 2013 at 7:02 am #23059

      thank you johnson. This will help me with a couple other display windows.

    • Corey Participant
      July 9, 2014 at 5:10 pm #24198

      Alright, I’m using a second capture window for IC text that Flek set up for me a while back. It grabs all channels that I’m tuned to, broadcasts, says and so on. However, I would like a 3rd window to specifically filter OOC and osay. Can anyone help me out with this?

      EDIT: I use mushclient 4.84 – the script is linked above in Flek’s first post, the dropbox link

Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic.