Puhson 0 Share 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!"); } } Link to comment Share on other sites More sharing options...
RSMasterGuard 19 Share 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 Link to comment Share on other sites More sharing options...
Diggington 18 Share 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) Link to comment Share on other sites More sharing options...
camelCase 240 Share Posted August 12, 2023 https://www.youtube.com/watch?v=RRubcjpTkks Link to comment Share on other sites More sharing options...
Puhson 0 Author Share 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!"); } } Link to comment Share on other sites More sharing options...
faygo 12 Share Posted August 15, 2023 On 8/12/2023 at 5:19 AM, camalCase said: https://www.youtube.com/watch?v=RRubcjpTkks hotdog Link to comment Share on other sites More sharing options...
faygo 12 Share 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 Link to comment Share on other sites More sharing options...
faygo 12 Share Posted August 15, 2023 like the fucking ide tells you how to fix it Link to comment Share on other sites More sharing options...
DimitriWhite 8 Share 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 Link to comment Share on other sites More sharing options...
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