/
LotJDevelopment.xml
214 lines (186 loc) · 5.07 KB
/
LotJDevelopment.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, May 04, 2010, 3:32 PM -->
<!-- MuClient version 4.40 -->
<!-- Plugin "LotJDevelopment" generated by Plugin Wizard -->
<muclient>
<plugin
name="LotJDevelopment"
author="@Ilyena"
id="ccc64ed415951ef5a12640e4"
language="Lua"
purpose="A small tool for making development less tedious"
save_state="y"
date_written="2010-05-04 15:31:49"
requires="4.40"
version="1.0"
>
<description trim="y">
<![CDATA[
devhelp
]]>
</description>
</plugin>
<!-- Get our standard constants -->
<include name="constants.lua"/>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
group="Development"
match="You mess up your data. Now you have to start all over again..."
name="FailedAttempt"
script="DevelopmentAttempt"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="Development"
match="You spend hours developing but make no breakthroughs."
name="NoSuccessDev"
script="IncreaseIncrement"
sequence="100"
>
</trigger>
</triggers>
<!-- Aliases -->
<aliases>
<alias
name="ShowDevHelp"
script="ShowDevelopmentCommands"
match="devhelp"
enabled="y"
group="Development"
sequence="100"
>
</alias>
<alias
name="ShowDevInfo"
script="ShowDevelopmentInformation"
match="devinfo"
enabled="y"
group="Development"
sequence="100"
>
</alias>
<alias
name="BeginDevelopment"
script="DevelopmentAttempt"
match="devbegin"
enabled="y"
group="Development"
sequence="100"
>
</alias>
<alias
name="DevAttempts"
script="SetAttempts"
match="devtries *"
enabled="y"
group="Development"
sequence="100"
>
</alias>
<alias
name="DevelopmentScience"
script="SetScience"
match="devscience *"
enabled="y"
group="Development"
sequence="100"
>
</alias>
<alias
name="DevelopmentClear"
script="ClearDevelopment"
match="devclear"
enabled="y"
group="Development"
sequence="100"
>
</alias>
</aliases>
<!-- Variables -->
<variables>
<variable name="totalDevelopmentCost">450000</variable>
<variable name="developmentArea">data</variable>
<variable name="developmentAttempts">7</variable>
</variables>
<!-- Script -->
<script>
<![CDATA[
triesLeft = GetVariable("developmentAttempts")
developmentScience = GetVariable("developmentArea")
totalCost = GetVariable("totalDevelopmentCost")
function ClearDevelopment(name, line, wildcards)
SetVariable("developmentAttempts", "0")
triesLeft = GetVariable("developmentAttempts")
SetVariable("developmentArea", "")
developmentScience = GetVariable("developmentArea")
SetVariable("totalDevelopmentCost", "0")
totalCost = GetVariable("totalDevelopmentCost")
ColourNote("red", "black", "Development Cleared")
end -- function
function DevelopmentAttempt(name, line, wildcards)
if(tonumber(triesLeft) > 0) then
Execute("develop ".. developmentScience)
else
ColourNote("red", "black", "Development Attempts Exhausted")
end -- if
end -- function
function IncreaseIncrement(name, line, wildcards)
SetVariable("developmentAttempts", GetVariable("developmentAttempts") - 1)
SetVariable("totalDevelopmentCost", GetVariable("totalDevelopmentCost") + 50000)
triesLeft = GetVariable("developmentAttempts")
totalCost = GetVariable("totalDevelopmentCost")
ColourNote("grey", "black", "Attempts left: ".. triesLeft)
ColourNote("grey", "black", "Total cost so far: " .. totalCost .. " credits")
DevelopmentAttempt()
end -- function
function SetAttempts(name, line, wildcards)
if (wildcards[1] ~= nil) then
SetVariable("developmentAttempts", wildcards[1])
triesLeft = GetVariable("developmentAttempts")
ColourNote("grey", "black", "Attempts set to ".. triesLeft)
end -- if
end -- function
function SetScience(name, line, wildcards)
if (wildcards[1] ~= nil) then
SetVariable("developmentArea", wildcards[1])
developmentScience = GetVariable("developmentArea")
ColourNote("grey", "black", "Science Set to ".. developmentScience)
end -- if
end -- function
function ShowDevelopmentInformation(name, line, wildcards)
ColourNote("lime", "black", "Attempts Left: ".. triesLeft)
ColourNote("lime", "black", "Development Science: ".. developmentScience)
ColourNote("lime", "black", "Cost So Far: ".. totalCost .. " credits")
end -- function
function ShowDevelopmentCommands(name, line, wildcards)
ColourNote("grey", "black", "*** Development Assistant by @Ilyena ***")
ColourNote("grey", "black", "'devinfo' - Show Development Information")
ColourNote("grey", "black", "'devscience #' - Set the area of development")
ColourNote("grey", "black", "'devtries #' - Set the number of attempts to be made")
ColourNote("grey", "black", "'devbegin' - Start the development process")
ColourNote("grey", "black", "'devclear' - Clear the development information")
end -- function
]]>
</script>
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="LotJDevelopment:help"
enabled="y"
>
</alias>
</aliases>
<script>
<![CDATA[
function OnHelp ()
world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script>
</muclient>