Jump to content

Search the Community

Showing results for tags 'osbot api'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • OSBot
    • News & Announcements
    • Community Discussion
    • Bot Manager
    • Support Section
    • Mirror Client VIP
    • Script Factory
  • Scripts
    • Official OSBot Scripts
    • Script Factory
    • Unofficial Scripts & Applications
    • Script Requests
  • Market
    • OSBot Official Voucher Shop
    • Currency
    • Accounts
    • Services
    • Other & Membership Codes
    • Disputes
  • Graphics
    • Graphics
  • Archive

Product Groups

  • Premium Scripts
    • Combat & Slayer
    • Money Making
    • Minigames
    • Others
    • Plugins
    • Agility
    • Mining & Smithing
    • Woodcutting & Firemaking
    • Fishing & Cooking
    • Fletching & Crafting
    • Farming & Herblore
    • Magic & Prayer
    • Hunter
    • Thieving
    • Construction
    • Runecrafting
  • Donations
  • OSBot Membership
  • Backup

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


MSN


Website URL


ICQ


Yahoo


Skype


Location:


Interests

Found 1 result

  1. The code compiles fine, however when attempting to run via OSBot, the script doesn't run. Any idea? FYI: The script is meant to identify combat details of a player upon typing '!stats' and then type out this information. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.Arrays; import org.osbot.Hi; import org.osbot.rs07.api.ui.Message; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.net.MalformedURLException; import java.util.ArrayList; @ScriptManifest(name = "Highscores", author = "OsBot", version = 1, logo = " ", info = "Highscores") public class Highscores extends Script { private final ArrayList<String> stats = new ArrayList<String>(); public Highscores(final String player) { getStats(player); } public void onMessage(Message message) throws InterruptedException { String text = message.getMessage().toLowerCase(); String username = message.getUsername().toLowerCase(); Highscores highscores = new Highscores(username); if(text.contains("!stats")) { log("---"); getKeyboard().typeString("Atk:" + highscores.getSkillLevel(Skill.ATTACK) + ",Str:" + highscores.getSkillLevel(Skill.STRENGTH) + ",Def:" + highscores.getSkillLevel(Skill.DEFENCE) + ",Range:" + highscores.getSkillLevel(Skill.RANGED) + ",Mage:" + highscores.getSkillLevel(Skill.MAGIC)); } } @Override public void onStart() { this.getBot().addMessageListener(this); } @Override public int onLoop() throws InterruptedException { return random(400,600); } public int getSkillLevel(final Skill skill) { int index = getSkillIndex(skill); String[] array = stats.get(index).split(","); return Integer.parseInt(array[1]); } public int getSkillExperience(final Skill skill) { int index = getSkillIndex(skill); String[] array = stats.get(index).split(","); return Integer.parseInt(array[2]); } private void getStats(final String player) { try { URL url = new URL("https://secure.runescape.com/m=hiscore_oldschool/index_lite.ws?player=" + player); URLConnection con = url.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) { stats.add(inputLine); } in.close(); } catch (MalformedURLException e) { // CATCH } catch (IOException e) { // CATCH } } private int getSkillIndex(final Skill skill) { return Arrays.asList(Skill.values()).indexOf(skill) + 1; } }
×
×
  • Create New...