Jump to content

My Script won't start?


Recommended Posts

Posted

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

Posted (edited)

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
Posted

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

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