More updates to both the Combateering and Empathing systems

Now when you call TTAR <target> and GM for Combateering and Empathing
respectively, the actions queue is reset. This should hopefully help to
fix some deadlocking issues that arise.
This commit is contained in:
Zachary Dziura 2016-10-14 19:51:27 -04:00
parent b9af3f297d
commit 3d8f52e7d8
2 changed files with 142 additions and 121 deletions

View file

@ -40,7 +40,7 @@ disableTrigger(&quot;Autopilot&quot;)
send(&quot;config shipsight 1&quot;, false) send(&quot;config shipsight 1&quot;, false)
send(&quot;config aethermap on&quot;, false) send(&quot;config aethermap on&quot;, false)
local reset = dreadnought.pilot.reset() local reset = dreadnought.reset.pilot()
dreadnought.aetherbeastsTotal = reset.aetherbeastsTotal dreadnought.aetherbeastsTotal = reset.aetherbeastsTotal
dreadnought.currentModule = matches[2] dreadnought.currentModule = matches[2]
dreadnought.pilot = reset.pilot dreadnought.pilot = reset.pilot
@ -72,7 +72,7 @@ disableTrigger(&quot;Autopilot&quot;)
send(&quot;config shipsight 0&quot;, false) send(&quot;config shipsight 0&quot;, false)
send(&quot;config aethermap off&quot;, false) send(&quot;config aethermap off&quot;, false)
local reset = dreadnought.pilot.reset() local reset = dreadnought.reset.pilot()
dreadnought.aetherbeastsTotal = reset.aetherbeastsTotal dreadnought.aetherbeastsTotal = reset.aetherbeastsTotal
dreadnought.currentModule = reset.currentModule dreadnought.currentModule = reset.currentModule
dreadnought.pilot = reset.pilot</script> dreadnought.pilot = reset.pilot</script>
@ -730,67 +730,19 @@ dmsg(&quot;The empathic grid is set up and ready for your control.&quot;)</scrip
<colorTriggerBgColor>#000000</colorTriggerBgColor> <colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList/> <regexCodeList/>
<regexCodePropertyList/> <regexCodePropertyList/>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Damaged</name>
<script>dreadnought.heap.insert(dreadnought.actions, dreadnought.action(&quot;hull&quot;, 2, &quot;grid repair hull&quot;))</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>concussive shock rips through the hull.$</string>
<string>swiftly shears through her hull.$</string>
<string>rips apart her hull.$</string>
<string>shreds deep rends through her hull.$</string>
<string>^Violet sparks fly through the air and </string>
<string>^\(Ship\): \w+ says, \&quot;Repair.\&quot;$</string>
<string> cries out as bolts of jagged energy strike out from the ruptured fabric of aetherspace here.$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
<integer>1</integer>
<integer>1</integer>
<integer>1</integer>
<integer>1</integer>
<integer>1</integer>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Repairing</name>
<script>dreadnought.heap.head(dreadnought.actions).postCommand()</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^You send a surge of strength through the empathic grid</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Repaired</name> <name>Repaired</name>
<script>local action = dreadnought.heap.head(dreadnought.actions) <script>while dreadnought.actions.size &gt; 0 do
local action = dreadnought.heap.head(dreadnought.actions)
if action.name == &quot;hull&quot; then action.postCommand()
dreadnought.heap.extract(dreadnought.actions)
end
action.postCommand()</script> if action.name == &quot;hull&quot; then
dreadnought.heap.extract(dreadnought.actions)
else
break
end
end</script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta> <conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen> <mStayOpen>0</mStayOpen>
@ -810,7 +762,7 @@ action.postCommand()</script>
</Trigger> </Trigger>
</TriggerGroup> </TriggerGroup>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Repair</name> <name>Modules</name>
<script>local module = matches[2] <script>local module = matches[2]
local id = matches[3] local id = matches[3]
local damage = matches[4] local damage = matches[4]
@ -887,7 +839,9 @@ end</script>
dreadnought.empath.slivvensFound = 0 dreadnought.empath.slivvensFound = 0
dreadnought.empath.flags.checkSlivven = false dreadnought.empath.flags.checkSlivven = false
end</script> end
dreadnought.repairShip(dreadnought.actions)</script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta> <conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen> <mStayOpen>0</mStayOpen>
@ -909,12 +863,11 @@ end</script>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Repairing</name> <name>Repairing</name>
<script>local action = dreadnought.heap.head(dreadnought.actions) <script>local action = dreadnought.heap.head(dreadnought.actions)
action.postCommand()
if matches[3] == &quot;fully&quot; and action.name == matches[2] then if action.name == matches[2] then
dreadnought.heap.extract(dreadnought.actions) dreadnought.heap.extract(dreadnought.actions)
end end</script>
action.postCommand()</script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta> <conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen> <mStayOpen>0</mStayOpen>
@ -926,10 +879,16 @@ action.postCommand()</script>
<colorTriggerFgColor>#000000</colorTriggerFgColor> <colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor> <colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList> <regexCodeList>
<string>^Crackling energy surges to (?:\w+\s){2}(\w+), (\w+) healing it\.$</string> <string>You send a surge of strength through the empathic grid</string>
<string>As you attempt to operate the empathic grid, it sputters and gyrates without producing a noticeable result.</string> <string>As you attempt to operate the empathic grid, it sputters and gyrates without producing a noticeable result.</string>
<string>The empathic grid is not yet ready to be used again.</string>
<string>^Crackling energy surges to (?:a|an) \w+ (\w+), fully healing it\.$</string>
<string>The empathic grid is not yet ready to be used again.</string>
</regexCodeList> </regexCodeList>
<regexCodePropertyList> <regexCodePropertyList>
<integer>2</integer>
<integer>3</integer>
<integer>3</integer>
<integer>1</integer> <integer>1</integer>
<integer>3</integer> <integer>3</integer>
</regexCodePropertyList> </regexCodePropertyList>
@ -1053,10 +1012,10 @@ action.postCommand()</script>
</regexCodePropertyList> </regexCodePropertyList>
</Trigger> </Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Aetherbeast Dead</name> <name>Target Destroyed</name>
<script>if dreadnought.empath.skills.Purser then <script>if dreadnought.empath.skills.Purser then
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;emergency clarity&quot;, 1, &quot;grid clarity &quot; .. dreadnought.empath.modules.chair)) dreadnought.action(&quot;clarity&quot;, 4, &quot;grid clarity &quot; .. dreadnought.empath.modules.chair))
end</script> end</script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta> <conditonLineDelta>0</conditonLineDelta>
@ -1098,6 +1057,8 @@ end</script>
dreadnought.action(&quot;planarbond&quot;, 1, &quot;grid planarbond&quot;)) dreadnought.action(&quot;planarbond&quot;, 1, &quot;grid planarbond&quot;))
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;covey&quot;, 1, &quot;grid covey&quot;)) dreadnought.action(&quot;covey&quot;, 1, &quot;grid covey&quot;))
dreadnought.repairShip(dreadnought.actions)
end</script> end</script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta> <conditonLineDelta>0</conditonLineDelta>
@ -1110,7 +1071,7 @@ end</script>
<colorTriggerFgColor>#000000</colorTriggerFgColor> <colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor> <colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList> <regexCodeList>
<string>^(?:\w+\s?)+ launches into the aetherways\.$</string> <string>^[\w\'\s]+ launches into the aetherways\.$</string>
</regexCodeList> </regexCodeList>
<regexCodePropertyList> <regexCodePropertyList>
<integer>1</integer> <integer>1</integer>
@ -1136,7 +1097,7 @@ action.postCommand()</script>
<colorTriggerFgColor>#000000</colorTriggerFgColor> <colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor> <colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList> <regexCodeList>
<string>^You point out to (?:\w+\s?)+ that \w+ has a covey\.$</string> <string>^You point out to [\w\'\s]+ that she has a covey\.$</string>
</regexCodeList> </regexCodeList>
<regexCodePropertyList> <regexCodePropertyList>
<integer>1</integer> <integer>1</integer>
@ -1162,7 +1123,7 @@ action.postCommand()</script>
<colorTriggerFgColor>#000000</colorTriggerFgColor> <colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor> <colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList> <regexCodeList>
<string>^You direct (?:\w+\s?)+ to form a deep planar bond with the crew, rooting each of them to the distant aetherwaves\.$</string> <string>^You direct [\w\'\s]+ to form a deep planar bond with the crew, rooting each of them to the distant aetherwaves\.$</string>
</regexCodeList> </regexCodeList>
<regexCodePropertyList> <regexCodePropertyList>
<integer>1</integer> <integer>1</integer>
@ -1171,7 +1132,8 @@ action.postCommand()</script>
</TriggerGroup> </TriggerGroup>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Slivven Check</name> <name>Slivven Check</name>
<script>dreadnought.empath.flags.checkSlivven = true <script>dreadnought.actions = dreadnought.heap.new()
dreadnought.empath.flags.checkSlivven = true
send(&quot;grid modules&quot;, false)</script> send(&quot;grid modules&quot;, false)</script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta> <conditonLineDelta>0</conditonLineDelta>
@ -1192,6 +1154,36 @@ send(&quot;grid modules&quot;, false)</script>
<integer>1</integer> <integer>1</integer>
</regexCodePropertyList> </regexCodePropertyList>
</Trigger> </Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Prompt</name>
<script>if dreadnought.currentModule == &quot;grid&quot; then
local hullStrength = tonumber(matches[2])
dreadnought.empath.hull.current = hullStrength
if hullStrength &gt; dreadnought.empath.hull.max then
dreadnought.empath.hull.max = hullStrength
elseif hullStrength &lt; dreadnought.empath.hull.max then
dreadnought.heap.insert(dreadnought.actions, dreadnought.action(&quot;hull&quot;, 2, &quot;grid repair hull&quot;))
dreadnought.repairShip(dreadnought.actions)
end
end</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^\[(\d+)\-hull, \d+\-power, \w+ damage, \d+\-will \*x?\*\]$</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
</regexCodePropertyList>
</Trigger>
</TriggerGroup> </TriggerGroup>
<TriggerGroup isActive="no" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <TriggerGroup isActive="no" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Combateer</name> <name>Combateer</name>
@ -1358,20 +1350,20 @@ dreadnought.fireTurret(dreadnought.actions)</script>
<name>Targeting</name> <name>Targeting</name>
<script>if matches[2] ~= &quot;&quot; then <script>if matches[2] ~= &quot;&quot; then
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;target ship&quot;, 1, &quot;turret target ship &quot; ..matches[3])) dreadnought.action(&quot;target&quot;, 1, &quot;turret target ship &quot; ..matches[3]))
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;fire on ship&quot;, 2, &quot;turret fire&quot;)) dreadnought.action(&quot;fire&quot;, 2, &quot;turret fire&quot;))
else else
if matches[2] == &quot;karibidean&quot; then if matches[2] == &quot;karibidean&quot; then
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;target karibidean&quot;, 5, &quot;turret target creature karibidean&quot;)) dreadnought.action(&quot;target&quot;, 5, &quot;turret target creature karibidean&quot;))
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;fire on karibidean&quot;, 6, &quot;turret fire&quot;)) dreadnought.action(&quot;fire&quot;, 6, &quot;turret fire&quot;))
else else
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;target creature&quot;, 3, &quot;turret target creature &quot; ..matches[3])) dreadnought.action(&quot;target&quot;, 3, &quot;turret target creature &quot; ..matches[3]))
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;fire on creature&quot;, 4, &quot;turret fire&quot;)) dreadnought.action(&quot;fire&quot;, 4, &quot;turret fire&quot;))
end end
end</script> end</script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
@ -1396,7 +1388,7 @@ end</script>
<name>Target Acquired</name> <name>Target Acquired</name>
<script>local action = dreadnought.heap.head(dreadnought.actions) <script>local action = dreadnought.heap.head(dreadnought.actions)
if action.name == &quot;target ship&quot; or action.name == &quot;target creature&quot; or action.name == &quot;target karibidean&quot; then if action.name == &quot;target&quot; then
dreadnought.heap.extract(dreadnought.actions) dreadnought.heap.extract(dreadnought.actions)
end end
@ -1412,7 +1404,7 @@ action.postCommand()</script>
<colorTriggerFgColor>#000000</colorTriggerFgColor> <colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor> <colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList> <regexCodeList>
<string>^You tune the weapon module to target (?:a|an) (?:\w+\-?\s?)+\.$</string> <string>^You tune the weapon module to target (?:a|an) [\w\-\s]+\.$</string>
<string>No such creature is close enough for a battle turret to get a targeting lock.</string> <string>No such creature is close enough for a battle turret to get a targeting lock.</string>
</regexCodeList> </regexCodeList>
<regexCodePropertyList> <regexCodePropertyList>
@ -1557,10 +1549,10 @@ end</script>
</regexCodePropertyList> </regexCodePropertyList>
</Trigger> </Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Beast Dies</name> <name>Target Destroyed</name>
<script>local action = dreadnought.heap.head(dreadnought.actions) <script>local action = dreadnought.heap.head(dreadnought.actions)
if action.name == &quot;fire on ship&quot; or action.name == &quot;fire on creature&quot; or action.name == &quot;fire on karibidean&quot; then if action.name == &quot;fire&quot; then
dreadnought.heap.extract(dreadnought.actions) dreadnought.heap.extract(dreadnought.actions)
end</script> end</script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
@ -1584,7 +1576,7 @@ end</script>
<name>No Target</name> <name>No Target</name>
<script>local action = dreadnought.heap.head(dreadnought.actions) <script>local action = dreadnought.heap.head(dreadnought.actions)
if action.name == &quot;fire on ship&quot; or action.name == &quot;fire on creature&quot; or action.name == &quot;fire on karibidean&quot; then if action.name == &quot;target&quot; or action.name == &quot;fire&quot; then
dreadnought.heap.extract(dreadnought.actions) dreadnought.heap.extract(dreadnought.actions)
end end
@ -1601,9 +1593,11 @@ action.postCommand()</script>
<colorTriggerBgColor>#000000</colorTriggerBgColor> <colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList> <regexCodeList>
<string>A battle turret is not targeting anything.</string> <string>A battle turret is not targeting anything.</string>
<string>No such creature is close enough for a battle turret to get a targeting lock.</string>
</regexCodeList> </regexCodeList>
<regexCodePropertyList> <regexCodePropertyList>
<integer>3</integer> <integer>3</integer>
<integer>3</integer>
</regexCodePropertyList> </regexCodePropertyList>
</Trigger> </Trigger>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
@ -2125,7 +2119,7 @@ end</script>
<integer>1</integer> <integer>1</integer>
</regexCodePropertyList> </regexCodePropertyList>
</Trigger> </Trigger>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no"> <TriggerGroup isActive="no" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Gags</name> <name>Gags</name>
<script></script> <script></script>
<triggerType>0</triggerType> <triggerType>0</triggerType>
@ -2471,8 +2465,9 @@ end</script>
<regex></regex> <regex></regex>
<Alias isActive="yes" isFolder="no"> <Alias isActive="yes" isFolder="no">
<name>Grid Modules</name> <name>Grid Modules</name>
<script></script> <script>dreadnought.actions = dreadnought.heap.new()
<command>grid modules</command> send(&quot;grid modules&quot;, false)</script>
<command></command>
<packageName></packageName> <packageName></packageName>
<regex>^gm$</regex> <regex>^gm$</regex>
</Alias> </Alias>
@ -2505,6 +2500,7 @@ dreadnought.repairShip(dreadnought.actions)</script>
<Alias isActive="yes" isFolder="no"> <Alias isActive="yes" isFolder="no">
<name>Reset</name> <name>Reset</name>
<script>if #matches &gt; 1 then <script>if #matches &gt; 1 then
dreadnought.actions = dreadnought.heap.new()
local resets = dreadnought.reset.empath() local resets = dreadnought.reset.empath()
dreadnought.aetherbeastsTotal = resets.aetherbeastsTotal dreadnought.aetherbeastsTotal = resets.aetherbeastsTotal
@ -2548,22 +2544,24 @@ end</script>
</Alias> </Alias>
<Alias isActive="yes" isFolder="no"> <Alias isActive="yes" isFolder="no">
<name>Set Target</name> <name>Set Target</name>
<script>if #matches &gt; 2 then <script>dreadnought.actions = dreadnought.heap.new()
if #matches &gt; 2 then
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;target ship&quot;, 1, &quot;turret target ship &quot; ..matches[2])) dreadnought.action(&quot;target&quot;, 1, &quot;turret target ship &quot; ..matches[2]))
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;fire on ship&quot;, 2, &quot;turret fire&quot;)) dreadnought.action(&quot;fire&quot;, 2, &quot;turret fire&quot;))
else else
if matches[2] == &quot;karibidean&quot; then if matches[2] == &quot;karibidean&quot; then
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;target karibidean&quot;, 5, &quot;turret target creature karibidean&quot;)) dreadnought.action(&quot;target&quot;, 5, &quot;turret target creature karibidean&quot;))
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;fire on karibidean&quot;, 6, &quot;turret fire&quot;)) dreadnought.action(&quot;fire&quot;, 6, &quot;turret fire&quot;))
else else
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;target creature&quot;, 3, &quot;turret target creature &quot; ..matches[2])) dreadnought.action(&quot;target&quot;, 3, &quot;turret target creature &quot; ..matches[2]))
dreadnought.heap.insert(dreadnought.actions, dreadnought.heap.insert(dreadnought.actions,
dreadnought.action(&quot;fire on creature&quot;, 4, &quot;turret fire&quot;)) dreadnought.action(&quot;fire&quot;, 4, &quot;turret fire&quot;))
end end
end end
@ -2698,6 +2696,7 @@ end</script>
end end
local exch = function(h, x, y) local exch = function(h, x, y)
assert(type(h) == &quot;table&quot;)
assert(type(x) == &quot;number&quot;) assert(type(x) == &quot;number&quot;)
assert(type(y) == &quot;number&quot;) assert(type(y) == &quot;number&quot;)
@ -2707,28 +2706,25 @@ local exch = function(h, x, y)
end end
local sink = function(h, parentIndex) local sink = function(h, parentIndex)
local N = h.size while (parentIndex*2) &lt; h.size do
while (parentIndex*2) &lt;= N do
local childIndex = parentIndex * 2 local childIndex = parentIndex * 2
if childIndex &lt; N and lowerPriority(h.elements[childIndex], if childIndex &lt; h.size and lowerPriority(h.elements[childIndex],
h.elements[childIndex+1]) then h.elements[childIndex+1]) then
childIndex = childIndex + 1 childIndex = childIndex + 1
end end
if not lowerPriority(h.elements[parentIndex], h.elements[childIndex]) then if lowerPriority(h.elements[parentIndex], h.elements[childIndex]) then
break
else
exch(h, parentIndex, childIndex) exch(h, parentIndex, childIndex)
parentIndex = childIndex parentIndex = childIndex
else
break
end end
end end
end end
local swim = function(h, childIndex) local swim = function(h, childIndex)
while childIndex &gt; 1 and lowerPriority(h.elements[math.floor(childIndex/2)], while childIndex &gt; 1 and lowerPriority(h.elements[math.floor(childIndex / 2)], h.elements[childIndex]) do
h.elements[childIndex]) do
local parentIndex = math.floor(childIndex / 2) local parentIndex = math.floor(childIndex / 2)
exch(h, childIndex, parentIndex) exch(h, childIndex, parentIndex)
childIndex = parentIndex childIndex = parentIndex
@ -2752,7 +2748,11 @@ dreadnought.heap = {
extract = function(h) extract = function(h)
exch(h, 1, h.size) exch(h, 1, h.size)
h.size = h.size - 1
if h.size &gt; 0 then
h.size = h.size - 1
end
local ret = table.remove(h.elements) local ret = table.remove(h.elements)
sink(h, 1) sink(h, 1)
@ -2785,20 +2785,26 @@ dreadnought.heap = {
local cmd -- The command to execute the given action command local cmd -- The command to execute the given action command
if type(command) == &quot;string&quot; then if type(command) == &quot;string&quot; then
cmd = function() cmd = function()
send(command, false) if dreadnought.balance and not dreadnought.locked then
dreadnought.locked = true send(command, false)
dreadnought.locked = true
end
end end
elseif type(command) == &quot;table&quot; then elseif type(command) == &quot;table&quot; then
cmd = function() cmd = function()
for _,v in ipairs(command) do if dreadnought.balance and not dreadnought.locked then
send(v, false) for _,v in ipairs(command) do
send(v, false)
end
dreadnought.locked = true
end end
dreadnought.locked = true
end end
else else
cmd = function() cmd = function()
command() if dreadnought.balance and not dreadnought.locked then
dreadnought.locked = true command()
dreadnought.locked = true
end
end end
end end
@ -2809,11 +2815,16 @@ dreadnought.heap = {
postCommand = postCommand postCommand = postCommand
} }
setmetatable(action, { local mt = {
__lt = function(a, b) __lt = function(a, b)
return a.priority &lt; b.priority return a.priority &gt; b.priority
end,
__le = function(a, b)
return a.priority &gt;= b.priority
end end
}) }
setmetatable(action, mt)
return action return action
end</script> end</script>
@ -2945,6 +2956,11 @@ end</script>
<name>Empath</name> <name>Empath</name>
<packageName></packageName> <packageName></packageName>
<script>dreadnought.empath = dreadnought.empath or { <script>dreadnought.empath = dreadnought.empath or {
hull = {
current = 0,
max = 0
},
modules = { modules = {
chair = &quot;&quot;, chair = &quot;&quot;,
grid = &quot;&quot;, grid = &quot;&quot;,
@ -2960,20 +2976,22 @@ end</script>
checkSlivven = false checkSlivven = false
}, },
slivvensFound = 0 slivvensFound = 0,
inspectedModule = &quot;&quot;
} }
function dreadnought.reset.empath() function dreadnought.reset.empath()
sendGMCP([[Char.Skills.Get {&quot;group&quot;:&quot;aethercraft&quot;}]])
send(&quot;\n&quot;)
deleteLineP()
return { return {
aetherbeastsTotal = 0, aetherbeastsTotal = 0,
currentModule = &quot;&quot;, currentModule = &quot;&quot;,
actions = dreadnought.heap.new(), actions = dreadnought.heap.new(),
empath = { empath = {
hull = {
current = 0,
max = 0
},
modules = { modules = {
chair = &quot;&quot;, chair = &quot;&quot;,
grid = &quot;&quot;, grid = &quot;&quot;,
@ -2983,13 +3001,14 @@ function dreadnought.reset.empath()
cube = &quot;&quot; cube = &quot;&quot;
}, },
skills = {}, skills = dreadnought.empath.skills,
flags = { flags = {
checkSlivven = false checkSlivven = false
}, },
slivvensFound = 0 slivvensFound = 0,
inspectedModule = &quot;&quot;
} }
} }
end</script> end</script>
@ -3022,7 +3041,7 @@ function dreadnought.reset.combateer()
actions = dreadnought.heap.new(), actions = dreadnought.heap.new(),
combateer = { combateer = {
skills = {}, skills = dreadnought.combateer.skills,
flags = { flags = {
canVortex = false canVortex = false
} }
@ -3081,6 +3100,7 @@ end</script>
Astralsight = true, Astralsight = true,
Purser = true, Purser = true,
Scan = true, Scan = true,
FirstMate = true,
Resonance = true Resonance = true
} }

View file

@ -6,6 +6,7 @@ An automated aetherhunting system for Lusternia, written in Lua for the Mudlet c
Installation Installation
---------- ----------
0. Make sure that the GMCP is enabled before installing. You can double-check by clicking on the `Settings` button within Mudlet, and within the `General` tab there is a checkbox to "Enable GMCP". If not checked off, check that box, click "Save", then restart Mudlet.
1. Click on the green button above labeled `Clone or download`. From the dropdown that appears, click `Download ZIP`. 1. Click on the green button above labeled `Clone or download`. From the dropdown that appears, click `Download ZIP`.
2. Extract the zip file somewhere on your computer (such as your Downloads folder). 2. Extract the zip file somewhere on your computer (such as your Downloads folder).
3. Open Mudlet. On the Menu Bar, click on `Package Manager`. 3. Open Mudlet. On the Menu Bar, click on `Package Manager`.