Advertisement
Guest User

Untitled

a guest
Mar 6th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 4.82 KB | None | 0 0
  1. #include <UDFb64.au3>
  2. #include <md5.au3>
  3. #include <ButtonConstants.au3>
  4. #include <GUIConstantsEx.au3>
  5. #include <WindowsConstants.au3>
  6. #include <MsgBoxConstants.au3>
  7. #include <StringConstants.au3>
  8. HotKeySet("{F4}", "exitt")
  9. HotKeySet("{F3}", "scaner")
  10. $mapa = inputBox("mapa","localização atual","0,0")
  11. HotKeySet("{up}", "cima")
  12. HotKeySet("{down}", "baixo")
  13. HotKeySet("{left}", "esquerda")
  14. HotKeySet("{right}", "direita")
  15.  
  16. HotKeySet("{NUMPAD8}", "cima1")
  17. HotKeySet("{NUMPAD2}", "baixo1")
  18. HotKeySet("{NUMPAD4}", "esquerda1")
  19. HotKeySet("{NUMPAD6}", "direita1")
  20.  
  21.  $mapax = StringSplit($mapa, ',', $STR_ENTIRESPLIT)[1]
  22.  $mapay = StringSplit($mapa, ',', $STR_ENTIRESPLIT)[2]
  23.  
  24. $file = "trajeto.AU3"
  25.  
  26. func exitt()
  27.     Exit
  28.  EndFunc
  29.  
  30. func cima1()
  31. $mapay -=1
  32. GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  33. EndFunc
  34. func baixo1()
  35. $mapay +=1
  36. GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  37. EndFunc
  38. func esquerda1()
  39. $mapax -=1
  40. GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  41. EndFunc
  42. func direita1()
  43. $mapax +=1
  44. GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  45. EndFunc
  46.  
  47.  func scaner()
  48.  
  49.    $scaner1posx = "322"
  50.    $scaner1posy = "109"
  51.    $scaner1 = PixelGetColor($scaner1posx,$scaner1posy)
  52.    MouseMove($scaner1posx,$scaner1posy,3)
  53.  
  54.    $scaner2posx = "985"
  55.    $scaner2posy= "196"
  56.    $scaner2 = PixelGetColor($scaner2posx,$scaner2posy)
  57.    MouseMove($scaner2posx,$scaner2posy,3)
  58.  
  59.    $scaner3posx = "1094"
  60.    $scaner3posy = "797"
  61.    $scaner3 = PixelGetColor($scaner3posx,$scaner3posy)
  62.    MouseMove($scaner3posx,$scaner3posy,3)
  63.  
  64.    $scaner4posx = "417"
  65.    $scaner4posy =  "828"
  66.    $scaner4 = PixelGetColor($scaner4posx,$scaner4posy)
  67.    MouseMove($scaner4posx,$scaner4posy,3)
  68.  
  69.    $scaner5posx = "656"
  70.    $scaner5posy =  "539"
  71.    $scaner5 = PixelGetColor($scaner5posx,$scaner5posy)
  72.    MouseMove($scaner5posx,$scaner5posy,3)
  73.  
  74.  ;  $mapa = inputBox("mapa","localização atual",$mapax & "," & $mapay)
  75.  
  76.    $celula1 = $scaner1posx &" "& $scaner1posy  &" "&  hex($scaner1) &" "
  77.    $celula2 = $scaner2posx &" "& $scaner2posy  &" "&  hex($scaner2) &" "
  78.    $celula3 = $scaner3posx &" "& $scaner3posy  &" "&  hex($scaner3) &" "
  79.    $celula4 = $scaner4posx &" "& $scaner4posy  &" "&  hex($scaner4) &" "
  80.    $celula5 = $scaner5posx &" "& $scaner5posy  &" "&  hex($scaner5) &" "
  81. $mapa  = $mapax & "," & $mapay
  82. $mapaencriptado = MD5($celula1&$celula2&$celula3&$celula4&$celula5)
  83. $file3 = FileOpen("trajeto.AU3", 0)
  84. $read = FileRead($file3)
  85.     If StringRegExp($read, $mapaencriptado) Then
  86.        ConsoleWrite("Nao gravado"& @LF)
  87.    Else
  88. ConsoleWrite($mapaencriptado & @LF)
  89. ConsoleWrite($mapax & "," & $mapay & @LF)
  90. Filewriteline($file,$mapaencriptado & @LF&$mapa )
  91. ;$file2 = StringSplit(FileReadLine("trajeto.au3", 2), ',', $STR_ENTIRESPLIT)[1]
  92. ;ConsoleWrite($file2)
  93.  
  94.        ConsoleWrite("Gravado"& @LF)
  95.     EndIf
  96.  
  97. FileClose($file)
  98. EndFunc
  99.  
  100. func cima()
  101. $gera = Random(1,2,1)
  102. if $gera = 1 then
  103. $cima =  MouseClick("left",Random(122,600,1),Random(38,41,1),1)
  104. elseif $gera = 2 then
  105.   $cima = MouseClick("left",Random(600,1000,1),Random(38,41,1),1)
  106. Endif
  107. ;Filewriteline($file,"cima")
  108. $mapay -=1
  109. GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  110. EndFunc
  111.  
  112. func baixo()
  113. $gera = Random(1,2,1)
  114. if $gera = 1 then
  115.    $baixo =  MouseClick("left",Random(122,600,1),855,1)
  116. elseif $gera = 2 then
  117.   $baixo =  MouseClick("left",Random(600,1000,1),855)
  118.   Endif
  119. ;Filewriteline($file,"baixo")
  120. $mapay +=1
  121. GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  122. EndFunc
  123.  
  124. func esquerda()
  125. $gera = Random(1,2,1)
  126. if $gera = 1 then
  127.    $esquerda = MouseClick("left",Random(72,75,1),Random(50,400,1),1)
  128. elseif $gera = 2 then
  129.     $esquerda =  MouseClick("left",Random(72,75,1),Random(400,750,1),1)
  130. Endif
  131. ;Filewriteline($file,"esquerda")
  132. $mapax -=1
  133. GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  134. EndFunc
  135.  
  136. func direita()
  137. $gera = Random(1,2,1)
  138. if $gera = 1 then
  139.      $direita = MouseClick("left",1265,Random(50,400,1),1)
  140. elseif $gera = 2 then
  141.   $direita =   MouseClick("left",1265,Random(400,750,1),1)
  142. Endif
  143. ;Filewriteline($file,"direita")
  144. $mapax +=1
  145. GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  146.  EndFunc
  147.  
  148. #Region ### START Design ### Form=
  149. $map = GUICreate("scanner de mapas", 264, 90, 549, 698,-1,BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
  150. $bt1 = GUICtrlCreateButton("cima", 96, 8, 75, 25)
  151. $bt2 = GUICtrlCreateButton("baixo", 96, 56, 75, 25)
  152. $bt3 = GUICtrlCreateButton("esquerda", 16, 32, 75, 25)
  153. $bt4 = GUICtrlCreateButton("direita", 176, 32, 75, 25)
  154. $Label1 = GUICtrlCreateLabel($mapax & "," & $mapay, 192, 64, 51, 17)
  155. GUISetState(@SW_SHOW)
  156. #EndRegion ### END Design ###
  157.  
  158. While 1
  159.     $nMsg = GUIGetMsg()
  160.     Switch $nMsg
  161.         Case $GUI_EVENT_CLOSE
  162.             Exit
  163.         Case $bt1
  164. cima()
  165.         Case $bt2
  166. baixo()
  167.         Case $bt3
  168. esquerda()
  169.         Case $bt4
  170. direita()
  171.     EndSwitch
  172.     sleep(10)
  173.     GUICtrlSetData($Label1 ,$mapax & "," & $mapay)
  174. WEnd
  175.  
  176. ;~ While 1
  177. ;~    Sleep(100)
  178. ;~    WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement