Autohotkey Update
Figured out how to use autohotkey over local network.
First, you need a shared map on both pc's with full permissions. (So that is a local map on both PC's that is shared with the other PC.)
Then in my case as I run one instance on my main PC and two on my secondary, these are the scripts I run. (two scripts running on both PC's)
Main PC script 1:
After starting the script I have 2 seconds to make the diablo II instance active, then it stores its ID in a variable. Because I only have to initialize one instance on this PC, the script is running after that. (I might figure out a way to avoid having to initialize the windows, but I had some trouble getting autohotkey to target diablo without this more forceful method)
For the test I have only used the c key which is the inventory key in my case for testing purposes. It checks to see if I am currently active in the game window, if I am it writes two files, one locally and one on the other PC's shared folder.
Code:
#NoEnv
sleep 2000
WinGet, diablo1_id, ID, A
MsgBox, First instance set ("%diablo1_id%").
$c::
IfWinActive, ahk_id %diablo1_id%
{
keypress := "c"
FileAppend, %keypress%`n, commandPC1.txt
FileAppend, %keypress%`n, \\SECONDPC\shared\commandPC2.txt
} else {
Send c
}
return
Main PC script 2:
Again, initializing the window by activating the game window two seconds after starting the script. The rest is just a loop checking to see if anything needs done. (For example, if winactive and c is pressed, the first script makes a file and then this one executes the keypress.
When I wasn't saving these txt files locally for this script, it was lagging and barely working. That's why you need a local folder on both pc's that are shared with full permissions.
Code:
#NoEnv
sleep 2000
WinGet, diablo1_id, ID, A
MsgBox, First instance set ("%diablo1_id%").
Loop {
commandline := ""
if FileExist("commandPC1.txt") {
FileReadLine, commandline, commandPC1.txt, 1
if (commandline != "") {
ControlSend,, %commandline%, ahk_id %diablo1_id%
FileDelete, commandPC1.txt
}
}
}
Second PC script 1:
This time I have to initialize two windows. (I run both of these instances of diablo in Sandboxie in two seperate sandboxes named diablobox1 and diablobox2, I have the settings of these sandboxes to show sandbox name in title. This isn't needed for this script, but it is needed for windowed borderless gaming.)
The script much like main pc script 1 is pretty much the same.
Code:
#NoEnv
sleep 2000
WinGet, diablo2_id, ID, A
MsgBox, Second instance set ("%diablo2_id%").
sleep 2000
WinGet, diablo3_id, ID, A
MsgBox, Third instance set ("%diablo3_id%").
$c::
IfWinActive, ahk_id %diablo2_id%
{
keypress := "c"
FileAppend, %keypress%`n, \\FIRSTPC\shared\commandPC1.txt
FileAppend, %keypress%`n, commandPC2.txt
}
else IfWinActive, ahk_id %diablo3_id%
{
keypress := "c"
FileAppend, %keypress%`n, \\FIRSTPC\shared\commandPC1.txt
FileAppend, %keypress%`n, commandPC2.txt
} else {
send c
}
return
Second PC script 2:
And again like the main PC script, except double initialization and an extra controlsend to send the key to both instances.
Code:
#NoEnv
sleep 2000
WinGet, diablo2_id, ID, A
MsgBox, Second instance set ("%diablo2_id%").
sleep 2000
WinGet, diablo3_id, ID, A
MsgBox, Third instance set ("%diablo3_id%").
Loop {
commandline := ""
if FileExist("commandPC2.txt") {
FileReadLine, commandline, commandPC2.txt, 1
if (commandline != "") {
ControlSend,, %commandline%, ahk_id %diablo2_id%
ControlSend,, %commandline%, ahk_id %diablo3_id%
FileDelete, commandPC2.txt
}
}
}
This is running lagfree for me now. Although at the moment it just opens inventory on all three instances across pc's. With a little work it will be copying skills.
This is it for me today and tomorrow is beta so not sure yet what I want to do with sending mouse clicks.
Inventory spam in action:
Connect With Us