Reflection
From SRL Wiki
Contents |
Before you start...
Reflection is not working at the moment. There are people trying to fix it but no reflection based scripts will work right now (as of January 26, 2010).
You must already have SRL and SCAR downloaded and installed correctly before proceeding to read this tutorial. Please read about setting up SCAR and installing and setting up SRL if you need information about those topics. Reflection will not function at all if you do not have both SCAR and SRL setup already.
What is reflection?
Reflection is a means of reading ID's of objects on the Runescape client. It does not change or modify the client in any way, and therefore is not detectable like client hacking bots. Reflection allows for making flawless scripts, because reflection is 100% accurate in many areas of a script (NPC finding, walking, to name a few). Reflection is used through the use of SMART (Scar Minimizing Autoing Resource Thing by Benland100).
Two repositories
Similar to how SRL has two repositories, the Reflection include is also available in a Public and a Developer's version.
The public repository contains tried and tested functions and is therefore more stable with less bugs than the developer's repository. However the dev repository will always contain the latest fixes, features and cool new things. It will also include more new bugs and untested functions. Decide which you prefer: stability or functionality.
Downloading reflection
There are several ways to download and install reflection.
Using TortoiseSVN with Subversion
The Reflection includes are maintained in Subversion repositories and can be downloaded, installed and updated very easily with subversion and TortoiseSVN.
- If you haven't already download and install TortoiseSVN. Restart your computer as required.
- Browse to /Includes/SRL/SRL in your SCAR folder using Windows Explorer. For example:
C:/Program Files/SCAR 3.XX/Includes/SRL/SRL/
- To make sure you've got the correct folder level you should also see /Core/, /Misc/ and /Skills/ folders.
- Make a new folder called Reflection. The path should look like this:
C:/Program Files/SCAR 3.XX/Includes/SRL/SRL/Reflection/
- Now right-click that folder and do a Checkout on the repository link:
For the Reflection Public Repository:
http://scarreflection.googlecode.com/svn/trunk/
For the Developer's Repository:
http://scardevreflection.googlecode.com/svn/trunk/
- Now just click OK and reflection should be downloaded into the correct folder for you.
- To update reflection in the future just right-click your Reflection folder and select Update.
Using SCAR-based Reflection Downloaders
Several members have made it easier for new members inexperienced with TortoiseSVN or Subversion to obtain Reflection. These downloaders usually involve running a SCAR-script that will automatically connect to the repository directory and download the required files. There are several of these available including:
All instructions are on the program's specific threads.
Updating reflection
Reflection can be more easily broken from Runescape updates than color. Reflection involves the use of client "hooks" to grab data directly from the client. Many of these hooks get outdated when Jagex does an update. Hooks are usually updated in the repository a couple hours to days after an update.
Due to the automatic hook updater in the include itself, hooks will usually be updated automatically if required. However if you find that you're reflection scripts aren't working even several days after an update it may be worth trying to update the repository manually.
Updating using TortoiseSVN
If you used TortoiseSVN to download reflection initially its just a matter of right-clicking your Reflection folder and selecting Update. The new files will be downloaded automatically.
Updating using SCAR-based Installers
If you used the Installers to get reflection you'll need to run the respective installer again.
How to Use Reflection
Many scripts are available to the public that use reflection-based functions. However not all scripts use reflection. You should check with the script author or on the script thread if Reflection is required.
Generally, Reflection scripts will have:
{.include SRL/SRL/Reflection/Reflection.scar}
near the top of the script.
Creating Reflection Scripts
Teaching the use of specific reflection functions and how to create a working script using Reflection is out of the scope of this guide. However there are many reflection-scripting guides and tutorials available in the Reflection Tutorials forum on SRL-Forums. Here's a good tutorial written by Zasz: http://www.villavu.com/forum/showthread.php?t=46636
