Jump to content

datpigeon

Members
  • Posts

    38
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by datpigeon

  1. assuming ~50-60 cb i'd like to know how much an account would be with: 1) just a craw's bow 2) just a viggora's chainmace 3) both craw's bow and viggora's chainmace
  2. Having people click through an aimbooster.com like application to create a "MouseMoveProfile" that tries to mimic the movement patterns of the user's input data
  3. I have 3 questions and I'm sorry if someone's already asked it but there are too many people spamming these release posts, 1) Is there going to be a way to convert mouse movement biometrics into MouseMoveProfiles? (I doubt you guys have the time and/or motivation to do so) 2) Is there going to be a way to import custom flow profiles or is it going to be limited to the profiles provided in the predefined FlowVariety enums? (there might be a way already but I haven't found it) 3) Is there a way to see the api for the dev versions of osbot? I don't know if you have stated where the mouse movement API came from but I am 100% sure it is some modified version of the NaturalMouseMotion by JoonasVali. I have been working on my own implementation of this API in my own osbot scripts from scratch and I know you used JoonasVali's API because of the nature of the different variable movement properties but also more importantly a preview of the mouse movement in action (from this video) made me immediately recognize the overshoot behavior. This is should be a big issue because through my own personal testing, I have not yet found an authentic way to make overshoots look legitimate imo and I believe it could be easily recognizable without modifications.
  4. datpigeon

    Paint API

    sorry for the late response, but yeah you do have to exchange context in the main script (obviously in onStart() is the best place to do it)
  5. A lot of infrequently used functions aren't really as well defined in the api documentation as they could be, you'll probably just have to test it out yourself or see if someone has found it before. Another option that I like doing is using google and in your case I would search "osbot onResponseCode" and there will likely be some links to forum topics here that have some information about it.
  6. assuming good feedback and email access edit: it also has 1 maul, cannon + 4k cballs, gracefull, 47qp, varrock easy diary
  7. ok well I may end up trying that out, i did something similar to that a long time ago but rather than moving the mouse close with some other mouse movement API i just instantly moved the mouse to the x,y position and then used the standard methods to interact with the object and that worked really well for the critical task it needed to do
  8. What methods would you have to override to have osbot universally to implement custom mouse movement like that? I've spent about 4 hours trying to find information on how other people have done it in the past and I only came across 2 different topics that had anything to do with what I am asking/trying to do. Topic 1: This topic slightly addresses my question but the responses got derailed off the topic and is irrelevant to me. In the topic "making your own Mouse.click()" was mentioned which I assume was intended to mean overriding the Mouse.click() and Mouse.move() functions which is not possible because those methods are final and cannot be overridden. And before anyone answers "just make your own function that clicks where you want to click with the custom mouse movement you want to use...", i'm specifically asking how to universally override the mouse movement without having to create every single possible method I would ever need to use that would move the mouse like a new NPC.interact() method, a new Item.interact() method, etc. Topic 2: This topic is almost exactly what I want to be able to do, but the main topic it references (https://osbot.org/forum/topic/47398-semi-advanced-creating-your-own-mouse-controller/) has been moved to a location I cannot see with my osbot account (maybe I need VIP or something but I doubt it) and I went through all the archived topics in the date range that the topic existed and I couldn't find it. To be able to do what this topic below mentions, I need to be able to use the MouseController class (which is in the topic that is referenced above) and I have not found a way to see it. While having the ability to implement custom mouse movement would be really nice, my scripts work entirely fine right now so there is no real urgency here.
  9. datpigeon

    Paint API

    idk if you still need it but i needed it, i just changed all the GraphicUtilities to getDisplay() because of this import java.awt.Color; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Polygon; import java.awt.Rectangle; import java.awt.Shape; import java.awt.geom.Area; import java.awt.geom.Rectangle2D; import java.util.Collection; import java.util.List; import java.util.function.Function; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.Vector3D; import org.osbot.rs07.script.API; /** * Painter utility * * @author LiveRare */ public class PaintAPI extends API { /** * Initialise module */ @Override public void initializeModule() { } /** * Draw line between two in-game points * * @param g - Graphic object * @param entity1 - First entity point * @param entity2 - Second entity point */ public void drawLink(Graphics2D g, Entity entity1, Entity entity2) { Area a1; Area a2; Rectangle2D r1; Rectangle2D r2; Point p1; Point p2; if (entity1 != null && entity2 != null) { a1 = getDisplay().getModelArea(entity1.getGridX(), entity1.getGridY(), entity1.getZ(), entity1.getModel()); a2 = getDisplay().getModelArea(entity2.getGridX(), entity2.getGridY(), entity2.getZ(), entity2.getModel()); r1 = a1.getBounds2D(); r2 = a2.getBounds(); p1 = new Point((int) r1.getCenterX(), (int) r1.getCenterY()); p2 = new Point((int) r2.getCenterX(), (int) r2.getCenterY()); if ((p1.x > 0 || p1.y > 0) && (p2.x > 0 || p2.y > 0)) { g.drawLine(p1.x, p1.y, p2.x, p2.y); } } } /** * Draw minimap area * * @param g - Graphic object * @param area - Area object */ public void drawMinimapArea(Graphics2D g, org.osbot.rs07.api.map.Area area) { Polygon areaPolygon; Polygon minimapPolygon; int minimapX; int minimapY; short[] minimapCoordinates; if (area != null) { areaPolygon = area.getPolygon(); if (areaPolygon != null) { minimapPolygon = new Polygon(); for (int i = 0; i < areaPolygon.npoints; i++) { minimapX = areaPolygon.xpoints[i]; minimapY = areaPolygon.ypoints[i]; minimapCoordinates = getDisplay().getMinimapScreenCoordinate(minimapX, minimapY); if (minimapCoordinates != null) { minimapX = (int) minimapCoordinates[0]; minimapY = (int) minimapCoordinates[1]; minimapPolygon.addPoint(minimapX, minimapY); } } drawShape(g, minimapPolygon); } } } /** * Draw a dynamically generated, position-related string and set its location to * an in-game position * * @param g - Graphic object * @param toString - string function * @param position - Position object */ public <T extends Position> void drawString(Graphics2D g, Function<T, String> toString, T position) { if (toString != null && position != null) { drawString(g, toString.apply(position), position); } } /** * Draw string for a tile * * @param g - Graphic object * @param aString - String object * @param position - Position object * @see {@link PaintAPI#drawString(Graphics2D, String, Rectangle)} */ public void drawString(Graphics2D g, String aString, Position position) { Rectangle2D rectangle; Polygon polygon; if (position != null && position.isVisible(bot)) { polygon = position.getPolygon(bot); if (polygon != null) { rectangle = polygon.getBounds2D(); drawString(g, aString, rectangle.getBounds()); } } } /** * Draw string for an entity * * @param g - Graphic object * @param aString - String object * @param entity - Entity object */ public void drawString(Graphics2D g, String aString, Entity entity) { Rectangle rectangle; if (entity != null && entity.isVisible()) { rectangle = getDisplay().getModelBoundingBox(entity.getGridX(), entity.getGridY(), entity.getZ(), entity.getModel()); if (rectangle != null) { drawString(g, aString, rectangle); } } } /** * Draw entity * * @param g - Graphic object * @param entity - Entity object * @param aString - String object * @param labelTile - <tt>Label relative to tile</tt> * @param click - <tt>Draw click box</tt> * @param cube - <tt>Draw model cube</tt> * @param minimap - <tt>Draw minimap point</tt> * @param tile - <tt>Draw tile</tt> * @param box - <tt>Draw 3D wire-frame box spanning from bottom to top tile</tt> * @param wireframe - <tt>Draw wire-frame</tt> * @see {@link PaintAPI#drawClickBounds(Graphics2D, Entity)} * @see {@link PaintAPI#drawCube(Graphics2D, Entity)} * @see {@link PaintAPI#drawMinimapPoint(Graphics2D, Vector3D)} * @see {@link PaintAPI#drawTile(Graphics2D, Entity)} * @see {@link PaintAPI#drawBox(Graphics2D, Entity)} * @see {@link PaintAPI#drawWireframe(Graphics2D, Entity)} * @see {@link PaintAPI#drawString(Graphics2D, String, Position)} * @see {@link PaintAPI#drawString(Graphics2D, String, Entity)} */ public void drawEntity(Graphics2D g, Entity entity, String aString, boolean labelTile, boolean click, boolean cube, boolean minimap, boolean tile, boolean box, boolean wireframe) { if (entity != null) { if (minimap) { drawMinimapPoint(g, entity); } if (entity.isVisible()) { if (click) { drawClickBounds(g, entity); } if (cube) { drawCube(g, entity); } if (tile) { drawTile(g, entity); } if (box) { drawBox(g, entity); } if (wireframe) { drawWireframe(g, entity); } if (labelTile) { drawString(g, aString, new Position(entity.getX(), entity.getY(), entity.getZ() + 1)); } else { drawString(g, aString, entity); } } } } /** * Draw entity * * @param g - Graphic object * @param entity - Entity object * @param getDescription - get description * @param labelTile - <tt>Label relative to tile</tt> * @param click - <tt>Draw click box</tt> * @param cube - <tt>Draw model cube</tt> * @param minimap - <tt>Draw minimap point</tt> * @param tile - <tt>Draw tile</tt> * @param tileCube - <tt>Draw tile cube</tt> * @param wireframe - <tt>Draw wireframe</tt> * @see {@link PaintAPI#drawEntity(Graphics2D, Entity, String, boolean, boolean, boolean, boolean, boolean, boolean, boolean)} */ public <T extends Entity> void drawEntity(Graphics2D g, T entity, Function<T, String> getDescription, boolean labelTile, boolean click, boolean cube, boolean minimap, boolean tile, boolean tileCube, boolean wireframe) { String aString = null; if (getDescription != null && entity != null) { aString = getDescription.apply(entity); } drawEntity(g, entity, aString, labelTile, click, cube, minimap, tile, tileCube, wireframe); } /** * Draw entities * * @param g - Graphic object * @param entities - Entity object * @param getDescription - get description * @param labelTile - <tt>Label relative to tile</tt> * @param click - <tt>Draw click box</tt> * @param cube - <tt>Draw model cube</tt> * @param minimap - <tt>Draw minimap point</tt> * @param tile - <tt>Draw tile</tt> * @param tileCube - <tt>Draw tile cube</tt> * @param wireframe - <tt>Draw wireframe</tt> * @see {@link PaintAPI#drawEntity(Graphics2D, Entity, String, boolean, boolean, boolean, boolean, boolean, boolean, boolean)} */ 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) { if (entities != null && !entities.isEmpty()) { entities.forEach(entity -> { if (entity != null) { String aString = null; if (getDescription != null) { aString = getDescription.apply(entity); } drawEntity(g, entity, aString, labelTile, click, cube, minimap, tile, tileCube, wireframe); } }); } } /** * Draw box * * @param g - Graphic object * @param entity - Entity object */ private void drawBox(Graphics2D g, Entity entity) { Position bottomTile; Position topTile; if (entity != null) { bottomTile = entity.getPosition(); topTile = new Position(bottomTile.getX(), bottomTile.getY(), bottomTile.getZ() + 1); drawBox(g, bottomTile, topTile); } } /** * Draw box * * @param g - Graphic object * @param bottomTile - Position object A * @param topTile - Position object B * @see {@link PaintAPI#drawShape(Graphics2D, Shape)} */ private void drawBox(Graphics2D g, Position bottomTile, Position topTile) { Polygon bottom; Polygon top; Polygon side1; Polygon side2; Polygon side3; Polygon side4; if (bottomTile != null) { bottom = bottomTile.getPolygon(bot); top = topTile.getPolygon(bot); side1 = new Polygon( new int[]{top.xpoints[0], top.xpoints[1], bottom.xpoints[1], bottom.xpoints[0]}, new int[]{top.ypoints[0], top.ypoints[1], bottom.ypoints[1], bottom.ypoints[0]}, 4); side2 = new Polygon( new int[]{top.xpoints[1], top.xpoints[2], bottom.xpoints[2], bottom.xpoints[1]}, new int[]{top.ypoints[1], top.ypoints[2], bottom.ypoints[2], bottom.ypoints[1]}, 4); side3 = new Polygon( new int[]{top.xpoints[2], top.xpoints[3], bottom.xpoints[3], bottom.xpoints[2]}, new int[]{top.ypoints[2], top.ypoints[3], bottom.ypoints[3], bottom.ypoints[2]}, 4); side4 = new Polygon( new int[]{top.xpoints[3], top.xpoints[0], bottom.xpoints[0], bottom.xpoints[3]}, new int[]{top.ypoints[3], top.ypoints[0], bottom.ypoints[0], bottom.ypoints[3]}, 4); drawShape(g, bottom); drawShape(g, side1); drawShape(g, side2); drawShape(g, side3); drawShape(g, side4); drawShape(g, top); } } /** * Draw wireframe * * @param g - Graphic object * @param entity - Entity object * @see {@link PaintAPI#drawShape(Graphics2D, Shape)} */ private void drawWireframe(Graphics2D g, Entity entity) { List<Polygon> polygons = getDisplay().getModelMeshTriangles(entity.getGridX(), entity.getGridY(), entity.getZ(), entity.getModel()); if (polygons != null && !polygons.isEmpty()) { for (Polygon polygon : polygons) { drawShape(g, polygon); } } } /** * Draw click bounds * * @param g - Graphic object * @param entity - Entity object */ private void drawClickBounds(Graphics2D g, Entity entity) { Rectangle rectangle = getDisplay().getModelBoundingBox(entity.getGridX(), entity.getGridY(), entity.getZ(), entity.getModel()); if (rectangle != null) { drawShape(g, rectangle); } } /** * Draw box around entity * * @param g - Graphic object * @param entity - Entity object */ private void drawCube(Graphics2D g, Entity entity) { Area area = getDisplay().getCubicArea(entity.getGridX(), entity.getGridY(), entity.getZ(), entity.getSizeX(), entity.getSizeY(), entity.getHeight()); if (area != null) { drawShape(g, area); } } /** * Draw minimap point * * @param g - Graphic object * @param v - 3D Vector */ public void drawMinimapPoint(Graphics2D g, Vector3D v) { short[] minimapPosition = null; int x = 0; int y = 0; if (v != null) { minimapPosition = getDisplay().getMinimapScreenCoordinate(v.getX(), v.getY()); if (minimapPosition != null) { x = (int) minimapPosition[0]; y = (int) minimapPosition[1]; drawPoint(g, x, y, 3); } } } /** * Draw links between vectors * * @param g - Graphic object * @param a - 3D Vector A * @param b - 3D Vector B */ public void drawMinimapLink(Graphics2D g, Vector3D a, Vector3D b) { short[] minimapPositionA; short[] minimapPositionB; int x1; int y1; int x2; int y2; if (a != null && b != null) { minimapPositionA = getDisplay().getMinimapScreenCoordinate(a.getX(), a.getY()); minimapPositionB = getDisplay().getMinimapScreenCoordinate(b.getX(), b.getY()); if (minimapPositionA != null && minimapPositionB != null) { x1 = minimapPositionA[0]; y1 = minimapPositionA[1]; x2 = minimapPositionB[0]; y2 = minimapPositionB[1]; if (x1 != x2 && y1 != y2 && (x1 > 0 || y1 > 0) && (x2 > 0 || y2 > 0)) { g.drawLine(x1, y1, x2, y2); } } } } /** * Draw tile * * @param g - Graphic object * @param entity - entity object * @see {@link PaintAPI#drawTile(Graphics2D, Position)} */ public void drawTile(Graphics2D g, Entity entity) { if (entity != null) { drawTile(g, entity.getPosition()); } } /** * Draw tile * * @param g - Graphic object * @param position - Position object */ public void drawTile(Graphics2D g, Position position) { Polygon polygon = null; if (position != null && position.isVisible(bot)) { polygon = position.getPolygon(bot); drawShape(g, polygon); } } /** * Draw point * * @param g - Graphic object * @param point - Point object * @param size - Size of the oval */ public static void drawPoint(Graphics2D g, Point point, int size) { if (point != null) { drawPoint(g, point.x, point.y, size); } } /** * Draw point * * @param g - Graphic object * @param x - X coordinate * @param y - Y coordinate * @param size - Size of the oval */ public static void drawPoint(Graphics2D g, int x, int y, int size) { final Color bg = g.getBackground(); final Color fg = g.getColor(); g.setColor(bg); g.fillOval(x - size, y - size, size * 2, size * 2); g.setColor(fg); g.drawOval(x - size, y - size, size * 2, size * 2); } /** * Draw and fill shape * * @param g - Graphic object * @param shape - Shape object */ public static void drawShape(Graphics2D g, Shape shape) { final Color bg = g.getBackground(); final Color fg = g.getColor(); if (shape != null) { if (bg != null) { g.setColor(bg); g.fill(shape); g.setColor(fg); } g.draw(shape); } } /** * Draw string * * @param g - Graphic object * @param aString - String object * @param x - X coordinate * @param y - Y coordinate */ public static void drawString(Graphics2D g, String aString, int x, int y) { final Color bg = g.getBackground(); final Color fg = g.getColor(); if (aString != null && !aString.isEmpty()) { if (bg != null) { g.setColor(bg); g.drawString(aString, x + 1, y + 1); g.drawString(aString, x + 1, y - 1); g.drawString(aString, x - 1, y + 1); g.drawString(aString, x - 1, y - 1); g.setColor(fg); } g.drawString(aString, x, y); } } /** * Draw string * * @param g - Graphic object * @param aString - String object * @param point - Point object * @see {@link PaintAPI#drawString(Graphics2D, String, int, int)} */ public static void drawString(Graphics2D g, String aString, Point point) { if (point != null) { drawString(g, aString, point.x, point.y); } } /** * Draw centred string above rectangle * * @param g - Graphic object * @param aString - String object * @param rectangle - Rectangle object */ public static void drawString(Graphics2D g, String aString, Rectangle rectangle) { final FontMetrics fontMetrics = g.getFontMetrics(); double x = 0D; double y = 0D; int stringWidth = 0; if (aString != null && !aString.isEmpty() && rectangle != null) { stringWidth = fontMetrics.stringWidth(aString); x += rectangle.getCenterX(); x -= (stringWidth / 2); y = rectangle.getY(); drawString(g, aString, (int) x, (int) y); } } } EDIT1: the paste code below isn't working for me right now but i'll try to fix it EDIT2: nvm i forgot to exchange context
  10. Wow going back and reading this makes me really sad to see the amount of gaslighting going on in an attempt to distract from the point OP was trying to make by creating this thread
  11. https://Advertising other bots isn&#39;t allowed..org/forums/topic/60720-guide-to-implementing-abc2/
  12. yikes didn't know you were gonna get all butthurt about it, but i was talking about scripts in general with anti-ban features like yours
  13. I'm sorry but i don't understand why your script is so special? I see that there are a bunch of cool features, but other bot clients with higher standards of scripts than this one and usually requires/has all of those features and the ban rates are relatively similar in my experience
  14. hey i have a question not entirely related to this thread, how long does it normally take for the issues with the bots to get resolved after a new update and when would i know it's fixed. i make my own private scripts for myself and this is the first time i really encountered a big problem with this
  15. I was thinking about that and using prayer points but I decided there was a good chance that I wouldn't lose a prayer point every game tick, if you don't mind telling me how you do it in pm or something as watching your fire cape bot video did inspire me to find a way to detect the game ticks (im not making a fire cape bot btw). I have a few ideas on how you might be able to determine it, but since I have created this thread I used this code to find a general idea of when the ticks happen (this is in the onPaint method so it updates really fast) gameTick = (int)java.lang.Math.floor((double)getBot().getClient().gameClockMs() / 600); g.drawString("Current Game Tick: " + gameTick,10,250); I know it's probably not the most efficient process, but it was all I could think of right before I went to sleep. I found those methods way before when I was browsing through the possible methods to call (i am probably using the wrong terminology btw, im pretty new to programming in general) like for example: I generally find it more useful browsing through that than wasting time looking at the API, since in the API it NEVER tells you the exact "vaules" that could be returned like for instance a MessageType TypeID returns these values based off of the message: proximity message - TypeID = 2 private message - TypeID = 3 clan message - TypeID = 9 game message - TypeID = 27 autochat message - TypeID = 90 trade message - TypeID = 101 That kind of information is nowhere to be found in the API AT ALL, which imo makes the API pretty much useless. Sorry the majority of this post was off topic, but I hope i learn something from you or other experienced people on this forum. EDIT: just now after testing, I was able to 1 tick flick for a while while only looking at the current game tick that i used, so it should be sufficient enough
  16. i need help determining when the next game tick will be to help with a script i'm writing. I essentially want to do only 1 action during that game tick, and i've tried all the GameTickListener and the deprecated method onGameTick() and i couldn't get either of them to work. So i was wondering if there was anyway to read each game tick and increment a value whenever a new game tick takes place. btw i've tried checking the API for any information and couldn't find a single thing
  17. i think this script has been profiled by jagex i used to be able to run 3 accounts 12 hours a day all the same ip (that i've been ban previously) and now i can't bot 1 account for more than 3 hours on fresh ip's without getting ban even while using the yanille location, which should not have had that many people botting there. Good Luck to future buyers of this script PS: the bot still stops whenever any random appears for it but since we want to blame it on the client (even though no other script has that problem btw) we won't even try to look at the problem
  18. later on ill add that along with falador to a list of locations
  19. i was just seeing how botlike the script was and without anything, but it just looks so obvious except when it does the webwalking so i decided to put that in
  20. This script fills Buckets at the Varrock East fountain and uses them on Clay to make Soft Clay Reasons why I made this script: 1. need to make a script to get scripter status 2. there are no clay softener scripts on this bot client that aren't broken or complete garbage Requirements: 14 buckets in your inventory clay in the bank Source: https://pastebin.com/UnLFGea2 Jar: PigeonClaySoftener.jar Things I know I can improve on it: 1. add the amount of clay made into soft clay into paint 2. create more locations 3. make sure that you can log in with anything in your inventory and not break the script Please let me know what I can improve on, thanks! EDIT (4/17/20): Just came back after a while and just wanted to say that this script probably won't work anymore but I will leave it up so anyone can look at my code to reference.
  21. i finally got everything working just how i like it thanks to everyone who commented with help!
  22. @Explv So i tried your GUI snippet (the GridBagLayout) and i tried to add actions to the buttons on the GUI but i keep getting a null pointer exception on the 18th line (in insertButtonActionPerformed, whitelist.setModel(dm)) and i was hoping you could tell me what i was doing wrong. Would it be a better idea to put the event handlers in the main class like how liverare's tutorial shows or keep them there? here's my code: import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.ActionEvent; import static java.awt.GridBagConstraints.HORIZONTAL; import static java.awt.GridBagConstraints.NONE; public class PigeonGUI { private final JFrame jFrame; DefaultListModel dm = new DefaultListModel(); private void insertButtonActionPerformed(ActionEvent e) { if(nameField.getText() != null) { dm.addElement(nameField.getText()); nameField.setText(null); whitelist.setModel(dm); } } private void deleteButtonActionPerformed(ActionEvent e) { if (whitelist.getSelectedValue() != null) { dm.removeElementAt(whitelist.getSelectedIndex()); whitelist.setModel(dm); } } private void startButtonActionPerformed(ActionEvent e) { this.close(); } public PigeonGUI() { jFrame = new JFrame("Pigeon GUI"); mainPanel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); jFrame.setContentPane(mainPanel); mainPanel.setBorder(new EmptyBorder(10, 10, 10, 10)); titleLabel = new JLabel("Pigeon GUI"); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 4; gbc.insets = new Insets(0, 10, 20, 10); mainPanel.add(titleLabel, gbc); nameLabel = new JLabel("Name:"); gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 1; gbc.insets = new Insets(0, 0, 0, 5); mainPanel.add(nameLabel, gbc); nameField = new JTextField(20); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 1; gbc.insets = new Insets(0, 0, 0, 0); mainPanel.add(nameField, gbc); whitelistScrollPane = new JScrollPane(); JList<String> whitelist = new JList<>(); whitelistScrollPane.add(whitelist); gbc.gridx = 2; gbc.gridy = 1; gbc.ipadx = 200; gbc.ipady = 200; gbc.gridwidth = 2; gbc.insets = new Insets(10, 10, 0, 10); mainPanel.add(whitelistScrollPane, gbc); insertButton = new JButton("Insert"); insertButton.addActionListener(e -> insertButtonActionPerformed(e)); gbc.gridx = 2; gbc.gridy = 2; gbc.fill = HORIZONTAL; gbc.weightx = 0.5; gbc.gridwidth = 1; gbc.ipadx = 0; gbc.ipady = 0; gbc.insets = new Insets(10, 10, 0, 10); mainPanel.add(insertButton, gbc); deleteButton = new JButton("Delete"); deleteButton.addActionListener(e -> deleteButtonActionPerformed(e)); gbc.gridx = 3; gbc.gridy = 2; gbc.fill = HORIZONTAL; gbc.weightx = 0.5; gbc.gridwidth = 1; gbc.ipadx = 0; gbc.ipady = 0; gbc.insets = new Insets(10, 10, 0, 10); mainPanel.add(deleteButton, gbc); startButton = new JButton("Start"); startButton.addActionListener(e -> startButtonActionPerformed(e)); gbc.gridwidth = 4; gbc.gridx = 0; gbc.gridy = 3; gbc.fill = NONE; gbc.insets = new Insets(20, 10, 0, 10); mainPanel.add(startButton, gbc); jFrame.pack(); // resize the JFrame so that all the components are at or above their preferred sizes jFrame.setLocationRelativeTo(jFrame.getOwner()); // center the gui on bot client } //test variables private JPanel mainPanel; private JLabel titleLabel; private JLabel nameLabel; private JTextField nameField; private JScrollPane whitelistScrollPane; private JList<String> whitelist; private JButton insertButton; private JButton deleteButton; private JButton startButton; //end test variables public void open() { jFrame.setVisible(true); } public void close() { jFrame.setVisible(false); jFrame.dispose(); } public static void main(String[] args) { SwingUtilities.invokeLater(() -> new PigeonGUI().open()); } }
  23. i'm assuming it would be a better idea to use a GUI designer until i understand what each of the layouts do and what should go where, but ill use your snippets as a guide in the future, thanks!
  24. yeah i have looked at your GUI implementing tutorial, but i have never done anything dealing with atomic variables in my cs classes so far. I would like to understand what im doing when i make anything rather than copy pasting or half understanding what is going on, but if nothing else works in this thread ill give it try.
  25. so i tried to that (i used run instead of main for the function name) and when i started the script, nothing happened at all. Even the logger didn't even show that a script started and whenever i try to rebuild the project it says it can't delete the .jar file until i close that instance of the osbot client here's my code //in the main class public class Main extends Script { private PigeonGUI gui = new PigeonGUI(); private Settings s = new Settings(); @Override public void onStart() throws InterruptedException { log("Starting Script"); gui.run(s); } @Override public int onLoop() throws InterruptedException { if (!gui.isVisible()) { //bot code here return random(200, 600); } return random(200, 600); } } //in the GUI class public class PigeonGUI extends JFrame { //GUI code here public void run(Settings settings) { JFrame frame = new PigeonGUI(); frame.setVisible(true); } } i have 2 return statements in onLoop and one shouldn't be there but the script doesn't even get past onStart to get there so it isn't a problem
×
×
  • Create New...