The World of Layonara

The Layonara Community => Roleplaying => Topic started by: Pen N Popper on March 19, 2007, 07:44:41 pm

Title: Emote your heart out!!
Post by: Pen N Popper on March 19, 2007, 07:44:41 pm
[SIZE=18]Tired of trying to type in battle?  Tired of repeating your introduction to the umpteenth person?  I have the solution right here![/SIZE]

Those of you that have travelled with my PCs were probably thinking to yourself, "That fellow can type up a storm!"  While I can do that, I've added to my repetoire by taking advantage of this nifty software:  AutoHotkey - Free Mouse and Keyboard Macro Program with Hotkeys and AutoText (http://www.autohotkey.com).

This free bit of software allows you to write rather complicated hotkeys and macros.  The nice thing is that it can intercept the keystrokes before they reach your game.

Take my paladin of Vorax, Wanark.  He had a dozen or more short blessings that he'd say (some in dwarven) when just prior to casting bless or equipping his waraxe.  Then he had longer blessings that even included him kneeling.  Finally, he had the entire Vorax paladin credo he'd use when he visited the temple.  All of these I had assigned to hotkeys outside the game.  Brings a tear to your eye, doesn't it?  Beautiful.

I'll give an example from my current PC that you can use to build your own set.  (Careful of line wrapping if you cut&paste into your own file.)
[INDENT][SIZE=16]
;; ------------------------------------------
;; A utility routine to say something
;;
[/SIZE]
[SIZE=16]Say(s)
{
    global prefix

    SendInput {Enter}
    Sleep 250
    IfInString, s, /tp
    SendInput {Raw}%s%
    else
    SendInput {Raw}%prefix%%s%
    SendInput {Enter}
}

;; ------------------------------------------
;; This will send yourself a tell with some help
;;
::/o help::
    SendInput {Raw}/tp "Pen N Popper" name, description, wearing, ^f
    Send {Enter}
return

;; -------------------------------------------
;; Give your name
;;
::/o name::
    SendInput {Raw}rolan tennesen... *bows* sellsword in the employ of the freelancers
    Send {Enter}
return


;; ------------------------------------------
;; A random color emote of walking along
;;
^g::
    Random, num, 1, 5
    if ( num == 1 )
    Say("*hurries along at an uneven pace, pausing now and then to catch breath*")
    else if ( num == 2 )
    Say("*moves along at a steady pace*")
    else if ( num == 3 )
             Say("*hurries along, gaze taking in his surroundings*")
    else if ( num == 4 )
             Say("*marches along with quick strides, sounding a bit out of breath*")
    else if ( num == 5 )
             Say("*moves at a deliberate pace*")

    Sleep 100
    SendInput {LControl}
return[/SIZE]

[/INDENT]I save this to a file called "rolan.ahk" and then run it.  Ingame, when I hit Ctrl-g a random description of walking will be sent.  When I type in /o description the verbose description of Rolan is output.

You can see that this can have as much flavor as you can think of.  It is especially handy during battle when all I have to do is type Ctrl-f for a fight emote.  (I even have it setup to fill in which weapon he is using to the emotes are correct.)

Good luck!
Title: Re: Emote your heart out!!
Post by: Tanman on March 19, 2007, 09:33:57 pm
OK. PnP I don't know where you get this stuff from but this is brilliant.
Title: Re: Emote your heart out!!
Post by: gilshem ironstone on March 19, 2007, 09:46:24 pm
Not only do I not know where you get this stuff, but how do you know how to use it?  Wait is that the development team laughing at me?
Title: Re: Emote your heart out!!
Post by: Hellblazer on March 19, 2007, 10:00:11 pm
Man thank you very much.
Title: Re: Emote your heart out!!
Post by: Stephen_Zuckerman on March 19, 2007, 10:12:30 pm
Quote from: gilshem ironstone
Not only do I not know where you get this stuff, but how do you know how to use it?  Wait is that the development team laughing at me?


Actually, I'm hesitant about trying to use this, myself. I'm not sure about the actual application of this...
Title: Re: Emote your heart out!!
Post by: Tanman on March 20, 2007, 01:15:36 am
Stephen, basically its an extension of the text macro in NWN, except that it is far more powerful. You can just run a macro, and all of a sudden, the program will randomly select certain phrases that you have preselected, or you can hotkey it.

So in essence you are not tired down to the quickslots in NWN to run your text macros.
Title: Re: Emote your heart out!!
Post by: Hruby on March 20, 2007, 11:52:14 am
P N P,

You rock as always.  Kurgin has all his slots filled with Cleric Spells.  This will help tremendously.
Title: Re: Emote your heart out!!
Post by: Falonthas on March 20, 2007, 11:59:44 am
so do we need to do anything special for this and can it be assigned for each character or only one
Title: Re: Emote your heart out!!
Post by: Pen N Popper on March 20, 2007, 12:05:54 pm
The way I have it set up, each of my PCs have their own ahk file.  I then browse to the files and double-click on them to get them running.  This will put a little green H in the Windows toolbar.  Right-clicking on that allows you to suspend the ones you're not currently playing.  Just keep one script active to match your current PC.
Title: Re: Emote your heart out!!
Post by: gilshem ironstone on March 20, 2007, 12:26:47 pm
Quote from: Stephen_Zuckerman
Actually, I'm hesitant about trying to use this, myself. I'm not sure about the actual application of this...


Yeah I have seen PnP use them many a time.  Like when he did "The Book of Five Rings" series.  Those were all done using this software.
Title: Re: Emote your heart out!!
Post by: Hellblazer on March 20, 2007, 01:58:40 pm
oy macros!!! runs and hide.
Title: Re: Emote your heart out!!
Post by: bowfreak on March 23, 2007, 06:39:07 pm
Do you write and save this file to your NWN folder? When do you run it...before or after you load NWN? This is sweet, the macros dont give enough room to -really- say or emote what you want without cutting it up to fit, or trying to squeeze it in multiple slots.
 
You used this with Aeron and Yzar at the Crimson Memorial, and this is exactly what I thought..."That fellow can type up a storm!"
Title: Re: Emote your heart out!!
Post by: darkstorme on March 26, 2007, 02:22:13 pm
It runs independently of NWN, so you install it, and then any .ahk file will execute on double-click.  Generally speaking, you should activate it before you start NWN.

That being said, I've taken to editing my files on the fly, so I activate and deactivate it throughout a play session.

Edit:  I'd forgotten the reason I originally was going to post!  Props to PnP for such a useful program!
Title: Re: Emote your heart out!!
Post by: Faldred on March 26, 2007, 02:32:55 pm
Quote from: darkstorme
It runs independently of NWN, so you install it, and then any .ahk file will execute on double-click.  Generally speaking, you should activate it before you start NWN.

Can it be launched form the command line?  That would be sweet, as I can then just add it to the batch files I use for starting NWN for Layo...
Title: Re: Emote your heart out!!
Post by: darkstorme on March 26, 2007, 02:52:25 pm
There's a nifty little feature in AHK itself which allows you to compile an AHK file into an .exe.   I would guess that if you did that, you could then launch it from the command line, though I don't have the program here to try right now.

Even so, I'd imagine it's possible.
Title: Re: Emote your heart out!!
Post by: pejsaboy on April 07, 2007, 08:56:55 pm
Once I got past the formatting, this thing is absolutely great! Thanks for the link :D
Title: Re: Emote your heart out!!
Post by: Masterjack on March 13, 2008, 09:53:24 am
*bump for the new players*

My son set it up for me. He has it so all have to do is hit Crtl + L and NWN launches and loads right into layo. Don't ask me how to do it, I have no idea.
Title: Re: Emote your heart out!!
Post by: Thief Of Navarre on January 19, 2009, 07:12:36 am
Im pretty sure ^L::Run C:\\Desktop\\nwn.exe to run Neverwinter Nights if thats the way its set up. God knows how he got it to load into Layo from the getgo! Im not that clever or patient >.<
Title: Re: Emote your heart out!!
Post by: ShiffDrgnhrt on January 19, 2009, 03:50:16 pm
Well it doesn't work in with Layo.  It's based on Key Board Commands like Ctrl+L to execute written scripts that you make.  It's probably capable of doing things like launch NWN for you with a push of some buttons, but I don't know how to script that.  I do know though, that after you create your basic scripts, while in game if you hit the assigned short cut, usually an CtrL+whatever letter you want or number or whatever, it can do whatever's necessary.  it even works as a sort of "auto typer."  I have it set up that if I type /o armor it scripted to type in "*Tyra does whatever with her armor"...  it's really cool, but I wouldn't know how to help someone set it up over forum posts.  If you can catch me or any of the other people who use it with some fluency on IRC I'll be happy to talk you through at least what I have set up.
Title: Re: Emote your heart out!!
Post by: ShiffDrgnhrt on March 24, 2009, 07:09:00 pm
A Friendly Bump  :)
Title: Re: Emote your heart out!!
Post by: Xaltotun on April 12, 2009, 05:35:28 pm
Thanks Pen N Popper, this utility is fantastic. I have done a few tests and it works really well. Here is a sample of the script I am going to use. I have named the script name of my character.ahk which you suggested, so thanks. However, I have used a simpler way (I hope) of getting my character to say things.

Text file has these two lines in it...
::sco?::I am going to scout ahead, and I need you all to stay here until I return, so no heroics and no sleeping. You all got that?
::fou?::I have found a whole bunch of them ahead, but we need to be careful. Here's what I suggest we do...

The file has two shortcuts which it interprets when you press Enter in NWN and type. So to say the first line, I press Enter to start the talk and type sco? and press Enter to say the first line - "I am going to scout ahead, and I need you all to stay here until I return, so no heroics and no sleeping. You all got that?."
When I return I press Enter to talk again, then type fou? and press Enter to say the second line "I have found a whole bunch of them ahead, but we need to be careful. Here's what I suggest we do..." and I can then add appropriate text as the third set of chat lines.

I use the question marks to terrminate the shortcuts as I found I sometimes used real text and it got intercepted and reproduced which I didn't want to happen.

Hope this helps to add to a useful suggestion by Pen N Popper
Title: Re: Emote your heart out!!
Post by: Maestro3P on July 10, 2012, 02:31:24 pm
I can't get it to work :\\

I've tried all kinds of things. I can get other stuff to work with the program, like
Code: [Select]
#space::Run www.google.com
I can even fire that kind of code while NWN is active, but it's just like NWN won't accept any input caused by the AutoHotKey, not even the code posted by Pen N Popper.

Does anyone have any idea?