SRL Archive - RS3 Outdated / Broken Scripts

Gucci's Cow Killer + Looter


Gucci

2012-03-24 12:16:09

Gucci's Tavereley Cow Killer + Looter

This is the first release from my Burthorpe/ Tavereley series of scripts.

Features:

- Accurate Cow Killing.
- Decent Looting.
- AntiBan.
- Report.


Instructions:

1. Update SPS maps from here: http://www.mediafire.com/?uwf6afblczrkpk6
2. Replace the current SPS with the downloaded one. Should be in Simba>Includes>SPS>img.
3. Be at the new Taverely Bank with inventory empty.
4. Hit Run.


Change Log

Version 1

- Initial Release

Version 2

- Added Breaking.
- Added World Switching.
- Fixed Banking Issues.


To Come:

Nothing ATM

:spot: Enjoy the script, post bugs and progress reports :spot:

Gucci

2012-03-24 12:17:13

Reserved for reports

FifthDimension

2012-03-24 12:17:40

Nice release!

Striken

2012-03-24 14:42:40

Good job! Making this script will lower cowhide prices + leather prices = easier crafting :stirthepot:

begginer

2012-03-24 15:14:13

Well done sir. Gratz on script

Silentcore

2012-03-24 15:58:07

It Was A Pleasure Being A Tester.

Forgot to Save Proggies but Runs Good And Its All GOOOOOOD! Good Job.

Coming Home

2012-03-24 20:29:35

Wow nice. And thanks for the new SRL appreciated. Also what does it loot?

Coming Home

2012-03-24 20:34:27

Nevermind:p

Gucci

2012-03-24 21:31:19

From: FifthDimension
Nice release!


Thanks man.

From: Phyaskou
Good job! Making this script will lower cowhide prices + leather prices = easier crafting :stirthepot:


Lol would be useful get my crafting up

From: begginer
Well done sir. Gratz on script


Thanks!


From: Ucantseemebot
It Was A Pleasure Being A Tester.

Forgot to Save Proggies but Runs Good And Its All GOOOOOOD! Good Job.


Yeah thanks for testing also get me proggy's :p

Coming Home

2012-03-24 22:34:32

Im now downloading all of your scripts:) I love your antiban system will post a proggy later.

Gucci

2012-03-24 22:56:25

From: Coming Home
Im now downloading all of your scripts:) I love your antiban system will post a proggy later.


Thanks :D Yeah I could use a proggy, although I haven't tested those they should work fine

Striken

2012-03-24 23:10:21

It will also bring the prices back to when it was in the good old days :p

Gucci

2012-03-24 23:12:29

From: Phyaskou
It will also bring the prices back to when it was in the good old days :p


Come on can't be that bad…………:redface:

Striken

2012-03-24 23:14:18

From: Gucci
Come on can't be that bad…………:redface:


Used to be 200gp for Cowhide.

Gucci

2012-03-24 23:20:53

From: Phyaskou
Used to be 200gp for Cowhide.


Well that's decent still :D

pigggy

2012-03-25 21:48:43

how much money per hour is this?

Gucci

2012-03-25 22:04:14

From: pigggy
how much money per hour is this?


Depends on your combat level cow hide is 430gp and if I was too do this with my main I would make a lot of money an hour

Mauradon

2012-03-26 03:10:14

Any chance you could make a F2P cow killer? (The ones near the mill where the guy banks your stuff for you and keeps 1 cowhide every 10..?)

Kyle Undefined

2012-03-26 10:03:56

Nice, you beat me to it :p still might make mine :stirthepot:

Gucci

2012-03-26 11:47:40

From: Kyle Undefined
Nice, you beat me to it :p still might make mine :stirthepot:


Hope you do it will be way better than mine

hoopla

2012-03-27 09:20:23

Interesting how it said the files to be overwritten were newer?

Works great! Thank you. May I suggest having the character 'rest' until healed else? I can throw it in there if you'd like.

Gucci

2012-03-27 10:57:34

From: hoopla
Interesting how it said the files to be overwritten were newer?

Works great! Thank you. May I suggest having the character 'rest' until healed else? I can throw it in there if you'd like.


I'll add it in for the next update

hoopla

2012-03-27 13:09:37

I think world switch should be implemented in x to give it more anti-ban, where x switches every 10-30 mins to keep folks from staying in the spot too long….more human like rotation of camera (it rotates 180 degrees perfectly in 50/50 rotations). Sometimes whilst fighting it'll click skills and get locked in the guides menu. If possible, randomization of your start point for attacking. Has a habit of not wanting to fight after flawlessly navigating to and from the bank (On a side note, I've noticed if I just restart the script it'll get back at it like it's supposed to).

Appreciate your efforts and looking forward to the next update. Also, I've been tweaking your parameters a bit, looking to expand the search box (I believe searching on the sides of the fence would be more accurate, or possibly just expanding your pixel range) and I believe I've gotten it to my personal liking…Thanks again, works very nicely for the ranged newb ;).

Still, a very, very excellent job!!

hoopla

2012-03-28 00:35:22

Duplicate post.

hoopla

2012-03-28 00:41:30

Here is my take on your script, I hope you don't mind my interpretation and if you do, I'll remove it. I'm still trying to iron out the bug on why it fails to fight after making a successful run to the cows and banking. Thanks for teaching me something!

picks up charms, arrows and hides, drops/avoids bones. This is a very much alpha but works and is itw.

Setup for pure def ranger, search is expanded a bit.

expanded antiban/checks player guide and fixed the constant 50/50 rotation of camera - it works much better now and doesn't rotate so often to look more realistic.

Progress report is now auto-updated (just for time working), working on getting a constant count of items through DTMs

Needs to be fixed:

Route needs to be randomized, defaults to center and clicks samespot too often.
Needs ColorSpiralTolerance added for fletching of arrow, meat, black part of charm ( I believe it has hide)
Needs a more routine check of dropped items.
Completes one good run and then on the way back, navigates successfully and then goes back to bank for some reason. I've been trying to hunt this one down.
Progress report needs to be updated with a count more often since it's now auto-updated. Working on this, too.


program BurthorpeCowKiller;
{$DEFINE SMART}
{$DEFINE PAINT}
{$i SRL\SRL.simba}
{$i SRL\SRL\Misc\PaintSmart.simba}
{$i sps\sps.simba}

// By GUCCI
// Coooooochie

{ Instructions:
1. Make sure your SPS maps have been updated.
2. Start at new Taverly Bank with inventory empty.
3. Hit Run. }

const
SRLStats_User = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True;
NumbOfPlayers = 1;
StartPlayer = 0;

var
x, y, CowKilled, Hide, HidesCollected:integer;
ToCows, ToBank: TPointArray;
Drops: TStringArray;

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['XP'];

With Players[0] do
begin
Name := ''; //Username.
Pass := ''; //Password.
Active := True;
end;

end;

function InFight: Boolean;
begin
Result := srl_InFight;
end;

Function OthersInFight: Boolean;
var
x, y, i: integer;
Colors: TIntegerArray;
begin
Colors := [HP_BAR_COLOR1, HP_BAR_COLOR2];
for i := 0 to High(Colors) do
if FindColorTolerance(x, y, Colors[i], MSX1, MSY1, MFBox.X1, MSY2, 0) or
FindColorTolerance(x, y, Colors[i], MSX1, MSY1, MSX2, MFBox.Y1, 0) or
FindColorTolerance(x, y, Colors[i], MFBox.X2, MSY1, MSX2, MSY2, 0) or
FindColorTolerance(x, y, Colors[i], MSX1, MFBox.Y2, MSX2, MSY2, 0) then
begin
Result := True;
Exit;
end;
end;

function IsFightAt(var X, Y: Integer): Boolean;
var
B: TBox;
H, I: integer;
ATPA: T2DPointArray;
Colors: TIntegerArray;
begin
Colors := [HP_BAR_COLOR1, HP_BAR_COLOR2];
H := High(Colors);
SetArrayLength(ATPA, H+1);
B := IntToBox(x-20, y-40, x+20, y+10);
for i := 0 to H do
with B do
FindColorsSpiralTolerance(x, y, ATPA[i], Colors[i], Max(X1, MSX1), Max(Y1, MSY1), X2, Y2, 0);
Result := Length(MergeATPA(ATPA)) > 0;
end;

procedure CowCounting;
begin
IncEx(CowKilled, 28);
IncEx(HidesCollected, 28);
end;

procedure Report;

begin


begin

Writeln('############### Cow Pwner #############');
Writeln('|= Player : ' + Players[CurrentPlayer].Name);
Writeln('|= Time Running : ' + TimeRunning);
Writeln('|= Cows Killed : ' + IntToStr(CowKilled));
Writeln('|= Hides Gotten : ' + IntToStr(HidesCollected));
Writeln('########################################');
end;
end;

{function FindCow(x, y: Integer): Boolean;
var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09, 0.62);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 12305611, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 5, 5);
If(IsUpTextMultiCustom(['ttack, ow, k C'])) then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
end;}

procedure KillCows;
var
Xi, Yi, x: Integer;
begin
SetAngle(SRL_ANGLE_LOW);
Wait(RandomRange(1575, 5686));
if InFight then
begin
repeat
FindNormalRandoms;
until (not (OthersInFight) or (not LoggedIn) or (not InFight))
end;
x := Random(8)

if FindObj(x, y, 'ow', 11974591, 5) then
begin
if not (IsFightAt(Xi, Yi) and not InFight) then
begin
GetMousePos(Xi, Yi);
Mouse(Xi, Yi, 8, 8, True);
end;
while IsMoving do
begin
Wait(225);
end;
end
else
begin
wait(800)
end;
end;

procedure FailSafe (Reason:String);
begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
TerminateScript;
end;

procedure DropVars;
begin
Drops :=['one']

end;

function LootColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04, 0.39);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 9676521, MSX1, MSY1, MSX2, MSY2, 23);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 29.16) and (X <= 88.45) and (Y >= 19.99) and (Y <= 91.36) and (Z >= 6.86) and (Z <= 96.19) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

procedure WalkToCows;
begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE, ['8_7', '8_6']);
ToCows := [Point(3340, 2981), Point(3362, 2980), Point(3367, 2943),
Point(3374, 2920), Point(3364, 2894), Point(3363, 2872), Point(3374, 2854),
Point(3390, 2836), Point(3406, 2804), Point(3409, 2785), Point(3409, 2756),
Point(3406, 2723), Point(3380, 2699)];
SPS_WalkPath(ToCows);
end;

procedure WalkToBank;
begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE, ['8_6', '8_7']);
ToBank := [Point(3377, 2702), Point(3400, 2738), Point(3410, 2757),
Point(3413, 2785), Point(3408, 2815), Point(3393, 2838), Point(3359, 2863),
Point(3365, 2886), Point(3375, 2918), Point(3373, 2948), Point(3368, 2967),
Point(3357, 2981), Point(3342, 2983)];
SPS_WalkPath(ToBank);
end;

procedure Banking;
begin
if SPS_WalkPath(ToBank) then

begin
MakeCompass('E');
SetAngle(SRL_ANGLE_LOW);

OpenBankFast('tavb');

if BankScreen then
DepositAll;
end;
end;

function FindLoot(Var X,Y: Integer): Boolean;
var
CTS: Integer;
TPA: TPointArray;
begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.04, 0.39);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, LootColor, MSX1, MSY1, MSX2, MSY2, 23);
ColorToleranceSpeed(CTS);


if (Length(TPA) < 1) then
Exit;

MMouse(TPA[0].X, TPA[0].Y, 5, 5);

if WaitUpText('ake', 250) then
begin
GetMousePos(X, Y);
Mouse(x, y, 0, 0, False);
ChooseOptionMulti(Drops);
Result := True;
Inc(Hide);
Exit;
end;

end;

function PickupLoot:Boolean;
var
x, y: Integer;
begin
FindNormalRandoms;
If FindLoot(x, y) Then
begin
While IsMoving do
Wait(25);
FindNormalRandoms;
Wait(RandomRange(300,470));
Mouse(x, y, 0, 0, False);
ChooseOption('ide');
Result := True;
ChooseOption('row');
Result := True;
ChooseOption('arm');
Result := True;
end;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
exit;
FindNormalRandoms;
case Random(2) of
0:
begin
WriteLn('Skill Check');
RandomRClick;
HoverSkill('random', False);
Wait(900 + Random(500));
end;
end;
end;

procedure FailSafe2 (Reason:String);
var
Z:TPoint;
begin
Z:= SPS_GetMyPos;
if (Not (Distance(Z.X, Z.Y, 3377, 2700) < 35)) then//Change the 25 to whatever you want your distance checking to be.
Begin
BoredHuman;
RandomRClick;
SPS_WalkToPos(Point(3377, 2700));
end;
end;

begin
Smart_Signed := True;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
Smart_Server := 104;
ActivateClient;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
Wait(4000+random(400));
Repeat
WalkToCows;
KillCows;
PickupLoot;
AntiBan;
if InvFull then
WalkToBank;
Banking;
Report;
Until(False)
end.

Gucci

2012-03-28 00:43:18

I don't mind and put it in Simba tags so your pretty much not taking up the entire thread

hoopla

2012-03-28 00:55:23

Sorry about that, let me know what you think, if there's anything you can incorporate, please don't hesitate!

The only flaw I've noticed is the 2nd trip, the character arrives and sometimes even attacks but then loops back to bank. I'll try to kink this out if I can.

Gucci

2012-03-28 01:22:44

That happens if auto color fails

hoopla

2012-03-28 09:31:52

From: Gucci
That happens if auto color fails


Right. Well, I'll continue to try and iron out why it's not working the 2nd go around.

Thanks again.

hoopla

2012-03-28 10:18:55

Leechers are really fucking abusing your script!!! To date, seen over 3-4 folks using your script in the same world, twice. I'm still working on adding a world switch for my own ass and if I get it, I'll post…gotta few kinks right now but this is going to be the banzor hammer soon, just sayin'.

Sin

2012-03-28 10:27:57


procedure FailSafe2 (Reason:String);
var
Z:TPoint;
begin
Z:= SPS_GetMyPos;
if (Not (Distance(Z.X, Z.Y, 3377, 2700) < 10)) then//Change the 25 to whatever you want your distance checking to be.
Begin
BoredHuman;
SPS_WalkToPos(Point(3377, 2700));
end;
end;
Why do you call Reason?


procedure AntiBan;
begin
if(not(LoggedIn))then
exit;
FindNormalRandoms;
case Random(2) of
0:
begin
WriteLn('Skill Check');
HoverSkill('Random', False);
Wait(1000 + Random(200));
end;
end;
end;
Standards :s


function PickupLoot:Boolean;
var
x, y: Integer;
begin
FindNormalRandoms;
If FindLoot(x, y) Then
begin
While IsMoving do
Wait(25);
FindNormalRandoms;
Wait(RandomRange(300,400));
Mouse(x, y, 0, 0, False);
ChooseOption('ide');
Result := True;
end;
end;
should actually be


function PickupLoot:Boolean;
var
x, y: Integer;
begin
Result := False;
if FindNormalRandoms then
if not LoggedIn then
terminatescript;
If FindLoot(x, y) Then
begin
While IsMoving do
Wait(25);

if FindNormalRandoms then
if not LoggedIn then
terminatescript;

Wait(RandomRange(300,400));
Mouse(x, y, 0, 0, False);
WaitOpTion('ide',750);
Result := True;
end;
end;
Always set the result false in the beginning of calling the function.

Your main loop -

begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
Smart_Server := 24;
ActivateClient;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
Wait(4000+random(400));
Repeat
WalkToCows;
KillCows;
PickupLoot;
AntiBan;
if InvFull then
WalkToBank;
Banking;
Report;
Until(False)
end.

is flawed, it should be

begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
Smart_Server := 24;
ActivateClient;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
Wait(4000+random(400));
Repeat
WalkToCows;
KillCows;
PickupLoot;
AntiBan;
if InvFull then
begin
WalkToBank;
Banking;
end;
Report;
Until(False)
end.
Otherwise it's just going to continue banking every main loop cycle.

hoopla

2012-03-28 12:02:35

From: Sin

procedure FailSafe2 (Reason:String);
var
Z:TPoint;
begin
Z:= SPS_GetMyPos;
if (Not (Distance(Z.X, Z.Y, 3377, 2700) < 10)) then//Change the 25 to whatever you want your distance checking to be.
Begin
BoredHuman;
SPS_WalkToPos(Point(3377, 2700));
end;
end;
Why do you call Reason?


procedure AntiBan;
begin
if(not(LoggedIn))then
exit;
FindNormalRandoms;
case Random(2) of
0:
begin
WriteLn('Skill Check');
HoverSkill('Random', False);
Wait(1000 + Random(200));
end;
end;
end;
Standards :s


function PickupLoot:Boolean;
var
x, y: Integer;
begin
FindNormalRandoms;
If FindLoot(x, y) Then
begin
While IsMoving do
Wait(25);
FindNormalRandoms;
Wait(RandomRange(300,400));
Mouse(x, y, 0, 0, False);
ChooseOption('ide');
Result := True;
end;
end;
should actually be


function PickupLoot:Boolean;
var
x, y: Integer;
begin
Result := False;
if FindNormalRandoms then
if not LoggedIn then
terminatescript;
If FindLoot(x, y) Then
begin
While IsMoving do
Wait(25);

if FindNormalRandoms then
if not LoggedIn then
terminatescript;

Wait(RandomRange(300,400));
Mouse(x, y, 0, 0, False);
WaitOpTion('ide',750);
Result := True;
end;
end;
Always set the result false in the beginning of calling the function.

Your main loop -

begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
Smart_Server := 24;
ActivateClient;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
Wait(4000+random(400));
Repeat
WalkToCows;
KillCows;
PickupLoot;
AntiBan;
if InvFull then
WalkToBank;
Banking;
Report;
Until(False)
end.

is flawed, it should be

begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
Smart_Server := 24;
ActivateClient;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
Wait(4000+random(400));
Repeat
WalkToCows;
KillCows;
PickupLoot;
AntiBan;
if InvFull then
begin
WalkToBank;
Banking;
end;
Report;
Until(False)
end.
Otherwise it's just going to continue banking every main loop cycle.



this does indeed fix the banking issue…now if we could just implement world switching to make it less bot like! hahaha

Gucci

2012-03-28 12:03:53

Thanks for the pointers Sin

solid123

2012-03-31 05:27:42

was this tested with low level account? seems to be a bit slow reaction on my lvl 60 that keeps 1 hitting the cow then kills another 5 and then gets one cowhide and lets the rest disappear and also picks up meat and bones besides that its flawless lol great work

unknownrpg

2012-04-16 22:18:44

quick question? i have a newb att/str pure who has been members b4 but if i renew membership and my nub gets banned for bottin while killing cows would they track my credit card info to my main? n ban both?? some1 get back to me plz appreciate it

Rezozo

2012-04-24 18:14:50

From: unknownrpg
quick question? i have a newb att/str pure who has been members b4 but if i renew membership and my nub gets banned for bottin while killing cows would they track my credit card info to my main? n ban both?? some1 get back to me plz appreciate it


No they won't, it's to much work for them.

Also general question for Gucci, do you think you could make a cow killer/looter for Beefy?

Gucci

2012-04-24 18:26:52

I'll look into it since it's mostly this but different walking and stuff. Also reply to your testing thread :p

Joe

2012-04-24 19:06:11

Good script… haven't used extensively as I am working on my script (hence the sig).

Gucci

2012-04-24 19:38:45

From: JOEbot
Good script… haven't used extensively as I am working on my script (hence the sig).


Thanks, and good luck with the hill giant killer looks fun ;).

@joeygupta I'm done…… not really sure if it works or not but yeah it's done let me know if you want to test or I'll just release public and let people try it out

Striken

2012-04-24 23:42:31

I'll donate to you some time this week after I buy myself 70 prayer.

Gucci

2012-04-24 23:56:43

From: Phyaskou
I'll donate to you some time this week after I buy myself 70 prayer.


Awesome, thanks :D just started a pure could use some cash on it

Striken

2012-04-25 00:00:16

Good luck on that. Around this week or next week after I get my stats up.

Rezozo

2012-04-28 21:17:04

From: Gucci
Thanks, and good luck with the hill giant killer looks fun ;).

@joeygupta I'm done…… not really sure if it works or not but yeah it's done let me know if you want to test or I'll just release public and let people try it out


I'd love to test it out! Have just the pure for the job lol.

As for releasing to the public, once all (if any) the kinks are worked out, go for it! No point in releasing one that half works :)

Gucci

2012-04-28 21:40:38

From: joeygupta
I'd love to test it out! Have just the pure for the job lol.

As for releasing to the public, once all (if any) the kinks are worked out, go for it! No point in releasing one that half works :)


True not even sure if it works ;)

Cinkupis

2012-05-05 03:39:38

Not sure why, but for me it doesn't loot.

Problem is, he kills 10 cows, and only 1 of them killed loots.

bots420

2012-05-05 10:48:02

I'm trying this script out now. Lets hope it works :D
Thanks alot man!

gashwagon

2012-05-07 15:16:00

couldnt get the script to do anything till i took it to the cows


Edit: oops not true wrong bank start in Taverly bank not burthorpe or at cows


RUNS FOREVER, Nice job keep up the good work

Gucci maybe you should make a smither thats better than supper savvy we need one and your talented.

BigRedJapan

2012-05-24 14:07:04

Only Problem it doesnt loot!

apk1973

2012-05-26 19:22:29

hi gucci.. when are you updating the problems with this script.. as it keeps coming up as sps error then cutting off after 30 mins or less

Gucci

2012-05-27 01:55:43

From: apk1973
hi gucci.. when are you updating the problems with this script.. as it keeps coming up as sps error then cutting off after 30 mins or less


Only problem is apparently yours, can you post the error your getting?

apk1973

2012-05-27 17:14:42

Hi Gucci, think it might of been a problem with my pc running too many things.. its only an AMD II QUAD CORE Q6600 and ive only just had it so unsure how many things i can run on it at the same time.. sorry for any confusion

apk1973

2012-05-27 21:30:06

hi gucci it did it again heres whats its doing.. its opening a new tab with sps on the tab with all this in it

(*
SPS ~ SRL Positioning System
============================

Concept and original work done by marpis @ SRL-Forums.

*)

{$loadlib sps}

const
// Path where all the SPS files are
SPS_IMG_PATH = IncludePath + 'SPS\img\';
SPS_IMG_FMT = '.png';

// Surfaces
RUNESCAPE_SURFACE = 0;
RUNESCAPE_SURFACE_FOLDER = 'runescape_surface\';

RUNESCAPE_OTHER = 1;
RUNESCAPE_OTHER_FOLDER = 'runescape_other\';

// SPS Global variables
var
SPS_Debug, SPS_MultiMouse: boolean;
SPS_Areas: TStringArray;
SPS_AreaMaps: T3DIntegerArray; // Grids of the combined SPS_Areas
SPS_Tolerance, SPS_MatchesPercent: extended;
SPS_Accuracy: integer; // Splits minimap/areas into squares of this side length; used for area recognition

// Returns an image of the minimap in a TMufasaBitmap
function SPS_GatherMinimap: TMufasaBitmap;
var
c: TClient;
begin
try
Result := TMufasaBitmap.Create;
Result.SetSize(150, 150);

c := getTClient;
Result.CopyClientToBitmap(
c.IOManager, false, 0, 0, MMCX-75, MMCY-75, MMCX+75, MMCY+75
);

except
Writeln('SPS_GatherMinimap ERROR: '+ExceptionToString(ExceptionType, ExceptionParam));
end;
end;

// Gets the starting area coordinates depending on the area image
procedure SPS_GetAreaCoords(Area: string; var x, y: integer);
var
p: integer;
begin
// if it's a specific dungeon map (i.e. name isn't 0_0, 10_2, etc.)
if (length(getNumbers(Area)) < 2) then
begin
x := 0;
y := 0;
Exit;
end;

p := pos('_', Area);

x := StrToIntDef(copy(Area, 1, p - 1), -1);
y := StrToIntDef(copy(Area, p + 1, Length(Area) - p), -1);

//writeln('SPS_GetAreaCoords: '+toStr(point(x, y)));
end;

// Converts a point from a map piece to a point on the entire map
function SPS_LocalToGlobal(Area: string; x, y: integer): TPoint;
var
cx, cy: integer;
begin
SPS_GetAreaCoords(Area, cx, cy);
Result.x := (cx * 400) + x;
Result.y := (cy * 400) + y;
end;

// Converts a point from the entire map to a point on the main screen
function SPS_GlobalToLocal(x, y: integer): TPoint;
var
cx, cy: integer;
begin
cx := Floor(x / 400);
cy := Floor(y / 400);

Result.x := x - (cx * 400);
Result.y := y - (cy * 400);
end;

// Returns the coordinates (x, y) in the form of a string
function SPS_AreaCoordsToString(x, y: integer): string;
begin
Result := IntToStr(x)+'_'+IntToStr(y);
end;

// Author: Coh3n
// Returns a TPA of the areas' values
function SPS_TPAFromAreas(areas: TStringArray): TPointArray;
var
i: integer;
begin
setLength(result, length(areas));

for i := 0 to high(areas) do
SPS_GetAreaCoords(areas[i], result[i].x, result[i].y);
end;

// Author: Coh3n
// Sorts the areas by columns, and sorts each column by rows
// Example: ['1_5', '1_3', '0_5'] results ['0_5', '1_3', '1_5']
function SPS_SortAreas(areas: TStringArray): TStringArray;
var
i, j: integer;
tpa: TPointArray;
begin
setLength(tpa, length(areas));

tpa := SPS_TPAFromAreas(areas);
clearDoubleTPA(tpa);

sortTPAByX(tpa, true); // first sort by column number

// then sort the Y values for each column number
for i := 0 to high(tpa) do
for j := i to high(tpa) do
if (tpa[i].x = tpa[j].x) then
if (tpa[i].y > tpa[j].y) then
tSwap(tpa[i], tpa[j]);

setLength(result, length(tpa));

for i := 0 to high(tpa) do
result[i] := SPS_AreaCoordsToString(tpa[i].x, tpa[i].y);

//writeln('SPS_SortAreas: '+toStr(result));
end;

// Loads the "Area" image
function SPS_GetArea(Area: string; surface: integer): TMufasaBitmap;
var
x, y: integer;
S: string;
begin
SPS_GetAreaCoords(Area, x, y);

case surface of
RUNESCAPE_SURFACE: s := RUNESCAPE_SURFACE_FOLDER;
RUNESCAPE_OTHER: s := RUNESCAPE_OTHER_FOLDER;
end;

try
Result := TMufasaBitmap.Create;
Result.LoadFromFile(SPS_IMG_PATH + s + Area + SPS_IMG_FMT);
except
Writeln('SPS_GetArea ERROR: '+ExceptionToString(ExceptionType, ExceptionParam));
end;
end;

// Author: Coh3n
// Merges the SPS 'areas' into one bitmap (makes more more accurate GetMyPos)
function SPS_MergeAreas(areas: TStringArray): TMufasaBitmap;
var
t, i, l, x, y, diffX, diffY, newWidth, newHeight: integer;
startPoint: TPoint;
newAreas: TStringArray;
xVals, yVals: TIntegerArray;
bmpTemp: TMufasaBitmap;
tmpTPA: TPointArray;
begin
if (length(areas) <= 0) then
exit;

t := getSystemTime();

// sort the areas from by columns/rows; remove duplicates
newAreas := SPS_SortAreas(areas);
l := length(newAreas);

// if there's only one area in the array
if (l = 1) then
begin
result := SPS_GetArea(areas[0], RUNESCAPE_SURFACE);
exit;
end;

// get the x and y values for each area
setLength(xVals, l);
setLength(yVals, l);

for i := 0 to high(newAreas) do
SPS_GetAreaCoords(newAreas[i], xVals[i], yVals[i]);

// get the lowest Y value so we can calculate the starting point to draw the first image
tmpTPA := SPS_TPAFromAreas(newAreas);
sortTPAByY(tmpTPA, true);

try
result := TMufasaBitmap.create();

// calculate the starting point
// x is always 0 because of how the areas are sorted
// y is relative to the lowest y value in the areas
SPS_GetAreaCoords(newAreas[0], x, y);
startPoint.x := 0;
startPoint.y := ((y - tmpTPA[0].y) * 400);

// draw the first area to the starting point on the bitmap
bmpTemp := SPS_GetArea(newAreas[0], RUNESCAPE_SURFACE);
result.SetSize(bmpTemp.width, bmpTemp.height + startPoint.y);
bmpTemp.fastDrawTransparent(startPoint.x, startPoint.y, result);
bmpTemp.free();

// loop through each area, drawing them to the result bitmap
// coordinates are calculated relative to the first area drawn (areas[0])
for i := 0 to (l - 2) do
begin
diffX := (xVals[i + 1] - xVals[0]);
diffY := (yVals[i + 1] - yVals[0]);

newWidth := 500 + (round(abs(diffX)) * 400);
newHeight := 500 + (round(abs(diffY)) * 400);

// only set the size if the width or height is increasing
if (newWidth > result.width) then
result.setSize(newWidth, result.height);

if (newHeight > result.height) then
result.setSize(result.width, newHeight);

// copy the area image to the resulting bitmap
bmpTemp := SPS_GetArea(newAreas[i + 1], RUNESCAPE_SURFACE);
bmpTemp.fastDrawTransparent(startPoint.x + (diffX * 400 + 1),
startPoint.y + (diffY * 400 + 1), result);
bmpTemp.free();
end;

//result.saveToFile('C:/Simba/test.bmp');
except
Writeln('SPS_MergeAreas ERROR: '+ExceptionToString(ExceptionType, ExceptionParam));
end;

if (SPS_Debug) then
writeln('SPS_MergeAreas: Merged areas in '+toStr(getSystemTime - t)+' ms.');
end;

// Author: Coh3n
// Returns an SPS area of lowest x and y value. Used for calculating the
// player's correct position
function SPS_GetTopLeftCoords(areas: TStringArray): string;
var
tpa: TPointArray;
begin
tpa := SPS_TPAFromAreas(areas);

if (length(tpa) <= 0) then
begin
result := '0_0';
exit;
end;

sortTPAByX(tpa, true);
result := toStr(tpa[0].x);

sortTPAByY(tpa, true);
result := result + '_'+toStr(tpa[0].y);

//writeln('SPS_GetTopLeftCoords: '+result);
end;

// SPS2
function SPS_GetMyPos(): TPoint;
var
Minimap: TMufasaBitmap;
SmallMap: T3DIntegerArray;
t, FoundMatches: integer;
P: TPoint;
Searches: extended;
begin
Result := Point(-1, -1);

if (not LoggedIn) then
Exit;

if (SPS_Tolerance < 1.0) then
SPS_Tolerance := 600.0;

if (SPS_MatchesPercent = 0.0) then
SPS_MatchesPercent := 0.35;

if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then
MakeCompass('N');

t := getSystemTime();

Minimap := SPS_GatherMinimap;
SPS_FilterMinimap(Minimap);
//DrawBitmapDebugImg(Minimap.Index);
//DisplayDebugImgWindow(150, 150);
SmallMap := [];
SmallMap := SPS_BitmapToMap(Minimap, SPS_Accuracy);

FoundMatches := SPS_FindMapInMap(P.x, P.y, SPS_AreaMaps, SmallMap, SPS_Tolerance);
Searches := ((Minimap.Width / SPS_Accuracy) * (Minimap.Height / SPS_Accuracy));
{
writeln('fx: '+toStr(p.x)+' ~ on area: '+toStr(P.X * SPS_Accuracy + (Minimap.Width / 2)));
writeln('fy: '+toStr(p.y)+' ~ on area: '+toStr(P.Y * SPS_Accuracy + (Minimap.Width / 2)));
writeln('matches: '+toStr(foundMatches));
writeln('searches: '+toStr(searches));
writeln('percent: '+toStr(FoundMatches / Searches));
}
if ((FoundMatches / Searches) > SPS_MatchesPercent) then
Result := SPS_LocalToGlobal(SPS_GetTopLeftCoords(SPS_Areas), // the top left of the total area
P.x * SPS_Accuracy + (Minimap.Width / 2),
P.y * SPS_Accuracy + (Minimap.Width / 2));

Minimap.Free;

t := (GetSystemTime - t);
if (SPS_Debug) then
Writeln('SPS_GetMyPos: Finished in '+ToStr(t)+' ms. Result = '+ToStr(Result));
end;

// Finds position P in minimap by checking your own location
function SPS_PosToMM(P: TPoint): TPoint;
var
MyPos: TPoint;
begin
if not LoggedIn then
Exit;

Result := Point(-1, -1);
MyPos := SPS_GetMyPos;

if (Distance(MyPos.X, MyPos.Y, P.X, P.Y) < 75) then
Result := Point(MMCX + P.X - MyPos.X, MMCY + P.Y - MyPos.Y);
end;

// Walks to position, P.
function SPS_WalkToPos(P: TPoint): boolean;
var
MM: TPoint;
begin
if not LoggedIn then
Exit;

MM := SPS_PosToMM(P);

if (MM.X > 0) then
begin
if (SPS_MultiMouse) then
MultiMouse(MM.X, MM.Y, 25, 3, false)
else
Mouse(MM.X, MM.Y, 0, 0, mouse_Left);

if WaitFunc(@IsMoving, 1, 3000 + random(500)) then
while IsMoving do
Flag;

Result := True;
end;
end;

// Returns true if the point "Pt" is on the minimap
function SPS_PosOnMM(Pt: TPoint): Boolean;
var
p: TPoint;
begin
p := SPS_PosToMM(Pt);
Result := rs_OnMinimap(p.x, p.y);
end;

// 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;

// Walks blindly from the player's current position to the point T
function SPS_BlindWalk(P: TPoint): Boolean;
var
Tries: Integer;
M: TPoint;
ctrlPoints: TPointArray;
begin
repeat
M := SPS_GetMyPos;

if (Length(ctrlPoints) = 0) then
ctrlPoints := TPABetweenPoints(Point(M.X, M.Y), Point(P.X, P.Y), 20 + Random(15), 10);

Inc(Tries);
if (Tries > 20) then
Exit;

Result := SPS_WalkPath(ctrlPoints);
until(Result);
end;

// Sets up SPS; needs to be called if you want to switch RS surfaces
function SPS_Setup(surface: integer; areas: TStringArray): boolean;
var
t: integer;
tmp: TMufasaBitmap;
begin
t := getSystemTime;

SPS_MultiMouse := true;
SPS_Accuracy := 4;

if (length(areas) > 0) then
begin
if (surface = RUNESCAPE_SURFACE) then
tmp := SPS_MergeAreas(areas) // combine the SPS areas into 1; makes for a more accurate read
else
if (surface = RUNESCAPE_OTHER) then
if (length(areas) = 1) then
tmp := SPS_GetArea(areas[0], surface)
else begin
writeln('SPS_Setup(): Invalid dungeon areas. You can only select one!');
exit;
end;

result := true;
SPS_AreaMaps := SPS_BitmapToMap(tmp, SPS_Accuracy);
SPS_Areas := SPS_SortAreas(areas);
tmp.free();

end else
writeln('SPS_Setup(): ERROR: SPS areas are not set!');

t := (getSystemTime - t);

if (SPS_Debug) and (result) then
writeln('[SPS] SPS_Setup() took '+toStr(t)+' ms. Areas: '+toStr(SPS_Areas));
end;

Yago

2012-05-27 21:32:49

From: apk1973
hi gucci it did it again heres whats its doing.. its opening a new tab with sps on the tab with all this in it


Please use Code Tags… BAsically put that code in tags like so:

[noparse]
blahblah function blah
[/noparse]

Gucci

2012-05-28 00:35:04

apk1973 put that in Simba tags a major waste of space also don't double post edit your original, what comes up in the debug cause I don't see a problem in the script that would cause that.

Stanger

2012-05-29 12:55:01

apk1973 Make sure you replaced the bitmap good and otherwise close simba and try again sometime it will help. Also make sure you updated SPS

Austin

2012-06-28 11:24:12

Did you ever think about changing the WalkToBank to make the player walk to the bank north of the cow pen instead of the one all the way to the south in Taverly? It's a lot closer and would only take 1/5 of the time to go to. Just a suggestion :)

Gucci

2012-06-29 00:58:27

From: AustnW
Did you ever think about changing the WalkToBank to make the player walk to the bank north of the cow pen instead of the one all the way to the south in Taverly? It's a lot closer and would only take 1/5 of the time to go to. Just a suggestion :)


I did but I don't plan on changing what I have

DreamDog

2012-07-05 19:05:01

changed runescape_surface gonna try this out on my pure- if all goes well i will post a progress report.

edit: DAMN. there are atleast 3 bots with those stupid spam names that you can tell have all been geared up by the same guy (bot army) every single world. - successful scripts are successful i guess.

############### Cow Pwner #############
|= Player : *********
|= Time Running : 58 Minutes and 35 Seconds
|= Cows Killed : 126
|= Hides Gotten : 100
########################################

Gucci

2012-07-07 12:08:28

From: DreamDog
changed runescape_surface gonna try this out on my pure- if all goes well i will post a progress report.

edit: DAMN. there are atleast 3 bots with those stupid spam names that you can tell have all been geared up by the same guy (bot army) every single world. - successful scripts are successful i guess.

############### Cow Pwner #############
|= Player : *********
|= Time Running : 58 Minutes and 35 Seconds
|= Cows Killed : 126
|= Hides Gotten : 100
########################################


Yeah they are annoying but I don't play anymore, nice proggy