mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +00:00
Update LoadCannon.java
This commit is contained in:
@@ -7,11 +7,8 @@ import org.rev317.min.api.methods.Game;
|
|||||||
import org.rev317.min.api.methods.Inventory;
|
import org.rev317.min.api.methods.Inventory;
|
||||||
import org.rev317.min.api.methods.Items;
|
import org.rev317.min.api.methods.Items;
|
||||||
import org.rev317.min.api.methods.SceneObjects;
|
import org.rev317.min.api.methods.SceneObjects;
|
||||||
import org.rev317.min.api.wrappers.Item;
|
|
||||||
import org.rev317.min.api.wrappers.SceneObject;
|
import org.rev317.min.api.wrappers.SceneObject;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class LoadCannon implements Strategy {
|
public class LoadCannon implements Strategy {
|
||||||
private SceneObject cannon;
|
private SceneObject cannon;
|
||||||
private long nextFill = System.currentTimeMillis() + 20000;
|
private long nextFill = System.currentTimeMillis() + 20000;
|
||||||
@@ -23,6 +20,7 @@ public class LoadCannon implements Strategy {
|
|||||||
if (Variables.running
|
if (Variables.running
|
||||||
&& Variables.load_cannon
|
&& Variables.load_cannon
|
||||||
&& cannon != null
|
&& cannon != null
|
||||||
|
&& hasCannonBalls()
|
||||||
&& nextFill <= System.currentTimeMillis()
|
&& nextFill <= System.currentTimeMillis()
|
||||||
) {
|
) {
|
||||||
Variables.setStatus("filling cannon");
|
Variables.setStatus("filling cannon");
|
||||||
@@ -48,4 +46,9 @@ public class LoadCannon implements Strategy {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasCannonBalls(){
|
||||||
|
// Make sure we have cannon balls
|
||||||
|
return Inventory.getItem(2 + 1) != null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user