September 12, 201510 yr 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
September 12, 201510 yr getSkills().getDynamic(Skill.HITPOINTS) getInventory().getItem("Food_Name").interact("Eat") Use the api docs.
September 12, 201510 yr Author getSkills().getDynamic(Skill.HITPOINTS) getInventory().getItem("Food_Name").interact("Eat") Use the api docs. i have been on that line for over an hour, the bit i dont understand is how to say for example if hp is below 5 all i can do is get hp
September 12, 201510 yr i have been on that line for over an hour, the bit i dont understand is how to say for example if hp is below 5 all i can do is get hp You should look into control flow statements (https://docs.oracle.com/javase/tutorial/java/nutsandbolts/flow.html)
September 12, 201510 yr Author 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 September 12, 201510 yr by Rylad
September 12, 201510 yr i have been on that line for over an hour, the bit i dont understand is how to say for example if hp is below 5 all i can do is get hp getSkills().getDynamic(Skill.HITPOINTS) < 5 lol
September 12, 201510 yr 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 September 12, 201510 yr by fixthissite
September 12, 201510 yr Author >> 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
September 12, 201510 yr 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 September 12, 201510 yr by fixthissite
Create an account or sign in to comment