shaunthasheep
2007-04-28 08:35:08
Need testers…. this is my first walking script.. and first script using SRL.
Note:
Never tested it fully… need More 30gpz xD
the only part that it may get stuck on, is the ClickToContinue after you sail to karajama.. but i think i fixed that
Walking From RuneStore/Jewelry Store/Axe Shop (in port sarim) to transportation symbol is a bit risk-taking… idk what will happen if it doesn't find the transportation symbol xD (the way i script it, it should walk to the East until it finds it)
Dont steal this code without asking… and i did use a function from solemn wishes "chatend" i couldn't find one in SRL and i didnt want to make my own xD
Yes i no i need to fix the repeat until false.. i was gonna use Time Mark and if it gets stuck for a certain amout of time it will say its lost and logout
and Comments on how to improve the walking would be great
Note:
Never tested it fully… need More 30gpz xD
the only part that it may get stuck on, is the ClickToContinue after you sail to karajama.. but i think i fixed that
Walking From RuneStore/Jewelry Store/Axe Shop (in port sarim) to transportation symbol is a bit risk-taking… idk what will happen if it doesn't find the transportation symbol xD (the way i script it, it should walk to the East until it finds it)
Dont steal this code without asking… and i did use a function from solemn wishes "chatend" i couldn't find one in SRL and i didnt want to make my own xD
program KarjamaFisher;
{.include SRL/SRL.scar}
//by solemn wishes
function chatend: boolean;
begin
if ((not FindColor(x, y, 0, 21, 434, 21, 434)) and (not FindColor(x, y, 0, 475, 434, 475, 434))) then
Result:=True;
end;
procedure FindKarajamaColors;
var
C, RX, RY, RoadBit : integer;
begin
RoadBit := BitmapFromString(10, 2, 'z78DAB374B4303734B0A43B09001C4' +
'219C9');
Writeln('Finding Colors!');
if RoadColor = 0 then
repeat
If FindBitMapToleranceIn(RoadBit, RX, RY, 570, 5, 725, 160, C) Then
Begin
RoadColor:= GetColor(RX, RY);
Break;
End;
C := C + 5;
until((RoadColor <> 0) or (C >= 75))
Writeln('RoadColor = ' + inttostr(RoadColor));
if RoadColor = 0 then
begin
Writeln('ERROR: COULDN''T GET ALL COLORS!');
Logout
end;
FreeBitmap(RoadBit);
end;
procedure FindDraynorColors;
var
C, RX, RY, RoadBit : integer;
begin
RoadBit := BitmapFromString(3, 3, 'z78DA333734B334B334279104003AF4' +
'0B77');
Writeln('Finding Colors...');
if RoadColor = 0 then
repeat
C := C + 5;
If FindBitMapToleranceIn(RoadBit, RX, RY, 587, 38, 621, 75, C) Then
Begin
RoadColor:= GetColor(RX, RY);
Break;
End;
until((RoadColor <> 0) or (C >= 100))
if BankColor = 0 then
begin
C := 0;
repeat
C := C + 1;
BankColor := GetSymbolColor (RX , RY, 'bank');
Wait(100);
until((BankColor <> 0) or (C >= 100));
end;
Writeln('RoadColor = ' + inttostr(RoadColor));
Writeln('BankColor = ' + inttostr(BankColor));
if((RoadColor = 0) or (BankColor = 0))then
begin
Writeln('ERROR: COULDN''T GET ALL COLORS!');
TerminateScript;
end;
FreeBitmap(RoadBit);
end;
procedure BankToDock;
var
Times, SX, SY, SX2, SY2 : integer;
begin
RadialRoadWalk(RoadColor, 313, 276, 65, 0, 0);
FFlag(5);
if FindSymbol(SX, SY, 'quest') then
begin
Mouse(SX, SY, 1, 1, True);
Flag;
end;
repeat
Times := Times + 1
MouseFlag(MMCX, MMCY - 40, 1, 4);
if Times > 5 then
begin
Writeln('Lost');
Logout;
end;
until(FindSymbol(SX, SY, 'dungeon'));
MouseFlag(SX, SY, 1, 1);
RadialRoadWalk(RoadColor, 313, 276, 55, 0, 0);
repeat
RadialRoadWalk(RoadColor, 200, 270, 55, 0, 0);
Wait(500);
until(FindSymbol(SX, SY, 'Jewelery') or FindSymbol(SX, SY, 'Axe shop'));
Flag;
RadialRoadWalk(RoadColor, 263, 268, 66, 0, 0);
if FindSymbol(SX, SY, 'Jewelery') then
begin
if FindSymbol(SX2, SY2, 'Axe shop') then
begin
MouseFlag((SX2 - SX) / 2 + SX, SY, 0, 0);
//This Clicks Inbetween The Two Symbols
//If There Both Found, and Y coord = Jewelry Shops Y
end;
end;
Times := 0;
repeat
Times := Times + 1;
MouseFlag(MMCX, MMCY + 40, 0, 0);
until(FindSymbol(SX, SY, 'minigame') or (Times > 2))
Times := 0;
if FindSymbol(SX, SY, 'minigame') then
begin
MouseFlag(SX, SY, 1, 1);
MouseFlag(MMCX, MMCY + 50, 1, 10);
end;
repeat
if FindSymbol(SX, SY, 'transportation') then
begin
Mouse(SX, SY, 0, 0, True);
Flag;
Times := -1; //Just Incase
Break;
end else
begin
Wait(100);
if Times < 3 then
begin
Times := Times + 1;
Mouse(MMCX, MMCY + 30, 1, 1, True);
Flag;
end;
if Times > 100 then
begin
Writeln('Couldn''t Find Dock!');
Logout;
Exit;
end;
end;
until Times = -1
MakeCompass('E');
HighestAngle;
repeat
if FindObject(SX, SY, 'alk', 11424335, 10, True) then
begin
Writeln('Found Sailor');
Mouse(SX, SY, 0, 0, False);
if ClickOption('Pay', 1) then
begin
break;
end;
end;
until false
repeat
Wait(100);
ClickToContinue;
until ClickNpcChatText('Yes')
Wait(5000);
repeat
Wait(100);
ClickToContinue;
until not chatend
MakeCompass('S');
LowestAngle;
repeat
if FindObject(SX, SY, 'ross', 3628667, 10, True) then
begin
Writeln('Found Blank');
Mouse(SX, SY, 0, 0, False);
if ClickOption('ross', 1) then
begin
break;
end;
end;
until false
MakeCompass('N');
HighestAngle;
FindKarajamaColors;
repeat
RadialWalk(RoadColor , 254, 300, 50, 0, 0);
wait(1000);
until(FindSymbol(SX, SY, 'water') or FindSymbol(SX, SY, 'bar'))
Times := 0;
repeat
Times := 1;
RadialWalk(RoadColor , 254, 300, 50, 0, 0);
until(FindSymbol(SX, SY, 'store') or (Times >= 2))
MouseFlag(SX, SY, 0, 0);
Times := 0;
repeat
if Times < 6 then
MouseFlag(MMCX + 45, MMCY - 45, 2, 2);
Times := Times + 1;
Wait(100);
until(FindSymbol(SX, SY, 'fish') or (Times > 40))
if Times > 40 then
MouseFlag(MMCX, MMCY - 50, 0, 0)
else
MouseFlag(SX, SY, 0, 0);
//Player.Location := 'Karajama Dock'
end;
begin
SetupSRL;
ActivateClient;
Wait(2000);
MakeCompass('N');
HighestAngle;
FindDraynorColors;
SetRun(False);
GameTab(4);
BankToDock;
end.
Yes i no i need to fix the repeat until false.. i was gonna use Time Mark and if it gets stuck for a certain amout of time it will say its lost and logout
and Comments on how to improve the walking would be great