Advertisement
Guest User

TheFinalGamer's Code

a guest
Jul 2nd, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.14 KB | None | 0 0
  1. #include <ImageSearch2015.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <MsgBoxConstants.au3>
  4. #include <AutoItConstants.au3>
  5. #include <Misc.au3>
  6. #include <WindowsConstants.au3>
  7. $dll = DllOpen("user32.dll")
  8.  
  9. HotKeySet("{F1}", "myExit")
  10. $x = WinActivate("RuneScape")
  11.  
  12. $x1=0
  13. $y1=0
  14. $x = 1
  15. $y = 1
  16. ;~ $picture = "RSettings.png"
  17. $picture = "GSettings.png"
  18. $picture1 = "Rresize.png"
  19. $picture2 = "SetMin.png"
  20. $picture3 = "Close.png"
  21. $picture4 = "Settings.png"
  22. $picture5 = "BottomIron.png"
  23. $picture6 = "Compass.png"
  24. $picture7 = "MiniMapsMap.png"
  25. $picture8 = "IronOre.png"
  26. $picture9 = "IronError.png"
  27. $picture10 = "CompassReset.png"
  28. $picture11 = "Portaln.png"
  29. $picture12 = "Bank.png"
  30. $picture13 = "ExitPortal.png"
  31. $picture14 = "MiningIcon.png"
  32. $picture15 = "BankAll.png"
  33. $picture16 = "ChatBox.png"
  34. $picture17 = "LogBackIn.png"
  35. $picture18 = "LoggingIn.png"
  36. $FindMySelf = False
  37. $CompassResetDone = False
  38. $CompassRight = False
  39. $Statement1 = False
  40. $ResetAll = False
  41. $MiningIcon2 = False
  42. $result6969 = False
  43. $Count = 0
  44.  
  45. $TopLeftx = @DesktopWidth * 0
  46. $TopLefty = @DesktopHeight * 0
  47. $IronTopLeftx = @DesktopWidth / 2.20
  48. $IronTopLefty = @DesktopHeight / 2.45
  49. $IronBottomRightx = @DesktopWidth / 1.85
  50. $IronBottomRighty = @DesktopHeight / 1.6
  51. $Bankingx = @DesktopWidth / 2.4
  52. $Bankingy = @DesktopHeight /2.35
  53. $BankingOutx = @DesktopWidth / 1.777777777
  54. $BankingOuty = @DesktopHeight / 1.66409
  55. $PortalOutWalkx = @DesktopWidth / 2.4489759
  56. $PortalOutWalky = @DesktopHeight / 2.6086956
  57. $timer = TimerInit()
  58. ConsoleWrite($timer)
  59. While (1)
  60. While (1)
  61. RunescapeRestart ()
  62. If $result6969 = True Then
  63. LC($x1,$y1)
  64. MouseMove($IronTopLeftx,$IronTopLefty,1)
  65. ExitLoop
  66. EndIf
  67.  
  68. $waitingtostart = _ImageSearch($picture18,1,$x1,$y1,10,0)
  69. If $waitingtostart = True Then
  70. Do
  71. $waitingtostart = _ImageSearch($picture18,1,$x1,$y1,10,0)
  72. Until $waitingtostart = False
  73. EndIf
  74.  
  75. If $result6969 = False Then
  76.  
  77.  
  78. If $ResetAll = False Then
  79. ResetAllGraphicSetings ()
  80. Else
  81. EndIf
  82. If $CompassResetDone = False Then
  83. FindCompass ()
  84. Else
  85. EndIf
  86.  
  87.  
  88. MouseDragging ()
  89. ;~ If $CompassRight = False Then
  90. ;~ CompassRight ()
  91. ;~ Else
  92. ;~ EndIf
  93.  
  94. If $FindMyself = False Then
  95. FindMySelf ()
  96. Sleep(5000)
  97. EndIf
  98.  
  99.  
  100. BankingGoingIn ()
  101. $result6969 = _ImageSearch($picture17,1,$x1,$y1,10,0)
  102. If $result6969 = True Then
  103. LC($x1,$y1)
  104. ExitLoop
  105. EndIf
  106. Sleep(6200)
  107. BankingAll ()
  108. $result6969 = _ImageSearch($picture17,1,$x1,$y1,10,0)
  109. If $result6969 = True Then
  110. LC($x1,$y1)
  111. ExitLoop
  112. EndIf
  113. Sleep(400)
  114. BankingOut ()
  115. $result6969 = _ImageSearch($picture17,1,$x1,$y1,10,0)
  116. If $result6969 = True Then
  117. LC($x1,$y1)
  118. ExitLoop
  119. EndIf
  120. Sleep(4000)
  121. PortalOutWalk ()
  122. $result6969 = _ImageSearch($picture17,1,$x1,$y1,10,0)
  123. If $result6969 = True Then
  124. LC($x1,$y1)
  125. ExitLoop
  126. EndIf
  127. Sleep(1750)
  128. Chatting ()
  129. Sleep(1000)
  130. MineIron ()
  131. EndIf
  132. WEnd
  133. WEnd
  134. ;~ Func SettingsClick ()
  135. ;~ Do
  136. ;~ $result = _ImageSearch($picture2,1,$x1,$y1,120,0)
  137. ;~ ConsoleWrite($result)
  138. ;~ Until $result = True;
  139. ;~ If $result=1 Then
  140. ;~ MouseMove($x1,$y1,1)
  141. ;~ MouseClick($MOUSE_CLICK_LEFT)
  142. ;~ Else
  143. ;~ MsgBox(0,"msg","Ending")
  144. ;~ EndIf
  145. ;~ EndFunc
  146. ;~ Func ScreenReset ()
  147. ;~ Do
  148. ;~ $result = _ImageSearch($picture,1,$x1,$y1,0,0)
  149. ;~ ConsoleWrite($result)
  150. ;~ Until $result = True;
  151. ;~ If $result=1 Then
  152. ;~ MouseMove($x1,$y1,1)
  153. ;~ MouseClick($MOUSE_CLICK_LEFT)
  154. ;~ Else
  155. ;~ MsgBox(0,"msg","Ending")
  156. ;~ EndIf
  157. ;~ SettingsClick ()
  158. ;~ EndFunc
  159. Func myExit ()
  160. msgbox(0,"Exiting", "You killed me :(")
  161. exit
  162. EndFunc
  163. func LC($x, $y)
  164. MouseClick("left", $x, $y, 1 ,1)
  165. EndFunc
  166. func RC($x, $y)
  167. MouseClick("right", $x, $y, 1 ,1)
  168. EndFunc
  169. Func SetGraphics ()
  170. Do
  171. $result = _ImageSearch($picture,1,$x1,$y1,50,0)
  172. ConsoleWrite($result)
  173. Until $result = True;
  174. If $result=1 Then
  175. MouseMove($x1,$y1,1)
  176. MouseClick($MOUSE_CLICK_LEFT)
  177.  
  178. EndIf
  179.  
  180. EndFunc
  181. Func SetMinSettings ()
  182.  
  183.  
  184. Do
  185. $result = _ImageSearch($picture2,1,$x1,$y1,75,0)
  186. ConsoleWrite($result)
  187. Until $result = True;
  188. If $result=1 Then
  189. MouseMove($x1,$y1,1)
  190. MouseClick($MOUSE_CLICK_LEFT)
  191.  
  192. EndIf
  193.  
  194. EndFunc
  195. Func CloseSettings ()
  196. Do
  197. $result = _ImageSearch($picture3,1,$x1,$y1,10,0)
  198. ConsoleWrite($result)
  199. Until $result = True;
  200. If $result=1 Then
  201. MouseMove($x1,$y1,1)
  202. MouseClick($MOUSE_CLICK_LEFT)
  203. EndIf
  204. EndFunc
  205. Func OpenSettings ()
  206. $result = _ImageSearch($picture4,1,$x1,$y1,10,0)
  207. ;~ ConsoleWrite($result)
  208.  
  209. If $result=1 Then
  210. MouseMove($x1,$y1,1)
  211. MouseClick($MOUSE_CLICK_LEFT)
  212. EndIf
  213. EndFunc
  214. Func FixedScreen ()
  215. Do
  216. $result = _ImageSearch($picture1,1,$x1,$y1,100,0)
  217. ConsoleWrite($result)
  218. Until $result = True;
  219. If $result=1 Then
  220. MouseMove($x1,$y1,1)
  221. MouseClick($MOUSE_CLICK_LEFT)
  222. EndIf
  223. EndFunc
  224. Func ResetAllGraphicSetings ()
  225.  
  226. $ResetAll = False
  227. while(Not($ResetAll))
  228.  
  229.  
  230. WinWaitActive("RuneScape", "", 10)
  231. OpenSettings ()
  232.  
  233. SetGraphics ()
  234.  
  235. SetMinSettings ()
  236.  
  237. FixedScreen ()
  238.  
  239. CloseSettings ()
  240.  
  241. Global $ResetAll = True
  242. WEnd
  243.  
  244. EndFunc
  245. Func MineIron ()
  246. Do
  247. if $Statement1=False Then
  248. Global $pixels = PixelSearch($IronTopLeftx / 1.2,$IronTopLefty / 1.2,$IronBottomRightx * 1.2,$IronBottomRighty * 1.2,0x4E2B19,2)
  249. If Not @error Then
  250. LC($pixels[0],$pixels[1])
  251. Sleep(2200)
  252.  
  253. $result2 = _ImageSearch($picture17,1,$x1,$y1,10,0)
  254.  
  255. Global $Statement1 = _ImageSearch($picture9,1,$x1,$y1,50,0)
  256. If $Statement1 = True Then
  257.  
  258. $Statement1 = True
  259.  
  260. EndIf
  261. If $result2 = True Then
  262. LC($x1,$y1)
  263. EndIf
  264.  
  265. EndIf
  266.  
  267. ElseIf $Statement1=True Then
  268.  
  269. EndIf
  270.  
  271.  
  272. Until $Statement1 = True or $result2 = True
  273. EndFunc
  274. ;~ Func CompassRight ()
  275. ;~ Global $CompassRight = False
  276. ;~ $i3 = 0
  277. ;~ Send("{PGDN down}")
  278. ;~ Send("{UP down}")
  279. ;~ sleep(500)
  280. ;~ Send("{PGDN UP}")
  281. ;~ Send("{UP UP}")
  282.  
  283. ;~ If $CompassRight = False Then
  284. ;~ Do
  285. ;~ $result = _ImageSearch($picture10,1,$x1,$y1,10,0)
  286. ;~ If $result = False Then
  287. ;~ $SendingRight = Send("{RIGHT}")
  288. ;~ Sleep(500)
  289. ;~ ElseIf $result = True Then
  290. ;~ Global $CompassRight = True
  291. ;~ EndIf
  292. ;~ Until $CompassRight = True
  293. ;~ endif
  294. ;~ EndFunc
  295. Func FindCompass ()
  296. $CompassResetDone = False
  297. while(Not($CompassResetDone))
  298. $result = _ImageSearch($picture7,1,$x1,$y1,150,0)
  299. ;~ConsoleWrite($result)
  300. MouseMove($x1,$y1,1)
  301. $position = MouseGetPos()
  302. Global $compasspositionx = $position[0]
  303. Global $compasspositiony = $position[1]
  304. Global $RcCompassx = $compasspositionx
  305. Global $RcCompassy = $compasspositiony / 0.56
  306. ;~ ConsoleWrite(".......")
  307. ;~ ConsoleWrite($RcCompassy)
  308. ;~ ConsoleWrite(".......")
  309. ;~ ConsoleWrite($RcCompassx)
  310. ;~ ConsoleWrite(".......")
  311. Global $LcCompassx = $RcCompassx + 1
  312. Global $LcCompassy = $RcCompassy / 0.65
  313. RC($compasspositionx,$RcCompassy)
  314. LC($LcCompassx,$LcCompassy)
  315. if Not @error Then
  316. Global $CompassResetDone = True
  317. EndIf
  318. WEnd
  319. EndFunc
  320. Func FindChatArea ()
  321.  
  322.  
  323.  
  324. EndFunc
  325. Func BankingGoingIn ()
  326. $BankIn1 = False
  327. while(Not($BankIn1))
  328. $BankIn = PixelSearch($TopLeftx,$TopLefty,@DesktopWidth,@DesktopHeight,0xE0270F,1)
  329. if NOT(@error) Then
  330. LC($BankIn[0],$BankIn[1])
  331. Sleep(4500)
  332. EndIf
  333. $BankInBlocks = PixelSearch($TopLefty,$TopLeftx,@DesktopWidth,@DesktopHeight,0x808688,10)
  334. if NOT(@error) Then
  335. $BankIn1 = True
  336. EndIf
  337. WEnd
  338.  
  339.  
  340. EndFunc
  341. Func MouseMove123 ()
  342. $move = False
  343.  
  344.  
  345. $xmove = $x
  346. $ymove = $y
  347. $ymove1 = 0
  348. $xmove1 = 0
  349. MouseMove(@DesktopWidth / 2,$ymove,1)
  350. $x = $x + 10
  351. $y = $y + 10
  352.  
  353.  
  354. EndFunc
  355. Func BankingAll ()
  356. LC($Bankingx,$Bankingy)
  357. Sleep(1000)
  358. Do
  359. $result = _ImageSearch($picture15,1,$x1,$y1,5,0)
  360. until $result = True
  361. LC($x1,$y1)
  362.  
  363. EndFunc
  364. Func BankingOut ()
  365. LC($BankingOutx,$BankingOuty)
  366. EndFunc
  367. Func FindMySelf ()
  368. If $FindMySelf = False Then
  369. MouseMove($LcCompassx,$LcCompassy,5)
  370. Sleep(200)
  371. MouseWheel($MOUSE_WHEEL_DOWN,20)
  372. Sleep(1000)
  373. MouseWheel($MOUSE_WHEEL_UP,5)
  374. Sleep(1000)
  375. Do
  376. If $MiningIcon2 = False Then
  377.  
  378. Global $MiningIcon2 = _ImageSearch($picture14,1,$x1,$y1,40,0)
  379.  
  380. ConsoleWrite("-----------------")
  381. ConsoleWrite($MiningIcon2)
  382. EndIf
  383. If $MiningIcon2 = True Then
  384. ;~ $MiningIconClickx = $MiningIcon2[0]
  385. ;~ $MiningIconClicky = $MiningIcon2[1]
  386. Sleep(500)
  387. MouseMove($x1,$y1,20)
  388. Sleep(500)
  389. $position = MouseGetPos()
  390. Sleep(500)
  391. $MiningIconClickx = $position[0]
  392. Sleep(100)
  393. $MiningIconClicky = $position[1]
  394. Sleep(100)
  395. ; 540 / 2 = 270
  396. LC($MiningIconClickx,$MiningIconClicky)
  397. Sleep(5500)
  398. LC($MiningIconClickx / 5,$MiningIconClicky * 3.9)
  399. Sleep(6000)
  400. Global $MiningIcon2 = True
  401. EndIf
  402. Until $MiningIcon2 = True
  403. EndIf
  404. $FindMySelf = True
  405. EndFunc
  406. Func PortalOutWalk ()
  407. LC($PortalOutWalkx,$PortalOutWalky)
  408. $result2 = _ImageSearch($picture17,1,$x1,$y1,10,0)
  409. If $result2 = True then
  410. LC($x1,$y1)
  411. EndIf
  412. Sleep(3000)
  413. EndFunc
  414. Func RandomWords ()
  415. $Random = Random(1,20,1)
  416. If $Random = 1 Then
  417. Global $word = "YES"
  418. ElseIf $Random = 2 Then
  419. Global $word = "nooooooooo"
  420. ElseIf $Random = 3 Then
  421. Global $word = "Im having so much fun haha"
  422. ElseIf $Random = 4 Then
  423. Global $word = "How long you guys play runescape?"
  424. ElseIf $Random = 5 Then
  425. Global $word = "I have been playing this for forever so much has changed."
  426. ElseIf $Random = 6 Then
  427. Global $word = "How long have you guys been mining? haha"
  428. ElseIf $Random = 7 Then
  429. Global $word = "Wel......"
  430. ElseIf $Random = 8 Then
  431. Global $word = "This is so much than playing basketball lol"
  432. ElseIf $Random = 9 Then
  433. Global $word = "When did you guys first play this?"
  434. ElseIf $Random = 10 Then
  435. Global $word = "This has been my favoirte skill...... most of the time haha"
  436. ElseIf $Random = 11 Then
  437. Global $word = "Can get much better"
  438. ElseIf $Random = 12 Then
  439. Global $word = "How much gold do you guys have?"
  440. ElseIf $Random = 13 Then
  441. Global $word = "I type random words lol"
  442. ElseIf $Random = 14 Then
  443. Global $word = "Do you guys love me?"
  444. ElseIf $Random = 15 Then
  445. Global $word = "Does anybody know when new update to runescape comes?"
  446. ElseIf $Random = 16 Then
  447. Global $word = "Well im getting tired...."
  448. ElseIf $Random = 17 Then
  449. Global $word = "This is my life dreammm........not"
  450. ElseIf $Random = 18 Then
  451. Global $word = "I wonder if there is gonna be a runescape 4"
  452. ElseIf $Random = 19 Then
  453. Global $word = "I bet (new) runescape will diwndle to a ember within next 4 years."
  454. ElseIf $Random = 20 Then
  455. Global $word = "Well........have you guys play the new game diep.io..... hard af to get above 250k!"
  456. EndIf
  457. EndFunc
  458. Func Chatting ()
  459. RandomWords ()
  460. Do
  461. $result = _ImageSearch($picture16,1,$x1,$y1,10,0)
  462. $result2 = _ImageSearch($picture17,1,$x1,$y1,10,0)
  463.  
  464. Until $result = True or $result2 = True
  465. LC($x1,$y1)
  466. Send($word)
  467. Sleep(50)
  468. Send("{ENTER}")
  469. Sleep(100)
  470. Send("{ESC}")
  471. EndFunc
  472. Func RunescapeRestart ()
  473. Global $result6969 = _ImageSearch($picture17,1,$x1,$y1,10,0)
  474. If $result6969 = True Then
  475. LC($x1,$y1)
  476. EndIf
  477. EndFunc
  478. Func MouseDragging ()
  479. Do
  480. $result = _ImageSearch($picture10,1,$x1,$y1,0,0)
  481. MouseClickDrag("middle",@DesktopWidth / 2, @DesktopHeight / 2,@DesktopWidth / 2.85, @DesktopHeight / 2)
  482. Until $result = True
  483. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement