Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <GUIListBox.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <MsgBoxConstants.au3>
- #include <Timers.au3>
- #include <Misc.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1_1 = GUICreate("Markoz Tool", 336, 383, 190, 122)
- $Checkbox1 = GUICtrlCreateCheckbox("Turn on/off", 8, 336, 89, 25)
- $List1 = GUICtrlCreateList("", 8, 32, 121, 123)
- GUICtrlSetData(-1, "")
- $Label1 = GUICtrlCreateLabel("Process List:", 8, 8, 64, 17)
- $Label2 = GUICtrlCreateLabel("Your mouse positions:", 168, 16, 107, 17)
- $XPo = GUICtrlCreateLabel("", 16, 224, 4, 4)
- $YPos = GUICtrlCreateLabel("00", 240, 80, 48, 17)
- $XPos = GUICtrlCreateLabel("00", 168, 80, 48, 17)
- $Label3 = GUICtrlCreateLabel("Key of your amulet:", 16, 176, 94, 17)
- $amuletKeyInput = GUICtrlCreateInput("{F1}", 16, 208, 81, 21)
- $Label4 = GUICtrlCreateLabel("Mouse position to scan:", 160, 112, 116, 17)
- $XAmuletPos = GUICtrlCreateInput("00", 160, 176, 41, 21)
- $YAmuletPos = GUICtrlCreateInput("00", 224, 176, 49, 21)
- $X = GUICtrlCreateLabel("X", 168, 48, 27, 17)
- $Y = GUICtrlCreateLabel("Y", 232, 48, 11, 17)
- $ScanX = GUICtrlCreateLabel("ScanX", 160, 144, 36, 17)
- $ScanY = GUICtrlCreateLabel("ScanY", 224, 144, 36, 17)
- $Button1 = GUICtrlCreateButton("Take Pixel Without Amulet", 120, 288, 137, 25)
- $AmuletColorID = GUICtrlCreateLabel("ID of a color", 264, 296, 62, 17)
- $Label5 = GUICtrlCreateLabel("Key delay", 144, 344, 82, 17)
- $delay = GUICtrlCreateInput("200", 240, 344, 81, 21)
- $Label6 = GUICtrlCreateLabel("Amulet", 280, 176, 44, 25)
- $XRingPos = GUICtrlCreateInput("00", 160, 216, 41, 21)
- $YRingPos = GUICtrlCreateInput("00", 224, 216, 49, 21)
- $Label7 = GUICtrlCreateLabel("Ring", 280, 216, 34, 17)
- $RingColorID = GUICtrlCreateLabel("ID of a color", 264, 256, 62, 17)
- $Button2 = GUICtrlCreateButton("Take a Pixel Without Ring", 120, 248, 137, 25)
- $Label8 = GUICtrlCreateLabel("Key of your ring:", 16, 248, 88, 17)
- $ringKeyInput = GUICtrlCreateInput("{F2}", 16, 280, 73, 21)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- DllOpen("user32.dll")
- global $procID = 0
- global $on = false
- global $hDLL = DllOpen("user32.dll")
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- DllClose($hDLL)
- GUIDelete()
- Exit
- Case $Button1:
- GetPixelColorAmulet()
- Case $Button2:
- GetPixelColorRing()
- Case $Checkbox1:
- $on = not $on
- EndSwitch
- hideShow()
- mouse()
- procList()
- if $on and $procID > 0 then
- MainFunc()
- EndIf
- WEnd
- Func mouse()
- local $m = MouseGetPos()
- if GUICtrlRead($Xpos) <> $m[0] or GUICtrlRead($Ypos) <> $m[1] then
- GUICtrlSetData($XPos,$m[0])
- GUICtrlSetData($YPos,$m[1])
- EndIf
- EndFunc
- Func hideShow()
- $windowName = "Markoz Tool"
- If _IsPressed("2E", $hDLL) Then
- WinSetState($windowName, "", @SW_SHOW)
- ElseIf _IsPressed("23", $hDLL) Then
- WinSetState($windowName, "", @SW_HIDE)
- EndIf
- EndFunc
- Func GetPixelColorAmulet()
- $handle = _GetHwndFromPID($procID)
- $xAmulet = GUICtrlRead($XAmuletPos)
- $yAmulet = GUICtrlRead($YAmuletPos)
- $valueAmulet = PixelGetColor($xAmulet, $yAmulet,$handle)
- GUICtrlSetData($AmuletColorID,$valueAmulet)
- EndFunc
- Func GetPixelColorRing()
- $handle = _GetHwndFromPID($procID)
- $xRing = GUICtrlRead($xRingPos)
- $yRing = GUICtrlRead($YRingPos)
- $valueRing = PixelGetColor($xRing, $yRing,$handle)
- GUICtrlSetData($RingColorID,$valueRing)
- EndFunc
- Func procList()
- local $process = "client.exe"
- local $aProcessList = ProcessList($process)
- For $i = 1 To $aProcessList[0][0]
- $procID = $aProcessList[$i][1]
- GUICtrlSetData($List1,$aProcessList[$i][0] & " " & $aProcessList[$i][1])
- Next
- If ProcessExists($process) == 0 then
- GUICtrlSetData($List1,"")
- EndIf
- EndFunc
- Func MainFunc()
- local $handle = _GetHwndFromPID($procID)
- $delaySleep = GUICtrlRead($delay)
- $keyAmulet = GUICtrlRead($amuletKeyInput)
- $keyRing = GUICtrlRead($ringKeyInput)
- $colorNowAmulet = PixelGetColor(GUICtrlRead($XAmuletPos),GUICtrlRead($YAmuletPos),$handle)
- $colorNowRing = PixelGetColor(GUICtrlRead($XRingPos),GUICtrlRead($YRingPos),$handle)
- $colorNoAmulet = GUICtrlRead($AmuletColorID)
- $colorNoRing = GUICtrlRead($RingColorID)
- If $colorNowRing == $colorNoRing then
- ControlSend($handle,"","",$keyRing)
- Sleep($delaySleep)
- EndIf
- If $colorNowAmulet == $colorNoAmulet then
- ControlSend($handle,"","",$keyAmulet)
- Sleep($delaySleep)
- EndIf
- EndFunc
- Func _GetHwndFromPID($PID)
- $hWnd = 0
- $winlist = WinList()
- Do
- For $i = 1 To $winlist[0][0]
- If $winlist[$i][0] <> "" Then
- $iPID2 = WinGetProcess($winlist[$i][1])
- If $iPID2 = $PID Then
- $hWnd = $winlist[$i][1]
- ExitLoop
- EndIf
- EndIf
- Next
- Until $hWnd <> 0
- Return $hWnd
- EndFunc ;==>_GetHwndFromPID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement