Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.93 KB | None | 0 0
  1.  
  2. ;===MANDATORY CONFIG===
  3. ;Position of a container in the bank box (Bank will awasly open op position x:10 y:10
  4. SET %bankBagx 82
  5. SET %bankBagY 157
  6.  
  7. ;Mining delay in seconds of your shard ( recomended to add +1 second)
  8. SET %miningDelay 11
  9.  
  10. SET %timeoutRelog 30
  11.  
  12. ;Go to bank when Weight reaches ...
  13. ;Put 0 to disable bank
  14. SET %maxMiningWeight 250
  15.  
  16. ;IF you fail to mine a tile, perhaps it contains good ore. But IF your mining skill is
  17. ;too low you will be only wasting time.
  18. ;recomended to turn on only after 70.0%
  19. SET %persist 0
  20.  
  21. ;===OPTIONAL CONFIG===
  22.  
  23. ;Ores and gems (need to add more gems)
  24. SET %ores DWJ_TVJ_GWJ_EWJ_BVF
  25. ;Pickaxe and shovel
  26. SET %miningTool NPF_QPF
  27. SET %timeOut #SCNT
  28.  
  29. GOSUB relog
  30. GOSUB intro
  31. GOSUB preValidations
  32. GOSUB setGumps
  33. GOSUB setForMining
  34.  
  35. SET %posToMine 0
  36.  
  37. GOSUB journalScan
  38.  
  39. ;========= FUNCTIONS ================
  40.  
  41. SUB relog
  42.  
  43. EVENT sysmessage --> entrou relog
  44.  
  45. ;IF #SCNT - %timeOut >= %timeoutRelog
  46. {
  47. GOSUB RELOGAR
  48. }
  49.  
  50. RETURN
  51.  
  52. ;Main loop inside this function
  53. SUB journalScan
  54.  
  55. SET %jrnl #jindex
  56.  
  57. GOSUB mine
  58.  
  59. while #true
  60. {
  61.  
  62. IF #jindex > %jrnl
  63. {
  64. SET %jrnl %jrnl + 1
  65. scanjournal %jrnl
  66. IF There_is_nothing_here_to_mine_for in #journal
  67. {
  68. GOSUB setForMining
  69. GOSUB mine
  70. }
  71. IF Try_mining_elsewhere in #journal
  72. {
  73. GOSUB setForMining
  74. GOSUB mine
  75. }
  76. IF That_is_too_far_away in #journal
  77. {
  78. GOSUB setForMining
  79. GOSUB mine
  80. }
  81. IF You_have_no_line_of_sight_to_that_location in #journal
  82. {
  83. GOSUB setForMining
  84. GOSUB mine
  85. }
  86. IF You_cannot_mine_so_close_to_yourself in #journal
  87. {
  88. GOSUB setForMining
  89. GOSUB mine
  90. }
  91. IF You_loosen_some_rocks_but_fail_to_find_any_useable_ore in #journal
  92. {
  93. IF %persist = 0
  94. GOSUB setForMining
  95. GOSUB mine
  96. }
  97. IF You_put in #journal
  98. {
  99. EVENT sysmessage --> YEAH ! ORES ...
  100. GOSUB mine
  101. }
  102.  
  103. IF #SCNT - %timeOut >= %miningDelay
  104. {
  105. SET %jrnl #jindex
  106. SET %t #SCNT - %timeOut
  107. EVENT sysmessage --> TIMEOUT %t
  108. GOSUB setForMining
  109. GOSUB mine
  110. }
  111. IF #WEIGHT >= %maxMiningWeight && %maxMiningWeight <> 0
  112. {
  113. GOSUB MineToBank
  114. GOSUB OreToBank
  115. GOSUB BankToMine
  116. GOSUB setForMining
  117. GOSUB mine
  118. }
  119. }
  120. }
  121. RETURN
  122.  
  123.  
  124. SUB walk
  125.  
  126. SET %walkDirection #random % 8
  127. GOSUB %walkDirection 2
  128. MOVE #ltargetx #ltargety 0 2s
  129. ;SET %walkDirection %walkDirection + 1
  130. ;IF %walkDirection > 7
  131. ;{
  132. ; SET %walkDirection 0
  133. ;}
  134. RETURN
  135.  
  136. SUB 0
  137. SET #ltargetx #charposx
  138. SET #ltargety #charposy - %1
  139. RETURN
  140.  
  141. SUB 1
  142. SET #ltargetx #charposx + %1
  143. SET #ltargety #charposy - %1
  144. RETURN
  145.  
  146. SUB 2
  147. SET #ltargetx #charposx + %1
  148. SET #ltargety #charposy
  149. RETURN
  150.  
  151. SUB 3
  152. SET #ltargetx #charposx + %1
  153. SET #ltargety #charposy + %1
  154. RETURN
  155.  
  156. SUB 4
  157. SET #ltargetx #charposx
  158. SET #ltargety #charposy + %1
  159. RETURN
  160.  
  161. SUB 5
  162. SET #ltargetx #charposx - %1
  163. SET #ltargety #charposy + %1
  164. RETURN
  165.  
  166. SUB 6
  167. SET #ltargetx #charposx - %1
  168. SET #ltargety #charposy
  169. RETURN
  170.  
  171. SUB 7
  172. SET #ltargetx #charposx - %1
  173. SET #ltargety #charposy - %1
  174. RETURN
  175.  
  176.  
  177.  
  178. SUB setForMining
  179. ; Reset variables in case you CLICK with your mouse
  180. SET #LTARGETID 0
  181. SET #LTARGETZ 0
  182. SET #LTARGETKIND 2
  183.  
  184. ; SET mining position
  185. GOSUB %posToMine 1
  186. ; Increment mining spot
  187. SET %posToMine %posToMine + 1
  188.  
  189. ; IF last stop reached
  190. IF %posToMine > 7
  191. {
  192. SET %posToMine 0
  193. GOSUB walk
  194. }
  195. RETURN
  196.  
  197.  
  198. SUB mine
  199.  
  200. SET %timeOut #SCNT
  201.  
  202. FINDITEM %miningTool
  203. SET #LOBJECTID #FINDID
  204. EVENT macro 17 0 ; uses last object
  205. target 3s ; WAIT for target cursor
  206. EVENT macro 22 0 ; last target
  207.  
  208. GOSUB relog
  209.  
  210. RETURN
  211.  
  212.  
  213. SUB intro
  214.  
  215. EVENT sysmessage --> Mining macro by BELZEBOSS
  216. EVENT sysmessage --> TFG shard 2017/10/16
  217. EVENT sysmessage --> Screen resolution 1920x1080
  218.  
  219. RETURN
  220.  
  221.  
  222. SUB setGumps
  223.  
  224. EVENT macro 8 3 ;open journal
  225. WAIT 7
  226. contpos 635 13 ;moves to position
  227. WAIT 7
  228.  
  229. EVENT macro 8 4 ;open journal
  230. WAIT 10
  231. contpos 800 13 ;moves to position
  232. WAIT 7
  233.  
  234. EVENT macro 8 1 ;Open Paperdoll
  235. WAIT 7
  236. contpos 500 -45 ;moves you paperdoll to Position
  237. WAIT 7
  238.  
  239. EVENT macro 8 7 ;Open Backpack
  240. WAIT 10
  241. contpos 546 300 ;moves it to Position
  242. WAIT 7
  243.  
  244. EVENT macro 8 8 ;Open Overview
  245. EVENT macro 8 8 ;Open Overview
  246. WAIT 7
  247. contpos 530 500 ;moves you overview to position
  248. WAIT 7
  249.  
  250. EVENT macro 8 2 ;Open Statusbar
  251. WAIT 7
  252. ;EVENT macro 10 2 ;minimize Statusbar
  253. ; WAIT 5
  254. contpos 570 450 ;moves you Statusbar to position
  255. WAIT 7
  256.  
  257. RETURN
  258.  
  259. SUB preValidations
  260.  
  261. FINDITEM %miningTool C_ , #BACKPACKID ;Finds pickaxe in your bag
  262. IF #findKind = -1
  263. {
  264. FINDITEM %miningTool C_ , #CHARID ;Finds pickaxe in your paperdoll
  265. IF #findKind = -1
  266. {
  267. EVENT sysmessage --> NO MINING TOOL FOUND. MACRO ABORTED
  268. GOSUB RELOGAR
  269. HALT
  270. }
  271. }
  272.  
  273. RETURN
  274.  
  275.  
  276. SUB OreToBank
  277.  
  278. nextCPos 10 10
  279. msg ! Banker Bank $
  280. WAIT 1s
  281.  
  282. __AGAIN:
  283. FINDITEM %ores C , #BACKPACKID
  284. EVENT drag #findId
  285. WAIT 15
  286. IF #findstack > 1
  287. {
  288. MSG $
  289. WAIT 15
  290. }
  291. CLICK %bankBagx %bankBagy p
  292. WAIT 15
  293. IF #Findkind <> -1
  294. GOTO __AGAIN
  295.  
  296. RETURN
  297.  
  298.  
  299. SUB MineToBank
  300.  
  301. GOSUB pathFind 2579 475 0
  302. GOSUB pathFind 2571 478 0
  303. GOSUB pathFind 2567 484 0
  304. GOSUB pathFind 2559 491 0
  305. GOSUB pathFind 2558 501 0
  306. GOSUB pathFind 2553 504 14
  307. GOSUB pathFind 2547 501 30
  308. GOSUB pathFind 2536 500 30
  309. GOSUB pathFind 2525 505 15
  310. GOSUB pathFind 2528 515 0
  311. GOSUB pathFind 2529 526 0
  312. GOSUB pathFind 2524 536 0
  313. GOSUB pathFind 2518 540 0
  314. GOSUB pathFind 2512 545 0
  315.  
  316. RETURN
  317.  
  318. SUB BankToMine
  319.  
  320. GOSUB pathFind 2524 536 0
  321. GOSUB pathFind 2529 526 0
  322. GOSUB pathFind 2528 515 0
  323. GOSUB pathFind 2525 505 15
  324. GOSUB pathFind 2536 500 30
  325. GOSUB pathFind 2547 501 30
  326. GOSUB pathFind 2553 504 9
  327. GOSUB pathFind 2558 501 0
  328. GOSUB pathFind 2559 491 0
  329. GOSUB pathFind 2567 484 0
  330. GOSUB pathFind 2571 478 0
  331. GOSUB pathFind 2579 475 0
  332.  
  333. RETURN
  334.  
  335.  
  336. SUB pathFind
  337.  
  338. REPEAT
  339.  
  340. ;try to avoid getting stuck when something is on that particular tile
  341. IF #RANDOM % 2 = 0
  342. {
  343. SET %fPathx %1 + 1
  344. SET %fPathy %2 - 1
  345.  
  346. EVENT pathFind %fPathx %fPathy %3
  347. }
  348. ELSE
  349. {
  350. EVENT pathFind %1 %2 %3
  351. }
  352. WAIT 10
  353. UNTIL #CHARPOSX = %1 && #CHARPOSY = %2
  354.  
  355. RETURN
  356.  
  357. SUB RELOGAR
  358.  
  359. EVENT sysmessage --> entrou relogar
  360.  
  361. Set %password sword0035
  362. Set #Result N/A
  363.  
  364. ClickAccept:
  365. If ( #contSize <> 203_121 ) && ( #contName <> waiting_gump )
  366. Goto ClickAccept
  367. Wait 10
  368. Key Enter
  369. Gosub WaitGump MainMenu_gump
  370. Goto EnterPass
  371.  
  372. EnterPass:
  373. Click 384 399
  374. Wait 10
  375. Msg %password
  376. Wait 100
  377. Key Enter
  378. Set %TimeOut #Scnt + 12
  379. Goto WaitShardScreen
  380.  
  381. WaitShardScreen:
  382. If #Scnt > %TimeOut
  383. Goto ErrorShard
  384. If ( #contSize <> 640_480 ) && ( #contName <> normal_gump )
  385. Goto WaitShardScreen
  386. Goto ChooseShard
  387.  
  388. ChooseShard:
  389. Click 190 430
  390. Set %TimeOut #scnt + 12
  391. Goto WaitCharScreen
  392.  
  393. WaitCharScreen:
  394. If #Scnt > %TimeOut + 10
  395. Goto ErrorChar
  396. If ( #contSize <> 640_480 ) && ( #contName = normal_gump )
  397. Goto ChooseChar
  398. If ( #contSize <> 640_480 ) && ( #contName <> Login_gump )
  399. Goto WaitCharScreen
  400.  
  401.  
  402. ChooseChar:
  403. Wait 10
  404. Click 361 165 d f x 4
  405. Set %TimeOut #Scnt + 12
  406. Goto WaitToBeInWorld
  407.  
  408. WaitToBeInWorld:
  409. If #Scnt > %TimeOut
  410. Goto ErrorWorld
  411. If #cliLogged = 1 3
  412. Wait 100
  413. Set #Result #True
  414. Exit
  415. Goto WaitToBeInWorld
  416.  
  417. ErrorShard:
  418. If ( #contSize <> 356_212 ) && ( #contName <> waiting_gump )
  419. Halt
  420. Key enter
  421. Gosub WaitGump MainMenu_gump
  422. Click 518 404
  423. Wait 10
  424. For %pass 0 15
  425. {
  426. key back
  427. wait 5
  428. }
  429. Goto EnterPass
  430.  
  431. ErrorChar:
  432. Halt
  433.  
  434. ErrorWorld:
  435. Halt
  436.  
  437. Sub WaitGump
  438. Set %_TimeOut #Scnt + 10
  439. WaitGump:
  440. If #Scnt > %_TimeOut
  441. Return
  442. If #contName = %1
  443. Return
  444. Goto WaitGump
  445.  
  446. RETURN
  447.  
  448.  
  449. --
  450. Francesco Salaris
  451. 54-9.8112-6010
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement