Jump to content

badjie

Members
  • Posts

    12
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by badjie

  1. 24 minutes ago, Apaec said:

    Well, 'advanced java knowledge' isn't exactly some unattainable feat, though it does take some practice and reading some tutorials. I'd say that while most scripters with premium scripts on the market have a solid if not strong understanding of Java, and some (esp. scripter IIIs) have wider software dev/computer science knowledge too, you can certainly get a long way with just the basics. It's amazing how much you can pick up by just trying API things out, failing, and asking questions - once you've beaten the initial learning curve (which is quite steep, but don't let that put you off!), improving is much quicker and easier. Indeed, writing scripts for OSBot doesn't have to just be a fun hobby---is a great introduction to the world of programming and software development. Well worth learning!

    I'm always here to answer questions, programming related or otherwise. Reply here or send me a PM any time you need anything :)

    -Apa

     

    thank you so much man!

  2. 23 minutes ago, Apaec said:

    Yep, that's more or less what is going on. It looks a bit complicated and is certainly advanced syntax (it's an anonymous instantiation) so don't worry too much if you're not comfortable with it. 

    Just wondering do most paid scripts use advanced java knowledge (like anonymous instantiation) or can most of them be acomplished through simple use of the api capabilities?

  3. 18 minutes ago, Wisply said:

    yeah for mass botting its normally just suicide botting everything, but if youre doing something with higher reqs like zulrah you could buy a zulrah ready account or pay someone to get an account zulrah ready

    so it's better to get accounts that are already ready to do high lvl content

  4. Do people that massbot do it by suicidebotting? do they just bot right from tut island, bot all the quests basically 100% botted. Curious to know since people that have 1/2 bots usually take better "care" of the accounts since they do not need that much time to manually setup compared to mass botters who can't be bothered to manually do quests and tut island on like 50 accounts. Wondering what's the process like thanks!

  5. 8 hours ago, Apaec said:

    Hmm, this is certainly a niche situation, but can definitely be done. Might be a little trickier though. Typically, when the players inventory is full of junk so a script cannot run, the script should either terminate and let the player know this, or do something loss-less, such as going to a bank and depositing the junk. Arbitrarily dropping items isn't a great idea in general: what is the inventory was full of godswords?

    Anyway, to achieve what you're looking for, the default API entries won't seem to provide this functionality. We'll have to create our own filter:

    (Note that I haven't tested this code and wrote it here in the reply box so there could be errors, let me know if it doesn't work!)

    
    if (getInventory().isFull()) {
        getInventory().dropForFilter(new Filter<Item>(){
        	@Override
            public boolean match(Item x) {
              return !x.getName().equals("Cup of Tea");
            }
        });
    }

     

    Oh i see what you did there! just to make sure you are basically making a filter for an item, then you create a method with the argument x, and make it return an item thats NOT x and then you pass that to the filter? i currently have no way to test it since i have a main rs account and i dont want to test it on a bot and get my ip flagged. I still need to take care of that later(prob getting a proxy). Anyways, the important thing is that i think i understood how it works. Thanks once again!

    • Like 1
  6. 1 hour ago, Apaec said:

    Sounds like the relevant part of the API to you would be the inventory API: https://osbot.org/api/org/osbot/rs07/api/Inventory.html

    Something like inventory#dropAllExcept sounds about right. For example:

    
    if (getInventory().isFull()) {
    	getInventory().dropAllExcept("Cup of Tea");
    }

     

     

    what if i dont want to drop everything, and instead just 1 thing at a time? that's my real problem cuz i can't find anything for that

     

  7. public int onLoop() throws InterruptedException {
            RS2Object stall = getObject().closest("Tea Stall");
                    if (getInventory().contains("Cup of Tea")) {
                        getInventory().drop("Cup of Tea");
                        sleep(700);
                    }
                    else if (stall != null && !myPlayer().isAnimating) {
                            stall.interact("Steal-From");
                            log ("Stall Here!");
                            sleep(700);
                    }
            return random(200, 300);
        }

     

    So my inventory can be full and NOT have tea (just full with other items), i was thinking about doing something like

    if ( getInventory().isFull() AND getInventory().contains("anything other than tea") ) {

    getInventory().drop("a random item in my inventory")

     

    I've been looking on the API but im not sure how to check for "anything other than tea" and how to drop a random item in my inventory.

     

  8. I recently got into scripting and im having some difficulties searching for stuff i need in the api, i know what i need but i have trouble finding what is the right method to use and how to use it. For example the myPlayer method, there's no way i would know that i need to do !myPlayer instead of myPlayer. Also if i find a method, i dont know what do i have to import in order to use it. Sorry for the noob question but essencially if i know how to search the api, i would script much faster since i have some programming knowledge already. Thanks!

×
×
  • Create New...