Puhson 0 Posted August 9, 2023 I am trying to make a combat script and trying to figure out whats wrong. getLocalPlayer gives me this = Cannot resolve symbol 'getLocalPlayer' And sleepuntil gives me this: Cannot resolve method 'sleepUntil(<lambda expression>, int)' My code: import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.interactive.NPCs; 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 = "Puh", name = "Revenant Imp Killer", version = 1.0, description = "Kills Revenant Imps", category = Category.COMBAT) public class RevenantImpKiller extends AbstractScript { @Override public void onStart() { log("Script started!"); } @Override public int onLoop() { if (!(getLocalPlayer).isInCombat()) { NPC imp = NPCs.closest("Revenant imp"); if (imp != null && imp.interact("Attack")) { sleepUntil(() -> getLocalPlayer().isInCombat(), Calculations.random(3000, 5000)); } } return Calculations.random(200, 600); } @Override public void onExit() { log("Script stopped!"); } }
RSMasterGuard 20 Posted August 9, 2023 4 hours ago, Puhson said: I am trying to make a combat script and trying to figure out whats wrong. getLocalPlayer gives me this = Cannot resolve symbol 'getLocalPlayer' And sleepuntil gives me this: Cannot resolve method 'sleepUntil(<lambda expression>, int)' My code: import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.interactive.NPCs; 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 = "Puh", name = "Revenant Imp Killer", version = 1.0, description = "Kills Revenant Imps", category = Category.COMBAT) public class RevenantImpKiller extends AbstractScript { @Override public void onStart() { log("Script started!"); } @Override public int onLoop() { if (!(getLocalPlayer).isInCombat()) { NPC imp = NPCs.closest("Revenant imp"); if (imp != null && imp.interact("Attack")) { sleepUntil(() -> getLocalPlayer().isInCombat(), Calculations.random(3000, 5000)); } } return Calculations.random(200, 600); } @Override public void onExit() { log("Script stopped!"); } } your code or chat gpts? Tweeboy 1
Diggington 20 Posted August 9, 2023 https://dreambot.org/javadocs/org/dreambot/api/methods/interactive/Players.html#getLocal() https://dreambot.org/javadocs/org/dreambot/api/utilities/Sleep.html#sleepUntil(org.dreambot.api.utilities.impl.Condition,long)
Puhson 0 Author Posted August 13, 2023 On 8/9/2023 at 9:02 AM, Diggington said: https://dreambot.org/javadocs/org/dreambot/api/methods/interactive/Players.html#getLocal() https://dreambot.org/javadocs/org/dreambot/api/utilities/Sleep.html#sleepUntil(org.dreambot.api.utilities.impl.Condition,long) Would it be like this then? import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.combat.Combat; import org.dreambot.api.methods.interactive.NPCs; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.impl.Condition; import org.dreambot.api.wrappers.interactive.Character; import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.wrappers.interactive.Player; import java.util.Objects; @ScriptManifest(author = "Puh", name = "Revenant Imp Killer", version = 1.0, description = "Kills Revenant Imps", category = Category.COMBAT) public class RevenantImpKiller extends AbstractScript { public Character getLocal; @Override public void onStart() { log("Script started!"); } public static Player getLocal() { return null; } @Override public int onLoop() { if (!(getLocal).isInCombat()) { NPC imp = NPCs.closest("Revenant imp"); if (imp != null && imp.interact("Attack")) { sleepUntil(() -> (getLocal()).isInCombat(), Calculations.random(3000, 5000)); } } return Calculations.random(200, 600); } private void sleepUntil(Object o, int random) { } @Override public void onExit() { log("Script stopped!"); } }
faygo 13 Posted August 15, 2023 On 8/12/2023 at 5:19 AM, camalCase said: https://www.youtube.com/watch?v=RRubcjpTkks hotdog
faygo 13 Posted August 15, 2023 On 8/12/2023 at 9:05 PM, Puhson said: Would it be like this then? import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.combat.Combat; import org.dreambot.api.methods.interactive.NPCs; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.impl.Condition; import org.dreambot.api.wrappers.interactive.Character; import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.wrappers.interactive.Player; import java.util.Objects; @ScriptManifest(author = "Puh", name = "Revenant Imp Killer", version = 1.0, description = "Kills Revenant Imps", category = Category.COMBAT) public class RevenantImpKiller extends AbstractScript { public Character getLocal; @Override public void onStart() { log("Script started!"); } public static Player getLocal() { return null; } @Override public int onLoop() { if (!(getLocal).isInCombat()) { NPC imp = NPCs.closest("Revenant imp"); if (imp != null && imp.interact("Attack")) { sleepUntil(() -> (getLocal()).isInCombat(), Calculations.random(3000, 5000)); } } return Calculations.random(200, 600); } private void sleepUntil(Object o, int random) { } @Override public void onExit() { log("Script stopped!"); } } bro its Sleep.sleepUntil and Players.getLocal actual brainlet
Newp 9 Posted August 25, 2023 On 8/15/2023 at 4:27 PM, faygo said: like the fucking ide tells you how to fix it IDE speak smart. I no smeak spart
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now