kushroom Posted January 8, 2017 Posted January 8, 2017 can someone do a massive solid for me and compile this? It'll save me the hour or two figuring it out Really? All you do is go to the tutorials section, find the script skeleton. Than add the code to the onStart() method. Not hard, id recommend learning some java if you wish to handle scripts, look on youtube for the boston or something like that. He teaches everything from variables to polymorphism, and abstract classes.
Jeune Padawan Posted March 11, 2017 Posted March 11, 2017 (edited) Here's the proper way of doing it : import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import javax.swing.*; import java.awt.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; @ScriptManifest(author = "Purple", name = "IP Display Changer", version = 1.01, info = "Changes the title of your osbot to display your bots IP address.", logo = "") public class Display extends Script { @Override public void onStart() { changeFrameTitle("OSBot (" + getCurrentIPAddress() + ")"); stop(false); } public void changeFrameTitle(final String title) { for(Frame frame : Frame.getFrames()) { if(frame.isVisible() && frame.getTitle().startsWith("OSBot")) { SwingUtilities.invokeLater(() -> frame.setTitle(title)); break; } } } public int onLoop() throws InterruptedException { return 0; } public String getCurrentIPAddress() { try { URL url = new URL("http://myip.dnsomatic.com/"); BufferedReader b = new BufferedReader(new InputStreamReader(url.openStream())); String ip = b.readLine(); b.close(); return ip; } catch (Exception e) { e.printStackTrace(); } return "null"; } } Edited March 11, 2017 by Jeune Padawan
Coolst0rybr0 Posted August 29, 2017 Posted August 29, 2017 On 3/12/2017 at 2:21 AM, M1tch said: someone compile for me plz i pay u 1m this