Hey, amazing work! However, whenever I try to run the script, I get the following error:
[04:13:52.862][ERROR][ScriptTaskContainer][485] Error during executing task: 'com.epicbot.api.shared.script.LoopScript$LoopTask'
java.lang.NullPointerException
at ELeetWoodcutter.clickTree(ELeetWoodcutter.java:134)
at ELeetWoodcutter.loop(ELeetWoodcutter.java:76)
at com.epicbot.api.shared.script.LoopScript$LoopTask.run(qfa:136)
at com.epicbot.api.shared.script.ScriptTaskContainer.runTask(qha:23)
at com.epicbot.api.shared.script.ScriptTaskContainer.run(qha:20)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Any idea what might be the cause? Much appriciate it!
*********************** SOLVED IT ************************************************************
All I had to do was to change the code in line 134 to:
if(entity != null && entity.isValid()) {
entity.interact("Chop down");
} else {
System.out.println("Couldn't find a tree to cut.");
}
Your code tried to access or invoke a method on an object that was null.
!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!
Change the type of the tree to ---> "Yew tree" instead of just "Yew"
Other than that it works flawlessly, big + for the camera rotations and random clicks i suspect lower detection rates thanks to that feature!
Hope it helps someone!