Swizzbeat Posted March 20, 2014 Posted March 20, 2014 Is there a method like "repaint()" to do this or a way to grab the bots graphics context?
FrostBug Posted March 20, 2014 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
Swizzbeat Posted March 20, 2014 Author 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
UltraScripts Posted March 23, 2014 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