SRL Archive - OSR Help

Sps


xtubbiex

2012-06-10 15:35:03

I am tryng to mke a seers village magic tree cuttah but if won't walk to trees please help me

program MagicCuttah;

{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

const
RandomBreaks = False; // Make False True if you don't want random minibreaks 40sec
LongBreak = False; //Make True if you want 10-15 mins breaks.
AxeWield = True; //Make True if you're equiping you're hatchet

var
Woodcuttinglevel, Antibans, LogsChopped:Integer;

Procedure WalkToTrees;
Var
myPath : array of TPoint;
Begin
SPS_Setup(RUNESCAPE_SURFACE, ['6_6', '6_7']);
myPath := [Point(339, 276), Point(336, 304), Point(337, 332), Point(327, 364), Point(334, 396), Point(323, 417), Point(326, 435), Point(327, 462), Point(322, 494), Point(342, 67), Point(331, 126), Point(328, 159), Point(320, 191), Point(316, 214), Point(310, 234), Point(298, 251), Point(279, 273), Point(252, 283), Point(242, 257)];
SPS_WalkPath(MyPath);
end;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Pin := ''; // Bank Pin. Leave it if you don't have one.
Players[0].Active := True;
end;


procedure CheckLevels;
begin
GameTab(Tab_Stats);
GetAllLevels;
WoodcuttingLevel := Players[CurrentPlayer].Level[SKILL_WOODCUTTING];
GameTab(Tab_Inv);
end;
procedure Antiban;
begin

Case Random(200) of
0..1: begin HoverSkill('cooking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); WriteLn('Performing Antiban'); Inc(Antibans); end;
2..3: begin HoverSkill('firemaking', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); WriteLn('Performing Antiban'); Inc(Antibans); end;
4: begin HoverSkill('random', False); Wait(300 + Random(500)); MMouse(256, 161, 250, 160); WriteLn('Performing Antiban'); Inc(Antibans); end;
5..7: begin RandomRClick; WriteLn('Performing Antiban'); Inc(Antibans); end;
8..10: begin PickUpMouse; WriteLn('Performing Antiban'); Inc(Antibans); end;
11..13: begin RandomMovement; WriteLn('Performing Antiban'); Inc(Antibans); end;
14..16: begin BoredHuman;WriteLn('Performing Antiban'); Inc(Antibans); end;
17: begin ExamineInv; WriteLn('Performing Antiban'); Inc(Antibans); end;
18..24: begin SleepAndMoveMouse(Random(5000)); WriteLn('Performing Antiban'); Inc(Antibans); end;
25: begin FindNormalRandoms; WriteLn('Performing Antiban'); Inc(Antibans); end;
end;

end;

Procedure TakeBreaks;
begin

WriteLn('Doing small break like 40 sec')
Wait(30000 + Random(20000));

end;

Procedure TakeLongBreaks;
begin

WriteLn('Doing Long break like 15 mins')
ExitToLobby;
Wait(900000 + Random(400000));
LogInPlayer;

end;

Procedure Startup;
begin

if(not LoggedIn)then
begin
repeat
FindNormalRandoms;
LoginPlayerToLob;
until LobbyScreen;

OpenWorldScreen;
if not WorldScreen then
OpenWorldScreen;
if WorldScreen then
begin
writeln('picking world 15 cuz there are low amount of players');
SelectWorld(15);
LogInPlayer;
end;
end;
If LoggedIn then
begin
Antiban;
CheckLevels;
FindNormalRandoms;
WriteLn('Starting up');
MakeCompass('N');
GameTab(Tab_Inv);
SetAngle(SRL_ANGLE_HIGH);
end;
end;
procedure Progress;
var
LogPH, XPPH :Integer;
begin

LogPH := Round((LogsChopped * 3600) / (GetTimeRunning / 1000));
XPPH := Round(((LogsChopped * 250) * 3600) / (GetTimeRunning / 1000));

ClearDebug;
Writeln('***********Mage Tree Cutter**********');
Writeln('* ~By XTubbiex~ ');
Writeln('* XP earned: ' + IntToStr(LogsChopped * 250)+ ' (' + IntToStr(XPPH) + ' P/H)');
Writeln('* Logs Chopped: ' + IntToStr(LogsChopped));
writeln('* Woodcutting Level: '+ IntToStr(WoodcuttingLevel));
Writeln('* AntiBan Preformed: ' + IntToStr(Antibans));
Writeln('* Total Time: ' + TimeRunning);
Writeln('*************************************');

end;
Procedure Bank;
var
AxeWielded:Boolean;
begin
repeat
if OpenBankNpc then
begin
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
Wait(randomrange(500,700));
end;
Until BankScreen;

If Bankscreen then
begin
MouseItem(1,mouse_Right);
WaitOption('27', 500);
CloseBank;
end;
End;

Procedure Mainloop;
var
x, y:Integer;
MyPath, MyPath2:TpointArray;
Begin

x := MSCX;
y := MSCY;
If LoggedIn then
if (InvCount > 1) then

begin
Bank;
SPS_Setup(RUNESCAPE_SURFACE, ['6_6', '6_7']);
myPath2 := [Point(339, 276), Point(336, 304), Point(337, 332), Point(327, 364), Point(334, 396), Point(323, 417), Point(326, 435), Point(327, 462), Point(322, 494), Point(342, 67), Point(331, 126), Point(328, 159), Point(320, 191), Point(316, 214), Point(310, 234), Point(298, 251), Point(279, 273), Point(252, 283), Point(242, 257)];
SPS_WalkPath(MyPath2);
WriteLn('Walking to tha treez');
end;

If (InvCount = 1) then
begin
SPS_Setup(RUNESCAPE_SURFACE, ['6_6', '6_7']);
myPath := [Point(339, 276), Point(336, 304), Point(337, 332), Point(327, 364), Point(334, 396), Point(323, 417), Point(326, 435), Point(327, 462), Point(322, 494), Point(342, 67), Point(331, 126), Point(328, 159), Point(320, 191), Point(316, 214), Point(310, 234), Point(298, 251), Point(279, 273), Point(252, 283), Point(242, 257)];
SPS_WalkPath(MyPath);
WriteLn('Walking to tha treez');
end;
end;

begin
ClearDebug;
DeclarePlayers;
Smart_Server := 16;
Smart_Members := False;
Smart_Signed := False;
Smart_SuperDetail := False;
SetUpSRL;
if (RandomBreaks) then
TakeBreaks;
Startup;
If LoggedIn then
repeat
MainLoop;
Antiban;
FindNormalRandoms;
until(AllPlayersInactive);
end.

weeps

2012-06-10 15:38:17

Does the script compile?

Also if you used the path creator I think you need to load the runescape_surface picture (if you didn't).

CephaXz

2012-06-10 15:40:53

Umm… Idk why but I saw this

Writeln('***********Mage Tree Cutter**********');
Writeln('* ~By Remco1337~ ');

Don't think you're trying to make it though.

weeps

2012-06-10 15:43:50

From: CephaXz
Umm… Idk why but I saw this

Writeln('***********Mage Tree Cutter**********');
Writeln('* ~By Remco1337~ ');

Don't think you're trying to make it though.


I mean when you load the path creator (if you did), did you pick 6.7 pictures or the runescape surface?

CephaXz

2012-06-10 15:47:54

From: weeps
I mean when you load the path creator (if you did), did you pick 6.7 pictures or the runescape surface?


Did you just thought I'm the OP? :p

And yeah as what you said, the paths aren't made with the runescape_surface map. It should be at least 4 digits coords.

xtubbiex

2012-06-10 15:48:03

Runescape surface 6_7 and 6_6

weeps

2012-06-10 15:51:15

From: CephaXz
Did you just thought I'm the OP? :p

And yeah as what you said, the paths aren't made with the runescape_surface map. It should be at least 4 digits coords.


Lol fail, i though you were the creator of this thread =P.


From: xtubbiex
Runescape surface 6_7 and 6_6


Try to do the cordinates with Runescape_surface, the last pic. So i should be something like this:

SPS_Setup(RUNESCAPE_SURFACE, []);

I think it should solve the problem, not 100 %.

xtubbiex

2012-06-10 15:53:55

Lol i got that already?

CephaXz

2012-06-10 15:56:05

He just simply means, when you're creating paths using path generator, don't open the image of 6_7, 6_6 to make your paths. Open up runescape_surface.png image, which is the last image file in the folder.

And it should be something like:
myPath := [Point(2741, 2698), Point(2728, 2724), Point(2717, 2749), Point(2721, 2789), Point(2677, 2803)];

Just simply clicked some points at seers.

xtubbiex

2012-06-10 16:01:22

Aight trying now !

xtubbiex

2012-06-10 16:02:42

Mmmh still not walking :S

EDIT: Banking and standing still but now i have to sleep hopefully i recieve in the morning important news

SPS_GetArea ERROR: Exception: Error while reading stream: Out of memory
Error: Exception: Access violation at line 305
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, 3]

SPS_Setup(RUNESCAPE_SURFACE, ['runescape_surface']);

CephaXz

2012-06-10 16:04:24

Actually, just copy the paths I made above and replace it with the one you had now. Don't touch anything else. Start and bank and see if it walks.

Google

2012-06-10 16:15:01

Last I remember the sps_surface map was outdated for this area, you will have to make your own custom minimap map or use a different walking method if you cant get it to work.

CephaXz

2012-06-10 16:33:47

Well, couldn't believe that its not working so I tried it myself :p. Its your mainloop that screwed your script. The paths I made above works well, but it walks to yews, idk where are magics.

Your mainloop starts with banking if your inventory has more than one item. You choose to right click the first item in your inventory slot and choose the option that I believe is deposit 27, so I assume your axe is at last inv? I mod your main loop a bit, it should work better IMO. And there's still no chop function in your main loop yet.



Procedure Mainloop;
var
x, y:Integer; //didnt use
MyPath, MyPath2:TpointArray;
Begin

x := MSCX; //didnt use
y := MSCY; //didnt use
if (InvCount > 1) then
begin
Bank;
end else
begin
SPS_Setup(RUNESCAPE_SURFACE, ['6_6', '6_7']);
myPath := [Point(2741, 2698), Point(2728, 2724), Point(2717, 2749), Point(2721, 2789), Point(2677, 2803)];
//Obviously you need to change this, to walk to magic trees
SPS_WalkPath(MyPath);
WriteLn('Walking to tha treez');
end;
end;

Mat

2012-06-10 18:01:34

CephaXz is right, you have to call in the individual. Map Number '6_6' etc, but the Path has to have been made on the RS Map, if you called in the whole RS Map it'll be extremely Slow, to walk etc.
Mat

P1ng

2012-06-11 00:52:38

I'm sorry, but this is exactly the script I was PMed by remco1337 to help with just before that account was banned. With exactly this question.

CephaXz

2012-06-11 00:56:10

Tell Nava the Thor, he's got the hammer.

xtubbiex

2012-06-11 01:24:54

It´s isnt walking still.

Getdropped

2012-06-11 08:14:18

If you still can't get it working i suggest using DTM walking method…. because if the map is out dated sps will not work. DTM is the best way to go in this case. however it might not be out of date because your script does not seem right because the numbers should be bigger than 339 for seers village…. you might just want to do a getmyspspos somewhere in your code so you can find out your actual position on the map….