Jump to content

Anyone wanna help a nub ?


Rylad

Recommended Posts

hey guys, ive decided its about time i start making a script, i decided to make a flesh crawler killer, my idea was to have it go from edgville bank, down to the SHOS, get to the crawlers, eat, kill and possibly loot aswell ahah but yeah, my first wall ive hit is how do i check my player health and interact with my inventory to find and eat the food

 

 

 

a simple link to a relevant tutorial would be good enough

 

please no hate

please no " i cant help sorry " thats spam

 

 

 

if i end up getting this good enough to slap a price on it ill even offer the person that helps a few £

 

 

im doing this for RS07 nor RS2 btw

Link to comment
Share on other sites

well, ive fucked about so much with it, this is how its ended up, not working of course, not even making sence

 

{
int Hitpoints = getSkills().getDynamic(Skill.HITPOINTS);
}
{
boolean Eat = getInventory().getItem("Trout").interact("Eat");
}
 
void Eat() {
   // the "if" clause: bicycle must be moving
   if (Hitpoints > 10){ 
 
 
EDIT
 
now changed to 
 
{
if((getSkills().getDynamic(Skill.HITPOINTS)) >> 10);
}
 
 
 
but i got my old enemy line again " cannot convert from int to boolean
 
 
 
help

 

Edited by Rylad
Link to comment
Share on other sites

well, ive fucked about so much with it, this is how its ended up, not working of course, not even making sence

{

int Hitpoints = getSkills().getDynamic(Skill.HITPOINTS);

}

{

boolean Eat = getInventory().getItem("Trout").interact("Eat");

}

void Eat() {

// the "if" clause: bicycle must be moving

if (Hitpoints > 10){

EDIT

now changed to

{

if((getSkills().getDynamic(Skill.HITPOINTS)) >> 10);

}

but i got my old enemy line again " cannot convert from int to boolean

help

>> is a bitshift operation, > is the greater than comparison. When you do # > #, it will return true or false (a boolean). if you do # >> #, it will return an int. If statements require booleans. Edited by fixthissite
Link to comment
Share on other sites

>> is a bitshift operation, > is the greater than comparison. When you do # > #, it will return true or false (a boolean). if you do # >> #, it will return an int. If statements require booleans.

 

 

ok ive got most of it sorted now

 

 

my only problem is

 

 

{
if((getSkills().getDynamic(Skill.HITPOINTS)) < 20);
getInventory().getItem("Trout").interact("Eat");
 
   }
 
 
 
it just eats trout over and over no matter what the hp is
Link to comment
Share on other sites

ok ive got most of it sorted now

my only problem is

{

if((getSkills().getDynamic(Skill.HITPOINTS)) < 20);

getInventory().getItem("Trout").interact("Eat");

}

it just eats trout over and over no matter what the hp is

Thats because you ended your if statement with a ;, rather than opened it up with a { } to contain the trout eating code.

You are doing

if(...);
Eat

you should be doing

if(...) {
    Eat
}
Edited by fixthissite
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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