SRL Archive - Reflection Tutorials

Using Reflection!


Timer

2008-08-04 10:52:01

Walking
Walking on runescape has never been easier (for SCAR atleast…), now with reflection you can Get Tiles of the runescape map, and click them for walking.

So, Lets Begin!
——————————————–
Alright, there are three functions you need to be familiar with -
procedure R_FFlag(Distance: Integer);                                      
Procedure R_Flag;
Function WalkToTile(Tile: TPoint; Randomness, FlagD: Integer): Boolean;
alright, R_FFlag and R_Flag, are the "same" as srls (in usage), except use reflection, you can put those aside for later use (making custom tile walking functions), lets focus on the main one.
Function WalkToTile(Tile: TPoint; Randomness, FlagD: Integer): Boolean;
This function will click the minimap at a precise point (with your randomness of coarse then, making it un-precise.. xD), to use this function you will imput a tile, for example..
WalkToTile(Point(3341, 3352), Randomness, FlagD);
then the randomness on the number of tiles..
WalkToTile(Point(3341, 3352), 3, FlagD);
then, a Flag distance (in tiles)
WalkToTile(Point(3341, 3352), 3, 5);
To get a tile, stand on the map on which tile you want, and run this little script
{.include SRL\SRL\Misc\Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\Reflection\Reflection.scar}

var
Ref_Pos: TPoint;

begin
SmartSetupEx(World, False, True, False);
SetTargetDc(SmartGetDC);
SetupSRL;
Ref_Pos := GetMyPos;
WriteLn('Point(' + IntToStr(Ref_Pos.x) + ', ' + IntToStr(Ref_Pos.y) + ')');
end.

WILL FINISH UPDATING, JUST FU**ING WAIT

Nexhou

2008-08-04 11:13:54

This is great! I cant wait until its done!

Hugolord

2008-08-04 11:16:43

Looking good ^^ maybe add a section on how to make an array tile playground (like an array with alot of tiles for one location like all tiles in a bank or all fishing spots) so then we can randomize the tiles for each location.

ShawnjohnSJ

2008-08-04 11:26:33

Looks amazing. Thanks for the tutorial, will edit when it's fully done.

sjlou

2008-08-04 11:35:09

i was waiting for someone to make a tut for reflection
cant wait till it done :D

Pure1993

2008-08-04 14:19:59

Hehe, with reflections, everything is way too easy. wrote a willow burner in 15 minutes which works like a charm. Will start with a willow chopper and banker in 10 minutes, and I plan to be done in 35 minutes… too easy…(but heck, this will get my main to lvl 99 fishing, firemaking and woodcutting in no time) :D

Timer

2008-08-04 14:59:30

Fully Done and Upto Date.

(More will be added, (Objects) once object finding is completed.)

TheGuyWhoGotOn

2008-08-04 15:10:59

Very nice, maybe this will help some reflection noobs get into reflection :).

Pure1993

2008-08-04 16:22:11


=============================================
===========Pure1993s Willow Burner===========
=============================================
Logs Burned: 156
Time Running: 14 Minutes and 52 Seconds
You started out with: 122970xp.
You gained 14040xp!
Your current level is 53.
You gained 2 level(s).
==================Thank You==================
=============================================
(Stopped manually to configure failsafes (this was still in the testing phase)).

=============================================
===========Pure1993s Willow Burner===========
=============================================
Logs Burned: 269
Time Running: 20 Minutes and 18 Seconds
You started out with: 145830xp.
You gained 24210xp!
Your current level is 55.
You gained 2 level(s).
==================Thank You==================
=============================================
(stopped because of school random).

=============================================
===========Pure1993s Willow Burner===========
=============================================
Logs Burned: 351
Time Running: 26 Minutes and 5 Seconds
You started out with: 170865xp.
You gained 31590xp!
Your current level is 56.
You gained 1 level(s).
==================Thank You==================
=============================================
(crashed because of huge lagg (3 minutes)).

Some proggies of my script… when nothing interferes, it worked like an oiled machien.. I LOVE REFLECTIONS! Now the waiting until a fire is up is failsafe. Up to now, when lighting fires quickly in a row, the "attempting to light a fire" doesn't show up, thus messing up LightWait, now we can just wait until we moved one square further east or west (west if there is a wall and you char walked back one). My Willow chopper is also already done, but haven't tested it yet, want to burn the 6k willows I have left first :D. So yeha, back on topic: You might also want to introduce some things that can be done with reflections that aren't in the actual library… comming to think of it… can I design some skill functions for the reflection library? :D

P1nky

2008-08-04 17:45:10

wel written gonna take time to read this 2nite ;) gj

Shuttleu

2008-08-04 17:57:02

well done but i dont undersyand TNPC's
mabey you could explain them a bit more?

~shut

NiCbaZ

2008-08-04 18:01:30

as widget said reflect is not read for public use really yet so if srl makes reflection scripts try to keep them in members section until it is ready, we are making new functions every day so it wort be long !

Shuttleu

2008-08-04 19:07:14

From: NiCbaZ
as widget said reflect is not read for public use really yet so if srl makes reflection scripts try to keep them in members section until it is ready, we are making new functions every day so it wort be long !

well if this is members only then mabey they should make a members obly tutorial island?

~shut

Method

2008-08-04 22:50:58

From: Shuttleu
well done but i dont undersyand TNPC's
mabey you could explain them a bit more?

~shut


TNPC is just a type used for storing information from NPCs. With it, you can access quite a bit of information about all of the NPCs on the screen. Things like: tile position, main screen coordinates, type, name, if it's in a fight or moving all are accessible through the type once you call one of the NPC functions in Characters.scar

To use the type, just declare a variable as an NPC (something like Banker: NPC would work, for example). Then, you can use a function like FindNPC('Banker', Banker) to check to see if it's on the map. From there, you can walk to it or click on it through it's tile position or coordinates on the screen.

Negaal

2008-08-05 02:11:23

Holy cow! Nicely explained..

NiCbaZ

2008-08-05 02:53:51

Anyway Nice Tut Timer, should help lots of people wanting to script. To all people out there before you relase your reflections script, you will probaly need to update the because us Devs are devolping and changing reflection every day.

Timer, a Neater And shorter way for loading tiles is like….

Function WalkThere(what: string);
Var
Tiles: TPointArray

begin
case what of
'tobank': begin
Tiles:=[Point(3007,3347),Point(3006,3332),Point(3001,3317),Point(2994,3305),
Point(2987,3296),Point(2979,3294),Point(2972,3279),Point(2974,3267),
Point(2977,3254),Point(2977,3240),Point(2976,3234)];

end;
end;
WalkThePath(Tiles)
end;

i wrote that on the sport so it looks crap, but you get what i mean Load It in a TpointArray so you dont have 2 Load Each Tile in an Array?

anyway nice tut relfection is getting better and better w00t.

Pure1993

2008-08-05 08:19:45

@NiCbaZ: Well, I don't get it why not posting something as simple as an autoburner in the Jr. Member section… it can serve as a little example on how they can be used… also, I believe that there are flax spinners and such things released already…But for now, I will keep my scripts to myself anyway… I might release them all in one big bundel if they have gone obsolete, or there is a great demand for such scripts as I have. By obsolete I mean for my own purpose, because I get an unsolvable every 45 minutes anyway (got a maze, a mime, and a school), and if I were to publishe it, who knows at what rate I would get the randoms then… especially, I only auto with my main atm, and he was hard work to get him to where he is, so I won't risk using public scripts ^^.
[OFFTOPIC]
Another proggy :D:

=============================================
===========Pure1993s Willow Burner===========
=============================================
Logs Burned: 620
Time Running: 46 Minutes and 57 Seconds
You started out with: 229545xp.
You gained 55800xp!
Your current level is 60.
You gained 2 level(s).
==================Thank You==================
=============================================
crashed because of maze random… -.-
[/OFFTOPIC]

The!

2008-08-07 22:52:42

Could we also add:

isInteracting - See's if your player is interacting with something, useful for combat since while your in combat your animation goes to -1 at some points, but your still interacting with the NPC.

myPlayer - Gets the things of your player, E.G. animation, plane, login index.

deathbyvirus

2008-08-08 02:03:57

is reflection not working atm? I've made a path marking script which puts everything together for you the only problem is, is that when i mark the path, it just comes up with the same number (33554430, 33554430) everytime, no matter where i move to (not a scripting error)

NiCbaZ

2008-08-08 02:31:27

From: The!
Could we also add:

isInteracting - See's if your player is interacting with something, useful for combat since while your in combat your animation goes to -1 at some points, but your still interacting with the NPC.

myPlayer - Gets the things of your player, E.G. animation, plane, login index.


its already done :o, you can get login index, and ani not sure about plane tho

OpenHearts

2008-08-09 05:15:26

//------------------------------------------------------------------\\
//-- Scar Non-Standard Resource Library --||
//-- » Reflection Routines - Walking --||
//------------------------------------------------------------------//
// * Function DistanceFrom(TileX, TileY: Integer) : Integer; // * by Widget
// * Function ClickTile(TileX, TileY, Height : Integer; // * by ss23 and Widget
// Left : Boolean) : Boolean; // º
// * Function WalkToTile(TileX, TileY : Integer): Boolean; // * by ss23 and Widget
// * Function WalkToTileTol(TileX, TileY, Tol : Integer): Boolean; // * by ss23 and Widget and TheGuyWhoGotOn
// * Function AlmostThere: Boolean; // * by TheGuyWhoGotOn
// * function LongWalkEx(TileX, TileY, DisX, DisY, // * by TheGuyWhoGotOn
// * Tol : integer): boolean; // º
// * function LongWalk(TileX, TileY, Tol : integer): boolean; // * by TheGuyWhoGotOn
// * function PathWalk(Path : array of TPoint; Long : boolean; // * by TheGuyWhoGotOn
// * Tol : integer): Boolean; // º
// * Function GoToTile(XTile, YTile, FlagD: Integer): Boolean; // * by Timer
// * Function WalkPath(Path: TPointArray; StartTile, // * by Timer
// * FlagD: Integer): Boolean; // º
// * Function GetLowest(aVar: TIntegerArray): Integer; // * by Timer
// * Function GetHighest(aVar: TIntegerArray): Integer; // * by Timer
// * Function FindMeOnPath(Var aVar: Integer; Path: TPointArray; // * by Timer
// * LocateTo: Boolean): Boolean; // º
// * Function WalkThePath(Path: TPointArray): Boolean; // * by Timer
// * Function GerneratePath(StartTilePosX, StartTilePosY, TilePosX, // * by MasterKill
// * TilePosY: Integer): TPointArray; // * º
// * Function BlindWalkToTile(TilePosX, TilePosY): Boolean; // * by MasterKill
// * Procedure R_Flag; // * by Timer
// * procedure R_FFlag(Distance: Integer); // * by ZephyrsFury
//------------------------------------------------------------------//

If these are the functions/procedures in walking.scar, how come I only have:

//------------------------------------------------------------------\\
//-- Scar Non-Standard Resource Library --||
//-- » Reflection Routines - Walking --||
//------------------------------------------------------------------//
// * function WalkToTile(TileX, TileY : Integer): Boolean; // * by ss23 and Widget
// * function GetFlag(var x, y: Integer): boolean; // * by TheGuyWhoGotOn
// * procedure R_Flag; // * by Timer
// * procedure R_FFlag(Distance: Integer); // * ZephyrsFury
// * Function DistanceFrom(TileX, TileY: Integer) : Integer; // * by Widget
//------------------------------------------------------------------//

Is what you posted a members only part of reflection? Or is there something wrong with mine? I've tried updating it several times, but my walking.scar never includes what you have posted.

EDIT: I can't believe I thought some parts of it was members only, since when can you detect whether your a member or not if your downloading something. Anyway…Help please :p

Method

2008-08-09 13:39:58

You've got the latest one, OpenHearts. Walking.scar was recently updated and cleaned out, so you're seeing what's left.

Rubix

2008-08-09 17:22:16

Now, lets set the length of tiles…

what does that mean? examples pleasE?

carlover

2008-08-10 12:40:06

Ok i think i understand this but how do you make the path more random?

Method

2008-08-10 13:17:52

From: carlover
Ok i think i understand this but how do you make the path more random?


Add randomness to the tiles themselves, use multiple paths, or make the Mouse randomness when you click bigger (in WalkToTile).

carlover

2008-08-10 18:30:05

Ok now i'm having some trouble i've used sumilions new reflection path maker tool to get all this ||
\/
function LoadPath: TPointArray;
begin
SetLength(Result, 42);

Result[0] := Point(3012, 3354);
Result[1] := Point(3008, 3362);
Result[2] := Point(3000, 3362);
Result[3] := Point(2995, 3367);
Result[4] := Point(2987, 3371);
Result[5] := Point(2980, 3377);
Result[6] := Point(2971, 3378);
Result[7] := Point(2967, 3384);
Result[8] := Point(2967, 3394);
Result[9] := Point(2965, 3402);
Result[10] := Point(2969, 3409);
Result[11] := Point(2975, 3414);
Result[12] := Point(2984, 3419);
Result[13] := Point(2988, 3426);
Result[14] := Point(2997, 3432);
Result[15] := Point(3008, 3431);
Result[16] := Point(3016, 3425);
Result[17] := Point(3022, 3422);
Result[18] := Point(3027, 3425);
Result[19] := Point(3036, 3425);
Result[20] := Point(3041, 3415);
Result[21] := Point(3051, 3414);
Result[22] := Point(3057, 3415);
Result[23] := Point(3068, 3416);
Result[24] := Point(3079, 3416);
Result[25] := Point(3087, 3421);
Result[26] := Point(3098, 3420);
Result[27] := Point(3112, 3420);
Result[28] := Point(3119, 3417);
Result[29] := Point(3126, 3414);
Result[30] := Point(3137, 3416);
Result[31] := Point(3147, 3416);
Result[32] := Point(3158, 3418);
Result[33] := Point(3166, 3426);
Result[34] := Point(3176, 3428);
Result[35] := Point(3175, 3442);
Result[36] := Point(3171, 3453);
Result[37] := Point(3166, 3460);
Result[38] := Point(3164, 3467);
Result[39] := Point(3164, 3475);
Result[40] := Point(3164, 3481);
Result[41] := Point(3165, 3487);

end;

But now how do i get all this into a script that will click all those points?

Please help:(

Sumilion

2008-08-10 18:51:17

program WalkExample;
{.include SRL\SRL\misc\Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\reflection\reflection.scar}


var
Path: TPointArray;

function GoToTile(p: TPoint; FlagD: Integer): Boolean;
// by Timer
begin
Result := WalkToTile(p, 0, 0);
if (not (Result)) then
Exit;

FFlag(FlagD);
end;

function WalkPath(Path: TPointArray; FlagD: Integer): Boolean;
// by timer
var
H, I: Integer;

begin
H := High(Path);

for I := 0 to H do
if (not (GoToTile(Path[i], FlagD))) then
Exit;

Result := True;
end;

function LoadPath: TPointArray;
begin
SetLength(Result, 42);

Result[0] := Point(3012, 3354);
Result[1] := Point(3008, 3362);
Result[2] := Point(3000, 3362);
Result[3] := Point(2995, 3367);
Result[4] := Point(2987, 3371);
Result[5] := Point(2980, 3377);
Result[6] := Point(2971, 3378);
Result[7] := Point(2967, 3384);
Result[8] := Point(2967, 3394);
Result[9] := Point(2965, 3402);
Result[10] := Point(2969, 3409);
Result[11] := Point(2975, 3414);
Result[12] := Point(2984, 3419);
Result[13] := Point(2988, 3426);
Result[14] := Point(2997, 3432);
Result[15] := Point(3008, 3431);
Result[16] := Point(3016, 3425);
Result[17] := Point(3022, 3422);
Result[18] := Point(3027, 3425);
Result[19] := Point(3036, 3425);
Result[20] := Point(3041, 3415);
Result[21] := Point(3051, 3414);
Result[22] := Point(3057, 3415);
Result[23] := Point(3068, 3416);
Result[24] := Point(3079, 3416);
Result[25] := Point(3087, 3421);
Result[26] := Point(3098, 3420);
Result[27] := Point(3112, 3420);
Result[28] := Point(3119, 3417);
Result[29] := Point(3126, 3414);
Result[30] := Point(3137, 3416);
Result[31] := Point(3147, 3416);
Result[32] := Point(3158, 3418);
Result[33] := Point(3166, 3426);
Result[34] := Point(3176, 3428);
Result[35] := Point(3175, 3442);
Result[36] := Point(3171, 3453);
Result[37] := Point(3166, 3460);
Result[38] := Point(3164, 3467);
Result[39] := Point(3164, 3475);
Result[40] := Point(3164, 3481);
Result[41] := Point(3165, 3487);
end;

begin
SetupSRL;
Path := LoadPath;
WalkPath(Path, 10);
end.

There we go, now I didn't test it so I'm not sure if it works..

carlover

2008-08-10 18:58:23

Ok i'll try it and thanks sumilion for both the helpful post and the extremely helpful path maker tool. If I ever have any more questions is it ok to PM you?

jas0npc

2008-08-10 23:50:12

From: Method
make the Mouse randomness when you click bigger (in WalkToTile).



Could you explain this bit please, Sorry to sound like a noob, But im TRYING to learn lol, many thanks.

carlover

2008-08-11 09:07:15

OK jason this is it without randomness
function GoToTile(XTile, YTile, FlagD: Integer): Boolean;
// by Timer
begin
Result := WalkToTile(XTile, YTile, 0, 0);
if (not (Result)) then
Exit;

And this is it with randomness
function GoToTile(XTile, YTile, FlagD: Integer): Boolean;
// by Timer
begin
Result := WalkToTile(XTile, YTile, 4, 4);//change these last two number
if (not (Result)) then
Exit;
Hope that answered your question.

jas0npc

2008-08-11 09:30:59

From: carlover
OK jason this is it without randomness
function GoToTile(XTile, YTile, FlagD: Integer): Boolean;
// by Timer
begin
Result := WalkToTile(XTile, YTile, 0, 0);
if (not (Result)) then
Exit;

And this is it with randomness
function GoToTile(XTile, YTile, FlagD: Integer): Boolean;
// by Timer
begin
Result := WalkToTile(XTile, YTile, 4, 4);//change these last two number
if (not (Result)) then
Exit;
Hope that answered your question.


so if i understand it right, Result := WalkToTile(XTile, YTile, 4, 4);//change these last two number

will it choose a random number between 1 and 4, or will it just use the number 4

Naike

2008-08-11 09:35:47

Reflection have been TPoint based.. So Timer have to Rewrite hes tut :)

carlover

2008-08-11 10:52:31

It will choose a random between 0-4. And yea this really sux that everything has been TPoint based cuz now i have to change all the stuff that i have been working on. I wish that they would stop changing it around so much..OO well.

Sumilion

2008-08-11 13:16:21

From: carlover
It will choose a random between 0-4. And yea this really sux that everything has been TPoint based cuz now i have to change all the stuff that i have been working on. I wish that they would stop changing it around so much..OO well.


Actually its 0-3

From: carlover
Ok i'll try it and thanks sumilion for both the helpful post and the extremely helpful path maker tool. If I ever have any more questions is it ok to PM you?


You're welcome, no :D

I never actually made a reflection script you know … :p except for one simple thing a loooong time ago.

basic_i

2008-08-11 23:41:32

From: Pure1993
Hehe, with reflections, everything is way too easy.


Well don't complain…..I was going to learn the old fashioned way, but this is awesome. This should make my life easier by about a weeks worth of time, and bucket's load of stressful thinking.

Who ever made this, tell them I said thank you.

soccnut

2008-08-12 11:30:19

Cant compile your example.Line 13 has invalid parameters.

Result := WalkToTile(XTile, YTile, 0, 0);

{*******************************************************************************
Function - WalkToTile(Tile: TPoint; Randomness, FlagD: Integer): Boolean;
By: Wizzup
Description: Walks to the tile using minimap.
*******************************************************************************}

Sumilion

2008-08-12 12:01:04

From: soccnut
Cant compile your example.Line 13 has invalid parameters.

Result := WalkToTile(XTile, YTile, 0, 0);

{*******************************************************************************
Function - WalkToTile(Tile: TPoint; Randomness, FlagD: Integer): Boolean;
By: Wizzup
Description: Walks to the tile using minimap.
*******************************************************************************}


Lol reflection changes too much … updated version :

program WalkExample;
{.include SRL\SRL\misc\Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\reflection\reflection.scar}


var
Path: TPointArray;

function GoToTile(p: TPoint; FlagD: Integer): Boolean;
// by Timer
begin
Result := WalkToTile(p, 0, 0);
if (not (Result)) then
Exit;

FFlag(FlagD);
end;

function WalkPath(Path: TPointArray; FlagD: Integer): Boolean;
// by timer
var
H, I: Integer;

begin
H := High(Path);

for I := 0 to H do
if (not (GoToTile(Path[i], FlagD))) then
Exit;

Result := True;
end;

function LoadPath: TPointArray;
begin
SetLength(Result, 42);

Result[0] := Point(3012, 3354);
Result[1] := Point(3008, 3362);
Result[2] := Point(3000, 3362);
Result[3] := Point(2995, 3367);
Result[4] := Point(2987, 3371);
Result[5] := Point(2980, 3377);
Result[6] := Point(2971, 3378);
Result[7] := Point(2967, 3384);
Result[8] := Point(2967, 3394);
Result[9] := Point(2965, 3402);
Result[10] := Point(2969, 3409);
Result[11] := Point(2975, 3414);
Result[12] := Point(2984, 3419);
Result[13] := Point(2988, 3426);
Result[14] := Point(2997, 3432);
Result[15] := Point(3008, 3431);
Result[16] := Point(3016, 3425);
Result[17] := Point(3022, 3422);
Result[18] := Point(3027, 3425);
Result[19] := Point(3036, 3425);
Result[20] := Point(3041, 3415);
Result[21] := Point(3051, 3414);
Result[22] := Point(3057, 3415);
Result[23] := Point(3068, 3416);
Result[24] := Point(3079, 3416);
Result[25] := Point(3087, 3421);
Result[26] := Point(3098, 3420);
Result[27] := Point(3112, 3420);
Result[28] := Point(3119, 3417);
Result[29] := Point(3126, 3414);
Result[30] := Point(3137, 3416);
Result[31] := Point(3147, 3416);
Result[32] := Point(3158, 3418);
Result[33] := Point(3166, 3426);
Result[34] := Point(3176, 3428);
Result[35] := Point(3175, 3442);
Result[36] := Point(3171, 3453);
Result[37] := Point(3166, 3460);
Result[38] := Point(3164, 3467);
Result[39] := Point(3164, 3475);
Result[40] := Point(3164, 3481);
Result[41] := Point(3165, 3487);
end;

begin
SetupSRL;
Path := LoadPath;
WalkPath(Path, 10);
end.

slakan

2008-08-13 12:43:48

{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}

Var
X, Y: Integer;

Begin
SmartSetup('world144', True, True, False);
SetTargetDC(SmartGetDC);
SetupSRL;
SetupReflection;
ActivateClient;
Wait(2000 + Random(500));
Repeat
If (IsFKeyDown(2)) Then
Begin
GetMyPos(X, Y);

WriteLn(IntToStr(X) + ', ' + IntToStr(Y));

While (IsFKeyDown(2)) Do
Wait(1);
End;
Until False;
End.

Dont work..

Tniffoc

2008-08-14 00:16:02

Ok, I've got two things. One, how do you click on an npc after you use FindNPC? Second, Here is an updated version of Timer's Path Creation Script. (Up to date for Reflection 68). If anyone objects to me updating his script for him, I will remove immediately. @Slakan, This is a fix to your last post.


{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}

Var
X, Y: Integer;
t: TPoint;

Begin
SmartSetup('world11', True, True, False);
SetTargetDC(SmartGetDC);
SetupSRL;
SetupReflection; // You may or may not need to comment out this line.
ActivateClient;
Wait(2000 + Random(500));
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;
Players[0].Name:= 'username';
Players[0].Pass:= 'password';
Players[0].Active:= true;
Players[0].Nick:= 'nick';
Writeln('Logging in player!');
if(not LoggedIn)then
LoginPlayer;
Repeat
If (IsFKeyDown(2)) Then
Begin
t:= GetMyPos;

WriteLn(IntToStr(t.x) + ' , ' + IntToStr(t.y));

While (IsFKeyDown(2)) Do
Wait(1000);
End;
wait(2000);
Until IsFKeyDown(3);
Logout;
End.

NiCbaZ

2008-08-14 01:23:02

From: slakan
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}

Var
X, Y: Integer;

Begin
SmartSetup('world144', True, True, False);
SetTargetDC(SmartGetDC);
SetupSRL;
SetupReflection;
ActivateClient;
Wait(2000 + Random(500));
Repeat
If (IsFKeyDown(2)) Then
Begin
GetMyPos(X, Y);

WriteLn(IntToStr(X) + ', ' + IntToStr(Y));

While (IsFKeyDown(2)) Do
Wait(1);
End;
Until False;
End.

Dont work..



GetMyPos is a Tpoint now.

The!

2008-08-14 21:00:55

This will help major. Oh, can I request some things?

LoginIndex
isInteracting
isMoving
settingArray
interface support.

Method

2008-08-14 22:40:29

From: The!
This will help major. Oh, can I request some things?

LoginIndex
isInteracting
isMoving
settingArray
interface support.


There's already a hook for LoginIndex, and you can see if your character is moving using CharacterMoving. As far as I know, interfaces are being worked on, and the settings array may be also. I'm not sure about interacting, though.

Infantry001

2008-08-14 23:50:03

From: tniffoc
Ok, I've got two things. One, how do you click on an npc after you use FindNPC?


Well, say you do this:

FindNPC('Chicken',Chicken);

…where Chicken is already set as a TNPC variable.

All you would have to do is access the coordinates of the Chicken on the mainscreen. Say you want to move the mouse to the Chicken:

MMouse(Chicken.MS.X,Chicken.MS.Y)

..and that's it!

To learn a bit more about what you are actually doing, check out some the the reflection include files as well as this tut I used to learn about types and records.

http://www.villavu.com/forum/showthread.php?t=3747?t=4502&highlight=record

Bobarkinator

2008-08-15 08:12:37

From: The!
This will help major. Oh, can I request some things?

LoginIndex
isInteracting
isMoving
settingArray
interface support.


Before you request something, try checking if it's already been done. Maybe under a different name.

noidea

2008-08-18 20:31:31

When every I try and run the GetMyPos script that timer has on the front page, I get this error…

Line 20: [Error] (16572:12): Invalid number of parameters in script

Can I please get some help? (Yes, I did look at the function in the include file)

noidea

Shuttleu

2008-08-18 20:36:39

From: noidea
When every I try and run the GetMyPos script that timer has on the front page, I get this error…


Can I please get some help? (Yes, I did look at the function in the include file)

noidea

there was an update in reflection so make sure you have the latest revision of reflection

if you do have the latest revision then use this one

program DebugNPCs;
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/reflection/reflection.scar}
var
i:integer;
NPCs:array of TNPC;
s:string;
Position: TPoint;
begin
LoadHooks;
SmartSetupEx(123,false,false,false);
while true do
repeat
try
ClearDebug;
NPCs := SortNPCs(GetNPCs);
Position:= GetMyPos;
writeln(inttostr(Position.x)+' '+inttostr(Position.y));
Writeln('NPCs on screen: '+inttostr(GetArrayLength(NPCs)));
for i := 0 to High(NPCs) do
begin
s := padr(NPCs[i].Name,15);
s := s + ' ID: '+padr(inttostr(NPCs[i].NPCType),7);
s := s + ' ('+inttostr(NPCs[i].Tile.X)+', '+inttostr(NPCs[i].Tile.Y)+')';
s := s + ' In Fight: '+BoolToStr(NPCs[i].InFight);
s := s + ' Is Moving: '+BoolToStr(NPCs[i].IsMoving);
Writeln(s);
end;
sleep(500);
except
writeln('oh noes!')
sleep(500);
end;
until False;
end.
i take it your talking about the NPC Debugger

~shut

noidea

2008-08-18 20:44:21

Thx for the speedy responce.

noidea

Claymore

2008-08-29 17:17:42

how about a tutorial on making a FindItems. No one ever taught about items. Only once, but very little explained. Just handed over functions and i got 'wtf?'

Timer

2008-08-29 17:55:56

I'm working on a complete Rewrite.

fre

2008-09-11 13:32:48

The tile tool doesen't work for me..

I changed somethings like getmypos(x,y);
i removed the (x,y)

still don't work

i just get (0, 0)

no tile numbers/coordinates?

What can i do about this?

EDIT:
problem solved

Knoot

2008-09-14 14:38:43


{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Reflection\Reflection.Scar}

Var
X, Y: Integer;

Begin
SmartSetup('world144', True, True, False);
SetTargetDC(SmartGetDC);
SetupSRL;
SetupReflection;
ActivateClient;
Wait(2000 + Random(500));
Repeat
If (IsFKeyDown(2)) Then
Begin
GetMyPos(X, Y);

WriteLn(IntToStr(X) + ', ' + IntToStr(Y));

While (IsFKeyDown(2)) Do
Wait(1);
End;
Until False;
End.

It messes up at line 18 and says: "Line 18: [Error] (16957:15): Invalid number of parameters in script"

the line 18 is : "GetMyPos(x, y);"

Thanks.


The tile tool doesen't work for me..

I changed somethings like getmypos(x,y);
i removed the (x,y)

still don't work

i just get (0, 0)

no tile numbers/coordinates?

What can i do about this?

EDIT:
problem solved

Would be good if you told everybody else how you fixed it:D








EDIT2: Read on page 2 :D

TheSantaMan

2008-09-20 02:15:25

Wow reflection is big pimpin lol. Gonna use in my flax picker script.

davidwang

2008-11-12 12:07:04

thank you very muchy

Macros

2008-12-04 20:59:08

Please try and excuse the noobyish nature of these questions:

I still don't really understand what reflection is; is it just a client like SMART, (and based off SMART)?

Also, the functions etc listed here sound amazing, like everyone's been saying, but what makes them different from a normal SRL-included function?

Please include anything else you feel goes along with these questions.

Also I'm fairly certain that someone is going to respond with "search the forums n00b" or something like that, but before you do: I did search the forums, and while I can't say for certain that the answers aren't out there, I can say that there isn't much written on reflection, and it I'm not the only one wondering…

Method

2008-12-04 21:02:14

From: Macros
Please try and excuse the noobyish nature of these questions:

I still don't really understand what reflection is; is it just a client like SMART, (and based off SMART)?

Also, the functions etc listed here sound amazing, like everyone's been saying, but what makes them different from a normal SRL-included function?

Please include anything else you feel goes along with these questions.

Also I'm fairly certain that someone is going to respond with "search the forums n00b" or something like that, but before you do: I did search the forums, and while I can't say for certain that the answers aren't out there, I can say that there isn't much written on reflection, and it I'm not the only one wondering…


No, it's not a client like SMART. Reflection is a tool used by SMART that allows us to read information from the game client.

Reflection functions are different in the sense that they use information directly from the client's code instead of colors found on the game screen.

Macros

2008-12-04 21:14:23

Ohhh OK. That's brilliant! So it doesn't have to search for a banker, it just knows where one essentially?

Method

2008-12-04 21:25:38

From: Macros
Ohhh OK. That's brilliant! So it doesn't have to search for a banker, it just knows where one essentially?


Yes, it can locate NPCs without having to look for a color. It still has to search through the array of NPCs a bit, but it's more reliable and accurate than color finding would be (though not in the state SMART is in currently).

Da 0wner

2009-02-01 19:40:03

complete the tut now?

mikevskater

2009-02-02 13:48:32

[Runtime Error] : Type Mismatch in line 70 in script F:\SCAR 3.15\Scripts\Alch Script\Alch_Beta.scar
WTF!?!
I keep gettin this error no matter what i try…
this is the line 70 code:
if TileOnMM(point(3363,3320)) then
begin
WalkToTile(point(3363,3320), 1, 0);
EnterAlch;

Da 0wner

2009-02-03 18:35:08

Heh that is exactly what I get even when it is correct. Shouldn't be a problem with your code. Seems it is a problem with Reflection or something.

mormonman

2009-02-03 19:08:59

From: Da 0wner
Heh that is exactly what I get even when it is correct. Shouldn't be a problem with your code. Seems it is a problem with Reflection or something.


its no longer a tpoint in that function, its a ttile… look it up if you don't know what i mean

Da 0wner

2009-02-03 23:51:03

I know what TTile is ;). I just wasn't looking at the parameters for that procedure/function :p.

NiCbaZ

2009-02-04 00:58:49

DownGrade your reflection to 181 i think, the latest one afaik breaks all scripts and it simply wired.

Method

2009-02-04 09:46:05

From: NiCbaZ
DownGrade your reflection to 181 i think, the latest one afaik breaks all scripts and it simply wired.


It breaks all scripts for a reason. We're making a switch to TTiles (for some odd reason, though, tiles seemed like they worked fine).

mikevskater

2009-02-04 13:57:19

Ive converted my line of code to Tile(the shit…) and i still get runtime… WTF?!?!

lordsaturn

2009-02-04 14:14:00

Read:
http://www.villavu.com/forum/showthread.php?t=41555

Nava2

2009-02-07 00:38:43

This thread is also very old.

Try looking for more up-to-date tutorials and information.