Results 1 to 6 of 6

Thread: Some Profanity-related Questions

  1. Default Some Profanity-related Questions

    Looking for some help to accomplish a couple things with Profanity if anyone can assist.

    1. I want thoughts, LNet, Voln, etc messages to show up in both the main window and their own dedicated window. This way I can keep up as I am staring at combat scroll without losing the consolidation of messages.

    2. I want to display customized script content in its own window. I figure I can either get the profanity.rb file to recognize lich methods (like GameObj.npcs) or, in a separate lich script, push content into the profanity window. But, I'm not sure how to approach either.

    Any help is appreciated.

  2. Default

    I'm hoping to try again and see if anyone has any guidance they can provide here since I am stumped.

    Re: #1

    It's definitely possible to repost the line to the main window with something like this:

    if current_stream =~ /^(?:thoughts|voln|lnet)$/
    stream_handler['main'].add_string(text, line_colors)
    end

    The problem is that every time you call the add_string method it wipes out the line_colors array resulting in the second time it is called for the same text line (whether it is for the main window or the thoughts window), the start position is off and the text begins off screen.

    I have tried redefining line_colors again before calling add_string, saving into another variable, and attempting to post directly from within the window class, but can't get this displaying right.


    Re: #2

    Requiring the lich.rbw file in the profanity.rb file straight up fails. So I can't put my script directly into the profanity.rb file. It's preferred for it to be external anyway and I can require the profanity.rb file, but I probably need to split that file for it to work. Perhaps all of the methods into a single file and a separate file that starts the thread. I've played with this bit but can't get profanity to load when the file is split.


    Any thoughts that would give me a different direction to pursue?

    Thanks

  3. #3
    Join Date
    Jul 2003
    Location
    St. Louis, MO
    Posts
    4,271

    Default

    Take a look at ;showxml in the repo. It demonstrates how to send XML to an arbitrary window. You can create another <window ... value="custom_window_name" ... > to your profanity config for your custom script.
    Quote Originally Posted by Patrick McGoohan
    I am not a number, I am a free man!

  4. Default

    Thank you for your response and direction. Do you use puts to insert xml that can be picked up by the script? It looks like that is what the showxml script is doing. But in profanity, it just scrolls the output taking over the whole terminal. I tried to target the output to the main window using ;showxml id=main but that didn't work.

    I added the window in .profanity.xml with class='text' value='npcs'. In my script if I do something like

    puts "<component id='npcs' />#{npcs}</component/>\n"

    it just pastes the string in the quotes in the terminal (in no specific window) as if it were a respond.

  5. #5

    Default

    Quote Originally Posted by Samire View Post
    Thank you for your response and direction. Do you use puts to insert xml that can be picked up by the script? It looks like that is what the showxml script is doing. But in profanity, it just scrolls the output taking over the whole terminal. I tried to target the output to the main window using ;showxml id=main but that didn't work.

    I added the window in .profanity.xml with class='text' value='npcs'. In my script if I do something like

    puts "<component id='npcs' />#{npcs}</component/>\n"

    it just pastes the string in the quotes in the terminal (in no specific window) as if it were a respond.
    use _respond (with the underscore) to poop things with tags back out from a lich script that profanity will digest correctly.
    Mithrilschlong, 2015-03-10 to slightly later on 2015-03-10. You will not be forgotten!
    usable Meteor Swarm, late 2020-12-30 to early 2020-12-31. You will also not be forgotten!

  6. Default

    Oh, you're beautiful! I've got this working. Thank you so much.

    _respond "<pushStream id='npcs'/>#{npcs}<popStream/>\n"

Similar Threads

  1. Profanity FE and highlighting
    By POWPOW in forum The Lich Project
    Replies: 1
    Last Post: 07-07-2020, 01:10 AM
  2. Profanity... a terminal frontend
    By Tillmen in forum The Lich Project
    Replies: 134
    Last Post: 01-20-2020, 08:31 PM
  3. Profanity FE and Quality of Life
    By Luxelle in forum The Lich Project
    Replies: 13
    Last Post: 09-26-2016, 04:11 AM
  4. Profanity in Happy Meals?
    By ClydeR in forum Politics
    Replies: 8
    Last Post: 06-27-2010, 12:19 AM
  5. Couple of training related questions
    By Amber in forum Ranger
    Replies: 3
    Last Post: 04-26-2010, 11:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •