-
Posts
821 -
Joined
-
Last visited
-
Feedback
100%
Posts posted by lisabe96
-
-
I'm not sure drawPolygon will work if the position's Z coordinate is not 0 (could be wrong).
If this is the case you could use:
Polygon p = position.getPolygon(getBot(), myPosition().getZ()); if(p != null) g2d.draw(p);
Which I can confirm DOES work on with all planes.
Cheers
Thanks, will use.
Better avoid possible problems
-
-
Try doing this instead:
g.drawPolygon(t.getPolygon(getBot()));
Exactly what I wanted! Thanks a bunch
-
Oh shit, I didn't see it was an XBox
It's used on anything not just an xbox, it just originates from xbox360.
-
-
Got it working
It doesn't look good when the camera is tilted as it draws the screen and not the game world obviously.
But it works.
private List<Position> tiles = new ArrayList<>(); @Override public void mouseDragged(MouseEvent e) { handle(e); } @Override public void mouseClicked(MouseEvent e) { handle(e); } private void handle(MouseEvent e) { log(e.getX() + ", " + e.getY()); Position pos = getPosition(e.getPoint()); if (exists(pos)) { tiles.remove(pos); return; } tiles.add(pos); } @Override public void onPaint(Graphics2D graphics) { Graphics2D g = (Graphics2D) graphics; g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF)); g.setColor(Color.GREEN); if (!tiles.isEmpty()) { for (Position t : tiles) { if (t.isVisible(getBot())) { g.draw(t.getPolygon(getBot()).getBounds()); } } } } private Position getPosition(Point mousePosition) { for(int x = 0; x < 104; x++) { for(int y = 0; y < 104; y++) { Position pos = new Position(getMap().getBaseX()+x, getMap().getBaseY()+y, getMap().getPlane()); if(pos.isVisible(getBot()) && pos.getPolygon(getBot()).contains(mousePosition)) { return pos; } } } return null; } private boolean exists(Position pos) { if (!tiles.isEmpty()) { for (Position tile : tiles) { if (tile.equals(pos)) { return true; } } } return false; }
-
Thanks!
This should be enough information to get it working
-
Perhaps you can do something like:
for each tile in myplayer.getArea(radius):
if tile.polygon contains (mx, my):
return tile
not the most efficient solution tho
I hope to find something more efficient, but I'll give it a try if I can't figure out anything else
Not 100% since im not where I can freely test. The solution might be
mouse().getArea();
As I said I recall doing this at one point in scripting but I'd have to test it.
This would return java.awt.geom.Area
-
Entity hover debug shows you which tile you are hovering over if thats what you need.
That's exactly what I need but I need it in code.
Maybe this example will be more clear:
void mouseMoved(MouseEvent e) { Tile tile = new Tile(mouseX, mouseY); log(tile.getPosition()); }
This obvious doesn't work, I'm after how I would get this working within osbot
-
- Bad Example:
-
public RS2Object entrance; public RS2Widget wait; public RS2Widget cont; public NPC guard; public NPC tzkih; public NPC tzkek; public NPC tokxil; public NPC ytmejkot; public NPC ketzek; public NPC jad; public NPC ythurkot; String state; int startHPExp; int startATTExp; int startDEFExp; int startSTRExp; int completed; long startTime; long runTime;
This is an example of bad code! Most of us have probably defined our variables like this before and thought it is correct. Though it is correct and will work, it is not the most efficient and clean way to define them.
- Good Example:
-
int profit, age; int a = 4, b = 6; long startTime, timeRun RS2Object guard, target, chicken; RS2Widget selectX, makeAll; ..... so forth
Fewer lines of your code, all your variables are still there and it looks neater and easier on the eyes.
I personally find the first example a lot cleaner and easier on the eyes.
-
How can I with the API determine what Position I'm hovering at.
The same as when you use the entity debug option that shows which tile coordinates your hovering on.
It's probably something simple but I haven't found anything useful in the API.
-
for (Item item : script.getInventory().getItems()) { if (item != null && item.getName().startsWith("Amulet of glory")) { return item; } }
I win for readable oldschool code
-
It would be 180, if it was 360 you would be walking into him.
Always will be one falling for it
-
3
-
-
Turn 360° and walk away
-
Same issue here
-
Since yesterday the "notifications dropdown" doesn't seem to work anymore for me.
This is what I see ^
The number displaying the amount of notifications will be gone after clicking but I wasn't actually able to see them
because it just displays this small gray border.
OS: Windows 7 x64
Browser: Opera 35.0
EDIT:
Excuse me, I just saw there is already a topic running on this issue.
-
java.lang.NoSuchMethodError: org.osbot.rs07.api.Walking.webWalk(Lorg/osbot/rs07/api/map/Position;)
webWalk(position) was deprecated and now removed. You might want to update to webWalk (Area) or similar
Best wishes
Thanks for noticing.
However as it isn't on the SDN it's not urgent.
I am in the process of reworking most of my scripts currently,
so eventually this one and all my other ones will be updated.
Just give me a little
-
As mentioned before, it's a webwalking issue. Hope it will be fixed with the next API update.
It wasn't Ill work something out
-
Area webwalking still doesn't seem to be fixed
-
At least she isn't showing off her boobs like most girl streamers
-
script is great but there's 1 big issue. At Draynor whenever the bot goes to bank whether it was custom or a set area, he enters the bank and spams click multiple times left side of the door and sit there for a bit, then walks to the bank booth. The issue is, it's too obvious it's a bot. IF it went straight for the banking counter it'd have been better. What it does is, it clicks on the door's frame, then spams click on the left by those 4 booths by the wall instead of going straight for the banking booth. I hope I made it clear
To visualize it, imagine you are at the bank's door and the camera is poiting towards the fishing area/willow area. Now the left spot right by the door's entrance inside bank is the culprit.
great script.
As mentioned before, it's a webwalking issue. Hope it will be fixed with the next API update.
-
2
-
-
-
Even though my gfx skills are below zero, I ain't
-
Plot twist, in the end you'll die after all.
Seriously, I did an account giveaway like a week ago without troubles?
I wouldn't know why this aint allowed in the first place
How to enable camera when input is disabled
in Scripting Help
Posted · Edited by lisabe96
While input is disabled on the client, I'd like camera movement to be enabled.
The reason is that I want to reach more tiles by moving the camera, but I don't want my character start
running around like a tard when clicking the tiles. Which happens with input is enabled.
So I'd only want camera input enabled.