Log in

View Full Version : [HotKeyNet] first script



aspekx
01-21-2014, 08:31 PM
obviously it's all copy/pasta script then modified for EQ2. i have had several issues, but i just want to start at the beginning.

here is my script:

http://www.privatepaste.com/b403e3b17e

here is the HKN debugger report:







Loading script C:\Users\Carl\Desktop\games\hotkeynet\EQ2 CLIENTS.txt.


Finished loading hotkey file.
No errors were found
62 definitions were loaded
1 key will be used as a modifier


Command line: AutoExec
Unable to find command AutoExec


Installing mouse hook
Hook installation succeeded


From this pc: <LaunchAndRename Local "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">


From this pc: <Run "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"><RenameTargetWin "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">


From this pc: <LaunchAndRename Local "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">


From this pc: <LaunchAndRename Local "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">


From this pc: <ResizeAndPosition EQ1 EQ2 EQ3>
<Run "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"> completed: Program started.. Window could not be found
<RenameTargetWin "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"> failed: No window is targeted.


From this pc: <Run "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"><RenameTargetWin "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">
<Run "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"> completed: Program started.. Window could not be found
<RenameTargetWin "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"> failed: No window is targeted.


From this pc: <Run "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"><RenameTargetWin "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">
<Run "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"> completed: Program started.. Window could not be found
<RenameTargetWin "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe"> failed: No window is targeted.


From this pc: <SendWinM EQ1><SetWinRect 0 0 1920 800><SendWinM EQ2><SetWinRect 0 805 715 330><SendWinM EQ3><SetWinRect 715 805 715 330>
<SendWinM EQ1> failed: Could not find window "EQ1"
<SetWinRect 0 0 1920 800> failed: No window is targeted.
<SendWinM EQ2> failed: Could not find window "EQ2"
<SetWinRect 0 805 715 330> failed: No window is targeted.
<SendWinM EQ3> failed: Could not find window "EQ3"
<SetWinRect 715 805 715 330> failed: No window is targeted.


i am also getting an error message from the EQ2 clients stating the following:

Fatal Error
EverQuest II has detected an unrecoverable error and must shutdown.

<verify> G:\live\eq2\game\Client\src\ClientApp.cpp(3810):
No game assets found. Please launch the game from the patcher.
00dabbd8

so, as far as HKN it seems to me that what is happening is that there is some kind of error in my LaunchAndRename. it looks like all the errors that spill out after that command are related to being unable to find the windows to execute the next commands on.

as for the EQ2 error there's a reason it can't find any assets in G: it's because i don't have a G: drive. i have no clue what's happening there. i can launch each of the 3 clients to be used from the executable that the script is supposedly calling on and not a single error appears.

once i launch the game manually and get my 3 clients running simultaneously i can rename them with my hotkey Ctrl+R script.

(rabbit trail: although i am unclear as to how the script hands out the names to each window. how does it decide which window is EQ1 and EQ3, etc.)

Khatovar
01-22-2014, 02:00 AM
Verify Error - https://forums.station.sony.com/eq2/index.php?threads/game-crashes-on-clicking-play-after-new-patch.515459/

There are no immediate errors with the HotKeyNet script outside of the issues the Verify Error is causing.

The script usually hands out names based on the launch order and the arguments in the launch script. Your launch hotkey, however, does not have an argument for naming the windows. You actually have two conflicting commands in your Launch sequence.


//-----------------------------------------------------------
// SUBROUTINE TO LAUNCH AND RENAME A COPY OF EQ2.
//-----------------------------------------------------------
<Command LaunchAndRename>
<SendPC %1%>
<Run "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">
<RenameTargetWin %2%>



//-----------------------------------------------------------
// HOTKEY TO LAUNCH AND RENAME
//-----------------------------------------------------------
<Hotkey LCtrl LAlt w>
<if WinDoesNotExist EQ1>
<LaunchAndRename Local "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">
<endif>
<if WinDoesNotExist EQ2>
<LaunchAndRename Local "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">
<endif>
<if WinDoesNotExist EQ3>
<LaunchAndRename Local "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe">
<endif>
<ResizeAndPosition EQ1 EQ2 EQ3>

%1% and %2% in the first section are arguments. They are looking for variables to fill in based on the second part.

Basically, you press LCtrl LAlt w, HotKeyNet checks if you already have a window called EQ1. If not, it moves to the next command in line, "LaunchAndRename." HotKeyNet then looks for the command you defined called "LaunchAndRename," which is the first piece of code.

The LaunchAndRename Command looks for where to issue the commands {SendPC} and checks the Hotkey for the first argument %1%. This is the first section after calling the LaunchAndRename command, "Local." So the commands are going to the local computer as opposed to a remote one.

LaunchAndRename then moves to the next part of the command, "Run "C:\Users\Public..." and launches the game.

Then it comes up on a new argument %2% that is supposed to rename the window. But when it looks at the second piece of code, you have the pathname defined again. Technically, your script is {or rather, would be} renaming windows from something like "EverQuest II (Jan 3 2014 17:46:26) USER OPTIMIZED: SOEBuild=10670L" to "C:\Users\Public\Sony Online Entertainment\Installed Games\EverQuest II\EverQuest2.exe" because that is the second variable after the LaunchAndRename command is called in your hotkey.

You can review how this all works in my HotKeyNet Starter Script Walkthough (http://genus-industri.us/wp/2011/09/09/configuring-a-hotkeynet-starter-script/).

As far as getting this to work for EQ2, you will probably end up rewriting the entire command in order to get a proper launch and rename to get all the way to the character screen. Or you can stick with manually launching them.

Frankly, you'd probably be better off just switching to ISBoxer as EQ2 has gotten rather fussy and I've not sat down to get a real workable script for it in quite a while.

aspekx
01-22-2014, 05:56 AM
thank you for the reply. i have actually been reading a number of tutorials that i believe are your work. the primary one i used was in the wiki, but i did visit your website and read through the same tutorial there hoping to catch something overlooked by myself.

i will go back and review all of this again. i am sure with some more effort i can probably figure a rewrite out. (i have been surprised at how interesting this has been for me, i've never really scripted anything before except for some HTML.)


my other question concerning this script was where i might be getting it wrong in passing hotkey commands to both clients.

once ingame and grouped i can press the #9 hotkey in Hotbar 1 and while both clients have a Hotbar 1 and an ability slotted in the #9 hotkey only the foreground client receives the message.

when i check the HKN bug report it says that the cmd was successfully transferred to both windows.

i had read somewhere, i thought, that Windows does not natively support key cmds going to a background window. perhaps this is the trouble?

again thank you for your time and reply.

Khatovar
01-22-2014, 06:21 AM
I addressed that in the other thread (http://www.dual-boxing.com/threads/50640-New-to-dual-multi-boxing-and-ran-into-an-issue-with-Windows-8?p=387411&viewfull=1#post387411).

aspekx
01-22-2014, 06:41 AM
I addressed that in the other thread (http://www.dual-boxing.com/threads/50640-New-to-dual-multi-boxing-and-ran-into-an-issue-with-Windows-8?p=387411&viewfull=1#post387411).

my apologies, i did miss that.

thank you.