Jump to content
  • Create New...


  • Posts

  • Joined

  • Last visited

  • Days Won


Pty last won the day on September 24

Pty had the most liked content!


7 Neutral

1 Follower

About Pty

Script Writer I

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. There should be a "Setting"(The cog) at the bottom which will allow you to specify that it is not to be dismissed.
  2. Please read this setup guide - https://powbot-265e9f.webflow.io/guides/installing-powbot-with-ldplayer-on-windows
  3. Don't use LD Player instance, create a new one(Create button) which will have powbot-x. Then install to that and you should be good to go.
  4. Pty

    Simple quest script

    It was removed in the V2 migration sorry. Will start working on it when the new web walking is released.
  5. Simple fisher already does Minnows.
  6. Hi all, with the new upcoming release of V2 we have changed the process from using Java GUI's to native android GUI's. In an effort to make this easier for scripters we have changed the way of doing this by using annotations. @ScriptConfiguration Using the @ScriptConfiguration tag you can now configure your script as required to make it simple to setup. There are currently 6 OptionType's you can use to setup your data which can correspond to different types of controls used to get that data. String Integer Double Boolean GameObjects Npcs Examples Singular @ScriptConfiguration( name = "Tree", description = "Pick which tree type you want to cut", defaultValue = "Tree", allowedValues = ["Tree", "Oak"], optionType = OptionType.STRING, // Default enabled = true, // Default visible = true, // Default ) class TreeKiller : AbstractScript() { override fun onStart() { var tree = getOption<String>("Tree") } } Multiple configurations @ScriptConfiguration.List( [ ScriptConfiguration( name = "Tree", description = "Pick which tree type you want to cut", allowedValues = ["Tree", "Oak"] ), ScriptConfiguration( name = "Powercut", description = "Tick this to drop logs when your inventory is full", optionType = OptionType.BOOLEAN, defaultValue = "true", ) ] ) Controls When entering data you naturally will need different controls for different things, here is a list of the current ones we support. If you have any more feel free to suggest them and give an example use case Drop down list Must be string type Must have multiple allowed values This will most likely be the most common one you would be using, it starts at the default value and the complete list contains all the allowed values Text Fields This is a field where users can enter data they want, depending on the type you specify it will restrict the characters allowed to be entered. String(no/empty allowed values) Any character allowed Double type 0-9 and . Integer 0-9 only Checkbox This is a simple field which will return true/false depending whether the checkbox is ticked. Only for Boolean OptionType. Npc This is a special field which allows you to select a list of NPC's and return relevant information relating to them in a List<NpcOption> format. GameObject This is another field just like the one above although this one returns in a List<GameObjectOption> format @ValueChanged This annotation much like the name suggests lets you get notified when the value is changed. You can use one of these for each of the script configurations that you have setup above, combined with the functionality to update the values this allows you to create much more dynamic user interfaces. Example In the example below I have two script configurations for when I want to chop wood Location and Tree. The predicament is that Draynor does not have access to all the trees that Seers or Edgeville does so if I was to add all the trees below and invalid configuration would be possible. Using @ValueChanged we can solve that by listening for when the user changes the Location and update the list of values the user is allowed to select. @ScriptConfiguration.List( [ ScriptConfiguration( name = "Location", description = "Pick a location to cut the tree at", defaultValue = "Draynor", allowedValues = ["Draynor", "Edgeville", "Lumbridge", "Nearby", "Seers"] ), ScriptConfiguration( name = "Tree", description = "Pick which tree type you want to cut", allowedValues = ["Tree", "Oak"] ), ] ) class x : AbstractScript() { @ValueChanged("Location") fun locationUpdated(updatedValue: String) { // Select list of tree's based on the location val updatedList = when (updatedValue) { "Lumbridge" -> arrayOf("Tree", "Oak") "Draynor" -> arrayOf("Tree", "Oak", "Willow") "Edgeville" -> arrayOf("Yew") "Nearby" -> arrayOf("Tree", "Oak", "Willow", "Maple", "Yew", "Magic") "Seers" -> arrayOf("Tree", "Oak", "Willow", "Maple", "Yew", "Magic") else -> arrayOf() } // Update the list of allowed trees for the field named "Tree" updateAllowedOptions("Tree", updatedList) } } Other methods which do similar things are as follows // Gets the value of the data from the name. T is the type returned depending on the field(EG String/Boolean) getOption<T>(name: String) // Updates the list of allowed options for a field. updateAllowedOptions(name: String, options: Array<String>) // Updates the value depends on the type of field EG Boolean/String updateOption(name: String, value: T?, type: OptionType) // Updates whether the field is hidden or shown updateVisibility(name: String, visibility:Boolean) // Updates whether the field is enabled/disabled updateEnabled(name: String, enabled: Boolean) Hopefully this helps you understand what we are trying to accomplish and how to use these changes. Any suggestions are welcome or any requests for other fields etc.
  7. Can you run it through commandline? Will give better information java -Xmx1024M -jar "%HOMEPATH%\.powbot\client\powbot.jar"
  8. (Just really looked at main) Some general notes Compiled code should not be checked in as its generated and generally increases repository size for no benefit Out(Folder) Docs(Not sure why you need to generate this?) Code format kind of seems clumped, but that's my preference to have it more well spaces Biggest one(Which would involve quite a bit of tidyup): Use if statements to help determine logic and error check, you are too reliant on it just working and nothing going wrong. You should separate GUI logic and business logic otherwise it can get messy. private void startSetUp() { Condition.wait(() -> ctx.game.clientState() == Constants.GAME_LOADED, 500, 20); if (!ctx.players.local().inViewport()) { Component playButton = ctx.widgets.widget(378).component(80); Condition.wait(() -> playButton.visible() && playButton.click(), 250, 8); Condition.wait(() -> ctx.players.local().inViewport(), 500, 20); } } Unsure why you need to check play button as that should be handled by AutoLogin? if (ctx.chat.canContinue()) { // If we have leveled up or started a dialog Condition.wait(() -> true, Random.nextInt(732, 3930), 1); updateWindow(); Component component = ctx.widgets.widget(233).component(3); if (component.visible() && component.click()) // Then click continue System.out.println("|Cannon-Baller| Clicked on continue"); state = STATE.SMITH; // and go back to smithing (assumed that it will only happen during a level up) } could be if (ctx.chat.canContinue() && ctx.chat.clickContinue()) { updateWindow(); state = STATE.SMITH; // and go back to smithing (assumed that it will only happen during a level up) } BankGoods seems to rely on it being opened first time and it looks messy. It really should be more structured (EG) if (!ctx.bank.opened && !ctx.bank.open()) { return } //Now contine assuming the bank is opened if (ctx.bank.depositAllExcept(<MouldNameHere>) { // Now we know there is only the mould if (ctx.bank.withdraw("Steel bars", 0)) { // 0 should be all var result = Condition.wait({check bar count}); if (result) { // Successfully has bar count ctx.bank.close() state = STATE.SMITH; return } } } SmithCannonballs This really lacks safety logic and checking "if" statements. Your widget logic is too reliant on it working first time and all shoved together. ^^ Above int[] ids = {AMMO_MOULD, STEEL_BAR}; Could be final at the top of the class so its not defined each time method is called. GameObject smelter = ctx.objects.toStream().within(INTERACTION_RANGE).name("Furnace").first(); smelter.interact("Smelt"); Gameobjects can't be null although they can be Nil(GameObject.Nil) this means that the object you would be interacting with is invalid. So you really should be checking it like it's a null object or invalid. Should be something like this GameObject smelter = ctx.objects.toStream().within(INTERACTION_RANGE).name("Furnace").first(); if (smelter == GameObject.Nil){ // Invalid smelter so I guess we need to walk to it state = State.WALK_TO; return; } Component all = cannonballWidget.component(COMPONENT_ALL_ID).component(COMPONENT_ALL_SUB_ID); // The ALL button on the widget This is not used until later and should only be called if the "if" statement is successful. Gathering components is an expensive action and should only be done when needed.
  9. Pty

    Simple quest script

    Sorry for late reply No, it will gather all items(Or log an output if its not possible), it also has grand exchange option which requires it to start by GE. Best location is the bank nearest to the quest start Correct Both should work(This is more of a client than script thing)
  10. Pty

    Simple Fisher

    Most likely related to web-walking. An alternative probably would be Draynor/Al-Kharid(Assume your using lumbridge swamp?)
  11. Private scripts aren't allowed currently. Although depending how complex it is etc I could make a public one.
  12. Best come into discord and ask in the help channel for fastest help. There is some server issues which have to be rebooted, when they are up again you should be able to open again.(Assuming you have successfully ran the bot before)
  13. Pty

    Simple Fisher

    99 Fishing 24/7 minnows