-
Posts
510 -
Joined
-
Last visited
-
Feedback
97.4%
Everything posted by House
-
Objects.get() returns an array of objects at the position, .get(0) returns the first one and usually there is only one objects per tile. You could take an area around the player in a eg 10x10 grid and check if the mouse click or press event's .getPoint() is within the bounds of a tile. (Do not check every tile loaded, 10x10 is already a significant load) Idk if this is the best way to approach it but i know it works Useful snippets: ArrayList<Position> nearby_positions = new ArrayList<Position>(); private void updateNearbyPositions(int scan_radius) { Position my_position = myPosition(); int start_x = my_position.getX() - scan_radius; int start_y = my_position.getY() - scan_radius; int end_x = my_position.getX() + scan_radius; int end_y = my_position.getY() + scan_radius; for (int xx = start_x; xx <= end_x; xx++) { for (int yy = start_y; yy <= end_y; yy++) { Position pp = new Position(xx, yy, my_position.getZ()); nearby_positions.add(pp); } } } @[member=Override] public void mouseClicked(MouseEvent e) { for (Position p : nearby_positions) { if (p.isVisible(getBot()) && p.getPolygon(getBot()).contains(e.getPoint())) { if (mining_rock_positions.containsKey(p)) { mining_rock_positions.remove(p); e.consume(); } else if (!mining_rock_positions.containsKey(p)) { RS2Object rock = getObjects().get(p.getX(), p.getY()).get(0); if (rock != null) { mining_rock_positions.put(p, rock.getId()); e.consume(); } } } } } Apologies for the structure, its a pretty old code of mine
-
You need to regrab the object on the position you store. You do not store the RS2Object. you can get an updated version of the current object on a tile using Objects.get(x,y).get(0);
-
or just bot it
-
When you interact with the rock you have an instance of the object. You can store the position and see if the rock is still a valid mineable rock?
-
Fair enough but if you look at my feedback i've been selling decent chunks of gold recently and i go first
-
Status: SOLD Selling 120M 0.95$/M PP Leave your skype below or pm it
-
Selling 140M PP 0.95$/M PM me or post your skype below!
-
In general i personally don't recommend walking to current location + x because it will not work with WalkingEvent if the tile is not walkable which can be the case because you base it on current location + x Just my two cents
-
Just check for that darn tree haha
-
hmm if he is around that area, what if he is attacked by the guards on the way?
-
Did you open the forums with your bot client using the same proxy dbuffed used?
-
create your own solution to handle the obstacle? add it into the break condition if the tree is X distance away and handle it yourself
-
Is there a way to seperate breakhandler from random events?
House replied to swiffyp's topic in Scripting Help
This ^ Also good to mention getTimeUntilBreak() returns the time in minutes OR you can write your own break manager with -allow norandoms -
Fuck what am i expecting on here
-
Need It To Be Undetectable. -> Not possible Low Ban Rate. -> Possible Multi-Platform -> What does that even mean?
-
Status: Sold Selling 100M 0.95$/M PP if you wouldn't sell to the account you are posting on yourself don't bother
-
No more org.osbot.rs07.script.RandomBehaviourHook ?
House replied to dokato's topic in Scripting Help
This isn't the spam section, but why ? -
No more org.osbot.rs07.script.RandomBehaviourHook ?
House replied to dokato's topic in Scripting Help
So we can properly manage farms? -
I really think this song's going to blow up soon
House replied to Transporter's topic in Spam/Off Topic
its from 2015 bro -
you know every bond is the result of "real money" right
-
who tf are you
-
These should help for determining when to run the login task. public boolean isLoggedIn() { return // isHopping() || // getClient().getLoginStateValue() == 30 || // getClient().isLoggedIn() || // isLoading(); } public boolean isHopping() { return // getClient().getLoginStateValue() == 45 || // getClient().getLoginStateValue() == 25;// } public boolean isLoading() { return // getClient().getLoginState() == LoginState.LOADING || // getClient().getLoginState() == LoginState.LOADING_MAP; } Client.isLoggedIn() triggers false when hopping so these checks are good to add in
-
I don't think using a position given like that is good, like you said it will fuck you over if its not walkable and not do anything. Usually you want to deagro with changing the Z coord aka walking up a ladder What if you are in a small area also?
-
Well does it work? Create a method called isShopEmpty. have a for loop and if any of the items have an amount > 0 return as false;