Jump to content

My First Script HELP


Toxic

Recommended Posts

Well, I really didn't want to ask for help and try to figure this out myself but...I just don't understand why my script is not running. I click start and it just stands there by the jug...:/

If anyone can help and explain too me how to fix this to make it take the Jug in lumbridge kitchen and then drop and wait....please I would love you.

Here is my Code

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 2/4/2018 at 11:41 PM, HeyImJamie said:

It's possible the RS2Object call within your getState method is stopping it from running. Try with the script logged in. If that fixes it you could add a while loop to your onStart method that waits for the script to be logged in before your getState method is called :) 

Expand  

I am already logged in while starting the script and it does nothing still.

Link to comment
Share on other sites

  On 2/5/2018 at 4:56 AM, Prozen said:

You're trying to grab the nearest Object, when jugs are grounditems. use getGroundItems().closest() as I use in the example.

 

GroundItem jug = getGroundItems().closest("Jug");

if(jug != null && jug.exists() && jug.interact("Take")) {

// Interaction successful - sleep here

}

Expand  

Got it, Thank you :D

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