Jump to content

Oak Doors [Looking for feedback]


Imthabawse

Recommended Posts

Re-made an Oak-door's script that I whipped up awhile back. Looking for feedback on the code of ways I can improve it. Still need to add an option to stop script either after bank doesn't contain Oak planks or based on message that Butler says when you run out of Oak planks to build. Would also like to add random checking of EXP widget when you gain EXP in skill. 

 

Id also like to add that when I write a script I don't make it with the intentions of running it and leaving it. I baby sit my bot whilst watching Youtube/pornhub(jk) 😉 or whatever I may be doing. Not saying you can't walk away for a bit while scripts running but wouldn't let it run for hours un-attended. 

74-83 Construction achieved so far 

Features

- Build's and Remove's Oak doors in player owned basement

- Interacts with Butler to fetch planks from bank (Must be Demon butler)

- Moves mouse outside screen while waiting on Butler to return

- Basic informative paint

To run script

- Have client on "Fixed mode"

- Have Oak planks in bank

- Interact with Butler prior to running and have him set to fetch 20x Oak planks from bank

- Saw, Hammer, Nails in inventory

- Be in player owned basement (Build mode ON)

- Butler in basement with you

- level 74 Construction (Obviously)

- Have Servant's money bag with at least 100k in it (Demon-butler takes 10k every 8 trips, keep this in mind)

 

Code

  Reveal hidden contents

 

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

You haven't been using conditionals in the right way at all.

// WRONG 
talkToButler();
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return fetchPlanksWidget();
                }
            }.sleep();

// RIGHT
if(talkToButler()){
   new ConditionalSleep(5000) {
      @Override
       public boolean condition() {
          return fetchPlanksWidget();
       }
   }.sleep();
}

 

The conditonalSleep should be triggered if the "talkToButler" action is true.

  • Like 1
Link to comment
Share on other sites

  On 4/25/2019 at 7:06 PM, dreameo said:

You haven't been using conditionals in the right way at all.

// WRONG 
talkToButler();
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return fetchPlanksWidget();
                }
            }.sleep();

// RIGHT
if(talkToButler()){
   new ConditionalSleep(5000) {
      @Override
       public boolean condition() {
          return fetchPlanksWidget();
       }
   }.sleep();
}

 

The conditonalSleep should be triggered if the "talkToButler" action is true.

Expand  

Thank you @dreameo so all of my Conditionals are wrong? ðŸ˜ž 

This is my first time using booleans like this so I expected mistakes lol. Appreciate your feedback nonetheless!

* Edited above code 

Edited by Imthabawse
Link to comment
Share on other sites

  On 4/25/2019 at 7:51 PM, Imthabawse said:

Thank you @dreameo so all of my Conditionals are wrong? ðŸ˜ž 

This is my first time using booleans like this so I expected mistakes lol. Appreciate your feedback nonetheless!

* Edited above code 

Expand  

Notice how most of the actions are booleans? They return true if the action occured and false if the action failed. You only want to do a conditional sleep if an action occurs. So for example if you interact and fail, you will wait for 5 seconds because of the timeout. On the other hand, if you use the conditionals right, if you fail an interact, you wont wait those 5 seconds.

  • Like 1
Link to comment
Share on other sites

@dreameo So would something like this work correctly? The script works okay but not sure if my code is being executed in the right way. 

What the below code means to me is if my inventory has less than 10 planks and door doesnt exist and yes widget doesnt exist then we talk to butler? If talked to butler sleep 5 seconds or until fetch widget exists? Or is this skipping all the other checks and just talking to butler?

Appreciate all your help  :)

if (getInventory().getAmount("Oak plank") < 10 && door == null && yesFetch == null && talkToButler()) {
            log("Talking to Butler..");
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() {
                    return fetchPlanksWidget();
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...