Log in

View Full Version : SPS being weird



Footy
08-07-2012, 06:58 PM
Im trying to get my script to walk from the tanner to the bank in al-kharid, but there are a few issues
1: When the script goes to click the second point, it clicks horribly off since my person is running
2: Script sometimes skips points and just stops walking in the middle of my path
3: Since script missclicks, it clicks behind the bankers, and gets stuck since the flag never leaves

http://i0.simplest-image-hosting.net/picture/untitled195.png#REMEMBER-TO-LINK-SIMPLEST-IMAGE-HOSTING.NET-WHEN-HOTLINKING

Any way to fix any of these errors? Heres the script so far, its unfinished, all it does so far is walk from the tanner to the bank, then open the bank.

program SPSS;
{$i srl/srl.simba}
{$i sps/sps.simba}
var
MyPath:TPointarray;
Counter, X, Y, Bankfails:Integer;


procedure getmyposition;
var
P: TPoint;
begin
P := SPS_GetMyPos;
writeln('Point'+ToStr(P));
end;

Function CustomBank:boolean;
begin
if Bankfails > 2 then
begin
writeln('We cant find the bank! Logging off!');
Logout;
Terminatescript;
end;
if findcolorspiraltolerance(x, y, 10801140, 148, 140, 190, 244, 10) then
begin
Mouse(x, y, 5, 5, mouse_right);
waitoption('Bank Bank', 1000);
Marktime(Counter);
repeat
wait(randomrange(100, 200));
if timefrommark(counter) > 10000 then
begin
writeln('We cant find the bank, Likely missclicked! We will try again.)');
inc(BankFails);
Result := False;
exit;
end;
until(Bankscreen);
Writeln('Bank sucessfully found!');
end else
begin
Writeln('We couldnt find the Bank! Color not found! We will try again!');
inc(bankfails);
Result := False;
Exit;
end;
Result := True;
Bankfails := 0

end;

Procedure Setupstuff;
begin
SetupSRL;
Activateclient;
wait(randomrange(100, 200));
SPS_Setup(RUNESCAPE_SURFACE,['12_10','12_9']);
myPath := [(Point(4943, 3947)), (Point(4935, 3983)), (Point(4923, 3971)), (Point(4911, 3991))];
end;

Procedure WalkingToBank;
begin
SPS_WalkPath(Mypath);
flagex(5, false);
wait(randomrange(50, 250));
end;

begin
Setupstuff;
WalkingToBank;
repeat
CustomBank;
until(BankScreen);
//getmyposition;
end.

CephaXz
08-07-2012, 07:05 PM
If you wait for a while, it will eventually end the walkpath procedure. Or don't make your point to bank so close to the banker. But I would edit the sps_walkpath if I were you so I could use FFlag.

Footy
08-07-2012, 07:09 PM
SPS_walkpath appears to use FFlag, ill try using flagex or just moving my points around... Blindwalk also looks like an interesting way to do it.
SPS_WalkPath
// Walks the path "Path"; always walks to the furthest point possible
function SPS_WalkPath(Path: TPointArray): boolean;
var
I, H, T, D: integer;
P, MM: TPoint;
begin
H := High(Path);
T := GetSystemTime + 20000 + Random(5000);

while (not Result) and (GetSystemTime < T) do
begin
RunEnergy(20);

P := SPS_GetMyPos;
for I := H downto 0 do
begin
MM.X := MMCX + Path[I].X - P.X;
MM.Y := MMCY + Path[I].Y - P.Y;

D := Distance(MM.X, MM.Y, MMCX, MMCY);

if (D < 10) then
break
else
if (D < 70) then
begin
if (SPS_MultiMouse) then
MultiMouse(MM.X, MM.Y, 25, 3, false)
else
Mouse(MM.X, MM.Y, 5, 5, mouse_Left);

FFlag(Integer(I <> H) * 15);

T := getSystemTime + 20000 + Random(1000);
Break;
end;
end;

Result := (I = H);
end;
end;

Nebula
08-07-2012, 07:17 PM
Here's your solution: http://villavu.com/forum/showthread.php?t=78905

Footy
08-07-2012, 07:18 PM
Tried using those once, didnt work so well, I think I found a solution using SPS, if it doesent work, ill try ODTM's again.

BigFate
08-07-2012, 07:33 PM
If your going to apply for members with this it might be worth using some techniques like ddtms or radialwalk with autocolor functions. SPS is known to be a bit buggy at Al kharid and the wildy. GOODLUCK!

CephaXz
08-07-2012, 07:44 PM
Editing the SPS_walkpath works for me. I did it in my astral script since it always clicks behind the bankers.

Footy
08-07-2012, 07:46 PM
If your going to apply for members with this it might be worth using some techniques like ddtms or radialwalk with autocolor functions. SPS is known to be a bit buggy at Al kharid and the wildy. GOODLUCK!

Thats a good point. I was thinking of applying with this or another script i was planning, ODTM will work for now, works very well! :D

Element17
08-08-2012, 02:02 AM
Best bet is to make a custom map for it as well.

John
08-08-2012, 04:13 AM
Best bet is to make a custom map for it as well.
Agreed, Use A custom SPS Map, They Work Wonders.