OSR Reflection
Please view the Reflection forum for any info regarding relfection or these includes: https://villavu.com/forum/forumdisplay.php?f=661
OSR Reflection
Please view the Reflection forum for any info regarding relfection or these includes: https://villavu.com/forum/forumdisplay.php?f=661
Last edited by Kyle; 01-20-2015 at 05:46 PM.
“The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius
@Borland im sure you can help them!
if you guys got flawless random solvers im going to make a slayer script for osr!
Definitely interested. I have been playing around with reflection these last 2 days managed to get together a few functions and made some headway with NPCs today, I'll be back on that tomorrow.
How do I get involved with this officially?
Add me on Skype and we can talk. Its just my villavu name.
“The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius
How do you get the most recent hooks? I tried looking on javahacking but have no idea what I'm looking at or for.
Solar from RiD.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
Teaser
Progress Report:Name: rat ID: 1372 Combat: 1 Pos X: 3207 Pos Y: 3208 LoopCycle: 194992 MoveSpeed: 1
“The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius
@elfyyy
im going to help, getting members asap.
edit: you have to include
before you include reflection.Simba Code:{$I SRL-OSR/SRL/misc/SmartGraphics.simba}
edit: you can remove@ C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Player.simba(118:3)Simba Code:var me: Integer;
Started working on my updater again, along with helping the group out with code.
Code:Analyzing has started! Class Hook: Node fz Class Hook: CacheableNode fa Class Hook: Renderable cx Class Hook: Model do Class Hook: Actor aw Class Hook: NodeHashTable fu Class Hook: Player o Field Hook: o.m PlayerModel Ldo; -1 Field Hook: o.j PlayerName Ljava/lang/String -1 Class Hook: NPC e Field Hook: e.j NPCDefinition Lak; -1 Class Hook: NPCDefinition ak Field Hook: z NPCActions [Ljava/lang/String; -1 Field Hook: a NPCName Ljava/lang/String; -1 Class Hook: Client client Field Hook: f.fo CameraPitch I 1424438993 Field Hook: client.bj NPCArray [Le; -1 Field Hook: client.gi PlayerArray [Lo; -1 Field Hook: q.fi CameraYaw I -1409161417
Moar teasers
Grabs all the local NPCs that match either on Name or ID (in this case 'rat') and fills a record with each ones information for easy looping after.
Progress Report:######## Result 0 ######## Index: 12506 Name: rat Tile: (3204, 3210) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 1 WalkQueueX: 44 WalkQueueY: 50 Interacting: -1 Orientation: 180 ########################## ######## Result 1 ######## Index: 12507 Name: rat Tile: (3201, 3208) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 2 WalkQueueX: 41 WalkQueueY: 49 Interacting: -1 Orientation: 254 ########################## ######## Result 2 ######## Index: 12508 Name: rat Tile: (3205, 3217) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 0 WalkQueueX: 45 WalkQueueY: 57 Interacting: -1 Orientation: 142 ########################## ######## Result 3 ######## Index: 12509 Name: rat Tile: (3207, 3208) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 0 WalkQueueX: 47 WalkQueueY: 48 Interacting: -1 Orientation: 142 ########################## ######## Result 4 ######## Index: 12510 Name: rat Tile: (3201, 3219) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 0 WalkQueueX: 41 WalkQueueY: 59 Interacting: -1 Orientation: 254 ########################## ######## Result 5 ######## Index: 12511 Name: rat Tile: (3213, 3212) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 0 WalkQueueX: 53 WalkQueueY: 52 Interacting: -1 Orientation: 180 ########################## ######## Result 6 ######## Index: 12514 Name: rat Tile: (3205, 3201) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 2 WalkQueueX: 47 WalkQueueY: 41 Interacting: -1 Orientation: 216 ########################## ######## Result 7 ######## Index: 12515 Name: rat Tile: (3212, 3204) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 2 WalkQueueX: 51 WalkQueueY: 43 Interacting: -1 Orientation: 236 ########################## ######## Result 8 ######## Index: 12537 Name: rat Tile: (3221, 3223) Combat: 1 HitPoints: 0 Actions: ['Attack'] ID: 1372 Animation: -1 WalkSpeed: 0 WalkQueueX: 61 WalkQueueY: 63 Interacting: -1 Orientation: 160 ##########################
As a piece of advice you guys don't need AL_Functions to be included, just replace my mouse stuff with SRL's stock mouse procedures. Also, have you all considered upgrading to Lape?
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
Yeah Brandon. I know, didn't mean to Push them yet as i'm not done with the npc's yet. Thanks though!
“The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius
While at it, why not make it Lape compatible (it seems it's not)? There are only small changes needed for it to compile under lape (so it seems).
!No priv. messages please
Yeah, a lot of people have been talking about that. But for know, there's no reason to, until OSR is rewritten with lape.
EDIT- Hooks updated!
Got everyone other than a few Npc's, should have it uploaded within the hour!
EDIT2- Minireflection has been updated
EDIT3- This Include is completely updated with new hooks!
Last edited by Kyle; 01-09-2014 at 07:40 PM.
“The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius
Hooking ground items.. I wrote it in java. Someone translate it :l Too lazy..
Node:
Java Code:package osrs;
import java.lang.reflect.Field;
/**
*
* @author Brandon
*/
public class Node {
private Object nodelist;
private ClassLoader loader;
public Node(Object nodelist, ClassLoader loader) {
this.nodelist = nodelist;
this.loader = loader;
}
public Object currentNode() {
return nodelist;
}
public Node getNext() {
try {
Field f = loader.loadClass("fc").getDeclaredField("dt");
f.setAccessible(true);
return new Node(f.get(this.nodelist), loader);
} catch(ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
public Node getPrevious() {
try {
Field f = loader.loadClass("fc").getDeclaredField("ef");
f.setAccessible(true);
return new Node(f.get(this.nodelist), loader);
} catch(ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
public long getID() {
try {
Field f = loader.loadClass("fc").getDeclaredField("dg");
f.setAccessible(true);
return f.getLong(this.nodelist);
} catch(ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return -1;
}
}
Linked-List:
Java Code:package osrs;
import java.lang.reflect.Field;
/**
*
* @author Brandon
*/
public class LinkedList {
private Object obj;
private ClassLoader loader;
public LinkedList(Object obj, ClassLoader loader) {
this.obj = obj;
this.loader = loader;
}
public Node getHead() {
try {
Field f = loader.loadClass("fj").getDeclaredField("e");
f.setAccessible(true);
Object head = f.get(obj);
return new Node(head, loader);
} catch(ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
public Node getTail() {
try {
Field f = loader.loadClass("fj").getDeclaredField("b");
f.setAccessible(true);
Object tail = f.get(obj);
return new Node(tail, loader);
} catch(ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
}
Item:
Java Code:package osrs;
import java.lang.reflect.Field;
/**
*
* @author Brandon
*/
public class Item {
private Object obj;
private ClassLoader loader;
public Item(Object obj, ClassLoader loader) {
this.obj = obj;
this.loader = loader;
}
public int getID() {
try {
Field f = loader.loadClass("x").getDeclaredField("b");
f.setAccessible(true);
return f.getInt(obj) * 766650721;
} catch(ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return -1;
}
public int getQuantity() {
try {
Field f = loader.loadClass("x").getDeclaredField("e");
f.setAccessible(true);
return f.getInt(obj) * -374023265;
} catch(ClassNotFoundException | NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return -1;
}
public String getName() {
try {
Field f = loader.loadClass("az").getDeclaredField("l");
f.setAccessible(true);
//return (String) f.get(obj);
return null;
} catch(Exception e) {
e.printStackTrace();
}
return null;
}
}
OSRS:
Java Code:import java.lang.reflect.Field;
import javax.swing.JFrame;
/**
*
* @author Brandon
*/
public class OSRS {
public static void main(String[] args) throws ClassNotFoundException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
JFrame Frame = new JFrame("Test-Bot");
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ClientApplet applet = new ClientApplet("http://oldschool38.runescape.com", "", 765, 503);
applet.start();
Frame.add(applet);
Frame.setVisible(true);
Frame.pack();
try {
System.in.read();
} catch(Exception e) {
}
ClassLoader loader = applet.getClassLoader();
Field GroundItemsLinkedList = loader.loadClass("client").getDeclaredField("hi");
GroundItemsLinkedList.setAccessible(true);
//Item = x, id = b * 766650721, quantity = e * -374023265
//ItemDef = az, name = l
//Linked-List = fj, head = e, tail = b.
//Node = fc, next = dt, prev = ef, id = dg.
Object[][][] glist = (Object[][][])GroundItemsLinkedList.get(null);
for (int i = 0; i < glist.length; ++i) { //always 4.
for (int j = 0; j < glist[i].length; ++j) { //always 104.
for (int k = 0; k < glist[i][j].length; ++k) { //always 104.
Object linked_list = glist[i][j][k];
if (linked_list != null) {
LinkedList l = new LinkedList(linked_list, loader);
Node n = l.getTail();
Object first = n.currentNode();
while(first != (n = n.getNext()).currentNode()) {
Item item = new Item(n.currentNode(), loader);
System.out.println("ID: " + item.getID() + " Quantity: " + item.getQuantity());
System.out.println("Name: " + item.getName());
}
}
}
}
}
}
}
Prints:
ID: 1619 Quantity: 1
Name: null
which is correct because I dropped a ruby on the floor. In a crowded area, it prints every single item on the floor/ground item. So the above is one way of getting ground items. There HAS to be a better way than iterating the 4x104x104 linked list all the way (check the old includes or something for a hash or index algo iirc).. Oh.. Wasn't sure why my getName wasn't working but the ID and Quantity works.
Someone translate that to PS. I'm tired.
Last edited by Brandon; 01-10-2014 at 08:21 AM.
I am Ggzz..
Hackintosher
Thank you very much Brandon, any help is good help. It looks like you have some nice stuff there, we'll have it translated to PS soon enough.
I've heavily modified the auto-updater, now it will update the entire reflection include straight from the google source-code whenever there is a new IncludeRevision instead of just the hooks (which used to be updated via pastebin). The hooks will update if the ReflectionRevision or the IncludeRevision version changes.
Also modified R_TileToMs(); to improve accuracy on the player tile, went from 80% accurate to 99.99%. Rarely inaccurate due to rounding issues which couldn't be corrected. Next update will improve accuracy of tiles surrounding the player.
Elfyyy hasn't stated in the OP, but you need to call SetupReflection; at the start of your script for auto-updating to work. Everyone should re-download the include from: https://code.google.com/p/osrreflection/source/browse/ because the auto-updater changes are very important.
There are currently 1 users browsing this thread. (0 members and 1 guests)