st1nklr 1 Posted April 23, 2020 Ive been learning how to script so i was messing around trying to make a cow killing script but when i go to run it it just doesnt start this appeared in the debug console 22:13:03: Error occurred while trying to start script: java.lang.InstantiationException at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.dreambot.api.script.ScriptManager.start(ScriptManager.java:99) at org.dreambot.0.1.1.3.4.2(4.java:256) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
PapayaBrownie 1 Posted April 23, 2020 Can you post or message me your source code to see what could be wrong?
st1nklr 1 Author Posted April 23, 2020 8 hours ago, PapayaBrownie said: Can you post or message me your source code to see what could be wrong? Yes my bad for the very late response import org.dreambot.api.methods.filter.Filter; import org.dreambot.api.methods.map.Area; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.wrappers.interactive.NPC; @ScriptManifest(author = "You", name = "CowKiller", version = 1.0, description = "Simple CowKiller", category = Category.COMBAT) public abstract class CowScript extends AbstractScript { public static final Filter<NPC> COWFILTER = new Filter<NPC>() { @Override public boolean match(NPC npc) { if (npc == null) { return false; } if (npc.getName().equals("Cow") && !npc.isHealthBarVisible()) { return true; } else { return false; } } }; Area CowArea = new Area(3209, 3302, 3192, 3282); @Override public int onLoop() { if (getLocalPlayer().isInCombat()) { } else if (CowArea.contains(getLocalPlayer())) { NPC cow = getNpcs().closest("Cow"); if (cow != null) { cow.interact("Attack"); } } else { getWalking().walk(CowArea.getRandomTile()); } return 1000; } } Eclipse doesnt seem to be registering any errors in it
Shy 14 Posted April 23, 2020 public abstract class CowScript extends AbstractScript You declared your class abstract. You can't instantiate an abstract class. That's why you get " java.lang.InstantiationException" in the debug console.
st1nklr 1 Author Posted April 23, 2020 7 minutes ago, Shy said: public abstract class CowScript extends AbstractScript You declared your class abstract. You can't instantiate an abstract class. That's why you get " java.lang.InstantiationException" in the debug console. Ah i see, yeah that fixed it thank you very much for the response
Recommended Posts
Archived
This topic is now archived and is closed to further replies.