Jump to content
×
×
  • Create New...

[On Hold - FEB] Maddox Script Writer Application V2


Maddox
 Share

Recommended Posts

Today I'm glad to reapply, with the requested script from @Dan, BlackJack script using TBL Structure, I'm also glad to say the source will stay Open-Source, for the rest of the people wanting to learn to write scripts, and Use this script for future ideas for them to make. and to all of the people just starting to learn. On that note, Any and all advice is taken into strong consideration. And any tips are greatly appreciated.

Script functions: Interface option, set hp percentage to eat at, Luring bandit, Restocking, Escaping if in combat during pickpocketing.

 

Updated: 
 

Added additional options for thugs, such as lower and higher level ones, Added menaphite house and escape route.

Added a more secure way of escaping to escape faster than before, added a few more checks for routes.

 

 

Progress report - 5 hour(lowest level bandit):
cjckme7.png

Progress report - 2 hour: 

uIeZsnX.png


Github Repo:  MaddoxOSRS/BlackJack

Edited by Maddox
Link to post
Share on other sites

  • Moderators

Nicely done with the comeback on my challenge.

Firstly, you don't need to upload the client jars to your repo in libs, I'd probably look to remove those quickly.

This is probably going to be a long section of feedback so I'll try and break it up into sections.

 

General Feedback

Naming conventions; you seem to not have any. Try looking for some information on Camel Case. You have some constants in all caps, you have some in all lower case, some in a mix of half caps half not, some in camel case. 

Use of magic numbers; for example on the link below, you refer to id(1993) but there's no indication as to what 1993 is. This should be properly defined as WINE_ID = 1993; and then you can pass that variable to all the places where you reference 1993. If the ID were to change, you'd need to go and replace all instances of 1993. If you were to support more food than just wines you need to replace all instances of 1993. etc etc.
https://github.com/MaddoxOSRS/BlackJack/blob/15e5747b099bba85cb61192c3c46a82642889884/src/io/maddox/behaviour/Eating/ActivateEat.java#L13

https://github.com/MaddoxOSRS/BlackJack/blob/366b916bf5550cf6bc37079279c38d7147fadfcc/src/io/maddox/behaviour/Restocking/Leaves/Restock.java#L22
Lines 22 to 29, 8 lines of code, and as many magic numbers.. Nobody knows what those numbers are or mean and if you come back to this task to try and resolve a user issue, you're going to have a hard time figuring it all out.

TBL Structure; I don't think you've quite grasped the concept of a tree branch leaf structure as you've converted it into a task structure. What I mean by this is each of your branches only has 1 leaf, meaning you've taken the activate() exectute() structure from a task framework and applied it here. For example your eat branch has the validation as your eat leaf. A tree has many branches, branches have many leaves. For example a combat script might have a branch called "Combat". Inside this combat branch there will be multiple leaves, "AttackTarget", "Heal", "Potions". All of these would share the same combat branch validation but their individual leaf validations differ.

To relate it to your script more, you have an eat branch which checks your hp < configured hp but it also checks if your wines are empty. When really, wines being empty is a leaf validation, not a branch validation. So if you removed the wine check from your branch validation, you could move restocking into your eat branch. Branch returns true and you need to eat, if wines no empty, eat leaf runs, else restock leaf runs.

 

Conditional VS Static Waits

https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/Eating/Leaves/Eat.java#L22
Waiting/sleeping is one of those things that people seem to always brush over when looking at the logic of their tasks. In reality what we're trying to do is write a program to complete actions as a human would. So when you ask it to eat food and to sleep between 200-500ms you're assuming a human would do that.
When if you think about it, humans react visually, when you eat a piece of food, you confirm that you've done it as you can see it's done. You don't generate a random number and count ms in your head and then continue. There is also no validation whatsoever with a sleep().
I wrote a section on using waits in our docs which I'll link you below
https://docs.powbot.org/#/Fundamentals_In_Practice/UsingWaits

Seen another example here:
https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/KnockandPick/leaves/Pickpocket.java#L65
you're likely using 4-500ms as a tick timer, or somethigin which allows you to get another pickpocket in quickly, during your testing that 4-500ms probably worked given your connection and your ping, but there's no conditional which confirms it's able to do it again, using something like a conditional wait for xp drop for example at least confirms the user finished the first one and is able to go again.

 

Caching objects
https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/EscapeCombat/Leaves/Escape.java#L24

Here you cache 4 objects which have an inconsistent method of doing so, some using .at() some using .within() but that's not what I wanted to raise. 

If you're downstairs, on floor 0, the objects upstairs, on floor 1+ aren't loaded. Because they're not interactable, there's no point in loading them into the game. So you're loading 4 objects when only 1 of them is usable at any one time. I'm assuming here you have 2 locations where you can go up the stairs. Really you should utilise multiple leaves in your branch and separate this leaf into multiple. Then you only activate which ever leaf is applicable to the type of escape you need to do. This way, you only cache the object you need.

Accessing game data and streams take time and resources to do. Granted, because your queries are optimised, it doesn't take alot, but there's no need to be caching those 4 objects.
Another example is here
https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/KnockandPick/leaves/Pickpocket.java#L17
you cache the bandit and attacking bandit but then on line 19, you run the same stream again rather than using the one you just cached.

 

Modularisation

https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/KnockandPick/leaves/Pickpocket.java

For the most part, some of your leaves are nice and simple. They follow the rule of 1 responsibility. Your pickpocket leaf is a wild rollercoaster of different responsibilities and leaves. As I mentioned earlier, utilise multiple leaves per branch.

Pickpocket.java should NOT be responsible for opening curtains, dropping jugs, opening pouches, and knocking out.

IF and a big IF, all of those responsibilities share the same branch validation, then they can be moved into separate leaves under the KnockandPick Branch but SHOULD NOT all be bundled into the one leaf.

 

Use Of Waits

I'm not trying to repeat myself here, this is slightly different.
https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/KnockandPick/leaves/Pickpocket.java#L40
here you use a conditional wait. I'm not so sure the random int is needed as it's a reaction wait but either way lets for argument sake, take the highest possible wait of 750ms at 50 attempts. You're potentially waiting 37.5 seconds for you to be idle. 
That's a pretty long wait if you missclicked the curtain. In other classes, you check the return of .interact(x) to see if it was successfully interacted with, however here you don't and for a wait that long, you really should.

Conditional waits also return a boolean. It returns true if it early exits due to a true condition and if it times out and never hits a true condition, it returns false; checking the return value would be useful for things like this:
https://github.com/MaddoxOSRS/BlackJack/blob/366b916bf5550cf6bc37079279c38d7147fadfcc/src/io/maddox/behaviour/Restocking/Leaves/Restock.java#L48
you'll get stuck in a loop of failed to select the first item, selects the second item, then your selectedItem id != -1 and therefore you're stuck.

 

Chat API

Your lure.java is a complete mess, there's so much going on with interacting with the npcs, there's widgets everywhere accessing all kinds of different widgets looking for different strings. Have a look at the chat api in a bit more detail, you are using some aspects, but you'll probably find almost all of your widget usage here can be resolved by using the chat api better.

---------------------------------------------------------------------------------------------------

Overall it's nice to see you put forward your own script for review.

In summary there's a lot of general practices you need to work on, get to grips with what a TBL framework is and what it's used for AND how it differs to a task framework.
Keep working on your knowledge and understanding of the API and how to work out what the methods are and do.

You've sent me screenshots of the script running and working, now it's about keeping it working, making the code more optimised and a little more elegant and improving some of your general practices.

I'm not closing this application, but take some time to go through it and really understand what I've fedback on. When I say time, I don't mean tomorrow or monday, really take some time and If you need clarity then just message me and I'll point you in the right direction. 

Link to post
Share on other sites

10 hours ago, Dan said:

Nicely done with the comeback on my challenge.

Firstly, you don't need to upload the client jars to your repo in libs, I'd probably look to remove those quickly.

This is probably going to be a long section of feedback so I'll try and break it up into sections.

 

General Feedback

Naming conventions; you seem to not have any. Try looking for some information on Camel Case. You have some constants in all caps, you have some in all lower case, some in a mix of half caps half not, some in camel case. 

Use of magic numbers; for example on the link below, you refer to id(1993) but there's no indication as to what 1993 is. This should be properly defined as WINE_ID = 1993; and then you can pass that variable to all the places where you reference 1993. If the ID were to change, you'd need to go and replace all instances of 1993. If you were to support more food than just wines you need to replace all instances of 1993. etc etc.
https://github.com/MaddoxOSRS/BlackJack/blob/15e5747b099bba85cb61192c3c46a82642889884/src/io/maddox/behaviour/Eating/ActivateEat.java#L13

https://github.com/MaddoxOSRS/BlackJack/blob/366b916bf5550cf6bc37079279c38d7147fadfcc/src/io/maddox/behaviour/Restocking/Leaves/Restock.java#L22
Lines 22 to 29, 8 lines of code, and as many magic numbers.. Nobody knows what those numbers are or mean and if you come back to this task to try and resolve a user issue, you're going to have a hard time figuring it all out.

TBL Structure; I don't think you've quite grasped the concept of a tree branch leaf structure as you've converted it into a task structure. What I mean by this is each of your branches only has 1 leaf, meaning you've taken the activate() exectute() structure from a task framework and applied it here. For example your eat branch has the validation as your eat leaf. A tree has many branches, branches have many leaves. For example a combat script might have a branch called "Combat". Inside this combat branch there will be multiple leaves, "AttackTarget", "Heal", "Potions". All of these would share the same combat branch validation but their individual leaf validations differ.

To relate it to your script more, you have an eat branch which checks your hp < configured hp but it also checks if your wines are empty. When really, wines being empty is a leaf validation, not a branch validation. So if you removed the wine check from your branch validation, you could move restocking into your eat branch. Branch returns true and you need to eat, if wines no empty, eat leaf runs, else restock leaf runs.

 

Conditional VS Static Waits

https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/Eating/Leaves/Eat.java#L22
Waiting/sleeping is one of those things that people seem to always brush over when looking at the logic of their tasks. In reality what we're trying to do is write a program to complete actions as a human would. So when you ask it to eat food and to sleep between 200-500ms you're assuming a human would do that.
When if you think about it, humans react visually, when you eat a piece of food, you confirm that you've done it as you can see it's done. You don't generate a random number and count ms in your head and then continue. There is also no validation whatsoever with a sleep().
I wrote a section on using waits in our docs which I'll link you below
https://docs.powbot.org/#/Fundamentals_In_Practice/UsingWaits

Seen another example here:
https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/KnockandPick/leaves/Pickpocket.java#L65
you're likely using 4-500ms as a tick timer, or somethigin which allows you to get another pickpocket in quickly, during your testing that 4-500ms probably worked given your connection and your ping, but there's no conditional which confirms it's able to do it again, using something like a conditional wait for xp drop for example at least confirms the user finished the first one and is able to go again.

 

Caching objects
https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/EscapeCombat/Leaves/Escape.java#L24

Here you cache 4 objects which have an inconsistent method of doing so, some using .at() some using .within() but that's not what I wanted to raise. 

If you're downstairs, on floor 0, the objects upstairs, on floor 1+ aren't loaded. Because they're not interactable, there's no point in loading them into the game. So you're loading 4 objects when only 1 of them is usable at any one time. I'm assuming here you have 2 locations where you can go up the stairs. Really you should utilise multiple leaves in your branch and separate this leaf into multiple. Then you only activate which ever leaf is applicable to the type of escape you need to do. This way, you only cache the object you need.

Accessing game data and streams take time and resources to do. Granted, because your queries are optimised, it doesn't take alot, but there's no need to be caching those 4 objects.
Another example is here
https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/KnockandPick/leaves/Pickpocket.java#L17
you cache the bandit and attacking bandit but then on line 19, you run the same stream again rather than using the one you just cached.

 

Modularisation

https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/KnockandPick/leaves/Pickpocket.java

For the most part, some of your leaves are nice and simple. They follow the rule of 1 responsibility. Your pickpocket leaf is a wild rollercoaster of different responsibilities and leaves. As I mentioned earlier, utilise multiple leaves per branch.

Pickpocket.java should NOT be responsible for opening curtains, dropping jugs, opening pouches, and knocking out.

IF and a big IF, all of those responsibilities share the same branch validation, then they can be moved into separate leaves under the KnockandPick Branch but SHOULD NOT all be bundled into the one leaf.

 

Use Of Waits

I'm not trying to repeat myself here, this is slightly different.
https://github.com/MaddoxOSRS/BlackJack/blob/9f6cd7479737dbea73b5d5f4a2723e4dfbe78d3b/src/io/maddox/behaviour/KnockandPick/leaves/Pickpocket.java#L40
here you use a conditional wait. I'm not so sure the random int is needed as it's a reaction wait but either way lets for argument sake, take the highest possible wait of 750ms at 50 attempts. You're potentially waiting 37.5 seconds for you to be idle. 
That's a pretty long wait if you missclicked the curtain. In other classes, you check the return of .interact(x) to see if it was successfully interacted with, however here you don't and for a wait that long, you really should.

Conditional waits also return a boolean. It returns true if it early exits due to a true condition and if it times out and never hits a true condition, it returns false; checking the return value would be useful for things like this:
https://github.com/MaddoxOSRS/BlackJack/blob/366b916bf5550cf6bc37079279c38d7147fadfcc/src/io/maddox/behaviour/Restocking/Leaves/Restock.java#L48
you'll get stuck in a loop of failed to select the first item, selects the second item, then your selectedItem id != -1 and therefore you're stuck.

 

Chat API

Your lure.java is a complete mess, there's so much going on with interacting with the npcs, there's widgets everywhere accessing all kinds of different widgets looking for different strings. Have a look at the chat api in a bit more detail, you are using some aspects, but you'll probably find almost all of your widget usage here can be resolved by using the chat api better.

---------------------------------------------------------------------------------------------------

Overall it's nice to see you put forward your own script for review.

In summary there's a lot of general practices you need to work on, get to grips with what a TBL framework is and what it's used for AND how it differs to a task framework.
Keep working on your knowledge and understanding of the API and how to work out what the methods are and do.

You've sent me screenshots of the script running and working, now it's about keeping it working, making the code more optimised and a little more elegant and improving some of your general practices.

I'm not closing this application, but take some time to go through it and really understand what I've fedback on. When I say time, I don't mean tomorrow or monday, really take some time and If you need clarity then just message me and I'll point you in the right direction. 

Thank you for your feedback, Most of which is now applied. Not sure what all I have missed, but I will be reviewing it over again and again the next few days, If you or anyone else sees anything I do not, please let me know as it is greatly appreciated.

Link to post
Share on other sites

  • Moderators

You still don't need to upload the jar files fyi.

I know you've been sending a lot of stuff through on discord; good job on the updates; it's nice to see you making some progress.
I'll run through briefly all your tasks and comment any feedback.

https://github.com/MaddoxOSRS/BlackJack/blob/8c4e5482f1f8950c5d600a61bc2636b0c80a7817/src/io/maddox/behaviour/KnockandPick/leaves/Eat.java#L29
Why is this in your eat leaf? Opening coin pouches has absolutely nothing to do with eating.
Remember, 1 leaf 1 responsibility. This one here is responsible for both eating and opening coin pouches?

 

https://github.com/MaddoxOSRS/BlackJack/blob/dd68ec7ac5d83b4bdee6fc893d2f49eb5837fca8/src/io/maddox/behaviour/KnockandPick/leaves/KnockandPick.java#L49

This whole section doesn't make any sense; the last statement pickcount<=2 can never be false, it gets reset to 0 above and then you pick twice inside so it's literally never going to be false.
I also thought we had this conversation like 60 times about how structure your sleeps to get pickpocketing right? Pickpocket wait 570ms pickpocket creates an awfully obvious pattern.. Figure out how to use conditional waits here. Alternatively, look at a for loop for the pickpocketing.

 

https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/Luring/leaves/Lure.java
I already spoke about magic numbers in my previous review; this task is a bit of a cluster fuck of numbers everywhere. have a look at this page here and it explains a bit about what I'm refering to.
https://code-basics.com/languages/java/lessons/magic-numbers


https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/Luring/leaves/MoveintoHouse.java
This is an example of a nice concise simple leaf, 1 leaf, 1 responsibility. 👍

 

https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/Restocking/Leaves/Restock.java
The opposite to what I just said, this one needs splitting, too many responsibilities in this leaf. Opens the curtain, walks to the npc, interacts with the npc, also magic numbers floating everywhere too. 😞

 

You're making progress and it's nice to see. Just got to try and apply the feedback across the whole script rather than just the isolated parts I've pointed out. For example the magic numbers, I'm not going to link you to every magic number, that's on you to go and find and fix, and then realise why it's bad and then you learn from that.

This is why I said take some time to really learn from the feedback I've given you, rather than just fix the issues that I've pointed out. If you learn from the feedback you'll be able to use it going forwards. 👌

Link to post
Share on other sites

18 hours ago, Dan said:

You still don't need to upload the jar files fyi.

I know you've been sending a lot of stuff through on discord; good job on the updates; it's nice to see you making some progress.
I'll run through briefly all your tasks and comment any feedback.

https://github.com/MaddoxOSRS/BlackJack/blob/8c4e5482f1f8950c5d600a61bc2636b0c80a7817/src/io/maddox/behaviour/KnockandPick/leaves/Eat.java#L29
Why is this in your eat leaf? Opening coin pouches has absolutely nothing to do with eating.
Remember, 1 leaf 1 responsibility. This one here is responsible for both eating and opening coin pouches?

 

https://github.com/MaddoxOSRS/BlackJack/blob/dd68ec7ac5d83b4bdee6fc893d2f49eb5837fca8/src/io/maddox/behaviour/KnockandPick/leaves/KnockandPick.java#L49

This whole section doesn't make any sense; the last statement pickcount<=2 can never be false, it gets reset to 0 above and then you pick twice inside so it's literally never going to be false.
I also thought we had this conversation like 60 times about how structure your sleeps to get pickpocketing right? Pickpocket wait 570ms pickpocket creates an awfully obvious pattern.. Figure out how to use conditional waits here. Alternatively, look at a for loop for the pickpocketing.

 

https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/Luring/leaves/Lure.java
I already spoke about magic numbers in my previous review; this task is a bit of a cluster fuck of numbers everywhere. have a look at this page here and it explains a bit about what I'm refering to.
https://code-basics.com/languages/java/lessons/magic-numbers


https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/Luring/leaves/MoveintoHouse.java
This is an example of a nice concise simple leaf, 1 leaf, 1 responsibility. 👍

 

https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/Restocking/Leaves/Restock.java
The opposite to what I just said, this one needs splitting, too many responsibilities in this leaf. Opens the curtain, walks to the npc, interacts with the npc, also magic numbers floating everywhere too. 😞

 

You're making progress and it's nice to see. Just got to try and apply the feedback across the whole script rather than just the isolated parts I've pointed out. For example the magic numbers, I'm not going to link you to every magic number, that's on you to go and find and fix, and then realise why it's bad and then you learn from that.

This is why I said take some time to really learn from the feedback I've given you, rather than just fix the issues that I've pointed out. If you learn from the feedback you'll be able to use it going forwards. 👌

Again thank you for the feedback. I will take the time now that I should have longer and look over every line in the script and identify the suggestions everywhere you said. 

 

The sleep condition was the only way I could find to ensure the double pickpocket but I will find a workaround. I will also look through all of the leafs and separate as much as possible for 1 leaf 1 responsibility. Again thank you 

  • Like 1
Link to post
Share on other sites

  • Moderators

As per your message on discord, here's some more feedback 🙂

User interface is much better allowing the user to select from drop downs rather than have to type names or id's 👍 Also nice job on splitting up the tasks to 1 responsibility i.e. splitting eat and opening pouches.

Just some general feedback here, nothing too major.
https://github.com/MaddoxOSRS/BlackJack/blob/855038192a6494686aebf48908c1a78e36bf491b/src/io/maddox/behaviour/KnockandPick/leaves/Eat.java#L27
This is over complex for what it is. HOWEVER I see the logic and the ingenuity behind what you've done here. Rather than have to have different methods or eat or drink, you pull the actions and use the first one which is pretty clever.

The part here that's over complex is checking that actions > 0, every single item in the game has an action, usually bare minimum "Use" and "Cancel" so this check is completely unnecessary as you're already checking that it's valid in the step above.

Further to that, you also specify i.valid() in your filter query which again isn't necessary as you're checking if food.valid() later on. You're doubling up the workload for no reason here.

 

 

https://github.com/MaddoxOSRS/BlackJack/blob/855038192a6494686aebf48908c1a78e36bf491b/src/io/maddox/behaviour/KnockandPick/leaves/OpenPouch.java#L22
Not sure I understand the wait logic here; opening coin poches has no animation, right? So why check if you're idle and not moving as an alternative to having no coin pouches?

 

 

https://github.com/MaddoxOSRS/BlackJack/blob/855038192a6494686aebf48908c1a78e36bf491b/src/io/maddox/behaviour/KnockandPick/leaves/MovetoBandit.java#L15
Brackets are your friends here, you'll want to use brackets to group together your conditions.
So rather than:

condition1 && condition2 || condition3 && condition4
it becomes
(condition1 && condition2) || (condition3 && condition4)
What this does is it evaluates the contents of the brackets as a whole boolean, so it becomes
Condition1 || Condition2

HOWEVER, you don't need condition4 in this statement as it's the same as condition 2; so you'd be better off rewriting this to 

  @Override
    public boolean isValid() {
        return !Configs.house.contains(Players.local())
          && (Inventory.stream().name(Configs.food).action("Eat").isNotEmpty()  || Inventory.stream().name(Configs.food).action("Drink").isNotEmpty())
    }

Otherwise you're re-evaluating the same condition multiple times which again is more workload for the script/client to do when it doesn't need to.

Judging by the amount of times you're quering for both Eat and Drink actions, you'd be better off creating a variable in your main class, like you did with the noted id, store the designated action. Default "Eat" unless they chose wines, then change to "Drink". This way you don't have to query both all the time.

 

 

https://github.com/MaddoxOSRS/BlackJack/blob/855038192a6494686aebf48908c1a78e36bf491b/src/io/maddox/behaviour/KnockandPick/leaves/KnockandPick.java#L44
As you are using on line 45, conditional waits return a boolean as to whether they early returned true, or they timed out false. So why do you repeat the wait on line 44? 44 can be removed completely.

 

 

https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/Luring/leaves/Lure.java
Much much better than before, using variables rather than magic numbers all over the place. The next step would be to house all of your constants in 1 place so they're accessible by all of your leaves should they need it. For example a Constants.java to store all of these in, just like you do with Configs. 🙂

 

 

https://github.com/MaddoxOSRS/BlackJack/blob/855038192a6494686aebf48908c1a78e36bf491b/src/io/maddox/behaviour/Restocking/Leaves/SellEmptyjugs.java#L26
Not sure if you knew, but we have a Store section in the api so you can do your trade, and then a conditional wait for Store.opened() rather than have to check and get all the widgets.

 

I've not finished going through it yet but if I see anything else I'll add some more 🙂

Otherwise some great improvements but for now I'm off to sleep 😄

 

Link to post
Share on other sites

Great thanks for letting me know what to look for! I plan on applying all of this yet again tomorrow to the entire script! 🙂 enjoy your slepe friend.( nightmare joke)

  • Thanks 1
Link to post
Share on other sites

  • Moderators
Quote

https://github.com/MaddoxOSRS/BlackJack/blob/master/src/io/maddox/behaviour/Luring/leaves/Lure.java
Much much better than before, using variables rather than magic numbers all over the place. The next step would be to house all of your constants in 1 place so they're accessible by all of your leaves should they need it. For example a Constants.java to store all of these in, just like you do with Configs. 🙂

You seem to have misunderstood me here.
You had a conditional wait inside an if() which was correct, you only want to pickpocket again, if that first wait returns true. However what you had was 
Conditional.wait(Conditions)
if(Conitional.wait(Same conditions as above))
Meaning the first wait isn't needed because you're then doing it exactly the same way again inside the if().
 

Quote

https://github.com/MaddoxOSRS/BlackJack/blob/855038192a6494686aebf48908c1a78e36bf491b/src/io/maddox/behaviour/KnockandPick/leaves/OpenPouch.java#L22
Not sure I understand the wait logic here; opening coin poches has no animation, right? So why check if you're idle and not moving as an alternative to having no coin pouches?

You've seemingly removed the OpenPouch.java altogether here??

 

It again seems you're just trying to resolve the issues that I'm pointing out but not understanding them at all. Don't get me wrong, you've come a hell of a long way from where you started but I still don't think you quite understand how it all works enough yet.

I've put this on hold till mid-end of Feb. In the mean time, write some different scripts, get a better understanding of how it all works and come back to this and apply your newly learned knowledge to this.

Link to post
Share on other sites

  • Dan changed the title to [On Hold - FEB] Maddox Script Writer Application V2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

 Share