public final class Swath
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALERT_ERROR
User error alert.
|
static int |
ALERT_INFORMATION
User information alert.
|
static int |
ALERT_WARNING
User warning alert.
|
static int |
ALL_PROMPTS
All prompts.
|
static int |
ALLIED
The trader/corp is allied with you.
|
static int |
CARGO_HOLDS
The index and identifier used for Cargo holds.
|
static int |
CITADEL_PROMPT
The planet citadel prompt.
|
static int |
COLONISTS
The index and identifier used for Colonists.
|
static int |
COLOR_BLACK
Color black.
|
static int |
COLOR_BLUE
Color blue.
|
static int |
COLOR_CYAN
Color cyan.
|
static int |
COLOR_GREEN
Color green.
|
static int |
COLOR_MAGENTA
Color magenta.
|
static int |
COLOR_RED
Color red.
|
static int |
COLOR_WHITE
Color white.
|
static int |
COLOR_YELLOW
Color yellow.
|
static int |
COMMAND_PROMPT
The command prompt.
|
static int |
COMPUTER_PROMPT
The computer command prompt.
|
static int |
CORP_PROMPT
The corporate command prompt.
|
static int |
CORPORATE
The corporate owner type.
|
static int |
DEFENSIVE_FTRS
The defensive fighter type.
|
static int |
ENEMY
The trader/corp is an enemy of yours.
|
static int |
EQUIPMENT
The index and identifier used for Equipment.
|
static int |
FIGHTERS
The index and identifier used for Fighters.
|
static int |
FRIENDLY
The sector is friendly to you.
|
static int |
FUEL_ORE
The index and indentifier used for Fuel Ore.
|
static java.lang.String |
FUNC_ABORT_COMMAND |
static java.lang.String |
FUNC_ABORT_SCRIPT |
static java.lang.String |
FUNC_ABOUT_SWATH |
static java.lang.String |
FUNC_ADJACENT_SECTORS |
static java.lang.String |
FUNC_BUBBLE_FINDER |
static java.lang.String |
FUNC_BUST_LIST |
static java.lang.String |
FUNC_COM_WINDOW |
static java.lang.String |
FUNC_COMPILE_JAVA_CODE |
static java.lang.String |
FUNC_CONNECT |
static java.lang.String |
FUNC_COPY |
static java.lang.String |
FUNC_DISCONNECT |
static java.lang.String |
FUNC_EXIT |
static java.lang.String |
FUNC_EXPORT |
static java.lang.String |
FUNC_FIGHTER_LIST |
static java.lang.String |
FUNC_FIND |
static java.lang.String |
FUNC_FIND_NEAREST |
static java.lang.String |
FUNC_FIND_ROUTE |
static java.lang.String |
FUNC_GAME_INFO |
static java.lang.String |
FUNC_GAME_NOTES |
static java.lang.String |
FUNC_GAME_OPTIONS |
static java.lang.String |
FUNC_GAME_SETTINGS |
static java.lang.String |
FUNC_GENERATE_CRASH_REPORT |
static java.lang.String |
FUNC_HELP_TOPICS |
static java.lang.String |
FUNC_HELPER_MODE |
static java.lang.String |
FUNC_IMPORT |
static java.lang.String |
FUNC_INFO_BAR |
static java.lang.String |
FUNC_JAWS_MODE |
static java.lang.String |
FUNC_LICENSE_STATUS |
static java.lang.String |
FUNC_MACRO_LIST |
static java.lang.String |
FUNC_MINE_LIST |
static java.lang.String |
FUNC_NEW |
static java.lang.String |
FUNC_OPEN |
static java.lang.String |
FUNC_PARSE_INCOMING_TEXT |
static java.lang.String |
FUNC_PASTE |
static java.lang.String |
FUNC_PLANET_LIST |
static java.lang.String |
FUNC_PLAY_QUICK_MACRO |
static java.lang.String |
FUNC_PORT_FINDER |
static java.lang.String |
FUNC_PREFERENCES |
static java.lang.String |
FUNC_PROXY_MODE |
static java.lang.String |
FUNC_RECORD_QUICK_MACRO |
static java.lang.String |
FUNC_REGISTRATION_TOOL |
static java.lang.String |
FUNC_RELOAD_ALL_SCRIPTS |
static java.lang.String |
FUNC_RESET |
static java.lang.String |
FUNC_RUNNING_SCRIPT_HELP |
static java.lang.String |
FUNC_SAVE |
static java.lang.String |
FUNC_SAVE_AS |
static java.lang.String |
FUNC_SCRIPT_DEBUG_MODE |
static java.lang.String |
FUNC_SECTOR_FINDER |
static java.lang.String |
FUNC_SECTOR_INFO |
static java.lang.String |
FUNC_SECTOR_NOTE |
static java.lang.String |
FUNC_SHIP_LIST |
static java.lang.String |
FUNC_STATUS_BAR |
static java.lang.String |
FUNC_SUPPRESS_TEXT_OUTPUT |
static java.lang.String |
FUNC_SWATH_FAQ |
static java.lang.String |
FUNC_SWATH_FORUM |
static java.lang.String |
FUNC_SWATH_HOMEPAGE |
static java.lang.String |
FUNC_TIME_INDEX_LOG_MODE |
static java.lang.String |
FUNC_TRADERS_AND_CORPS |
static java.lang.String |
FUNC_TRIGGER_LIST |
static java.lang.String |
FUNC_TWXSYNC_DEBUG_MODE |
static java.lang.String |
FUNC_VISUAL_MAP |
static int |
HOSTILE
The sector is hostile to you.
|
static int |
ID_ALIEN
This is the trader id for 'Alien'.
|
static int |
ID_FEDERAL
This is the trader id for 'Federation'.
|
static int |
ID_FERRENGI
This is the trader id for 'Ferrengi'.
|
static int |
ID_NOBODY
This is the trader id for 'Nobody'.
|
static int |
ID_UNKNOWN
This is the trader id for 'Unknown'.
|
static int |
ID_YOU
This is your trader id.
|
static MainInfo |
main
Get main game and SWATH information here.
|
static int |
MERCHENARY_FTRS
The merchenary fighter type.
|
static int |
N_A
Indicates 'N/A'.
|
static int |
NEUTRAL
The trader/corp/sector is neutral to you.
|
static int |
NO
Indicates 'No'.
|
static int |
NO_CHANGE
Indicates 'No change'.
|
static int |
NO_PROMPT
No prompt.
|
static int |
OFF
Indicates 'Off'.
|
static int |
OFFENSIVE_FTRS
The offensive fighter type.
|
static int |
ON
Indicates 'On'.
|
static int |
ORGANICS
The index and identifier used for Organics.
|
static int |
PERSONAL
The personal owner type.
|
static int |
PLANET_PROMPT
The planet prompt.
|
static Sector |
sector
Get the current sector information here.
|
static int |
SHIELDS
The index and identifier used for Shields.
|
static Ship |
ship
Get your current ship information here.
|
static int |
STARDOCK_PROMPT
The StarDock prompt.
|
static int |
TOLL_FTRS
The toll fighter type.
|
static int |
UNKNOWN
Indicates 'Unknown'.
|
static int |
WITH_YOU
The trader/corp is playing together with you.
|
static int |
YES
Indicates 'Yes'.
|
static Trader |
you
Get your own trader information here.
|
Modifier and Type | Method and Description |
---|---|
static void |
clearConsole()
Clear the SWATH console window.
|
static void |
clearErrorMsg()
Clears the current error message.
|
static void |
clearUserDisplayValue(int index)
Clears the user display value on the given row.
|
static void |
delUserVariable(java.lang.String name,
boolean global)
Deletes a user variable.
|
static java.lang.Object |
execCommand(CommandIfc cmd)
Executes a command.
Used by SWATH only! |
static boolean |
execSwathFunction(java.lang.String function)
Executes a SWATH menu function.
|
static Corporation[] |
getAllCorporations()
Gets an array with all corporations.
|
static PlanetClass[] |
getAllPlanetClasses()
Gets an array with all planet classes.
|
static Planet[] |
getAllPlanets()
Gets an array with all planets.
|
static ShipCategory[] |
getAllShipCategories()
Gets an array with all ship categories.
|
static Ship[] |
getAllShips()
Gets an array with all ships.
|
static Trader[] |
getAllTraders()
Gets an array with all traders.
|
static Bubble[] |
getBubbles(int type)
Gets all bubbles of a specific type.
|
static java.lang.String |
getCommandName()
Gets the name of the running command.
|
static Corporation |
getCorporation(int corp)
Gets a corporation.
|
static Sector[] |
getExploredSectors()
Gets an array of all explored sectors.
|
static Planet |
getPlanet(int planet)
Gets a planet.
|
static PlanetClass |
getPlanetClass(java.lang.String name)
Gets a planet class.
|
static java.lang.String |
getScriptName()
Gets the name of the running script.
|
static Sector |
getSector(int sector)
Gets a sector.
|
static Sector[] |
getSectors(int[] sectorNumbers)
Gets an array of sectors.
|
static Ship |
getShip(int ship)
Gets a ship.
|
static ShipCategory |
getShipCategory(java.lang.String type)
Gets a ship category.
|
static Trader |
getTrader(java.lang.String name)
Gets a trader.
|
static Sector[] |
getUnexploredSectors()
Gets an array of all unexplored sectors.
|
static UserVariable |
getUserVariable(java.lang.String name,
boolean global)
Gets a user variable.
|
static Sector[] |
getVisitedSectors()
Gets an array of all visited sectors.
|
static void |
postEvent(UserDefinedEvent event)
This method posts an event in the SWATH event queue.
|
static void |
printTrace(java.lang.Exception e)
Print an exception and the complete stack trace
in the SWATH console window.
|
static void |
printTrace(java.lang.String text)
Print trace text in the SWATH console window.
|
static void |
setErrorMsg(java.lang.String message)
Sets the current error message.
|
static void |
setErrorMsg(java.lang.Throwable t)
Sets the current error message.
|
static void |
setUserDisplayValue(int index,
java.lang.String text,
int value,
int color)
Sets the user display value on the given row.
|
static void |
setUserVariable(java.lang.String name,
UserVariable var,
boolean global)
Sets a user variable.
|
static void |
userAlert(java.lang.String text,
int type)
Display a user alert window to the user and
print the text in the SWATH console window.
|
public static final int NO_PROMPT
public static final int COMMAND_PROMPT
public static final int COMPUTER_PROMPT
public static final int PLANET_PROMPT
public static final int CITADEL_PROMPT
public static final int CORP_PROMPT
public static final int STARDOCK_PROMPT
public static final int ALL_PROMPTS
public static final int FUEL_ORE
public static final int ORGANICS
public static final int EQUIPMENT
public static final int COLONISTS
public static final int FIGHTERS
public static final int SHIELDS
public static final int CARGO_HOLDS
public static final int PERSONAL
public static final int CORPORATE
public static final int TOLL_FTRS
public static final int DEFENSIVE_FTRS
public static final int OFFENSIVE_FTRS
public static final int MERCHENARY_FTRS
public static final int ID_YOU
public static final int ID_NOBODY
public static final int ID_UNKNOWN
public static final int ID_FEDERAL
public static final int ID_FERRENGI
public static final int ID_ALIEN
public static final int WITH_YOU
public static final int ALLIED
public static final int NEUTRAL
public static final int ENEMY
public static final int FRIENDLY
public static final int HOSTILE
public static final int YES
public static final int NO
public static final int ON
public static final int OFF
public static final int N_A
public static final int UNKNOWN
public static final int NO_CHANGE
public static final int ALERT_INFORMATION
public static final int ALERT_WARNING
public static final int ALERT_ERROR
public static final int COLOR_BLACK
public static final int COLOR_RED
public static final int COLOR_GREEN
public static final int COLOR_YELLOW
public static final int COLOR_BLUE
public static final int COLOR_MAGENTA
public static final int COLOR_CYAN
public static final int COLOR_WHITE
public static final java.lang.String FUNC_NEW
public static final java.lang.String FUNC_OPEN
public static final java.lang.String FUNC_SAVE
public static final java.lang.String FUNC_SAVE_AS
public static final java.lang.String FUNC_CONNECT
public static final java.lang.String FUNC_DISCONNECT
public static final java.lang.String FUNC_RESET
public static final java.lang.String FUNC_IMPORT
public static final java.lang.String FUNC_EXPORT
public static final java.lang.String FUNC_EXIT
public static final java.lang.String FUNC_COPY
public static final java.lang.String FUNC_PASTE
public static final java.lang.String FUNC_FIND
public static final java.lang.String FUNC_PREFERENCES
public static final java.lang.String FUNC_GAME_OPTIONS
public static final java.lang.String FUNC_TRIGGER_LIST
public static final java.lang.String FUNC_HELPER_MODE
public static final java.lang.String FUNC_PROXY_MODE
public static final java.lang.String FUNC_PARSE_INCOMING_TEXT
public static final java.lang.String FUNC_SUPPRESS_TEXT_OUTPUT
public static final java.lang.String FUNC_INFO_BAR
public static final java.lang.String FUNC_STATUS_BAR
public static final java.lang.String FUNC_COM_WINDOW
public static final java.lang.String FUNC_VISUAL_MAP
public static final java.lang.String FUNC_GAME_INFO
public static final java.lang.String FUNC_GAME_SETTINGS
public static final java.lang.String FUNC_TRADERS_AND_CORPS
public static final java.lang.String FUNC_SHIP_LIST
public static final java.lang.String FUNC_PLANET_LIST
public static final java.lang.String FUNC_FIGHTER_LIST
public static final java.lang.String FUNC_MINE_LIST
public static final java.lang.String FUNC_BUST_LIST
public static final java.lang.String FUNC_ABORT_SCRIPT
public static final java.lang.String FUNC_RELOAD_ALL_SCRIPTS
public static final java.lang.String FUNC_COMPILE_JAVA_CODE
public static final java.lang.String FUNC_ABORT_COMMAND
public static final java.lang.String FUNC_MACRO_LIST
public static final java.lang.String FUNC_RECORD_QUICK_MACRO
public static final java.lang.String FUNC_PLAY_QUICK_MACRO
public static final java.lang.String FUNC_FIND_NEAREST
public static final java.lang.String FUNC_FIND_ROUTE
public static final java.lang.String FUNC_SECTOR_INFO
public static final java.lang.String FUNC_ADJACENT_SECTORS
public static final java.lang.String FUNC_SECTOR_FINDER
public static final java.lang.String FUNC_PORT_FINDER
public static final java.lang.String FUNC_BUBBLE_FINDER
public static final java.lang.String FUNC_GAME_NOTES
public static final java.lang.String FUNC_SECTOR_NOTE
public static final java.lang.String FUNC_SCRIPT_DEBUG_MODE
public static final java.lang.String FUNC_TWXSYNC_DEBUG_MODE
public static final java.lang.String FUNC_TIME_INDEX_LOG_MODE
public static final java.lang.String FUNC_GENERATE_CRASH_REPORT
public static final java.lang.String FUNC_HELP_TOPICS
public static final java.lang.String FUNC_RUNNING_SCRIPT_HELP
public static final java.lang.String FUNC_SWATH_HOMEPAGE
public static final java.lang.String FUNC_SWATH_FORUM
public static final java.lang.String FUNC_SWATH_FAQ
public static final java.lang.String FUNC_LICENSE_STATUS
public static final java.lang.String FUNC_REGISTRATION_TOOL
public static final java.lang.String FUNC_JAWS_MODE
public static final java.lang.String FUNC_ABOUT_SWATH
public static MainInfo main
public static Trader you
public static Ship ship
public static Sector sector
public static void setErrorMsg(java.lang.String message)
message
- An error message.public static void setErrorMsg(java.lang.Throwable t)
t
- A throwable/exception.public static void clearErrorMsg()
public static void printTrace(java.lang.String text)
text
- The text to print.public static void printTrace(java.lang.Exception e)
e
- The exception to print.public static void clearConsole()
public static void userAlert(java.lang.String text, int type)
text
- The text to display in the alert.type
- The type of user alert to display.ALERT_INFORMATION
,
ALERT_WARNING
,
ALERT_ERROR
public static boolean execSwathFunction(java.lang.String function) throws java.lang.Exception
function
- The function to execute (see constants).true
if successful, otherwise false
.java.lang.Exception
FUNC_NEW
,
FUNC_OPEN
,
FUNC_SAVE
,
FUNC_SAVE_AS
,
FUNC_CONNECT
,
FUNC_DISCONNECT
,
FUNC_RESET
,
FUNC_IMPORT
,
FUNC_EXPORT
,
FUNC_EXIT
,
FUNC_COPY
,
FUNC_PASTE
,
FUNC_FIND
,
FUNC_PREFERENCES
,
FUNC_GAME_OPTIONS
,
FUNC_TRIGGER_LIST
,
FUNC_HELPER_MODE
,
FUNC_PROXY_MODE
,
FUNC_PARSE_INCOMING_TEXT
,
FUNC_SUPPRESS_TEXT_OUTPUT
,
FUNC_INFO_BAR
,
FUNC_STATUS_BAR
,
FUNC_COM_WINDOW
,
FUNC_VISUAL_MAP
,
FUNC_GAME_INFO
,
FUNC_GAME_SETTINGS
,
FUNC_TRADERS_AND_CORPS
,
FUNC_SHIP_LIST
,
FUNC_PLANET_LIST
,
FUNC_FIGHTER_LIST
,
FUNC_MINE_LIST
,
FUNC_BUST_LIST
,
FUNC_ABORT_SCRIPT
,
FUNC_RELOAD_ALL_SCRIPTS
,
FUNC_COMPILE_JAVA_CODE
,
FUNC_ABORT_COMMAND
,
FUNC_MACRO_LIST
,
FUNC_RECORD_QUICK_MACRO
,
FUNC_PLAY_QUICK_MACRO
,
FUNC_FIND_NEAREST
,
FUNC_FIND_ROUTE
,
FUNC_SECTOR_INFO
,
FUNC_ADJACENT_SECTORS
,
FUNC_SECTOR_FINDER
,
FUNC_PORT_FINDER
,
FUNC_BUBBLE_FINDER
,
FUNC_GAME_NOTES
,
FUNC_SECTOR_NOTE
,
FUNC_SCRIPT_DEBUG_MODE
,
FUNC_TWXSYNC_DEBUG_MODE
,
FUNC_TIME_INDEX_LOG_MODE
,
FUNC_GENERATE_CRASH_REPORT
,
FUNC_HELP_TOPICS
,
FUNC_RUNNING_SCRIPT_HELP
,
FUNC_SWATH_HOMEPAGE
,
FUNC_SWATH_FORUM
,
FUNC_SWATH_FAQ
,
FUNC_LICENSE_STATUS
,
FUNC_REGISTRATION_TOOL
,
FUNC_JAWS_MODE
,
FUNC_ABOUT_SWATH
public static UserVariable getUserVariable(java.lang.String name, boolean global) throws java.lang.Exception
name
- The name of the user variable.global
- true
to get the global variable
or false
to first look for the local game variable.null
if not found.java.lang.Exception
setUserVariable(java.lang.String, com.swath.UserVariable, boolean)
,
delUserVariable(java.lang.String, boolean)
,
UserVariable
public static void setUserVariable(java.lang.String name, UserVariable var, boolean global) throws java.lang.Exception
name
- The name of the user variable.var
- The user variable to set.global
- true
to set the variable on a global level
or false
to set it locally for the current game.java.lang.Exception
getUserVariable(java.lang.String, boolean)
,
delUserVariable(java.lang.String, boolean)
,
UserVariable
public static void delUserVariable(java.lang.String name, boolean global) throws java.lang.Exception
name
- The name of the user variable.global
- true
to delete the variable on all levels
or false
to only delete the local game variable.java.lang.Exception
getUserVariable(java.lang.String, boolean)
,
setUserVariable(java.lang.String, com.swath.UserVariable, boolean)
,
UserVariable
public static void setUserDisplayValue(int index, java.lang.String text, int value, int color) throws java.lang.Exception
index
- The row index starting from zero.text
- The text to display. If it is too long, it will be cropped.value
- The value to display.color
- The color for the value (see color constants).java.lang.Exception
clearUserDisplayValue(int)
,
COLOR_RED
,
COLOR_GREEN
,
COLOR_YELLOW
,
COLOR_BLUE
,
COLOR_MAGENTA
,
COLOR_CYAN
,
COLOR_WHITE
public static void clearUserDisplayValue(int index) throws java.lang.Exception
index
- The row index starting from zero.java.lang.Exception
setUserDisplayValue(int, java.lang.String, int, int)
public static Sector getSector(int sector) throws java.lang.IllegalArgumentException, java.lang.Exception
sector
- The sector number.java.lang.IllegalArgumentException
java.lang.Exception
public static Sector[] getSectors(int[] sectorNumbers) throws java.lang.IllegalArgumentException, java.lang.Exception
sectorNumbers
- The sector number array.java.lang.IllegalArgumentException
java.lang.Exception
public static Sector[] getVisitedSectors() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static Sector[] getExploredSectors() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static Sector[] getUnexploredSectors() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static Trader getTrader(java.lang.String name) throws java.lang.IllegalArgumentException, java.lang.Exception
name
- The trader name.java.lang.IllegalArgumentException
java.lang.Exception
public static Trader[] getAllTraders() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static Ship getShip(int ship) throws java.lang.IllegalArgumentException, java.lang.Exception
ship
- The ship id.java.lang.IllegalArgumentException
java.lang.Exception
public static Ship[] getAllShips() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static ShipCategory getShipCategory(java.lang.String type) throws java.lang.IllegalArgumentException, java.lang.Exception
type
- The ship type.java.lang.IllegalArgumentException
java.lang.Exception
public static ShipCategory[] getAllShipCategories() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static Planet getPlanet(int planet) throws java.lang.IllegalArgumentException, java.lang.Exception
planet
- The planet id.java.lang.IllegalArgumentException
java.lang.Exception
public static Planet[] getAllPlanets() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static PlanetClass getPlanetClass(java.lang.String name) throws java.lang.IllegalArgumentException, java.lang.Exception
name
- The planet class name.java.lang.IllegalArgumentException
java.lang.Exception
public static PlanetClass[] getAllPlanetClasses() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static Corporation getCorporation(int corp) throws java.lang.IllegalArgumentException, java.lang.Exception
corp
- The corporation id.java.lang.IllegalArgumentException
java.lang.Exception
public static Corporation[] getAllCorporations() throws java.lang.IllegalArgumentException, java.lang.Exception
java.lang.IllegalArgumentException
java.lang.Exception
public static Bubble[] getBubbles(int type) throws java.lang.IllegalArgumentException, java.lang.Exception
type
- The type of bubbles to get.java.lang.IllegalArgumentException
java.lang.Exception
Bubble.TYPE_NORMAL
,
Bubble.TYPE_DEAD_END
,
Bubble.TYPE_BLACK_HOLE
public static void postEvent(UserDefinedEvent event)
event
- The event to post.public static java.lang.String getScriptName()
getCommandName()
public static java.lang.Object execCommand(CommandIfc cmd) throws CommandException, java.lang.Exception
cmd
- The command.CommandException
- If the command fails.java.lang.Exception
public static java.lang.String getCommandName()
getScriptName()