Jump to content

moops22

Members
  • Posts

    5
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

moops22's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. I am making a script for 1-99 magic and so far I have wind strike, fire strike, and fire bolt. it buys runes and staves but my one problem is the attacking. this is the first thing I made in my script so I am confused on how to fix it because I have no previous java experience but I have some experience in c++ can anyone help me make a better attack script for the Lesser demon on top of the wizards tower because right now it just clicks constantly and selects the spell sometimes. private void firestrikedemon() throws InterruptedException { if (getTabs().open(Tab.MAGIC)) { if (getMouse().click(true)) sleep(random(1000, 2000)); NPC enemy = getNpcs().closest("Lesser demon"); if (enemy != null) { magic.castSpell(Spells.NormalSpells.FIRE_STRIKE); if (enemy != null && !enemy.interact("Attack")) if (enemy.interact()) { sleep(random(964,1960)); } } } } demon_splash.java
  2. oh wow such a small mistake. Thank you!
  3. so I have been making different functions for each time I buy runes I thought that was tedious and thought I could do something like this. private void buyrunes(int amount, string name) throws InterruptedException { NPC aubury = getNpcs().closest("Aubury"); if (aubury != null && aubury.interact("Trade")) { sleep(random(2000, 4000)); if(getStore().isOpen()) { getStore().buy("air rune", 1000); } getKeyboard().pressKey(KeyEvent.VK_ESCAPE); sleep(random(2000, 4000)); } } but the problem is that my intellij is giving me the error that it cant resolve the symbol string? any advice would be very helpful.
  4. thank you this fixed the issue.
  5. I recently started botting a few days ago and wanted to get into coding scripts. my plan for this one is to wind strike to level 11 confuse to level 33 then alc. everything works except the last part where I walk to the demon on top of the wizards tower and I'm not sure why, I have been trying to fix it for about an hour but I cant find anything wrong with it. sorry for sloppy code this is my first time using java package core; import org.osbot.rs07.api.Magic; import org.osbot.rs07.api.Skills; import java.util.LinkedHashMap; import java.awt.Graphics2D; import java.awt.event.KeyEvent; import java.util.HashMap; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.InteractableObject; import java.util.stream.Stream; import java.util.Map; import org.osbot.rs07.script.MethodProvider; @ScriptManifest(author = "jason", info = "Casts magic on the demon", name = "Demon_splasher", version = 0, logo = "") public class demon_splash extends Script { private static final String DEMON_NAME = "Lesser demon"; Position pos = new Position(3110,3161,2); Position runeshoppos = new Position(3252,3401,0); Position bankpos = new Position(3253,3420,0); @Override public void onStart() { log("Script started"); } private void attackdemon() throws InterruptedException { } private void withdrawgold() throws InterruptedException { NPC banker = getNpcs().closest("banker"); if (banker != null && banker.interact("bank")) { sleep(random(2000, 4000)); if(getBank().isOpen()) { getBank().withdraw("coins", 20000); } getKeyboard().pressKey(KeyEvent.VK_ESCAPE); sleep(random(2000, 4000)); } } private void interactWithShopkeeperAndBuymindRunes() throws InterruptedException { // Interact with the shopkeeper (replace "Aubury" with the actual NPC name) NPC aubury = getNpcs().closest("Aubury"); if (aubury != null && aubury.interact("Trade")) { sleep(random(2000, 4000)); if(getStore().isOpen()) { getStore().buy("mind rune", 1000); } getKeyboard().pressKey(KeyEvent.VK_ESCAPE); sleep(random(2000, 4000)); } } private void interactWithShopkeeperAndBuyairRunes() throws InterruptedException { // Interact with the shopkeeper (replace "Aubury" with the actual NPC name) NPC aubury = getNpcs().closest("Aubury"); if (aubury != null && aubury.interact("Trade")) { sleep(random(2000, 4000)); if(getStore().isOpen()) { getStore().buy("air rune", 1000); } getKeyboard().pressKey(KeyEvent.VK_ESCAPE); sleep(random(2000, 4000)); } } ///////////////////////WALK_TO_VARROCK_MAGIC_SHOP/////////// private boolean should_Walk_To_magic_shop() { Position currentPlayerTile = myPosition(); return !pos.equals(currentPlayerTile); } private void walk_To_magicshop(Position runeshoppos) throws InterruptedException { if (getWalking().webWalk(runeshoppos)) { new ConditionalSleep(2000, 5000) { @Override public boolean condition() throws InterruptedException { return !runeshoppos.equals(myPosition()); } }.sleep(); } } ///////////////////////WALK_TO_VARROCK_MAGIC_SHOP//////////////////////^^^ ////////////////////////WALK TO DEMON//////////////////////////// private boolean shouldWalkToPos() { Position currentPlayerTile = myPosition(); return !pos.equals(currentPlayerTile); } private void walkToPos(Position pos) throws InterruptedException { if (getWalking().webWalk(pos)) { new ConditionalSleep(2000, 5000) { @Override public boolean condition() throws InterruptedException { return !pos.equals(myPosition()); } }.sleep(); } } ////////////////////////////WALK TO DEMON///////////////////////////^^^ ////////////////////////WALK TO BANK//////////////////////////// private boolean shouldwalkbank() { Position currentPlayerTile = myPosition(); return !pos.equals(currentPlayerTile); } private void walkTobankPos(Position bankpos) throws InterruptedException { if (getWalking().webWalk(bankpos)) { new ConditionalSleep(2000, 5000) { @Override public boolean condition() throws InterruptedException { return !bankpos.equals(myPosition()); } }.sleep(); } } ////////////////////////////WALK TO BANK///////////////////////////^^^ @Override public int onLoop() throws InterruptedException { int Magic_Level = getSkills().getDynamic(Skill.MAGIC); switch (Magic_Level) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: if (getInventory().getAmount("airrune")>=1000 && getInventory().getAmount("mindrune")>=1000){ if (shouldWalkToPos()) { walkToPos(pos); } }else { if (getInventory().getAmount("airrune") == 0){ if (getInventory().getAmount("coins")<20000){ if (shouldwalkbank()) { walkTobankPos(bankpos); withdrawgold(); } } if (should_Walk_To_magic_shop()) { walk_To_magicshop(runeshoppos); } interactWithShopkeeperAndBuyairRunes(); } else if (getInventory().getAmount("mindrune")==0) { if (getInventory().getAmount("coins")<20000){ if (shouldwalkbank()) { walkTobankPos(bankpos); withdrawgold(); } } if (should_Walk_To_magic_shop()) { walk_To_magicshop(runeshoppos); } interactWithShopkeeperAndBuymindRunes(); } } break; } return 300; } @Override public void onExit() { log("Thanks using demon_splasher!"); } @Override public void onPaint(Graphics2D g) { } }
×
×
  • Create New...