Add walk-efficient

This commit is contained in:
dginovker
2019-12-23 15:24:23 -05:00
parent 00c7fd610c
commit 153ce9e255
69 changed files with 20 additions and 50 deletions
+1 -3
View File
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
@@ -4,6 +4,7 @@ import org.parabot.environment.api.utils.Filter;
import org.parabot.environment.api.utils.Time; import org.parabot.environment.api.utils.Time;
import org.parabot.environment.input.Keyboard; import org.parabot.environment.input.Keyboard;
import org.parabot.environment.input.Mouse; import org.parabot.environment.input.Mouse;
import org.parabot.environment.scripts.framework.SleepCondition;
import org.rev317.min.api.methods.*; import org.rev317.min.api.methods.*;
import org.rev317.min.api.wrappers.*; import org.rev317.min.api.wrappers.*;
import scriptfactory.VarsMethods; import scriptfactory.VarsMethods;
@@ -97,6 +98,18 @@ public class ActionHandler {
Time.sleep(a.getParam(2)); Time.sleep(a.getParam(2));
} }
public void walkEfficient(Action a) {
final Tile destinationTile = new Tile(a.getParam(0), a.getParam(1));
final int withinDistance = a.getParam(2);
Walking.walkTo(destinationTile);
Time.sleep(new SleepCondition() {
@Override
public boolean isValid() {
return destinationTile.distanceTo() < withinDistance;
}
}, 50000);
}
public void handleGroundItemInteract(final Action a) { public void handleGroundItemInteract(final Action a) {
try { try {
GroundItem item = GroundItems.getNearest(new Filter<GroundItem>() { GroundItem item = GroundItems.getNearest(new Filter<GroundItem>() {
+1 -1
View File
@@ -21,7 +21,7 @@ import static scriptfactory.VarsMethods.log;
* Welcome to AIO AIO - ScriptFactory. Make your own scripts! * Welcome to AIO AIO - ScriptFactory. Make your own scripts!
*/ */
@ScriptManifest(author = "Before", name = "Script Factory 1.14", category = Category.OTHER, version = 1.14, description = "Create your own scripts!", servers = "All") @ScriptManifest(author = "Before", name = "Script Factory 1.15", category = Category.OTHER, version = 1.15, description = "Create your own scripts!", servers = "All")
public class Core extends Script implements Paintable { public class Core extends Script implements Paintable {
private ArrayList<Action> actions = new ArrayList<>(); private ArrayList<Action> actions = new ArrayList<>();
@@ -8,12 +8,13 @@ import java.util.ArrayList;
public class UncommonActionGuiInfo extends NewStatementGUI { public class UncommonActionGuiInfo extends NewStatementGUI {
public UncommonActionGuiInfo(ArrayList<Action> actionList, Consumer<Integer> updateTextField) public UncommonActionGuiInfo(ArrayList<Action> actionList, Consumer<Integer> updateTextField)
{ {
String[] actionTypes = new String[]{"Comment", "Run subscript", "Bank all except IDs", "Change Tick Speed"}; String[] actionTypes = new String[]{"Comment", "Run subscript", "Bank all except IDs", "Change Tick Speed", "Walk Efficient"};
NewStatementGUI.Descriptions[] setDescs = { NewStatementGUI.Descriptions[] setDescs = {
new Descriptions("Enter any text to be your comment."), new Descriptions("Enter any text to be your comment."),
new Descriptions("Enter the file name of the subscript (cAsE sEnSiTiVe)"), new Descriptions("Enter the file name of the subscript (cAsE sEnSiTiVe)"),
new Descriptions("Enter the IDs to keep (comma separated) (i.e. \"995,150,356\") (can be blank)"), new Descriptions("Enter the IDs to keep (comma separated) (i.e. \"995,150,356\") (can be blank)"),
new Descriptions("Enter the new Tick Speed (in ms), which is time delayed between each line (default 1200)"), new Descriptions("Enter the new Tick Speed (in ms), which is time delayed between each line (default 1200)"),
new Descriptions("X-tile coordinate", "Y-tile coordinate", "Distance to get within (times out after 50secs)"),
}; };
initGui("Add new uncommon action", actionList, updateTextField, actionTypes, setDescs); initGui("Add new uncommon action", actionList, updateTextField, actionTypes, setDescs);
} }
@@ -108,6 +108,9 @@ public class ActionExecutor {
case "Walk to": case "Walk to":
actionHandler.walkTo(action); actionHandler.walkTo(action);
break; break;
case "Walk Efficient":
actionHandler.walkEfficient(action);
break;
case "Run subscript": case "Run subscript":
insertSubscript(action, actions, action.getParamAsString(0)); insertSubscript(action, actions, action.getParamAsString(0));
lineIndex = --lineIndex == -1 ? actions.size()-1 : lineIndex; //Rerun the last line, which now contains start of subscript lineIndex = --lineIndex == -1 ? actions.size()-1 : lineIndex; //Rerun the last line, which now contains start of subscript
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="allatori">
<target name="allatori">
<taskdef name="allatori" classname="com.allatori.ant.ObfuscatorTask" classpath="${user.home}/allatori/allatori.jar"/>
<allatori config="src/main/resources/config.xml"/>
<echo message="Obfuscating script"/>
</target>
</project>
-37
View File
@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config>
<jars basedir="/home/dr_cookie/Projects/ScriptFactory3/target/">
<jar in="1000202.jar" out="/home/ci/jars/1000202.jar"/>
</jars>
<classpath basedir="/home/ci/allatori/libs">
<jar name="./*.jar"/>
</classpath>
<!-- String encryption -->
<property name="string-encryption" value="enable"/>
<property name="string-encryption-type" value="fast"/>
<property name="string-encryption-version" value="v4"/>
<!-- Control flow obfuscation -->
<property name="control-flow-obfuscation" value="enable"/>
<property name="extensive-flow-obfuscation" value="normal"/>
<!-- Renaming -->
<property name="default-package" value=""/>
<property name="force-default-package" value="disable"/>
<property name="classes-naming" value="unique"/>
<property name="methods-naming" value="iii"/>
<property name="fields-naming" value="iii"/>
<property name="local-variables-naming" value="abc"/>
<!-- Other -->
<property name="line-numbers" value="keep"/>
<property name="generics" value="keep"/>
<property name="member-reorder" value="enable"/>
<property name="finalize" value="disable"/>
<property name="synthetize-methods" value="private"/>
<property name="synthetize-fields" value="private"/>
<property name="remove-toString" value="disable"/>
</config>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.