SRL Archive - OSR Help

ProjectRS06 Lobster fish


Syntax

2013-01-11 08:50:07

Hi guys, I've made the script for an RSPS which is why I don't use uptext and such since I found this too be easier (got uptext to work, but sometimes the text changes size which is glitchy so it wasn't reliable)
Anyway I'm having multiple errors. I went through the script and cleaned it up. The script is stuck on the function.
program PRS06_Lobster;
{$define srl5}
{$i srl/srl.simba}
{$i sps/sps.simba}
var
full:boolean;
Lobster, DropLobster, Cage:Integer;

Procedure DeclareBits; //For Bitmaps Dependancies
begin
Lobster := BitmapFromString(15, 12, 'meJxlkc8HwnAYxrc/oMMYY2SNSY' +
'ekRGIaFStNP9RUdOjQJTpEhw6jQ4eIiA6d+md7vnvmNcVjvt7v5/u' +
'+z/tM1zRd03rjpT+KIZyL3ZNhmMUwcaObN3uiUirVITBWewfp6ROo' +
'4LQBk3dGV3f6IAwSUlf9M2VUhhAripzcpTNhVYxuqKOV2dzIW7b9h' +
'73Fy4vfdudg+/tfOH7nYcuy6daoThRMS2FS8AIa1nMJ8CG+VmtLPy' +
'AhuMoLAGDGgrMzuKiNFq/y+sNBZmOFDhhnB8d8gBk8fZAEhmURKRZ' +
'hkuJc/YgwEXtmbZ41JJluIW5Jih8ZLcsK8EOCURmSTDHYQ4xkvnfP' +
'ajk=');


DropLobster := BitmapFromString(104, 5, 'meJy9VEkOgDAI7NO8+QGv/skfY5' +
'VIJqw1jRIOdNoMdKAluqy1tm47PdZuE4SXHHcwwdGXg8SFUHBGOFa' +
'4u1S0jJdUCKrzYhYvmbuT0Q3v6O4mcaJbtGVF4CJf6VbGbmqXczBL' +
'rsC8bnnTbUmupPO6IU856m5n/9dNNT2/IEr9kW45T/SiFe7+ZshPY' +
'OqkxQcLi4ZKdbaktb+BO7oljlvRyKnsJzkul7o=');

Cage := BitmapFromString(116, 8, 'meJy9lFESgzAIRLldL9Df3v8Yqd' +
'ox3S4Lkqhl/MisG0ieYGtrmNnj+br7saWQq/URJzYW9/7zoXO2mG2' +
'DOKNzaQfEtvCebpMi7c08gR550DaUk8SIbdeXQFyjuvysHqY0CG5b' +
'dvLzvZTH9pNJvAd13d6SvnM47NvuGV0nIyPFrB/gLnT3UU9xpip5k' +
'vz1vq3wxA8xx7aPueyHC9cC76V1ESMuJvoTkUqwdbb38czZXlvXjz' +
'9ikf+Euj7BFgfT4DAn7+jT6oNFdZ3Or5QuJoIu/huk+/9J5CdDIuY' +
'V59bftHHfyrqILocj9TcfiHdB');
end;
Procedure RiverTroll; //Not sure if works let me know in the thread please :)
var
x, y:Integer;
begin
If FindcolorTolerance(x, y, 7966560, 0, 0, 511, 334, 5) then
writeln('Found Trollarch :D');
Mouse(584, 61, 5, 5, true);
writeln('clicked Away from Trollarch');
wait(15000 + random (1000));
Mouse(636, 474, 10, 10, true);
Wait(100);
Mouse(639, 346, 3, 40, true);
wait(10);
WriteLn('River Troll Detected! -logging out');
end;
Function IsFishing: Boolean; //To find if fishing
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 400);
Writeln('Checking if we are Fishing');
end;

Procedure FindFishingSpot;
var
tmpCTS, i, l, r, x, y:integer;
FishTPA:TPointArray;
Begin
While IsFishing Do Wait (200+random(50));
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.38, 0.87);
FindColorSpiralTolerance(x, y, 15647904, 3, 2, 514, 336, 4);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);

L:=High(FishTPA);
for i:= 0 to L do
begin
r := random(L);
Wait(randomrange(63,202));
mmouse(FishTPA[r].x, FishTPA[r].y,2,2);
end;
end;
Procedure StartFishing;
Var
x, y: Integer;
Begin
If IsFishing then
Begin
Writeln('we are currently fishing Lobsters');
repeat
wait(randomrange(250,263));
until(not(IsFishing));
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
If not FindBitmap(Cage, x, y) then
begin
FindFishingSpot;
end else
begin
Mouse(x, y, 0, 0, true);

end;
end;
end;


Procedure DropInventory;
var
x, y, x2, y2:Integer;
Begin;
Full := True
repeat
If (FindBitmapToleranceIn(Lobster, x, y, 546, 184, 753, 453, 15)) then
begin
wait(10);
Mouse(x, y, 3, 3, False);
wait(10);
if FindBitmapToleranceIn(DropLobster, x2, y2, 546, 184, 753, 453, 15)then
wait(20);
MMouse(x, y, 0, 0);
Mouse(x2, y2, 50, 3, True);
wait(1000 + Random(100));
end else
begin
Full := False
DeclareBits;
FindFishingSpot;
end;
until(Full = False)
end;

Procedure CheckFull;
var
x, y:Integer;
Begin
repeat
DeclareBits;
If (FindBitmapToleranceIn(Lobster, x, y, 690, 405, 737, 444, 15)) then
begin
Full := True
DropInventory;
end else;
begin
Full := True
DropInventory;
end;
wait(10000 + Random(1000));
until(Full = True)
end;
Procedure Randoms;
begin
If(Full = False) then
repeat
Rivertroll;
Wait (10 + random(7000));
until(Full = True)
end;
begin
ClearDebug;
SetupSRL;
While IsFishing Do Wait(200+Random(50));
StartFishing;
CheckFull;
Randoms;
FreeBitmap(Lobster);
FreeBitmap(DropLobster);
FreeBitmap(Cage);
end.

Script keeps on repeating my Writeln " Writeln('Checking if we are Fishing');" Anyone advise me on how to rewrite? Thank you so much :)

rj

2013-01-11 17:02:42

So it does not do any of the procedures? And if im not mistaken I think if you add that Writeln in the function it will always show it

Syntax

2013-01-11 20:24:26

From: rjj95
So it does not do any of the procedures? And if im not mistaken I think if you add that Writeln in the function it will always show it


Yeah it pretty much just keeps doing the Writeln, I removed it and made one at the beginning of what should be the next procedure it does from the mainloop and it just stalls doesn't print that in the debug box. I dunno my original script works but it's not clean and its not too accurate sometimes.

Syntax

2013-01-12 04:13:55

Bumping the thread been multiple hours.

Pew

2013-01-12 04:44:36

If that's my river troll detection then you should know that it will log out if anyone gets one not just you. I can't run simba right now so if you could elaborate on your errors I can try to help.

You are also better off trying to just bank the lobs as the bank is so close. Perhaps use find symbol method, I think someone posted an explanation in the shrimp cooker thread.

Syntax

2013-01-13 01:34:53

From: Pew
If that's my river troll detection then you should know that it will log out if anyone gets one not just you. I can't run simba right now so if you could elaborate on your errors I can try to help.

You are also better off trying to just bank the lobs as the bank is so close. Perhaps use find symbol method, I think someone posted an explanation in the shrimp cooker thread.


Yep it is your detection, I was going to put credit when i made the official thread for the script. I'll check that thread out after work.

Syntax

2013-01-19 04:55:48

Just going to bump here hopefully for a reply ;)
Thanks :)