Swizzbeat Posted March 20, 2014 Share Posted March 20, 2014 Is there a method like "repaint()" to do this or a way to grab the bots graphics context? Link to comment Share on other sites More sharing options...
FrostBug Posted March 20, 2014 Share Posted March 20, 2014 (edited) Bot class has a public getter for BotCanvas, which you can repaint or grab Graphics from; However, the getter is reobfuscated with every release I suppose you could grab it between compilations using reflection; Try something like this.. Field[] fields = bot.getClass().getDeclaredFields(); BotCanvas canvas = null; for (Field field : fields) { if (field.getType().isAssignableFrom(BotCanvas.class)) { try { field.setAccessible(true); canvas = (BotCanvas) field.get(bot); } catch (IllegalArgumentException | IllegalAccessException ex) { //Exception handling } } } if(canvas != null) { Graphics g = canvas.getGraphics(); //Grab graphics context canvas.repaint(); //Repaint } Edited March 20, 2014 by FrostBug Link to comment Share on other sites More sharing options...
Swizzbeat Posted March 20, 2014 Author Share Posted March 20, 2014 (edited) Bot class has a public getter for BotCanvas, which you can repaint or grab Graphics from; However, the getter is reobfuscated with every release I suppose you could grab it between compilations using reflection; Try something like this.. Field[] fields = bot.getClass().getDeclaredFields(); BotCanvas canvas = null; for (Field field : fields) { if (field.getType().isAssignableFrom(BotCanvas.class)) { try { field.setAccessible(true); canvas = (BotCanvas) field.get(bot); } catch (IllegalArgumentException | IllegalAccessException ex) { //Exception handling } } } if(canvas != null) { Graphics g = canvas.getGraphics(); //Grab graphics context canvas.repaint(); //Repaint } Yeah I was trying to avoid doing this because of, like you said, the obfuscation. I'll try this code out and see what I can do thanks EDIT: Tried both this code out as well as getting the canvas directly and they both just lead to an onStart error being supressed. Here's the message when I log the BotCanvas: bx[canvas0,0,0,765x503,invalid] EDIT EDIT: Nevermind found the real issue. It's grabbing the canvas context fine but for some reason when I'm trying to get the bounding box of a specific object it's returning null... Edited March 21, 2014 by Swizzbeat Link to comment Share on other sites More sharing options...
UltraScripts Posted March 23, 2014 Share Posted March 23, 2014 Yeah I was trying to avoid doing this because of, like you said, the obfuscation. I'll try this code out and see what I can do thanks EDIT: Tried both this code out as well as getting the canvas directly and they both just lead to an onStart error being supressed. Here's the message when I log the BotCanvas: bx[canvas0,0,0,765x503,invalid] EDIT EDIT: Nevermind found the real issue. It's grabbing the canvas context fine but for some reason when I'm trying to get the bounding box of a specific object it's returning null... you reobsucate the biometric sphere and replace it with botcanvas 1 Link to comment Share on other sites More sharing options...
Sigma Posted March 25, 2014 Share Posted March 25, 2014 Why do you want to do this? Link to comment Share on other sites More sharing options...