Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/02/2022 in all areas

  1. How to set up Intellij for Script Development Please note that EpicBot uses Java 8. You can download this from Oracle here. If your Java version is not 8, set up Intellij to use Java 8, read "Set Up Intellij" here. Don't know your Java version? Type java --version in a command prompt. SETUP Make a new Intellij Project Go to File -> Project Structure -> Modules. Click the + icon. Select JARs or Directories. Find your EpicBot folder. Select the dependencies folder and click OK. You should now see it in your Dependencies list. Click Apply (don't click OK). Click your Artifacts tab on the left, and the plus arrow again. Select "Other" from the drop down menu. You should see something like this: Name your artifact at the top (must be unique from your other script artifact names in other projects). Select the "Include in project build" checkbox. Click the '<project name> compile output' on the right side, so it moves to the left column. Click the file folder on the left. Find your EpicBot/scripts folder. You may not have one, and will need to make one. Select it and click OK. If your screen looks like this, click Apply and OK. Any script should now compile when you click the "Build Project" button (green hammer top right) Making a Test Script Right click your src folder on the left. Select New -> Java Class, and name it. You should get something like this: A quick sample script to test: import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.GameType; import com.epicbot.api.shared.script.LoopScript; import com.epicbot.api.shared.script.ScriptManifest; import com.epicbot.api.shared.util.paint.frame.PaintFrame; import java.awt.*; @ScriptManifest(name = "Test Script", gameType = GameType.OS) public class TestClass extends LoopScript { @Override public boolean onStart(String... strings) { return true; } @Override protected int loop() { return 50; } @Override protected void onPaint(Graphics2D g, APIContext ctx) { PaintFrame frame = new PaintFrame("Test Script"); frame.addLine("Title", "Value"); frame.draw(g, 0, 170, ctx); } } Click the build icon (green hammer top right) and you should then be able to see your script in the script selector. FAQ Q: I followed the instructions and everything is red? Your dependencies are not imported properly. Q: I don't see the script in the script list? You're not building the artifact properly. Ensure that "Include in Project Build" is checked, your output directory is correct, and your compile output is under the output root (left column). See below:
    1 point
  2. Forth script release! 🎉 Do you like my free scripts? Please show your support: 🙂 ---------------- 👇 DISCLAIMER: This script is for EDUCATIONAL PURPOSES ONLY. It is to help other new scripters get an idea of how to approach writing scripts. If you use this script,⚠️you will more than likely face a quick ban in OSRS⚠️. This is a very easy first script to write, but also a very well-known method. Use at your own risk, and most importantly... learn from it. 🙂 VIDEO TUTORIAL: CODE: import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.GameType; import com.epicbot.api.shared.entity.GroundItem; import com.epicbot.api.shared.methods.*; import com.epicbot.api.shared.model.Area; import com.epicbot.api.shared.script.LoopScript; import com.epicbot.api.shared.script.ScriptManifest; import com.epicbot.api.shared.util.paint.frame.PaintFrame; import com.epicbot.api.shared.webwalking.model.RSBank; import java.awt.*; @ScriptManifest(name = "Lumbridge Cowhide Collector by Zynava", gameType = GameType.OS) public class LumbridgeCowHideCollector extends LoopScript { /*** BEGIN VARIABLES ***/ public String status = ""; public IInventoryAPI myInventory() { return getAPIContext().inventory(); } public IWebWalkingAPI webWalking() { return getAPIContext().webWalking(); } public IBankAPI myBank() { return getAPIContext().bank(); } public ILocalPlayerAPI localPosition() { return getAPIContext().localPlayer(); } public IGroundItemsAPI groundItems() { return getAPIContext().groundItems(); } public Area COW_AREA = new Area(3244, 3295, 3262, 3277); /*** END VARIABLES ***/ @Override public boolean onStart(String... strings) { setStatus("Script starting"); return true; } @Override protected int loop() { if(myInventoryIsFull()) { setStatus("Heading to bank..."); bank(); if(myBank().isOpen()) { setStatus("Depositing inventory..."); if(myBank().depositInventory()) { myBank().close(); } } } if(!myInventoryIsFull() && !COW_AREA.contains(localPosition().getLocation())) { setStatus("Walking to cow field..."); webWalking().walkTo(COW_AREA.getRandomTile()); } if(!myInventoryIsFull() && COW_AREA.contains(localPosition().getLocation())) { GroundItem cowHide = groundItems().query().named("Cowhide").results().nearest(); if(cowHide != null) { setStatus("Gathering cowhide"); cowHide.interact("Take"); } } return 50; } public boolean myInventoryIsFull() { return myInventory().isFull(); } public void bank() { webWalking().walkTo(RSBank.LUMBRIDGE_TOP.getTile()); myBank().open(); } public void setStatus(String status) { this.status = status; } @Override protected void onPaint(Graphics2D g, APIContext ctx) { PaintFrame frame = new PaintFrame("Lumbridge Cowhide Collector by Zynava"); frame.addLine("Action being performed: ", status); frame.draw(g, 0, 170, ctx); } }
    1 point
×
×
  • Create New...