Jump to content

Booleans YAY

Trade With Caution
  • Posts

    184
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Booleans YAY

  1. I know it's overkill, but little better than using switch.
  2. omg I had a similar thought like this, embarrassing -.-" Thanks though
  3. The issue is that the tabs don't actually switch randomly. Code is compatible but not functioning right. private static int rngTab = random(0, 125); private enum Tabs { ATTACK(0, Tab.ATTACK); private int chance; private Tab tab; public int getChance() { return chance; } public Tab getTab() { return tab; } private static Set<Tabs> tab_set = Collections.unmodifiableSet(EnumSet.allOf(Tabs.class)); public static Optional<Tabs> forTabs(int rng) { return tab_set.stream().filter(Objects::nonNull).filter(tabs -> tabs.getChance() == rng).findAny(); } public static void randomTabs(Script script, int chance) { if (rngTab == forTabs(chance).get().getChance()) { script.getTabs().open(forTabs(chance).get().getTab()); } } private Tabs(int chance, Tab tab) { this.chance = chance; this.tab = tab; } } if (getState() == BotState.FISHING) { Tabs.randomTabs(this, 0); return; }
  4. The code in this script isn't my 'best' but functional, feel free to improve if you'd like I just did this up quick is all lol sorry in advance! Be sure to hit the Like button if you use, this is my second script made so far. Plenty more to come! Anyways, market price for Cabbage is 48gp, sell lower to auto sell. I was actually testing to see if infact cabbage would sell and it did. Regardless, there's 0 requirements for this money making method and is entirely F2P. Start off anywhere, it'll walk itself to the cabbage patch (start draynor ideally). Here's some features to list. Statistics Log Walks to Port Sarim/Draynor Cabbage patch Anti ban methods as seen in my Bone Bury script Prior features from the Bury Bones script included Bank support (object/npc (randomized)) package main.script.Cabbage_Patch_Kid; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; 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.model.NPC; import org.osbot.rs07.api.ui.Tab; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Booleans Yay", info = "Cabbage Picking made ez pz", name = "Cabbage Patch Kid", version = 1, logo = "") public class CabagePatchKid extends Script { private int cabbage_taken, banked,randomsDismissed; long timeStarting = System.currentTimeMillis(); private Area bankArea = new Area(3092 , 3245, 3094, 3245); private Position cabbagePos = new Position(3053, 3284, 0); @[member='Override'] public void onStart() throws InterruptedException { cabbage_taken = 0; banked = 0; randomsDismissed = 0; timeStarting = System.currentTimeMillis(); getSettings().setRunning(true); if (!(cabbagePos == myPlayer().getPosition())) { getWalking().webWalk(cabbagePos); } } private enum BotState { PICKING_CABAGE, BANKING }; private BotState getState() { return inventory.isFull() ? BotState.BANKING : BotState.PICKING_CABAGE; } private boolean dismissRandom() { for (NPC npc : npcs.getAll()) { if (npc == null || npc.getInteracting() == null || npc.getInteracting() != myPlayer()) { continue; } if (npc.hasAction("Dismiss")) { npc.interact("Dismiss"); randomsDismissed++; return true; } } return false; } public void antiBanMode() throws InterruptedException { camera.movePitch(random(0, getState() == BotState.PICKING_CABAGE ? 360 : 0)); sleep(random(500, 900)); camera.moveYaw(random(0, getState() == BotState.PICKING_CABAGE ? 360 : 0)); sleep(random(500, 900)); int randomTabs = random(0, 125); if (getState() == BotState.PICKING_CABAGE) { switch (randomTabs) { case 0: getTabs().open(Tab.EMOTES); break; case 1: getTabs().open(Tab.ATTACK); break; case 2: getTabs().open(Tab.FRIENDS); break; case 3: getTabs().open(Tab.CLANCHAT); break; case 4: getTabs().open(Tab.EQUIPMENT); break; case 5: getTabs().open(Tab.IGNORES); break; case 6: getTabs().open(Tab.INVENTORY); break; case 7: getTabs().open(Tab.LOGOUT); break; case 8: getTabs().open(Tab.PRAYER); break; case 9: getTabs().open(Tab.SKILLS); break; case 10: getTabs().open(Tab.MAGIC); break; } return; } } public void bank() throws InterruptedException{ openBank(); depositBank(); closeBank(); } public void openBank() throws InterruptedException{ NPC closestBanker = getNpcs().closest("Banker"); Entity closestBankBooth = objects.closest(6943); if(!bank.isOpen()){ int randomChoice = random(3); if (randomChoice == 1){ closestBankBooth.interact("Bank"); }else{ closestBanker.interact("Bank"); } sleep(random(1500,5000)); log("opening bank"); } } public void depositBank() throws InterruptedException { if (bank.isOpen()) { bank.depositAllExcept("Coins"); sleep(random(400, 750)); banked++; } log("Depositing"); } public void closeBank() { if (bank.isOpen()) bank.close(); log("Closing bank"); } @[member='Override'] public int onLoop() throws InterruptedException { antiBanMode(); int runRNG = random(5); if (runRNG == 1) { getSettings().setRunning(getSettings().getRunEnergy() < 25 ? false : true); } if(dismissRandom()) { sleep(random(600, 800)); while(myPlayer().isMoving()) { sleep(600); } } switch (getState()) { case PICKING_CABAGE: if (!myPlayer().isAnimating()) { Entity cabbage = objects.closest("Cabbage"); if (cabbage != null) { cabbage.interact("Pick"); sleep(1_100); if (myPlayer().getX() == cabbage.getX()) cabbage_taken++; } } break; case BANKING: while (!inventory.isEmpty()) { getWalking().webWalk(bankArea); bank(); } if (inventory.isEmpty()) { getWalking().webWalk(cabbagePos); } break; } return random(200, 300); } @[member='Override'] public void onExit() { } @[member='Override'] public void onPaint(Graphics2D g) { drawMouse(g); Font font = new Font("TimesRoman", Font.PLAIN, 14); g.setFont(font); g.setColor(Color.WHITE); g.drawString("Cabage Patch Kid script created by: Booleans Yay", 5, 40); g.drawString("Cabbage Patch Kid v1.1", 5, 55); g.drawString("Cabbage Gathered: " + cabbage_taken, 5, 85); g.drawString("Inventories Banked: " + banked, 5, 100); long runTime = System.currentTimeMillis() - timeStarting; g.drawString("Script Runtime: " + formatTime(runTime), 5, 115); g.drawString("Random Events Skipped: " + randomsDismissed, 5, 130); g.drawString("Mouse X/Y: " + mouse.getPosition().x + " " + mouse.getPosition().y, 5, 145); g.drawString("Player Running: " + settings.isRunning() + (" (Energy: " + settings.getRunEnergy() +")"), 5, 160); g.drawString("88888888888", 10, 470); } public void drawMouse(Graphics g) { ((Graphics2D) g).setRenderingHints( new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); Point p = mouse.getPosition(); Graphics2D spinG = (Graphics2D) g.create(); Graphics2D spinGRev = (Graphics2D) g.create(); spinG.setColor(new Color(255, 255, 255)); spinGRev.setColor(Color.cyan); spinG.rotate(System.currentTimeMillis() % 2000d / 2000d * (360d) * 2 * Math.PI / 180.0, p.x, p.y); spinGRev.rotate(System.currentTimeMillis() % 2000d / 2000d * (-360d) * 2 * Math.PI / 180.0, p.x, p.y); final int outerSize = 20; final int innerSize = 12; spinG.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); spinGRev.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize, outerSize, 100, 75); spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize, outerSize, -100, 75); spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2), innerSize, innerSize, 100, 75); spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2), innerSize, innerSize, -100, 75); } public final String formatTime(final long ms) { long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24; s %= 60; m %= 60; h %= 24; return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s) : h > 0 ? String.format("%02d:%02d:%02d", h, m, s) : String.format("%02d:%02d", m, s); } }
  5. So this is my function for picking up case LOOTING_BONES: if (!myPlayer().isAnimating()) { GroundItem bone = groundItems.closest("bones"); if (bone != null) { bone.interact("Take"); sleep(random(900)); new ConditionalSleep(2_000) { @[member=Override] public boolean condition() throws InterruptedException { return inventory.getItem("bones").getAmount() > currentBonerCount; } }.sleep(); } } break; g.drawString("Bones Collected: " + currentBonerCount, 5, 55); Script doesn't startup
  6. Thanks for all the welcoming guys See you in chatbox, or wherever else!
  7. This script isn't utilizing the Banking option. Function of script is according: Find local Bone (random tile based due to location demo (Chaos Temple)) Pickup local bone Fill inventory Begin bury process Repeat Side note: I got my goal of 43 prayer, thanks me! XD
  8. Hello guys, my real name is Dennis. I'm a programmer by day, night, sleep, whenever else. Kidding I do program Java though in an intermediate level; still learning as I go along. I honestly was pretty bored doing Java RSPS, so I decided to look into creating my first script for a bot. I had remembered that OSBot had an API, which then I could easily make scripts which i'm doing right now actually. I'm working on my first script which you can find the link in the description! Anyways, I hope to learn more about this API, and hope to communicate and learn within this community! Any questions feel free to ask i'm always willing to chat mostly! - Dennis/Booleans Yay Side note: if admin could capitalize my username accordingly so as seen above TY!
  9. Well, it's just simply based on how many bones collected, if I had died it'd be less score than burried. Honestly i'm a little tempted to remove it based on redundancy and to save time. Side note to anyone who knows, does anyone know how to request a script for review to got to SDN? for future references I mean cause I still want to work and clean up before I give a request. Thanks!
  10. I was aware of the ++ but was lazy way, anyways. This is my function code for picking up bones, i'm picking them up in random tile locations so pin pointing a timer would be hard due to bones being further away, if it was simple as banking and burying then I wouldn't really have this issue what so ever; but because of random tile distances for the ground items Bones not sure if putting a timer is the right thing to do. Maybe create an event per pickup, if the bone == null then ++ ? i'm not too sure exactly what code should be done to fix this sort of issue regarding my OP.
  11. increment of bones collected (currently +=1; when clicking the ground item, clicks more than once sometimes so I need to figure out when the player collects the bone to inventory to increment then(any tips that'd be great!).
  12. Anyone know how to enable the running widget? Tried a few different ways but non actually worked. Thanks!
  13. i'm calling it correctly but still not showing up. g.drawString("Experience p/HR: " + skillTracker.getGainedXPPerHour(Skill.PRAYER), 5, 160); g.drawString("Next Level up in: " + skillTracker.getTimeToLevel(Skill.PRAYER), 5, 175); Fixed* by reverting back to the api code i did before using this released version; thanks for posting anyways.
  14. I tried the usages and no errors, but the strings doesn't print out for some reason. Any help on how to fix this?
  15. Thanks for the usage. I've updated since. And reading other threads for ideas and usages to improve myself further! Hopefully when I'm finished this, it will be available in the SDN or repo for the free scripts.
  16. Thanks, could you tell me the calling to implement it please? Also why is this moved to "Help"? This code is fully functional; just needed input/advice..
  17. It's a basic short and simple system. I'm learning the API so please if you have any additional ideas and things to add or guides or anything I can use to better myself and my scripts please PM me or reply here!! Script Features: Camera Movement Picks up full inventory of Bones to bury Hoping to add more! Jar: https://mega.nz/#!1R11TTjJ!WkjkMtG6EU-c-k0StJGnVVLgA4nIUiGP1xP4tTJwBnM Raw: https://paste.ee/p/2ZRLP package main.script; import java.awt.Graphics2D; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Booleans Yay", info = "Bone burying made ez pz", name = "Bone Bury", version = 1, logo = "") public class BoneBury extends Script { @[member='Override'] public void onStart(){} private enum BotState { PICKUP, BURY }; private BotState getState() { return inventory.isFull() ? BotState.BURY : BotState.PICKUP; } @[member='Override'] public int onLoop() throws InterruptedException { switch (getState()) { case PICKUP: if (!myPlayer().isAnimating()) { GroundItem bone = groundItems.closest("Bones"); if (bone != null) { bone.interact("Take"); Thread.sleep(random(1500)); } } break; case BURY: camera.moveYaw(random(360)); while (!inventory.isEmpty()) { Item bones = inventory.getItem("Bones"); if (bones != null) { bones.interact("Bury"); if (myPlayer().isAnimating()) { bones.interact("Bury"); Thread.sleep(random(200)); } } } break; } return random(200, 300); } @[member='Override'] public void onExit(){} @[member='Override'] public void onPaint(Graphics2D g){} }
×
×
  • Create New...