Everything posted by Woody
-
New dynamic signature images [pls r8]
i like, but perhaps a different font? maybe bold?
-
#ROADKILL
- 0000 to 9999 combination
man, you guys surely know how to over-complicate things... Why dont you just chill and bang some tinder girls?- Anyone here play runescape?
no lol, he is serious mate- Help me please
Create own method using widgets- Firemaking script?
y u alwais undercut me bro make it $30 monthly or ill make a dispute- Firemaking script?
- Is this a good staking schedule?
Not taking risks ≠ no chance to make lots of cash Dude, YOLO- Inventory interaction questions
Item peaches = getInventory().getItem("Peach"); Item bones = .... Same as above If peaches != null Eat Else If bones != null Click bones to peaches Else Stop- stuck on getInventory.....
I will not spoonfeed you anymore. Learn some java instead of depending on the forum.- stuck on getInventory.....
First thing we need is an instance that supplies the methods we need (from MethodProvider). We can do this by extending upon the API type: final class DefaultAPI extends API { } You will be forced to declare an initializeModule method. Don't worry about it, just the devs not following interface segregation Leave it blank. You could fill it in, but you would be required to call it after instantiating API. Once you have your API type, create an instance of it in onStart in your Script subclass: final class MyScript extends Script { private API api; public void onStart() { api = new DefaultAPI(); } } Finally, we need to pass the context of our script to our api instance. We do this by calling exchangeContext on our api instance, passing in the script's bot: final class MyScript extends Script { private API api; public void onStart() { api = new DefaultAPI(); api.exchangeContext(getBot()); } } I quoted fixthissite's post. Read it through thoroughly and if you pay attention, you'll make it. Edit: If you did all of this above, here is an example: import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.API; public class Inventory { // ADDED THIS HERE @@@ private API api; public Inventory(API api) { this.api = api; } // @@@@@@@ // WARNING: Untested code /** Holds the amount of willows we have cut */ private int willowsCut = 0; /** Holds the last inventory that was compared */ private Item[] lastInv; /** * Simple getter * @return the number of willows cut */ public int getWillowsCut() { return willowsCut; } /** * Compares your last inventory with the current inventory. */ public void compareItems() { if (lastInv == null) { lastInv = api.getInventory().getItems(); return; // It will be the same, no need to check } String item = "Willow logs"; Item[] currInv = getInventory().getItems(); for (int i = 0; i < 28; i++) { // Check for the same thing if ((currInv[i] == null && lastInv == null) || currInv[i].getName().equals(lastInv[i].getName())) continue; // Its the same, continue if (currInv[i] != null) { // We have an item when we didn't if (currInv[i].getName().equals(item)) willowsCut++; // It was a willow log, ++ } else { // We don't have an item when we did if (lastInv[i].getName().equals(item)) willowsCut--; // It was a willow log, -- } } lastInv = currInv; // Update the inv } /** * Run this when the lastInv needs refreshing, aka after banking */ public void resetItems() { lastInv = api.getInventory().getItems(); } } If you want to get inventory in your Inventory class, simply do "api.getInventory()".- Black Dragon Script
My post makes you mad? What do you have against me? Straight up and just tell me.- stuck on getInventory.....
Read the guide and do it step by step.- ◄⌠Viliuks AIO Services⌡«»Questing«»Leveling«»Cannoning«»Minigames«»And a lot more!►
1. firecape 2. naldo.end 3. yea 4. yea- stuck on getInventory.....
http://osbot.org/forum/topic/73842-isolating-the-api-from-script/- Black Dragon Script
http://osbot.org/forum/forum-181/announcement-25-scriptscripter-rules/ Below is a list of scripts not permitted on the SDN: -Free AIO resource scripts (eg woodcutting, fishing, mining) (dragon bones are resource) 4. Prices may not undercut existing scripts. Mine does not support safespot, no it does not. However that does not mean you can still release it in the SDN for free. No point in arguing here. Just apply for S2 and if you get promoted, release it as premium.- Black Dragon Script
You cant make it free if there is a premium version of the same script.- Black Dragon Script
Are you not supposed to be S2 to be able to release premium scripts?- When you level Wc Stuck.
Dude, I am suggesting to NOT use try & catch like how you are using it. Try something like this: RS2Object tree = getObjects().closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object obj) { return obj.getPosition().equals(WILLOW_POSITION_1) || obj.getPosition().equals(WILLOW_POSITION_2); } }); then check if tree != null and do action. Play around with it and learn how to use filters; it will help you A LOT when using filters.- When you level Wc Stuck.
Make a filter to only get the 2 desired willow trees. I would not recommend using a for loop like you did. Btw, do you know what try & catch is for? If not, read it up and you'll then understand why you don't have to use it like you are now.- When you level Wc Stuck.
If you fixed it, then great. However, why are you a for loop here? for (int i = 0; i < Willow.length; i++) { // why? } Also, you don't really need to try and catch when doing an action. Just make sure the object is not null.- When you level Wc Stuck.
It should ignore the level up widget... Post your code where it gets stuck- Let's see everyone's whip
This picture is from google, I know, but it's almost exactly like this one; minus side mirrors (mine are all white) and the rims (mine are cooler). It's a BMW 5 serie F10, 535D xDrive.- Woody's Scripts - Request a trial here! [Blue dragon killer]
Woody's Scripts If you want a trial to one of my scripts, please read the requirements and post in this thread. SCRIPTS: Requirements: Hit the like button on this post AND the first post in this thread When I like your post in this script, it will mean that the trial as started. Please leave some feedback/progress report(s) in the script's thread!- [NEW] Woody's GREEN DRAGON KILLER [SOON][ALPHA][OMFG!]
Sure, but it is not in beta stage yet. I'll post here when I need some testers! - 0000 to 9999 combination