Advertisement
Guest User

Untitled

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