Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Kawaii_s

Members
  • Joined

  • Last visited

Everything posted by Kawaii_s

  1. @Fruity This helps me out so much!!! Thank you
  2. Hello. I'm trying to write a fully functional cwars script, and have it actually defend the flag and run after players. I need it to read all the equipped items of nearby players into a list and iterate through until it finds the one holding the flag, it then needs to grab what gear they are wearing to attack using the combat triangle. I'm not quite sure how to read the gear of other players, because it's different than reading your own gear. I spent a lot of time reading the API, but can't find any way of possibly doing this. I was wondering if this is something that can be done with OSbots API and if anyone has any examples/hints of how to do this. What I'm trying to do is something like this, however this code is invalid and halts execution of the client.. for(final Player player : getPlayers().getAll()) { if(player.getMethods().getEquipment().getItemInSlot(EquipmentSlot.WEAPON.slot).getName().contains("flag")) { //interact and attack player } }
  3. Got everything working, not sure what the problem with the method to get percent hitpoints, but found that using the depricated methods works for my case. Are the depricated methods considered unsafe for bot detection or just aren't really used anymore? Nevertheless, the code I used is as follows.. while(!(starting_area.contains(myPlayer()))) { walkToStart(); if(gui.getFood() != null) inventory.getItem(new String(gui.getFood())).interact("Eat"); } private void walkToStart() throws InterruptedException { WebWalkEvent to_start = new WebWalkEvent(starting_area); to_start.setBreakCondition(new Condition() { @Override public boolean evaluate() { return (getHealthPercentB() <= 0.60); } }); getWalking().execute(to_start); }
  4. You're right. My fix helped fix the issue of when I was idle, my script would tell me that I was 100% hp, when I was not.
  5. Seems that I've found a current fix using deprecated methods, thanks for your help private double getHealthPercentB() { return (double)myPlayer().getCurrentHealth() / (double)myPlayer().getMaximumHealth(); } while(myPlayer().isMoving()) { if(getHealthPercentB() <= 0.6) { if(gui.getFood() != null) inventory.getItem(new String(gui.getFood())).interact("Eat"); } sleep(random(100, 200)); }
  6. I can try that, but I'm not sure why it would work if it does. log(myPlayer().getHealthPercent()) gives me an output of 100, so we would be sending into the if statement (false && true && true)
  7. Kawaii_s posted a topic in Archive
    Hello, during deathwalking I am trying to enable eating in my script, the code is as follows... while(myPlayer().isMoving()) { if(myPlayer().getHealthPercent() < 60) { if(getFood() != null) inventory.getItem(new String(getFood())).interact("Eat"); } sleep(random(100, 200)); } This seems like it should work, but the problem is that it is never eating. I tried some basic debugging of the script and decided to log the output from the getHealthPercent function and it is always returning 100. When my hitpoints are 8/38 it says that my health percent is 100 and therefore does not eat.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.