SRL Archive - General Botting Help

SPS help


kingob

2014-05-08 08:27:29

So I use SPS for walking on one of my runecrafting scripts, I have the map in the correct location includes/sps/img/runescape_surface.

I load it correctly Sps.Setup('0_0map', runescape_surface);
I was using the script a couple of weeks ago but havent used it or changed it since then, today I tried to run it and got this error
---- FATAL ERROR: sps.setup(): Unable to load map or bitmap to map failed
Successfully executed.

Have updated my srl and sps, updated simba. I open the script from its file not threw simba's recently used. The map is a .png file which has worked for years.

I really cant figure out why it will not work. Any help is much much appreciated. I am using sps-rs3 by the way.

The procedure which is throwing up the error from sps-rs3 is the following.
(*
Loads and setups the TSPSArea.

Example:
sps.setup('my_map_name', RUNESCAPE_SURFACE, 4, 600.0, 0.40);
*)
procedure TSPSArea.setup(imgName, imgFolder: string; accuracy: integer; tolerance, minMatchPercent: extended);
var
bmp: TMufasaBitmap;
t: integer;
m: extended;
begin
print(self.getName()+'.init()', TDebug.HEADER);

t := getSystemTime();

if (fileExists(SPS_IMG_PATH + imgFolder + imgName + SPS_IMG_FMT)) then
begin
print('Path exists ('+SPS_IMG_PATH + imgFolder + imgName + SPS_IMG_FMT+')');

self._accuracy := accuracy;
self._tolerance := tolerance;
self._minMatchPercent := minMatchPercent;
self.__mapPath := SPS_IMG_PATH + imgFolder + imgName + SPS_IMG_FMT;

if (spsAnyAngle) then
self._minMatchPercent := 0.10;

try
bmp.init(client.getMBitmaps());
bmp.loadFromFile(self.__mapPath);

SPS_BitmapToMap(bmp, self._accuracy, self.__areaMap);
except
print(self.getName()+'.setup(): Unable to load map or bitmap to map failed', TDebug.FATAL);
finally
bmp.free();
end;

self.isSetup := true;
end else
print(self.getName()+'.setup(): Unable to find map, searched path '+ SPS_IMG_PATH + imgFolder + imgName + SPS_IMG_FMT, TDebug.FATAL);

print('Setup area "' + imgName + '" in ' + intToStr(getSystemTime() - t) + 'ms');
print(self.getName()+'.init()', TDebug.FOOTER);
end;

kingob

2014-05-08 08:33:36

program new;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I sps/lib/sps-rs3.simba}
begin
smartPlugins := ['d3d9.dll'];
SetUpSrl();
Sps.Setup('0_0map', runescape_surface, 4, 600.0, 0.40);
end.


Just ran that to make sure it wasnt anything else in the script which was causing problems and got the same error so I am going to do some investigation on the size of the map and location, but it always worked fine in the past!

Olly

2014-05-08 10:53:18

Try force updating your plugins

kingob

2014-05-08 12:50:53

Thanks I completely uninstalled everything to do with Simba and reinstalled simba, srl and sps from scratch which did the trick. Another question if you dont mind. I am using this procedure to click on the altar
procedure CraftRunes(WaitLonger: Boolean); 
var
ColorsFound: TPointArray;
MidPoint: TPoint;
CR1: Integer;
begin
if FindColorsTolerance(ColorsFound, ColorAltar, MainScreen.GetBounds, ColorTolAltar) then
begin
writeLn('==============Found Altar Color Checking if Altar!===============');
MidPoint := MedianTpa(ColorsFound);
Mouse(MidPoint);
if (isMouseOverText(['Craft', '-rune', 'Altar'], 500)) then
begin
Mouse(MidPoint, MOUSE_LEFT);
writeLn('==============It was the Altar! Crafting Runes!===============');
wait(1500 + randomrange(100,150));
end

else end;
end;

I was just wondering if this is safe to use. It clicks on the midpoint of the TPA, I suppose my worry is that that point may be the same everytime? IS that the case or is the TPA midpoint slightly different everytime? Thanks for your help.

The Mayor

2014-05-08 15:54:25

From: kingob
Thanks I completely uninstalled everything to do with Simba and reinstalled simba, srl and sps from scratch which did the trick. Another question if you dont mind. I am using this procedure to click on the altar
procedure CraftRunes(WaitLonger: Boolean); 
var
ColorsFound: TPointArray;
MidPoint: TPoint;
CR1: Integer;
begin
if FindColorsTolerance(ColorsFound, ColorAltar, MainScreen.GetBounds, ColorTolAltar) then
begin
writeLn('==============Found Altar Color Checking if Altar!===============');
MidPoint := MedianTpa(ColorsFound);
Mouse(MidPoint);
if (isMouseOverText(['Craft', '-rune', 'Altar'], 500)) then
begin
Mouse(MidPoint, MOUSE_LEFT);
writeLn('==============It was the Altar! Crafting Runes!===============');
wait(1500 + randomrange(100,150));
end

else end;
end;

I was just wondering if this is safe to use. It clicks on the midpoint of the TPA, I suppose my worry is that that point may be the same everytime? IS that the case or is the TPA midpoint slightly different everytime? Thanks for your help.


I could swear I've seen this snippet of code before :p

kingob

2014-05-08 16:09:52

From: The Mayor
I could swear I've seen this snippet of code before :p



Haha ye for sure I ament even sure which script I took it from, think it was maybe from vwxz's astral crafter. I changed it to use the mouseover text as a fail safe as that wasnt in the procedure originally as far as I can remember. I used parts of peoples scripts when I was learning and I wasnt able to do something myself! Would you be able to answer my question? Also I use SPS to walk, I remember that when walking it used to not wait for the flag to disappear from the minimap before clicking the next point. Is there a way to do that again? I am currently using rs3 sps and just using the sps.walkpath. I have taken the walkpath function from the include and but in my script and am changing it around trying to reduce the wait times between clicking to points. Is there an easier way to do this? Thanks

The Mayor

2014-05-08 17:09:50

From: kingob
Haha ye for sure I ament even sure which script I took it from, think it was maybe from vwxz's astral crafter. I changed it to use the mouseover text as a fail safe as that wasnt in the procedure originally as far as I can remember. I used parts of peoples scripts when I was learning and I wasnt able to do something myself! Would you be able to answer my question? Also I use SPS to walk, I remember that when walking it used to not wait for the flag to disappear from the minimap before clicking the next point. Is there a way to do that again? I am currently using rs3 sps and just using the sps.walkpath. I have taken the walkpath function from the include and but in my script and am changing it around trying to reduce the wait times between clicking to points. Is there an easier way to do this? Thanks


Just follow the SPS guide in my tutorial.

kingob

2014-05-08 18:04:17

I already know how to use sps, I was asking specifically about creating an sps function which does not wait for the minimap flag to disappear before clicking on the next point. I have already managed to create the function in the mean time. No wonder there are no new SRL scripters, I have asked three different questions and havent gotten more than a ten word reply without answering one of my questions.

The Mayor

2014-05-09 02:14:25

From: kingob
I already know how to use sps, I was asking specifically about creating an sps function which does not wait for the minimap flag to disappear before clicking on the next point. I have already managed to create the function in the mean time. No wonder there are no new SRL scripters, I have asked three different questions and havent gotten more than a ten word reply without answering one of my questions.


No need to lash out :) The reason I said that is because sps.walkpath doesn't wait for the flag to disappear, it waits until the flag is within a certain distance from the MM center (which is random each time). If the flag is always disappearing before each click, it might mean simba is taking a while to calculate your position from the SPS map after each click. Could be a massive map or a slow computer. Anyway, I'm glad you came up with a solution.

kingob

2014-05-09 06:06:26

ok thank you

CRASH_OVERRIDE

2014-07-07 07:15:25

@kingob, yeah their is a similar check:

minimap.waitFlag(7);
minimap.waitPlayerMoving();