-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebt.cmd
335 lines (331 loc) · 10.4 KB
/
debt.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
####################################
# Debt paying Script
# By Shroom of TF
####################################
echo
echo ===========================
echo *** PAYING OFF YOUR DEBT!!
echo ===========================
echo
TO_TELLER:
var plat 20
var fine 0
var wealth 0
var nofundloop 0
CHECKING_FINE:
echo
echo ===============
echo *** CHECKING CITY DEBT
echo ===============
echo
pause 0.2
if ("$zoneid" = "107") then goto FINECHECK_QI
if ("$zoneid" = "99") then goto FINECHECK_QI
if ("$zoneid" = "90") then goto FINECHECK_QI
if ("$zoneid" = "61") then goto FINECHECK_ZOLUREN
if ("$zoneid" = "1") then goto FINECHECK_ZOLUREN
if ("$zoneid" = "30") then goto FINECHECK_THERENGIA
if ("$zoneid" = "34a") then goto FINECHECK_THERENGIA
if ("$zoneid" = "42") then goto FINECHECK_THERENGIA
if ("$zoneid" = "47") then goto FINECHECK_THERENGIA
if ("$zoneid" = "67") then goto FINECHECK_ILITHI
if ("$zoneid" = "116") then goto FINECHECK_FORFEDHDAR
pause
echo
echo *** CRITICAL ERROR!
echo *** UKNOWN CITY LOCATION!!
echo
put #echo >Log Red *** CRITICAL ERROR!!!!
put #echo >Log Red *** UNKOWN CITY LOCATION: Zone- $zoneid Room- $roomid
put #echo >Log Red *** PAY YOUR FINE MANUALLY!
pause 0.1
exit
FINECHECK_QI:
var LOCATION FINECHECK_QI
matchre SET_FINE Qi\.\s*\((\d+) copper Lirums\)
send wealth
matchwait 8
goto NO_FINE
FINECHECK_THERENGIA:
var LOCATION FINECHECK_THERENGIA
matchre SET_FINE Therengia\.\s*\((\d+) copper Lirums\)
send wealth
matchwait 8
goto NO_FINE
FINECHECK_ZOLUREN:
var LOCATION FINECHECK_ZOLUREN
matchre SET_FINE Zoluren\.\s*\((\d+) copper Kronars\)
send wealth
matchwait 8
goto NO_FINE
FINECHECK_ILITHI:
var LOCATION FINECHECK_ILITHI
matchre SET_FINE Ilithi\.\s*\((\d+) copper Dokoras\)
send wealth
matchwait 8
goto NO_FINE
FINECHECK_FORFEDHDAR:
var LOCATION FINECHECK_FORFEDHDAR
matchre SET_FINE Forfedhdar\.\s*\((\d+) copper Dokoras\)
send wealth
matchwait 8
goto NO_FINE
SET_FINE:
pause 0.1
var fine $1
pause 0.1
eval fine replacere("%fine", ",", "")
eval fine replacere("%fine", " ", "")
math currentfine add %fine
pause 0.2
echo
echo ==================
echo *** CHECKING CURRENT CASH
echo ==================
echo
pause 0.1
if ("$zoneid" = "107") then goto CASHCHECK_QI
if ("$zoneid" = "99") then goto CASHCHECK_QI
if ("$zoneid" = "90") then goto CASHCHECK_QI
if ("$zoneid" = "61") then goto CASHCHECK_ZOLUREN
if ("$zoneid" = "1") then goto CASHCHECK_ZOLUREN
if ("$zoneid" = "30") then goto CASHCHECK_THERENGIA
if ("$zoneid" = "34a") then goto CASHCHECK_THERENGIA
if ("$zoneid" = "42") then goto CASHCHECK_THERENGIA
if ("$zoneid" = "47") then goto CASHCHECK_THERENGIA
if ("$zoneid" = "67") then goto CASHCHECK_ILITHI
if ("$zoneid" = "116") then goto CASHCHECK_FORFEDHDAR
##### CHECK CURRENT COINS ON YOU
CASHCHECK_QI:
var LOCATION CASHCHECK_QI
matchre NO_WEALTH ^No Lirums
matchre SET_WEALTH Lirums\s\(([\d,]+) copper Lirums\)\.
send wealth
matchwait 15
goto NO_WEALTH
CASHCHECK_THERENGIA:
var LOCATION CASHCHECK_THERENGIA
matchre NO_WEALTH ^No Lirums
matchre SET_WEALTH Lirums\s\(([\d,]+) copper Lirums\)\.
send wealth
matchwait 15
goto NO_WEALTH
CASHCHECK_ZOLUREN:
var LOCATION CASHCHECK_ZOLUREN
matchre NO_WEALTH ^No Kronars
matchre SET_WEALTH Kronars\s\(([\d,]+) copper Kronars\)\.
send wealth
matchwait 15
goto NO_WEALTH
CASHCHECK_ILITHI:
var LOCATION CASHCHECK_ILITHI
matchre NO_WEALTH ^No Dokoras
matchre SET_WEALTH Dokoras\s\(([\d,]+) copper Dokoras\)\.
send wealth
matchwait 15
goto NO_WEALTH
CASHCHECK_FORFEDHDAR:
var LOCATION CASHCHECK_FORFEDHDAR
matchre NO_WEALTH ^No Dokoras
matchre SET_WEALTH Dokoras\s\(([\d,]+) copper Dokoras\)\.
send wealth
matchwait 15
goto NO_WEALTH
SET_WEALTH:
var wealth $1
eval wealth replacere("%wealth", ",", "")
eval wealth replacere("%wealth", " ", "")
goto FINE_PROCESS
NO_WEALTH:
var wealth 0
FINE_PROCESS:
echo
echo =============
echo *** WEALTH: %wealth
echo =============
echo
pause 0.1
if (%fine = 0) then goto NO_FINE
if (%fine > 20000) then
{
put #echo >Log Crimson *** Warning! Large Fines in %CURRENT_CITY! Current Fine: %fine
if (%Debt = 0) then put #echo >Log Crimson *** Consider laying low from stealing for a few days or switching provinces!
}
if (%wealth > %fine) then
{
echo
echo =========================
echo *** Paying debt with cash on hand!
echo =========================
echo
pause 0.4
goto PAY.DEBT
}
if (%fine > 250000) then goto BIGGER_FINE
if (%fine > 100000) then goto BIG_FINE
goto WITHDRAW
WITHDRAW:
var LOCATION WITHDRAW
if ($invisible = 1) then gosub stopinvis
gosub AUTOMOVE teller
pause 0.2
pause 0.1
matchre WITHDRAW ^\.\.\.wait|^Sorry\,
matchre BANK.INVIS ^How can you withdraw money when the clerk can't even see
matchre TO.TELLER ^You must be at a bank teller's window
matchre PAY.DEBT ^The clerk counts out
matchre NO.FUNDS we are not lending money|You don't have that much
send withdraw %fine copper
matchwait 15
goto NO.FUNDS
BIG.FINE:
var LOCATION BIG.FINE
if ($invisible = 1) then gosub stopinvis
pause 0.2
pause 0.1
matchre BIG.FINE ^\.\.\.wait|^Sorry\,
matchre BANK.INVIS ^How can you withdraw money when the clerk can't even see
matchre TO.TELLER ^You must be at a bank teller's window
matchre PAY.DEBT ^The clerk counts out
matchre NO.FUNDS we are not lending money|You don't have that much
send withdraw %plat plat
matchwait 15
goto NO.FUNDS
BANK.INVIS:
delay 0.001
if ("$guild" = "Necromancer") then
{
put release eotb
pause 0.3
}
if ("$guild" = "Thief") then
{
put khri stop silence vanish
pause 0.3
}
if ("$guild" = "Moon Mage") then
{
put release rf
pause 0.3
}
pause 0.3
goto %LOCATION
BIGGER.FINE:
var LOCATION BIGGER.FINE
if (%fine > 200000) then var plat 25
if (%fine > 250000) then var plat 35
if (%fine > 350000) then var plat 40
if (%fine > 400000) then var plat 45
if (%fine > 450000) then var plat 50
if (%fine > 500000) then var plat 90
if (%fine > 900000) then var plat 120
if (%fine > 1200000) then var plat 150
if (%fine > 1500000) then var plat 200
if (%fine > 2000000) then var plat 300
goto BIG.FINE
NO.FINE:
echo
echo *** You have no fine!
echo
goto DONE.DEBT
PAY.DEBT:
var LOCATION PAY.DEBT
echo
echo **** Paying off your debt! ***
echo
pause 0.3
# Walking to pay off the debt
gosub AUTOMOVE debt
if ($invisible = 1) then gosub stopinvis
pause 0.2
send pay %fine
pause
if ("$zoneid" = "116") then
{
gosub automove 1teller
goto DONE.DEBT
}
if ("$zoneid" = "90") then
{
gosub AUTOMOVE 1teller
goto DONE.DEBT
}
gosub AUTOMOVE teller
DONE.DEBT:
var LOCATION DONE.DEBT
pause 0.1
if ($invisible = 1) then gosub stopinvis
send deposit all
pause 0.1
echo
echo ====================
echo ** DONE! Paid off Debt!
echo ** FINE PAID: %fine
echo ====================
echo
put #parse SCRIPT FINISHED!
put #parse SCRIPT FINISHED!
exit
##### AUTOMOVE SUBROUTINE #####
AUTOMOVE:
delay 0.0001
pause 0.0001
var Destination $0
var automovefailCounter 0
if $roomid = 0 then GOSUB MOVE.RANDOM
if (!$standing) then gosub AUTOMOVE.STAND
if ("%goPawn" = "ON") then goto PAWN.SKIP
if ("$roomid" = "%Destination") then return
AUTOMOVE.GO:
matchre AUTOMOVE.FAILED ^(?:AUTOMAPPER )?MOVE(?:MENT)? FAILED
matchre AUTOMOVE.RETURN ^YOU HAVE ARRIVED(?:\!)?
matchre AUTOMOVE.RETURN ^SHOP CLOSED(?:\!)?
matchre AUTOMOVE.RETURN ^SHOP IS CLOSED(?:\!)?
matchre AUTOMOVE.INVIS ^The shop appears to be closed, and you can't flag anyone down without being seen
matchre AUTOMOVE.FAIL.BAIL ^DESTINATION NOT FOUND
send #goto %Destination
matchwait
AUTOMOVE.STAND:
pause 0.1
matchre AUTOMOVE.STAND ^\.\.\.wait|^Sorry\,
matchre AUTOMOVE.STAND ^Roundtime\:?|^\[Roundtime\:?|^\(Roundtime\:?
matchre AUTOMOVE.STAND ^The weight of all your possessions prevents you from standing\.
matchre AUTOMOVE.STAND ^You are still stunned\.
matchre AUTOMOVE.STAND.PLAYING ^You are a bit too busy performing to do that\.
matchre AUTOMOVE.RETURN ^You stand(?:\s*back)? up\.
matchre AUTOMOVE.RETURN ^You are already standing\.
matchre AUTOMOVE.RETURN ^You begin to get up and
send stand
matchwait
AUTOMOVE.FAILED:
evalmath automovefailCounter (automovefailCounter + 1)
if (%automovefailCounter > 3) then goto AUTOMOVE.FAIL.BAIL
send #mapper reset
pause 0.5
goto AUTOMOVE.GO
AUTOMOVE.FAIL.BAIL:
put #echo
put #echo >$Log Crimson *** AUTOMOVE FAILED. ***
put #echo >$Log Destination: %Destination
put #echo Crimson *** AUTOMOVE FAILED. ***
put #echo Crimson Destination: %Destination
put #echo Crimson Skipping to next shop
put #echo
put #parse MOVE FAILED
gosub clear
goto %LAST
AUTOMOVE.RETURN:
if matchre("%Destination", "teller|exchange|debt|PAWN") then if $invisible = 1 then gosub stopinvis
pause 0.001
return
AUTOMOVE.STAND.PLAYING:
matchre AUTOMOVE.STAND ^You stop playing your song\.|^In the name of love\?
send stop play
matchwait 15
goto AUTOMOVE.STAND
AUTOMOVE.INVIS:
send hum scale
pause 0.2
send stop hum
pause 0.5
goto AUTOMOVE.GO