import com.swath.*; import com.swath.cmd.*; /** * This script will drain a sector of limpets. All you have to do is go into a sector * with more than one and run this script. It will pick up the limpets by logging you * in and out of the game. This way you pick up a limpet each time and you don't use * any turns :) * * Concept: DarkOne - CEO of -=< Nav Haz Unltd >=- * Date: 10 may 2001 * Updated: 20 June 2001 * Updated: 6 July 2001 * Updated again 23 Jun 2003 for TWA use by Severian * * Version: 2.1 */ public class LimpetClear extends UserDefinedScript { private Parameter m_cycles; private Parameter m_clear; private Parameter m_scrub; private Parameter m_movin; public String getName() { // Return the name of the script return "Clear Limpets"; } public boolean initScript() throws Exception { MessageBox.exec("This script was made for The Trade Warriors Alliance", "Clear Limpets", MessageBox.ICON_INFORMATION, MessageBox.TYPE_OK); MessageBox.exec("REMEMBER: If you select 'Clear Limpets' you will have to actually scrub manually. If moves you itself, but you have to scrub (as many players have animation and/or ANSI Preferences, this alters the port options at SD. Enter your logon info to the SWATH preferences.", "Clear Limpets", MessageBox.ICON_INFORMATION, MessageBox.TYPE_OK); // Check that we are at the correct prompt if (!atPrompt(Swath.COMMAND_PROMPT)) return false; // Define layout & values of User Interface m_cycles = new Parameter("Number of times to pick up:"); m_cycles.setType(Parameter.INTEGER); m_cycles.setInteger(2); m_clear = new Parameter("Clear off Limpets when done?"); m_clear.setType(Parameter.BOOLEAN); m_clear.setBoolean(false); m_scrub = new Parameter("where to move to for a scrub"); m_scrub.setType(Parameter.INTEGER); m_movin = new Parameter("Move to destination via: "); m_movin.setType(Parameter.CHOICE); m_movin.addChoice(0, "Move"); m_movin.addChoice(1, "Transwarp"); m_movin.setCurrentChoice(1); //Register Paramters registerParam(m_cycles); registerParam(m_clear); registerParam(m_scrub); registerParam(m_movin); return true; } public boolean runScript() throws Exception { // Counter to keep track of number of cycles completed int counter = 1; //Tell Corpies What Is Going On SendSSRadioMessage.exec("<<< Clearing a sector of limpets, coms are OFF! >>>"); SendString.exec("c"); WaitForPrompt.exec(Swath.COMPUTER_PROMPT); ChangePersonalSettings.exec(Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.YES); LeaveComputer.exec(); //Start script while (counter <= m_cycles.getInteger()){ //ReEnter game after entering password and game info in SWATH ReEnterTW.exec(); if(counter == m_cycles.getInteger()){ if (m_clear.getBoolean() == true){ // Move to destination sector if(m_movin.getCurrentChoice() == 1) { TransWarp.exec(m_scrub.getInteger()); SendString.exec("c"); WaitForPrompt.exec(Swath.COMPUTER_PROMPT); ChangePersonalSettings.exec(Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO); LeaveComputer.exec(); SendSSRadioMessage.exec("<<>>"); } else { SendString.exec("c"); WaitForPrompt.exec(Swath.COMPUTER_PROMPT); ChangePersonalSettings.exec(Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO_CHANGE, Swath.NO); LeaveComputer.exec(); Move.exec(m_scrub.getInteger()); SendSSRadioMessage.exec("<<>>"); } } } counter++; } return true; } public void endScript(boolean finished) { // Do some clean up here if necessary. // Remember: In Java you don't need to free any memory // since all memory is garbage collected when not used. } }