SRL Archive - OSR Help

need help with first script!


x44

2013-03-01 19:39:55

Hello everyone I’m trying to make my first script (first time ever writing code lol) and it’s not going to well. I’m trying to walk from fally west bank to furnace. I have read a lot of walking tutorials but I can seem to get any to work. I followed the thread "SPS Walking guide" but my character doesn't want to walk. Not sure if it’s outdated or… I’m just doing something wrong.

I’m using movemouse and Clickmouse to walk around but I don’t think it’s the right way to do it. was just messing around to get a moral boost lol :/


Please go easy on me it’s my first time :)

Ian

2013-03-01 19:44:08

Could you post what you have so far? SPS should work fine :)

x44

2013-03-01 20:05:16

From: BMWxi
Could you post what you have so far? SPS should work fine :)


dont laugh

[PHP]program Script;
{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

Procedure Walk;
Var
myPath:TPointArray;
begin
SetupSRL;
SPS_Setup (RUNESCAPE_SURFACE,['9_7']);
myPath := [Point(249, 376), Point(246, 356), Point(196, 345), Point(174, 325), Point(137, 311), Point(93, 304), Point(87, 321)]; //Path
SPS_WalkPath(myPath);
end;

Procedure walkhere;
begin
SetupSRL;
SetAngle(SRL_ANGLE_HIGH);
MakeCompass('n');

Movemouse (147, 83)
wait(200);
Clickmouse (147, 83, mouse_Left);
wait(200)
end;
begin
walkhere;
end.

begin
SetupSRL;
ActivateClient;
ClickNorth(SRL_ANGLE_HIGH);
//DeclarePlayers;
//LoginPlayer;
end.

begin
end. [/PHP]

Ian

2013-03-01 22:08:28

Ok, it appears that you have multiple main loops. Delete the one at the end with nothing in it, and delete the one that is just

begin
WalkHere;
end.

Also remove SetupSRL; from your walking procedures, you only need to call it once in your mainloop.

Now, to add the SPS walking procedure to the main loop so it actually gets executed, put

Walk;

after

ClickNorth(SRL_ANGLE_HIGH);

now see if it walks :)

x44

2013-03-01 22:57:58

ok so i want to use SPS for walking. so i removed movemouse and clickmouse.

are movemouse and clickmouse good method of walking or SPS is better?


here is what i have its probably all wrong

[PHP]program Script;
{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

Procedure Walk;
Var
myPath:TPointArray;
begin
SetupSRL;
SetAngle(SRL_ANGLE_HIGH);
SPS_Setup (RUNESCAPE_SURFACE,['9_7']);
myPath := [Point(249, 376), Point(246, 356), Point(196, 345), Point(174, 325), Point(137, 311), Point(93, 304), Point(87, 321)]; //Path
SPS_WalkPath(myPath);
end;

begin
SetupSRL;
ActivateClient;
ClickNorth(SRL_ANGLE_HIGH);
Walk;
//DeclarePlayers;
//LoginPlayer;
end.
[/PHP]
i ran it, it adjusts compass then spawns another SMART client.

Sjoe

2013-03-01 23:11:01

Simba encounters issues on occasions when it is spawning a smart client.
Just close the smart clients and press play again.

Remove SetupSRL; in your procedure Walk;
As Bmwxi stated: 'Call SetupSRL once in Mainloop'.

Put DeclarePlayers; and LoginPlayer; after SetupSRL;

x44

2013-03-01 23:39:38

I think I have done what you guys have told me but still doesn't want to walk.

Sjoe

2013-03-01 23:44:55

From: x44
I think I have done what you guys have told me but still doesn't want to walk.


Post code?
PS: U can use
 tags instead of the [CODE] u are using at the moment.

x44

2013-03-01 23:50:58

From: Sjoekeloe
Post code?
PS: U can use
 tags instead of the [CODE] u are using at the moment.


ah thanks! sorry im very new to this if you cant tell already lol

program Script;
{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

Procedure Walk;
Var
myPath:TPointArray;
begin
SetAngle(SRL_ANGLE_HIGH);
SPS_Setup (RUNESCAPE_SURFACE,['9_7']);
myPath := [Point(-276, 40), Point(246, 356), Point(196, 345), Point(174, 325), Point(137, 311), Point(93, 304), Point(87, 321)]; //Path
SPS_WalkPath(myPath);
end;

begin
SetupSRL;
ActivateClient;
ClickNorth(SRL_ANGLE_HIGH);
Walk;
//DeclarePlayers;
//LoginPlayer;

end.

Sjoe

2013-03-01 23:59:20

From: x44
ah thanks! sorry im very new to this if you cant tell already lol

program Script;
{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

Procedure Walk;
Var
myPath:TPointArray;
begin
SetAngle(SRL_ANGLE_HIGH);
SPS_Setup (RUNESCAPE_SURFACE,['9_7']);
myPath := [Point(-276, 40), Point(246, 356), Point(196, 345), Point(174, 325), Point(137, 311), Point(93, 304), Point(87, 321)]; //Path
SPS_WalkPath(myPath);
end;

begin
SetupSRL;
ActivateClient;
ClickNorth(SRL_ANGLE_HIGH);
Walk;
//DeclarePlayers;
//LoginPlayer;

end.


Put DeclarePlayers; and LoginPlayer; right after SetupSRL; for future uses.

U are using few points. Try to make them closer to eachother: like this example .


If that doesn't work. It might be cause your map is too small.
It is best to get 2 MINIMAPS distance from your path, like in the example.(don't mind the text)
As u see my red dots are not near the edge of the map.
SPS does not work well when your path is near the edge of the map.

I hope this'll help.

x44

2013-03-02 00:32:56

i added more points still doesnt work. what do i do know?

is this the reason why people font use fally furnace for scripts?

Sjoe

2013-03-02 00:43:25

From: x44
i added more points still doesnt work. what do i do know?

is this the reason why people font use fally furnace for scripts?


No that was just an example, it's part of the map I used for my ZammyWineRunner.

Cut a custom map using Runescape_surface. which is big enough. Using the conditions I gave u.
and instead of calling
SPS_Setup (RUNESCAPE_SURFACE,['9_7']);

call the custom map by the name u gave him
eg: Fally.png
SPS_Setup (RUNESCAPE_SURFACE,['Fally']);

x44

2013-03-02 01:18:59

so i made my own map. when i try to run it sps tab opens and highlights FoundMatches := SPS_FindMapInMap(P.x, P.y, SPS_AreaMaps, SmallMap, SPS_Tolerance);

x44

2013-03-02 02:24:46

WHOA i think its working now! THank you guys!! my script is finally getting somewhere

Sjoe

2013-03-02 02:46:08

From: x44
WHOA i think its working now! THank you guys!! my script is finally getting somewhere


How did u solve it?

x44

2013-03-02 03:31:16

From: Sjoekeloe
How did u solve it?


I made the custom map you told me about then I realized that error was happening cuz I would leave path creator open -_-

also this walking isn't very accurate. I'm having a hard time getting to walk in front of furnace so I can start next part of script

Sjoe

2013-03-02 03:33:05

From: x44
I made the custom map you told me about then I realized that error was happening cuz I would leave path creator open -_-

also this walking isn't very accurate. I'm having a hard time getting to walk in front of furnace so I can start next part of script


It's more accurate when you're standing still, then use eg : SPS_WalkToPos(Point(123,323));

To get an accurate point is by using:
writeln(SPS_GetMyPos)
By standing on the place u want to be.

If it's still not accurate, try a bigger map.

x44

2013-03-02 04:14:03

From: Sjoekeloe
It's more accurate when you're standing still, then use eg : SPS_WalkToPos(Point(123,323));

To get an accurate point is by using:
writeln(SPS_GetMyPos)
By standing on the place u want to be.

If it's still not accurate, try a bigger map.


yeah im lost :/ not sure how to use those

Sjoe

2013-03-02 04:24:22

From: x44
yeah im lost :/ not sure how to use those


Step 1: Stand next to your furnace. The spot where u want to end.

Step 2: Play the script with SPS_Setup (RUNESCAPE_SURFACE,['Your_map']); and Writeln(SPS_GetMyPos);

Step 3: eg: Debug will write eg: Point(142,80)

Step 4: Walk to that point By using function SPS_WalkToPos(142,80); . Better result when your character is NOT moving

x44

2013-03-02 05:46:45

here is what i have so far after 100's of trial and error runs. what do you think? haha
still seems a bit buggy to me but oh well. next is to actually select the furnace LOL


program Script;
{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

Procedure Walk;
Var
myPath:TPointArray;
begin
SetAngle(SRL_ANGLE_HIGH);
SPS_Setup (RUNESCAPE_SURFACE,['fally1']);
myPath := [Point(514, 511), Point(500, 496), Point(478, 486),
Point(454, 478), Point(436, 473), Point(419, 466),
Point(392, 457), Point(377, 446)];
SPS_WalkPath(myPath);
wait(5000);
//SPS_WalkToPos(Point(351, 443));
SPS_WalkToPos(Point(355, 455));
end;

begin
SetupSRL;
//DeclarePlayers;
//LoginPlayer;
ActivateClient;
ClickNorth(SRL_ANGLE_HIGH);
Walk;
//findfurance;
//walkbacktobank;
//selectlace;
end.