crapkiller
2007-04-14 19:38:31
This is my 4th SRL script.
NOTE: thx town for telling me bout BankScreen
Start in falador logged in or out doesn't matter. Fill out the 2 colors and the player nick and stuff. Then hit run.
NOTE: This is my first time trying to indent. Can any one who knows tell me if i indented wrong. Thanks.
Please rate out of 10? (Please keep in mind this is only my 4th SRL script.)(second to even partially work lol)
EDIT:I changed the indenting, Is it right this time? And i also made the bitmaps smaller :p
NOTE: thx town for telling me bout BankScreen
Start in falador logged in or out doesn't matter. Fill out the 2 colors and the player nick and stuff. Then hit run.
NOTE: This is my first time trying to indent. Can any one who knows tell me if i indented wrong. Thanks.
program New;
{.include SRL\SRL.scar}
// Thanks to Nielsie95 for helping me get the road colors =D
Const
GPColor = 2149883; //The color of the coins in your bank
BankSymbolColor = 5691881; // The color of the bank symbol on the MiniMap(this is a failsafe)
Var mage, Bankx, Banky, Eyes, Loads, Gp :integer;
Var Lost :Boolean;
Procedure DeclarePlayers;
begin
HowManyPlayers := 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := ''; //3 - 4 letters of YOUR username, example: zima
Players[0].Active := True;
Players[0].Integer1 := 100; //Amount of loads
Players[0].String1 := 'Mining'; //What skill to pick for lamp
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := ''; //3 - 4 letters of YOUR username, example: zima
Players[1].Active := True;
Players[1].Integer1 := 100; //Amount of loads
Players[1].String1 := 'Mining'; //What skill to pick for lamp
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := ''; //3 - 4 letters of YOUR username, example: zima
Players[2].Active := True;
Players[2].Integer1 := 100; //Amount of loads
Players[2].String1 := 'Mining'; //What skill to pick for lamp
end;
Procedure LoadBmps;
begin
mage := BitmapFromString(38, 15, 'z78DAD5964B0A80300C44AF54' +
'4D11DD6BEF7F244137959861623FD42EB28821CC6B3E35AE7288A' +
'4B4AD53BA6DBC3CDA3E62B618240E610DB5587FB80E15330E29C1' +
'9BEBD7D5D45F076584BC9A02DB9E8C1F6784E843C66329615479E' +
'343761C798879CC335B8CDAAFE32D55DE7826CFCB6D54DA397C6F' +
'B7F65B7D5BC2C8D4E5C78C4EF6FF32329BB9456F3B7657A6F331A' +
'DC64B8A63023C785B62163E8FB5732ADBE277B0F2FBDB8251F312' +
'FFBD9D1817D9656E4E0DE717F764850ADE8C1D49F9C92DE9C613C' +
'E97D9EB');
end;
Procedure AntiRandoms;
begin
FindNormalRandoms;
FindLamp(Players[CurrentPlayer].String1);
end;
Procedure StartBank;
begin
Bankx := 105 + random(5);
Banky := 175 + random(5);
repeat
MMouse(Bankx, Banky, 5, 5);
Banky := Banky + 10;
Wait(100);
If (Banky > 363) then
begin
Bankx := Bankx + 50;
Banky := 175;
end;
Until(IsUpText('Bank booth') = True);
Mouse(Bankx, Banky, 1, 1, False);
Wait(1000+Random(500));
ClickOption('Use-quickly', 1);
repeat
Wait(500);
until(BankScreen);
FindColorTolerance(x, y, GPColor, 69, 63, 465, 294, 10);
Mouse(x, y, 1, 1, False);
wait(100+random(100));
ClickOption('Withdraw X', 1);
wait(1000+random(200));
TypeSend('1000');
Wait(200+random(500));
CloseBank;
end;
Procedure Walk2Shop;
begin
PerfectNorth;
Setrun(True);
If(Not(RadialRoadWalk(FindFallyRoadColor, 270, 180, 50, 1, 1)))then
begin
Mouse(MMCX-20, MMCY+40, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(FindFallyRoadColor, 200, 160, 50, 1, 1)))then
begin
Mouse(MMCX, MMCY+50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(FindFallyRoadColor, 200, 160, 50, 1, 1)))then
begin
Mouse(MMCX+10, MMCY+50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
FindRoadColor;
If(Not(RadialRoadWalk(RoadColor, 90, 200, 50, 1, 1)))then
begin
Mouse(MMCX, MMCY+50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(RoadColor, 120, 200, 50, 1, 1)))then
begin
Mouse(MMCX, MMCY+50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(RoadColor, 120, 200, 50, 1, 1))) then
begin
Mouse(MMCX+20, MMCY+50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(RoadColor, 120, 200, 50, 1, 1))) then
begin
Mouse(MMCX+20, MMCY+50, 5, 5, True);
Flag;
FindSymbol(x, y, 'magic shop');
Mouse(x, y, 1, 1, True);
Flag;
repeat
FindColorTolerance(x, y, 3801403, 0, 0, 492, 324, 5);
MMouse(x, y, 1, 1);
Wait(100+random(100));
until(IsUpText('Betty') = True);
Mouse(x, y, 1, 1, False);
Wait(100+random(200));
ClickOption('Trade', 1);
repeat
Wait(500);
x := x + 1;
If(x = 20) then
begin
repeat
FindColorTolerance(x, y, 3801403, 0, 0, 492, 324, 5);
MMouse(x, y, 1, 1);
Wait(100+random(100));
until(IsUpText('Betty') = True);
Mouse(x, y, 1, 1, False);
Wait(100+random(200));
ClickOption('Trade', 1);
end;
until(FindBitmap(mage, x, y) = True);
exit;
end;
AntiRandoms;
Flag;
RadialRoadWalk(RoadColor, 90, 180, 50, 1, 1);
Flag;
AntiRandoms;
RadialRoadWalk(RoadColor, 220, 180, 50, 1, 1);
Flag;
AntiRandoms;
RadialRoadWalk(RoadColor, 270, 180, 50, 1, 1);
Flag;
AntiRandoms;
FindSymbol(x, y, 'magic shop');
Mouse(x, y, 1, 1, True);
Flag;
repeat
FindColorTolerance(x, y, 3801403, 0, 0, 492, 324, 5);
MMouse(x, y, 1, 1);
Wait(100+random(100));
until(IsUpText('Betty') = True);
Mouse(x, y, 1, 1, False);
Wait(100+random(200));
ClickOption('Trade', 1);
repeat
Wait(500);
x := x + 1;
If(x = 20) then
begin
repeat
FindColorTolerance(x, y, 3801403, 0, 0, 492, 324, 5);
MMouse(x, y, 1, 1);
Wait(100+random(100));
until(IsUpText('Betty') = True);
Mouse(x, y, 1, 1, False);
Wait(100+random(200));
ClickOption('Trade', 1);
end;
until(FindBitmap(mage, x, y) = True);
end;
Procedure Buy;
begin
FindColorTolerance(x, y, 11737620, 0, 0, 515, 334, 10);
Mouse(x, y, 1, 1, False);
ClickOption('Buy 10', 1);
Wait(100+random(200));
Mouse(x, y, 1, 1, False);
ClickOption('Buy 10', 1);
Wait(100+random(200));
Mouse(x, y, 1, 1, False);
ClickOption('Buy 10', 1);
Wait(100+random(200));
Mouse(485, 40, 1, 1, True);
end;
Procedure Walk2Bank;
begin
FindRoadColor;
If(Not(RadialRoadWalk(RoadColor, 0, 90, 50, 1, 1)))then
begin
Mouse(MMCX+30, MMCY-50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(RoadColor, 300, 390, 50, 1, 1)))then
begin
Mouse(MMCX-40, MMCY-50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(RoadColor, 270, 390, 50, 1, 1)))then
begin
Mouse(MMCX-50, MMCY, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(RoadColor, 300, 390, 50, 1, 1)))then
begin
Mouse(MMCX, MMCY-50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(RoadColor, 300, 390, 50, 1, 1)))then
begin
Mouse(MMCX, MMCY-50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
RadialRoadWalk(RoadColor, 300, 390, 50, 1, 1);
Flag;
AntiRandoms;
RadialRoadWalk(RoadColor, 300, 390, 50, 1, 1 );
Flag;
AntiRandoms;
If(Not(RadialRoadWalk(FindFallyRoadColor, 330, 370, 50, 1, 1)))then
begin
Mouse(MMCX, MMCY-50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(FindFallyRoadColor, 330, 370, 50, 1, 1)))then
begin
Mouse(MMCX, MMCY-50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(RadialRoadWalk(FindFallyRoadColor, 330, 370, 50, 1, 1)))then
begin
Mouse(MMCX, MMCY-50, 5, 5, True);
Flag;
end;
AntiRandoms;
Flag;
If(Not(FindSymbol(x, y, 'bank')))then
begin
If(Not(FindColorTolerance(x, y, 5691881, MMX1, MMY1, MMX2, MMY2, 10)))then
begin
Lost := True;
Exit;
end;
end;
Mouse(x, y, 1, 1, True);
Flag;
end;
Procedure EndBank;
begin
Bankx := 105 + random(5);
Banky := 175 + random(5);
repeat
MMouse(Bankx, Banky, 5, 5);
Banky := Banky + 10;
Wait(100);
If (Banky > 363) then
begin
Bankx := Bankx + 50;
Banky := 175;
end;
Until(IsUpText('Bank booth') = True);
Mouse(Bankx, Banky, 1, 1, False);
Wait(1000+Random(500));
ClickOption('Use-quickly', 1);
repeat
Wait(500);
Until(BankScreen);
FindColorTolerance(x, y, 11737620, 559, 209, 625, 230, 10);
Mouse(x, y, 5, 5, False);
PopUp('Store All');
Wait(200+random(500));
FindColorTolerance(x, y, GPColor, 559, 209, 625, 230, 10);
Mouse(x, y, 5, 5, False);
PopUp('Store All');
Wait(200+random(500));
CloseBank;
end;
Procedure ProggyReport;
begin
Eyes := Loads * 28;
Gp := Eyes * 3;
Writeln('----------Crapkillers Eye of Newt Buyer----------');
Writeln('Worked for ' + TimeRunning);
Writeln('Bought ' + IntToStr(Loads) + ' Loads of Eyes');
Writeln('Bought About ' + IntToStr(Eyes) + ' Eye of Newts');
Writeln('Spent about ' + IntToStr(Gp) + ' Coins');
Writeln('-------------------------------------------------');
SRLRandomsReport;
end;
begin
SetupSRL;
DeclarePlayers;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
LoginPlayer;
Lost := False;
ActivateClient;
Wait(3000);
PerfectNorth;
LoadBmps;
repeat
repeat
PerfectNorth;
AntiRandoms;
StartBank;
Walk2Shop;
If(Lost = True) then Break;
Buy;
Walk2Bank;
If(Lost = True) then Break;
EndBank;
Loads := Loads + 1;
ProggyReport;
until(Loads = Players[CurrentPlayer].Integer1);
If(Lost = True) then
begin
Writeln(Players[CurrentPlayer].Name + ' is lost, switching to next player...');
NextPlayer(False);
end;
If(Lost = False) then
begin
Writeln(Players[CurrentPlayer].Name + ' has finished his/her loads, switching players...');
If(Players[CurrentPlayer].Active = True) then NextPlayer(True);
If(Players[CurrentPlayer].Active = False) then NextPlayer(False);
end;
until(False);
end.Please rate out of 10? (Please keep in mind this is only my 4th SRL script.)(second to even partially work lol)
EDIT:I changed the indenting, Is it right this time? And i also made the bitmaps smaller :p