Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.61 KB | None | 0 0
  1. ; Name: Advanced Lumberjacking
  2. ; Author: Frans 'De Tuun' Tuinstra
  3. ; Description: Remembers chopped trees and chops them
  4. ; Turns logs into boards
  5. ; Recalls home and drops logs/boards
  6. ; Recalls back to tree rune
  7. ; BASED OFF BRISTLEBANES LUMBERJACKING SCRIPT
  8.  
  9. ;ONLY EDIT THESE BELOW
  10. Set %MaxWeight 375 ; when will you recall home after having made boards?
  11. Set %CarpWeight 350 ; when will you start making boards?
  12. Set %HomeRune MQGTMMD ; this is the rune to your home
  13. Set %TreeRune KPAGNMD ; this is the rune to your lumberjacking spot
  14. Set %Drop SDHTMMD ; this is a chest/backpack where the logs and boards will be put in
  15. ; NOT THESE OK?
  16. Set #SYSMSGCOL 1264
  17. Set %Auto #FALSE
  18. Set %Action Begin
  19. Set %Carp #FALSE
  20. Set #SCNT 0
  21. Set #SCNT2 0
  22. Set %TimeOut 36000
  23. Set %WaitTimer 2000
  24. Set %HotkeyStart INSERT
  25. Set %HotkeySet SPACE
  26. Set %HotkeyEnd BACK
  27. Set %CarpTool BIG_AGG_BGG_CGG_DGG_EGG_HGG_IGG_JGG_KGG_BIG_
  28. Set %Logs ZLK_
  29. Set %Boards TLK_
  30. Set %Other EAG_
  31. Set %Tool FSF
  32. DeleteJournal
  33. DeleteJournal %N
  34.  
  35. If *Trees = 0 || *Trees = N/A
  36. {
  37. Event SysMessage There are no set tree, press %HotkeySet to set trees.
  38. Event SysMessage Hit the %HotkeyEnd to stop setting trees.
  39. Set *Trees 0
  40. }
  41. Else
  42. {
  43. Event SysMessage Press %HotkeyStart to chop last *Trees trees.
  44. Event SysMessage Or press %HotkeySet to restart settings trees. Hit the %HotkeyEnd to stop setting trees.
  45. }
  46.  
  47. FindItem %Tool C_ , #CHARID
  48. If #FINDKIND = -1
  49. {
  50. FindItem %Tool C_ ,
  51. If #FINDKIND = -1
  52. {
  53. Display Ok no hatchet in backpack or paperdoll
  54. Halt
  55. }
  56. ExEvent Drag #FINDID #FINDSTACK
  57. Wait 5
  58. ExEvent Droppd
  59. Wait 1s
  60. }
  61. Set %Hatchet #FINDID
  62. Set #LOBJECTID %Hatchet
  63.  
  64. Setup:
  65. OnHotKey %Hotkeyset
  66. {
  67. Set *Trees 0
  68. Event Macro 17
  69. Target 10s
  70. Set:
  71. OnHotKey %HotkeyEnd
  72. {
  73. Event SysMessage Setting trees stopping. Press %HotkeyStart to chop last *Trees trees.
  74. If #TARGCURS = 1
  75. Key ESC
  76. Msg $
  77. GoTo Setup
  78. }
  79. If #TARGCURS = 0
  80. {
  81. Event SysMessage #LTARGETX #LTARGETY #LTARGETZ
  82. Set *TreeX . *Trees #LTARGETX
  83. Set *TreeY . *Trees #LTARGETY
  84. Set *TreeZ . *Trees #LTARGETZ
  85. Set *TreeT . *Trees #LTARGETTILE
  86. Set *Trees *Trees + 1
  87. Set *Hatchet #LOBJECTID
  88. Event SysMessage Set Tree # , *Trees
  89. Wait 1s
  90. Event Macro 17
  91. Target 10s
  92. GoTo Set
  93. }
  94. GoTo Set
  95. }
  96.  
  97. OnHotKey %HotkeyStart
  98. {
  99. Set %Auto #TRUE
  100. Set *TreeIndex -1
  101. Event SysMessage Automatic chopping now.
  102. Set %Action = Idle
  103. Set #SCNT 29
  104. GoTo Chop
  105. }
  106. GoTo Setup
  107.  
  108. Chop:
  109. FindItem %Tool C_ , #CHARID
  110. If #FINDKIND = -1
  111. {
  112. FindItem %Tool C_ ,
  113. If #FINDKIND = -1
  114. {
  115. Display Ok no hatchet in backpack or paperdoll
  116. Halt
  117. }
  118. ExEvent Drag #FINDID #FINDSTACK
  119. Wait 5
  120. ExEvent Droppd
  121. Wait 1s
  122. }
  123. Set %Hatchet #FINDID
  124. Set #LOBJECTID %Hatchet
  125. If #SCNT > 30 && %Auto = #TRUE
  126. Set %Action Idle
  127. If %Auto = #TRUE && %Action = Idle && #SCNT > 30
  128. {
  129. Set *TreeIndex ( *TreeIndex + 1 ) % *Trees
  130. Set #LTARGETX *TreeX . *TreeIndex
  131. Set #LTARGETY *TreeY . *TreeIndex
  132. Set #LTARGETZ *TreeZ . *TreeIndex
  133. Set #LTARGETTILE *TreeT . *TreeIndex
  134. Set #LTARGETKIND 3
  135. GoSub PathFind #LTARGETX #LTARGETY #LTARGETZ
  136. ;Set #LOBJECTID *Hatchet
  137. Repeat
  138. {
  139. Event Macro 17
  140. Target 10s a
  141. }
  142. Until #TARGCURS = 1
  143. Event Macro 22
  144. Set #SCNT 0
  145. Set %Action Auto
  146. }
  147. For %N 5 1
  148. {
  149. ScanJournal %N
  150. If You_stop_lumberjacking in #JOURNAL && %Auto = #TRUE || You_stop_chopping in #JOURNAL && %Auto = #TRUE
  151. {
  152. ;Event SysMessage Stopped. Press %Hotkey to restart.
  153. Set %Auto #TRUE
  154. Set %Action Idle
  155. Set #SCNT 30
  156. ScanJournal 1
  157. DeleteJournal
  158. GoSub CheckWeight
  159. GoTo Start
  160. }
  161. If You_are_unable_to_produce_a_useable_log_from_this_tree in #JOURNAL || in_your_pack in #JOURNAL || You_fail_to_get_any_usable_wood in #JOURNAL || logs_in_your_backpack in #JOURNAL
  162. {
  163. DeleteJournal
  164. Set %Action Chopping
  165. Set #SCNT 0
  166. }
  167. If There's_not_enough_wood_here in #JOURNAL || There's_not_enough_wood_here_to_chop. in #SYSMSG
  168. {
  169. DeleteJournal
  170. Set #SCNT 30
  171. GoSub CheckWeight
  172. Set %Action Idle
  173. Set %Auto #TRUE
  174. Event SysMessage Reset
  175. If %Auto = #FALSE
  176. {
  177. If *Trees = 1
  178. Event SysMessage Done, let's chop down another tree.
  179. Else
  180. Event SysMessage That's *Trees trees. Chop on, or press %Hotkey to chop first one.
  181. }
  182. }
  183. }
  184. GoTo Chop
  185.  
  186. Sub CheckWeight
  187. Wait 2s
  188. IgnoreItem Reset
  189. If #WEIGHT > %CarpWeight
  190. {
  191. FindItem %CarpTool C_
  192. If #FINDKIND <> -1
  193. {
  194. Set #LOBJECTID #FINDID
  195. FindItem %Logs C_ , #BACKPACKID
  196. If #FINDKIND <> -1
  197. {
  198. For %lugs 1 #FINDCNT
  199. {
  200. Set #FINDINDEX %lugs
  201. If #FINDCOL = 0
  202. {
  203. Event Macro 17
  204. Wait 2s
  205. Click 286 98
  206. Target 2s
  207. Set #LTARGETKIND 1
  208. Set #LTARGETID #FINDID
  209. Event Macro 22
  210. Wait 16s
  211. }
  212. IgnoreItem #FINDID
  213. }
  214. }
  215. }
  216. }
  217. If #SCNT2 > %TimeOut
  218. {
  219. Event SysMessage Chilling for %WaitTimer seconds.
  220. For %i 1 %WaitTimer
  221. {
  222. ;Event SysMessage %i
  223. Event Macro 18
  224. Wait 1s
  225. }
  226. Set #SCNT2 0
  227. }
  228. If #WEIGHT > %MaxWeight
  229. {
  230. msg .quip 2$
  231. GoSub RecallHome
  232. GoSub Drop
  233. GoSub RecallTrees
  234. msg .quip 1$
  235. }
  236. Return
  237.  
  238. Sub Drop
  239. IgnoreItem Reset
  240. FindItem %Boards , _ , %Logs C_
  241. If #FINDKIND <> -1
  242. {
  243. For %Z 0 #FINDCNT
  244. {
  245. FindItem %Boards , _ , %Logs , _ , %Other C_
  246. ExEvent Drag #FINDID #FINDSTACK
  247. Wait 5
  248. ExEvent Dropc %Drop
  249. Wait 5
  250. }
  251. }
  252. Return
  253.  
  254. Sub RecallTrees
  255. Set %OldX #CHARPOSX
  256. Set %OldY #CHARPOSY
  257. Mana1:
  258. If #MANA > 10
  259. {
  260. Repeat
  261. {
  262. Event Macro 15 31
  263. Target 4s
  264. }
  265. Until #TARGCURS = 1
  266. FindItem %TreeRune G_2
  267. Set #LTARGETID #FINDID
  268. Set #LTARGETKIND 1
  269. Event Macro 22
  270. Wait 1
  271. Repeat
  272. Until %OldX <> #CHARPOSX && %OldY <> #CHARPOSY
  273. Return
  274. }
  275. GoTo Mana1
  276.  
  277. Sub RecallHome
  278. Set %OldX #CHARPOSX
  279. Set %OldY #CHARPOSY
  280. Mana2:
  281. If #MANA > 10
  282. {
  283. Repeat
  284. {
  285. Event Macro 15 31
  286. Target 4s
  287. }
  288. Until #TARGCURS = 1
  289. FindItem %HomeRune C_
  290. Set #LTARGETID #FINDID
  291. Set #LTARGETKIND 1
  292. Event Macro 22
  293. Wait 1
  294. Repeat
  295. Until %OldX <> #CHARPOSX && %OldY <> #CHARPOSY
  296. Return
  297. }
  298. GoTo Mana2
  299.  
  300. Sub PathFind
  301. Repeat
  302. {
  303. Event PathFind %1 %2 %3
  304. Wait 2s
  305. If #CHARPOSX = %1 || #CHARPOSX = %1 + 1 || #CHARPOSX = %1 - 1
  306. Set %POSX #TRUE
  307. Else
  308. Set %POSX #FALSE
  309. If #CHARPOSY = %2 || #CHARPOSY = %2 + 1 || #CHARPOSY = %2 - 1
  310. Set %POSY #TRUE
  311. Else
  312. Set %POSY #FALSE
  313. }
  314. Until %POSY && %POSX
  315. Set %POSX #false
  316. Set %POSY #false
  317. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement