PDA

View Full Version : [Reflection]Update 2/24/2015



Kyle
02-24-2015, 06:32 PM
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 (https://villavu.com/forum/forumdisplay.php?f=663)and bugs (https://villavu.com/forum/forumdisplay.php?f=665)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

Fitta
02-24-2015, 07:52 PM
:wowzers:

Myke
02-24-2015, 11:47 PM
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.

Kyle
02-25-2015, 12:38 AM
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


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.Ti le), 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.

Floor66
02-27-2015, 03:32 PM
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'

Kyle
02-27-2015, 05:40 PM
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 :)