SCAR Code:
program New;
{.include srl\srl.scar}
{.include srl\srl\misc\playerform.scar}
const tehfilename='onemember';
function SymbolFinder(var gx,gy:integer; symbol:string):boolean;
var bankfindtries,logouttries:integer;
begin
FindSymbol(gx,gy,symbol);
logouttries:=0;
if ((gx=0)or(gy=0)) then
begin
repeat
bankfindtries:=0;
repeat
FindSymbol(gx,gy,symbol);
if ( not((gx=0)and(gy=0)) ) then
begin
SendArrowSilentWait(3, 100 + Random(50));
bankfindtries:=bankfindtries+1;
wait(10);
end;
until (( not((gx=0)or(gy=0)) ) or (bankfindtries>10) );
if bankfindtries>10 then
begin
logout;
wait(1000+random(1000));
loginplayer;
logouttries:=logouttries+1;
repeat
wait(10);
until (loggedin);
mouse(519+random(31),214+random(40),0,0,true);
end;
FindSymbol(gx,gy,symbol);
if logouttries>3 then
begin
LogOut;
ActivateClient;
NextPlayer ( False );
LoginPlayer;
break
end;
until ( not((gx=0)or(gy=0)) );
if not((gx=0)or(gy=0)) then result:=true;
end;
end;
{*******************************************************************************
function angledir(angle,direction: String);
By: Boreas. Base on makecompass by Wizzup? and highest angle by StarBlaster 100
Description: Aligns RS to specified direction and angle at the same time
direction: set to: North='n', South='s', East='e', West='w'
angle: set to highest='h', lowest='l'
*******************************************************************************}
Function angledir(angle,Side:String): Boolean;
Var
Fx, Fy, Dx, Dy : Integer;
ComMark: Integer;
Left_Right : Boolean;
Begin
MarkTime(ComMark);
Case LowerCase(Side) Of
'n' : Begin Fx := 566; Fy := 13; End;
'e' : Begin Fx := 560; Fy := 19; End;
's' : Begin Fx := 566; Fy := 27; End;
'w' : Begin Fx := 573; Fy := 20; End;
end;
If FindColor(Dx,Dy,723587,Fx,Fy,Fx,Fy) Then
begin
Result:=True;
case angle of
'h':
begin
if (Loggedin) then
begin
keydown(38);
sleep(1000 + random(100) + random(200));
keyup(38);
wait(1000 + random(100));
end;
end;
'l':
begin
if (Loggedin) then
begin
keydown(40);
sleep(1000 + random(100) + random(200));
keyup(40);
wait(1000 + random(100));
end;
end;
end;
Exit;
end
If Random(2) = 1 Then Left_Right := True
Else Left_Right := False;
If Left_Right Then
begin
case angle of
'h':keydown(38);
'l':keydown(40);
end;
KeyDown(VK_RIGHT)
end
Else
begin
case angle of
'h':keydown(38);
'l':keydown(40);
end;
KeyDown(VK_Left);
end;
Repeat
Wait((10)+ Random(10));
If(FindColor(Dx,Dy,723587,Fx,Fy,Fx,Fy))then
begin
Result := True;
break;
end;
Until(TimeFromMark(ComMark) > 7000);
If Left_Right Then
begin
case angle of
'h':keyup(38);
'l':keyup(40);
end;
KeyUp(VK_Right);
end
Else
begin
case angle of
'h':keyup(38);
'l':keyup(40);
end;
KeyUp(VK_Left);
end;
End;
procedure AWalk2(Angle, Radius:integer; Color: string);
var
awx, awy, tout, Temp, Radius2, x1, y1 : Integer;
TempAngle, CurrentMinimapAngle : extended;
CompassBool : Boolean;
begin
Radius2 := Radius;
If (Radius = 0)or(Radius2 = 0)or(Radius > 57)or(Radius2 > 57)then
Radius2 := 57;
repeat
Temp := 0;
tout := tout + 1;
TempAngle := Angle;
CurrentMinimapAngle :=DetectRS2MinimapAngle(CompassBool);
// If (CurrentMinimapAngle = -1)Then
// begin
// Writeln('Minimap not Found!');
// Exit;
// end;
CurrentMinimapAngle := 360 - CurrentMinimapAngle * (180 / Pi);
TempAngle := TempAngle - CurrentMinimapAngle;
X1 := Round ( Radius2 * Sin (TempAngle * Pi / 180)) + 648;
Y1 := Round (- Radius2 * Cos (TempAngle * Pi / 180)) + 84;
Mouse(x1-2, y1-2, 4, 4, True);
wait(500);
if (FlagPresent=false) then
begin
repeat
Mouse(x1-2, y1-2, 4, 4, True);
Wait(500);
tout := tout + 1;
until (FlagPresent) or (findsymbol(awx, awy,color)) or (Tout > 20);
if (tout > 20) then
begin
writeln('AWalk2 by Starblaster100 - Could not Click!');
logout;
end;
end;
repeat
Wait(250);
Temp := Temp + 1;
until not(FlagPresent)or(Temp > 29)
// if(Color = 0)then
// Exit;
awx := 648;
awy := 84;
until (findsymbol(awx, awy,color)) or (Tout > 20);
end;
{*******************************************************************************
procedure QuickFixBank;
By: Boreas
Description: Just what it sounds like.
*******************************************************************************}
procedure QuicklyFixBank;
begin
if Bankscreen then
begin
if (GetColor(475, 75) = 1777699) then
begin
writeln('Quickly fixing bank');
mouse(470+random(482-470),76+random(83-76),0,0,true);
end;
end;
end;
procedure waittilstill;
var
points: array [0..17] of tpoint;
color: array [0..17] of integer;
oldcolor: array [0..17] of integer;
gh,hg,same: integer;
begin
points[1].x:=600
points[1].y:=30
points[2].x:=630
points[2].y:=30
points[3].x:=660
points[3].y:=30
points[4].x:=690
points[4].y:=30
points[5].x:=600
points[5].y:=60
points[6].x:=630
points[6].y:=60
points[7].x:=660
points[7].y:=60
points[8].x:=690
points[8].y:=60
points[9].x:=600
points[9].y:=90
points[10].x:=630
points[10].y:=90
points[11].x:=660
points[11].y:=90
points[12].x:=690
points[12].y:=90
points[13].x:=600
points[13].y:=120
points[14].x:=630
points[14].y:=120
points[15].x:=660
points[15].y:=120
points[0].x:=690
points[0].y:=120
gh:=17;
repeat
wait(50);
gh:=gh+1;
hg:=(gh mod 16);
oldcolor[hg]:=color[hg];
color[hg]:=getcolor(points[hg].x,points[hg].y);
if (color[hg]=oldcolor[hg]) then same:=same+1;
if not(color[hg]=oldcolor[hg]) then same:=0;
until same>=10;
end;
function FindObjb(var cx, cy: Integer; Text: String; color, tolerance: Integer): Boolean;
var
x, y, a, c, i, x1, y1, x2, y2: Integer;
begin
if (FindMSColorTol(x, y, color, tolerance)) then
begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if (not (Loggedin)) then
break;
a := a + 1;
if (a = 1) then
c := c + 1;
if (a = 3) then
c := c + 1;
for i := 1 to c do
begin
if (a = 1) then
begin
x1 := x1 + 30;
x2 := x2 + 30;
end;
if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
end;
if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
end;
if (a = 4) then
begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
if (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
if (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
if (x2 > 515) then
Break;
if not(bankscreen) then
if (FindColorTolerance(x, y, color, x1, y1, x2, y2, tolerance)) then
begin
if not(bankscreen) then
MMouse(x, y, 0, 0)
cx := x; cy := y;
if not(bankscreen) then
if (IsUpText(Text)) then
begin
Result := True;
Break;
end;
end;
end;
if (a = 4) then
a := 0;
if(bankscreen) then result:=true;
until (x2 > 515) or (Result = True);
end;
end;
procedure bankage;
begin
if not(loggedin) then terminatescript;
//if not(bankscreen) then
//begin
//players[currentplayer].loc:='findbank';
//exit;
//end;
quicklyfixbank;
depositall;
MouseBox(83,68,102,84,2);
wait(200+random(100));
clickoption('All',1);
repeat
wait(100);
until invfull;
closebank;
end;
procedure findfairy;
begin
symbolfinder(x,y,'bank');
mouse(x,y,5,5,true);
angledir('l','n');
waittilstill;
repeat
if not(bankscreen) then
//FindColorTolerance(x,y,528463,msx1,msy1,msx2,msy2,30);
findobjb(x,y,'ank',528463,30);//n
//getmousepos(x,y);
if not(bankscreen) then
mouse(x,y,0,0,false);
if not(bankscreen) then
wait(200+random(50));
if not(bankscreen) then
mouse(x,y+36+random(10),20,0,true);
//clickoption420 131 175 44 130 166 176
if not(bankscreen) then
wait(1000+random(500));
until bankscreen;
end;
procedure walktoaltar;
begin
awalk2(190,60,'water');
symbolfinder(x,y,'water');
mouse(x,y,5,5,true);
waittilstill;
waittilstill;
if not( findsymbol(x,y,'transportation')) then
mousebox(632,125,666,144,1);
waittilstill;
if findsymbol(x,y,'transportation') then
mouse(x,y,5,5,true);
waittilstill;
awalk2(230,50,'short cut');
wait(100);
//symbolfinder(x,y,'short cut');
//mouse(x,y,5,5,true);
waittilstill;
wait(100);
waittilstill;
mousebox(632,125,666,144,1);
symbolfinder(x,y,'short cut');
mouse(x,y,5,5,true);
waittilstill;
waittilstill;
mousebox(632,125,666,144,1);
wait(10000);
waittilstill;
symbolfinder(x,y,'short cut');
mouse(x,y,5,5,true);
waittilstill;
waittilstill;
mousebox(632,125,666,144,1);
wait(10000);
waittilstill;
waittilstill;
mousebox(632,125,666,144,1);
wait(10000);
waittilstill;
end;
procedure enteraltarr;
begin
waittilstill;
repeat
mousebox(128,112,456,306,0);
until isuptext('nter');
getmousepos(x,y);
mouse(x,y,0,0,true);
end;
begin
setupsrl;
filename:=tehfilename;
SetUpplayers;
CurrentPlayer := 0;
ActivateClient;
LoginPlayer;
// loaddtms;
findfairy;
bankage;
walktoaltar;
enteraltarr;
{
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars); // Screenname for FIRST Player in case of already loggedin.
MakeCompass('n');
GetDraynorColors;
repeat
SetChat('on',1);
SetChat('off',2);
SetChat('off',3);
FixChat;
SetChat('on',1); //* Call twice, Sometimes "misses" it the first time.
if Loggedin then
begin
Findfairy;
bankage;
WalkToAltar;
OpenAltar;
WalktoBank;
end;
if ((LoggedIn) and (Players[CurrentPlayer].Banked mod Loads = 0)) then
begin
SetChat('off',1);
repeat
Wait(10000);
until(not(LoggedIn));
wait((5+random(2))*60*1000);
loginplayer;
end;
if (Not(Loggedin)) then
begin
NextPlayer(False);
MakeCompass('n');
end;
until(False);
}
end.