owned1112
2007-10-07 11:57:33
This is my first script. The walking is REALLY buggy, but please comment. :)
edit: Recommended to start with compass east and highest angle.
edit: Recommended to start with compass east and highest angle.
program New;
{.include /SRL/SRL.scar}
{.include /SRL/SRL/skill/WoodCutting.scar}
var
x,y,i2,watercolor2,willowcolora,willowcolorb,willowcolorc:integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Loc := '';
Players[0].Active := True;
Players[0].Integers[1] := 0;
Players[0].Integers[2] := 30; //Loads to do before switching players
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
WillowColorA := 2319190;
WillowColorB := 2319190;
WillowColorC := 1791306;
end;
function AllPlayersInactive(number : integer) : boolean;
var thisi : integer;
thisi2 : integer;
begin;
thisi := 0;
thisi2 := 0;
for thisi := 0 to number do
begin;
if(Players[thisi].Active = True) then
begin;
Result:=False;
end else
begin;
thisi2:= thisi2 +1;
if(thisi2=number) then
result:=true;
end;
end;
end;
procedure Proggy;
begin;
writeln('Player: ' + Players[CurrentPlayer].name);
writeln('Chopped approximately: ' + inttostr(Players[CurrentPlayer].Integers[1]) + ' willows');
end;
function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;
procedure FindRandoms;
begin;
if not loggedin then exit;
FindFastRandoms;
FindNormalRandoms;
end;
procedure Chop;
begin;
if not loggedin then exit;
if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
findcolor(x,y,willowcolorB,0,0,1400,1400) or
findcolor(x,y,willowcolorC,0,0,1400,1400) then
begin;
disguise('Chopping...')
MMouse(x,y,3,3);
if isuptext('hop') then
begin;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
Flag;
wait(4000 + random(1000));
end else
begin;
i2 := 0;
while(i2 < 39) do
begin;
if findcolortolerance(x,y,WillowcolorA,0,0,1400,1400,25) or
findcolortolerance(x,y,willowcolorB,0,0,1400,1400,25) or
findcolortolerance(x,y,willowcolorC,0,0,1400,1400,25) then
begin;
MMouse(x,y,1,1);
if isuptext('hop') then
begin;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
Flag;
end;
end else
wait(4000 + random(1000));
end;
end;
end else
i2 := i2 + 1;
if(i2 = 39) then
begin;
Players[currentplayer].loc := 'lost';
Players[currentplayer].active := False;
nextplayer(true);
end;
end;
procedure ToBank;
begin;
if not LoggedIn then exit;
disguise('Going to bank');
findsymbol(x,y,'bank');
Mouse(x,y,1,1,true);
Flag;
end;
procedure ToWillow;
begin;
if not loggedin then exit;
wait(1000 + random(50))
makecompass('E');
disguise('Going to willow')
HighestAngle;
watercolor2:=FindWaterColor;
if(findcolor(x,y,watercolor2,0,0,1400,1400)) then
begin;
wait(2000 + random(100));
mouse(x,y,1,1,true);
wait(100 + random(100));
Flag;
MakeCompass('E');
FindSymbol(x,y,'fish');
Mouse(x,y,1,1,true)
Flag;
end else
begin;
writeln('Cant find watercolor. Next Player.');
NextPlayer(true);
end;
end;
procedure BankWillows;
begin;
if not loggedin then exit;
disguise('Starting banking procedure')
if(invFull) then
begin;
ToBank;
Disguise('Opening bank and banking.')
OpenBankQuiet('db');
DepositAll;
MakeCompass('E');
Players[currentplayer].Integers[1] := Players[currentplayer].Integers[1] + 1;
if(Players[currentplayer].Integers[1] >= Players[currentplayer].Integers[2]) then
begin;
Proggy;
Players[currentplayer].Active := False;
nextplayer(true);
end;
end;
end;
begin
SetupSRL;
MouseSpeed:=10;
DeclarePlayers;
wait(1000 + random(50));
ActivateClient;
if not LoggedIn then LoginPlayer;
repeat
MakeCompass('E');
ToWillow;
FindRandoms;
repeat
if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
findcolor(x,y,willowcolorB,0,0,1400,1400) or
findcolor(x,y,willowcolorC,0,0,1400,1400) then
begin;
MMouse(x,y,1,1);
FindEnt(x,y,true)
end;
Chop;
FindRandoms;
until(invFull)
FindRandoms;
BankWillows;
until(AllPlayersInactive(1))
end.