Jump to content

Script acting weird?


Recommended Posts

Posted

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.

Posted

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

Posted

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

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