Jump to content

Ryan

Member
  • Content count

    665
  • Joined

  • Last visited

About Ryan

  • Rank
    Adamant Member
  • Birthday 01/23/1998

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ryan

    Refactored 317

    If you have any corrections or something new I haven't refactored yet please post here. The current Github commit is broken so if you're interested in using this use the archived working version from MediaFire below. [B]Github:[/B] [URL]https://github.com/Rabrg/refactored-client/tree/master/[/URL] [B]Download:[/B] [URL="http://www.mediafire.com/download/8vz4d9a585489rf/refactored_317.rar"]refactored_317.rar[/URL] [B]Completely refactored:[/B] [LIST] [*] GameShell [*] GameFrame [*] Archive [*] Index [*] IdentityKit [*] ActorDefinition [*] ItemDefinition [*] OnDemandNode [*] OnDemandRequester [*] Requester [*] ImageRGB [*] IndexedImage [*] ModelHeader [*] ProducingGraphicsBuffer [*] Rasterizer [*] Skins [*] TypeFace [*] VertexNormal [*] Widget [*] Buffer [*] BufferedConnection [*] ISAACCipher [*] Cache [*] CachableNode [*] HashTable [*] LinkedList [*] Node [*] Queue [*] Renderable [*] Projectile [*] CollisionMap [*] SoundFilter [*] SoundTrack [*] SoundTrackEnvelope [*] SoundTrackInstrument [*] ChatEncoder [*] MouseCapturer [*] TextUtils [*] SignLink [/LIST] [B]Credits:[/B] [LIST] [*] [URL="http://www.****************/members/veer/"]super_[/URL] - The sound system, OnDemandRequester, CollisionMap [*] [URL="http://www.****************/members/discardedx2/"]`Discardedx2[/URL] - The original deob [*] [URL="http://www.****************/members/maxi/"]Maxi[/URL] - Map related classes [*] [URL="http://www.****************/members/peterbjornx/"]Peterbjornx[/URL] - Model related classes [/LIST]
  2. I'm making a program that requires at least 24 screenshots per second to be captured. Currently with the code below I'm only getting 1 per every ~94 milliseconds, so about 10 per second. I'd prefer not to use any 3rd party libraries because I'm trying to keep it as small as possible, but if I'd get significant performance increase I'd be willing to. I'm also trying to keep this platform independent, but again, if it would be a really significant performance increase I'd be willing to keep it limited to Windows. edit: I've now tried it two different ways as well; using a snippet found on oracles website and the one pointed out in the comments below. All three took around the same time, 2.1-2.2 million nanoseconds which is pretty damn inefficient. [code] public abstract class Benchmark { private final int iterations; public Benchmark(int iterations) { this.iterations = iterations; } public abstract void logic(); public void start() { long start = System.nanoTime(); for (int iteration = 0; iteration < iterations; iteration++) { logic(); } long total = (System.nanoTime() - start); System.out.println(iterations + " iterations took: " + total + " nanoseconds. Average iteration was: " + (total / iterations)); } } [/code] [code]import java.awt.AWTException; import java.awt.GraphicsEnvironment; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.peer.RobotPeer; import sun.awt.SunToolkit; [MENTION=19271]supp[/MENTION]ressWarnings("restriction") public class RobotPeerBenchmark extends Benchmark { private final SunToolkit toolkit; private final RobotPeer peer; private final Rectangle screenRectangle; private int[] screen; public static void main(String[] args) { try { Benchmark robotPeerBenchmark = new RobotPeerBenchmark(24); robotPeerBenchmark.start(); } catch (AWTException e) { e.printStackTrace(); } } public RobotPeerBenchmark(int iterations) throws AWTException { super(iterations); toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); peer = toolkit.createRobot(new Robot(), GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()); screenRectangle = new Rectangle(toolkit.getScreenSize()); screen = new int[screenRectangle.width * screenRectangle.height]; } [MENTION=15855]Over[/MENTION]ride public void logic() { screen = peer.getRGBPixels(screenRectangle); } } [/code] [code]import java.awt.AWTException; import java.awt.GraphicsDevice; import java.awt.Headles***ception; import java.awt.Rectangle; public class DirectRobotBenchmark extends Benchmark { private final GraphicsDevice device; private final Rectangle screenRectangle; private final DirectRobot robot; private int[] screen; public static void main(String[] args) { Benchmark benchmark; try { benchmark = new DirectRobotBenchmark(24); benchmark.start(); } catch (Headles***ception | AWTException e) { e.printStackTrace(); } } public DirectRobotBenchmark(int iterations) throws Headles***ception, AWTException { super(iterations); device = DirectRobot.getDefaultScreenDevice(); screenRectangle = new Rectangle(1920, 1080); robot = new DirectRobot(device); screen = new int[screenRectangle.width * screenRectangle.height]; } [MENTION=15855]Over[/MENTION]ride public void logic() { screen = robot.getRGBPixels(screenRectangle); } } [/code] [code]import java.awt.AWTException; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; public class RobotBenchmark extends Benchmark { private final Robot robot; private final Rectangle screen; public static void main(String[] args) { Benchmark benchmark; try { benchmark = new RobotBenchmark(24); benchmark.start(); } catch (AWTException e) { e.printStackTrace(); } } public RobotBenchmark(int iterations) throws AWTException { super(iterations); robot = new Robot(); screen = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); } [MENTION=15855]Over[/MENTION]ride public void logic() { robot.createScreenCapture(screen); } } [/code]
  3. [B]Refactored clients:[/B] [LIST] [*]Pre 194: [URL="http://www.mediafire.com/?kctvrabc568lnbr"]Refactored pre 194[/URL] [*]194: [URL="http://www.mediafire.com/?dc68q9uempdap3w"]Refactored 194[/URL] [*]217: [URL="http://www.mediafire.com/?en25i370kwcu11q"]Refactored 217[/URL] [*]289: [URL="http://www.mediafire.com/?f4u36oz8829mzzz"]Refactored 289[/URL] [*]317: [URL="http://Refactored 317"]R[/URL][URL="http://www.mediafire.com/?8vz4d9a585489rf"]efactored 317[/URL] [*]331: [URL="http://www.mediafire.com/?jrx6chm3wff90i5"]Refactored 331 with loader[/URL] [*]369: [URL="http://www.mediafire.com/?ipdc32bmfw090vw"]Refactored 369[/URL] [*]377: [URL="http://www.mediafire.com/?4qiq896d1eo140z"]Refactored 377[/URL] [/LIST]
  4. Ryan

    Which is better?

    [CODE]import java.util.HashMap; import java.util.Map; /** * Represents types of bows. * */ public enum Bow { /** * Normal bow. */ NORMAL(-1, -1, -1), // XXX: id, lvl, exp /** * Oak bow. */ OAK(-1, -1, -1), /** * Willow bow. */ WILLOW(-1, -1, -1); /** * The id. */ private int id; /** * The level. */ private int level; /** * The exp. */ private double exp; /** * A map of item ids' to bows. */ private static Map<Integer, Bow> bows = new HashMap<Integer, Bow>(); /** * Gets a bow by an item id. * * [MENTION=75098]Para[/MENTION]m item * The item id. * @return The bow, or <code>null</code> if the item is not a bow. */ public static Bow forId(int item) { return bows.get(item); } /** * Populates the bow map. */ static { for (Bow bow : Bow.values()) { bows.put(bow.id, bow); } } /** * Creates the bow. * * [MENTION=75098]Para[/MENTION]m id * The id. * [MENTION=75098]Para[/MENTION]m level * The required level. * [MENTION=75098]Para[/MENTION]m exp * The exp given. */ private Bow(int id, int level, double exp) { this.id = id; this.level = level; this.exp = exp; } /** * Gets the id. * * @return The id. */ public int getId() { return id; } /** * Gets the required level. * * @return The required level. */ public int getRequiredLevel() { return level; } /** * Gets the exp given. * * @return The exp given. */ public double getExp() { return exp; } } [/CODE]
  5. Ryan

    NPC dump

    [COLOR=#333333]the revision is whatever runescape is currently at[/COLOR]
  6. Ryan

    NPC dump

    719 is the highest it goes. the revision is whatever runescape is currently at
  7. Ryan

    Sound effects

    [B]Sound effect container:[/B] [CODE]/** * Represents a single sound effect request. */ public class SoundEffect { /** * Different sound effect constants. */ public static final SoundEffect EAT = SoundEffect.create(317); public static final SoundEffect DRINK = SoundEffect.create(334); /** * Creates a sound effect with the default volume and no delay. * @param id The sound effect id. * @return The new sound effect object. */ public static SoundEffect create(int id) { return SoundEffect.create(id, 1, 0); } /** * Creates a sound effect no delay. * @param id The sound effect id. * @param volume The sound effect volume. * @return The new sound effect object. */ public static SoundEffect create(int id, int volume) { return SoundEffect.create(id, volume, 0); } /** * Creates a sound effect. * @param id The sound effect id. * @param volume The sound effect volume. * @param delay The sound effect delay. * @return The new sound effect object. */ public static SoundEffect create(int id, int volume, int delay) { return new SoundEffect(id, volume, delay); } /** * The id. */ private final int id; /** * The volume. */ private final int volume; /** * The delay. */ private final int delay; /** * Creates a sound effect. * @param id The id. * @param volume The volume. * @param delay The delay. */ private SoundEffect(int id, int volume, int delay) { this.id = id; this.volume = volume; this.delay = delay; } /** * Gets the id. * @return The id. */ public int getId() { return id; } /** * Gets the volume. * @return The volume. */ public int getVolume() { return volume; } /** * Gets the delay. * @return The delay. */ public int getDelay() { return delay; } } [/CODE] [B]317 packets:[/B] [CODE] /** * Sends a sound effect request. * @param soundEffect The sound effect being requested. * @return The action sender instance, for chaining. */ public ActionSender sendSoundEffect(SoundEffect soundEffect) { player.write(new PacketBuilder(174).putShort(soundEffect.getId()).put((byte) soundEffect.getVolume()).putShort(soundEffect.getDelay()).toPacket()); return this; } /** * Sends a sound track request. * @param trackId The id of the track being requested. * @return The action sender instance, for chaining. */ public ActionSender sendSoundTrack(int trackId) { player.write(new PacketBuilder(74).putLEShort(trackId).toPacket()); return this; }[/CODE] [B]377 packets:[/B] [CODE] /** * Sends a sound effect request. * @param soundEffect The sound effect being requested. * @return The action sender instance, for chaining. */ public ActionSender sendSoundEffect(SoundEffect soundEffect) { player.write(new PacketBuilder(26).putShort(soundEffect.getId()).put((byte) soundEffect.getVolume()).putShort(soundEffect.getDelay()).toPacket()); return this; } /** * Sends a sound track request. * @param trackId The id of the track being requested. * @return The action sender instance, for chaining. */ public ActionSender sendSoundTrack(int trackId) { player.write(new PacketBuilder(220).putLEShortA(trackId).toPacket()); return this; }[/CODE]
  8. [b]Weight definition manager:[/b] [code]package com.runescape.world.entity.actor.player.util; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel.MapMode; import java.util.logging.Logger; /** * The weight definition manager. * [MENTION=52317]auth[/MENTION]or Cyberus * */ public class WeightDefinition { /** * Logger instance. */ private static final Logger logger = Logger.getLogger(WeightDefinition.class.getName()); /** * The count of items. */ public static final int ITEM_COUNT = 7956; /** * The definition array. */ private static WeightDefinition[] definitions; /** * Gets a definition for the specified id. * [MENTION=75098]Para[/MENTION]m id The id. * @return The definition. */ public static WeightDefinition forId(int id) { return definitions[id]; } /** * Loads the weight definitions. * @throws IOException if an I/O error occurs. */ public static void init() throws IOException { logger.info("Loading definitions..."); definitions = new WeightDefinition[ITEM_COUNT]; for(int i = 0; i < ITEM_COUNT; i++) { definitions[i] = new WeightDefinition(i, 0); } RandomAccessFile raf = new RandomAccessFile("data/weights.bin", "r"); try { ByteBuffer buffer = raf.getChannel().map(MapMode.READ_ONLY, 0, raf.length()); int count = buffer.getShort(); for(int i = 0; i < count; i++) { int id = buffer.getShort(); double weight = buffer.getDouble(); definitions[id] = new WeightDefinition(id, weight); } logger.info("Loaded " + definitions.length + " definitions."); } finally { raf.close(); } } /** * The id. */ private final int id; /** * The weight. */ private final double weight; /** * Creates the weight definition. * [MENTION=75098]Para[/MENTION]m id The id. * [MENTION=75098]Para[/MENTION]m name The weight. */ private WeightDefinition(int id, double weight) { this.id = id; this.weight = weight; } /** * Gets the id. * @return The id. */ public int getId() { return id; } /** * Gets the weight. * @return The weight. */ public double getWeight() { return weight; } } [/code] [b]317 packets:[/b] [code] /** * Sends the players weight. * [MENTION=75098]Para[/MENTION]m weight The weight of the player. * @return The action sender instance, for chaining. */ public ActionSender sendWeight(int weight) { player.write(new PacketBuilder(240).putShort(weight).toPacket()); return this; }[/code] [b]377 packets:[/b] [code] /** * Sends the players weight. * [MENTION=75098]Para[/MENTION]m weight The weight of the player. * @return The action sender instance, for chaining. */ public ActionSender sendWeight(int weight) { player.write(new PacketBuilder(174).putLEShort(weight).toPacket()); return this; }[/code] [b]Weight definitions:[/b] [url=http://205.196.121.39/bki323brmr3g/z3ei17dlkjpd60c/weights.bin]weights.bin[/url]
  9. [FONT=Verdana, Tahoma, Arial, Times, serif][COLOR=#000000]giant mole[/COLOR][/FONT]
  10. [B]Code:[/B] [CODE]package com.runescape.world.entity.beast; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import org.json.JSONArray; import org.json.JSONObject; public class BeastDefinition { public static final int BEAST_COUNT = 15055; private static BeastDefinition[] definitions; private final int id; private final String name; private final String description; private final String weakness; private final String slayercat; private final int deathAnimation; private final int attackAnimation; private final int size; private final int lifepoints; private final int level; private final int attack; private final int magic; private final int defence; private final int ranged; private final boolean poisonous; private final boolean attackable; private final boolean aggressive; private final boolean members; private final String[] areas; public BeastDefinition(int id, String name, String description, String weakness, String slayercat, int deathAnimation, int attackAnimation, int size, int lifepoints, int level, int attack, int magic, int defence, int ranged, boolean poisonous, boolean attackable, boolean aggressive, boolean members, String[] areas) { this.id = id; this.name = name; this.description = description; this.weakness = weakness; this.slayercat = slayercat; this.deathAnimation = deathAnimation; this.attackAnimation = attackAnimation; this.size = size; this.lifepoints = lifepoints; this.level = level; this.attack = attack; this.magic = magic; this.defence = defence; this.ranged = ranged; this.poisonous = poisonous; this.attackable = attackable; this.aggressive = aggressive; this.members = members; this.areas = areas; } public static BeastDefinition getDefinition(int id) { return BeastDefinition.definitions[id]; } public static void loadDefinition(Path path) throws Exception { List<String> lines = Files.readAllLines(path, Charset.forName("UTF-8")); BeastDefinition.definitions = new BeastDefinition[BeastDefinition.BEAST_COUNT]; for (String line : lines) { JSONObject rootObject = new JSONObject(line); int id = rootObject.getInt("id"); System.out.println(id); String name = rootObject.getString("name"); String description = rootObject.getString("description"); String weakness = null; if (line.contains("weakness" + '"')) { weakness = rootObject.getString("weakness"); } String slayercat = null; if (line.contains("slayercat")) { slayercat = rootObject.getString("slayercat"); } int deathAnimation = -1; int attackAnimation = -1; if (line.contains("animations")) { JSONObject animations = rootObject.getJSONObject("animations"); if (!animations.isNull("death")) { deathAnimation = animations.getInt("death"); } if (!animations.isNull("attack")) { attackAnimation = animations.getInt("attack"); } } int size = rootObject.getInt("size"); int lifepoints = -1; int level = -1; int attack = -1; int magic = -1; int defence = -1; int ranged = -1; if (line.contains("lifepoints")) { lifepoints = rootObject.getInt("lifepoints"); level = rootObject.getInt("level"); attack = rootObject.getInt("attack"); magic = rootObject.getInt("magic"); defence = rootObject.getInt("defence"); ranged = rootObject.getInt("ranged"); } boolean poisonous = rootObject.getBoolean("poisonous"); boolean attackable = rootObject.getBoolean("attackable"); boolean aggressive = rootObject.getBoolean("aggressive"); boolean members = rootObject.getBoolean("members"); String[] areas = null; JSONArray areasJSONArray = rootObject.getJSONArray("areas"); if (!areasJSONArray.isNull(0)) { areas = new String[areasJSONArray.length()]; for (int i = 0; i < areasJSONArray.length(); i++) { areas[i] = areasJSONArray.getString(i); } } BeastDefinition.definitions[id] = new BeastDefinition(id, name, description, weakness, slayercat, deathAnimation, attackAnimation, size, lifepoints, level, attack, magic, defence, ranged, poisonous, attackable, aggressive, members, areas); } } public int getId() { return id; } public String getName() { return name; } public String getDescription() { return description; } public String getWeakness() { return weakness; } public String getSlayercat() { return slayercat; } public int getDeathAnimation() { return deathAnimation; } public int getAttackAnimation() { return attackAnimation; } public int getSize() { return size; } public int getLifepoints() { return lifepoints; } public int getLevel() { return level; } public int getAttack() { return attack; } public int getMagic() { return magic; } public int getDefence() { return defence; } public int getRanged() { return ranged; } public boolean isPoisonous() { return poisonous; } public boolean isAttackable() { return attackable; } public boolean isAggressive() { return aggressive; } public boolean isMembers() { return members; } public String[] getAreas() { return areas; } @Override public String toString() { return id + ":" + name + ":" + description + ":" + weakness + ":" + slayercat + ":" + deathAnimation + ":" + attackAnimation + ":" + size + ":" + lifepoints + ":" + level + ":" + attack + ":" + magic + ":" + defence + ":" + ranged + ":" + poisonous + ":" + attackable + ":" + aggressive + ":" + members + ":" + areas; } } [/CODE] [B]Examples usage:[/B] [CODE]BeastDefinition.loadDefinition(Paths.get(BEAST_DEFINITION_PATH));[/CODE] [B]Beast definitions:[/B] [URL="http://www.mediafire.com/view/?b4nj3ygdw574bsn"]beasts.txt[/URL]
  11. Ryan

    Refactored 317 deob

    feel free to contribute
  12. it's all packaged and all the class names are refactored. rsa and the update server are enabled. it contains the loader. [B]Media:[/B] [IMG]http://i.imgur.com/lNZvvNo.png[/IMG] [B]Download:[/B] [url=http://www.mediafire.com/?jrx6chm3wff90i5]refactored_331.zip[/url]
  13. Ryan

    Hyperion 377

    server: [url]http://www.mediafire.com/?owf5kfogz4411l6[/url] refactored client: [url]http://www.runelocus.com/forums/showthread.php?86279-Refactored-377[/url]
×