Skip 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.

How do i combo eat?

Featured Replies

Hi how can i make my character combo eat swordfish and pizza?
private String food ="Swordfish";
private String food2 ="Anchovy Pizza";

if (myPlayer().getHealthPercent()== 100)

    if (getInventory().contains(food,food2)) {
        log("Contains" + food + food2);
    }
        if (getInventory().interact("Eat",food,food2));{
        log("Eating Swordfish and Pizza");
        }

 

when i use this code it will only eat food2

 

i have been thinking about isAnimating since animation each has its own id, i.e; eating has a id of 829

but since its a boolean type it will not differentiate between id values and only return true or false for any animation made?

 

i now want check for; if swordfish has been eaten/interacted with then eats pizza just learned java a few hours ago still trying to figure out how to write the code for this

 

could someone push me in the right direction

 

thanks in advance

getInventory().contains(item1, item2)

Returns true if either item1 or item2 is in the inventory.

getInventory().interact("Eat", item1, item2)

Uses the interaction "Eat" on either item1 or item2 depending on which item it finds in the inventory first.

If you want to eat a Swordfish followed by a Pizza, you need to be explicit in your logic, i.e

If not eaten swordfish

    Then eat swordfish

Else 

    Eat pizza

 

To track whether you have eaten a swordfish, just store a boolean value in a variable, e.g. hasEatenSwordfish, and set it to true when the "Eat" interaction on the swordfish is successful. Set it back to false when you eat the pizza

 

  • Author
13 hours ago, Explv said:

getInventory().contains(item1, item2)

Returns true if either item1 or item2 is in the inventory.

getInventory().interact("Eat", item1, item2)

Uses the interaction "Eat" on either item1 or item2 depending on which item it finds in the inventory first.

If you want to eat a Swordfish followed by a Pizza, you need to be explicit in your logic, i.e

If not eaten swordfish

    Then eat swordfish

Else 

    Eat pizza

 

To track whether you have eaten a swordfish, just store a boolean value in a variable, e.g. hasEatenSwordfish, and set it to true when the "Eat" interaction on the swordfish is successful. Set it back to false when you eat the pizza

 

omg didnt think about storing values like that ! i can see that this will open alot of things in my coding
Thank you so much

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.