Jump to content
×
×
  • Create New...

[Complete] Script Writer 1 Application - ADivorcedFork


Recommended Posts

Hey all,

 

I've been around the scene for a few years now scripting for other platforms, but been really impressed by PowBot mobile, so it looks like this'll be my go to for most scripts. Interested in seeing this platform grow and being involved where I can.

 

Anyways, here is a Wintertodt script made with the latest API. I'm sure there's probably some clean up I might of missed, but should show a broad use of the API:

https://github.com/adivorcedfork/ForksWintertodtPowBot

 

Let me know if there's anything that's needed or anything I can clarify. Thanks in advance.

 

- Fork

Link to post
Share on other sites

  • Moderators

Nice to see something slightly more unorthodox in your poll. Not everyone needs to follow the same framework, that's how we expand our knowledge base as a team.

I personally don't like private api methods where we ones to achieve the same result.

boolean success = Time.sleepUntil(ExInventory::isEmpty, 2000);
                if (success)
/// VS

boolean success = Condition.wait(()->ExInventory::isEmpty, 200, 10);
	        if (success)

However I'm assuming you just adapted your methods from another client to suit ours without really digging around too much in our API (albeit there's not much documentation).

Although for the most part, your script is nice and tidy as well as split into a somewhat modular layout, for an activity such as wintertodt, stuffing everything into 1 class irks me slightly. Manageability is reduced significantly as debugging something in 300 lines of code is vs your 5 main activities split into their own task of ~80 lines each.

You've clearly been around the block for a while and know what you're doing. I'll leave this open for @const_ to offer any suggestions and/or complete the application. 👍

Link to post
Share on other sites

  • Administrators

Just drop a few comments around API usage:

 

Object foodObj = getOption("Food");

You can declare the type:

String foodObj = getOption("Food");

However I would suggest using @ValueChanged, see 

 

I would recommend passing a radius when filtering objects:


  public static GameObject getNearest(Predicate<GameObject> pred) {
  	return Objects.stream().filter(pred).nearest().firstOrNull();
  }


  public static GameObject getNearest(Predicate<GameObject> pred) {
 	 return Objects.stream(10).filter(pred).nearest().firstOrNull();
  }

 

Nothing major though 🙂

Link to post
Share on other sites

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