Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.33 KB | None | 0 0
  1. ;Escrito por: Bid Magaveta
  2. ;Data da criação: 03/08/2018
  3. ;Data da ultima atualização: 03/08/2018
  4.  
  5. #SingleInstance, Force
  6. SetWorkingDir %A_ScriptDir%
  7. CoordMode, Mouse, Screen
  8. SetMouseDelay, -1
  9. Weapons := 0
  10. Weapons_Used := 0
  11. Stop := 0
  12. Target_Window:=null
  13. Gui, 1:+AlwaysOnTop
  14. Gui, Color, White, Black
  15.  
  16. ;FileInstall, Dummy.png, %A_ScriptDir%\Dummy.png, 0
  17. ;FileInstall, Weapon.png, %A_ScriptDir%\Weapon.png, 0
  18.  
  19. Gui Add, GroupBox, x18 y8 w416 h129, Janela
  20. Gui Add, Button, x152 y24 w148 h23 gSet_Target_Window, Selecionar Janela
  21. Gui Add, Edit, cWhite x188 y82 w211 h21 Center vTarget_Window
  22. Gui Add, Text, x52 y80 w100 h23 +0x200, Janela Selecionada
  23. Gui Add, GroupBox, x18 y136 w416 h231, Seleção
  24.  
  25. ;Gui Add, Picture, x52 y152 w131 h131, %A_ScriptDir%/Dummy.png
  26. Gui Add, Button, x52 y318 w131 h35 vSet_Click_Target gSet_Fixed_Location, Selecionar Dummy
  27. Gui Add, Edit, cWhite x52 y288 w131 h21 Center vTarget_Spot
  28.  
  29. ;Gui Add, Picture, x268 y152 w131 h131, %A_ScriptDir%/Weapon.png
  30. Gui Add, Button, x268 y320 w131 h35 vSet_Click_Target2 gSet_Fixed_Location2, Selecionar Arma
  31. Gui Add, Edit, cWhite x268 y288 w131 h21 Center vTarget_Spot2
  32.  
  33. Gui Add, GroupBox, x18 y367 w416 h140, Opções do treino
  34. Gui Add, Text, x32 y409 w75 h23 +0x200, Qtd. de armas
  35. Gui Add, Edit, cWhite x117 y412 w120 h21 Center vWeapons gSubmit_All,% Weapons
  36. Gui Add, Text, x32 y465 w75 h23 +0x200, Armas Usadas
  37. Gui Add, Edit, cWhite x117 y467 w120 h21 Center vWeapons_Used, % Weapons_Used
  38.  
  39. Gui Add, GroupBox, x268 y388 w148 h100, Hotkey
  40. Gui Add, Hotkey, x299 y412 w85 h21 vHK Center
  41. Gui Add, CheckBox, x315 y452 w55 h23 vCB gSet_Checkbox, Ativar
  42. Gui, Show,, Dynamic Hotkeys
  43.  
  44. Gui Add, GroupBox, x18 y508 w416 h61
  45. Gui Add, Button, x52 y529 w132 h23 gStart_Train, Iniciar
  46. Gui Add, Button, x265 y529 w134 h23 gStop_Train, Parar
  47.  
  48. Gui Show, w453 h599, Skill Trainer
  49. Gui, Submit, NoHide
  50.  
  51. GuiControl, Disable, Weapons_Used
  52.  
  53. Return
  54.  
  55. GuiClose:
  56. ExitApp
  57.  
  58. ; Do not edit above this line
  59.  
  60. GuiControl, Disable, Weapons_Used
  61. Submit_All:
  62. Gui, Submit, NoHide
  63. return
  64. ;Pause:
  65. ; Pause
  66. Set_Target_Window:
  67. isPressed:=0
  68. i:= 0
  69. Loop
  70. {
  71. Left_Mouse:=GetKeyState("LButton")
  72. WinGetTitle,Temp_Window,A
  73. ToolTip, Aperte 2x o botão esquerdo do mouse na janela: %Temp_Window%
  74. if(Left_Mouse==False&&isPressed==0)
  75. isPressed:=1
  76. else if(Left_Mouse==True&&isPressed==1)
  77. {
  78. i++
  79. isPressed:=0
  80. if(i>=2)
  81. {
  82. WinGetTitle,Target_Window,A
  83. ToolTip,
  84. break
  85. }
  86. }
  87. }
  88. GuiControl,1:,Target_Window,% Target_Window
  89. return
  90. Set_Fixed_Location:
  91. ;Stop:=1
  92. Get_Click_Pos(Fixed_X,Fixed_Y)
  93. GuiControl,1:, Target_Spot, X = %Fixed_X% Y = %Fixed_Y%
  94. return
  95. Set_Fixed_Location2:
  96. ;Stop:=1
  97. Get_Click_Pos2(Fixed_X2,Fixed_Y2)
  98. GuiControl,1:,Target_Spot2,X = %Fixed_X2% Y = %Fixed_Y2%
  99. return
  100. Set_Checkbox:
  101. Gui, Submit, NoHide
  102. If CB
  103. GuiControl, Disable, Target_Spot2
  104. else
  105. GuiControl, Enable, Target_Spot2
  106. return
  107. Start_Train:
  108. Stop:= 0
  109. WinActivate, %Target_Window%
  110. Gui, Submit, NoHide
  111. if(Target_Window==null)
  112. {
  113. MsgBox, 262192, Missing Info,Selecione a Janela do Tibia!
  114. return
  115. }
  116. if(Fixed_X!=null&&Fixed_Y!=null&&Fixed_X2!=null&&Fixed_Y2!=null&&CB=1)
  117. {
  118. Loop
  119. {
  120. if(Stop==1||Weapons_Used==Weapons)
  121. {
  122. MsgBox, Você terminou seu treino e usou %Weapons_Used% armas.
  123. break
  124. }
  125. WinActivate, %Target_Window%
  126. Send, {%HK%}
  127. MouseClick, Left, %Fixed_X%, %Fixed_Y%
  128. Weapons_Used++
  129. Sleep, 300
  130. Send, !{Esc}
  131. Sleep, 1010000
  132. GuiControl,1:, Weapons_Used, % Weapons_Used
  133. }
  134. }
  135. else if (Fixed_X!=null&&Fixed_Y!=null&&Fixed_X2!=null&&Fixed_Y2!=null&&CB=0)
  136. {
  137. Loop
  138. {
  139. if(Stop==1||Weapons_Used==Weapons)
  140. {
  141. MsgBox, Você terminou seu treino e usou %Weapons_Used% armas.
  142. break
  143. }
  144. WinActivate, %Target_Window%
  145. MouseClick, Right, %Fixed_X2%, %Fixed_Y2%
  146. Sleep, 500
  147. MouseClick, Left, %Fixed_X%, %Fixed_Y%
  148. Weapons_Used++
  149. Sleep, 300
  150. Send, !{Esc}
  151. Sleep, 1010000
  152. GuiControl,1:, Weapons_Used, % Weapons_Used
  153. ;Sleep, 1010000
  154. }
  155. }
  156. return
  157. Stop_Train:
  158. Weapons_Used:=0
  159. GuiControl,1:,Weapons_Used,% Weapons_Used
  160. Stop:=1
  161. return
  162.  
  163. Get_Click_Pos(ByRef X,ByRef Y)
  164. {
  165. isPressed:=0
  166. i:=0
  167. Loop
  168. {
  169. Left_Mouse:=GetKeyState("Alt")
  170. MouseGetPos,X,Y,
  171. ToolTip,Aperte Alt no SQM do Dummy `n`nCurrent Location: `nX = %X%`nY = %Y%
  172. if(Left_Mouse==False&&isPressed==0)
  173. isPressed:=1
  174. else if(Left_Mouse==True&&isPressed==1)
  175. {
  176. MouseGetPos,X,Y,
  177. ToolTip,
  178. break
  179. }
  180. }
  181. }
  182. Get_Click_Pos2(ByRef X,ByRef Y)
  183. {
  184. isPressed:=0
  185. i:=0
  186. Loop
  187. {
  188. Left_Mouse:=GetKeyState("Alt")
  189. MouseGetPos,X,Y,
  190. ToolTip,Aperte Alt no SQM da Arma `n`nCurrent Location: `nX = %X%`nY = %Y%
  191. if(Left_Mouse==False&&isPressed==0)
  192. isPressed:=1
  193. else if(Left_Mouse==True&&isPressed==1)
  194. {
  195. MouseGetPos,X,Y,
  196. ToolTip,
  197. break
  198. }
  199. }
  200. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement