Jump to content
×
×
  • Create New...

[Complete] Script Writer 1 Application - Proto


Proto
 Share

Recommended Posts

Hey guys,

After v2 came out, been really enjoying using the client and finally got the time to put into making scripts, got a couple ready to release once they get me my 99s, but below is a sample of a script request 

https://github.com/Protoprize/PP-Aerial-Fisher
 

Simple script, start with knife in inventory and it does the rest for you :) 

Anything else that's needed or more scripts, please let me know (I feel like I'm writing a work email)

 

 

Link to post
Share on other sites

  • Moderators

Nice structure and broad use of the API.

Some feedback from looking through which may be helpful for the future.

Firstly, I hate standard sleeps with a passion.

https://github.com/Protoprize/PP-Aerial-Fisher/blob/35d4e7b0d0a1c7dc58a191b2daf21e42cffd015f/src/com/proto/aerial/tasks/GetBird.java#L19

Here you wait 1.2-1.8 seconds without any validation whatsoever. I've never done the activity you wrote the script for, so it may be that there's no validation available or whatever but I'd personally stay clear as you've used conditional waits perfectly fine throughout the rest of the script.

Also make things easier for yourself and make use of the chat API.

   Component cont = Components.stream().text("Tap here to continue").first();
        if (cont.valid()) {
            cont.click();
            Condition.sleep(Random.nextInt(1200, 1800));
        }

//////////////////// VS

if(Chat.canContinue){
	Chat.clickContinue();
	Condition.wait(()->!Chat.canContinue(), 150, 10);
}

 

I also noticed something else too which I thought could come in handy for you. I wasn't sure if you knew that Condition.wait() returns a boolean, if early exits, true, if times out, false so below, it just saves you doing the same Inventory.selectedItem() check twice.
https://github.com/Protoprize/PP-Aerial-Fisher/blob/35d4e7b0d0a1c7dc58a191b2daf21e42cffd015f/src/com/proto/aerial/tasks/CutBait.java#L25

 if (knife.interact("Use")) {
                    Condition.wait(() -> Inventory.selectedItem().valid(), 200, 30);
                    if (Inventory.selectedItem().valid()) {
                        int x = Skills.level(Skill.Cooking.getIndex());
                        cut.interact("Use");
                        Condition.wait(() -> Inventory.stream().id(AerialData.CUT_ITEMS).isEmpty() || Skills.level(Skill.Cooking.getIndex()) != x, 300, 100);
                    }
                }

//////////////// VS
 if (knife.interact("Use")) {
                    if (Condition.wait(() -> Inventory.selectedItem().valid(), 200, 30)) {
                        int x = Skills.level(Skill.Cooking.getIndex());
                        cut.interact("Use");
                        Condition.wait(() -> Inventory.stream().id(AerialData.CUT_ITEMS).isEmpty() || Skills.level(Skill.Cooking.getIndex()) != x, 300, 100);
                    }
                }

 

However overall, you'll be a great addition to the team, congrats.

@const_

Link to post
Share on other sites

  • Dan changed the title to [Complete] Script Writer 1 Application - Proto
  • Dan locked this topic
Guest
This topic is now closed to further replies.
 Share