|
WritingStrategies
Guide to writing your own strategies
CodingStrategies are written in Java code, compiled using Janino and are then called by the simulator. Janino supports Java code up to 1.4. Your strategy must implement the public Action getAction() method, for example: /*
* 1. Savage Roar at 4 Combo Points
* 2. Rip at 5 Combo Points
* 3. Ferocious Bite at 5 Combo Points
*
* This strategy was proposed by Nightcrowler
* who found it the effective with his
* simulator, with full Tier 7 gear and full
* raid buffs. Note that this strategy is
* unlikely to yield good results with less
* than the required level of gear and buffs.
*/
int cycle = 1;
boolean finish = false;
public Action getAction() {
// Determine if previous action was successful
if (finish) {
finish = false;
if (status.getComboPoints() == 0)
cycle ++;
}
if (cycle > 3)
cycle = 1;
// Tiger's Fury whenever it has cooled down
if (status.getFuryCooldown() == 0) {
return Action.FURY;
}
switch (cycle) {
// Savage Roar at 4
case 1:
if (status.getComboPoints() >= 4) {
if (status.getEnergy() >= 25) {
finish = true;
return Action.ROAR;
}
else
return Action.NONE;
}
break;
// Rip at 5
case 2:
if (status.getComboPoints() >= 5) {
if (status.getEnergy() >= 30) {
finish = true;
return Action.RIP;
}
else
return Action.NONE;
}
break;
// Bite at 5
case 3:
if (status.getComboPoints() >= 5) {
if (status.getEnergy() >= 35) {
finish = true;
return Action.BITE;
}
else
return Action.NONE;
}
}
// Get some CPs. Always keep Rake up
if (status.getRakeTimer() == 0) {
if ((status.getEnergy() >= status.getRakeCost()) || status.isOocUp())
return Action.RAKE;
else
return Action.NONE;
}
// Mangle needs to be up all the time too
if (!status.isMangleUp()) {
if ((status.getEnergy() >= status.getMangleCost()) || status.isOocUp())
return Action.MANGLE;
else
return Action.NONE;
}
// Then finally, shred
if ((status.getEnergy() >= 90) || status.isOocUp()) {
return Action.SHRED;
}
return Action.NONE;
}The getAction() method is called by the simulator every 0.1 seconds of simulated time. A status object is provided to you to query the simulator state to make your decisions. Decisions are made by returning an Action type from the method. Variables declared inside the getAction() method do not persist between getAction() calls. If you wish to store states that persists between getAction() calls, declare the variables outside the getAction() method ActionsThese are the actions that may be returned by the getAction() method.
Status APIThe status object provides the following methods to query the simulator state: Note: 1 decisecond = 0.1 seconds
|
Sign in to add a comment