I have not lost one yet, but could just be the connection and I feel generous today so here is what I hacked together a couple hours ago you are going to have to customize it to your situation yourself though:
~RButton::Pause, Toggle
':: WinGet, hwndTS2, id,Dungeons and Dragons Online if hwndTS2 = { MsgBox Game is not running. Exit } DllCall("GetWindowThreadProcessId", "int", hwndTS2, "UInt *", PID, "UInt") if (ErrorLevel or !PID) { MsgBox GetWindowThreadProcessId failed. Exit } ProcessHandle := DllCall("OpenProcess", "int", 24, "char", 0, "UInt", PID, "UInt") if (ErrorLevel or !ProcessHandle) { MsgBox OpenProcess failed. Exit } WinActivate, Dungeons and Dragons Online ahk_class Turbine Device Class SetFormat, Float, 0.2 ADDRESSY = 0x01807684 ADDRESSX = 0x01807680 DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", ADDRESSX, "Float*", X, "Uint", 4, "Uint*", 0) DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", ADDRESSY, "Float*", Y, "Uint", 4, "Uint*", 0) WinGetPos, x, y, width, height, Dungeons and Dragons Online Loop 10 { targetX = -31.30 targetY = -740.76 While (X != targetX) { if (X > targetX - 0.3 && X < targetX + 0.3) { send {w up} send {s up} break } If (X > targetX) { send {w down} sleep 1 send {w up} } If (X < targetX) { send {s down} sleep 1 send {s up} }
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", ADDRESSX, "Float*", X, "Uint", 4, "Uint*", 0) } While (Y != targetY) { if (Y > targetY - 0.3 && Y < targetY + 0.3) { send {, up} send {. up} break } If (Y > targetY) { send {, down} sleep 1 send {, up} } If (Y < targetY) { send {. down} sleep 1 send {. up} }
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", ADDRESSY, "Float*", Y, "Uint", 4, "Uint*", 0) } send {1} Click 830 680 sleep 100 Click 830 680 sleep 3000 Click 870 680 sleep 100 Click 870 680 sleep 600 Send, {q} sleep, 400 Send, {e} while (1=1) { ImageSearch, PX,PY,0,0, %width%, %height%, *60 c:\ddobot\SharedBank.png if ErrorLevel = 0 { Break } } sleep, 600 RunWait, %comspec% /c "netsh interface set interface name="Local Area Connection" admin=disabled" sleep, 700 SendEvent {Click 830 680, down}{Click 44 138, up} sleep 600 SendEvent {Click 870 680, down}{Click 44 138, up} sleep 600 send {escape} sleep 600 while (1=1) { ImageSearch, PX,PY,0,0, %width%, %height%, *60 c:\ddobot\Yes.png if ErrorLevel = 0 { Click %PX%, %PY% sleep 600 Click %PX%, %PY% Break } } sleep 600 Click 200 50 sleep 200 Click 1267 50 sleep 200 Click 1267 50 sleep 200 RunWait, %comspec% /c "netsh interface set interface name="Local Area Connection" admin=enabled" sleep 15000 Send, {q} sleep, 400 Send, {e} while (1=1) { ImageSearch, PX,PY,0,0, %width%, %height%, *60 c:\ddobot\SharedBank.png if ErrorLevel = 0 { Break } } sleep, 600 loop 2 { targetX = -21.17 targetY = -733.91 While (X != targetX) { if (X > targetX - 0.3 && X < targetX + 0.3) { send {w up} send {s up} break } If (X > targetX) { send {w down} sleep 1 send {w up} } If (X < targetX) { send {s down} sleep 1 send {s up} }
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", ADDRESSX, "Float*", X, "Uint", 4, "Uint*", 0) } While (Y != targetY) { if (Y > targetY - 0.3 && Y < targetY + 0.3) { send {, up} send {. up} break } If (Y > targetY) { send {, down} sleep 1 send {, up} } If (Y < targetY) { send {. down} sleep 1 send {. up} }
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", ADDRESSY, "Float*", Y, "Uint", 4, "Uint*", 0) } } sleep 600 Send, {q} sleep, 400 Send, {e} sleep 600 loop 2 { while (1=1) { ImageSearch, PX,PY,0,0, %width%, %height%, *20 c:\ddobot\Unread.png if ErrorLevel = 0 { Click %PX%, %PY% sleep 200 Click %PX%, %PY% Break } } sleep 400 while (1=1) { ImageSearch, PX,PY,0,0, %width%, %height%, *60 c:\ddobot\Detach.png if ErrorLevel = 0 { Click %PX%, %PY% Break } } sleep 600 } sleep 400 targetY = -740.76 While (Y != targetY) { if (Y > targetY - 0.3 && Y < targetY + 0.3) { send {, up} send {. up} break } If (Y > targetY) { send {, down} sleep 1 send {, up} } If (Y < targetY) { send {. down} sleep 1 send {. up} }
DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", ADDRESSY, "Float*", Y, "Uint", 4, "Uint*", 0) } }
|