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.

foodid healing values

Featured Replies

private int getFoodHeal(int food) {
      int val = 0;
      switch (food) {
         case 6701: // baked potato
            val = 4;
            break;
         case 2309: // bread
            val = 5;
            break;
         case 333:
         case 2289: // plain pizza
         case 2291: // half plain pizza
            val = 7; // trout
            break;
         case 351: // pike
         case 2293: // meat pizza
         case 2295: // half meat pizza
         case 2297: // anchovy pizza
         case 2299: // half anchovy pizza
            val = 8;
            break;
         case 329: // salmon
            val = 9;
            break;
         case 361:
            val = 10; // tuna
            break;
         case 1993: // wine
         case 2301: // pineapple pizza
         case 2303: // half pineapple pizza
            val = 11;
            break;
         case 379:
            val = 12; // lobster
            break;
         case 365: // bass
            val = 13;
            break;
         case 373: // swordfish
         case 6703: // Potato with butter
         case 7054: // chilli potato
            val = 14;
            break;
         case 6705: // potato with cheese
         case 7496: // monkfish
            val = 16;
            break;
         case 385: // shark
         case 7058: // Mushroom potato
            val = 20;
            break;
         case 7060: //tuna potato
            val = 22;
            break;
         default:
            val = 7;
            break;
      
      }
      return val;
   }

thought this would be useful to others

So this heals certain foods?

haha thx for sharing this with. Always cool to see people working to make everything easier and better! ^^

 

btw why is defaul val 7? xD you should return 0 or -1 to let it know it didn't find the food xD

H0ppy

Edited by H0ppy

  • Author

haha thx for sharing this with. Always cool to see people working to make everything easier and better! ^^

 

btw why is defaul val 7? xD you should return 0 or -1 to let it know it didn't find the food xD

H0ppy

 

default value is 7 incase it's an unknown food type.  If it returned 0, your script could possibly eat everything in your inventory 

So this heals certain foods?

 

getDogFood();

 

get food for dog

 

getFoodHeal();

 

get heal for food

Would be better to use an enum for this.

just what i was thinking of. he could then loop through them check if he id entered = to enumname.getId or something the return value. simpler and cleaner

  • Author

just what i was thinking of. he could then loop through them check if he id entered = to enumname.getId or something the return value. simpler and cleaner

You guys are making this way harder than it needs to be.  There's a reason comments exist

You guys are making this way harder than it needs to be.  There's a reason comments exist

the way it is now is fine and there is no problem with it but just kinda messy. and enum are not hard and it was just a suggestion you dont have to use it. happy.png

  

public enum food{

  
TUNA("Tuna", 10, 361),
BREAD("Bread", 5, 2309);


food(String name, int value, int id){



this.name = name;



this.value = value;



this.id = id;



}


private String name;



private int value;



private int id;


/*Name of the item*/



public String toString(){



return name;



}



/*gets the id of the food item*/



public int getId(){



return id;



}



/*get the healing value of the food item*/



public int getValue(){



return value;



}


}



public int getHealValue(int id){

for(food f : food.values()){

if(f.getId() == id) return f.getValue();

}

return -1;

}


public int getFoodHealValue(String name){
for(food f : food.values()){
if(f.toString().equalsIgnoreCase(name)) return f.getValue();

}
return -1;
}



simple and less messy? and sorry if i got somethings wrong

as i said just an example dont have to use it.

Edited by Cyro

Guest
This topic is now closed to further replies.

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.