-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcraftlibrary.cmd
More file actions
2127 lines (1963 loc) · 69.2 KB
/
craftlibrary.cmd
File metadata and controls
2127 lines (1963 loc) · 69.2 KB
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
var disciplines weaponsmithing|armorsmithing|blacksmithing|tailoring
var difficulties easy|challenging|hard
action var product $1; var quantity $2; var quality $3; var timelimit $4 when \w+ shuffles through some notes and says, "Alright, this is an order for(?:a|an|some)? ?(.*)\. I need (\d+) (finely-crafted|of superior quality|of exceptional quality), made from any (?:material|leather|fabric) and due in (\d+) roisaen\.
action var chapter $1 when You seem to recall this item being somewhere in chapter (\d+) of the instruction book\.
action var volume $1 when \(1\) refined metal ingot \((\d+) volume\)
action var yards $1; var materialnoun cloth when \(1\) finished fabric cloth \((\d+) yards\)
action var yards $1; var materialnoun leather when \(1\) refined leather material \((\d+) yards\)
action var polelong $1 when \((\d+)\) finished long wooden pole
action var poleshort $1 when \((\d+)\) finished short wooden pole
action var haft $1 when \((\d+)\) finished wooden haft
action var hilt $1 when \((\d+)\) finished wooden hilt
action var cordshort $1 when \((\d+)\) finished short leather cord
action var cordlong $1 when \((\d+)\) finished long leather cord
action var handle $1 when \((\d+)\) finished metal shield handle
action var handleleather $1 when \((\d+)\) finished leather shield handle
action var boss $1 when \((\d+)\) finished metal shield boss
action var padlarge $1 when \((\d+)\) finished large cloth padding
action var padsmall $1 when \((\d+)\) finished small cloth padding
action var backinglarge $1 when \((\d+)\) finished large leather backing
action var backingsmall $1 when \((\d+)\) finished small leather backing
action math expenses add $1; var currency $2 when The attendant says, "You can purchase (?:a|an|some) \w+ \w+ \w+ for (\d+) (Kronars|Lirums|Dokoras)\.
action math expenses add $1; var currency $2 when The attendant says, "You can purchase (?:a|an|some) \w+ \w+ for (\d+) (Kronars|Lirums|Dokoras)\.
action math expenses add $1; var currency $2 when You decide to purchase the \w+, and pay the sales clerk (\d+) (Kronars|Lirums|Dokoras)\.
action math expenses add $1; var currency $2 when The sentry holds out (?:his|her) hand, saying, "That'll be (\d+) (Kronars|Lirums|Dokoras), (?:sir|madam)\."
action math expenses add $1; var currency $2 when You hand the clerk (\d+) (Kronars|Lirums|Dokoras) and (?:he|she) gives you back a repair ticket\.
action var revenue $1; var currency $2 when You hand \w+ your logbook and bundled items, and are given (\d+) (Kronars|Lirums|Dokoras) in return\.
goto CRAFTLIBEND
#####VARIABLE_SUBS#####
AREAVARINIT:
#AESRY,DIRGE,LETH,KRESH,RATHA,HAVEN
#CROSSING
if ($zoneid = 1) then
{
if (("%discipline" = "weaponsmithing") || ("%discipline" = "armorsmithing") || ("%discipline" = "blacksmithing")) then
{
var mastername Yalda
var masterrange 961|960|903|904|902|865|906|1021|905|962|963
var suppliesroom 906
var bulkroom 1021
var toolroom 905
var partsroom 905
var repairroom 905
var repairname clerk
var cruciblerange 960|903|961|904
var anvilrange 962|963|907|908|909
var bucketroom 0
var privateforge 906
var privateforgedoor stone door
}
if ("%discipline" = "tailoring") then
{
var mastername Milline
var masterrange 873|910|911|912|913|914|915|916
var suppliesroom 914
var bulkroom 0
var toolroom 913
var partsroom 0
var repairroom 9114
var repairname clerk
var workroom 917
var bucketroom 921
#var privateforge 906
#var privateforgedoor stone door
#var workrooms 917|918|919|920|921|922|923|924
}
}
#SHARD
if ($zoneid = 67) then
{
if (("%discipline" = "weaponsmithing") || ("%discipline" = "armorsmithing") || ("%discipline" = "blacksmithing")) then
{
var mastername Serric
var masterrange 644|645|649|650|653|654|655|658|646|661|800
var suppliesroom 658
var bulkroom 800
var toolroom 653
var partsroom 653
var repairroom 650
var repairname clerk
var cruciblerange 659|656|651|647
var anvilrange 660|657|652|648
var privateforge 655
var privateforgedoor guarded archway
}
}
#MERKRESH
if ($zoneid = 107) then
{
if (("%discipline" = "weaponsmithing") || ("%discipline" = "armorsmithing") || ("%discipline" = "blacksmithing")) then
{
var mastername Kapric
var masterrange 332|333|334|335|336
var suppliesroom 334
var bulkroom 0
var toolroom 335
var partsroom 335
var repairroom 335
var repairname clerk
var cruciblerange 337|338|339|340|341
var anvilrange 342|343|344|345|346
var privateforge 0
var privateforgedoor guarded archway
}
}
#HIB
if ($zoneid = 116) then
{
if (("%discipline" = "weaponsmithing") || ("%discipline" = "armorsmithing") || ("%discipline" = "blacksmithing")) then
{
var mastername Juln
var masterrange 401|402|403|404|405|406|407|408|409|410|411|412|413
var suppliesroom 409
var bulkroom 0
var toolroom 407
var partsroom 407
var repairroom 402
var repairname clerk
var cruciblerange 403|404|405|406
var anvilrange 410|411|412|413
var privateforge 402
var privateforgedoor battered doors
}
if ("%discipline" = "tailoring") then
{
var mastername Master
var masterrange 474|466|467|468|469|470|471|472|473
var suppliesroom 471
var bulkroom 0
var toolroom 473
var partsroom 0
var repairroom 473
var repairname clerk
}
}
return
CRAFTVARLOAD:
var crafting $m%varsetcrafting
var forging $m%varsetforging
var outfitting $m%varsetoutfitting
var craftingstorage $craftingstorage
var craftingstoragelocation $craftingstoragelocation
var forgingdifficulty $forgingdifficulty
var forgingmaterial $forgingmaterial
var forgingdiscipline $forgingdiscipline
var forgingrepair $forgingrepair
var forgingprivateroom $forgingprivateroom
var forgingmaxvolumes $forgingmaxvolumes
var forgingmaxquantity $forgingmaxquantity
var forgingsmelting $forgingsmelting
var outfittingdifficulty $outfittingdifficulty
var outfittingcloth $outfittingcloth
var outfittingleather $outfittingleather
var outfittingrepair $outfittingrepair
var outfittingmaxquantity $outfittingmaxquantity
var outfittingmaxyards $outfittingmaxyards
var awl $awl
var bellows $bellows
var hammer $hammer
var knittingneedles $knittingneedles
var pliers $pliers
var scissors $scissors
var sewingneedles $sewingneedles
var shovel $shovel
var slickstone $slickstone
var rod $rod
var tongs $tongs
var yardstick $yardstick
var restartorder 0
var workorderbail 0
var expenses 0
var revenue 0
var mindstatebegin $Forging.LearningRate
var timebegin $gametime
if (("%discipline" = "weaponsmithing") || ("%discipline" = "armorsmithing") || ("%discipline" = "blacksmithing")) then var crafttype forging
if ("%discipline" = "tailoring") then var crafttype outfitting
var forgingrepairlist %bellows|%hammer|%shovel|%rod|%tongs
var outfittingrepairlist %sewingneedles|%scissors|%awl|%yardstick|%slickstone|%knittingneedles
return
#####WORKORDER_SUBS#####
CRAFTINGABORT:
var workorderbail 1
var forging NO
put #var forging NO
return
CRAFTINGEND:
gosub STOREDEFAULT %storage
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
if ("$lefthand" != "Empty") then gosub PUTITEM my $lefthandnoun in my %craftingstorage
gosub CLOSEITEM my %craftingstorage
if ("%craftingstoragelocation" = "portal") then
{
gosub REMITEM %craftingstorage
gosub PUTITEM %craftingstorage in my portal
}
return
CRAFTINGSTART:
gosub FINDITEM %craftingstorage
if (%finditemfound = 0) then
{
if ("%craftingstoragelocation" = "vault") then
{
if ("%forgingtown" != "%vaulttown") then
{
put #echo %alertwindow Yellow CraftingStorageLocation is Vault, but VaultTown != ForgingTown! Ending crafting.
gosub CRAFTINGABORT
return
}
}
if ("%craftingstoragelocation" = "portal") then
{
put look in my portal
gosub GETITEM %craftingstorage in my portal
if (matchre("$righthand", "%craftingstorage")) then
{
gosub WEARITEM %craftingstorage
}
else
{
put #echo %alertwindow Yellow [CRAFT]: Could not find crafting storage.
exit
}
}
else
{
put #echo %alertwindow Yellow [CRAFT]: Could not find crafting storage.
exit
}
}
gosub OPENITEM my %craftingstorage
put store default %craftingstorage
return
WORKORDER:
#ACQUIRE_TASK
gosub FINDMASTER
gosub TASKACQUIRE
if (%workorderbail = 1) then return
gosub PUTITEM %discipline book in %craftingstorage
if ("%crafttype" = "forging") then
{
put #echo Yellow Work Order: %quantity %product %quality in %timelimit roisaen.
put #echo Yellow Volumes: %totalvolume
put #echo Yellow CordLong: %totalcordlong.....CordShort: %totalcordshort
put #echo Yellow Hafts: %totalhaft.....Hilts: %totalhilt
put #echo Yellow Long Poles: %totalpolelong.....Short Poles: %totalpoleshort
put #echo Yellow Handles: %totalhandle.....Bosses: %totalboss
put #echo Yellow PadLarge: %totalpadlarge.....PadSmall: %totalpadsmall
put #echo Yellow BackingLarge: %totalbackinglarge.....BackingSmall: %totalbackingsmall
}
if ("%crafttype" = "outfitting") then
{
put #echo Yellow Work Order: %quantity %product %quality in %timelimit roisaen.
put #echo Yellow Yards: %totalyards.....MaterialNoun: %materialnoun
#put #echo Yellow CordLong: %totalcordlong.....HandleLeather: %totalhandleleather
put #echo Yellow PadLarge: %totalpadlarge.....PadSmall: %totalpadsmall
}
#MATERIALS_PURCHASE
if ("%crafttype" = "outfitting") then
{
#CHECKING_EXISTING_MATERIAL
if ("%materialnoun" = "cloth") then var material %outfittingcloth
if ("%materialnoun" = "leather") then var material %outfittingleather
var goodfabric 0
gosub FABRICCHECK
if (%goodfabric != 1) then
{
#PURCHASING_MATERIAL
#PURCHASING_PARTS
#gosub ORDERPARTS
}
exit
}
if ("%crafttype" = "forging") then
{
#CHECKING_EXISTING_INGOT
var goodingot 0
gosub INGOTCHECK
if (%goodingot != 1) then
{
#PURCHASING_INGOTS
var ingotsused 0
gosub ORDERBULK
if ("%forgingsmelting" = "YES") then gosub ORDERMATERIALS
if (%ingotsused = 0) then
{
put #echo Yellow Could not find a combination of ingots to use when smelting is %forgingsmelting. Turning off forging.
gosub CRAFTINGABORT
return
}
}
else
{
var ingotsused 1
put #echo Yellow Had a big enough ingot already!
}
#PURCHASING_PARTS
gosub ORDERPARTS
#PURCHASING_OIL
gosub COUNTOIL
put #echo oilcount: %oilcount
put #echo quantity: %quantity
if (%oilcount < %quantity) then
{
if ($roomid != %partsroom) then gosub MOVE %toolroom
gosub CRAFTINGORDER 6
gosub PUTITEM my oil in my %craftingstorage
}
#SMELTING
put #echo Yellow IngotsUsed: %ingotsused
if (%ingotsused > 1) then
{
if ("%forgingsmelting" = "YES") then
{
gosub FINDCRUCIBLE
if (%foundcrucible = 0) then
{
put #echo Yellow No free crucibles!
put store default %storage
return
}
gosub SMELTPUT %material
gosub SMELT
}
else
{
put #echo Yellow Needed more than one ingot, but smelting is turned off! Turning off crafting.
put #echo %alertwindow Yellow Needed more than one ingot, but smelting is turned off! Turning off crafting.
gosub CRAFTINGABORT
return
}
}
}
#CRAFTING
if (%t >= %privateroomuntil) then gosub FINDANVIL
else var foundanvil 0
if (%foundanvil = 0) then
{
if (("%forgingprivateroom" = "YES") && (%privateforge != 0)) then
{
gosub MOVE %privateforge
gosub GOPRIVATEROOM %privateforgedoor
var privateroomuntil %t
math privateroomuntil add 3550
var rentedprivateroom 1
var usingprivateroom 1
}
else
{
put #echo %alertwindow Yellow [CRAFT]: No free anvils! Stopping forging!
gosub CRAFTINGABORT
return
}
}
gosub GETITEM %discipline book
if ((!matchre("$righthandnoun", "book")) && (!matchre("$lefthandnoun", "book"))) then
{
put #echo Yellow Could not find %discipline book! Turning off crafting.
put #echo %alertwindow Yellow Could not find %discipline book! Turning off crafting.
gosub CRAFTINGABORT
return
}
gosub CRAFTING
if (%restartorder = 1) then
{
var restartorder 0
goto WORKORDER
}
if (%usingprivateroom = 1) then
{
gosub MOVEROOMS go %privateforgedoor
var usingprivateroom 0
}
gosub FINDMASTER
gosub GETITEM logbook from my %craftingstorage
put #echo righthandnoun: $righthandnoun
if (!matchre("$righthandnoun", "logbook")) then
{
put #echo %alertwindow Yellow Could not find logbook! Ending crafting.
put #echo Yellow Could not find logbook! Ending crafting.
gosub CRAFTINGABORT
return
}
gosub GIVEMASTERLOG %mastername
gosub PUTITEM logbook in my %craftingstorage
put #echo Yellow Crafting complete!
var profit %revenue
math profit subtract %expenses
var mindstatetotal $Forging.LearningRate
math mindstatetotal subtract %mindstatebegin
var timetotal $gametime
math timetotal subtract %timebegin
var timetotalmod %timetotal
math timetotalmod modulus 6
math timetotal subtract %timetotalmod
var timetotalminutes %timetotal
math timetotalminutes / 60
put #echo >Log [CRAFT] Completed %difficulty %discipline work order in %material. Revenue: %revenue - Expenses: %expenses = Profit: %profit %currency. Mindstates gained: %mindstatetotal in %timetotalminutes minutes.
return
CRAFTREPAIR:
#REPAIR
var craftrepairing 0
if (("%discipline" = "weaponsmithing") || ("%discipline" = "armorsmithing") || ("%discipline" = "blacksmithing")) then
{
if ("%forgingrepair" = "YES") then var craftrepairing 1
}
if (%craftrepairing = 1) then
{
put #echo Yellow Repairing tools.
if ($roomid != %repairroom) then gosub MOVE %repairroom
gosub CRAFTREPAIRLOOP %repairname %crafttype
gosub CRAFTTICKETLOOP %repairname
}
return
FABRICCHECK:
gosub COMBINEALL %material %materialnoun
gosub GETITEM %material %materialnoun in my %craftingstorage
if ("$righthand" = "Empty") then return
gosub COUNT my %material %materialnoun
var fabricyards %counttotal
put #echo Yellow fabricyards: %fabricyards
put #echo Yellow totalyards: %totalyards
if (%fabricyards >= %totalyards) then
{
gosub PUTITEM %materialnoun in my %craftingstorage
var goodfabric 1
}
else
{
#gosub MOVEROOM %bucketroom
#gosub DUMPITEM %material %materialnoun
}
return
INGOTCHECK:
gosub GETITEM %material ingot in my %craftingstorage
if ("$righthand" = "Empty") then return
action (ingotcheck) var ingotvolume $1 when About (\d+) volume of metal was used in this item's construction\.
gosub ANALYZECRAFT %material ingot
action (ingotcheck) off
put #echo Yellow ingotvolume: %ingotvolume
if (%ingotvolume >= %totalvolume) then
{
gosub PUTITEM ingot in my %craftingstorage
var goodingot 1
return
}
else
{
gosub FINDCRUCIBLE
gosub DUMPITEM %material ingot
goto INGOTCHECK
}
COUNTINGOT:
var ingotcount 0
COUNTINGOTP:
pause
COUNTINGOTMAIN:
matchre COUNTINGOTP %waitstring
matchre COUNTINGOTGOOD About (\d+) volumes of material make up the \w+ ingot\.
matchre COUNTINGOTGOOD About (\d+) volume of material make up the \w+ ingot\.
match RETURN I could not find what you were referring to.
put count my ingot
matchwait
COUNTINGOTGOOD:
var ingotcount $1
return
COUNTOIL:
var oilcount 0
COUNTOILP:
pause
COUNTOILMAIN:
matchre COUNTOILP %waitstring
matchre COUNTOILGOOD The oil has (\d+) uses remaining\.
matchre COUNTOILGOOD The oil has (\d+) use remaining\.
match RETURN I could not find what you were referring to.
put count my oil in my %craftingstorage
matchwait
COUNTOILGOOD:
var oilcount $1
return
ANALYZECRAFT:
var analyzestring $0
goto ANALYZECRAFTMAIN
ANALYZECRAFTP:
pause
ANALYZECRAFTMAIN:
matchre ANALYZECRAFTP %waitstring
match RETURN Roundtime:
put analyze my %analyzestring
matchwait
#####CORE_CRAFTING#####
CRAFTING:
var craftcount 0
CRAFTINGMAIN:
if (%craftcount >= %quantity) then return
gosub GETITEM %discipline book
if ((!matchre("$righthandnoun", "book")) && (!matchre("$lefthandnoun", "book"))) then
{
put #echo Yellow Could not find %discipline book! Turning off crafting.
put #echo %alertwindow Yellow Could not find %discipline book! Turning off crafting.
gosub CRAFTINGABORT
return
}
if (%workorder != 1 ) then
{
action (pageread) on
action (pageread) var productcheck $3 when \-\= Chapter (\d+), Page (\d+)\: Instructions for crafting (.*) \=\-
if ("%discipline" = "tailoring") then
{
action (pageread) var materialnoun $1 when \(\d+\) (?:finished|refined) fabric (cloth|yarn) \(\d+ yards\)
}
gosub READBOOK my %discipline book
gosub TAPNOUN %productcheck
var product %nountap
action (pageread) off
#echo product: %product
#echo materialnoun: %materialnoun
}
gosub STUDYBOOK my %discipline book
gosub PUTITEM %discipline book in %craftingstorage
gosub TAPNOUN %product
var product %nountap
if (("%discipline" = "weaponsmithing") || ("%discipline" = "armorsmithing") || ("%discipline" = "blacksmithing")) then
{
gosub ANVILCHECK
if (%cleananvil = 2) then
{
gosub GETITEM ingot on anvil
put #echo %alertwindow Yellow Found $righthand on the anvil before working! Stowed, please investigate.
gosub PUTITEM ingot in my %craftingstorage
}
gosub GETITEM my %material ingot in %craftingstorage
gosub PUTITEM my %material ingot on anvil
gosub FORGE
if (%restartorder = 1) then return
}
if ("%discipline" = "tailoring") then
{
gosub GETITEM my %material %materialnoun in %craftingstorage
gosub SWAP
gosub TAILOR
}
if (%workorder = 1) then
{
gosub GETITEM logbook
gosub LOGBOOKBUNDLE %product
gosub PUTITEM logbook in my %craftingstorage
gosub GETITEM %material ingot in my %craftingstorage
gosuB PUTITEM %material ingot in my %craftingstorage
}
else
{
gosub STOW right
#gosub PUTITEM %product in %craftingstorage
}
math craftcount add 1
goto CRAFTINGMAIN
#####ZASELE_SUBS#####
ZASELECRAFTING:
var craftcount 0
ZASELECRAFTINGMAIN:
if (%craftcount >= %quantity) then return
gosub GETITEM %product instructions
if ("$righthandnoun" != "instructions") then
{
gosub LOCATIONCHECK
gosub FINDZASELENEW
gosub GETINSTRUCTIONS
gosub PUTITEM instructions in my %craftingstorage
gosub MOVE dolphin
gosub GOCORRAL
gosub MOVE %workroom
gosub GETITEM %product instructions
}
gosub STUDYINSTRUCTIONS
gosub PUTITEM my instructions in my %craftingstorage
gosub GETITEM my %material %materialnoun in %craftingstorage
gosub SWAP
gosub TAPNOUN %product
var product %nountap
if ("%discipline" = "tailoring") then gosub TAILOR
if ("%discipline" = "knitting") then gosub KNIT
gosub PUTITEM $righthand in my %craftingstorage
gosub PUTITEM %product in %craftingstorage
math craftcount add 1
goto ZASELECRAFTINGMAIN
STUDYINSTRUCTIONSP:
pause
STUDYINSTRUCTIONS:
matchre STUDYINSTRUCTIONSP %waitstring
match STUDYINSTRUCTIONS The delicate nature of the instructions will cause them to wear out with use.
match RETURN You now feel ready to begin the crafting process.
put study instructions
matchwait
#####KNITTING_SUBS#####
KNIT:
var firstcut 1
var craftaction knitknit
goto KNITMAIN
KNITP:
pause
KNITMAIN:
#GETTINGTOOLS
if ("%craftaction" = "knitknit") then
{
if ("$righthandnoun" != "needles") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %knittingneedles in my %craftingstorage
}
}
#MATCHES
matchre KNITP %waitstring
match KNITTURN Now the needles must be turned
match KNITTURN Some ribbing should be added
match KNITPUSH Next the needles must be pushed
match KNITPUSH ready to be pushed
#match KNITPUSH Upon finishing you realize the pattern is uneven and off by one
match KNITCAST The garment is nearly complete and now must be cast off
match KNITKNIT Roundtime:
match KNITKNIT The needles doesn't appear suitable for working on an unfinished
matchre KNITUNFINISHED You are already knitting an .*\. You must finish this before starting another project\.
match RETURN The needles doesn't appear suitable for working on
match RETURN You add a row of double stitches to
#ACTIONS
if ("%craftaction" = "knitknit") then
{
if (%firstcut = 1) then put knit my yarn with my %knittingneedles
else put knit my %knittingneedles
}
if ("%craftaction" = "knitcast") then put cast my %knittingneedles
if ("%craftaction" = "knitpush") then put push my %knittingneedles
if ("%craftaction" = "knitturn") then put turn my %knittingneedles
matchwait
KNITUNFINISHED:
var firstcut 0
gosub PUTITEM %material %materialnoun in my %craftingstorage
var craftaction knitknit
goto KNITMAIN
KNITKNIT:
if (%firstcut = 1) then
{
var firstcut 0
gosub PUTITEM %material %materialnoun in my %craftingstorage
}
var craftaction knitknit
goto KNITMAIN
KNITPUSH:
if (%firstcut = 1) then
{
var firstcut 0
gosub PUTITEM %material %materialnoun in my %craftingstorage
}
var craftaction knitpush
goto KNITMAIN
KNITTURN:
if (%firstcut = 1) then
{
var firstcut 0
gosub PUTITEM %material %materialnoun in my %craftingstorage
}
var craftaction knitturn
goto KNITMAIN
KNITCAST:
if (%firstcut = 1) then
{
var firstcut 0
gosub PUTITEM %material %materialnoun in my %craftingstorage
}
var craftaction knitcast
goto KNITMAIN
#####TAILORING_SUBS#####
TAILOR:
var firstcut 1
var craftaction cut
goto TAILORMAIN
TAILORP:
pause
TAILORMAIN:
#GETTINGTOOLS
if ("%craftaction" = "awl") then
{
if ("$righthandnoun" != "awl") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %awl in my %craftingstorage
}
}
if ("%craftaction" = "cut") then
{
if ("$righthandnoun" != "scissors") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %scissors in my %craftingstorage
}
}
if ("%craftaction" = "pins") then
{
if ("$righthandnoun" != "pins") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM straight pins in my %craftingstorage
if ("$righthandnoun" != "pins") then gosub NEWPINS
}
}
if ("%craftaction" = "sew") then
{
if ("$righthandnoun" != "needles") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %sewingneedles in my %craftingstorage
}
}
if ("%craftaction" = "slickstone") then
{
if ("$righthandnoun" != "slickstone") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %slickstone in my %craftingstorage
}
}
if ("%craftaction" = "yardstick") then
{
if ("$righthandnoun" != "yardstick") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %yardstick in my %craftingstorage
}
}
#MATCHES
matchre TAILORP %waitstring
match AWL One leather piece is too thick for the needle to penetrate and needs holes punched in it.
match AWL A critical section of leather needs holes punched into it so more thread can secure it.
match CUT With the measuring complete, now it is time to cut away more of the fabric with scissors.
match CUT With the measuring complete, now it is time to cut away more of the leather with scissors.
match PINS Two layers of the fabric won't cooperate and could use some pins to align them.
match PINS The leather keeps bending apart and could use some pins to keep it together.
match PINS Two pieces of the leather won't cooperate and could use some pins to align them.
match PINS The fabric keeps folding back and could use some pins to keep it straight.
match SEW Roundtime
match SLICKSTONE The fabric develops wrinkles from all the handling and could use a quick ironing.
match SLICKSTONE A deep crease develops along the fabric, bunching it together awkwardly.
match YARDSTICK The leather's dimensions appear to have shifted and could benefit from some remeasuring.
match YARDSTICK The fabric's dimensions appear to have shifted and could benefit from some remeasuring.
match NEWTHREAD The needles need to have thread put on them before they can be used for sewing. You think you can STUDY them to learn more.
#match NEWPINS
match RETURN You realize that cannot be repaired, and stop.
#ACTIONS
if ("%craftaction" = "cut") then
{
if (%firstcut = 1) then put cut my %materialnoun with my %scissors
else put cut my %product with my %scissors
}
if ("%craftaction" = "awl") then put poke my %product with my %awl
if ("%craftaction" = "pins") then put poke my %product with my straight pins
if ("%craftaction" = "sew") then put push my %product with my %sewingneedles
if ("%craftaction" = "slickstone") then put rub my %product with my %slickstone
if ("%craftaction" = "yardstick") then put measure my %product with my %yardstick
matchwait
AWL:
var craftaction awl
goto TAILORMAIN
CUT:
var craftaction cut
goto TAILORMAIN
PINS:
var craftaction pins
goto TAILORMAIN
SEW:
if (%firstcut = 1) then
{
var firstcut 0
gosub PUTITEM my %scissors in my %craftingstorage
gosub GETITEM %material %materialnoun
gosub PUTITEM %material %materialnoun in my %craftingstorage
}
var craftaction sew
goto TAILORMAIN
SLICKSTONE:
var craftaction slickstone
goto TAILORMAIN
YARDSTICK:
var craftaction yardstick
goto TAILORMAIN
NEWPINS:
if ($roomid != %toolroom) then gosub MOVE %toolroom
#gosub DUMPITEM %product
gosub CRAFTINGORDER 5
#gosub PUTITEM straight pins in my %craftingstorage
if ($roomid != %workroom) then gosub MOVE %workroom
goto TAILORMAIN
NEWTHREAD:
if ($roomid != %suppliesroom) then gosub MOVE %suppliesroom
gosub DUMPITEM %product
gosub CRAFTINGORDER 6
put put thread on my needles
gosub GETITEM %product
if ($roomid != %workroom) then gosub MOVE %workroom
goto TAILORMAIN
#####FORGING_SUBS#####
ANVILCHECK:
var cleananvil 0
goto ANVILCHECKMAIN
ANVILCHECKP:
pause
ANVILCHECKMAIN:
matchre ANVILCHECKP %waitstring
match ANVILCHECKCLEAN The anvil's surface looks clean and ready for forging.
matchre ANVILCHECKINGOT On the iron anvil you see a \w+ ingot\.
matchre ANVILCHECKDIRTY On the iron anvil you see (a|an|some).* unfinished .*\.
put look on anvil
matchwait
ANVILCHECKCLEAN:
var cleananvil 1
return
ANVILCHECKINGOT:
var cleananvil 2
return
ANVILCHECKDIRTY:
gosub ANVILCLEAN
goto ANVILCHECK
ANVILCLEANP:
pause
ANVILCLEAN:
match ANVILCLEAN [Do you really want to clean off the anvil? Clean it one more time to destroy the contents.]
match RETURN You stop working and clean off the anvil's surface, discarding
put clean anvil
matchwait
FORGE:
var firstpound 1
var craftaction pound
goto FORGEMAIN
FORGEP:
pause
FORGEMAIN:
#GETTINGTOOLS
if ("%craftaction" = "pound") then
{
if ("$righthandnoun" != "hammer") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %hammer in my %craftingstorage
}
if ("$lefthandnoun" != "tongs") then
{
if ("$lefthand" != "Empty") then gosub PUTITEM my $lefthandnoun in my %craftingstorage
gosub GETITEM %tongs in my %craftingstorage
}
}
if ("%craftaction" = "turntongs") then
{
if ("$righthandnoun" != "hammer") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %hammer in my %craftingstorage
}
if ("$lefthandnoun" != "tongs") then
{
if ("$lefthand" != "Empty") then gosub PUTITEM my $lefthandnoun in my %craftingstorage
gosub GETITEM %tongs in my %craftingstorage
}
}
if ("%craftaction" = "bellows") then
{
if ("$righthandnoun" != "bellows") then
{
if ("$righthand" != "Empty" then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %bellows in my %craftingstorage
}
}
if ("%craftaction" = "shovel") then
{
if ("$righthandnoun" != "shovel") then
{
if ("$righthand" != "Empty") then gosub PUTITEM my $righthandnoun in my %craftingstorage
gosub GETITEM %shovel in my %craftingstorage
}
}
if ("%craftaction" = "pliers") then
{
if (("$righthandnoun" != "pliers") && ("$lefthandnoun" != "pliers")) then gosub GETITEM %pliers in my %craftingstorage
}
if ("%craftaction" = "oil") then
{
if (("$righthandnoun" != "oil") && ("$lefthandnoun" != "oil")) then gosub GETITEM oil in my %craftingstorage
if (("$righthandnoun" != "%product") && ("$lefthandnoun" != "%product")) then gosub GETITEM %product on anvil
}
matchre FORGEP %waitstring
match RESTARTWORKORDER You need a larger volume of metal to continue crafting.
match SHOVEL As you complete working the fire dies down and needs more fuel.
match SHOVEL As you complete working the fire dies down and appears to need some more fuel.
matchre TURNTONGS You notice the .* would benefit from some soft reworking.
matchre TURNTONGS The .* could use some straightening along the horn of the anvil.
match TURNTONGS The metal now looks ready to be turned into wire using a mandrel or mold set.
match TURNTONGS The metal must be drawn into wire on a mandrel and placed in mold sets using tongs.
match QUENCH The metal now appears ready for cooling in the slack tub.
matchre QUENCH The .* is complete and ready for a quench hardening in the slack tub\.
match BELLOWS As you finish the fire flickers and is unable to consume its fuel.
match BELLOWS As you finish working the fire dims and produces less heat from the stifled coals.
match PLIERS Metal links can be woven into place by using pliers to pull them together.
match PLIERS The individual chain links are now ready for stitching together using pliers.
match POUND Roundtime
match OIL With grinding complete, the metal now needs protection by pouring oil on it.
match OIL The worked metal looks to be in need of some oil to preserve and protect it.
matchre OILBAD You don't know how to do that\.|You can't pour a flask of oil\!
matchre ASSEMBLEHAFT You need another finished wooden haft to continue crafting
matchre ASSEMBLEHILT You need another finished wooden hilt to continue crafting
matchre ASSEMBLESHORTCORD You need another finished short leather cord to continue crafting
matchre ASSEMBLELONGCORD You need another finished long leather cord to continue crafting
matchre ASSEMBLELPOLE You need another finished long wooden pole to continue crafting
matchre ASSEMBLESPOLE You need another finished short wooden pole to continue crafting
match ASSEMBLELPAD The links appear ready to be woven into and around a cloth padding.
matchre ASSEMBLESPAD You need another finished small cloth padding to continue crafting .*\.
matchre ASSEMBLELBACK You need another finished large leather backing to continue crafting .*\.
matchre ASSEMBLESBACK You need another finished small leather backing to continue crafting .*\.
matchre GRIND The .* now appears ready for grinding and polishing on a grinding wheel\.
match FORGEMAIN I could not find what you were referring to.
match OILRETURN You unwrap the cloth protecting your oil,
match OILRETURN You unwrap the cloth surrounding the oil,
match OILRETURN Tipping the oil to one side, you dampen a cloth with the syrupy black mixture.
match OILRETURN After applying some of the oil to the rag,
#ACTIONS
if ("%craftaction" = "pound") then
{
if (%firstpound = 1) then var poundstring ingot
else var poundstring %product
put pound %poundstring on anvil with my hammer
}
if ("%craftaction" = "bellows") then put push my bellows
if ("%craftaction" = "shovel") then put push fuel with my shovel
if ("%craftaction" = "oil") then put pour oil on my %product
if ("%craftaction" = "oil2") then put pour oil on %product
if ("%craftaction" = "turntongs") then put turn %product on anvil with my tongs
if ("%craftaction" = "quench") then put push tub
if ("%craftaction" = "grind") then put push grindstone with my %product