Jump to content

Help me with this, please!


Recommended Posts

Posted

Hi there. I ve got a raw script. but i dont know how to run it. Maybe i need to compile it? Could somebody help me with that?

heres script (prayer potion drinker. i ve just copied it from the forum :D)

public void drinkPotion() throws InterruptedException {
if (containsPotion() == true) {
if (client.getSkills().getCurrentLevel(Skill.PRAYER) <= 12) {
for (int i = 0; i < 4; i++) {
if (client.getInventory().interactWithName(
"Prayer potion(" + i + ")", "Drink")) {
sleep(random(600, 900));
}
}
}
}
}
 
public boolean containsPotion() {
for (int i = 0; i < 4; i++) {
if (client.getInventory().contains("Prayer potion(" + i + ")")) {
return true;
}
}
return false;
}  
Posted

 

Hi there. I ve got a raw script. but i dont know how to run it. Maybe i need to compile it? Could somebody help me with that?

heres script (prayer potion drinker. i ve just copied it from the forum biggrin.png)

public void drinkPotion() throws InterruptedException {
if (containsPotion() == true) {
if (client.getSkills().getCurrentLevel(Skill.PRAYER) <= 12) {
for (int i = 0; i < 4; i++) {
if (client.getInventory().interactWithName(
"Prayer potion(" + i + ")", "Drink")) {
sleep(random(600, 900));
}
}
}
}
}
 
public boolean containsPotion() {
for (int i = 0; i < 4; i++) {
if (client.getInventory().contains("Prayer potion(" + i + ")")) {
return true;
}
}
return false;
}  

 

you need to put that into the onLoop of the script skeleton then compile it. But I didn't take the time to go through and see if that actually works.

 

is it hard to learn the OSBOT API?

No, it should only take an afternoon. Learning what you can do with it though takes a lot longer.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...