Jump to content

My Script won't start?


Dab in a Lab

Recommended Posts

Been having trouble trying to get my script to run the past few hours. It was working fine yesterday and earlier today. 

Does anyone know a potential cause for this? Is it the code? This is my first script and it was quickly getting messy, so I started over. Is the two failed things in the logger important? What causes them not to load? I wasn't getting that error earlier.

https://gyazo.com/f625440b253168a7ddf937d95075ae6b

In case it is the code that's causing it, here's the source code, its not finished yet. Any feedback would be appreciated since this is my first script.

https://github.com/Dab-in-a-Lab/Wilderness-Looter/blob/master/Wilderness Looter Source Code

Link to comment
Share on other sites

put   RS2Object ditch = getObjects().closest("Wilderness Ditch");   and   GroundItem items = getGroundItems().closest(getDirectoryData() + getName() + File.separator + "osrs items.txt");

in your onloop. You shouldn't define RS2objects and Grounditems outside of your onloop this is causing your problem. Also i believe interactionevents need to be in your onloop since once there executed they expire (get the status finished) so they have to be created every loop (i could be wrong here) .

 

 

 

Edited by zwaffel
  • Like 1
Link to comment
Share on other sites

I think it's because you're initialising your variables at the same time as your declaring them.

Also I think there is a problem here: 

if (!getInventory().isFull()) ;{
  getWalking().webWalk(Wilderness);
  if (getWalking().webWalk(Wilderness))

Unless I'm missing what you're trying to do you should haven't a semi-colon after the first line, it should probably look more like this

if (!getInventory().isFull()) {

     if (!myPlayer().getPosition().equals(Wilderness)) {

          if (getWalking().webWalk(Wilderness) {

//conditional sleep until myPlayer().getPosition().equals(Wilderness)

          }

     }

     else {

          //loot

     } 

}

  • Like 1
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...