Lumberjacking with hiding, tracking, and camping by wolfgeist
Description: Modified based on Jaseown's lumberjacking script. Hides after a certain amount of failed attempts, and stays hidden until you move again.
Occasionally puts logs into a trapped pouch.
When tracking a PK, it will attempt to clear hands, hide, then hike. This script assumes you have 3 trapped pouches, if you have less than 3 it will assume there's a thief and will attempt to run the same "camp" script to escape. This script assumes you have a script named "camp" that will attempt to hike away or recall. Adjust to your own needs.
Also uses getlabel to verify the durability of your hatchet. It will again use the "camp" script to go to a safe place if your hatchet has 5 uses. The idea being you can then recycle that hatchet and get half of your ingots back instead of wasting it. Also gives warnings once your hatchet is at 50 uses or below.
1if targetexists 'neutral'
2 hotkey 'Target Self'
3endif
4
5if not dead
6 if not hidden
7 if hp < maxhp and not bandaging
8 hotkey 'Bandage Self'
9 endif
10 wait 50
11 endif
12endif
13
14//CHECK FOR TRACKING
15
16while not findbuff 'tracking'
17
18skill 'tracking'
19waitforgump 4267467659
20gumpresponse 6
21waitforgump 4267467659
22gumpclose
23endwhile
24
25//ANTI THIEF
26
27
28if findtype hatchet lefthand as myhatchet
29 getlabel myhatchet hlabel
30 if '(50 uses' in hlabel or '(45 uses' in hlabel or '(40 uses' in hlabel or '(35 uses' in hlabel or '(30 uses' in hlabel or '(25 uses' in hlabel or '(20 uses' in hlabel or '(15 uses' in hlabel or '(10 uses' in hlabel or '(9 uses' in hlabel or '(8 uses' in hlabel or '(7 uses' in hlabel
31 overhead "My hatchet is damaged!" 38
32 elseif '(5 uses' in hlabel or '(4 uses' in hlabel or '(3 uses' in hlabel or '(2 uses' in hlabel or '(1 uses' in hlabel
33 overhead 'Looking for another hatchet'
34 if findtype 'hatchet' backpack
35 dclicktype 'hatchet' backpack
36 wait 1000
37 overhead 'Hatchet found, restarting!'
38 replay
39 endif
40
41 clearhands 'both'
42 overhead 'Stopping script, hatchet is about to break.' 38
43 pause 1000
44 clearhands 'both'
45 if not hidden
46 skill 'hiding'
47 endif
48 script 'Camp'
49 endif
50endif
51
52//This assumes you have 3 trapped pouches. Adjust for however many you carry. If a thief opens a trapped pouch
53//it will count fewer trapped pouches and trigger the "camp" script which will do whatever you set it to do,
54//for me it drops weapon, hides, lights a fire, and hikes away.
55
56if counttype 'pouch' backpack 38 < 3
57 overhead "THIEF ALERT!" 38
58 pause 250
59 script 'camp'
60endif
61
62//END ANTI-THIEF
63
64
65if not listexists "lumberjack_actions"
66 createlist "lumberjack_actions"
67endif
68
69if not listexists "4-failures"
70 createlist "4-failures"
71endif
72
73//Red alert
74
75if inlist "lumberjack_actions" "red_alert"
76 overhead "Red Alert!" 34
77 poplist "lumberjack_actions" "red_alert"
78 clearhands 'both'
79 pause 250
80 skill 'Hiding'
81 overhead "Stopping script..." 34
82 clearsysmsg
83 pause 250
84 script 'Camp'
85endif
86
87if hidden
88 clearlist "4-failures"
89endif
90
91//Break after 5 failures
92
93if list "4-failures" = 1
94 overhead "Ive gathered all I can here."
95//hide wood in trapped pouch
96if findtype "pouch" backpack 38 as trappedPouch
97overhead 'Hiding logs.'
98while findtype "log%s" backpack as wood
99 lift wood 60000
100 drop trappedPouch -1 -1 -1
101 @ignore wood
102endwhile
103endif
104//
105elseif list "4-failures" = 7
106 overhead "Im going to rest soon."
107elseif list "4-failures" = 8
108 overhead "Taking a break." 34
109 wait 250
110elseif list "4-failures" = 9
111 wait 250
112elseif list "4-failures" >= 10
113 wait 250
114 if skill "Hiding" >= 40
115 useskill "Hiding"
116 endif
117 pause 100
118 while hidden
119 pause 500
120 clearlist "4-failures"
121 if insysmsg "now tracking"
122 overhead 'MURDERER ON THE PROWL!' 34
123 pause 50
124 script 'Camp'
125 endif
126 endwhile
127endif
128
129##CLEAR SYSMSG
130clearsysmsg
131##CLEAR SYSMSG
132
133
134//Check for hatchet
135
136if lhandempty ?? 0
137 if findtype 'hatchet' backpack
138 dclicktype 'hatchet' backpack
139 wait 200
140 endif
141endif
142
143if lhandempty ?? 0
144 overhead "I need a hatchet." 34
145 replay
146endif
147
148//Main chopping loop
149if insysmsg "You chop"
150 clearlist "4-failures"
151endif
152wait 50
153hotkey 'Use item in hand'
154wft 5000
155hotkey 'Target Self'
156if insysmsg "harvestable"
157
158endif
159
160for 75
161 wait 150
162 if insysmsg 'world is saving'
163 pause 50
164 hotkey 'Clear Target Queue'
165 hotkey 'Cancel Current Target'
166 for 30
167 overhead 'Waiting for world save...'
168 wait 1000
169 if insysmsg 'save complete'
170 overhead 'Save complete - continue on!' 88
171 clearsysmsg
172 wait 250
173 replay
174 elseif insysmsg "now tracking"
175 pushlist "lumberjack_actions" "red_alert"
176 clearsysmsg
177 wait 250
178 replay
179 endif
180 endfor
181 elseif insysmsg "now tracking"
182 pushlist "lumberjack_actions" "red_alert"
183 replay
184 elseif insysmsg "harvestable"
185 wait 250
186 pushlist "4-failures" "failure"
187 replay
188 elseif lhandempty ?? 0
189 overhead "Broke axe" 34
190 replay
191 elseif insysmsg 'You do not see any' or insysmsg 'You cannot produce any wood'
192 wait 500
193 replay
194 elseif insysmsg "travel"
195 overhead 'Waiting for travel...'
196 wait 1000
197 replay
198 else
199 if insysmsg "any harvestable" or insysmsg "lumberjack_actions"
200 // No Ore
201 overhead 'Move to next spot' 88
202 replay
203 elseif insysmsg "skillgain" or insysmsg "harvesting is not allowed"
204 // Gained skill
205 replay
206 elseif insysmsg "world is saving" or insysmsg 'World save complete'
207 // World Save
208 replay
209 elseif insysmsg "You hack"
210 // Failed
211 replay
212 elseif insysmsg "You chop"
213 clearlist "4-failures"
214 replay
215 elseif insysmsg "You must wait"
216 // Wait message
217 overhead 'You must wait..' 34
218 wait 500
219 replay
220 endif
221 endif
222endfor
223overhead 'Captcha break!' 34
224for 10
225 overhead 'Awaiting Captcha...' 34
226 wait 1000
227 if insysmsg 'Captcha successful'
228 overhead 'Success - continue on!' 88
229 wait 1000
230 replay
231 endif
232endfor
233replay