Results 1 to 6 of 6

Thread: [Reflection]Update 2/24/2015

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

    Default [Reflection]Update 2/24/2015

    Sorry it has been so long since the last update, I have been really busy working on some really big changes to the include on a dev branch of it. I ended up changing a lot of what I original wrote, but It is now committed to the main branch.

    Note: This was a rather large update and most, if not all current reflection scripts will break from it, and since I also changed the folder setup, you may have to reinstall the include from github. This should be the last update that breaks anything and if all goes well, will be out of beta quite soon!

    Changes:

    • No longer uses a record to store data for non static objects, uses Get methods now.
    • All non static objects reference live within the variable itself, so there is no need to loop .Get/.Find method to keep the object updated
    • Adds a lot of static functions to bank and inventory items
    • Adds Non static dropping functions to Inventory Items
    • Changes the Folder configuration to be more organized
    • Adds Graphics.simba
    • Removes a lot of Reflect.Internals functions, now placed in correct naming
    • GetMSPoint is added to all objects. objGame finding is now 100% accurate
    • Removes InventoryItem.Click

    Upcoming:

    • More small name changes
    • Documenting the include

    Please use the suggestions and bugs forum if need be.

    There has been a complete change to how memory is handled in the include when it comes to non static objects. The only thing that will be held in the record that is of use, is the actually reference to the object in memory. This makes the include now incredible fast and efficient compared to how it was. While scripts can be written is a similar manner to how they used to be done, I will update the tutorial and post some snippets of how to use it, and some errors that may have to be fixed on current scripts
    “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
    Feb 2013
    Location
    Rimmington
    Posts
    319
    Mentioned
    33 Post(s)
    Quoted
    183 Post(s)

    Default






  3. #3
    Join Date
    Dec 2011
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    Quote Originally Posted by elfyyy View Post
    • GetMSPoint is added to all objects. objGame finding is now 100% accurate

    This is very noticable, great work.

    Only took around 5 minutes to fix a script after breaking from the update, though others might have had more dependencies.

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

    Default

    Quote Originally Posted by Myke View Post
    This is very noticable, great work.

    Only took around 5 minutes to fix a script after breaking from the update, though others might have had more dependencies.


    Please check out the Tutorial, as I just updated it for today's update.

    Also, here is a snippet showing the major difference with the new memory handling and how it can be used to speed up a script

    Simba Code:
    program Meh;

    {$DEFINE SMART}
    {$i Reflection/Reflection.simba}

    var
      Guard: TReflectNpc;
      Me: TReflectLocalPlayer;

    begin
      Me.Username := 'UN';
      Me.Password := 'Pass';
      Me.Active := True;
      Reflect.Setup;
      Me.Login;
      ClearDebug;

      { Old Way }

      if Guard.Find('Guard') then
      begin
          Reflect.Mouse.Move(Reflect.Tiles.TileToMs(Guard.Tile), 2, 2);
          Reflect.Mouse.Click(Mouse_Left);
          while Guard.Health > 0 do
          begin
            //Antiban
            //EatFood
            Guard.Find('Guard'); //Have to find Guard again to 'Refresh' the record
        end;
      end;

      if Guard.Find('Guard') then
      begin
          Reflect.Mouse.Move(Guard.GetMSPoint, 2, 2);
          Reflect.Mouse.Click(Mouse_Left);
          while Guard.GetHealth > 0 do //Guard.GetHealth is an actual function now, returning the guards current Health, so no need to 'refresh'
          begin
            //Antiban
            //EatFood
        end;
      end;
    end.
    “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 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Awesome! Fixed my script in a few minutes too There's one slight inconsistency I've noticed:

    In widgets/gametab/Inventory.simba the function for translation to a mainscreen point is called 'TReflectInvItem.GetMainScreenPoint', whereas in other parts of the include (NPC, GroundItem) it is called 'xxx.GetMSPoint'
    Ce ne sont que des gueux


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

    Default

    Quote Originally Posted by Floor66 View Post
    Awesome! Fixed my script in a few minutes too There's one slight inconsistency I've noticed:

    In widgets/gametab/Inventory.simba the function for translation to a mainscreen point is called 'TReflectInvItem.GetMainScreenPoint', whereas in other parts of the include (NPC, GroundItem) it is called 'xxx.GetMSPoint'
    Ah, thanks for that! Just pushed the fix
    “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

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
  •