Advertisement
Guest User

Picktechies 0.1

a guest
Sep 5th, 2014
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.56 KB | None | 0 0
  1. #include <MsgBoxConstants.au3>
  2. #include <GUIConstantsEx.au3>
  3. Opt("WinTitleMatchMode", 3)
  4. Opt("TrayAutoPause", 0)
  5. Opt("TrayMenuMode", 3)
  6. Opt("TrayOnEventMode", 1)
  7. HotKeySet("{PgDn}", "toggle")
  8.  
  9.  
  10.  
  11. Local $bluePlayer = [0.10885, 0.094]
  12. Local $lockIn = [0.5, 0.724074]
  13. $searching = False
  14. $pixelColor = 0
  15. $screenSize = WinGetClientSize ("DOTA 2")
  16. $windowPos = WinGetPos("DOTA 2")
  17. $heroName = "tec"
  18. $yInt = 0
  19. $xSearch = 0
  20. $ySearch = 0
  21.  
  22.  
  23.  
  24. TrayCreateItem("Restore")
  25. TrayItemSetOnEvent(-1, "restore")
  26. TrayCreateItem("")
  27. TrayCreateItem("Exit")
  28. TrayItemSetOnEvent(-1, "exitScript")
  29.  
  30.  
  31.  
  32. $hGUI = GUICreate("PickTechies 0.1", 200, 70)
  33. $idLabel = GUICtrlCreateLabel("Aspect Ratio:", 35, 10, 70)
  34. $idComboBox = GUICtrlCreateCombo("16:9", 105, 6, 60, 20, 0x0003)
  35. $idHide = GUICtrlCreateButton("Hide", 10, 35, 85, 25)
  36. $idExit = GUICtrlCreateButton("Exit", 105, 35, 85, 25)
  37. GUICtrlSetData($idComboBox, "16:10|4:3", "16:9")
  38. $sComboRead = ""
  39.  
  40. GUISetState(@SW_SHOW, $hGUI)
  41.  
  42.  
  43.  
  44. Func toggle()
  45.  
  46.    If WinExists("DOTA 2") Then
  47.       $screenSize = WinGetClientSize ("DOTA 2")
  48.       $windowPos = WinGetPos("DOTA 2")
  49.       $searching = Not($searching)
  50.       ToolTip("")
  51.     Else
  52.         MsgBox($MB_SYSTEMMODAL, "Error", "Start DOTA2 first!")
  53.     EndIf
  54.  
  55.  EndFunc
  56.  
  57.  
  58.  
  59. Func restore()
  60.  
  61.     GUISetState(@SW_SHOW, $hGUI)
  62.  
  63.  EndFunc
  64.  
  65.  
  66.  
  67. Func exitScript()
  68.  
  69.     Exit
  70.  
  71.  EndFunc
  72.  
  73.  
  74.  
  75. Func aspectSwitch()
  76.  
  77.     If $sComboRead = "16:9" Then
  78.        $bluePlayer[0] = 0.10885
  79.     ElseIf $sComboRead = "16:10" Then
  80.        $bluePlayer[0] = 0.09642
  81.     ElseIf $sComboRead = "4:3" Then
  82.        $bluePlayer[0] = 0.068125
  83.     EndIf
  84.  
  85.  EndFunc
  86.  
  87.  
  88.  
  89. While(1)
  90.  
  91.     Switch GUIGetMsg()
  92.       Case $GUI_EVENT_CLOSE, $idExit
  93.           Exit
  94.  
  95.       Case $idHide
  96.           GUISetState(@SW_HIDE, $hGUI)
  97.  
  98.       Case $idComboBox
  99.           $sComboRead = GUICtrlRead($idComboBox)
  100.           aspectSwitch()
  101.  
  102.      EndSwitch
  103.  
  104.     If $searching = True Then
  105.        $yInt = Mod ($yInt + 1, 20)
  106.        $xSearch = $windowPos[0] + Ceiling(($bluePlayer[0] * $screenSize[0]))
  107.        $ySearch = $windowPos[1] + Ceiling(($bluePlayer[1] * $screenSize[1]) + $yInt - 10)
  108.        $pixelColor = PixelGetColor($xSearch, $ySearch)
  109.        ToolTip("Searching, pixel color: " & $pixelColor, $windowPos[0] + ($screenSize[0] * 0.5), $windowPos[1] + ($screenSize[1] * 0.5))
  110.        If $pixelColor > 3200000 And $pixelColor < 3400000 Then
  111.           Sleep(250)
  112.           Send($heroName)
  113.           Sleep(250)
  114.           MouseClick("left", ($windowPos[0] + $lockIn[0] * $screenSize[0]), ($windowPos[1] + $lockIn[1] * $screenSize[1]), 10, 1)
  115.           $searching = False
  116.           ToolTip("")
  117.         EndIf
  118.      EndIf
  119.  
  120.    Sleep(50)
  121.  
  122.  WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement