SRL Archive - General Botting Help

SPS not working cus to many items/NPC's/... ?


lanadekat

2014-12-16 16:20:45

SPS isn't working good, but when I take a look at the sps debug it seems to find the player but when NPC's move it messses up I think.
Any way to fix this/ anything other than SPS that's relative simple and higly accurate?

my map: ( Walking from lodestone to altar )

red: place where it clicks sometimes
green: place where player is when it clicks there ( the red area )
yellow: area that I couldn't do perfectly since map seems to change just a little bit depending on where you stand.

Lipcot

2014-12-16 16:22:22

From: lanadekat
SPS isn't working good, but when I take a look at the sps debug it seems to find the player but when NPC's move it messses up I think.
Any way to fix this/ anything other than SPS that's relative simple and higly accurate?

my map: ( Walking from lodestone to altar )


have you tried making the map bigger? that has always solved my problems.. or maybe tempering with the accuracy and tolerance?

make sure to have spsanyangle false.

lanadekat

2014-12-16 16:40:51

From: undorak7
have you tried making the map bigger? that has always solved my problems.. or maybe tempering with the accuracy and tolerance?

make sure to have spsanyangle false.


I don't think it has to do with size since most problems are in the middle of the map.
I added a picture with the marked problem spots.
do you have a link for some info about accuracy and tolerance?

cosmasjdz

2014-12-16 16:49:48

usually at difficult areas making map i try to filter out shop signs, red, yellow dots aswell. Also If it doesnt help them setting like sps.setup('wild',runescape_other,3,150,0.45); Seems always to work. if you remove less dots then need increase last digit to like 0,65 from 0,45 for example in the area where walking from altar to rune rocks it works. But takes so much time. You can always use blindwalking or dtms walkings aswell.

Lipcot

2014-12-16 17:53:46

From: lanadekat
I don't think it has to do with size since most problems are in the middle of the map.
I added a picture with the marked problem spots.
do you have a link for some info about accuracy and tolerance?


(*
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;


if you increase the accuracy number, it will scan faster, if you decrease it, it will take more time.

and tolerance, well, is tolerance.

min match percent, is the minimum percentage you want it to match.. if you are getting trouble at locating your player, then decrease min match percent, if you are getting trouble with accuracy, increase it.

The Mayor

2014-12-16 17:54:49

Post your script and I will fix it :whistling:

lanadekat

2014-12-17 08:06:57

From: The Mayor
Post your script and I will fix it :whistling:

Quite funny how I don't like sharing my scrips but end up posting it xD I don't mean I'm against helping the community but I would like to keep my goldfarming scripts private.
Walking to the bank works fine so you won't have to change that :)
It would be nice if you could add some information with the things you change/add so I don't have to ask this again next time.

program Nats;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}

const

MY_LOGINNAME = '';
MY_PASSWORD = '';
WORLD = 1;


var

PBANK := [Point(188, 125), Point(194, 143), Point(206, 165), Point(201, 178), Point(195, 200), Point(195, 218), Point(182, 230), Point(164, 228)];
PALTAR := [Point(137, 107), Point(148, 118), Point(163, 134), Point(177, 148), Point(195, 174), Point(212, 192), Point(225, 207), Point(248, 227), Point(263, 244), Point(280, 260), Point(283, 274), Point(284, 295), Point(284, 321), Point(292, 338), Point(311, 358), Point(333, 382), Point(354, 401), Point(366, 412), Point(382, 424), Point(396, 438), Point(411, 454), Point(427, 468), Point(439, 482)];
NATMAP, BANKMAP: TSPSArea;

procedure declarePlayers;
begin
WriteLn('Declaring players');
setLength(players, 1);
with players[0] do
begin
loginName := MY_LOGINNAME;
password := MY_PASSWORD;
bankPin := '';
world := WORLD;
isActive := true;
isMember := true;
end
currentPlayer := 0;
end;

procedure logUsIn;
begin
WriteLn('Logging in');
if not isLoggedIn then
begin
players[currentPlayer].login();
exitTreasure();
minimap.clickCompass();
mainscreen.setangle(MS_ANGLE_HIGH);
mainscreen.setZoom(true);
TabBackpack.open();
exitTreasure();
end;
end;

procedure TeleAltar;
begin
lodestoneScreen.teleportTo(LOCATION_KARAMJA);
wait(12000);
wait(randomRange(250, 1000));
if lodestonescreen.isopen() then TeleAltar();
end;

procedure TeleBank;
begin
lodestoneScreen.teleportTo(LOCATION_TAVERLEY);
wait(randomRange(250, 1000));
wait(12000);
if lodestonescreen.isopen() then TeleBank();
end;

procedure WalkAltar;
begin
WriteLn('walking to the nature altar');
NATMAP.debugPlayerPos();
if NATMAP.walkPath(PALTAR) then
minimap.waitPlayerMoving()
else TeleAltar;
end;

procedure WalkBank;
begin
WriteLn('walking to the nature altar');
if BANKMAP.walkPath(PBANK) then
minimap.waitPlayerMoving()
end;

procedure Bank();
var
I := Random(600);
begin
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
bankScreen.withdraw(1, WITHDRAW_AMOUNT_ALL, ['ure']);
bankScreen.close;
tabBackpack.waitWhileLocked;
end;

procedure OpenBank;
begin
bankScreen.open(BANK_NPC_BLUE);
wait(randomRange(500, 1000));
if bankScreen.isOpen then
Bank()
else
WriteLn('bank not opened')
end;

procedure EnterAltar;
var
x, y: integer;
begin
if mainscreen.findObject(x, y, 5109159, 19, ['nter'], MOUSE_LEFT) then
wait(randomRange(4500, 5500))
else
WriteLn('Didn"t enter the altar')
end;

procedure MakeRunes;
var
x, y: integer;
begin
wait(1500);
if mainscreen.findObject(x, y, 5261389, 2, ['raft'], MOUSE_LEFT) then
wait(randomRange(5000, 7500));
end;

begin
addOnTerminate('scriptTerminate');
ClearDebug();
smartPlugins := ['d3d9.dll'];
smartEnableDrawing := true;
SetupSRL();
NATMAP.Setup('Natmap', 'Runescape_Surface\');
BANKMAP.setup('Bankmap', 'Runescape_Surface\');
NATMAP.debugPlayerPos();
repeat
if (not isLoggedIn()) then
begin
declarePlayers;
logUsIn;
end
TeleAltar;
WalkAltar;
EnterAltar;
MakeRunes;
TeleBank;
WalkBank;
OpenBank;
Bank;
Until(false);
End;

here are 2 maps I made the first one seems to work better ( it's also the one with the points setup right in the script above )
http://imgur.com/hsTPVhU,iZLwLXc#0

lanadekat

2014-12-18 09:22:30

From: undorak7
(*
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;


if you increase the accuracy number, it will scan faster, if you decrease it, it will take more time.

and tolerance, well, is tolerance.

min match percent, is the minimum percentage you want it to match.. if you are getting trouble at locating your player, then decrease min match percent, if you are getting trouble with accuracy, increase it.


How do I use it ?
nmv: I got it working :) only a couple test runs now.

Brandon

2014-12-18 13:12:19

@lanadekat; Remove your email and password from your script.. before posting it..

lanadekat

2014-12-18 15:15:04

From: Brandon
@lanadekat; Remove your email and password from your script.. before posting it..


I'll do my best to remember it next time. Thank you for removing it!

KeepBotting

2014-12-18 17:20:20

From: lanadekat
I'll do my best to remember it next time. Thank you for removing it!


Use Rafiki and you'll never put your user/pass in the script again :)

OT: play around with your TSPSAreas, set tolerance/accuracy/minmatch when you .setup() them

Turpinator

2014-12-18 20:10:35

Umm… Shouldnt the background of the SPS map be black?

I guess it wont really matter, but meh.

WOAH WOAH WOAH. hold on.
can you post the /actual/ sps map? becuase if thats your sps map, its no good.

lanadekat

2014-12-19 01:37:48

From: KeepBotting
Use Rafiki and you'll never put your user/pass in the script again :)

OT: play around with your TSPSAreas, set tolerance/accuracy/minmatch when you .setup() them


From: Turpinator
Umm… Shouldnt the background of the SPS map be black?

I guess it wont really matter, but meh.

WOAH WOAH WOAH. hold on.
can you post the /actual/ sps map? becuase if thats your sps map, its no good.


I got it working already by playing around with tolerance and accuracy :)
@Turpinator I always used transparent backgrounds never had any problems with them.

Turpinator

2014-12-19 12:18:09

From: lanadekat
I got it working already by playing around with tolerance and accuracy :)
@Turpinator I always used transparent backgrounds never had any problems with them.


Annyway, but is that your actual map? because it is not the correct size.

lanadekat

2014-12-19 16:47:31

From: Turpinator
Annyway, but is that your actual map? because it is not the correct size.


How you mean ? the borders around the map?

[ATTACH=CONFIG]24630[/ATTACH]

Turpinator

2014-12-21 03:34:20

From: lanadekat
How you mean ? the borders around the map?

[ATTACH=CONFIG]24630[/ATTACH]


i mean it is literally not the correct size.

the correct size of the minimap on the left, and your WRONG size on the right.

Lipcot

2014-12-21 14:18:08

From: Turpinator
i mean it is literally not the correct size.

the correct size of the minimap on the left, and your WRONG size on the right.


yeah he must've messed up with photoshop or paint and zoomed away.