Spoiler
I started today working on a diablo 2 multibox script (preparing for D2R) and wonder if people have some ideas on it.
I want to multibox 3 clients on 2 seperate PC's.
So far I have the script working for keycloning as well as mouse left click cloning. I use 4 scripts total, 2 for each system. (One is a continuous loop, the other a remap script)
PC 1 runs one client, PC 2 runs two clients
PC 1 Script 1:
PC 1 Script 2
PC 2 Script 1
PC 2 Script 2
On both machines I have shared a local folder named ' shared' with full permissions in which these scripts reside. The script uses txt file creation to communicate across network. The PC 1's scripts have to be on the local shared folder on PC1 and PC2 scripts on PC2's local folder to avoid network lag.
The weird keypress variable addition is to make sure the variable is long, so I can easily test wether to simply clone a key or to get mouse position from the string.
The mouse cloning only works if you run all three instances in the same resolution/scaling.
I need to add something to choose when to clone mouse and with whom as obviously the characters quickly get seperated as of now, but it's still early days. Right now, it constantly clones the mouse.
I also need to initiate the window variables by activating the window after starting the scripts and waiting for message box, but I haven't found a good way yet to accurately target each window using anything other than "ahk_id".
(I use input director and soundit to network mouse, keyboard and sound over network to allow me to easily change to and main another instance)
What I got so far works like a charm for me though. Already so excited to run a 3-box in D2R on hardcore. (I'm not a masochist, really)
I want to multibox 3 clients on 2 seperate PC's.
So far I have the script working for keycloning as well as mouse left click cloning. I use 4 scripts total, 2 for each system. (One is a continuous loop, the other a remap script)
PC 1 runs one client, PC 2 runs two clients
PC 1 Script 1:
Code: Select all
#NoEnv
sleep 2000
WinGet, diablo1_id, ID, A
MsgBox, First instance set ("%diablo1_id%").
$c::
IfWinActive, ahk_id %diablo1_id%
{
keypress := "c"
FileAppend, %keypress%, commandPC1.txt
FileAppend, %keypress%, \\PC2\shared\commandPC2.txt
} else {
Send c
}
return
$NumpadSub::
ExitApp
return
#If WinActive("ahk_id "diablo1_id)
LButton::
CoordMode, Mouse, Relative
MouseGetPos, xpos, ypos
keypress := "123456789012345 " xpos " " ypos
FileAppend, %keypress%, commandPC1.txt
FileAppend, %keypress%, \\PC2\shared\commandPC2.txt
keypress := ""
xpos := ""
ypos := ""
return
Code: Select all
#NoEnv
SetControlDelay -1
CoordMode, Mouse, Relative
sleep 2000
WinGet, diablo1_id, ID, A
MsgBox, First instance set ("%diablo1_id%").
Loop {
if FileExist("commandPC1.txt") {
FileReadLine, commandline, commandPC1.txt, 1
StringLen, Length, commandline
if (commandline != "") {
if (Length >= 15) {
StringSplit, pos_array, commandline, %A_Space%
ControlClick, x%pos_array2% y%pos_array3%, ahk_id %diablo1_id%,, LEFT
FileDelete, commandPC1.txt
} else {
ControlSend,, %commandline%, ahk_id %diablo1_id%
FileDelete, commandPC1.txt
}
}
commandline := ""
pos_array := ""
}
}
Code: Select all
#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%, \\PC1\shared\commandPC1.txt
FileAppend, %keypress%, commandPC2.txt
}
else IfWinActive, ahk_id %diablo3_id%
{
keypress := "c"
FileAppend, %keypress%, \\PC1\shared\commandPC1.txt
FileAppend, %keypress%, commandPC2.txt
} else {
send c
}
return
$NumpadSub::
ExitApp
return
#If WinActive("ahk_id "diablo2_id)
LButton::
CoordMode, Mouse, Relative
MouseGetPos, xpos, ypos
keypress := "123456789012345 " xpos " " ypos
FileAppend, %keypress%, \\PC1\shared\commandPC1.txt
FileAppend, %keypress%, commandPC2.txt
keypress := ""
xpos := ""
ypos := ""
return
#If WinActive("ahk_id "diablo3_id)
LButton::
CoordMode, Mouse, Relative
MouseGetPos, xpos, ypos
keypress := "123456789012345 " xpos " " ypos
FileAppend, %keypress%, \\PC1\shared\commandPC1.txt
FileAppend, %keypress%, commandPC2.txt
keypress := ""
xpos := ""
ypos := ""
return
Code: Select all
#NoEnv
SetControlDelay -1
CoordMode, Mouse, Relative
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 {
if FileExist("commandPC2.txt") {
FileReadLine, commandline, commandPC2.txt, 1
StringLen, Length, commandline
if (commandline != "") {
if (Length >= 15) {
StringSplit, pos_array, commandline, %A_Space%
ControlClick, x%pos_array2% y%pos_array3%, ahk_id %diablo2_id%,, LEFT
ControlClick, x%pos_array2% y%pos_array3%, ahk_id %diablo3_id%,, LEFT
FileDelete, commandPC2.txt
} else {
ControlSend,, %commandline%, ahk_id %diablo2_id%
ControlSend,, %commandline%, ahk_id %diablo3_id%
FileDelete, commandPC2.txt
}
}
commandline := ""
pos_array := ""
}
}
The weird keypress variable addition is to make sure the variable is long, so I can easily test wether to simply clone a key or to get mouse position from the string.
The mouse cloning only works if you run all three instances in the same resolution/scaling.
I need to add something to choose when to clone mouse and with whom as obviously the characters quickly get seperated as of now, but it's still early days. Right now, it constantly clones the mouse.
I also need to initiate the window variables by activating the window after starting the scripts and waiting for message box, but I haven't found a good way yet to accurately target each window using anything other than "ahk_id".
(I use input director and soundit to network mouse, keyboard and sound over network to allow me to easily change to and main another instance)
What I got so far works like a charm for me though. Already so excited to run a 3-box in D2R on hardcore. (I'm not a masochist, really)