import com.swath.*; import com.swath.cmd.*; /** * Map surrounding of Sector. * * @author rem0te */ public class SectorMap extends UserDefinedScript { private Parameter m_sector; public String getName() { // Return the name of the script return "Map surrounding of Sector"; } public boolean initScript() throws Exception { // Initialisation of the script is done in this method. // All parameters should be created and registered here. // If something goes wrong, return false. // Check that we are at the correct prompt if (!atPrompt(Swath.COMMAND_PROMPT)) return false; // Create the parameter 'sector' and set the value to // the current sector. // The type will be set to INTEGER by setInteger(). m_sector = new Parameter("Show sector"); m_sector.setInteger(Swath.main.currSector()); registerParam(m_sector); return true; } public boolean runScript() throws Exception { Sector root,tmp; int sector; int[] warps,tmpw; int i,l; sector = m_sector.getInteger(); root = Swath.getSector(sector); warps = root.warpSectors(); SetTextMode.exec(SetTextMode.COLOR_WHITE, SetTextMode.COLOR_BLACK, SetTextMode.MODE_HIGHLIGHT); PrintText.exec("\n\n"+sector+" "); SetTextMode.exec(SetTextMode.COLOR_WHITE, SetTextMode.COLOR_BLACK, SetTextMode.MODE_NORMAL); PrintText.exec("--> "); for(i=0;i "); } else { SetTextMode.exec(SetTextMode.COLOR_BLACK, SetTextMode.COLOR_BLACK, SetTextMode.MODE_NORMAL); PrintText.exec(sector+" "); SetTextMode.exec(SetTextMode.COLOR_WHITE, SetTextMode.COLOR_BLACK, SetTextMode.MODE_NORMAL); PrintText.exec("|-> "); SetTextMode.exec(SetTextMode.COLOR_WHITE, SetTextMode.COLOR_BLACK, SetTextMode.MODE_HIGHLIGHT); PrintText.exec(warps[i]+" "); SetTextMode.exec(SetTextMode.COLOR_WHITE, SetTextMode.COLOR_BLACK, SetTextMode.MODE_NORMAL); PrintText.exec("--> "); } for(l=0;l "); SetTextMode.exec(SetTextMode.COLOR_WHITE, SetTextMode.COLOR_BLACK, SetTextMode.MODE_HIGHLIGHT); PrintText.exec(tmpw[l]+"\n"); } } SetTextMode.exec(SetTextMode.COLOR_BLACK, SetTextMode.COLOR_BLACK, SetTextMode.MODE_NORMAL); PrintText.exec(sector+" "); if(i