Jump to content

Cory

Members
  • Posts

    311
  • Joined

  • Last visited

  • Days Won

    3
  • Feedback

    100%

Everything posted by Cory

  1. Ohhh yeah, haha completely slipped my mind when i thought about that.
  2. Cory

    API Link

    www.osbot.org/api
  3. I'm sorry, what...? user B claims the $200 that user A scammed him for...
  4. Don't even think about it... User A: Buys it for $200 User B: Selling 60m, $200 User A: I'll buy it, scams him. User B: Got scammed, claims the $200 back. User A & User B = friends and just made $200.
  5. Cory

    Skill Monitor

    onStart; SkillMonitor.resetSkills(); onLoop or onPaint; SkillMonitor.updateSkills(client.getSkills()); use as; SkillMonitor.xpGained(Skill.MINING) Class; import org.osbot.script.rs2.skill.Skill; import org.osbot.script.rs2.skill.Skills; import java.util.Collection; import java.util.HashMap; /** * User: Cory * Date: 26/06/13 * Time: 06:41 */ public class SkillMonitor { private static HashMap<Skill, Monitor> monitors = new HashMap<Skill, Monitor>(); public static Monitor get(Skill skill) { Monitor mon = monitors.get(skill); if(mon == null) { mon = new Monitor(); mon.skill = skill; monitors.put(skill, mon); } return mon; } public static void updateSkills(Skills skills){ for(Monitor mon : values()) { int currentXp = skills.getExperience(mon.skill); if(mon.currentXp > 0) mon.lastGainedXp = currentXp-mon.currentXp; if(mon.currentXp != currentXp && mon.startXp <= 0 && mon.currentXp >= 0) { mon.startXp = mon.currentXp; mon.startLevel = mon.currentLevel; mon.startedTraining = System.currentTimeMillis(); } mon.currentXp = currentXp; mon.currentLevel = skills.getCurrentLevel(mon.skill); mon.actualLevel = skills.getLevel(mon.skill); mon.xpToLvl = xPForLevel(mon.currentLevel+1)-mon.currentXp; } } public static int xpGained(Skill skill) { if(startXp(skill) <= 0) return 0; return currentXp(skill)-startXp(skill); } public static int lvlGained(Skill skill) { if(startXp(skill) <= 0) return 0; return currentLvl(skill)-startLvl(skill); } public static int xpToLvl(Skill skill) { return get(skill).xpToLvl; } public static int startXp(Skill skill) { return get(skill).startXp; } public static int startLvl(Skill skill) { return get(skill).startLevel; } public static int currentXp(Skill skill) { return get(skill).currentXp; } public static int currentLvl(Skill skill) { return get(skill).currentLevel; } public static int xPForLevel(int level) { int points = 0; int output = 0; for (int lvl = 1; lvl <= level; lvl++) { points += Math.floor((double)lvl + 300.0 * Math.pow(2.0, (double)lvl / 7.0)); if (lvl >= level) return output; output = (int)Math.floor(points / 4); } return 0; } public static void resetSkills() { monitors.clear(); } public static Collection<Monitor> values() { return monitors.values(); } public static class Monitor { public int startXp = -1, startLevel = 0, lastGainedXp; public int currentXp = -1, currentLevel = -1, actualLevel = -1; public long startedTraining = -1; public Skill skill = null; public int xpToLvl = 0; } }
  6. public static RS2Object closestObjectWithAction(Script script, String action) { List<RS2Object> allObjects = script.client.getCurrentRegion().getObjects(); List<RS2Object> objects = new ArrayList<RS2Object>(); if(allObjects != null && allObjects.size() > 0) { for(RS2Object object : allObjects) { if(object != null && hasAction(object, action)) objects.add(object); } } return (RS2Object) closest(script, objects); } public static NPC closestNPCWithAction(Script script, String action) { List<NPC> allNPCs = script.client.getLocalNPCs(); List<NPC> NPCs = new ArrayList<NPC>(); if(allNPCs != null && allNPCs.size() > 0) { for(NPC npc : allNPCs) { if(npc != null && hasAction(npc, action)) NPCs.add(npc); } } return (NPC) closest(script, NPCs); } public static Entity closest(Script script, List<? extends Entity> entities) { Entity closest = null; for (Entity entity : entities) { if(closest == null) closest = entity; if(script.distance(entity) < script.distance(closest)) closest = entity; } return closest; } public static boolean hasAction(NPC npc, String action) { NPCDefinition i = npc.getDefinition(); return hasAction(i.getActions(), action); } public static boolean hasAction(RS2Object object, String action) { ObjectDefinition i = object.getDefinition(); return hasAction(i.getActions(), action); } public static boolean hasAction(String[] actions, String action) { for(String a : actions) { if(action.equals(a)) return true; } return false; }
  7. Step 1 - Determine if its your pc, or the scripts. Press the windows key followed by R You should get Type in the Open field: "%USERPROFILE%/OSBot/" and press enter. This will open up your OSBot folder, now navigate into the scripts folder Now, remove all scripts and add them back 1 at a time, if 1 of them shows up, its the scipts. But if you're not sure, do step 2 as well.. Step 2 - Get the latest JRE AND JDK Navigate to "http://www.oracle.com/technetwork/java/javase/downloads/index.html", you should see Download the JDK and the JRE links, install both of them, and then restart your pc. (to ensure they were setup/installed fully). Step 3 - Still can't get your local scripts to load? Leave me a pm or a reply and I'll get back to you.
  8. Cory

    Clipping Flags

    . public int getFlag(int x, int y) { XClippingPlane clipping = client.getClippingPlanes()[client.getPlane()]; int mx = client.getMapBaseX(), my = client.getMapBaseY(); int[][] flags = clipping.getTileFlags(); return flags[x-mx][y-my]; } . public enum Flag { WALL_NORTHWEST(0x1), WALL_NORTH(0x2), WALL_NORTHEAST(0x4), WALL_EAST(0x8), WALL_SOUTHEAST(0x10), WALL_SOUTH(0x20), WALL_SOUTHWEST(0x40), WALL_WEST(0x80), OBJECT_TILE(0x100), WALL_BLOCK_NORTHWEST(0x200), WALL_BLOCK_NORTH(0x400), WALL_BLOCK_NORTHEAST(0x800), WALL_BLOCK_EAST(0x1000), WALL_BLOCK_SOUTHEAST(0x2000), WALL_BLOCK_SOUTH(0x4000), WALL_BLOCK_SOUTHWEST(0x8000), WALL_BLOCK_WEST(0x10000), OBJECT_BLOCK(0x20000), DECORATION_BLOCK(0x40000), MAP_BLOCK(0x200000), WALL_ALLOW_PROJECTILE_NORTHWEST(0x400000), WALL_ALLOW_PROJECTILE_NORTH(0x800000), WALL_ALLOW_PROJECTILE_NORTHEAST(0x1000000), WALL_ALLOW_PROJECTILE_EAST(0x2000000), WALL_ALLOW_PROJECTILE_SOUTHEAST(0x4000000), WALL_ALLOW_PROJECTILE_SOUTH(0x8000000), WALL_ALLOW_PROJECTILE_SOUTHWEST(0x10000000), WALL_ALLOW_PROJECTILE_WEST(0x20000000), OBJECT_ALLOW_PROJECTILE(0x40000000), BLOCKED(0x1280100); private int flag; Flag(int flag) { this.flag = flag; } public int getFlag() { return this.flag; } } .
  9. Knowing the API is one of the most essential things when scripting, If you don't know where to look for things, or where the things you need are, how do you expect to be able to get anywhere? Making a script is actually very easy all you need to do is turn the actions required into a list... For example: Basic woodcutter; if im in the bank and my inventory isn't empty, empty inventory if im in the bank and my inventory is empty, walk to the trees if im at the trees and my inventory isn't full, chop the trees if im at the trees and my inventory is full, walk to the bank ​ import org.osbot.script.Script; import org.osbot.script.ScriptManifest; import org.osbot.script.rs2.ui.Bank; import org.osbot.script.rs2.utility.Area; import java.awt.*; /** * User: Cory * Date: 20/06/13 * Time: 22:06 */ @ScriptManifest(name = "WoodCutter", author = "Cory", version = 1, info="") public class WoodCutter extends Script { private Area bank; private Area trees; @Override public void onStart() { try { //anything that needs to be done before your script runs. //We'll use this to initialise the areas. bank = new Area(bottomLeftX, bottomLeftY, topRightX, topRightY); trees = new Area(bottomLeftX, bottomLeftY, topRightX, topRightY); //Obviously replace the values with correct info. } catch (Exception e){} } @Override public int onLoop() throws InterruptedException { boolean isInventoryEmpty = client.getInventory().isEmpty(); boolean isInventoryFull = client.getInventory().isFull(); //if im in the bank if(bank.contains(myPlayer())) { //my inventory isn't empty if(!isInventoryEmpty) { Bank bank = client.getBank(); //empty inventory //...open bank //deposit inventory bank.depositAll(); //close bank bank.close(); } //my inventory is empty if(isInventoryEmpty) { //walk to the trees walk(trees); } } //if im at the trees if(trees.contains(myPlayer())) { //my inventory isn't full if(!isInventoryFull) { //chop the trees } //my inventory is full if(isInventoryFull) { //walk to the bank walk(bank); } } return 100; } @Override public void onPaint(Graphics g){ //Draw anything you would like onto the client //Such as a paint etc } }
  10. I like minimalist designs, I think anything with too much detail looks awful. (And I'm shit at graphics)
  11. You shouldn't limit people to 1 IDE, let them choose. Show tutorials on how to set-up OSBot with intellij, netbeans and eclipse. (main 3, imo)
  12. HomePage About Page (working on design/content) Contact Page Scripts Page (working on design/content) Request Page (working on design/content) Feedback Page (working on design/content)
  13. I pick five letters and I list them. The next poster has to make a sentence using just the five letters. Like this; D T B I A ..Damn, This bot is amazing. Then he posts 5 letters Start this off with F H G O D
  14. Cory

    3 Wishes?

    Having an infinite amount of wishes...sounds fun, for maybe a year tops. then everything will get really boring. Personally I wouldn't wish for anything, I'm happy the way I am, I'm helpful, trust worthy and reliable. nothing else matters.
  15. There is a place, the thread related to the script?
  16. the .jar that runs the client IS the right one.
  17. Cory

    Future Logo (maybe)

    put http://puu.sh/35yjg.png in ur post
×
×
  • Create New...