Page 1 of 32 12311 ... LastLast
Results 1 to 25 of 792

Thread: [OSR]Reflection Include

  1. #1
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default [OSR]Reflection Include

    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

  2. #2
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    @Borland im sure you can help them!

    if you guys got flawless random solvers im going to make a slayer script for osr!

  3. #3
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    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?

  4. #4
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    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

  5. #5
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    Quote Originally Posted by elfyyy View Post
    Add me on Skype and we can talk. Its just my villavu name.
    How would one go about using the new reflection files instead of the other mini one? Would you just add the line you gave and that would be enough?

    Also, congrats on the reflection developer cup.
    Solar from RiD.

  6. #6
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by Solar View Post
    How would one go about using the new reflection files instead of the other mini one? Would you just add the line you gave and that would be enough?

    Also, congrats on the reflection developer cup.
    The include is extremely basic at the moment.

    Forum account issues? Please send me a PM

  7. #7
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    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.

  8. #8
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Solar View Post
    How do you get the most recent hooks? I tried looking on javahacking but have no idea what I'm looking at or for.
    @n3ss3s made a nifty little hook-grabber, you can find it here.

    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..."


  9. #9
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    @n3ss3s made a nifty little hook-grabber, you can find it here.
    OK, so I ran the bat file and that updated the Fields (I think). Still not sure how to use what I have?
    Solar from RiD.

  10. #10
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Teaser

    Progress Report:
    Name:      rat
    ID:        1372
    Combat:    1
    Pos X:     3207
    Pos Y:     3208
    LoopCycle: 194992
    MoveSpeed: 1

  11. #11
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by Borland View Post
    Teaser

    Progress Report:
    Name:      rat
    ID:        1372
    Combat:    1
    Pos X:     3207
    Pos Y:     3208
    LoopCycle: 194992
    MoveSpeed: 1
    pm me :P

  12. #12
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Borland View Post
    Teaser

    Progress Report:
    Name:      rat
    ID:        1372
    Combat:    1
    Pos X:     3207
    Pos Y:     3208
    LoopCycle: 194992
    MoveSpeed: 1
    Ooo Very nice

  13. #13
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by Solar View Post
    How would one go about using the new reflection files instead of the other mini one? Would you just add the line you gave and that would be enough?

    Also, congrats on the reflection developer cup.
    Thanks! Uh yeah just like I was saying in the main thread, just download the .zip, extract it and place it inside you sr-osr/srl folder and rename in to Reflection. You don't need to change the hooks or anything, they are up to date!
    “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

  14. #14
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by Borland View Post
    Teaser

    Progress Report:
    Name:      rat
    ID:        1372
    Combat:    1
    Pos X:     3207
    Pos Y:     3208
    LoopCycle: 194992
    MoveSpeed: 1
    Nice work! Any chance you want to share?

    Forum account issues? Please send me a PM

  15. #15
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    Quote Originally Posted by elfyyy View Post
    Thanks! Uh yeah just like I was saying in the main thread, just download the .zip, extract it and place it inside you sr-osr/srl folder and rename in to Reflection. You don't need to change the hooks or anything, they are up to date!
    I have done all of that like you said in the OP.
    I just wanted to know how I can manually update hooks, and if possible, can someone tell me what a hook actually is?
    I got n3ss3s's updater and ran the bat file but don't know what to do after that.
    Solar from RiD.

  16. #16
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by Solar View Post
    I have done all of that like you said in the OP.
    I just wanted to know how I can manually update hooks, and if possible, can someone tell me what a hook actually is?
    I got n3ss3s's updater and ran the bat file but don't know what to do after that.
    Add me On Skype. elfyyy
    Same Profile Pic
    “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

  17. #17
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    @elfyyy

    im going to help, getting members asap.

    edit: you have to include
    Simba Code:
    {$I SRL-OSR/SRL/misc/SmartGraphics.simba}
    before you include reflection.

    edit: you can remove
    Simba Code:
    var me: Integer;
    @ C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Player.simba(118:3)

  18. #18
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    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

  19. #19
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    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
    ##########################

  20. #20
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    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..."


  21. #21
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    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

  22. #22
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    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

  23. #23
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by warpie View Post
    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).
    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

  24. #24
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    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

  25. #25
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default

    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.

Page 1 of 32 12311 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •