SRL Archive - Reflection Help

Help with reflection


superbatman

2009-04-28 03:08:10

I am new to reflection and i dont quite get how it works.

I tried this:

program New;
{.include SRL/SRL.scar}
{.include SRL/SRL/Reflection/Reflection.scar}

var t: tpoint;
begin
t:=GetMyPos;
writeln('Character at: '+Inttostr(t.x)+','+Inttostr(t.y));
end.

And it always returns:


Character at: 33554430,33554430

Can someone please explain it a bit to me? Ive read some tuts but i just cant figure it out. Thank you.

EDIT: I am gonna try to update my hooks, dont know what that does but im going to try it.

EDIT: Tried updating hooks, its still returning same thing all the time =/

EDIT: Know im trying to use the Developers Files (http://scardevreflection.googlecode.com/svn/trunk/) is there any faster way to get that than to just copy and paste every file?

Shady?

2009-04-28 03:54:24

Here's a little Reflection Downloader i wrote:

Program New;

const
rvthisversion = 158;





{*******************************************************************************
Include Updater.scar
By: Shady?
Description: Updates Reflection
*******************************************************************************}
Var
rvdownload,rvdownload2: TStringArray;
rvdownloaded,rvdownloaded2: Array[0..13] Of String;
RvIHI, RvFiles: Integer;
Rvcurrentver, Rvcurrentversion, rvupdaterscar, rvreflectionscar: string;


Procedure RvDownloadFiles;
Begin
For RvIHI := 0 To High(RvDownload) Do
Begin
RvDownloaded[Rvihi] := GetPage('http://scarreflection.googlecode.com/svn/trunk/' + RvDownload[Rvihi]);
WriteLn(Rvdownload[Rvihi]);
End;
For RvIHI := 0 To High(RvDownload2) Do
Begin
RvDownloaded2[Rvihi] := GetPage('http://scarreflection.googlecode.com/svn/trunk/AntiRandoms/' + RvDownload2[Rvihi]);
WriteLn(Rvdownload2[Rvihi]);
End;
rvReflectionscar := GetPage('http://scarreflection.googlecode.com/svn/trunk/Reflection.Scar');
Writeln('Reflection.Scar');
rvReflectionscar := rvReflectionscar + chr(13) + '{.Include SRL\SRL\Reflection\updater.Scar}';
rvupdaterscar := GetPage('http://timer.mgatesphoto.com/uploader/ifile/Updater.scar');
Writeln('Updater.Scar');
Delete(rvupdaterscar,1,26);
Insert('const' + chr(13) + 'rvthisversion = ' + Rvcurrentversion + ';' + chr(13),rvupdaterscar,0);

End;

Procedure RvInstall;
Begin
For RvIhi := 0 To High(RvDownload) Do
Begin
RvFiles := RewriteFile(AppPath + '\Includes\SRL\SRL\Reflection\' + RvDownload[Rvihi], False);
WriteFileString(RvFiles, RvDownloaded[Rvihi]);
CloseFile(RvFiles);
End;
For RvIhi := 0 To High(RvDownload2) Do
Begin
RvFiles := RewriteFile(AppPath + '\Includes\SRL\SRL\Reflection\AntiRandoms\' + RvDownload2[Rvihi], False);
WriteFileString(RvFiles, RvDownloaded2[Rvihi]);
CloseFile(RvFiles);
End;
RvFiles := RewriteFile(AppPath + '\Includes\SRL\SRL\Reflection\Reflection.scar', False);
WriteFileString(RvFiles, RvReflectionscar);
CloseFile(RvFiles);
RvFiles := RewriteFile(AppPath + '\Includes\SRL\SRL\Reflection\Updater.scar', False);
WriteFileString(RvFiles, RvUpdaterscar);
CloseFile(RvFiles);
End;

Procedure RvUpdateReflection;

begin
RvDownload := ['Changelog.txt', 'Characters.Scar', 'Core.scar','GameTab.scar',
'Hooks.Scar', 'Objects.Scar', 'Inventory.scar',
'MMWalk.scar', 'Interfaces.scar','GroundItems.scar','Login.scar','Bank.scar','Chat.scar'];
RvDownload2 := ['AntiRandoms.scar', 'Box.scar', 'Demon.scar',
'Frog.scar', 'Mime.scar', 'Molly.scar','Pinball.scar','Pillory.scar','Forester.scar']
Rvcurrentversion := GetPage('http://scarreflection.googlecode.com/svn/trunk/');

// Rvcurrentversion := GetPage('http://timer.mgatesphoto.com/uploader/ifile/Updater.scar');
//Rvcurrentversion := Between('rvupdaterversion = ', ';', Rvupdaterver);
Rvcurrentversion := Between('evision ', ': /trunk', Rvcurrentversion);
WriteLn('Our current version is: '+inttostr(Rvthisversion)+' and the latest version is: '+Rvcurrentversion);
If (Rvthisversion = strtoint(Rvcurrentversion)) then
begin
WriteLn('We got the latest Reflection !');
exit;
end else
begin
RvDownloadFiles;
RvInstall;
WriteLn('Latest Reflection Downloaded, please restart the script!');
TerminateScript;
end;
end;


Begin
RvUpdateReflection;
End.

Run it and it will download the latest reflection to you. Anyways, i think reflection itself is still outdated due to Runescape updates.

senrath

2009-04-28 03:55:47

From: Shady?

Anyways, i think reflection itself is still outdated due to Runescape updates.


It's not. I'm using it right now.

superbatman

2009-04-28 04:14:15

Shady i ran your program and got Reflection updated, but it is still returning those large values. Is there something wrong with my code maybe?

Senrath, where did you get reflection downloaded?

senrath

2009-04-28 04:20:15

I used the installer from here:
http://www.villavu.com/forum/showthread.php?t=38932

And at the start of my program I put SetupReflection; which makes sure your hooks are up to date.

superbatman

2009-04-28 05:53:23

Hey senrath can you just send me a little bit of code that will load it up smart and reflection, and tell me what tile my play is on, cause now im getting errors with smart, i have to reinstall SCAR…

mormonman

2009-04-28 06:01:02


program UpdateReflection;
{.include SRL\SRL\misc\SMART.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\Reflection\Reflection.scar}

{BE SURE TO UPDATE YOUR REFLECTION INCLUDE FOLDER!
IF YOU DON'T KNOW WHAT I AM TALKING ABOUT GO TO
http://www.srl-forums.com/forum/setup-include-reflection-t36169.html}

{*******************************************************************************
procedure SetupReflection;
By: The Reflection Development Team modified by mormonman for debug text.
Description: Sets up the reflection include for use.
*******************************************************************************}
procedure SetupReflectionEx;
begin
// If this returns -1, then the hooks are out.
if SmartGetFieldInt(0, LoginIndex) = -1 then
begin
WriteLn('Updating Hooks...');
UpdateHooks;
WriteLn('Hooks Updated!');
end else
begin
WriteLn('Hooks are not Outdated!');
WriteLn('If you are still having trouble with Reflection, ');
WriteLn('go to [url]www.srl-forums.com[/url] to see what is going on with Reflection/Smart');
end;
end;

begin
SetupSRL;
SmartSetupEx(29, False, True, False);
SetTargetDC(SMARTGetDC);
While Not RSReady Do Wait(100);
SetupReflectionEx;
end.

Run that… it will update your hooks

senrath

2009-04-28 06:02:26

program New;
{.include SRL\SRL\Misc\Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\Reflection\Reflection.scar}
var
MyPos: TPoint;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'name'; //Character Name
Players[0].Pass := 'pass'; //Character Pass
Players[0].Nick := 'nick'; //Nickname 3 - 4 Letter's of char name
Players[0].Active := True;

end;
begin
SmartSetupEX(6, False, True, False);
SetTargetDC(SmartGetDC);
SetupSRL;
SetupReflection;
Wait(15000);
DeclarePlayers;
LoginPlayer;
Wait(1000);
MyPos := GetMyPos;
Writeln(IntToStr(MyPos.x) + ',' + IntToStr(MyPos.y));
end.

mormonman

2009-04-28 06:09:19

senrath, why the 15 second wait?

superbatman

2009-04-28 06:15:50

Thanks Senrath, that worked fine. It has to be in SMART doesnt it? thats why mine kept returning large numbers i think. rep+

senrath

2009-04-28 06:25:15

From: mormonman
senrath, why the 15 second wait?


That's to make absolutely sure SMART is loaded.

And you're welcome, superbatman.

mormonman

2009-04-28 07:18:13

From: senrath
That's to make absolutely sure SMART is loaded.

And you're welcome, superbatman.


lol…. just use rsready. :norris: