Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.30 KB | None | 0 0
  1. ;==================================
  2. ; Script Name: MineGrid
  3. ; Author: FuzzyLogic
  4. ; Version: 1.2
  5. ; Client Tested with: 2.0.0
  6. ; EUO version tested with: 1.5
  7. ; Shard OSI / FS: Free Shard Neverlands
  8. ; Notes: FOR MINOC MINES WITH .AUTO MINING TURNED -OFF-.
  9. ;==================================
  10. ; EDIT VARIABLES =
  11. ;================
  12. set %Banker WYNJX
  13. set %Forges AUJ_AVJ_BUJ_BVJ_CUJ_CVJ_DUJ_DVJ_EUJ_EVJ_FUJ_GUJ_HVJ_IVJ_JBG_JUJ_KUJ_NUJ_NVJ_OUJ_OVJ_PUJ_QUJ_ROJ_SOJ_TUJ_UUJ_VTJ_WTJ_XUJ_YUJ_ZTJ_ZUJ
  14. set %Ores DWJ
  15. set %Moongate OTF
  16. set %Ingots ENK_DWJ_RVH_EVF_FVF_RVF_BVF_HVF_MWF_GVF_VUF_OVF
  17. set %Weight #WEIGHT
  18. set %MaxWeight 280
  19. set #SYSMSGCOL 1940
  20. set %Smelt #FALSE
  21. set %Weight #WEIGHT
  22. set %Lootbag MKGHBPF
  23.  
  24. ;==================================
  25. ; V 1.1 - Some additional moongate protection, granite/stones/marble will be ignored during smelting, changes made to prevent all ores stacking before banking as a theif protection(unless smelted).
  26. ; V 1.2 - More frequent weight checks, added more theif/pk protection, changed journal/sysmsg scanning to hopefully be more efficient.
  27. ;==================================
  28.  
  29.  
  30. ;===============================================================================================================================================
  31.  
  32. Start:
  33. if #WEIGHT > %MaxWeight
  34. {
  35. event sysmessage Max weight reached!
  36. Manualbank:
  37. gosub MineToForge
  38. if %Smelt = #TRUE
  39. gosub MakeIngots
  40. gosub ForgeToBank
  41. gosub BankIngots
  42. gosub BankToMine
  43. set %Weight #WEIGHT
  44. }
  45. gosub MoveRandomTile
  46. goto MineGrid
  47. goto Start
  48.  
  49. ;===============================================================================================================================================
  50.  
  51. MineGrid:
  52. gosub Mine 0 0
  53. if #WEIGHT > %MaxWeight
  54. goto Start
  55. gosub Mine -1 2
  56. if #WEIGHT > %MaxWeight
  57. goto Start
  58. gosub Mine 0 2
  59. if #WEIGHT > %MaxWeight
  60. goto Start
  61. gosub Mine 1 2
  62. if #WEIGHT > %MaxWeight
  63. goto Start
  64. gosub Mine -2 1
  65. if #WEIGHT > %MaxWeight
  66. goto Start
  67. gosub Mine -1 1
  68. if #WEIGHT > %MaxWeight
  69. goto Start
  70. gosub Mine 0 1
  71. if #WEIGHT > %MaxWeight
  72. goto Start
  73. gosub Mine 1 1
  74. if #WEIGHT > %MaxWeight
  75. goto Start
  76. gosub Mine 2 1
  77. if #WEIGHT > %MaxWeight
  78. goto Start
  79. gosub Mine -2 0
  80. if #WEIGHT > %MaxWeight
  81. goto Start
  82. gosub Mine -1 0
  83. if #WEIGHT > %MaxWeight
  84. goto Start
  85. gosub Mine 1 0
  86. if #WEIGHT > %MaxWeight
  87. goto Start
  88. gosub Mine 2 0
  89. if #WEIGHT > %MaxWeight
  90. goto Start
  91. gosub Mine -2 -1
  92. if #WEIGHT > %MaxWeight
  93. goto Start
  94. gosub Mine -1 -1
  95. if #WEIGHT > %MaxWeight
  96. goto Start
  97. gosub Mine 0 -1
  98. if #WEIGHT > %MaxWeight
  99. goto Start
  100. gosub Mine 1 -1
  101. if #WEIGHT > %MaxWeight
  102. goto Start
  103. gosub Mine 2 -1
  104. if #WEIGHT > %MaxWeight
  105. goto Start
  106. gosub Mine -1 -2
  107. if #WEIGHT > %MaxWeight
  108. goto Start
  109. gosub Mine 0 -2
  110. if #WEIGHT > %MaxWeight
  111. goto Start
  112. gosub Mine 1 -2
  113. goto Start
  114.  
  115. ;===============================================================================================================================================
  116.  
  117. sub Mine
  118. finditem WTH_NPF C
  119. if #findkind = -1
  120. {
  121. event sysmessage No Tool
  122. halt
  123. }
  124. set #lobjectid #findid
  125. set #ltargetkind 3
  126. set #ltargetx #charposx + %1
  127. set #ltargety #charposy + %2
  128. set #ltargetz #charposz
  129. event macro 17 0
  130. target
  131. event macro 22 0
  132. wait 20
  133. deletejournal
  134. set #sCnt 1
  135.  
  136. Looping:
  137. if #sysmsg = You_stop_mining. || #sysmsg = That_is_too_far_away || #sysmsg = There_is_no_more_ore_to_mine_here. || #sysmsg = you_fail_to_find_any_ore. || #sysmsg = you_fail_to_find_any_usable_ore || #sysmsg = You_fail_to_find_usable_ore
  138. {
  139. deletejournal
  140. wait 10
  141. return
  142. }
  143. set %jrnl #jindex
  144. if #jindex > %jrnl
  145. set %jrnl %jrnl + 1
  146. scanjournal %jrnl
  147. if You_stop_mining. in #JOURNAL || That_is_too_far_away in #JOURNAL || There_is_no_more_ore_to_mine_here. in #JOURNAL || you_fail_to_find_any_ore. in #JOURNAL || you_fail_to_find_any_usable_ore in #JOURNAL || You_fail_to_find_usable_ore in #JOURNAL
  148. {
  149. deletejournal
  150. wait 10
  151. return
  152. }
  153. if ore_in_your_backpack in #JOURNAL
  154. {
  155. deletejournal
  156. gosub MoveMetal
  157. }
  158. if #CONTNAME = waiting_gump && #CONTSIZE = 356_212
  159. {
  160. click 400 375
  161. msg .age$
  162. return
  163. }
  164. if #sCnt > 60
  165. {
  166. event sysmessage 60s timer reached, resetting..
  167. wait 10
  168. return
  169. }
  170. onhotkey B ALT
  171. goto Manualbank
  172. finditem %Moongate G_10
  173. if #findkind <> -1
  174. gosub Moongate
  175. goto Looping
  176.  
  177. ;===============================================================================================================================================
  178.  
  179. sub MoveRandomTile
  180. for %i 1 2
  181. {
  182. set %steps #random % 4 + 1
  183. set %direction #random % 2
  184. if %direction = 0
  185. set %direction -
  186. if %direction = 1
  187. set %direction +
  188. if %i = 1
  189. set %move . %i #CHARPOSX %direction %steps
  190. if %i = 2
  191. set %move . %i #CHARPOSY %direction %steps
  192. }
  193. Event pathFind %Move1 %Move2 #CHARPOSZ
  194. for %i 5 1
  195. {
  196. scanjournal %i
  197. if Can't_get_there in #JOURNAL
  198. {
  199. deletejournal %i
  200. gosub MoveRandomTile
  201. }
  202. }
  203. set #scnt 0
  204. repeat
  205. until #CHARPOSX = %Move1 && #CHARPOSY = %Move2 || #scnt > 5
  206. if This_gate_leads in #journal
  207. gosub MoveRandomTile
  208. return
  209.  
  210. ;===============================================================================================================================================
  211.  
  212. sub MineToForge
  213. finditem %Moongate G_10
  214. if #findkind <> -1
  215. gosub Moongate
  216. gosub pathFind 2564 484 0
  217. gosub pathFind 2559 493 0
  218. gosub pathFind 2558 502 0
  219. gosub pathFind 2563 509 5
  220. gosub pathFind 2567 516 15
  221. gosub pathFind 2571 522 15
  222. return
  223.  
  224. ;===============================================================================================================================================
  225.  
  226. sub MakeIngots
  227. repeat
  228. finditem %Ores C
  229. if #findcol = 906 || #findcol = 952 || #findcol = 2999
  230. ignoreitem #findid
  231. if #FINDKIND <> -1
  232. {
  233. set #LOBJECTID #FINDID
  234. event Macro 17 0
  235. wait 12
  236. }
  237. until #FINDKIND = -1
  238. set %Weight #WEIGHT
  239. return
  240.  
  241. ;===============================================================================================================================================
  242.  
  243. sub ForgeToBank
  244. ignoreitem reset
  245. finditem %Banker G_10
  246. if #FINDID <> -1
  247. {
  248. gosub pathFind #findx #findy #FINDZ
  249. set #LOBJECTID %Banker
  250. event Macro 17 0
  251. repeat
  252. until #CONTNAME = generic_gump && #CONTSIZE = 230_298
  253. set %Cont #CONTID
  254. click 100 140
  255. repeat
  256. until #CONTSIZE = 180_240
  257. set %Bankbox #CONTID
  258. }
  259. return
  260.  
  261. ;===============================================================================================================================================
  262.  
  263. sub BankIngots
  264. finditem %Ingots , _ , %Ores C_ , #BACKPACKID
  265. if #FINDKIND <> -1
  266. {
  267. for %n 1 #FINDCNT
  268. {
  269. set #FINDINDEX %n
  270. exevent Drag #FINDID #FINDSTACK
  271. wait 10
  272. exevent Dropc %Bankbox
  273. wait 10
  274. }
  275. }
  276. finditem %Ingots , _ , %Ores C_ , %Lootbag
  277. if #FINDKIND <> -1
  278. {
  279. for %n 1 #FINDCNT
  280. {
  281. set #FINDINDEX %n
  282. exevent Drag #FINDID #FINDSTACK
  283. wait 10
  284. exevent Dropc %Bankbox
  285.  
  286. wait 10
  287. }
  288. }
  289. set %Weight #WEIGHT
  290. return
  291.  
  292. ;===============================================================================================================================================
  293.  
  294. sub BankToMine
  295. finditem %Moongate G_10
  296. if #findkind <> -1
  297. gosub Moongate
  298. gosub pathfind 2567 524 15
  299. gosub pathfind 2572 522 15
  300. gosub pathfind 2567 516 15
  301. gosub pathfind 2563 509 5
  302. gosub pathfind 2558 502 0
  303. gosub pathfind 2558 502 0
  304. gosub pathfind 2559 493 0
  305. gosub pathfind 2564 484 0
  306. return
  307.  
  308. ;===============================================================================================================================================
  309.  
  310. sub MoveMetal
  311. finditem %Ingots , _ , %Ores C_ , #BACKPACKID
  312. if #FINDKIND <> -1
  313. {
  314. for %n 1 #FINDCNT
  315. {
  316. set #FINDINDEX %n
  317. if #LLIFTEDKIND = 0
  318. {
  319. exevent Drag #FINDID #FINDSTACK
  320. wait 10
  321. exevent Dropc %Lootbag 50 50
  322. wait 10
  323. }
  324. }
  325. }
  326. set %Weight #WEIGHT
  327. return
  328.  
  329. ;===============================================================================================================================================
  330.  
  331. sub pathfind
  332. repeat
  333. {
  334. event pathfind %1 %2 %3
  335. wait 40
  336. }
  337. until #CHARPOSX = %1 && #CHARPOSY = %2
  338. return
  339.  
  340. ;===============================================================================================================================================
  341.  
  342. sub Moongate
  343. event sysmessage Someone is gating, waiting
  344. repeat
  345. finditem %Moongate G_10
  346. until #findkind = -1
  347. event sysmessage Returning..
  348. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement