annotate gm-merchant.tf @ 1655:356c3c26aee6

Get rid of ISO-8859-1 in copyrights.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 28 Sep 2021 02:24:25 +0300
parents a599a9429928
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
438
142407c139dc Urgh, fixed a typo.
Matti Hamalainen <ccr@tnsp.org>
parents: 431
diff changeset
1 ;;
163
71d0e5e4fc1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 159
diff changeset
2 ;; GgrTF::Merchant - Merchant guild support and utility macros
1655
356c3c26aee6 Get rid of ISO-8859-1 in copyrights.
Matti Hamalainen <ccr@tnsp.org>
parents: 1654
diff changeset
3 ;; (C) Copyright 2005-2015 Matti Hamalainen (Ggr)
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 ;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 ;; This file (triggerset) is Free Software distributed under
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 ;; GNU General Public License version 2.
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 ;;
1276
51c340df904a Update copyrights, version requirements.
Matti Hamalainen <ccr@tnsp.org>
parents: 1266
diff changeset
8 ;; NOTICE! This file requires GgrTF (version 0.6.15 or later) to be loaded.
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 ;;
336
f56c6dd17964 v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents: 333
diff changeset
10 /loaded GgrTF:Merchant
1035
c10f8a59a2e3 Use module depencies for checking required parent modules.
Matti Hamalainen <ccr@tnsp.org>
parents: 1031
diff changeset
11 /test prdefmodule("Merchant")
336
f56c6dd17964 v0.5.10.4: Added /loaded to each module; Few more small namespace cleanups done;
Matti Hamalainen <ccr@tnsp.org>
parents: 333
diff changeset
12
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
14 ;; General settings and data
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
16 ;@command /havebelt
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
17 ;@desc Toggle support for merchant belt functionality on/off.
327
521d0c3233bd v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
18 /prdeftoggle -n"havebelt" -d"Use merchant belt functionality"
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
19
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
20 ;@command /usepouch
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
21 ;@desc Toggle whether to use a reagent pouch with /mr (make reagent)
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
22 ;@desc command's functionality. See also /pouchname.
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
23 /prdeftoggle -n"usepouch" -d"Use reagent pouch as target in /mr"
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
24
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
25 ;@command /pouchname
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
26 ;@desc Set name of the reagent pouch to use with /mr skill. Used only
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
27 ;@desc if /usepouch option has been enabled.
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
28 /prdefvalue -n"pouchname" -d"Name of reagent pouch if usepouch enabled"
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
29
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
30 ;@command /boxname
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
31 ;@desc Name of the mineral box to use with /mbox operation mode.
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
32 ;@desc Default value is 'collect'.
867
2f23070da9f1 Misc. fixes and cleanups. Still needs more work, tho.
Matti Hamalainen <ccr@tnsp.org>
parents: 864
diff changeset
33 /prdefvalue -n"boxname" -d"Name of mineral box for /mbox"
2f23070da9f1 Misc. fixes and cleanups. Still needs more work, tho.
Matti Hamalainen <ccr@tnsp.org>
parents: 864
diff changeset
34 /set set_boxname=collect
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
35
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
36 ;; Defaults for tools and workbenches
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
37 /set set_mforge_bs=metal
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
38 /set set_mforge_cp=lumber
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
39 /set set_mforge_gc=gems
1610
2856f0632378 Rename glass type workbench default handle to "glassware".
Matti Hamalainen <ccr@tnsp.org>
parents: 1606
diff changeset
40 /set set_mforge_gb=glassware
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
41 /set set_mforge_ma=masonry
1008
0bd0741abdc9 Set loom as default workbench name for fabrics; Use only first argument for checking wb-type etc. in /refine.
Matti Hamalainen <ccr@tnsp.org>
parents: 1004
diff changeset
42 /set set_mforge_sw=loom
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
43 /set set_mforge_sc=sculpture
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
44
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
45 /set set_mtool_bs=hammer
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
46 /set set_mtool_cp=saw
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
47 /set set_mtool_gc=hammer
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
48 /set set_mtool_gb=tube,tongs
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
49 /set set_mtool_ma=hammer
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
50 /set set_mtool_sw=needle
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
51 /set set_mtool_sc=hammer
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
52 /set set_mtool_mine=pick
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
53 /set set_mtool_lj=saw
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
54
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
55 ;; Material data
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
56 ;; TODO FIXME! This probably would be better to have elsewhere...
1606
adfc1378dedb Update material information in merchant module.
Matti Hamalainen <ccr@tnsp.org>
parents: 1586
diff changeset
57 /set gmat_names=adamantium air alabaster alexandrite aluminium amber amethyst anipium aquamarine bamboo bark basalt batium birch bloodstone bone brass brick bronze burlap carnelian cedar cesium chalk charcoal chromium chrysoberyl clay cloth coal cobalt concrete copper coral cork cotton crystal darksteel diamond diggalite dragonscale dukonium duraluminium durandium earth ebony electrum elm emerald emulsion enchanted_air feathers fire flesh food fur garnet glass gold granite graphite hematite hemp highsteel ice illumium indium iridium iron ivory jade kryptonite laen lead leather magnesium mahogany malachite mallorn maple marble marlor mithril molybdenum moonstone moss_agate mowgles mowglite neo_burlap nickel nullium oak obsidian olivine onyx opal osmium palladium paper pearl petrified_wood pewter phosphorus platinum porcelain potassium pyrite quartz quicksilver rhodium rhodonite rift_plasma rubber ruby sapphire silicon silk silver slate starmetal steel steuben stone sulphur sunstone tadmium tin titanium topaz tormium tungsten turquoise uranium vanadium vegetation water wax weenite wood wool zhentorium zinc zircon
adfc1378dedb Update material information in merchant module.
Matti Hamalainen <ccr@tnsp.org>
parents: 1586
diff changeset
58 /set gmat_ntypes=metal organic inorganic gem metal stone gem metal gem wood wood stone metal wood gem bone alloy stone alloy cloth gem wood metal stone organic metal gem stone cloth stone metal stone metal bone wood cloth glass alloy gem metal bone metal alloy metal stone wood metal wood gem organic organic organic inorganic organic organic cloth gem glass metal stone metal metal organic alloy organic metal metal metal metal bone gem metal glass metal cloth metal wood gem wood wood stone wood metal metal stone gem metal metal cloth metal metal wood glass gem gem gem metal metal paper gem stone alloy organic metal inorganic metal metal gem metal metal gem inorganic inorganic gem gem metal cloth metal stone metal alloy glass stone stone gem metal metal metal gem metal metal gem metal metal organic organic organic gem wood cloth metal metal gem
907
0eb2eb54c742 s/organ/organic/g;s/inorg/inorganic/g.
Matti Hamalainen <ccr@tnsp.org>
parents: 906
diff changeset
59 /set gmat_types=alloy bone cloth gem glass inorganic metal organic paper stone wood
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
60 /set gmat_type_alloy=brass|bronze|darksteel|duraluminium|highsteel|pewter|steel
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
61 /set gmat_type_bone=bone|coral|dragonscale|ivory
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
62 /set gmat_type_cloth=burlap|cloth|cotton|fur|leather|neo burlap|silk|wool
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
63 /set gmat_type_gem=alexandrite|amethyst|aquamarine|bloodstone|carnelian|chrysoberyl|diamond|emerald|garnet|jade|malachite|moss agate|olivine|onyx|opal|pearl|quartz|rhodonite|ruby|sapphire|sunstone|topaz|turquoise|weenite|zircon
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
64 /set gmat_type_glass=crystal|glass|laen|obsidian|steuben
1606
adfc1378dedb Update material information in merchant module.
Matti Hamalainen <ccr@tnsp.org>
parents: 1586
diff changeset
65 /set gmat_type_inorganic=alabaster|fire|porcelain|rift plasma|rubber
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
66 /set gmat_type_metal=adamantium|aluminium|anipium|batium|cesium|chromium|cobalt|copper|diggalite|dukonium|durandium|electrum|gold|graphite|hematite|illumium|indium|iridium|iron|kryptonite|lead|magnesium|mithril|molybdenum|mowgles|mowglite|nickel|nullium|osmium|palladium|platinum|potassium|pyrite|quicksilver|rhodium|silicon|silver|starmetal|tadmium|tin|titanium|tormium|tungsten|uranium|vanadium|zhentorium|zinc
907
0eb2eb54c742 s/organ/organic/g;s/inorg/inorganic/g.
Matti Hamalainen <ccr@tnsp.org>
parents: 906
diff changeset
67 /set gmat_type_organic=air|charcoal|emulsion|enchanted air|feathers|flesh|food|hemp|ice|phosphorus|vegetation|water|wax
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
68 /set gmat_type_paper=paper
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
69 /set gmat_type_stone=amber|basalt|brick|chalk|clay|coal|concrete|earth|granite|marble|moonstone|petrified wood|slate|stone|sulphur
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
70 /set gmat_type_wood=bamboo|bark|birch|cedar|cork|ebony|elm|mahogany|mallorn|maple|marlor|oak|wood
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
71
900
18af9021056c Add new reagent material/spell/etc data, to be used later; Add sanity check for no reagent material set.
Matti Hamalainen <ccr@tnsp.org>
parents: 899
diff changeset
72 ;; Reagent data
18af9021056c Add new reagent material/spell/etc data, to be used later; Add sanity check for no reagent material set.
Matti Hamalainen <ccr@tnsp.org>
parents: 899
diff changeset
73 /set gmr_names=olivine stone bloodstone highsteel leather bronze steel electrum glass fur copper onyx ebony granite cobalt iron tungsten platinum quartz amethyst mallorn brass
18af9021056c Add new reagent material/spell/etc data, to be used later; Add sanity check for no reagent material set.
Matti Hamalainen <ccr@tnsp.org>
parents: 899
diff changeset
74
906
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
75 ;; Material Spell name Reagent name Exchange name
903
5e392a192603 Add exchange names to reagent info tables.
Matti Hamalainen <ccr@tnsp.org>
parents: 902
diff changeset
76 ;;-------------------------------------------------------------------------------------------------
906
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
77 /set gmr_mat_olivine= Acid_Blast handful_of_olivine_powder olivine_powder
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
78 /set gmr_mat_stone= Acid_Shield stone_cube stone_cube
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
79 /set gmr_mat_bloodstone= Acid_Storm pair_of_interlocked_rings interlocked_rings
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
80 /set gmr_mat_highsteel= Armour_of_Aether small_highsteel_disc highsteel_disc
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
81 /set gmr_mat_leather= Aura_of_Wind tiny_leather_bag leather_bag
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
82 /set gmr_mat_bronze= Blast_Vacuum bronze_marble bronze_marble
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
83 /set gmr_mat_steel= Cold_Ray steel_arrowhead steel_arrowhead
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
84 /set gmr_mat_electrum= Electrocution small_piece_of_electrum_wire electrum_wire
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
85 /set gmr_mat_glass= Flame_Shield small_glass_cone glass_cone
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
86 /set gmr_mat_fur= Frost_Shield grey_fur_triangle fur_triangle
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
87 /set gmr_mat_copper= Golden_Arrow copper_rod copper_rod
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
88 /set gmr_mat_onyx= Hailstorm handful_of_onyx_gravel onyx_gravel
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
89 /set gmr_mat_ebony= Killing_Cloud ebony_tube ebony_tube
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
90 /set gmr_mat_granite= Lava_Blast granite_sphere granite_sphere
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
91 /set gmr_mat_cobalt= Lava_Storm blue_cobalt_cup cobalt_cup
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
92 /set gmr_mat_iron= Lightning_Shield small_iron_rod iron_rod
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
93 /set gmr_mat_tungsten= Lightning_Storm cluster_of_tungsten_wires tungsten_wire
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
94 /set gmr_mat_platinum= Magic_Eruption tiny_platinum_hammer platinum_hammer
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
95 /set gmr_mat_quartz= Repulsor_Aura quartz_prism quartz_prism
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
96 /set gmr_mat_amethyst= Shield_of_Detoxification tiny_amethyst_crystal amethyst_crystal
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
97 /set gmr_mat_mallorn= Summon_Carnal_Spores silvery_bark_chip bark_chip
7de93717274a Untabify.
Matti Hamalainen <ccr@tnsp.org>
parents: 905
diff changeset
98 /set gmr_mat_brass= Vacuum_Globe small_fan small_fan
900
18af9021056c Add new reagent material/spell/etc data, to be used later; Add sanity check for no reagent material set.
Matti Hamalainen <ccr@tnsp.org>
parents: 899
diff changeset
99
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
100
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
101 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
102 ;; Item move handling
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
103 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
104 ;@command /mdisc
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
105 ;@desc Change item move target to your floating disc.
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
106 /def -i mdisc = /msq Move Items -> @{Cgreen}disc@{n}%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
107 /undef gmatmove_start%;/def -i gmatmove_start =%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
108 /undef gmatmove_item%;/def -i gmatmove_item = @@put %%* in my disc%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
109 /undef gmatmove_end%;/def -i gmatmove_end =
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
110
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
111 ;@command /mbox
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
112 ;@desc Change item move target to box (labeled as 'collect' by default,
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
113 ;@desc use /boxname command to change this setting.)
867
2f23070da9f1 Misc. fixes and cleanups. Still needs more work, tho.
Matti Hamalainen <ccr@tnsp.org>
parents: 864
diff changeset
114 /def -i mbox = /msq Move Items -> @{Cgreen}%{set_boxname}@{n}%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
115 /undef gmatmove_start%;/def -i gmatmove_start = @@drop %%{set_boxname}%;\
1326
a7c12582b440 Setting set_boxname was not used in all the places that it should've been.
Matti Hamalainen <ccr@tnsp.org>
parents: 1315
diff changeset
116 /undef gmatmove_item%;/def -i gmatmove_item = @@put %%* in %%{set_boxname}%%;@@get %%*%;\
a7c12582b440 Setting set_boxname was not used in all the places that it should've been.
Matti Hamalainen <ccr@tnsp.org>
parents: 1315
diff changeset
117 /undef gmatmove_end%;/def -i gmatmove_end = @@get %%{set_boxname}
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
118
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
119 ;@command /mdrop
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
120 ;@desc Change item move target to dropping of the item.
193
b644a0945471 Chest status translator fixes;/id brokage;/mdrop item move status
Matti Hamalainen <ccr@tnsp.org>
parents: 191
diff changeset
121 /def -i mdrop = /msq Move Items -> @{Cgreen}drop@{n}%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
122 /undef gmatmove_start%;/def -i gmatmove_start =%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
123 /undef gmatmove_item%;/def -i gmatmove_item = @@drop %%*%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
124 /undef gmatmove_end%;/def -i gmatmove_end =
193
b644a0945471 Chest status translator fixes;/id brokage;/mdrop item move status
Matti Hamalainen <ccr@tnsp.org>
parents: 191
diff changeset
125
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
126 /mdisc
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
128
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
129 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
130 ;; Fails & fumbles
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
131 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
132 ;; We catch lots of these, but probably not nearly all.
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
133 ;; Merchants can fumble and fail in so many wonderful ways, some of these
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
134 ;; might be up to debate whether they are fumbles or fails. My criteria
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
135 ;; has been that if it damages material, it is fumble, otherwise it is fail.
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
136
572
9a9b66d52f83 Moved to use new fail/fumble definition system.
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
137 /prdeffail -k -F -r -t"^Bang! Bang! You forge "
9a9b66d52f83 Moved to use new fail/fumble definition system.
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
138 /prdeffail -k -F -r -t"^You bang and bang the .* but wood refuses to bend"
976
50c662d0e408 Some more fumble messages added .. yay for merchant guild.
Matti Hamalainen <ccr@tnsp.org>
parents: 971
diff changeset
139 /prdeffail -k -F -r -t"^You (fail to get anything useful done and discard the material|hammer and hammer as the piece of .+ won't fit the construction|fumble and cut|slip up and fumble your attempt|slip up and damage your ore|slip and cut the ore in the wrong place|screw up big time and ruin your ore completely)"
50c662d0e408 Some more fumble messages added .. yay for merchant guild.
Matti Hamalainen <ccr@tnsp.org>
parents: 971
diff changeset
140 /prdeffail -k -F -r -t"^(Oh drat, you fumbled the skill and lost the salve|OH NO! *You really were not paying attention|OUCH, you cut your hand while trying to skin|Oops! Your grip on the .* slips, and you damage)"
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
141
572
9a9b66d52f83 Moved to use new fail/fumble definition system.
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
142 /prdeffail -k -f -r -t"^OUCH! You swing your hammer and hit your own thumb."
9a9b66d52f83 Moved to use new fail/fumble definition system.
Matti Hamalainen <ccr@tnsp.org>
parents: 508
diff changeset
143 /prdeffail -k -f -r -t"^You completely fail to amalgamate the (material|ore) properly\.$"
913
bdf5796742c6 Combine some fail/fumble messages into regexp groups and add one new.
Matti Hamalainen <ccr@tnsp.org>
parents: 909
diff changeset
144 /prdeffail -k -f -r -t"^You (try to label .+ but cannot get it done properly|mine for a long time but don't find anything|are unable to find a good splitting point|try to improve .+'s appearance but you fail)\.$"
917
ab38d10e0528 Bugfix one of the fail regexps.
Matti Hamalainen <ccr@tnsp.org>
parents: 915
diff changeset
145 /prdeffail -k -f -r -t"^(ARGH! *DARN! *CRAP! *You drop|Oh shoot! You nick)"
913
bdf5796742c6 Combine some fail/fumble messages into regexp groups and add one new.
Matti Hamalainen <ccr@tnsp.org>
parents: 909
diff changeset
146 /prdeffail -k -f -r -t"^You fail to (alloy the substances properly|refine the ore properly|get the parts to fit|.+ into its base material)\.$"
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
147
881
48c68ac538f9 Notes about some fail messages.
Matti Hamalainen <ccr@tnsp.org>
parents: 877
diff changeset
148 ;You are unable to assemble anything.
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
149
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
188
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
151 ;; Workbench and tool helper code
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
152 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
188
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
153 ;; Tool wielding function
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
154 /set mwb_mode=
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
155 /set mwb_target=1
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
156 /set mwb_wielded=
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
157
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
158 /def -i gwb_wield_tool =\
1290
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
159 /if (opt_havebelt=~"on" & {1}=~"")\
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
160 /set mwb_wield=toolbelt%;\
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
161 /else \
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
162 /set mwb_wield=%{1}%;\
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
163 /endif%;\
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
164 /if (mwb_wielded!~{1})\
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
165 /if (mwb_wielded!~"")\
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
166 /msq Switching '%{mwb_wielded}' -> '%{mwb_wield}'%;\
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
167 @@remove %{mwb_wielded}%;\
1291
b58430e6193b Minor bugfix in tool wielding (trying to wield "nothing").
Matti Hamalainen <ccr@tnsp.org>
parents: 1290
diff changeset
168 /if ({1}!~"")\
b58430e6193b Minor bugfix in tool wielding (trying to wield "nothing").
Matti Hamalainen <ccr@tnsp.org>
parents: 1290
diff changeset
169 @@wield %{1}%;\
b58430e6193b Minor bugfix in tool wielding (trying to wield "nothing").
Matti Hamalainen <ccr@tnsp.org>
parents: 1290
diff changeset
170 /endif%;\
1290
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
171 /elseif ({1}!~"")\
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
172 /msq Wielding -> '%{1}'%;\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
173 @@wield %{1}%;\
188
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
174 /endif%;\
1290
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
175 /set mwb_wielded=%{1}%;\
188
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
176 /endif
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
177
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
178 ;; Get workbench type for given material
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
179 /eval /def -i gwb_get_type =\
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
180 /if (regmatch("^(%{gmat_type_alloy}|%{gmat_type_metal})$$",{1})) /return "bs"%%;\
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
181 /elseif (regmatch("^(%{gmat_type_gem})$$",{1})) /return "gc"%%;\
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
182 /elseif (regmatch("^(%{gmat_type_stone})$$",{1})) /return "ma"%%;\
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
183 /elseif (regmatch("^(%{gmat_type_wood}|%{gmat_type_bone})$$",{1})) /return "cp"%%;\
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
184 /elseif (regmatch("^(%{gmat_type_glass})$$",{1})) /return "gb"%%;\
907
0eb2eb54c742 s/organ/organic/g;s/inorg/inorganic/g.
Matti Hamalainen <ccr@tnsp.org>
parents: 906
diff changeset
185 /elseif (regmatch("^(%{gmat_type_organic}|%{gmat_type_cloth})$$",{1})) /return "sw"%%;\
0eb2eb54c742 s/organ/organic/g;s/inorg/inorganic/g.
Matti Hamalainen <ccr@tnsp.org>
parents: 906
diff changeset
186 /elseif (regmatch("^(%{gmat_type_inorganic})$$",{1})) /return "sc"%%;\
933
00c3885b0d7e Add a warning about unknown material(s) when automagically selecting workbench type.
Matti Hamalainen <ccr@tnsp.org>
parents: 930
diff changeset
187 /else /return ""%%;/endif
872
08738b961cfe Material handling improved; Miscellaneous cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 871
diff changeset
188
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 ;; (Assume everything to be metal/bs by default)
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
190 /def -i gwb_set_bench =\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
191 /set mwb_type=$[gwb_get_type({1})]%;\
933
00c3885b0d7e Add a warning about unknown material(s) when automagically selecting workbench type.
Matti Hamalainen <ccr@tnsp.org>
parents: 930
diff changeset
192 /if (mwb_type=~"")\
00c3885b0d7e Add a warning about unknown material(s) when automagically selecting workbench type.
Matti Hamalainen <ccr@tnsp.org>
parents: 930
diff changeset
193 /msq @{Cred}No workbench type found for material@{n} '@{BCwhite}%{1}@{n}'%;\
00c3885b0d7e Add a warning about unknown material(s) when automagically selecting workbench type.
Matti Hamalainen <ccr@tnsp.org>
parents: 930
diff changeset
194 /return 0%;\
00c3885b0d7e Add a warning about unknown material(s) when automagically selecting workbench type.
Matti Hamalainen <ccr@tnsp.org>
parents: 930
diff changeset
195 /endif%;\
982
60ca44cdc9e0 Use prgetval().
Matti Hamalainen <ccr@tnsp.org>
parents: 976
diff changeset
196 /set mwb_forge=$[prgetval(strcat("set_mforge_",mwb_type))]%;\
60ca44cdc9e0 Use prgetval().
Matti Hamalainen <ccr@tnsp.org>
parents: 976
diff changeset
197 /set mwb_tool=$[prgetval(strcat("set_mtool_",mwb_type))]%;\
933
00c3885b0d7e Add a warning about unknown material(s) when automagically selecting workbench type.
Matti Hamalainen <ccr@tnsp.org>
parents: 930
diff changeset
198 /return 1
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
201 ;; Check new mode against currently set working mode and change tools etc. if necessary.
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
202 /def -i gwb_check_mode =\
1300
8602ee4b89e4 Fix autowield remove again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1299
diff changeset
203 /if (mwb_mode!~{1} | mwb_target!~{3} | !mwb_merchant)\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
204 /set mwb_target=%{3}%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
205 /set mwb_mode=%{1}%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
206 /test gwb_wield_tool({2})%;\
1300
8602ee4b89e4 Fix autowield remove again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1299
diff changeset
207 /endif%;\
8602ee4b89e4 Fix autowield remove again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1299
diff changeset
208 /set mwb_merchant=1
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
209
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
210
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
211 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1298
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
212 ;; Non-merchant skills
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
213 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
214 ;; Hook into skill starts to remove merchant tools when using non-merchant skills
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
215 /def -i gunwield_tool =\
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
216 /if (!mwb_merchant & mwb_wielded!~"")\
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
217 /test gwb_wield_tool("")%;\
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
218 /endif%;\
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
219 /set mwb_merchant=0
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
220
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
221 /test prlist_insert("event_skill_start", "gunwield_tool")
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
222
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
223
314ec2a61231 Automatically remove wielded merchant tools when using non-merchant skills.
Matti Hamalainen <ccr@tnsp.org>
parents: 1291
diff changeset
224 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
225 ;; LUMBERJACKING
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
227 /set mwb_mode=
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
228 /set mwb_target=1
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229 /set lj_target=
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
231 ;A birch tree with smooth, papery bark is growing here.
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
232 ;A tall mahogany tree is growing here.
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
233 ;A dark grey elm tree stands here.
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
234 ;A cedar tree with smooth bark stands here.
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
235 ;A maple tree is growing here.
611
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
236 /def -i glumberjack_grep =\
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
237 /if (regmatch("^pine|holly$",{1}))\
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
238 /set lj_target=%{1} tree%;\
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
239 /let _tmps=tree%;\
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
240 /else \
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
241 /set lj_target=%{1}%;\
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
242 /let _tmps=%{1}%;\
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
243 /endif%;\
1654
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1610
diff changeset
244 @@%{set_grepcmd} 'It can be cut down for ' look at %{_tmps} on ground
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
245
611
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
246
869
c70194adb6ea More smaller fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 868
diff changeset
247 /def -i -F -p9999 -mregexp -t"^.+ .* ([a-z][a-z]+) tree" glumberjack_at1 =\
611
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
248 /test glumberjack_grep({P1})
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
249
1258
a27869d67041 Add second detector trigger for trees for lumberjack autotargeting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1239
diff changeset
250 /def -i -F -p9999 -mregexp -t"([a-z][a-z]+) tree stands" glumberjack_at2 =\
a27869d67041 Add second detector trigger for trees for lumberjack autotargeting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1239
diff changeset
251 /test glumberjack_grep({P1})
a27869d67041 Add second detector trigger for trees for lumberjack autotargeting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1239
diff changeset
252
611
610b1bda74e1 Some trees were not "detected", when the room desc wrapped in certain way. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 609
diff changeset
253
608
9832e4507427 Some more fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 607
diff changeset
254 /def -i -p9999 -ag -msimple -t"No matches for 'It can be cut down for '." glumberjack_gag
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
255
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
256 /def -i -p9999 -ag -mregexp -t"^It can be cut down for ([0-9]) logs? of ([a-z]+)\.$" glumberjack_amount =\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
257 /msq [@{BCgreen}%{P1} logs@{n}] of @{Cyellow}%{P2}@{n}
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
258
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
259
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
260 ;@command /lj [target]
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
261 ;@desc Use lumberjacking (at optional target, if no target given,
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
262 ;@desc autotargetting or previous specified target is used.) (*) (!)
877
1ee7506ca908 Make some macros invisible.
Matti Hamalainen <ccr@tnsp.org>
parents: 874
diff changeset
263 /def -i lj =\
327
521d0c3233bd v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
264 /if ({*}!~"") /set lj_target=%*%;/endif%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
265 /test gwb_check_mode("lj", set_mtool_lj, lj_target)%;\
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
266 /msq Lumberjacking '%{lj_target}' ...%;\
606
Matti Hamalainen <ccr@tnsp.org>
parents: 605
diff changeset
267 @@use lumberjacking at %{lj_target}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
268
163
71d0e5e4fc1c Cleanups
Matti Hamalainen <ccr@tnsp.org>
parents: 159
diff changeset
269
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
270 /def -i -p9999 -mregexp -t"^You chop up the [a-z ]+ into ([0-9]+) useable logs\.$" glumberjack_get =\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
271 /if (mwb_mode=~"lj" & skill_st2=~"on")\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
272 /let _i=%{P1}%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
273 /gmatmove_start%;\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
274 /while (_i > 0)\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
275 /gmatmove_item log%;\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
276 /let _i=$[_i - 1]%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
277 /done%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
278 /gmatmove_end%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
279 /endif
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
280
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
281
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
282 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
283 ;; AMALGAMATING
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
284 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
285 ;@command /amal <material>
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
286 ;@desc Amalgamate given material. Workbench and tools are automatically
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
287 ;@desc selected.
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
288 /def -i amal =\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
289 /test gwb_set_bench({*})%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
290 /test gwb_check_mode("amal", mwb_tool, {*})%;\
1290
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
291 /msq Amalgamating '%{*}' in '%{mwb_forge}' with '%{mwb_wield}' ...%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
292 @@use amalgamate at %{*} in %{mwb_forge}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
293
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
294
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
295 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
296 ;; REFINING
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
297 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
298 ;@command /refine <material> [number]
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
299 ;@desc Refine specified material, or numbered chunk of material.
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
300 /def -i refine =\
1009
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
301 /if (regmatch("^([A-Za-z ]+) +([0-9]+) *$",{*}))\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
302 /let _tmat=%{P1}%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
303 /let _tnum=%{P1} %{P2}%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
304 /else \
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
305 /let _tmat=%{*}%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
306 /let _tnum=%{*}%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
307 /endif%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
308 /if (_tmat=~"") /msq @{BCred}No material given!@{n}%;/break%;/endif%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
309 /test gwb_set_bench(_tmat)%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
310 /test gwb_check_mode("refine", mwb_tool, _tmat)%;\
1290
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
311 /msq Refining '%{*}' in '%{mwb_forge}' with '%{mwb_wield}' ...%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
312 @@use refining at %{*} in %{mwb_forge}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
313
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
314
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
315 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
316 ;; MINERAL CUTTING
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
317 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
318 ;@command /mcut <material> [number] [/amount in grams]
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
319 ;@desc Mineral cut material. Optional number/index and amount/size can be
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
320 ;@desc given in grams. If no amount/size is specified, material chunk is
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
321 ;@desc cut in half. Use "/mcut" without arguments to get some examples.
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
322 /def -i mcut =\
1010
660d3171254a Few bugfixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1009
diff changeset
323 /if (regmatch("^([A-Za-z ]+) +([0-9]+) +\/ *([0-9]+)",{*}))\
1009
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
324 /let _tmat=%{P1}%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
325 /let _tnum=%{P1} %{P2}%;\
1013
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
326 /let _tcut=%{P3}%;\
1010
660d3171254a Few bugfixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1009
diff changeset
327 /elseif (regmatch("^([A-Za-z ]+) +\/ *([0-9]+)",{*}))\
1009
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
328 /let _tmat=%{P1}%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
329 /let _tnum=%{P1}%;\
1013
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
330 /let _tcut=%{P2}%;\
1010
660d3171254a Few bugfixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1009
diff changeset
331 /elseif (regmatch("^([A-Za-z ]+) +([0-9]+)",{*}))\
1009
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
332 /let _tmat=%{P1}%;\
1013
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
333 /if ({P2} > 50)\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
334 /let _tnum=%{P1}%;\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
335 /let _tcut=%{P2}%;\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
336 /else \
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
337 /let _tnum=%{P1} %{P2}%;\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
338 /let _tcut=%;\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
339 /endif%;\
1010
660d3171254a Few bugfixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1009
diff changeset
340 /elseif (regmatch("^([A-Za-z ]+)$",{*}))\
660d3171254a Few bugfixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1009
diff changeset
341 /let _tmat=%{P1}%;\
1012
736d8c109326 Oops, a nasty missing '%' in /mcut caused some problems. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 1010
diff changeset
342 /let _tnum=%{P1}%;\
1009
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
343 /let _tcut=%;\
188
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
344 /else \
1009
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
345 /msq @{BCwhite}Usage:@{n} @{Cyellow}/mcut@{n} @{Cred}<material>@{} @{Cgreen}[number]@{n} @{Ccyan}[/amount in grams]@{n}%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
346 /msq /mcut wood 1 /50000 @{BCwhite}|@{n} /mcut steel /5000 @{BCwhite}|@{n} /mcut ebony 2%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
347 /break%;\
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
348 /endif%;\
1013
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
349 /if (_tcut!~"")\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
350 /let _tcuts=%{_tcut}g piece%;\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
351 /let _tcut=cut %{_tcut}%;\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
352 /else \
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
353 /let _tcuts=half%;\
1f9ae34be580 Added some "intelligence" to /mcut, "/mcut ebony 25000" (where the number is > 50) will now assume that piece size is meant instead of index #.
Matti Hamalainen <ccr@tnsp.org>
parents: 1012
diff changeset
354 /endif%;\
1009
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
355 /test gwb_set_bench(_tmat)%;\
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
356 /test gwb_check_mode("mcut", mwb_tool, _tmat)%;\
1290
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
357 /msq Mineral Cutting '%{_tnum}' in '%{mwb_forge}' with '%{mwb_wield}' to %{_tcuts} ...%;\
1009
f46655d2e796 Improved /mcut and /refine commands to handle material index (e.g. "ebony 2") better. This, however, required syntax change for /mcut; Now also /mcut and /refine invoked without arguments will print a short help message.
Matti Hamalainen <ccr@tnsp.org>
parents: 1008
diff changeset
358 @@use mineral cutting at %{_tnum} in %{mwb_forge} %{_tcut}
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
359
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
360
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
361 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
189
308c8e2a9516 Added one fail message trigger; preliminal /alloy command.
Matti Hamalainen <ccr@tnsp.org>
parents: 188
diff changeset
362 ;; ALLOYING
308c8e2a9516 Added one fail message trigger; preliminal /alloy command.
Matti Hamalainen <ccr@tnsp.org>
parents: 188
diff changeset
363 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
364 ;@command /alloy <material1,material2[,material3...]>
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
365 ;@desc Alloy specified materials. Example: /alloy illumium,nullium
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
366 /def -i alloy =\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
367 /let _smat=$[replace(",", " ", replace(" ","_",{*}))]%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
368 /let _sfirst=$[prgetitem(1, _smat)]%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
369 /test gwb_set_bench(_sfirst)%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
370 /test gwb_check_mode("alloy", mwb_tool, _smat)%;\
1264
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
371 /set alloy_fumble=0%;\
1290
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
372 /msq Alloying '%{*}' in '%{mwb_forge}' with '%{mwb_wield}' ...%;\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
373 @@use alloying at %{*} in %{mwb_forge}
189
308c8e2a9516 Added one fail message trigger; preliminal /alloy command.
Matti Hamalainen <ccr@tnsp.org>
parents: 188
diff changeset
374
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1264
diff changeset
375 /def -i -F -msimple -t"You slip up and fumble your attempt." galloy_fumble =\
1264
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
376 /set alloy_fumble=1
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
377
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
378 /def -i prurify =\
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
379 /return replace(" ", "+", strip_attr({*}))
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
380
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1264
diff changeset
381 /gdef -i -F -p9999 -aBCwhite -mregexp -t"^You mix [a-z ,]+ and create a quantity of ([a-z ]+)\.?$" galloy_check =\
1264
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
382 /let _match=%{P0}%;/set _result=%{P1}%;\
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
383 @@look at %{_result} in %{mwb_forge}
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
384
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
385 ; %;\
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
386 ; /if (alloy_fumble == 0)\
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
387 ; /let _req=$[strcat("http://tnsp.org/mat/submit.php?guid=gAS51sPqeRQw3hX&match=",prurify(_match))]%;\
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
388 ; /quote -S /msq !wget -qO- "%{_req}"%;\
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
389 ; /endif
83cfce9b902e Add initial code (commented out and not finished) for auto-submitting data to alloy database.
Matti Hamalainen <ccr@tnsp.org>
parents: 1260
diff changeset
390
447
831b5ce21168 Bit of work on /alloy-macro, still not working too well;
Matti Hamalainen <ccr@tnsp.org>
parents: 442
diff changeset
391
189
308c8e2a9516 Added one fail message trigger; preliminal /alloy command.
Matti Hamalainen <ccr@tnsp.org>
parents: 188
diff changeset
392 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
393 ;; GEM CUTTING
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
394 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
395 ;@command /gcut [material]
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
396 ;@desc Use gem cutting at material. (!) Workbench and tools are automatically
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
397 ;@desc selected. If material is not specified, material from previous /gcut
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
398 ;@desc command is used.
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
399 /def -i gcut =\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
400 /if ({*}!~"") /set gcut_gem=%*%;/endif%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
401 /test gwb_set_bench(gcut_gem)%;\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
402 /set mwb_tool=magnifying glass,chisel%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
403 /test gwb_check_mode("gcut", mwb_tool, gcut_gem)%;\
1290
4227c4bf23d6 Change how merchant toolbelt support works when autowielding tools.
Matti Hamalainen <ccr@tnsp.org>
parents: 1287
diff changeset
404 /msq Gem Cutting '%{gcut_gem}' in '%{mwb_forge}' with '%{mwb_wield}' ...%;\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
405 @@use gem cutting at %{gcut_gem} in %{mwb_forge}
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
406
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
407
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1264
diff changeset
408 /gdef -i -F -p9999 -aBCwhite -t"You skillfully cut the gem ore into a beautiful gem." ggcut_get1 =\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
409 /if (mwb_mode=~"gcut" & skill_st2=~"on")\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
410 @@get gem from %{mwb_forge}%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
411 /gmatmove_item gem%;\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
412 @@look at %{gcut_gem} in %{mwb_forge}%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
413 /endif
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
414
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
415
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
416 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
417 ;; MINING
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
418 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
419 ;; Autotargetting
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
420 /set mine_target=
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
421 /set mine_amount=
605
Matti Hamalainen <ccr@tnsp.org>
parents: 587
diff changeset
422 /set mine_grep=0
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
423
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1264
diff changeset
424 /gdef -i -F -p9 -P0BCgreen -mregexp -t"(exits|Exits:)" gmine_init =\
1016
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
425 /set mine_match=1
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
426
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
427 /def -i -F -p9999 -P2BCred -mregexp -t"(abyss|chunky|coil|crag|deposit|gloss|graveyard|hill|hit|lode|lump|mass|mound|mountain|nest|network|pile|pocket|pool|protrusion|puddle|shard|slab|stack|tangle|torrent) of ([a-z]+|moss agate|petrified wood) *(ore|is|$)" gmine_at1 =\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
428 /if (mine_match)\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
429 /set mine_match=0%;\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
430 /set mine_grep=0%;\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
431 /set mine_target=%{P2}%;\
1654
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1610
diff changeset
432 @@%{set_grepcmd} 'contains roughly' look at %{P1} on ground%;\
1016
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
433 /endif
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
434
1016
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
435 /def -i -F -p999 -mregexp -t"An? (abyss|chunky|coil|crag|deposit|gloss|graveyard|hill|hit|lode|lump|mass|mound|mountain|nest|network|pile|pocket|pool|protrusion|puddle|shard|slab|stack|tangle|torrent)" gmine_at2 =\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
436 /if (mine_match)\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
437 /set mine_match=0%;\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
438 /set mine_grep=1%;\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
439 /set mine_type=%{P1}%;\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
440 /endif
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
441
1016
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
442 /def -i -F -p99 -P1BCred -mregexp -t"([a-z]+|moss agate|petrified wood) (ore is|is) embedded" gmine_at3 =\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
443 /if (mine_grep)\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
444 /set mine_grep=0%;\
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
445 /set mine_target=%{P1}%;\
1654
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1610
diff changeset
446 @@%{set_grepcmd} 'contains roughly' look at %{mine_type} on ground%;\
1016
53bd67eead9b Fix previous changes in mining autotargetting.
Matti Hamalainen <ccr@tnsp.org>
parents: 1014
diff changeset
447 /endif
605
Matti Hamalainen <ccr@tnsp.org>
parents: 587
diff changeset
448
Matti Hamalainen <ccr@tnsp.org>
parents: 587
diff changeset
449
867
2f23070da9f1 Misc. fixes and cleanups. Still needs more work, tho.
Matti Hamalainen <ccr@tnsp.org>
parents: 864
diff changeset
450 /def -i -F -p9999 -ag -msimple -t"No matches for 'contains roughly'." gmine_gag1
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
451
1081
6861573b5a3f Use substitute instead of /msq for reporting deposit sizes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1080
diff changeset
452 /def -i -F -p9999 -mregexp -t"^The ([a-z]+) contains roughly ([0-9]+) kg of ([a-z ]+)\.$" gmine_amount =\
191
13769cb7ff91 Added documentation, minor fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 189
diff changeset
453 /set mine_amount=%{P2}%;/set mine_target=%{P3}%;\
1081
6861573b5a3f Use substitute instead of /msq for reporting deposit sizes.
Matti Hamalainen <ccr@tnsp.org>
parents: 1080
diff changeset
454 /substitute -p [@{BCgreen}%{P2} kg@{n}] of @{Cyellow}%{P3}@{n}.
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
455
867
2f23070da9f1 Misc. fixes and cleanups. Still needs more work, tho.
Matti Hamalainen <ccr@tnsp.org>
parents: 864
diff changeset
456 /def -i -F -p9999 -mregexp -t"^No matches for \'\(" gmine_gag2 =\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
457 /substitute ====================
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
458
1014
c8ed706fe891 Improvements on the mining autotargetting functionality.
Matti Hamalainen <ccr@tnsp.org>
parents: 1013
diff changeset
459
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
460 ;@command /mine [target]
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
461 ;@desc Use mining (at optional target, if no target given, autotargetting
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
462 ;@desc or previous specified target is used.) (*) (!)
877
1ee7506ca908 Make some macros invisible.
Matti Hamalainen <ccr@tnsp.org>
parents: 874
diff changeset
463 /def -i mine =\
327
521d0c3233bd v0.5.10.0: Major cleanup of namespace, many functions and variables renamed
Matti Hamalainen <ccr@tnsp.org>
parents: 291
diff changeset
464 /if ({*}!~"") /set mine_target=%*%;/endif%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
465 /test gwb_check_mode("mine", set_mtool_mine, mine_target)%;\
187
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
466 /msq Mining '%{mine_target}' ...%;\
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
467 @@use mining at %{mine_target}
834d37c620c5 v0.5.9.10; various merchant module improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 183
diff changeset
468
1014
c8ed706fe891 Improvements on the mining autotargetting functionality.
Matti Hamalainen <ccr@tnsp.org>
parents: 1013
diff changeset
469
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
470 /def -i gmine_move =\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
471 /if (mwb_mode=~"mine" & skill_st2=~"on")\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
472 /gmatmove_item %{1}%;\
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
473 /endif
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
474
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1264
diff changeset
475 /gdef -i -p9999 -aBCwhite -mregexp -t"^You begin mining the [a-z ]+ ([a-z]+) and you manage to retrieve an? ([a-z ]+)\." gmine_get1 =\
1239
8d45639802fb Fix automatic material moving when mining not to move coins etc, thanks to Gileon for the fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 1081
diff changeset
476 /test gmine_move({P2},{P1})%;\
1654
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1610
diff changeset
477 @@%{set_grepcmd} 'contains roughly' look at %{P1} on ground
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
478
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1264
diff changeset
479 /gdef -i -p9999 -aBCwhite -mregexp -t"^You mine the [a-z]+ ([a-z]+) and retrieve an? ([a-z ]+)\." gmine_get2 =\
1239
8d45639802fb Fix automatic material moving when mining not to move coins etc, thanks to Gileon for the fix.
Matti Hamalainen <ccr@tnsp.org>
parents: 1081
diff changeset
480 /test gmine_move({P2},{P1})
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
481
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
482
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
483 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1299
a61dc735db1d Add trigger for autowielding mining tools when using minecrafting tunneling.
Matti Hamalainen <ccr@tnsp.org>
parents: 1298
diff changeset
484 ;; MINECRAFTING
a61dc735db1d Add trigger for autowielding mining tools when using minecrafting tunneling.
Matti Hamalainen <ccr@tnsp.org>
parents: 1298
diff changeset
485 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a61dc735db1d Add trigger for autowielding mining tools when using minecrafting tunneling.
Matti Hamalainen <ccr@tnsp.org>
parents: 1298
diff changeset
486 /gdef -i -F -p9999 -aBCwhite -msimple -t"You start preparing for the tunneling." gminecraft_start =\
a61dc735db1d Add trigger for autowielding mining tools when using minecrafting tunneling.
Matti Hamalainen <ccr@tnsp.org>
parents: 1298
diff changeset
487 /test gwb_check_mode("minecraft", set_mtool_mine, "lode")
a61dc735db1d Add trigger for autowielding mining tools when using minecrafting tunneling.
Matti Hamalainen <ccr@tnsp.org>
parents: 1298
diff changeset
488
a61dc735db1d Add trigger for autowielding mining tools when using minecrafting tunneling.
Matti Hamalainen <ccr@tnsp.org>
parents: 1298
diff changeset
489
a61dc735db1d Add trigger for autowielding mining tools when using minecrafting tunneling.
Matti Hamalainen <ccr@tnsp.org>
parents: 1298
diff changeset
490 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
491 ;; MAKE REAGENT
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
492 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
902
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
493 /def -i prgetitem=\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
494 /let _ptmp=$(/nth %{1} %{2})%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
495 /return replace("_"," ",_ptmp)
902
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
496
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
497 /def -i gmrshowlist =\
905
24925b72fa19 Improve "/mr" reagent list output.
Matti Hamalainen <ccr@tnsp.org>
parents: 903
diff changeset
498 /let _mrline=$[strrep("-",12)]+$[strrep("-",27)]+$[strrep("-",32)]%;\
909
1c80c02095d7 Use /msw instead of /echo -p.
Matti Hamalainen <ccr@tnsp.org>
parents: 907
diff changeset
499 /msw ,%{_mrline}.%;\
1c80c02095d7 Use /msw instead of /echo -p.
Matti Hamalainen <ccr@tnsp.org>
parents: 907
diff changeset
500 /msw | Material | Spell | Reagent |%;\
1c80c02095d7 Use /msw instead of /echo -p.
Matti Hamalainen <ccr@tnsp.org>
parents: 907
diff changeset
501 /msw +%{_mrline}+%;\
902
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
502 /let _nline=0%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
503 /while ({#})\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
504 /if (mod(_nline,2) == 1)\
905
24925b72fa19 Improve "/mr" reagent list output.
Matti Hamalainen <ccr@tnsp.org>
parents: 903
diff changeset
505 /let _mrcol=@{Cred}%;\
902
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
506 /else \
905
24925b72fa19 Improve "/mr" reagent list output.
Matti Hamalainen <ccr@tnsp.org>
parents: 903
diff changeset
507 /let _mrcol=@{Cyellow}%;\
902
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
508 /endif%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
509 /let _nline=$[_nline+1]%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
510 /let _mrvar=gmr_mat_%{1}%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
511 /let _mrdata=$[prgetval(_mrvar)]%;\
909
1c80c02095d7 Use /msw instead of /echo -p.
Matti Hamalainen <ccr@tnsp.org>
parents: 907
diff changeset
512 /msw | %{_mrcol}$[pad({1},-10)]@{n} | %{_mrcol}$[pad(prgetitem(1,_mrdata),-25)]@{n} | %{_mrcol}$[pad(prgetitem(2,_mrdata),-30)]@{n} |%;\
902
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
513 /shift%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
514 /done%;\
909
1c80c02095d7 Use /msw instead of /echo -p.
Matti Hamalainen <ccr@tnsp.org>
parents: 907
diff changeset
515 /msw `%{_mrline}'
902
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
516
1069
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
517 ;@command /mr [material]
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
518 ;@desc Make reagent from material. Tools and spell are automatically selected
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
519 ;@desc based on the material. If no material is specified, material of previous
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
520 ;@desc /mr command is used. Invalid material will print a list of reagents,
1b81712b6261 Improve merchant module documentation, move things to embedded TFDocs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1066
diff changeset
521 ;@desc spells and require materials for them.
877
1ee7506ca908 Make some macros invisible.
Matti Hamalainen <ccr@tnsp.org>
parents: 874
diff changeset
522 /def -i mr =\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
523 /if ({*}!~"") /set mmr_target=%*%;/endif%;\
986
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
524 /test gwb_set_bench(mmr_target)%;\
39bdd68b628f Lots of minor modularizations done and code repetition removed.
Matti Hamalainen <ccr@tnsp.org>
parents: 982
diff changeset
525 /test gwb_check_mode("mr", mwb_tool, mmr_target)%;\
915
9f55a8c22877 Oops, forgot a parenthesis.
Matti Hamalainen <ccr@tnsp.org>
parents: 914
diff changeset
526 /let _mrdata=$[prgetval(strcat("gmr_mat_", mmr_target))]%;\
914
1309d5b91b93 Use strcat and change a variable name.
Matti Hamalainen <ccr@tnsp.org>
parents: 913
diff changeset
527 /if (_mrdata!~"")\
1309d5b91b93 Use strcat and change a variable name.
Matti Hamalainen <ccr@tnsp.org>
parents: 913
diff changeset
528 /set mmr_spell=$[prgetitem(1,_mrdata)]%;\
1309d5b91b93 Use strcat and change a variable name.
Matti Hamalainen <ccr@tnsp.org>
parents: 913
diff changeset
529 /set mmr_rn1=$[prgetitem(2,_mrdata)]%;\
1309d5b91b93 Use strcat and change a variable name.
Matti Hamalainen <ccr@tnsp.org>
parents: 913
diff changeset
530 /set mmr_rn2=$[prgetitem(3,_mrdata)]%;\
902
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
531 /if (opt_usepouch=~"on" & set_pouchname=~"" & mmr_warn != 1)\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
532 /set mmr_warn=1%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
533 /gwarning Pouch name (/pouchname) not set, but usepouch enabled.%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
534 /endif%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
535 /if (opt_usepouch=~"on" & set_pouchname!~"")\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
536 /msq Make Reagent from '%{mmr_target}' for spell '%{mmr_spell}' into '%{set_pouchname} ...%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
537 @@use make reagent at %{mmr_target} for $[tolower(mmr_spell)] into %{set_pouchname}%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
538 /else \
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
539 /msq Make Reagent from '%{mmr_target}' for spell '%{mmr_spell}' ...%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
540 @@use make reagent at %{mmr_target} for $[tolower(mmr_spell)]%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
541 /endif%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
542 /else \
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
543 /msq @{BCwhite}Unknown/unset material, possible reagent materials are:@{n}%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
544 /gmrshowlist %{gmr_names}%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
545 /break%;\
1d31fe197cb0 Partially recoded reagent making helper.
Matti Hamalainen <ccr@tnsp.org>
parents: 901
diff changeset
546 /endif
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
547
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
548
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
549 ;; Automagically weigh the remaining material after crafting, if belt is enabled
1266
7910e501e680 Use /gdef instead of /def where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents: 1264
diff changeset
550 /gdef -i -F -p9999 -aCgreen -msimple -t"You craft some spell reagents." gmmr_done =\
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
551 /if (opt_havebelt=~"on") @@weigh %{mmr_target}%;/endif
1
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
552
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
553
1077a5d5de09 Initial revision
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
554 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
188
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
555 ;; Chest creation status translation
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
556 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
557 /def -i gchest_report =\
451
447bb03b96dc Cleanups, fixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
558 /substitute -p @{BCyellow}%{1}@{n} @{BCwhite}(@{n}@{BCgreen}%{2}@{n}/@{Cgreen}%{3}@{n}@{BCwhite})@{n}
188
db8d5f41d70f v0.5.9.11; fixes, very simple chest status translator trigger added
Matti Hamalainen <ccr@tnsp.org>
parents: 187
diff changeset
559
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
560 ;; Chest build status
871
537100a0be32 Tiny adjustments here and there.
Matti Hamalainen <ccr@tnsp.org>
parents: 869
diff changeset
561 /def -i -msimple -t"It looks totally incomplete." gchest_build0 = /test gchest_report({*},0,16)
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
562 /def -i -msimple -t"The basic structure is forming up." gchest_build1 = /test gchest_report({*},1,16)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
563 /def -i -msimple -t"It slightly resembles a chest." gchest_build2 = /test gchest_report({*},2,16)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
564 /def -i -msimple -t"It is missing a lid." gchest_build3 = /test gchest_report({*},3,16)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
565 /def -i -msimple -t"It is still quite shaky." gchest_build4 = /test gchest_report({*},4,16)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
566 /def -i -msimple -t"It looks like a small chest but it could be so much more." gchest_build5 = /test gchest_report({*},5,16)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
567 /def -i -msimple -t"It does not look quite safe yet." gchest_build6 = /test gchest_report({*},6,16)
1260
eafec7542239 Okay, that fix wasn't enough. Fixed. :P
Matti Hamalainen <ccr@tnsp.org>
parents: 1259
diff changeset
568 /def -i -msimple -t"The base looks strong now, but the lid is still quite weak." gchest_build7 = /test gchest_report({*},7,16)
897
7dca56c2847e Adjust to handle difference between coffer and chest status messages.
Matti Hamalainen <ccr@tnsp.org>
parents: 882
diff changeset
569 /def -i -mregexp -t"^The (chest is looking|coffer looks) much larger\.$" gchest_build8 = /test gchest_report({*},8,16)
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
570 /def -i -msimple -t"The construction looks bigger and bigger." gchest_build9 = /test gchest_report({*},9,16)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
571 /def -i -msimple -t"The structure is now stronger than ever before." gchest_build10 = /test gchest_report({*},10,16)
1315
d54608700b7a Fix one chest building status vs. coffers.
Matti Hamalainen <ccr@tnsp.org>
parents: 1300
diff changeset
572 /def -i -mregexp -t"^The (chest|coffer) looks big enough to hold (out several equipments|a lot of money)\.$" gchest_build11 = /test gchest_report({*},11,16)
997
468eb4912d01 Another coffer build message adjustment.
Matti Hamalainen <ccr@tnsp.org>
parents: 996
diff changeset
573 /def -i -mregexp -t"^The extra material has made the (chest|coffer) almost impossible to breach.$" gchest_build12 = /test gchest_report({*},12,16)
1019
20485e6ea12b Another chest vs. coffer build status difference amended.
Matti Hamalainen <ccr@tnsp.org>
parents: 1016
diff changeset
574 /def -i -mregexp -t"^The (chest |)construction looks quite large and safe\.$" gchest_build13 = /test gchest_report({*},13,16)
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
575 /def -i -msimple -t"The extra material in support-structure guarantees quality." gchest_build14 = /test gchest_report({*},14,16)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
576 /def -i -msimple -t"The chest looks just perfect and there is very little unfinished." gchest_build15 = /test gchest_report({*},15,16)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
577 /def -i -msimple -t"The construction looks very big and sturdy." gchest_build16 = /test gchest_report({*},16,16)
286
108a14295243 Chest reinforcement translation
Matti Hamalainen <ccr@tnsp.org>
parents: 243
diff changeset
578
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
579 ;; Chest reinforcement status
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
580 /def -i -msimple -t"The reinforcement looks totally incomplete." gchest_reinf1 = /test gchest_report({*},1,8)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
581 /def -i -msimple -t"The reinforcement is still quite weak." gchest_reinf2 = /test gchest_report({*},2,8)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
582 /def -i -msimple -t"The structure looks much stronger because of the reinforcement." gchest_reinf3 = /test gchest_report({*},3,8)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
583 /def -i -msimple -t"The reinforcement still lacks quality." gchest_reinf4 = /test gchest_report({*},4,8)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
584 /def -i -msimple -t"The reinforcement looks fine but it could be improved." gchest_reinf5 = /test gchest_report({*},5,8)
996
6c1d4706abd5 Adjust one reinforcement message regexp to catch coffers also.
Matti Hamalainen <ccr@tnsp.org>
parents: 987
diff changeset
585 /def -i -mregexp -t"^The reinforced (chest|coffer) looks quite sturdy now.$" gchest_reinf6 = /test gchest_report({*},6,8)
587
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
586 /def -i -msimple -t"It would be a pain to force through the reinforcements." gchest_reinf7 = /test gchest_report({*},7,8)
81189696e27b Major cleanup of merchant module. New features added.
Matti Hamalainen <ccr@tnsp.org>
parents: 573
diff changeset
587 /def -i -msimple -t"Just a final touch and the reinforcement is fully complete." gchest_reinf8 = /test gchest_report({*},8,8)
286
108a14295243 Chest reinforcement translation
Matti Hamalainen <ccr@tnsp.org>
parents: 243
diff changeset
588
987
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
589
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
590 ;; Chest creation helper
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
591 /def -i cbuild =\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
592 /if ({#}>0) /set mcc_mat=%{1}%;/endif%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
593 /if ({#}>1) /set mcc_chest=%{-1}%;/endif%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
594 /if (mcc_chest=~"") /set mcc_chest=chest%;/endif%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
595 /if (mcc_mat!~"")\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
596 /msq Building '%{mcc_chest}' hull from '%{mcc_mat}' ...%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
597 @@get %{mcc_mat}%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
598 @@use chest creation at build %{mcc_chest} hull from %{mcc_mat}%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
599 /else \
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
600 /msq No chest building material set or specified!%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
601 /endif
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
602
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
603 /def -i creinf =\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
604 /if ({#}>0) /set mcc_rmat=%{1}%;/endif%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
605 /if ({#}>1) /set mcc_chest=%{-1}%;/endif%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
606 /if (mcc_chest=~"") /set mcc_chest=chest%;/endif%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
607 /if (mcc_mat!~"")\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
608 /msq Reinforcing '%{mcc_chest}' hull from '%{mcc_rmat}' ...%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
609 @@get %{mcc_rmat}%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
610 @@use chest creation at reinforce %{mcc_chest} hull with %{mcc_rmat}%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
611 /else \
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
612 /msq No chest building material set or specified!%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
613 /endif
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
614
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
615 /def -i ccomplete =\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
616 /if ({#}>0) /set mcc_chest=%{*}%;/endif%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
617 /if (mcc_chest=~"") /set mcc_chest=chest%;/endif%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
618 /msq Completing '%{mcc_chest}' ...%;\
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
619 @@use chest creation at complete %{mcc_chest}
2adb9435411f Added some chest creation helper macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 986
diff changeset
620
1031
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
621
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
622 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1066
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
623 ;; Workbench helpers
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
624 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
625 ;@command /wbmang
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
626 ;@desc Toggles pro-workbench beautifying / output list mangling. This
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
627 ;@desc mangling mode tries to make the pro-workbench output more
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
628 ;@desc readable, and adds mineral number indexes for easier accesss.
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
629 ;@desc Especially helpful when you need to work on specific # of mineral.
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
630
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
631 /prdeftoggle -n"wbmang" -d"Mangle pro merchant workbench output"
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
632
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
633 /set gwbt_st=0
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
634
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
635 /def -i gwbt_clear =\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
636 /while ({#})\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
637 /eval /unset gwbt_%{1}_cnt%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
638 /shift%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
639 /done
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
640
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
641 /def -i gwbt_add =\
1080
8dd1791aee6d Fix pro-bench mangler for minerals with whitespaces in their names.
Matti Hamalainen <ccr@tnsp.org>
parents: 1073
diff changeset
642 /let _name=$[replace(" ","_",{1})]%;\
8dd1791aee6d Fix pro-bench mangler for minerals with whitespaces in their names.
Matti Hamalainen <ccr@tnsp.org>
parents: 1073
diff changeset
643 /test prlist_insert("gwbt_minerals",_name)%;\
8dd1791aee6d Fix pro-bench mangler for minerals with whitespaces in their names.
Matti Hamalainen <ccr@tnsp.org>
parents: 1073
diff changeset
644 /let _cnt=$[prgetval(strcat("gwbt_",_name,"_cnt")) + 1]%;\
8dd1791aee6d Fix pro-bench mangler for minerals with whitespaces in their names.
Matti Hamalainen <ccr@tnsp.org>
parents: 1073
diff changeset
645 /set gwbt_%{_name}_cnt=%{_cnt}%;\
1066
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
646 /return _cnt
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
647
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
648 /def -i -F -E(opt_wbmang=~"on") -mregexp -t"^This is a (loom|forge|workbench) in which you can .store. and .sort. up to " gwbt_start =\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
649 /set gwbt_st=1%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
650 /gwbt_clear %{gwbt_minerals}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
651 /set gwbt_minerals=
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
652
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
653 /def -i gwbt_output2 =\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
654 /eval /echo -p %%{gwbt_%{1}_str} | %%{gwbt_%{2}_str}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
655 /eval /unset gwbt_%{1}_str%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
656 /eval /unset gwbt_%{2}_str
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
657
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
658 /def -i gwbt_output1 =\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
659 /eval /echo -p %%{gwbt_%{1}_str}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
660 /eval /unset gwbt_%{1}_str
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
661
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
662 /def -i -F -Egwbt_st -mregexp -t"^It looks " gwbt_end =\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
663 /if (gwbt_st==2)\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
664 /echo -p @{BCwhite}-------------------------------------------------------------------------------@{n}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
665 /if (gwbt_line >= 2)\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
666 /let _line=1%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
667 /while (_line <= gwbt_line)\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
668 /gwbt_output2 $[_line] $[_line+1]%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
669 /let _line=$[_line+2]%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
670 /done%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
671 /else \
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
672 /let _line=1%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
673 /while (_line <= gwbt_line)\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
674 /gwbt_output1 %{_line}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
675 /let _line=$[_line+1]%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
676 /done%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
677 /endif%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
678 /echo -p @{BCwhite}-------------------------------------------------------------------------------@{n}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
679 /endif%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
680 /set gwbt_st=0
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
681
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
682 /def -i gwbt_queue =\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
683 /if (regmatch(gwbt_match, {1}))\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
684 /set gwbt_line=$[gwbt_line+1]%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
685 /set gwbt_%{gwbt_line}_str=%{2}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
686 /endif
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
687
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
688 /def -i gwbt_str =\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
689 /if ({4}!~"divine")\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
690 /let _col1=Cred%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
691 /let _col2=Cgreen%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
692 /let _col3=Cyellow%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
693 /else \
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
694 /let _col1=BCwhite%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
695 /let _col2=n%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
696 /let _col3=n%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
697 /endif%;\
1080
8dd1791aee6d Fix pro-bench mangler for minerals with whitespaces in their names.
Matti Hamalainen <ccr@tnsp.org>
parents: 1073
diff changeset
698 /return "@{%{_col1}}$[pad({1},3)]@{n} @{%{_col3}}$[prsubipad({2},13)]@{n}:@{BCwhite}$[pad({3},1)]@{n}@{%{_col2}}$[prsubpad({4},8)]@{n}/$[pad({5},10)]"
1066
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
699
1080
8dd1791aee6d Fix pro-bench mangler for minerals with whitespaces in their names.
Matti Hamalainen <ccr@tnsp.org>
parents: 1073
diff changeset
700 /def -i -F -Egwbt_st -mregexp -t"^ ([a-z ]+) \[(\*|)([a-z]+)/([0-9]+\.[0-9]+k?g|[0-9]+k?g)\] +([a-z ]+) \[(\*|)([a-z]+)/([0-9]+\.[0-9]+k?g|[0-9]+k?g)\] +$" gwbt_line1 =\
1066
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
701 /let _n1=%{P1}%;/let _n2=%{P5}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
702 /let _r1=%{P2}%;/let _r2=%{P6}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
703 /let _q1=%{P3}%;/let _q2=%{P7}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
704 /let _k1=%{P4}%;/let _k2=%{P8}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
705 /let _v1=$[gwbt_add(_n1)]%;/let _v2=$[gwbt_add(_n2)]%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
706 /if (gwbt_st==1)\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
707 /substitute -p $[gwbt_str(_v1,_n1,_r1,_q1,_k1)] | $[gwbt_str(_v2,_n2,_r2,_q2,_k2)]%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
708 /else \
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
709 /test gwbt_queue(_n1, gwbt_str(_v1,_n1,_r1,_q1,_k1))%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
710 /test gwbt_queue(_n2, gwbt_str(_v2,_n2,_r2,_q2,_k2))%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
711 /substitute -ag%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
712 /endif
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
713
1080
8dd1791aee6d Fix pro-bench mangler for minerals with whitespaces in their names.
Matti Hamalainen <ccr@tnsp.org>
parents: 1073
diff changeset
714 /def -i -F -Egwbt_st -mregexp -t"^ ([a-z ]+) \[(\*|)?([a-z]+)/([0-9]+\.[0-9]+k?g|[0-9]+k?g)\] +$" gwbt_line2 =\
1066
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
715 /let _n1=%{P1}%;/let _r1=%{P2}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
716 /let _q1=%{P3}%;/let _k1=%{P4}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
717 /let _v1=$[gwbt_add(_n1)]%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
718 /if (gwbt_st==1)\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
719 /substitute -p $[gwbt_str(_v1,_n1,_r1,_q1,_k1)] |%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
720 /else \
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
721 /test gwbt_queue(_n1, gwbt_str(_v1,_n1,_r1,_q1,_k1))%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
722 /substitute -ag%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
723 /endif
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
724
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
725
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
726 ;@command /wbgrep <workbench> <mineral regexp>
1423
fcc9fba389b2 Fix some inline documentation.
Matti Hamalainen <ccr@tnsp.org>
parents: 1327
diff changeset
727 ;@desc Performs a "grep '&lt;mineral regexp&gt;' look at &lt;workbench&gt;" with workbench
1066
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
728 ;@desc mangling enabled and filters results. This is useful for quick searches
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
729 ;@desc to see if given material exists in the bench and how many pieces there are.
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
730 /def -i wbgrep =\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
731 /set gwbt_st=2%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
732 /set gwbt_line=0%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
733 /set gwbt_match=%{-1}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
734 /gwbt_clear %{gwbt_minerals}%;\
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
735 /set gwbt_minerals=%;\
1654
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1610
diff changeset
736 /test send(strcat("@@",set_grepcmd," '",gwbt_match,"|^It looks ' look at ",{1}))
1066
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
737
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
738 /prdefgbind -s"wbl" -c"/wbgrep"
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
739
82286385adb4 Added pro-workbench output mangler.
Matti Hamalainen <ccr@tnsp.org>
parents: 1035
diff changeset
740 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1031
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
741 ;; Leadership hall helpers
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
742 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
743 /def -i -F -p999 -Emrlead_st -msimple -t"You see nothing special." mrchk_off1 =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
744 /set mrlead_st=0
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
745
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
746 /def -i mrchk_check_types =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
747 /while ({#})\
1654
a599a9429928 Implement 'grepcmd' setting (/grepcmd, /opts), which can be used to
Matti Hamalainen <ccr@tnsp.org>
parents: 1610
diff changeset
748 /test send("@@%{set_grepcmd} 'leader\.\$' kneel %{1}")%;\
1031
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
749 /shift%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
750 /done
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
751
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
752 /def -i mrchk_print_types =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
753 /set mrlead_st=0%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
754 /msw .---------------------------.%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
755 /msw | Merchant type leaderships |%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
756 /msw +---------------------------+---------.%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
757 /msw | Type | Leader | You |%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
758 /msw |------------+-----------------+------|%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
759 /while ({#})\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
760 /let _name=$[prgetval(strcat("mrlead_",{1}))]%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
761 /let _perc=$[prgetval(strcat("mrlead_",{1},"_p"))]%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
762 /msw | $[pad({1},-10)] | $[pad(_name,-15)] | @{BCwhite}$[pad(_perc,3)]@{n}% |%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
763 /shift%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
764 /done%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
765 /msw `-------------------------------------'
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
766
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
767 /def -i -F -p999 -Emrlead_st -mregexp -t"^You feel like kneeling in front of the statue might yield more information" mrchk_off2 =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
768 /substitute -ag%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
769 /mrchk_check_types %{gmat_types}
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
770
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
771 /def -i -Emrlead_st -mregexp -t"^There are several vitrines standing in the middle of the room. Each has been made in resemblance of a player." mrchk_line0 =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
772 /substitute -ag
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
773
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
774 /def -i -Emrlead_st -mregexp -t"^An? ([a-z]+) statue resembling ([A-Z][a-z]+)\.$" mrchk_line1 =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
775 /set mrlead_%{P1}=%{P2}%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
776 /substitute -ag
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
777
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
778 /def -i mrchk_end =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
779 /set mrlead_%{1}_p=%{2}%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
780 /substitute -ag%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
781 /let _last=$(/last %{gmat_types})%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
782 /if ({1}=~_last) /mrchk_print_types %{gmat_types}%;/endif
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
783
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
784 /def -i -Emrlead_st -mregexp -t"^You feel like being ([0-9]+)\% as good as the current ([a-z]+) leader\.$" mrchk_line3 =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
785 /test mrchk_end({P2},{P1})
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
786
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
787 /def -i -Emrlead_st -mregexp -t"^You have no experience with ([a-z]+), unlike ([A-Z][a-z]+), the current leader\.$" mrchk_line4 =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
788 /test mrchk_end({P1},0)
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
789
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
790 /def -i chkmerc =\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
791 /set mrlead_st=1%;\
9568504e4879 Added /chkmerc command for checking your status in merchant material type leaderships.
Matti Hamalainen <ccr@tnsp.org>
parents: 1019
diff changeset
792 /test send("@@look at statues")