-
Posts
373 -
Joined
-
Last visited
-
Days Won
1 -
Feedback
100%
Everything posted by Nym
-
Could anyone share some improvements I can make to this script? public class Main extends Script { GUI gui = new GUI(); private NPC monster; private long startTime; public enum State { splash, splashAlch } @Override public int onLoop() throws InterruptedException { if (Settings.started) { if (!Settings.monsterName.isEmpty() && Settings.monsterName != null) { monster = npcs.closest(Settings.monsterName); } else { log("Enter a real monster name."); stop(); } if (!magic.canCast(Settings.spellToCast)) { log("Cant cast spell"); stop(); } switch (getState()) { case splash: if (monster != null && monster.isVisible()) { if (magic.castSpellOnEntity(Settings.spellToCast, monster)) { new ConditionalSleep(3000) { @Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); new ConditionalSleep(3000) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); } }.sleep(); } } else { camera.toEntity(monster); } break; case splashAlch: if (monster != null && monster.isVisible()) { if (magic.castSpellOnEntity(Settings.spellToCast, monster)) { sleep(random(150, 400)); if (magic.canCast(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)) { if (magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)) { new ConditionalSleep(2000) { @Override public boolean condition() throws InterruptedException { return tabs.getOpen().equals(Tab.INVENTORY); } }.sleep(); sleep(random(50, 150)); if (mouse.click(inventory.getMouseDestination(inventory.getSlot(Settings.alchName)), false)) { new ConditionalSleep(3000) { @Override public boolean condition() throws InterruptedException { return tabs.getOpen().equals(Tab.MAGIC); } }.sleep(); sleep(random(150, 400)); } } } else { log("Can't cast High Alchemy"); stop(); } } } break; } } return 120; } public State getState() { return ((skills.getDynamic(Skill.MAGIC) >= 55) && Settings.alch) ? State.splashAlch : State.splash; } @Override public void onStart() throws InterruptedException { log("Nimmogel's 1-99 Magic has started :D"); gui.createGui(); experienceTracker.start(Skill.MAGIC); Methods methods = new Methods(this); Settings.spellToCast = methods.spellToCastFinder(); startTime = System.currentTimeMillis(); } public void onMessage(Message message) throws InterruptedException { String text = message.getMessage().toLowerCase(); if (text.contains("advanced a")) { Methods methods = new Methods(this); Settings.spellToCast = methods.spellToCastFinder(); } } @Override public void onExit() throws InterruptedException { log("Bye :D"); if (gui !=null) { gui.setVisible(false); gui.dispose(); } } @Override public void onPaint(Graphics2D g) { long runTime = System.currentTimeMillis() - startTime; long tillNextLevel = experienceTracker.getTimeToLevel(Skill.MAGIC); long second = runTime / 1000L % 60L; long minute = runTime / 60000L % 60L; long hour = runTime / 3600000L % 24L; long secondX = tillNextLevel / 1000L % 60L; long minuteX = tillNextLevel / 60000L % 60L; long hourX = tillNextLevel / 3600000L % 24L; g.setColor(Color.WHITE); g.drawString("Time running: " + String.format("%d:%02d:%02d", hour, minute, second), 300, 285); g.drawString("EXP: " + experienceTracker.getGainedXP(Skill.MAGIC) + " (" + experienceTracker.getGainedXPPerHour(Skill.MAGIC) + "/hr)", 300, 300); g.drawString("Level: " + skills.getDynamic(Skill.MAGIC) + "(" + String.format("%02d:%02d:%02d", hourX, minuteX, secondX) + ")", 300, 315); } }
-
Check the logs, should tell you what is needed. Also have right runes for the spell it is trying to cast.
-
Yes this script should stop if it runs out of supplies. Thank you!
-
The max i have used this for is up to 3 hour sessions, I have never been banned using this.
-
Thanks but idk why your congratulating me.
-
I needed a script for gaining magic levels so i created this 1-99 magic, thought I'd share. What is it? It progressively splashes on monsters to get you from levels 1-99 magic. Requirements - Required runes. - negative 65 magic bonus Setup Start beside a monster that will not move away from your player, ie) bear behind varrock palace. 1. Enter exact monster name. 2. Check F2P box if you are not a member. 3. Check if you want to alch at 55 magic, then enter exact alch name. 4. Press start. How does it work? 1-3 splashes air strike. 3-11 splashes confuse. 11-19 splashes weaken. (F2P) 19+ splashes curse, with optional alching at 55. (P2P) 19-66 splashes curse, with optional alching at 55. 66-73 splashes vulnerability, option to also alch. 73-80 splashes enfeeble, option to also alch. 80+ splashes stun, option to also alch. Gui Proggies - (Post some and I will add!) Where to get? Released on SDN. Want a script that gains you magic exp and profits you money? Check out my other script.
- 267 replies
-
- 11
-
-
-
I thought my scroll wheel was broken the first time.
-
I used eclipse window builder and dragged it into intellij. My layout is null cause I used absulute layout thing. I will make the component size larger and see what it does, thanks a lot
-
I made a gui but the wording of on my JLabels seems to cut off and do "...", there is plenty of room for it to fit there, additionally I have tried moving them over and it did not work.
-
Found the issue, just simple stuff, used to a differen't api. Sorry and thanks for the help
-
oh no, that part is not used, i just forgot to delete it edit - took out now scripts starts but my script doesnt do anything and uses a shit ton of cpu and mem
-
Hey can anyone help me here I made a simple script and when I start to the script it doesnt start. package core; import org.osbot.rs07.api.Objects; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import static core.PestControl.State.*; @ScriptManifest(version = 0, info = "Pest Control :D", logo = "", author = "Nimmogel", name = "Pest Control") public class PestControl extends Script { final State state = getState(); Area onBoatArea = new Area(2637, 2647, 2641, 2641); Area pcArea = new Area(2623, 2622, 2689, 2561); Area killArea = new Area(2627, 2596, 2640, 2587); Area outsideBoat = new Area(2644, 2646, 2644, 2642); String[] pestControlMonsters = {"Brawler","Defiler","Ravager","Shifter","Spinner","Torcher"}; public void onStart() throws InterruptedException { log("Pest Control has started :D"); } public enum State { ATTACK, ONBOAT, BOAT, WALKTOSPOT } private State getState() { if (!pcArea.contains(myPlayer()) && !onBoatArea.contains(myPlayer())) { return BOAT; } if (onBoatArea.contains(myPlayer())) { return ONBOAT; } if (pcArea.contains(myPlayer()) && !killArea.contains(myPlayer())) { return WALKTOSPOT; } if (killArea.contains(myPlayer())) { return ATTACK; } return null; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case ATTACK: NPC monster = npcs.closest(pestControlMonsters); log("atack monsters"); if (monster != null) { if (monster.isVisible()) { if (monster.interact("Attack")) { new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); } }.sleep(); } } } break; case ONBOAT: log("onBoat"); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return pcArea.contains(myPlayer()); } }.sleep(); break; case BOAT: RS2Object plank = new Objects().closest("Gangplank"); log("boat case"); if (plank != null) { if (plank.isVisible()) { if (plank.interact("Cross")) { new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return onBoatArea.contains(myPlayer()); } }.sleep(); } } } else { getWalking().walk(outsideBoat); sleep(random(650,900)); } break; case WALKTOSPOT: log("walking to kill area"); getWalking().webWalk(killArea); sleep(random(650,900)); break; } return 120; } @Override public void onExit() { log("Thanks for running my Pest Control"); } }
-
it seems to do this for me also, but, i just move my character around/to next spot and it then works. Got zulrah pet also at 400 kc ;D
-
Hey could I get a trail please