Page 1 of 13 12311 ... LastLast
Results 1 to 10 of 129

Thread: Profanity... a terminal frontend

  1. Default Profanity... a terminal frontend

    I just uploaded the terminal frontend I've been working on. It's based on Ruby and ncurses. The two main reasons I decided to make this was: 1) It runs natively on Linux. and B) You can use it in a terminal emulator on Android using a ssh connection to your normal computer.

    The script is here:
    https://github.com/matt-lowe/ProfanityFE

    Here are some screenshot type things:
    http://lichproject.org/download/prof...2013-07-10.png
    http://lichproject.org/download/prof...-10-mobile.png

    Mostly completed features:
    regex highlights
    thought window
    injury window
    death/logon/logoff/disconnect window
    stance, mind, health, spirit, mana, stamina, encumbrance, roundtime, and stun progress bars
    poison, disease, bleeding indicators

    Planned features:
    macros and arbitrary key bindings
    customizable layouts
    familiar, bounty, society, spells, voln, and lnet windows
    room window (not the title and description, just people/creatures/objects)
    arbitrary text windows (anything matching a custom regex gets redirected to the window)
    kneeling, sitting, prone, dead, webbed, hidden, invisible, group, left/right hand indicators
    other stuff I'll worry about later

    This is a very early release. Basically nothing can be customized right now without editing the code. That's probably what I'll be working on next.

    Regex highlights are cool. As you might guess, you can do things like /[A-Z][a-z]+ disk/ to highlight disks and the owner's name, without having to add a highlight for each player in the game. But you can also do weird stuff like /(?<!uncut )diamond/ to highlight "diamond", but only if "uncut " doesn't come before it.

    It's not exactly user friendly yet... but if you want to play around with it here's how you might do that:

    First, you'll need Lich 4.4.14.

    Download profanity.rb from the link above. You can put it anywhere, but I just put it in my Lich folder.

    Make sure you've set up quick game entry for a character in Lich.

    Open a terminal type thing..

    Change to the directory with lich.rb in it and start Lich with something like:
    ./lich.rb --login Charactername --without-frontend --detachable-client=8000
    or
    ruby lich.rb --login Charactername --without-frontend --detachable-client=8000
    or
    ruby.exe lich.rbw --login Charactername --without-frontend --detachable-client=8000
    or something..

    --without-frontend means it's not going to try to start a frontend and wait for it to connect to Lich and then connect to the game. It's going to get a login key and connect to the game without any way for you to see the output or give it input.

    --detachable-client=8000 means it's going to listen for a client to connect on port 8000. The client can connect or disconnect as much as it wants, and Lich will stay connected to the game.

    I don't intend for this to be the only way to use the frontend, but I play Shattered so I made it to work for me first.

    Now, you can start Profanity and connect to Lich on the port you specified (8000 in the example).

    On Linux, you may need to type "export TERM=xterm-256color" to enable 256 colors.
    ./profanity --port=8000

    On Android, I've been using the terminal emulator named "Android Terminal Emulator" by Jack Palevich with preferences > terminal type set to screen-256color
    ssh your_user_name@your_ip_or_dyndns_or_something
    /path/to/profanity/profanity --port=8000 --custom-colors=no

    On Windows... um.. you could use cmd.exe... but you probably shouldn't.
    ruby.exe profanity.rb --port=8000

    I haven't tried it on OSX. I assume it's the same as Linux.

    --custom-colors=no means it won't try to redefine the terminals colors. The script asks the terminal if it supports changing the colors, and in the case of the Android Terminal Emulator, it lies. So to keep it from looking like complete crap, you have to turn custom-colors off.

    Colors in the script are defined by html codes. In 256 color mode, with custom-colors on, it should have the appearance of unlimited colors. The script will continue to redefine the least recently used color slot whenever a requested color isn't defined. So as long as there are fewer than 256 colors on the screen at any given time, everything should be fine. When custom-colors is off, the script attempts to find the clostest matching available color.

    Some keys:
    page up/page down scrolls the current window up and down
    alt+page up/alt+page down scrolls the current window 1 line
    tab changes the current window, indicated by the scrollbar

    command prompt should work as expected except ctrl+enter, alt+enter, ctrl+left/right, copy/paste are not yet working.

    Typing .quit will close the frontend, but not exit the game.
    Type .resync if the roundtime bar isn't right.
    Don't type .e
    Any other command starting with a period gets changed to a semicolon before it's sent, because it's easier to hit the period on Android.
    Last edited by Tillmen; 09-10-2013 at 12:26 AM.

  2. Default

    Looks great! Can't wait to see where you go with it.

    Gretchen

  3. #3
    Join Date
    Jun 2007
    Location
    Mars
    Posts
    23,769
    Blog Entries
    17

    Default

    Why is cool shit coming out after I quit GS?
    Ceterum censeo Carthaginem esse delendam

  4. #4

    Default

    You know, I read the title of this thread and thought someone took pity on Dayko and created a script to help him curb his in-game use of profanity.

    That being said, this thing is awesome, Tillmen. Now I want an android. =(
    You slap Walkar's cheek, hard.
    He continues, "I've decided that I'm not going to let you serve community service, so don't get your hopes up. To this aim, you may either pay the fine of 50000000 silvers plus any other outstanding debts you may owe, or serve a total of 120 minutes of incarceration. You may ANSWER me either FINE or INCARCERATION as your choice. But I digress. Choose quickly, now, lest I hold you in contempt of court for wasting my time."

  5. #5

    Default

    Really cool just wanted to say I tried what you said not to do just to see what would happen.

    profanity.rb:77: undefined (?...) sequence: /(?<=\]\-)GSF/
    profanity.rb:78: undefined (?...) sequence: /(?<=\]\-)GSIV/
    profanity.rb:79: undefined (?...) sequence: /(?<=\]\-)GSPlat/
    profanity.rb:80: undefined (?...) sequence: /(?<=\]\-)DR/

    Running the windows command you said..uh not to run!
    Chris
    Have a good merchant experience with me?
    Leave me some HEAT

  6. #6

    Default

    Quote Originally Posted by Gelston View Post
    Why is cool shit coming out after I quit GS?
    I was told you quit GS so that cool shit would come out.

    Confirm/deny?
    www.twitch.tv/3piecesofbread
    Quote Originally Posted by time4fun
    No, actually, Back is not an idiot.
    Quote Originally Posted by Back
    I am a retard. I'm disabled. I'm poor. I'm black. I'm gay. I'm transgender. I'm a woman.


    Quote Originally Posted by Androidpk View Post
    And feel free to get me banned, not going to stop my lawyer from sending Kranar a subpoena for IP information on a couple of people.

  7. #7

    Default

    Quote Originally Posted by Buckwheet View Post
    Really cool just wanted to say I tried what you said not to do just to see what would happen.

    profanity.rb:77: undefined (?...) sequence: /(?<=\]\-)GSF/
    profanity.rb:78: undefined (?...) sequence: /(?<=\]\-)GSIV/
    profanity.rb:79: undefined (?...) sequence: /(?<=\]\-)GSPlat/
    profanity.rb:80: undefined (?...) sequence: /(?<=\]\-)DR/

    Running the windows command you said..uh not to run!
    This is apparently a problem with the Ruby version you're running. It happened for me, too, when I was running Ruby 1.8.7 in Windows. However, I installed Ruby 2.0, and I no longer get this error. In fact, I got this working on Windows!

    After you install Ruby 2.0, you will still get an error, but it will be a different one. Ruby 2.0 (or Windows, not sure which) has a problem with the IP address that profanity.rb has on line 1031. At line 1031, it says:

    Code:
    server = TCPSocket.open('0.0.0.0', PORT)
    You'll need to change that to the following:

    Code:
    server = TCPSocket.open('127.0.0.1', PORT)
    This tells it to connect to your local computer. Once you make that change, save profanity.rb. Then, from the command line, run:

    Code:
    ruby.exe profanity.rb --port=8000
    and it will connect successfully.

    By the way, for my part, I installed Ruby 2.0 separately from Ruby 1.8.7, so that I still have both on my computer. You might want to do that, too. In that case, instead of just typing "ruby.exe profanity.rb --port=8000", you may have to provide the full path to Ruby 2.0, e.g., "C:\Ruby200\bin\ruby.exe profanity.rb --port=8000".

  8. #8

    Default

    Obligatory Windows screenshot: http://i.imgur.com/Ot0jaVt.png

  9. Default

    Quote Originally Posted by Tillmen View Post
    Don't type .e

  10. #10

    Default

    I just did a full upgrade since I use virtual machine sandboxing. Anyways nice tips and that seems to work.

    Funny thing, I have sorter load by default. It puts the output into the first cmd window where you launch the game instead of the front end that is loaded inside the second CMD window.
    Chris
    Have a good merchant experience with me?
    Leave me some HEAT

Posting Permissions

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