HarryJames
2011-03-27 16:26:10
2 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Well for starters I know Java, some C++, Python, Psuedocode (:3), I suppose know I also know some Pascal.
Hells yeah for almost mastering Psuedocode?
Are you a member of any other communities?
I'm semi-active at;
www.Techious.com
Tell us about yourself…
From: HarryJames
So my name's Harry, which you could probably have guessed. I'm 16, soon to be 17 and I do a lot of coding and a fair bit of gaming when I'm not in 6thForm. Even when I'm in 6thForm I do some coding, cause I'm sad like that.
Runescape is not a big interest of mine, however developing bots to get past the challenges they present is. I like doing coding challenges. Often, when learning a new language I will complete around 10 of these challenges (atleast) before trying something of my own.
http://projecteuler.net/index.php?section=problems
Please show us one (or multiple) of your scripts.
[code]program DraynorWillows;
{$DEFINE SMART}
{$i SRL/SRL.scar}
{$i Reflection/Reflection.simba}
{$i SRL/SRL/Skill/Magic.scar}
{$i SRL/SRL/Misc/stats.simba}
Procedure DeclarePlayers;
Begin
HowManyPlayers:= 1; // How Many Players will you be using?
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
Member := False;
Integers[0] := 8000; // Fish to Catch
End;
{
with Players[1] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
Member := False;
Integers[0] := 8000; // Fish to Catch
End;
}
End;
Const
SRLStats_Username = '';
SRLStats_Password = '';
MOUSE_SPEED = 15;
MOUSE_SPEED_RANDOMNESS = 7;
{ Breaks }
TakeBreaks = True; // Do you want to take breaks?
BreakAfter = 30; // How often do you want breaks?
BreakFor = 2; // How long do you want to break?
var
Cooking : Boolean;
CaughtHerring, CookedHerring, CaughtSardine, CookedSardine, TimeUntilBreak, BreakRounds, TotalBreaks : Integer;
tmp : TInvItem;
Function HaveNeededItems( Which : Integer) : Boolean;
Begin
if not LoggedIn Then
LoginPlayer;
Case Which of
0: Result := R_ItemExists(590, tmp); // Tinderbox
1: Result := R_ItemExists(307, tmp); // Fishing R
2: Result := R_ItemExists(313, tmp); // Fishing B
End;
End;
Procedure anyAntiban;
Begin
case (Random(12)) of
1: BoredHuman;
2: RandomMovement;
3: PickUpMouse;
4: GameTab(23); // Stats
5: GameTab(25); // Inv
6: Begin
GameTab(26); // Equipped
wait(500 + Random(600));
GameTab(23);
End;
7: ExamineInv;
8: RandomAngle(false);
9: RandomAngle(true);
10: RandomRClick;
11: GameTab(21 + Random(9));
12: wait (Random(15000));
end;
End;
Function CountInvItem( Counting : Integer ) : Integer;
var
i : Integer;
NumberOf : TIntegerArray;
Inv : TInvItem;
Begin
SetLength(NumberOf, 3);
For i := 1 to 28 do
Begin
Inv := GetInvItemAt(i);
Case Inv.ID Of
313 : NumberOf[0] := Inv.StackSize; // bait
345 : Inc(NumberOf[1]);// herring
327 : Inc(NumberOf[2]);// sardine
End;
End;
Case Counting of
0 : Result := NumberOf[0];
1 : Result := NumberOf[1];
2 : Result := NumberOf[2];
End;
End;
Procedure Proggy;
var
FishCaught, exp : Integer;
Begin
FishCaught := CaughtHerring + CaughtSardine;
exp := (CaughtHerring * 30) + (CaughtSardine * 20);
Writeln('[report]');
Writeln('|--------- HarryJames ---------|');
Writeln('|------FisherCookerBanker------|');
Writeln('|==============================|');
Writeln( Padr('|', 31) + '|');
Writeln( Padr('| Character: ' + Players[currentPlayer].Name , 31) + '|');
Writeln( Padr('| Running Time: ' + MsToTime(GetTimeRunning, Time_short), 31) + '|');
Writeln( Padr('| Herring: ' + ToStr(CaughtHerring), 31) + '|');
Writeln( Padr('| Sardine: ' + ToStr(CaughtSardine), 31) + '|');
Writeln( Padr('| Fish Caught: ' + ToStr(FishCaught) + '/' + ToStr(Players[currentPlayer].Integers[0]), 31) + '|');
Writeln( Padr('| EXP Earned: ' + ToStr(exp), 31) + '|');
Writeln( Padr('| Bait remaining: ' + ToStr(CountInvItem(0)), 31) + '|');
if (TotalBreaks > 0) then
Writeln( Padr('| Taken ' + ToStr(TotalBreaks) + ' breaks.', 31) + '|');
Writeln( Padr('|', 31) + '|');
Writeln('|------------------------------|');
Writeln('[/report]');
Stats_Commit;
End;
Procedure Antiban(where : String);
Begin
Case where of
'fishing' : Begin
case (Random(30)) of
1 .. 5: anyAntiban;
6: HoverSkill('Fishing', false);
End;
End;
'moving' : Begin
case (Random(2)) of
1: anyAntiban;
End;
End;
'bank' : Begin
case (Random(2)) of
1: anyAntiban;
End;
End;
'cooking' : Begin
case (Random(6)) of
1..5: anyAntiban;
6: HoverSkill('Cooking', false);
end;
End;
'' : Begin // More of a fail safe than anything :)
Case (Random(4)) of
1: anyAntiban;
End;
End;
End;
End;
Procedure Deathwalk;
var
Path : TTileArray;
Begin
Path := [
Tile(3223, 3219),
Tile(3223, 3219),
Tile(3222, 3223),
Tile(3212, 3231),
Tile(3203, 3229),
Tile(3200, 3219),
Tile(3189, 3220),
Tile(3185, 3220),
Tile(3179, 3218),
Tile(3166, 3217),
Tile(3158, 3225),
Tile(3147, 3229),
Tile(3141, 3229),
Tile(3128, 3232),
Tile(3115, 3237),
Tile(3108, 3236),
Tile(3104, 3235),
Tile(3099, 3235)];
WalkPath(path);
End;
Procedure lost;
Begin
if ValidNPC('Nastroth') then
Begin
Writeln('Oh noes, we died!');
SetRun(True);
DeathWalk;
End;
if (DistanceFrom(Tile(3086,3230)) > 25) then
Begin
writeln('We''re lost!');
GameTab(Tab_Magic);
Cast('lumbridge home teleport', False);
wait(10000);
DeathWalk;
End;
End;
Procedure Fish;
var
FishingSpot : TPoint;
FishSpot : TNPC;
Begin
If Not HaveNeededItems(2) Then
Begin
Writeln('I think that the player has no bait :(');
Nextplayer(false);
End;
lost;
If FindNPC('Fishing spot', FishSpot) Then
FishingSpot := TileToMS(FishSpot.RealTile, 0);
If not FindNPC('Fishing spot', FishSpot) Then
Begin
WalkToTile(Tile(3086,3227), 0, 0);
r_flag;
FishingSpot := TileToMS(FishSpot.RealTile, 0);
End;
MMouse(FishingSpot.x, FishingSpot.y, 7, 7)
If ( R_IsUpText('ish') ) Then
Begin
Mouse(FishingSpot.x, FishingSpot.y, 0, 0, False);
r_WaitOption('ait', 900);
End;
wait(1000 + Random(400)); // To compensate for lag
While (GetSpeed <> 0) do
wait(333); // Wait while we're moving to the fishing spot if it's a few tiles away
wait(500); // For the gap between stopping and getting the Fishing rod out
While not ( GetAnimation = -1 ) Do
Begin
Antiban('fish');
R_FindRandoms;
wait(333);
End;
End;
Procedure Cook;
var
ourFire : TRSObject;
FirePoint : TPoint;
Begin
// Make Fire
R_ClickItemBy('Tinderbox', True, '');
//Wait(50+Random(100));
R_ClickItemBy('logs', True, '');
wait(1000); // To compensate for lag of the animation not happening yet
While not ( GetAnimation = -1 ) do wait(333);
// Start Cooking the fish
Begin
Begin
ourFire := GetObjectByID(2732, OBJECT_TYPE_INTERACTABLE, 1);
FirePoint := TileToMS(ourFire.Tile, 0);
R_ClickItemBy('raw', True, '');
Wait(50+Random(100));
Mouse(FirePoint.x, FirePoint.y, 0, 0, True);
Wait(300 + Random(700));
If ValidInterface(137) then
Begin
MMouse(250, 425, 15, 15);
if WaitUpText('ll', 400+Random(200)) then
Mouse(250, 425, 0, 0, true);
End;
End;
End;
End;
Procedure Bank;
Begin
Antiban('bank');
lost;
R_FindRandoms;
CaughtHerring := CaughtHerring + CountInvItem(1);
CaughtSardine := CaughtSardine + CountInvItem(2);
if R_OpenBankBooth('db') then
Begin
if (PinScreen) then
InPin(Players[CurrentPlayer].Pin);
Wait(150 + Random(50));
if (BankScreen) then
R_DepositAllButEx([590,313,307]);
End;
if (BankScreen) then
CloseBank;
End;
Procedure WalkTo(loc : String);
Begin
lost;
case loc of
'bank' : begin
if (DistanceFrom(Tile(3092,3243)) > 3) then
WalkToTile(Tile(3092,3243), 2, 0);
r_flag;
end;
'fish' : begin
if (DistanceFrom(Tile(3086,3230)) > 3) then
WalkToTile(Tile(3086,3230), 2, 0);
r_flag;
end;
'cook' : begin
if (DistanceFrom(Tile(3088,3243)) > 3) then
WalkToTile(Tile(3088,3243), 0, 0);
r_flag;
end;
'treeN' : begin
if (DistanceFrom(Tile(3082,3242)) > 3) then
WalkToTile(Tile(3082,3242), 0, 0);
r_flag;
end;
'treeW' : begin
if (DistanceFrom(Tile(3082,3232)) > 3) then
WalkToTile(Tile(3082,3232), 2, 0);
r_flag;
end;
End;
End;
{*******************************************************************************
function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
By: Echo_
Description: Takes brakes according to the minute values entered
*******************************************************************************}
Function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
var
w,x,y,z,y2: Integer;
begin
if not LoggedIn then Exit;
w := (BreakIn * 60000);
x := (BreakFor * 60000);
y := RandomRange(-randBreakIn * 60000, randBreakIn * 60000);
z := RandomRange(-randBreakFor * 60000, randBreakFor * 60000);
y2 := RandomRange(-randBreakIn,randBreakIn);
if (HowManyPlayers = 1) then
begin
TimeUntilBreak := ((BreakIn+y2)-(GetTimeRunning/60000));
if (GetTimeRunning < ((w) + (y) + BreakRounds)) then Exit
else
if (GetTimeRunning > ((w) + (y) + BreakRounds)) then
begin
if (PinScreen) Then
ClosePinScreen;
if (BankScreen) then
CloseBank;
Writeln('Taking a break for about ' + IntToStr(BreakFor) + ' minutes.');
Logout;
Wait((x) + (z));
Writeln('Logging in.');
LoginPlayer;
Result := LoggedIn;
FindNormalRandoms;
IncEx(BreakRounds, (w) + (x));
IncEx(TotalBreaks, 1);
Writeln('The next break will occur in about ' + IntToStr(BreakIn) + ' minutes.');
end;
end;
end;
Procedure GetSomeWood;
Var
WoodcuttingLevel, FiremakingLevel: Integer;
OurTree : TRSObject;
TreePoint : TPoint;
Begin
WoodcuttingLevel := R_GetSkillLevel(Skill_Woodcutting);
FiremakingLevel := R_GetSkillLevel(Skill_Firemaking);
// if ( (WoodcuttingLevel < 30) or (FiremakingLevel < 30) ) then
Begin
WalkTo('treeN');
OurTree := GetObjectByID(1278, OBJECT_TYPE_INTERACTABLE,10);
TreePoint := TileToMS(OurTree.Tile, 0);
Mouse(TreePoint.x, TreePoint.y, 0, 0, True);
wait(600 +Random(400));
While not ( GetAnimation = -1 ) do wait(333);
// End else;
// Begin
// WalkTo('treeW');
End;
End;
Procedure Startup;
Begin
if (HaveNeededItems(0)) then
cooking := True;
if not (HaveNeededItems(1)) then
Begin
writeln('You don''t have a Fishing Rod.');
NextPlayer(false);
TerminateScript;
End;
if not (HaveNeededItems(2)) then
Begin
writeln('You don''t have any Fishing Bait.');
NextPlayer(false);
TerminateScript;
End;
MouseSpeed := MOUSE_SPEED + Random(MOUSE_SPEED_RANDOMNESS);
SetAngle(true);
End;
Procedure MakePath;
var
me:TMe;
i:Integer;
Begin
writeln('Path := [');
For i := 1 to 100 do
Begin
Me := GetMe;
writeln('Tile(' + ToStr(Me.Tile.X) + ', ' + ToStr(Me.Tile.Y) + '), ');
wait(3500);
End;
End;
Procedure MainLoop;
Begin
//GetSomeWood;
lost;
WalkTo('fish');
While not (invFull) do Fish;
stats_IncVariable('Sardines Caught', CountInvItem(2));
stats_IncVariable('Herring Caught', CountInvItem(1));
//WalkTo('cook');
//Cook;
//stats_IncVariable('Sardines Cooked', (CookedSardine - last[0]));
//stats_IncVariable('Herring Cooked', (CookedSardine - last[0]));
WalkTo('bank');
Bank;
Proggy;
End;
Begin
Smart_Server := 34;
Smart_SuperDetail := False;
SetupSRL;
if not(SRLStats_Username = '') then
SetupSRLStats(85, SRLStats_Username, SRLStats_Password);
if (SRLStats_Username = '') then
SetupSRLStats(85, 'HJPublic', 'qwerty123');
DeclarePlayers;
LoginPlayer;
Writeln('Waiting Two seconds, just incase you lag.');
wait(1500);
Startup;
repeat
While ((CaughtHerring + CaughtSardine) < Players[currentPlayer].Integers[0]) do
Begin
if TakeBreaks then BreakHandler(BreakAfter, BreakFor,5, 2);
MainLoop;
End;
until(PlayersActive = 0)
End.[/code]