Jack Posted December 23, 2013 Posted December 23, 2013 (edited) Hi scripters. Here is code to put a mini screen the user can use to babysit their bot. import java.awt.BorderLayout; import java.awt.Graphics; import java.awt.image.BufferedImage; import javax.swing.JFrame; import javax.swing.JPanel; public class GUI extends JFrame{ private JPanel contentPane; BufferedImage capture; public GUI() { setResizable(false); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setSize(384, 255); contentPane = new JPanel(); setContentPane(contentPane); JPanel panel = new JPanel(); contentPane.add(panel, BorderLayout.CENTER); } public void paint(Graphics g) { g.drawImage(capture,2,30,getContentPane().getWidth(),getContentPane().getHeight(),getContentPane()); } public void setImage(BufferedImage image) { capture = image; } } How to Implement: BufferedImage capture; GUI gui; public int onLoop() throws InterruptedException { capture = client.getColorPicker().getBufferedImage(); gui.setImage(capture); gui.repaint(); return 200; } public void onStart(){ gui = new GUI(); gui.setVisible(true); } Edited December 23, 2013 by 25sittin25m 1
merch999k Posted December 23, 2013 Posted December 23, 2013 that would be good for people who are vip and need to overview all of their bots, otherwise theres not really an essential point to it
W8621 Posted January 3, 2014 Posted January 3, 2014 Nice man, I wish i knew how to use it loookks guuuud!
Ericthecmh Posted January 3, 2014 Posted January 3, 2014 Wow, this is a really clever idea. You should have release this sooner now OSBot 2 is gonna come out
Kenneh Posted January 8, 2014 Posted January 8, 2014 Note that it's a resource waste and it won't draw paint information. It's funny to watch though
TheScrub Posted January 15, 2014 Posted January 15, 2014 instead of putting it on in the on loop wouldn't it be better for script performance to put it in the paint thread?
Jack Posted January 15, 2014 Author Posted January 15, 2014 instead of putting it on in the on loop wouldn't it be better for script performance to put it in the paint thread? no because then it would be called 60 times per second not 5 times per second
Beau Posted February 4, 2014 Posted February 4, 2014 I believe the Robot class in java can make this easier.