View Full Version : Need some help with my first script. Just walking atm
Here2help
05-16-2012, 02:49 AM
So I've decided to make my first script a Catherby cooker.
Atm I am working on the walking... One step at a time.. Pun intended lol.
program Here2cook;
{$i srl/srl.simba}
{$i sps/sps.simba}
{$DEFINE SMART}
begin
SPS_setup(RUNESCAPE_SURFACE);
myPath := [myPath := [Tile(2814, 3437), Tile(2814, 3437), Tile(2819, 3438)];
end.
But i keep getting a compiling failure. I just want to watch it walk this before i move on. Any reason as to why I'm getting this?
Here2help
05-16-2012, 02:51 AM
[Hint] C:\Simba\Includes\SRL/SRL/core/animation.simba(257:3): Variable 'X' never used at line 256
[Hint] C:\Simba\Includes\SRL/SRL/core/animation.simba(257:3): Variable 'Y' never used at line 256
[Error] (10:3): Unknown identifier 'myPath' at line 9
Compiling failed.
is the error code.
I just noticed with Wolygon's path creator, it has a reflection and an sps format. I'm assuming sps is more reliable? What's the difference?
Awkwardsaw
05-16-2012, 02:53 AM
in the beginning of the script you need to declare mypath as a variable, in this case it's a TPointArray, because it's an array of TPoints.
program Here2cook;
{$i srl/srl.simba}
{$i sps/sps.simba}
{$DEFINE SMART}
var
myPath : TPointArray;
begin
SPS_setup(RUNESCAPE_SURFACE);
myPath := [Tile(2814, 3437), Tile(2814, 3437), Tile(2819, 3438)];
end.
e: oh, and you need to define SMART before you include srl, so it should look like this:
program Here2cook;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
var
myPath : TPointArray;
begin
SetupSRL;
SPS_setup(RUNESCAPE_SURFACE);
myPath := [myPath := [Tile(2814, 3437), Tile(2814, 3437), Tile(2819, 3438)];
end.
Here2help
05-16-2012, 03:00 AM
in the beginning of the script you need to declare mypath as a variable, in this case it's a TPointArray, because it's an array of TPoints.
program Here2cook;
{$i srl/srl.simba}
{$i sps/sps.simba}
{$DEFINE SMART}
var
myPath : TPointArray;
begin
SPS_setup(RUNESCAPE_SURFACE);
myPath := [Tile(2814, 3437), Tile(2814, 3437), Tile(2819, 3438)];
end.
e: oh, and you need to define SMART before you include srl, so it should look like this:
program Here2cook;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
var
myPath : TPointArray;
begin
SetupSRL;
SPS_setup(RUNESCAPE_SURFACE);
myPath := [myPath := [Tile(2814, 3437), Tile(2814, 3437), Tile(2819, 3438)];
end.
Ok, I think i'm getting the hang of var now..
I'm still getting a compiling failed message.
it has the
SPS_Setup(RUNESCAPE_SURFACE);
highlighted
and has
[Hint] C:\Simba\Includes\SRL/SRL/core/animation.simba(257:3): Variable 'X' never used at line 256
[Hint] C:\Simba\Includes\SRL/SRL/core/animation.simba(257:3): Variable 'Y' never used at line 256
[Error] (10:31): Invalid number of parameters at line 9
Compiling failed. in the debug box.
This is what what i have.
program Here2cook;
{$i srl/srl.simba}
{$i sps/sps.simba}
{$DEFINE SMART}
var
Mypath : TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE);
myPath := [Tile(2814, 3437), Tile(2814, 3437), Tile(2819, 3438)];
end.
e/ just saw your edit. Even after defining smart first, i still get a compiling failure.
Awkwardsaw
05-16-2012, 03:06 AM
If you hit ctrl + space right after " SPS_Setup" but before the "(" a pop up will apear showing the parameters that you need to have. The first parameter is RUNESCAPE_SURFACE, and the second is the SPS_Areas.
Should look like this:
var
myPath : TPointArray;
myAreas : TStringArray;
begin
myAreas := ['7_7']; //defined as a TStringArray
SPS_Setup(RUNESCAPE_SURFACE, myAreas);
myPath := [Tile(2814, 3437), Tile(2814, 3437), Tile(2819, 3438)];
end.
Hope it makes more sence :)
Here2help
05-16-2012, 03:09 AM
If you hit ctrl + space right after " SPS_Setup" but before the "(" a pop up will apear showing the parameters that you need to have. The first parameter is RUNESCAPE_SURFACE, and the second is the SPS_Areas.
Should look like this:
var
myPath : TPointArray;
myAreas : TStringArray;
begin
myAreas := ['7_7']; //defined as a TStringArray
SPS_Setup(RUNESCAPE_SURFACE, myAreas);
myPath := [Tile(2814, 3437), Tile(2814, 3437), Tile(2819, 3438)];
end.
Hope it makes more sence :)
Damn you just did a flip flop on me. I'm going to read the SPS Walking Guide a couple more times. See if all this will fit together after.
Here2help
05-16-2012, 03:16 AM
I did it! COMPILE SUCCESSFULLY EXICUTED. I'm a boss.
program Here2cook;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
var
Mypath : TPointArray;
myAreas : TStringArray;
begin
SPS_Areas := ['7_7'];
SPS_Setup(RUNESCAPE_SURFACE, myAreas);
myPath := [Point(3077, 2884), Point(3077, 2884), Point(3097, 2878), Point(3074, 2885), Point(3074, 2885)];
end.
I was copying the reflection points instead of the SPS points.
Why wont it open smart so i can test this small walking script?
e/ Also for walking back. do i have to make another line of code the same way, but just point B to point A? Or is there something i can just add to the line of code to make it walk back?
I did it! COMPILE SUCCESSFULLY EXICUTED. I'm a boss.
program Here2cook;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
var
Mypath : TPointArray;
myAreas : TStringArray;
begin
SPS_Areas := ['7_7'];
SPS_Setup(RUNESCAPE_SURFACE, myAreas);
myPath := [Point(3077, 2884), Point(3077, 2884), Point(3097, 2878), Point(3074, 2885), Point(3074, 2885)];
end.
I was copying the reflection points instead of the SPS points.
Why wont it open smart so i can test this small walking script?
e/ Also for walking back. do i have to make another line of code the same way, but just point B to point A? Or is there something i can just add to the line of code to make it walk back?
Congrats ;)
Maybe you want to make it a procedure like this?
program CatherbyCooker;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
procedure WalkToCook;
var
Mypath : TPointArray;
myAreas : TStringArray;
begin
SPS_Areas := ['7_7'];
SPS_Setup(RUNESCAPE_SURFACE, myAreas);
myPath := [Point(3077, 2884), Point(3077, 2884), Point(3097, 2878), Point(3074, 2885), Point(3074, 2885)];
end;
begin
SetupSRL;//Must Have for it to work
WalkToCook;
end.
Oh and to walk back to the bank just do exactly the same thing but B to a Instead Of A to B. AKA Make the path again.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.