Search the Community
Showing results for tags 'paint'.
-
Bob Ross would be so proud! Example code: import java.awt.Color; import java.awt.Graphics2D; import java.util.List; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import com.liverare.api.PaintAPI; @ScriptManifest(author = "", info = "", logo = "", name = "Test", version = 0) public class Test extends Script { PaintAPI paint; Area safeSpace; List<NPC> guards; @Override public void onStart() throws InterruptedException { paint = new PaintAPI(); paint.exchangeContext(bot); safeSpace = myPlayer().getArea(5); } @Override public int onLoop() throws InterruptedException { guards = npcs.filter(Test::isGuard); return 100; } private static boolean isGuard(NPC npc) { return npc.getName().equals("Guard"); } @Override public void onPaint(Graphics2D g) { g.setColor(Color.BLACK); g.setBackground(Color.PINK); // dont worry bout checks fam, i do dat paint.drawMinimapArea(g, safeSpace); paint.drawEntities(g, guards, Test::guardToString, true, false, false, false, false, false, true); } private static String guardToString(NPC npc) { return "Health: " + npc.getHealthPercent() + ", xyz: " + npc.getPosition().toString(); } } Functions: public void drawLink(Graphics2D g, Entity entity1, Entity entity2) public void drawMinimapArea(Graphics2D g, org.osbot.rs07.api.map.Area area) public <T extends Position> void drawString(Graphics2D g, Function<T, String> toString, T position) public void drawString(Graphics2D g, String aString, Position position) public void drawString(Graphics2D g, String aString, Entity entity) public void drawEntity(Graphics2D g, Entity entity, String aString, boolean labelTile, boolean click, boolean cube, boolean minimap, boolean tile, boolean box, boolean wireframe) public void drawEntity(Graphics2D g, Entity entity, Function<T, String> getDescription, boolean labelTile, boolean click, boolean cube, boolean minimap, boolean tile, boolean box, boolean wireframe) public <T extends Entity> void drawEntities(Graphics2D g, Collection<T> entities, Function<T, String> getDescription, boolean labelTile, boolean click, boolean cube, boolean minimap, boolean tile, boolean tileCube, boolean wireframe) private void drawBox(Graphics2D g, Entity entity) private void drawBox(Graphics2D g, Position bottomTile, Position topTile) private void drawWireframe(Graphics2D g, Entity entity) private void drawClickBounds(Graphics2D g, Entity entity) private void drawCube(Graphics2D g, Entity entity) public void drawMinimapPoint(Graphics2D g, Vector3D v) public void drawMinimapLink(Graphics2D g, Vector3D a, Vector3D b) public void drawTile(Graphics2D g, Entity entity) public void drawTile(Graphics2D g, Position position) public static void drawPoint(Graphics2D g, Point point, int size) public static void drawPoint(Graphics2D g, int x, int y, int size) public static void drawShape(Graphics2D g, Shape shape) public static void drawString(Graphics2D g, String aString, int x, int y) public static void drawString(Graphics2D g, String aString, Point point) public static void drawString(Graphics2D g, String aString, Rectangle rectangle) Source:
- 25 replies
-
- 11
-
i had problems with Painting On screen image (Backround image) to print it with URL Correcly --go to https://imgur.com/upload upload your back round --After uploaded you get your link https://imgur.com/kVbst forgedit -- Right click on Image and View image and it opens new image on sepret tab -- Now if you check link you see it have cahnged to https://i.imgur.com/fVVS6e.png --Now copy That link with i.imgur.com --now add to script your link in == private final Image bg = getImage ("https://i.imgur.com/Q6HR6.png"); --Now you should have you Own image printed on screen (Paint guides with url == see the full script here: http://pastebin.com/Ry4A7rcx By :Pug
- 3 replies
-
- url
- backround image
-
(and 5 more)
Tagged with:
-
Hey Started learning how to script a few days ago, and I am now in need of some help I know how to display for how long the script has been running / and how many levels I have gained. How would I go about counting, logging and displaying f.ex amount of logs chopped since I started the script? - what code could I use? Thanks
- 4 replies
-
- beginner
- scripting help
-
(and 2 more)
Tagged with:
-
Quick question on multithreading. My script uses a GUI which has two options: What tree type to cut and another dropbown menu for how big of an area you want to cut in. Now when the area size if being adjusted I want to paint it, while the main scriptloop has not started yet. How can I implement such a function?
- 6 replies
-
- multithreading
- woodcutting
-
(and 1 more)
Tagged with: