Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Name: Advanced Lumberjacking
- ; Author: Frans 'De Tuun' Tuinstra
- ; Description: Remembers chopped trees and chops them
- ; Turns logs into boards
- ; Recalls home and drops logs/boards
- ; Recalls back to tree rune
- ; BASED OFF BRISTLEBANES LUMBERJACKING SCRIPT
- ;ONLY EDIT THESE BELOW
- Set %MaxWeight 375 ; when will you recall home after having made boards?
- Set %CarpWeight 350 ; when will you start making boards?
- Set %HomeRune MQGTMMD ; this is the rune to your home
- Set %TreeRune KPAGNMD ; this is the rune to your lumberjacking spot
- Set %Drop SDHTMMD ; this is a chest/backpack where the logs and boards will be put in
- ; NOT THESE OK?
- Set #SYSMSGCOL 1264
- Set %Auto #FALSE
- Set %Action Begin
- Set %Carp #FALSE
- Set #SCNT 0
- Set #SCNT2 0
- Set %TimeOut 36000
- Set %WaitTimer 2000
- Set %HotkeyStart INSERT
- Set %HotkeySet SPACE
- Set %HotkeyEnd BACK
- Set %CarpTool BIG_AGG_BGG_CGG_DGG_EGG_HGG_IGG_JGG_KGG_BIG_
- Set %Logs ZLK_
- Set %Boards TLK_
- Set %Other EAG_
- Set %Tool FSF
- DeleteJournal
- DeleteJournal %N
- If *Trees = 0 || *Trees = N/A
- {
- Event SysMessage There are no set tree, press %HotkeySet to set trees.
- Event SysMessage Hit the %HotkeyEnd to stop setting trees.
- Set *Trees 0
- }
- Else
- {
- Event SysMessage Press %HotkeyStart to chop last *Trees trees.
- Event SysMessage Or press %HotkeySet to restart settings trees. Hit the %HotkeyEnd to stop setting trees.
- }
- FindItem %Tool C_ , #CHARID
- If #FINDKIND = -1
- {
- FindItem %Tool C_ ,
- If #FINDKIND = -1
- {
- Display Ok no hatchet in backpack or paperdoll
- Halt
- }
- ExEvent Drag #FINDID #FINDSTACK
- Wait 5
- ExEvent Droppd
- Wait 1s
- }
- Set %Hatchet #FINDID
- Set #LOBJECTID %Hatchet
- Setup:
- OnHotKey %Hotkeyset
- {
- Set *Trees 0
- Event Macro 17
- Target 10s
- Set:
- OnHotKey %HotkeyEnd
- {
- Event SysMessage Setting trees stopping. Press %HotkeyStart to chop last *Trees trees.
- If #TARGCURS = 1
- Key ESC
- Msg $
- GoTo Setup
- }
- If #TARGCURS = 0
- {
- Event SysMessage #LTARGETX #LTARGETY #LTARGETZ
- Set *TreeX . *Trees #LTARGETX
- Set *TreeY . *Trees #LTARGETY
- Set *TreeZ . *Trees #LTARGETZ
- Set *TreeT . *Trees #LTARGETTILE
- Set *Trees *Trees + 1
- Set *Hatchet #LOBJECTID
- Event SysMessage Set Tree # , *Trees
- Wait 1s
- Event Macro 17
- Target 10s
- GoTo Set
- }
- GoTo Set
- }
- OnHotKey %HotkeyStart
- {
- Set %Auto #TRUE
- Set *TreeIndex -1
- Event SysMessage Automatic chopping now.
- Set %Action = Idle
- Set #SCNT 29
- GoTo Chop
- }
- GoTo Setup
- Chop:
- FindItem %Tool C_ , #CHARID
- If #FINDKIND = -1
- {
- FindItem %Tool C_ ,
- If #FINDKIND = -1
- {
- Display Ok no hatchet in backpack or paperdoll
- Halt
- }
- ExEvent Drag #FINDID #FINDSTACK
- Wait 5
- ExEvent Droppd
- Wait 1s
- }
- Set %Hatchet #FINDID
- Set #LOBJECTID %Hatchet
- If #SCNT > 30 && %Auto = #TRUE
- Set %Action Idle
- If %Auto = #TRUE && %Action = Idle && #SCNT > 30
- {
- Set *TreeIndex ( *TreeIndex + 1 ) % *Trees
- Set #LTARGETX *TreeX . *TreeIndex
- Set #LTARGETY *TreeY . *TreeIndex
- Set #LTARGETZ *TreeZ . *TreeIndex
- Set #LTARGETTILE *TreeT . *TreeIndex
- Set #LTARGETKIND 3
- GoSub PathFind #LTARGETX #LTARGETY #LTARGETZ
- ;Set #LOBJECTID *Hatchet
- Repeat
- {
- Event Macro 17
- Target 10s a
- }
- Until #TARGCURS = 1
- Event Macro 22
- Set #SCNT 0
- Set %Action Auto
- }
- For %N 5 1
- {
- ScanJournal %N
- If You_stop_lumberjacking in #JOURNAL && %Auto = #TRUE || You_stop_chopping in #JOURNAL && %Auto = #TRUE
- {
- ;Event SysMessage Stopped. Press %Hotkey to restart.
- Set %Auto #TRUE
- Set %Action Idle
- Set #SCNT 30
- ScanJournal 1
- DeleteJournal
- GoSub CheckWeight
- GoTo Start
- }
- 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
- {
- DeleteJournal
- Set %Action Chopping
- Set #SCNT 0
- }
- If There's_not_enough_wood_here in #JOURNAL || There's_not_enough_wood_here_to_chop. in #SYSMSG
- {
- DeleteJournal
- Set #SCNT 30
- GoSub CheckWeight
- Set %Action Idle
- Set %Auto #TRUE
- Event SysMessage Reset
- If %Auto = #FALSE
- {
- If *Trees = 1
- Event SysMessage Done, let's chop down another tree.
- Else
- Event SysMessage That's *Trees trees. Chop on, or press %Hotkey to chop first one.
- }
- }
- }
- GoTo Chop
- Sub CheckWeight
- Wait 2s
- IgnoreItem Reset
- If #WEIGHT > %CarpWeight
- {
- FindItem %CarpTool C_
- If #FINDKIND <> -1
- {
- Set #LOBJECTID #FINDID
- FindItem %Logs C_ , #BACKPACKID
- If #FINDKIND <> -1
- {
- For %lugs 1 #FINDCNT
- {
- Set #FINDINDEX %lugs
- If #FINDCOL = 0
- {
- Event Macro 17
- Wait 2s
- Click 286 98
- Target 2s
- Set #LTARGETKIND 1
- Set #LTARGETID #FINDID
- Event Macro 22
- Wait 16s
- }
- IgnoreItem #FINDID
- }
- }
- }
- }
- If #SCNT2 > %TimeOut
- {
- Event SysMessage Chilling for %WaitTimer seconds.
- For %i 1 %WaitTimer
- {
- ;Event SysMessage %i
- Event Macro 18
- Wait 1s
- }
- Set #SCNT2 0
- }
- If #WEIGHT > %MaxWeight
- {
- msg .quip 2$
- GoSub RecallHome
- GoSub Drop
- GoSub RecallTrees
- msg .quip 1$
- }
- Return
- Sub Drop
- IgnoreItem Reset
- FindItem %Boards , _ , %Logs C_
- If #FINDKIND <> -1
- {
- For %Z 0 #FINDCNT
- {
- FindItem %Boards , _ , %Logs , _ , %Other C_
- ExEvent Drag #FINDID #FINDSTACK
- Wait 5
- ExEvent Dropc %Drop
- Wait 5
- }
- }
- Return
- Sub RecallTrees
- Set %OldX #CHARPOSX
- Set %OldY #CHARPOSY
- Mana1:
- If #MANA > 10
- {
- Repeat
- {
- Event Macro 15 31
- Target 4s
- }
- Until #TARGCURS = 1
- FindItem %TreeRune G_2
- Set #LTARGETID #FINDID
- Set #LTARGETKIND 1
- Event Macro 22
- Wait 1
- Repeat
- Until %OldX <> #CHARPOSX && %OldY <> #CHARPOSY
- Return
- }
- GoTo Mana1
- Sub RecallHome
- Set %OldX #CHARPOSX
- Set %OldY #CHARPOSY
- Mana2:
- If #MANA > 10
- {
- Repeat
- {
- Event Macro 15 31
- Target 4s
- }
- Until #TARGCURS = 1
- FindItem %HomeRune C_
- Set #LTARGETID #FINDID
- Set #LTARGETKIND 1
- Event Macro 22
- Wait 1
- Repeat
- Until %OldX <> #CHARPOSX && %OldY <> #CHARPOSY
- Return
- }
- GoTo Mana2
- Sub PathFind
- Repeat
- {
- Event PathFind %1 %2 %3
- Wait 2s
- If #CHARPOSX = %1 || #CHARPOSX = %1 + 1 || #CHARPOSX = %1 - 1
- Set %POSX #TRUE
- Else
- Set %POSX #FALSE
- If #CHARPOSY = %2 || #CHARPOSY = %2 + 1 || #CHARPOSY = %2 - 1
- Set %POSY #TRUE
- Else
- Set %POSY #FALSE
- }
- Until %POSY && %POSX
- Set %POSX #false
- Set %POSY #false
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement