Added within Tiles to If

This commit is contained in:
dginovker
2019-10-07 00:38:45 -04:00
parent 55cbcd9204
commit ef24f43104
70 changed files with 39 additions and 61 deletions
@@ -2,6 +2,7 @@ package scriptfactory.Actions.Logic;
import org.parabot.environment.api.utils.Filter;
import org.rev317.min.api.wrappers.GroundItem;
import org.rev317.min.api.wrappers.Tile;
import scriptfactory.Actions.Action;
import org.rev317.min.api.methods.*;
@@ -35,6 +36,8 @@ public class LogicHandler {
return Players.getMyPlayer().getHealth() < a.getParam(0);
case "In Combat":
return Players.getMyPlayer().isInCombat();
case "Within x Tiles of Coords":
return new Tile(a.getParam(1), a.getParam(2)).distanceTo() < a.getParam(0);
default:
log("Error: Unimplemented conditional: " + a.getAction());
}
@@ -0,0 +1,27 @@
package scriptfactory.AdvancedGui.ScriptFactorySDN.Scripts;
import org.parabot.environment.scripts.Category;
import scriptfactory.AdvancedGui.ScriptFactorySDN.ScriptFactoryScript;
public class ArdyCakes extends ScriptFactoryScript {
public ArdyCakes() {
super(
"ArdyCakes (with banking)",
"Maui",
Category.THIEVING,
1.0,
"Steals cakes in Ardy",
"If Inventory-slots-used(28)\n" +
"IfNot Entity-is-around(494)\n" +
"Walk-to(2655,3286,35000)\n" +
"Endif\n" +
"Interact-with-entity-by-ID(2213,2)\n" +
"Bank-all-except-IDs()\n" +
"Walk-to(2669,3310,35000)\n" +
"Endif\n" +
"IfNot Inventory-slots-used(28)\n" +
"Interact-with-entity-by-location(2667,3310)\n",
new String[]{}
);
}
}
@@ -33,7 +33,6 @@ public class Cowkiller extends ScriptFactoryScript {
public static class Walktocows extends ScriptFactoryScript
{
public Walktocows() {
super(
"Walktocows",
@@ -55,9 +54,9 @@ public class Cowkiller extends ScriptFactoryScript {
);
}
}
public static class Openlummybank extends ScriptFactoryScript
{
public Openlummybank() {
super(
"Openlummybank",
+1 -1
View File
@@ -20,7 +20,7 @@ import static scriptfactory.VarsMethods.log;
* Welcome to AIO AIO - ScriptFactory. Make your own scripts!
*/
@ScriptManifest(author = "Before", name = "Script Factory 1.6", category = Category.OTHER, version = 1.6, description = "Create your own scripts!", servers = "All")
@ScriptManifest(author = "Before", name = "Script Factory 1.7", category = Category.OTHER, version = 1.7, description = "Create your own scripts!", servers = "All")
public class Core extends Script implements Paintable {
private ArrayList<Action> actions = new ArrayList<>();
@@ -11,7 +11,7 @@ import java.util.ArrayList;
*/
public class ConditionGuiInfo extends NewStatementGUI {
public ConditionGuiInfo(ArrayList<Action> actionList, Consumer<Integer> updateTextfield) {
String[] actionTypes = new String[]{"Item is in Inventory", "Inventory slots used", "Item is on Ground", "Entity is around", "Hitpoints is below", "In Combat"};
String[] actionTypes = new String[]{"Item is in Inventory", "Inventory slots used", "Item is on Ground", "Entity is around", "Hitpoints is below", "In Combat", "Within x Tiles of Coords"};
Descriptions[] setDescs = {
new Descriptions("Item to detect (eg. 4296 = bones)", "Number of them to detect (blank = 1)"),
new Descriptions("Inventory slots greater than or equal to (eg. \"28\" detects a full inventory)"),
@@ -19,6 +19,7 @@ public class ConditionGuiInfo extends NewStatementGUI {
new Descriptions("Entity to detect (eg. \"81,397,1767,1768\" detects cows)"),
new Descriptions("Below health # (eg. 10)"),
new Descriptions(),
new Descriptions("Tiles to be within (i.e. 6)", "x Coordinate", "y Coordinate"),
};
initGui("Add new condition", actionList, updateTextfield, actionTypes, setDescs);
@@ -56,7 +56,7 @@ public class ActionExecutor {
executeLine(line);
} catch (NumberFormatException notFilledIn) {
log("Error on line " + line);
log("Make sure you fill in all numeric values properly! Numbers only!");
log("Make sure you fill in all numeric values properly! Numbers only! (No spaces!!)");
}
Time.sleep(VarsMethods.tickSpeed);
+1 -1
View File
@@ -21,7 +21,7 @@ public class VarsMethods {
public static String currentSubscript = "";
public final static String DEFAULT_DIR = System.getProperty("user.home") + System.getProperty("file.separator") + "Parabot" + System.getProperty("file.separator") + "Script Factory";
public final static String CACHED_LOC = DEFAULT_DIR + System.getProperty("file.separator") + "ScriptFactory cache.txt";
public final static String CACHED_LOC = DEFAULT_DIR + System.getProperty("file.separator") + "Your Previous Script.txt";
public final static String FSEP = System.getProperty("file.separator");
public final static int MAX_PARAMS = 3;