Jump to content

Nexus123

Members
  • Posts

    12
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

873 profile views

Nexus123's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. Hello. I am creating a woodcutting bot but i need some help with code can anyone help me out... I have inserted my code below i need help with 2 things and they are... The bot keeps spam clicking on the same tree until it chops down the tree. And i need to make the camera adjust to the tree package Woodcutter; import java.awt.Graphics2D; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.Skill; @ScriptManifest(author = "Test", info = "Chops", logo = "N/A", name = "WoodCutter", version = 1.0) public class Woodcutter extends Script { private int beginningXP; private int currentXp; private int xpGained; private int currentLevel; private int beginningLevel; private int levelsGained; // code to be executed at the start of script @Override public void onStart() { log("Starting Woodcutter"); log("Starting Woodcutter"); beginningXP = skills.getExperience(Skill.WOODCUTTING); beginningLevel = skills.getStatic(Skill.WOODCUTTING); } private enum State { CHOP, BANK, WAIT; }; private State getState() { if (!(inventory.isFull())) return State.CHOP; if (inventory.isFull()) return State.BANK; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case CHOP: Entity willowTree = objects.closest("Tree"); if (willowTree != null) willowTree.interact("Chop down"); break; case BANK: if (inventory.isFull()) { inventory.dropAll(); } break; case WAIT: sleep(random(500, 700)); break; } return 50; } // code to be executed at the end @Override public void onExit() { } @Override public void onPaint(Graphics2D g) { currentXp = skills.getExperience(Skill.WOODCUTTING); xpGained = currentXp - beginningXP; g.drawString("XP Gained: " + xpGained, 25, 50); currentLevel = skills.getStatic(Skill.WOODCUTTING); g.drawString("Beginning Level: " + beginningLevel, 25, 60); g.drawString("Current Level: " + currentLevel, 25, 70); levelsGained = currentLevel - beginningLevel; g.drawString("Levels Gained: " + levelsGained, 25, 80); } }
  2. Looks SEXY! vgsgp he clearly stated that they would fix the issue. Please read through before post theses things...
  3. can i send it to someone through message ? package Woodcutter; import java.awt.Graphics; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Kn0oop", info = "Chops Trees.", logo = "", name = "Kn0PCutter", version = 1.0) public class Woodcutter extends Script { final String TREE_NAME = "Tree"; // Code Executed On Script Start public void onStart() { } // Code Executed On Script End. public void onExit() { } // Loop In Code. @SuppressWarnings("null") public int onLoop() { Inventory inven = null; if (inven.isFull()) { // Chop Entity tree = closestObjectForName(TREE_NAME); if (tree != null) { if (tree.isVisible()) { tree.interact("Chop Down"); } else { moveCameraTo(tree); } } else { // Bank } } return 50; } private Entity closestObjectForName(String TREE_NAME) { return null; } private void moveCameraTo(Entity tree) { } // Paint public void onPaint(Graphics g) { } } there is still alot more to code but it should work this might help [iNFO][bot #1][10/28 11:40:13 PM]: Random solver exited : Auto Login [ERROR][bot #1][10/28 11:40:16 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:30) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [iNFO][bot #1][10/28 11:40:16 PM]: Started random solver : Welcome Screen [iNFO][bot #1][10/28 11:40:18 PM]: Random solver exited : Welcome Screen [ERROR][bot #1][10/28 11:40:18 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:30) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:40:19 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:30) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:40:20 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:30) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:40:21 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:30) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [iNFO][bot #1][10/28 11:40:21 PM]: Terminating script Kn0PCutter... [iNFO][bot #1][10/28 11:40:21 PM]: Script Kn0PCutter has exited!
  4. cut down trees (normal trees)
  5. that's what im not sure about
  6. ok so when i launch the script it starts up and in console it says [ERROR][bot #1][10/28 11:12:27 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:30) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) need reply quick!!
  7. Hello i made a bot and it's fully coded but it does nothing it just stands there... ERROR = [ERROR][bot #1][10/28 11:05:14 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:29) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [iNFO][bot #1][10/28 11:05:14 PM]: Started random solver : Welcome Screen [iNFO][bot #1][10/28 11:05:16 PM]: Random solver exited : Welcome Screen [ERROR][bot #1][10/28 11:05:16 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:29) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:05:17 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:29) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:05:18 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:29) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:05:19 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:29) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:05:20 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:29) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:05:21 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:29) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [ERROR][bot #1][10/28 11:05:22 PM]: Error in script executor! java.lang.NullPointerException at Woodcutter.Woodcutter.onLoop(Woodcutter.java:29) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(sg:186) at java.lang.Thread.run(Unknown Source) [iNFO][bot #1][10/28 11:05:22 PM]: Terminating script TEST... [iNFO][bot #1][10/28 11:05:22 PM]: Script TEST has exited!
×
×
  • Create New...