Guest User

Untitled

a guest
May 9th, 2017
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. package TestScript;
  2. //javac -classpath external.jar com.mycompay/myClass.java
  3. //javac -classpath /Desktop/OSbotetc thisClass.java
  4. //jar cf myJar.jar myClass.class
  5.  
  6. import org.osbot.rs07.api.ui.Skill;
  7. import org.osbot.rs07.api.Skills;
  8. import org.osbot.rs07.script.Script;
  9. import org.osbot.rs07.script.ScriptManifest;
  10.  
  11. import java.io.IOException;
  12. import java.net.*;
  13.  
  14.  
  15.  
  16. public class TestScript extends Script {
  17.  
  18.     public void onStart() {
  19.         log("Starting to Collect");
  20.  
  21.         this.getSkillLevel();
  22.     }
  23.  
  24.     public void onExit() {
  25.  
  26.     }
  27.  
  28.     public final int onLoop() throws InterruptedException {
  29.         return 0;
  30.     }
  31.  
  32.     public void getSkillLevel() {
  33.         String url = "http://127.0.0.1:5000/";
  34.         try {
  35.             URL urlObj = new URL(url);
  36.             HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();
  37.             conn.setRequestMethod("GET");
  38.             conn.setRequestProperty("User-Aget", "Mozilla/5.0");
  39.             int responseCode = conn.getResponseCode();
  40.             log(responseCode);
  41.         } catch (Exception e) {
  42.             e.printStackTrace();
  43.         }
  44.     }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment