Jump to content

Script acting weird?


INFERN0

Recommended Posts

i made a draynor chopper and all of a sudden now its acting up i might have changed something by mistake, it will leave the draynor bank then go chop and when inventory is full instead of going back to the bank it will go on its own random path can someone fix it and post pastebin link now aware of what i did to the walking paths.


 


http://pastebin.com/mHqmRkPb


Link to comment
Share on other sites

So i should replace the private position with local walker and keep the coordinates and it will be fine?

In my oppinion, you have a lot of code that really doesn't need to be there. In like 30 lines of code you could write a willow script that will run away when attacked, only cut willows, bank them, and walk back. (Okay maybe not 30 lines) and it would be a lot simpler than this. Mainly just if statements and osbot API.

Link to comment
Share on other sites

In my oppinion, you have a lot of code that really doesn't need to be there. In like 30 lines of code you could write a willow script that will run away when attacked, only cut willows, bank them, and walk back. (Okay maybe not 30 lines) and it would be a lot simpler than this. Mainly just if statements and osbot API.

Give me an example of this so i can get a peep like i said i am nre and just delt with what i was handed maybe if you could write a simple willow script that i could look at that would be awesome

Link to comment
Share on other sites

Give me an example of this so i can get a peep like i said i am nre and just delt with what i was handed maybe if you could write a simple willow script that i could look at that would be awesome

I'm on mobile so it won't be in code format.

(Pretend cases are already defined and what not up here)

case CHOP:

If(willow!=null&&!inventory.isFull())

willow.interact("Chop down");

//I have a timer I can give you when I get home so it won't constantly keep clicking the tree

break;

case BANK:

if(inventory.isFull()&&BANK_AREA.contains(myPlayer())

//banking goes here, I have the bank snippet I can give you as well

break;

case WALK_TO_WILLOWS:

if(BANK_AREA.contains(myPlayer()&&!inventory.isFull())

localWalker.walkPath(TO_WILLOWS);

break;

case WALK_TO_BANK:

if(inventory.isFull()&&WILLOW_AREA.contains(myPlayer())

localWalker.walkPath(TO_BANK);

break;

case UNDERATTACK:

If(myPlayer().isUnderAttack())

localWalker.walkPath(TO_BANK);

//have this be the very first state to be returned, so it trumps everything

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