-
Notifications
You must be signed in to change notification settings - Fork 0
/
FastSDPhoton.java
executable file
·54 lines (45 loc) · 1.36 KB
/
FastSDPhoton.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import com.swath.*;
/**
Author MD
*/
public class FastSDPhoton extends UserDefinedCommand {
private int target;
public String getName() {
// Return the name of the command
return "Fast SD Photon";
}
public boolean initCommand() throws Exception {
// if(!atPrompt(Swath.STARDOCK_PROMPT)){
// throw new Exception("Must be at Stardock Prompt.");
// }
if(Swath.ship.photonMissiles() <= 0){
throw new Exception("Must have at least 1 Photon Missle.");
}
return true;
}
public void startCommand() throws Exception {
sendString("qcpy"+target+RETURN_KEY+"q"+RETURN_KEY);
}
public void endCommand(boolean finished) throws Exception {
}
public void onText(String buffer, String text) throws Exception {
}
public void onEvent(EventIfc event) throws Exception {
// // Here you can receive and process incoming events
// printTrace("onEvent('" + event.getClassName() + "')");
}
public static void exec(int sector) throws Exception {
//Gets fuel from port in sector
FastSDPhoton cmd = new FastSDPhoton();
cmd.initInstance();
cmd.target = sector;
cmd.execInstance();
}
public static void exec(Sector sector) throws Exception {
//Gets fuel from planet in sector
FastSDPhoton cmd = new FastSDPhoton();
cmd.initInstance();
cmd.target = sector.sector();
cmd.execInstance();
}
}