PDA

View Full Version : [OSR][Reflection]Basic Scripting and Setup Guide



Kyle
01-20-2014, 11:41 PM
Welcome to The "Official" Guide to The "Unofficial" Reflection Include for Osr

Since there hasn't been an official reflection include for simba in a few years, I’m sure there are a lot of people who aren't sure exactly how to use reflection to help increase the accuracy and efficiency of a color script. Furthermore the reflection include that we are currently working is written differently than previous versions. This compelled me to make a detailed guide to help increase the amount of scripts posted. I will break the guide down into three sections:


How to download, setup and get reflection working with simba
How to use the various functions within the include
Antirandoms


Since the include is still very new, we are constantly adding new functions and trying different idea's. As such, there is a good chance that there may be a few bugs. Please post here if any are found. Also, if there are any functions that you would like to see be added, or anything that you think could be changed, let one of us know!


Include thread: http://villavu.com/forum/showthread.php?t=107479

Developers: elfyyy, Krazy Meerkat & Frement




Downloading and setup:


Well the most important part is to download and get the include setup properly to run with simba!

The first step is to go to github where the include is posted, which is found here (https://github.com/Elfyyy/OSR-Reflection-PascalScript)
After that, you are going to want to download the .zip file from:

I suggest saving it to your desktop, so it is easier to find once you go to extract it. From where ever you decide to save the .zip, you are going to want to extract is using your favorite unzip program (.7zip or Winrar work fine.)
You will want to extract it to Simba/Includes/SRL-OSR/SRL.
Once there, you will need to rename it to "reflection" without the "". Your /SRL folder should now look like:

http://elfyyy.com/reflecsetup

To test that everything was download properly you can run:

program R_Test;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}


begin
setupsrl;
SetupReflection;
end.

You shouldn't get any errors, and it will either say that you are up to date with reflection or that a update has been downloaded!




Writing Scripts With Reflection:


Now that everything is downloaded and running properly, you can begin to start scripting using reflection functions!

So, as you saw in the Test example, in order to use any of the functions, you must include {$I SRL-OSR/SRL/Reflection/Reflection.simba} under {$I SRL-OSR/SRL.Simba} at the top of your script.

You also must call SetupReflection; in your main loop BEFORE SetupSrl. This checks if there are any updates that need to be downloaded (Which it will do automatically.)




Tiles:


Most of the functions in here are used in other functions throughout the include, but some of them are still very useful for different things.

function R_TileToMs(Tp: Tpoint): Tpoint;

Another usefull function, it returns the tpoint of the current tile that we are standing on. This can be used to just determine where we are for use with other functions, or you can write your own within your script with it.
R_GetTileGlobal

The rest of the tile functions are fairly self explanatory, but if you want me to go over any, just let me know.





MapWalk:


By far the most important reason that one will choose to use reflection, is the ability that it has to be used for mapwalking features. For the most part, reflection walking "should" be 100% accurate and won't fail. The reason I say "should" is because stuff happens, and it is still good to use failsafes.

The first function is simply R_WalkPath(Path: TPointArray): boolean; this function will walk along a path designated by the TPointArray in the parameters. In order to know the points in order to walk, we can use a great tool written by Turpinator. This tool can be found it reflection/tools. What this does, is when the script is started, each time you enable SMART, a new point is made.

This array of points can then be used with R_WalkPath in order to walk along it.

An example of a path from Varock East bank to the west bank: R_WalkPath([Point(3245, 3429), Point(3231, 3429), Point(3216, 3428), Point(3206, 3428), Point(3195, 3429), Point(3185, 3429), Point(3184, 3437)]);

It is VERY important to know, each point must be showing on the minimap from the previous point, so you can't "skip" points when making a path.

R_BlindWalk(P: TPoint): Boolean; This simply, makes a array of points from our current location to the final point, and walks it using R_WalkPath. This is great to use when you need to walk a straight line. It will NOT go around walls/obstacles.

The last MapWalk function is R_TileOnMM(Tile: TPoint): boolean; This returns true if the given point is on the Minimap. Usefull mainly for Failsafes.




Player:


Another nice feature of reflection, is being able to get data about your player without switching tabs or any other method. Most of these are self explainitory, so I will only discuss some in which may need more explanation.

Returns True if our player is animating.
R_IsAnimating:Boolean




Npc:



For this section, the best way I think to explain it, is to write a small example script of a monster killing snippet.

procedure AttGuard;
var
Guard: TNPC;
Tp : Tpoint;
begin
if R_FindNpc('Guard', Guard) then // Loads the record for Guard.
begin
if Guard.InCombat then // if he is in combat, don't attack, since we are on a loop, This acts as a wait also
exit;
Tp := Guard.Tile; //Get guard tile location
Tp := R_TileToMs(Tp); //Changes Tile into a Onscreen Point
Mmouse(Tp.x, Tp.y, 0, 0);
if R_WaitUptext('Guard', 200) then
ClickMouse2(Mouse_Left);
while (Guard.InCombat) and (R_InFight) do // waits until guard is dead to move on
wait(500);
end;
end;

So, that's a very basic example of how you can go about using reflection to interact and find npc's quickly. When You call R_FindNpc it stores the entire record of the npc into the TNPC record. So from calling the one function, you are able to get the following data from the npc:

Type TNPC = Record
Name: String;
Tile: TPoint;
Index, Level, NpcID: Integer;
Animation, HitPoints: Integer;
Interacting: Integer;
InCombat: Boolean;
end;

Using that one function to be able to call all those individual procedures from withing the variable makes it very powerful. You just need to keep in mind, that you must R_FindNpc right before you want any of the data from it that isn't static, such as location. Being that the TNPC is a variable, it changes, so it is very important to keep that in mind.
For all the npc functions, the value that you enter to search for the npc, is what is called a "variant." So you can either enter in the npc's name, or the ID of the npc. Either way will work




Addition NPC info courtesy from Krazy_Meerkat:


There are several functions you can use, but you must know that npc's are returned in a TNPC format. So it is always wise to declare a variable as a TNPC or TNPCArray;
var
man: TNPC;
men: TNPCArray;
So now, when using npc functions, you can store the npc. There are a few npc functions and they don't all work the same..
Men:= R_GetNpcs('Man'); //returns a TNPCArray of all npc's named 'Man' in the area (sorted by player distance), I stored it into Men for this example.

if R_FindNpc('Man', Man) then //looks for npcs named 'Man' and stores the closest one in the TNPC Man. Boolean function, returns true if found, false if not.

Man:= R_FindFreeNpc('man'); //looks for the closest npc named 'Man' which isn't in combat and returns the TNPC (I stored this into Man).

R_InteractingNpc //returns the tnpc of any npc your player is interacting with, this means you can use it like R_InteractingNpc.HitPoints

Finally, when you want to call record information from your npc, you treat the TNPC array as an array of npcs as follows:
for i:= 0 to high(men) do
if men[i].HitPoints > 0 then
dosomething;
The TNPC is treated as singular, so you can just call the record info:
R_TileToMs(man.tile);




Misc:


Most of the functions in here are used for other functions throughout the include. There are however, some that are quite useful for many things. They are:

R_GetSettingArray
R_GetSetting
R_GetPlayerName
R_GetUptext
R_ChooseOption

These are for various "setting's" within the runescape client. By using R_GetSetting, you can determine if your character is running, casting spells, auto retaliating, and many more. I will go into more detail on the use of this later, because tbh, there are so many, I don't know enough of them yet.

I also only wrote one of the uptext functions and choose options, as these are used the exact same way as SRL except with using reflection, they are now 100% accurate



Objects:


In runecape there are 4 different types of objects, all of which our include now supports! They are GameObjects, WallObjects, Boundaries, and FloorDecoration. These are defined as constants and should be called in scripts as such!


OBJ_GAME = 0;
OBJ_WALL = 1;
OBJ_FLOORDECORATION = 2;
OBJ_BOUNDARY = 3;

As of now, there are only three functions that should be called in scripts related to objects, they are:

function R_GetAllObjects(ObjType: integer): TRSObjectArray;
function R_GetObjectAt(ObjType: integer; Tile: TPoint): TRSObject;
function R_GetObjectsDistance(ObjType, Distance: integer): TRSObjectArray;

They should be pretty self explanatory so I won't go into any detail on the specifics of each function, but feel free to ask if you have any questions. When any of the functions are called, it returns either a TRSObject or a TRSObjectArray. Within a TRSObject is contained the "ID," "Tile," and "ObjectType." I will soon be adding to this list a few more param's but for now, I believe those to be the most useful!

Now, on what each of the objects are... They seem to vary a lot throughout Runescape, but here is a general rule of thumb that I have found, but you will still wan't to check yourself for each one!:

GameObject: Most interactable objects that are not on walls: Bank booths, chests, crates, some non interactable such as crates and rocks.
WallObject: Most interactable objects on walls and decoration on walls: Doors, levers, pictures, windows, ect....
Boundaries: Anything "Wall like" that blocks our path: Walls, fences, some doors and gates.
FloorDecoration: Anything on floor that doesn't fall into a category above: Some Rocks, bushes, stones ect....

Kyle
01-21-2014, 05:44 PM
Anti Randoms:


We are now at the point in the include in which is the reason that I started working on this project in the first place, to be able to have accurate random solvers that allow us to use skilling scripts without constantly worrying about failing a random. As of this moment, I just committed the new antirandoms.simba.

The randoms that should be working are as follows:

ALL talking randoms that don't use an interface e.g Sandwhich Lady isn't solved.
Combat Randoms
Mime
Drill Demon
Freaky Forester



Now is the time that we can really use any info about how the solvers are working currently and we could also really use accounts that are stuck in any randoms that we could use! Please don't post a bug report on a random that fails that isn't on this list, but please do post if one fails that is on it, and if you know where/how it failed!

We changed the name of the random function to be more consistent with SRL:
R_FindNormalRandoms
This will call all reflection detectors/solvers for the ones we have done, and will use SRL's for the one's we have not yet done.

function R_FNRWait(Time, WaitPerLoop: integer)
This can be called instead of the normal wait/sleep and will check for reflection randoms every waitperloop up to the Time. For Example:
R_FNRWait(5000, 100)
Will wait 5000ms while calling R_FindNormalRandoms every 100ms. Note: The lower your waitperloop is, the higher the cpu usage will be!


Constants:


R_RunAwayDirection := 'random';
R_Reincarnate := False;
R_CombatRandoms := True;

For the combat random's the're are those three constants. What is unique about this include unlike the previous one's is that for the combat detection it doesn't just runaway immediatley when you're in combat, it will only do so if you are in combat with an actual random. So this means that you can keep R_CombatRandoms set to 'False' and still run a combat script! R_Reincarnate if set to true will allow you're player to die and not logg out upon death.



So again, your feedback is key to us getting all randoms solved. If you get stuck in a random and don't mind letting us use it for a little bit, please get in touch with either me or Meerkat on here or through Skype!

NKN
01-21-2014, 07:30 PM
I'll help write up some guides/code when I get home. Reserving this post because I'll edit it.

Going to start learning that lape stuff and write the actual include now.

lasse48
01-21-2014, 10:33 PM
Thanks , this will be useful

vizzyy
01-31-2014, 01:58 AM
Incredible. Thank you for your efforts, I am looking forward to trying this out.

vizzyy
01-31-2014, 05:54 AM
Using the coordinate finder within the include/tools/ it only ever spits out the same coordinate over and over for me no matter where I move or restart the script.

"[Point(-174199997, 1075589826)]"
Smart command prompt says "field not found ca.hs"

lollol012
02-03-2014, 02:19 PM
"Error: Out Of Range at line 46" in the Reflection NPC.simba file.
Any clue what the problem might be?

Edit: And to add, in case it wasn't apperant, this happens when I search for an NPC using R_FindNpc.

Kyle
02-03-2014, 08:32 PM
"Error: Out Of Range at line 46" in the Reflection NPC.simba file.
Any clue what the problem might be?

Edit: And to add, in case it wasn't apperant, this happens when I search for an NPC using R_FindNpc.

Hmm, never had that happen before... Care to add me on skype and show me how and when that occurred? Thanks man, my skype is above by my avatar. :)

EDIT: I assume you recently downloaded it for the googlecode. Thanks a lot for mentioning that error. We changed some stuff on npc's but didn't have it auto update to other people, so I didn't catch it. It was a simple fix and should be good to go now! :) Post back if anything else has any bugs!

lollol012
02-04-2014, 01:55 AM
Hmm, never had that happen before... Care to add me on skype and show me how and when that occurred? Thanks man, my skype is above by my avatar. :)

EDIT: I assume you recently downloaded it for the googlecode. Thanks a lot for mentioning that error. We changed some stuff on npc's but didn't have it auto update to other people, so I didn't catch it. It was a simple fix and should be good to go now! :) Post back if anything else has any bugs!

No problem. Always my.. erm.. pleasure to find errors :)
I assume I'll have plenty of opportunities to find errors in the future =P

joulaha
02-06-2014, 06:08 PM
Threw you a PM, but will post here also.

I do have latest hooks and latest reflection, script did work before.
Now the problem comes with walking and path maker.

Path maker is giving these "strange" X/Y locations (Which dont work) and when using old ones it starts to walk totally wrong direction(S) and is not working fine.

What could be wrong?

Kyle
02-06-2014, 06:42 PM
Hooks updated to Revision 38 :)

lollol012
02-13-2014, 12:41 PM
Following the latest updates, Mapwalking is broken again. Here is an example of what a point and what PAthMaker returns (and obviously R_WalkPath doesn't work):

Earlier saved point and what it shows now: Point(3272, 3167) --> [Point(880358903, -1328997390)]

vizzyy
02-13-2014, 07:56 PM
Following the latest updates, Mapwalking is broken again. Here is an example of what a point and what PAthMaker returns (and obviously R_WalkPath doesn't work):

Earlier saved point and what it shows now: Point(3272, 3167) --> [Point(880358903, -1328997390)]

We must patiently wait for new hooks. :)

samerdl
02-15-2014, 03:47 PM
Excellent tutorial, keep up the great work :-).

Hope to see item support as well.. If we somehow can get a really easy 1 click setup for Simba + oldschool + osrs reflection includes at the same time... it would be amazing and encourage much more needed users to these boards.

svenno
02-20-2014, 12:26 PM
Im confused, I just setup reflection and ran the test script + a R_walkpath function and everything worked well.
After a runescape update im trying to run the exact same script but im getting an error:
Math error at line 103 in the file: 'Tiles.simba'.
Anyone know what can fix this?

Hoodz
02-20-2014, 01:21 PM
Im confused, I just setup reflection and ran the test script + a R_walkpath function and everything worked well.
After a runescape update im trying to run the exact same script but im getting an error:
Math error at line 103 in the file: 'Tiles.simba'.
Anyone know what can fix this?
hooks are probably outdated. btw try to run the script after you have logged in (if the hooks are fixed) and tell me if the error still occurs. i found out that if im not logged in i will get that error, but if im logged in it works fine. i think it can be fixed with a simple change in the function that causes the error. im sure elfyyy and meerkat can fix it.

svenno
02-20-2014, 01:39 PM
hooks are probably outdated. btw try to run the script after you have logged in (if the hooks are fixed) and tell me if the error still occurs. i found out that if im not logged in i will get that error, but if im logged in it works fine. i think it can be fixed with a simple change in the function that causes the error. im sure elfyyy and meerkat can fix it.

I tried the script while logged out and while logged in but i get the same error..
To be sure i also put in the login from srl.

The script

begin
DeclarePlayers;
setupsrl;
SetupReflection;
if (not LoggedIn) then
LogInPlayer;
R_WalkPath([Point(3184, 3437), Point(3185, 3429), Point(3195, 3429),Point(3206, 3428),Point(3216, 3428), Point(3231, 3429), Point(3245, 3429) ]);
end.

I discovered my extensions were disabled for some reason... so i enabled them, updated srl through simba and tried to update the plugins through simba but thats giving errors.. Could it be that my plugins are wrong?

Kyle
02-20-2014, 01:55 PM
Yeah the hooks are outdated as of now. The reason the error occurs is because it uses the distance formula, and when the hooks are wrong, it is multiplying a very large number under a radical, and it doesn't like to take the square root of it so it errors. I can fix it, but until we get a proper way to check if the hooks are wrong, I will keep it as it kills the scripts that use reflection. :)

svenno
02-20-2014, 02:06 PM
So it is outdated because of the runescape update?
In that case in happy to have it all setup correctly, because it worked before the update :)

Krazy_Meerkat
02-20-2014, 02:19 PM
Yeah the hooks are outdated as of now. The reason the error occurs is because it uses the distance formula, and when the hooks are wrong, it is multiplying a very large number under a radical, and it doesn't like to take the square root of it so it errors. I can fix it, but until we get a proper way to check if the hooks are wrong, I will keep it as it kills the scripts that use reflection. :)

I added a proper way to check if the hooks are wrong but elfyyy removed it because "too many scripts(Hoodz) have SetupSrl after SetupReflection."

Hoodz
02-20-2014, 03:01 PM
I added a proper way to check if the hooks are wrong but elfyyy removed it because "too many scripts(Hoodz) have SetupSrl after SetupReflection."

do i have to change it? just ask me. btw get on skype

Kyle
02-21-2014, 12:33 AM
Hooks updated to Revision 41

lollol012
02-21-2014, 05:09 PM
Reflection mapwalking doesn't seem to work for me atm. Also it says something about "D" not being used when debugging, dunno if it's related.

Sk1nyNerd
02-21-2014, 05:57 PM
Reflection mapwalking doesn't seem to work for me atm. Also it says something about "D" not being used when debugging, dunno if it's related.

post your walking method code. whats it doing wrong? if it says Hint: variable D is not being used or something like that its no big deal. that just means you made a variable "D" and you havent used it anywhere in ur script

lollol012
02-21-2014, 06:31 PM
post your walking method code. whats it doing wrong? if it says Hint: variable D is not being used or something like that its no big deal. that just means you made a variable "D" and you havent used it anywhere in ur script

Oh ya, it was in my own include lol.

Anyway, it doesn't work atm when I try to walk in Yanille.




Procedure WalkToPortal;
begin
R_WalkPath([Point(2612, 3092), Point(2604, 3094)]);
R_WalkPath([Point(2597, 3097), Point(2585, 3097)]);
R_WalkPath([Point(2576, 3094), Point(2562, 3092)]);
R_WalkPath([Point(2555, 3097), Point(2546, 3095)]);
end;


Doesn't work individually either.

I'll clarify, this is the path from the bank to the house portal.
I also found a new one with path_maker, it didn't work either.

Hoodz
02-21-2014, 06:55 PM
Oh ya, it was in my own include lol.

Anyway, it doesn't work atm when I try to walk in Yanille.




Doesn't work individually either.

I'll clarify, this is the path from the bank to the house portal.
I also found a new one with path_maker, it didn't work either.
Didnt work for me either the last few days. Try to replace it with R_PerfectPath

Sk1nyNerd
02-21-2014, 07:16 PM
Oh ya, it was in my own include lol.

Anyway, it doesn't work atm when I try to walk in Yanille



Doesn't work individually either.

I'll clarify, this is the path from the bank to the house portal.
I also found a new one with path_maker, it didn't work either.

are you sure all the points are on the minimap? the points have to be visible on the minimap before it can walk to it.

if so you might just have to delte the reflection include as its out dated and redownload from google code. ive had similiar issues and this solved it https://code.google.com/p/osrreflection/source/browse/

lollol012
02-22-2014, 12:02 AM
Suddenly it works again. Strange, really. Perhaps there is a glitch in Yanille itself. I'll test it a bit later.


Edit: Now it randomly doesn't work again, somewhere else. I got no idea what's going on.

Kyle
02-22-2014, 12:22 AM
Suddenly it works again. Strange, really. Perhaps there is a glitch in Yanille itself. I'll test it a bit later.

No lol... Its called reflection haha. It breaks everytime rs updates it will break until we update it :)

lollol012
02-22-2014, 12:33 AM
No lol... Its called reflection haha. It breaks everytime rs updates it will break until we update it :)

No, it's not the hooks. The pathmaker works perfectly, it's just that when I run R_WalkPath it writes "Sucessfully Executed" and does absolutely nothing. And returns "true", no less. I still don't understand how to replicate this error, it just ranodmly started again.

Kyle
02-22-2014, 01:45 AM
No, it's not the hooks. The pathmaker works perfectly, it's just that when I run R_WalkPath it writes "Sucessfully Executed" and does absolutely nothing. And returns "true", no less. I still don't understand how to replicate this error, it just ranodmly started again.

Then the first point is obviously not on the mini map. You should make the points 5 tiles apart

lollol012
02-22-2014, 01:55 AM
Then the first point is obviously not on the mini map. You should make the points 5 tiles apart

I know how it usually is, but this time, it's clearly on the minimap - I try it when it's 3/4/5/6 tiles away from me, and it gives the same result.
Obviously, I tested it with an array of a single point first, which was the first and the last point, and was a few tiles away from me..

This happened with points I've used before, and also with new points PathMaker calculated. All of them in range.
Also, when a point wasn't on the minimap beforehand, it used to wait a bit before returning "false". Now it just returns true without doing a thing, almost instantly.
I'll test more later, it's strange, but it's definitely an actual glitch, even if it happens under very specific conditions.

Sk1nyNerd
02-22-2014, 02:12 AM
I know how it usually is, but this time, it's clearly on the minimap - I try it when it's 3/4/5/6 tiles away from me, and it gives the same result.
Obviously, I tested it with an array of a single point first, which was the first and the last point, and was a few tiles away from me..

This happened with points I've used before, and also with new points PathMaker calculated. All of them in range.
Also, when a point wasn't on the minimap beforehand, it used to wait a bit before returning "false". Now it just returns true without doing a thing, almost instantly.
I'll test more later, it's strange, but it's definitely an actual glitch, even if it happens under very specific conditions.

try using blindwalk, you wont need any of the points on the minimap. might help pin point the problem. my walking was bugging out yesterday but elfyyy said the include was outdated so i dissabled all the walking and i dont have any spare accounts to test it again- got a 10+ hour proggy going :P

Pakyakkistan
02-24-2014, 08:32 PM
I discovered that when declaring the numerical tile points (X-Tile, Y-Tile) you must declare it as a Point before you add (X-Tile, Y-Tile) IE -


R_NearTile(Point(1234,1234));//Notice that it states it as a point here prior to the cords being used (This is needed ANYWHERE there is a TPoint being asked for
R_WalkPath([Point(1234,1234)]);//Notice here there are brackets wrapped around the Point (or points(usually need brackets if there is a possibility for more then one Tpoint)) without brackets you just get a parameter error(if the brackets are needed)

I figured that since it really isn't mentioned as to how you 'operate' the TPoints it may be helpful to others to add this when talking about Tiles or Mapwalking in the OP.

Kyle
03-12-2014, 03:18 PM
Just added Objects to the guide! Currently working on adding the new MapWalk functions and the Misc functions! :)

NKN
03-12-2014, 06:05 PM
Just throwing this out there, if any of y'all got an account in an 07 random, you should PM me the details of it. I'll write up a solver.

Sjoe
03-12-2014, 06:07 PM
Just throwing this out there, if any of y'all got an account in an 07 random, you should PM me the details of it. I'll write up a solver.

is this a dream?

Kyle
03-12-2014, 06:10 PM
is this a dream?

I was literally just thinking that haha. There's a definite reason that I wrote in the antirandoms part to pm me or Meerkat your account info! :p

lollol012
03-16-2014, 06:51 AM
Tried using Anti_Randoms, currently unusible. Every random it finds, it writes

[Reflection Anti-Randoms] Dr Jekyll random detected! Solving...
Error: Out Of Range at line 439


Happened with 2 randoms today.

samerdl
03-29-2014, 09:42 AM
Nice guide, will report on any issues i need help with :)

edit: can you add an example for object clicking please? like agility obstacles/bank booths would really appreciate it.

lollol012
04-02-2014, 07:11 PM
Have to report that the Drill Demon solver, R_SolveDD, doesn't work for whatever reason.

It detected the event successfully, but did not start solving, just stood.
Had to replace it with DD_Solve in your include for it to solve it. (DD_Solve is the normal solver)

Kyle
04-02-2014, 07:39 PM
Have to report that the Drill Demon solver, R_SolveDD, doesn't work for whatever reason.

It detected the event successfully, but did not start solving, just stood.
Had to replace it with DD_Solve in your include for it to solve it. (DD_Solve is the normal solver)

Alright, yeah your the second person who has said that. So something apparently happened. Seeing as I don't play RS the only way I can work on any of the randoms is if I am given an account in a random to work on a solver for. So next time if you get in one, if you could pm or skype me, I could work on it!

wister1
04-07-2014, 06:27 PM
i get the error whenever i try a script dunno why

Exception in Script: Unable to find file 'SRL-OSR/SRL/misc/al_functions.simba'

Kyle
04-07-2014, 07:14 PM
i get the error whenever i try a script dunno why

Exception in Script: Unable to find file 'SRL-OSR/SRL/misc/al_functions.simba'

Because you are running a script that uses al_functions. As this has nothing to do with reflection, this isn't the proper place to post this, you can go to my pest control script in my sig to download the include for Al

wister1
04-07-2014, 10:00 PM
Because you are running a script that uses al_functions. As this has nothing to do with reflection, this isn't the proper place to post this, you can go to my pest control script in my sig to download the include for Al

sorry just started reading about OSR scripts, thanks alot for the answer

bigboy63
04-15-2014, 09:24 PM
this is when i run the test script to check reflection..

[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(164:13): Variable 'Result' never used at line 163
[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(402:3): Variable 'X' never used at line 401
[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(402:3): Variable 'Y' never used at line 401
[Error] (10:3): Identifier expected at line 10
Compiling failed.

any idea what I've done wrong? I've followed the guide, installed the reflection following the guide, and still am struggling. I just returned from a 2 year break a few weeks ago and just started back into simba, so I'm a little confused right now, but hopefully I can get this resolved and start using simba

Thanks in advance for any advice =]

Frement
04-15-2014, 09:27 PM
this is when i run the test script to check reflection..

[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(164:13): Variable 'Result' never used at line 163
[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(402:3): Variable 'X' never used at line 401
[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(402:3): Variable 'Y' never used at line 401
[Error] (10:3): Identifier expected at line 10
Compiling failed.

any idea what I've done wrong? I've followed the guide, installed the reflection following the guide, and still am struggling. I just returned from a 2 year break a few weeks ago and just started back into simba, so I'm a little confused right now, but hopefully I can get this resolved and start using simba

Thanks in advance for any advice =]

Check your interpreter: Script > Interpreter

Needs to be PascalScript.

bigboy63
04-15-2014, 09:40 PM
ok double checked and it is set to PascalScript. On the reflection test I am still getting an error:

[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(164:13): Variable 'Result' never used at line 163
[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(402:3): Variable 'X' never used at line 401
[Hint] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Interaction.simba(402:3): Variable 'Y' never used at line 401
[Error] C:\Simba\Scripts\reflecttest.simba(10:3): Identifier expected at line 10
Compiling failed.

and when i try to run draynor willow banker i get this:
[Error] C:\Simba\Scripts\Sk1nyNerds [PRO] Draynor Willow Banker.simba(21:14): Syntax error at line 21

any ideas? :confused:

ry0240
04-22-2014, 03:03 PM
Since last night I've been getting this problem for all reflection scripts

[Error] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\MapWalk.simba(518:11): Unknown identifier 'R_FindNormalRandoms' at line 518
Compiling failed.
Is there a official section to report reflection bugs?

hakishakataki
04-22-2014, 04:24 PM
Since last night I've been getting this problem for all reflection scripts

[Error] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\MapWalk.simba(518:11): Unknown identifier 'R_FindNormalRandoms' at line 518
Compiling failed.
Is there a official section to report reflection bugs?

i have this problem too. on scripts that used to work no less

Kyle
04-22-2014, 04:32 PM
Since last night I've been getting this problem for all reflection scripts

[Error] C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\MapWalk.simba(518:11): Unknown identifier 'R_FindNormalRandoms' at line 518
Compiling failed.
Is there a official section to report reflection bugs?


Fixed, Re Download for the proper fix! And Yes, you can report bugs to:
https://code.google.com/p/osrreflection/issues/list
(https://code.google.com/p/osrreflection/issues/list)

imgonnaeatu
06-04-2014, 03:21 AM
Im having a problem when trying to run the update code that you provided, i keep getting this error:
Exception in Script: Operator expected at line 281, column 26 in file "C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Tiles.simba"
Any help would be greatly appreciated

Grunt
06-10-2014, 05:15 AM
i had the same problem, u got to switch the interpreter to pascal script

MrMonotone
06-10-2014, 05:49 AM
Hello:

I was wondering if you could help me with opening doors. I am making a script to kill Al Kharid guards. This is what I have so far:


program R_Test;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}

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

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
var
center, south, east, west: tPoint;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
R_FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
R_FindNormalRandoms;
end;
end;
end;

procedure ResetPosition;
begin
end;

procedure OpenDoor;
var
CloseObjects: TRSObjectArray;
DoorPoint: TPoint;
i: Integer;
begin
R_get

for i := 0 To high(CloseObjects) do
begin
DoorPoint:= R_TileToMs(CloseObjects[i].Tile);
MMouse(DoorPoint.x, DoorPoint.y, 0, 0);
end;
//writeln(CloseObjects[i].Tile);


//
//ClickMouse2(mouse_Right);
//if R_WaitUptext('Open', 200) then
//ClickMouse2(mouse_Left);
end;

procedure AttackWarrior;
var
Warrior: TNPC;
WarriorPoint: TPoint;
begin
if R_FindNpc('Al-Kharid warrior', Warrior) then // Loads the record for Guard.
begin
WarriorPoint := R_TileToMs(Warrior.Tile); //Get guard tile location
MMouse(WarriorPoint.x, WarriorPoint.y, 0, 0);
if R_WaitUptext('Al-Kharid warrior', 200) then
begin
ClickMouse2(Mouse_Left);
wait(100+random(50));
if not(R_IsWalking) and not(R_InFight) then
OpenDoor;
end;
while (Warrior.InCombat) and (R_InFight) do // waits until guard is dead to move on
begin
R_FindNormalRandoms;
wait(400+random(250));
AntiBan;
end;
end;
end;

procedure Main;
begin
repeat
R_FindNormalRandoms;
AttackWarrior;
until(InvFull);
end;

begin
SetupSrl;
SetupReflection;
ActivateClient;
DeclarePlayers;
LoginPlayer;
Main;
end.


I know its pretty rough but I just started today. Would it be best to save the locations of the doors in Tpoints and just use R_opendoor on the nearest door if I am stuck against a wall? Is there a better way? Is there an example you could provide. Thanks!

[edit]
i skyped hope you do not mind ;)

xPeritus
06-13-2014, 06:05 AM
When running the test, I get error: Exception in Script: Operator expected at line 281, column 26 in file "C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Tiles.simba".
Any idea what operator I need to add and where?

roguered
07-15-2014, 05:23 PM
Is reflection only for rs3? Does it still work? Should I do this for osrs?

Turpinator
07-15-2014, 06:21 PM
Is reflection only for rs3? Does it still work? Should I do this for osrs?

Well, its called "Reflection Include for Osr" so ill let you drawn your own conclusions from that.
Need a little more help? Its posted in the "Old School Runescape Help and Tutorials" forum. sooo.

dan8808
08-15-2014, 03:32 PM
I was trying to run joulaha's catherby fisher and I got this message:

Attempting to spawn a client
Grabbing your best world...
Succesfully spawned a client, attempting to target...
Set SMART[4168] as Simba's target
Reflection Hooks are outdated
No need to post about it, we are currently working on it. ~ Reflection dev's
Succesfully freed SMART[4168]
Successfully executed.

I have reflection and have used this script many times in the past.

Harrier
08-15-2014, 03:36 PM
I was trying to run joulaha's catherby fisher and I got this message:

Attempting to spawn a client
Grabbing your best world...
Succesfully spawned a client, attempting to target...
Set SMART[4168] as Simba's target
Reflection Hooks are outdated
No need to post about it, we are currently working on it. ~ Reflection dev's
Succesfully freed SMART[4168]
Successfully executed.

I have reflection and have used this script many times in the past.

Reflection Hooks are outdated
No need to post about it, we are currently working on it. ~ Reflection dev's

No need to post about it, we are currently working on it.

No need to post about it.
...

lanadekat
08-20-2014, 12:46 PM
When running the test, I get error: Exception in Script: Operator expected at line 281, column 26 in file "C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Tiles.simba".
Any idea what operator I need to add and where?
http://i.imgur.com/TUYpNSa.png
make sure it's pascalscript

imabadass
09-13-2014, 11:09 PM
I'm having an issue getting the script writer up on my mac, can you help me?

Woodcutters
02-28-2015, 11:39 AM
25154

Exception in Script: Unable to find file 'SRL-OSR/SRL/Reflection/Reflection.simba' used from ''

getting this code, I have all my files correct I believe

Solar
02-28-2015, 12:08 PM
25154

Exception in Script: Unable to find file 'SRL-OSR/SRL/Reflection/Reflection.simba' used from ''

getting this code, I have all my files correct I believe

If you read it properly it also tells you to rename the osr reflection master folder to just reflection.

Harrier
02-28-2015, 12:08 PM
25154

Exception in Script: Unable to find file 'SRL-OSR/SRL/Reflection/Reflection.simba' used from ''

getting this code, I have all my files correct I believe
Re-name the file to Reflection

Woodcutters
03-01-2015, 01:14 AM
okay great thanks I got it up and running

lolskilla
03-02-2015, 03:52 AM
Thank you

Life2dmax
04-14-2015, 05:08 AM
thanks, this helped

xujnea
05-02-2015, 09:29 PM
Seems like i cant run it,any ideas?

program New;
//{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}
{$i Reflection/Reflection.Simba}

begin
SetupSrl;
SetupReflection;
end.

And i get this error :

Error: Duplicate declaration "Skill_Attack" at line 220
Compiling failed.

lizon
09-25-2015, 12:19 AM
so if i use R_TileOnMM(Tile: TPoint): boolean; does it returns true if i am standing on the tile or if it is showing in the minimap?

new botter
11-18-2016, 07:45 AM
Hi there, I have been trying to get the tile my player is standing on, but can't seem to do so. All I'm getting is "{X = 2046021779, Y = -989860132}"
May I know what I'm doing wrong? :O


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

var
MyPlayer : TReflectLocalPlayer;

begin
initAL;
MyPlayer.Create;
repeat
writeln(MyPlayer.GetTile);
wait(1000);
until(false);
end;

hawkzz
12-01-2016, 07:51 PM
Im also getting Duplicate declaration "Skill_Attack" error. Downloaded the lape include, extracted, tried to compile but failed. Anybody could help?

Joopi
12-02-2016, 07:27 AM
Im also getting Duplicate declaration "Skill_Attack" error. Downloaded the lape include, extracted, tried to compile but failed. Anybody could help?

Don't include SRL-OSR together with reflection... They dont go well together

AFools
02-05-2017, 10:26 AM
I have tried many different way to try store multiple NPCs



function TReflectNpc.FindFree(Name: string): Boolean;
var
Npcs: TReflectNPCArray; <--- this is an array so multiple NPC are being searchesd
I: Integer;
begin
Npcs.Get('Chicken','Cow'); <--- this is obviously overloaded
for I := 0 to High(Npcs) do
if (Npcs[I].IsFree) and (NPCs[I].GetInteractingIndex = -1) then
begin
Self := Npcs[I];
Exit(True);
end;
end;


I have been bored recently and wanting to make more in depth scripts; attacking multiple npcs is a great anti-ban =D

botscaper
12-22-2017, 11:37 PM
thanks for the guide