Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • LoremIpsum213

    Members
    • Posts

      13
    • Joined

    • Last visited

    Posts posted by LoremIpsum213

    1. Hi,

      I am making a fully featured crafting script, however i am facing one problem when crafting armour, and that is that the Widget Children do not contain any text string to which i can compare to.

      For making jewellery the following works:

      for (WidgetChild i : Widgets.getWidget(446).getChildren()) {
        if (i != null && i.hasAction(this.toString())) {
        Sleep.sleep(100, 2000);
        i.interact();
        Sleep.sleepUntil(Players.getLocal()::isStandingStill, () -> Players.getLocal().isAnimating(), 10000, 500, 3);
        break;
        }
      }

      Where this.toString() contains the name of the item to be crafted. the parent widget id for the Armour crafting menu is "270".

      For more context, I am talking about this menu. Is it possible to extract the names of the items somehow? or do i have to make some item -> WidgetID lookup table?

      image.png.4f8489c2a20434bc9aa70c13e55a4498.png

       

       

       

    2. 3 hours ago, una_maquina said:

      I see, that makes sense, still though fixed sleeping times like that is unadvisable, better to always have random sleep times with Calculation.random().

      As for why he's having that bug is probably due to something being wrong in the canSmelt() method.

      the fixed sleeping time, is just the timeout, so that means it will always exit after 60 seconds in my latest code change. But 99.9% of time, everything has been smelted by then and the canSmelt function will return false (which is checked every 5 seconds). Perhaps I should randomize that a little bit. so i don't always walk away exactly at the same time.

    3. A script that jumps from task to task, lets say you are mining, got x amount of ores or after random amount of time, then use those ores to smelt bars and then use these bars to craft items. Then rinse and repeat. I think this kind of script will lower banrates a lot.

      Basically, making full on assembly lines involving multiple skills.

    4. In the end i solved it as following:

       

      	//get furnace object in Area (= special class that uses Dreambot Area API)
              GameObject furnace = Area.GetInteractionObject();
              // check if we are within reach, otherwise, keep walking to destination
              if(furnace != null && furnace.distance() < 10)
              {
                  // if furnace was clicked
                  if(furnace.interact())
                  {
                    	// succesfully clicked on furnace, now wait until widget menu is opened
                      sleepUntil(() -> Widgets.isOpen(), 10000, 500);
                      WidgetChild selectionbox = Widgets.getWidgetChild(270, widgetMap.get(Bar.getID()));
                      if (selectionbox != null && selectionbox.isVisible() && selectionbox.interact()) {
                          //wait until done smelting or when a lvl-up dialogue pops up
                          sleepUntil(() -> !canSmelt() || Dialogues.canContinue(), 60000, 5000);
                      }
                  }
              }

       

      I guess this code can be repeated for many different activities within the game. Let me know if i did something else kinda weird.

       

    5. 39 minutes ago, una_maquina said:

      I had this happen when I was doing a cooking script, essentially you make sure that you started animating, and then you sleep until there's no more raw resources in your inventory (ores in this case), or until you're in dialogue.

      Thats what i do, although iam not sure if iam using the sleepWhile() function correctly:

       

              // check whether we are in area
              if(Area.getArea().contains(Players.getLocal().getTile()))
              {
                  GameObject furnace = Area.GetInteractionObject();
                  // if player is on tile in front of furnace and we can smelt, and interact
                  if(furnace.interact())
                  {
                      sleep(500, 3000);
                      
                      WidgetChild selectionbox = Widgets.getWidgetChild(270, widgetMap.get(Bar.getID()));
                      if (selectionbox != null && selectionbox.isVisible()) { //widget exists
                          selectionbox.interact();
                      }
                      sleepWhile(() -> canSmelt(), 30000, 5000);
                  }
              }

       

    6. At the moment i use this function to determine whether the player is smelting bars:

          private boolean isSmelting()
          {
              return Players.getLocal().isAnimating() || (Players.getLocal().getAnimation() == Players.getLocal().getStandAnimation() && canSmelt());
          }

      where canSmelt() determines whether there is enough ores in the inventory.


      However, this is not fool proof as sometimes, the player model just stands still for a brief moment before adding more ore in the furnace.

      In the execute function i have an if statement that uses the isSmelting() function to determine whether we should interact with the furnace, \

      if we are already smelting i don't want it to click on the furnace again.

      I have got everything else working for my smithing script, except for this annoying issue. If someone knows a better way, let me know.

       

       

    7. I got the same yesterday on my linux machine. in the end i ended up removing all Dreambot data, after that it worked again.

      (delete folder "Dreambot" under C:\Users\<user>

    8. 1 hour ago, yeeter said:

      sorry to hear you are having troubles with the API, generally we hear only good things about our documentation so feel free to ask if you have any problems.

       

      If you are hoping to avoid other people running into this issue into the future you can also look into open sourcing your code so if / when you retire from the botting others can pickup where you left off with your script.  The magic of open vs closed source!

      My problem with the API is mainly that the API description assumes that the dev knows what a class does and meant to represent.

      for example https://dreambot.org/javadocs/org/dreambot/api/methods/widget/Widgets.html

      The Methods are described pretty well, but its useless if there is no description of what a widget is in the first place.. There is no description on how this class represents an element in game. so i have no clue what to use it for. Only after some googling for examples or asking ChatGPT does it become clear what it is meant for.

       

      I will certainly consider opensourcing it, however, I think that when a lot of people have access to it, the banrates will increase, even though i have already integrated anti-ban mechanisms.

    9. 6 minutes ago, yeeter said:

      We don't provide the source code for scripts hosted on the SDN, otherwise nothing would keep a person from cloning and reselling someone elses script.

       

      You'll need to contact the original scripter to see if they will fix it, if not you are just kinda SOL.

      Ah. yes of course. Well, i started making one myself now. Will perhaps upload it here for free if it works properly :). Unfortunately the dreambot API description does not make it easy... but ill get there with some trial and error!

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.