Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="iso-8859-1" ?>
- <!DOCTYPE muclient>
- <muclient>
- <plugin name="LotJupgradeship" author="@Cronlan" id="0b90ce53347f37f34ff36fcd" language="Lua" purpose="Automatic Upgrading" save_state="y" requires="4.40" version="1.72">
- <description trim="y">
- <![CDATA[ Upgradeship queue
- ]]>
- </description>
- </plugin>
- <!-- Get our standard constants -->
- <include name="constants.lua" />
- <!-- Triggers -->
- <triggers>
- <trigger name="DismantComplete" script="dismantNext" match="You earn (.*) credits after selling the parts." enabled="y" group="UpgradeSh" regexp="y" sequence="100" />
- <trigger name="UpgradeDone" script="upgradeNext" match="You pay (.*) credits to complete the modification." enabled="y" group="UpgradeSh" regexp="y" sequence="100" />
- </triggers>
- <!-- Aliases -->
- <aliases>
- <alias name="DqueAdd" script="addItemD" match="^dqadd (.*)$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="UqueAdd" script="addItemU" match="^uqadd (.*)$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="begin" script="dismantstart" match="^dismantstart$" enabled="y" group="UpgradeshCMD" regexp="y" ignore_case="y" sequence="100" />
- <alias name="removedis" script="removeItemD" match="^remdq (.*)$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="removeupg" script="removeItemU" match="^remuq (.*)$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="ListCommands" script="displayList" match="^ListCommands$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="ClearList" script="clearList" match="^clearUQ$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="AddShip" script="addShip" match="^addShip (.*)$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="resumeD" script="resumeD" match="^resumeD$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="resumeU" script="resumeU" match="^resumeU$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="nextD" script="nextD" match="^nextD$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- <alias name="nextU" script="nextU" match="^nextU$" enabled="y" group="UpgradeshCmd" regexp="y" ignore_case="y" sequence="100" />
- </aliases>
- <!-- Script -->
- <script>
- <![CDATA[
- require "pairsbykeys"
- currentShip = 1
- ShipList = {}
- DismantList = {}
- UpgradeList = {}
- currentPos = 1
- currentItem = ""
- function displayList(name, line, args)
- Note("DismantStart - Begin taking apart the ship! Starts upgrading when done/empty")
- Note("uqadd <Component> <Number> - Add to the list for upgradeship")
- Note("dqadd <Component> <Number> - Add to the list for Dismantle")
- Note("remuq <Component> <Number> - Remove from list")
- Note("addship <shipname> -Add ship to list")
- note("remship <shipname> -Remove Ship from list")
- Note("ListCommands - Display this page")
- Note("ClearUQ - Clear list and start over")
- Note("resumeD -Begins where you left off if interrupted whilte using Dismantle")
- Note("resumeU -Begins where you left off if interrupted while using Upgradeship")
- end
- function nextU(name, line, args)
- currentPos = currentPos + 1
- resumeU()
- end
- function nextD(name, line, args)
- currentPos = currentPos + 1
- resumeD()
- end
- function resumeD(name, line, args)
- Send("dismant " .. ShipList[currentShip] .. " " .. DismantList[currentPos])
- end
- function resumeU(name, line, args)
- Send("upgradeship " .. ShipList[currentShip] .. " " .. UpgradeList[currentPos])
- end
- function addShip(name, line, args)
- ShipList[#ShipList + 1] = args[1]
- Note("'" .. ShipList[#ShipList] .. "' added to ship list.")
- end
- function nextShip(name, line, args)
- currentShip = currentShip + 1
- if (currentShip > #ShipList) then
- Note("No more ships in the queue! Lists cleared.")
- clearList()
- else
- currentPos = 0
- dismantstart()
- end
- end
- function dismantstart(name, line, args)
- currentItem = ""
- if (#DismantList > 0) then
- currentPos = 0
- dismantNext()
- else
- Note("Nothing to remove, moving to upgrades!")
- upgradestart()
- end
- end
- function upgradestart(name, line, args)
- currentItem = ""
- if (#UpgradeList > 0) then
- currentPos = 0
- upgradeNext()
- else
- Note("Upgrades are complete! Moving to next ship.")
- nextShip()
- end
- end
- function dismantNext(name, line, args)
- currentPos = currentPos + 1
- if (currentPos > #DismantList) then
- Note("Dismantle Done. Starting Upgrades.")
- upgradestart()
- else
- Send("dismant " .. ShipList[currentShip] .." " .. DismantList[currentPos])
- end
- end
- function upgradeNext(name, line, args)
- currentPos = currentPos + 1
- if (currentPos > #UpgradeList) then
- Note("Upgrades Complete. Moving to next Ship.")
- nextShip()
- else
- Send("upgradesh " .. ShipList[currentShip] .." " .. UpgradeList[currentPos])
- end
- end
- function addItemD(name, line, args)
- DismantList[#DismantList + 1] = args[1]
- Note("'" .. DismantList[#DismantList] .. "' added to Dismantle queue.")
- end
- function removeItemD(name, line, args)
- t = #DismantList
- for i, v in ipairs(DismantList) do
- if ((v == args[1]) or (i == tonumber(args[1]))) then
- Note("Removed '" .. DismantList[i] .. "' index(" .. i .. ") from Dismantle queue.")
- table.remove(DismantList, i)
- if (currentPos > i) then
- currentPos = currentPos - 1
- end
- break
- else
- if (t == i) then
- Note("Unable to find specified item.")
- end
- end
- end
- end
- function addItemU(name, line, args)
- UpgradeList[#UpgradeList + 1] = args[1]
- Note("'" .. UpgradeList[#UpgradeList] .. "' added to Upgrade queue.")
- end
- function removeItemU(name, line, args)
- t = #UpgradeList
- for i, v in ipairs(UpgradeList) do
- if ((v == args[1]) or (i == tonumber(args[1]))) then
- Note("Removed '" .. DismantList[i] .. "' index(" .. i .. ") from Dismantle queue.")
- table.remove(DismantList, i)
- if (currentPos > i) then
- currentPos = currentPos - 1
- end
- break
- else
- if (t == i) then
- Note("Unable to find specified item.")
- end
- end
- end
- end
- function clearList()
- currentItem = ""
- DismantList = {}
- UpgradeList = {}
- ShipList = {}
- Note("Ship, Upgrade and Dismantle lists cleared.")
- currentPos = 0
- end
- ]]>
- </script>
- <script>
- <![CDATA[ function OnHelp ()
- world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
- end
- ]]>
- </script>
- </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement