EvilChicken!
2011-02-26 12:58:35
Says he's been coding for no more than three days, yet below I've attached his script. With all honesty I can say, that all the features he ultilizes in there took me much longer than three days to learn.
In addition to this, check out his other posts. He is extremely humble and seems very intelligent and tries his best to help and be useful.
What do you think?
{------------------------------------------------------------------------------}
{------------------------------------------------------------------------------}
{--------------------------Lumbridge Lobster Cooker v1.1-----------------------}
{-----------------------------------By: Yago-----------------------------------}
{------------------------------------------------------------------------------}
{--------------------Description: This Is A Lumbridge Cooker-------------------}
{------------------------------------------------------------------------------}
{-------Official Thread: http://villavu.com/forum/showthread.php?t=62594-------}
{------------------------------------------------------------------------------}
{Startup: Must Start In Lumbridge Bank With Nothing In Inventory And Have More-}
{--------------------Than One Raw Lobster In Your Inventory.-------------------}
{------------------------------------------------------------------------------}
{Other: This Is My First Script So Please Be Helpful By Criticizing Me & Giving}
{-------Me Tips And/Or Suggestions. Need Your Help To Make The Script Flawless.}
{------------------------------------------------------------------------------}
{---------P.S.:Took A Long Time To Make. Took Ideas From Other Scripts.--------}
{------------------------------------------------------------------------------}
Program LumbridgeCooker;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
Const
{---SMART Setup Constants---}
WORLD = 152;
MEMBERS = false;
SIGNED = true;
{---------------------------}
Const
//Global Constants.
Range = 1911503;
Range2 = 1977560;
Compass = 'N';
SetLobs = 999999999;
SetTime = 999999999;
{You Must Set The Amout Of Time To Run The Script Or The # Of Lobsters To Cook.
If Using Time Then Set Lobs To An Extremely High Number Like 999999999.
If Using Lobs Then Set Time To An Extremely High Number Like 999999999.
}
Var
//Global Variables.
RawLobDtm, CookedLobDtm, Time: Integer;
ToKitchen : TPointArray;
LobsPresent : Boolean;
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
{------------------------------------------------------------------}
With Players[0] Do
Begin
Name := ''; //Username Goes Here.
Pass := ''; //Password Goes Here.
Nick := ''; //3-4 Letters Of The Character Go Here.
Active := True;
Pin := ''; //Pin Goes Here. Leave Blank If You Have No Pin.
{------------------------------------------------------------------}
End;
End;
Procedure AntiBan;
Begin
Case Random(55) of
5: RandomRClick;
10: HoverSkill('Cooking', False);
15: HoverSkill('Cooking', False);
20: PickUpMouse;
25: RandomMovement;
30: BoredHuman;
35: ExamineInv;
40: MMouse(RandomRange(MSX1, MIX2), RandomRange(MSY1, MIY2), 0, 0);
45: MMouse(RandomRange(MSX1, MIX2), RandomRange(MSY1, MIY2), 0, 0);
50: MMouse(RandomRange(MSX1, MIX2), RandomRange(MSY1, MIY2), 0, 0);
55: MMouse(RandomRange(MSX1, MIX2), RandomRange(MSY1, MIY2), 0, 0);
End;
If Not (GameTab(25)) Then
Begin
WriteLn('The Current Game Tab Is ' + IntToStr(GetCurrentTab) + '.');
WriteLn('Switching To Game Inventory Tab (25).');
GameTab(25);
End;
WriteLn('Ran Procedure AntiBan.');
End;
Procedure AntiRandoms;
Begin
R_FindRandoms;
FindMod;
LampSkill := 'cooking';
LevelUp;
WriteLn('Ran Procedure AntiRandoms.');
End;
Procedure LoadDTMs;
Begin
If not (LoggedIn) Then
Exit;
Begin
WriteLn('Running Procedure LoadDTMs.');
RawLobDtm := DTMFromString('78DA6314636060106640018916720CFC409A1' +
'188FF83685E2021C3800698C0242394C7C801240408A8510212AC04D' +
'480DCA348408D2C9010C1AF0600C89202D5');
CookedLobDtm := DTMFromString('78DA6314656060106040018B02C519B880342' +
'310FF07D1B2408289010D400418A13C465520C14E408D04909023A08' +
'6074848115003B2870FBF1A000356030B');
End;
End;
Procedure PlayerStartup;
Begin
If Not (LoggedIn) Then
Exit;
MarkTime(Time);
WriteLn('Running Procedure Player Startup.');
If R_MakeCompass(Compass) Then
WriteLn('Compass is North.');
SetAngle(True);
WriteLn('Camara angle is at highest.');
SetRun(True);
WriteLn('Run is enabled (on).');
AntiRandoms;
End;
Procedure Maintenance;
Begin
If (RS_GetCompassAngleDegrees >= 10) Or (RS_GetCompassAngleDegrees <= 350) Then
Begin
WriteLn('Fixing Compass.');
If R_MakeCompass(Compass) Then
Begin
WriteLn('Compass is North.');
SetAngle(True);
WriteLn('Camara angle is at highest.');
End
Else
Begin
WriteLn('Failed To Fix The Compass.');
End;
End
Else
Begin
WriteLn('Compass is Fine.');
End;
End;
Procedure Bank;
Var
X, Y, V, W: Integer;
Begin
If Not (LoggedIn) Then
Exit;
Begin
WriteLn('Running Procedure Bank.');
AntiRandoms;
R_OpenBankBooth('LB');
Wait(500 + Random(300));
If (R_BankScreen) Then
Begin
WriteLn('Bank Screen Is Open.');
Wait(1000);
R_DepositAll(True);
If R_InvEmpty Then
Begin
WriteLn('The Inventory Is Empty.');
If FindDTM(RawLobDtm, X, Y, MBX1, MBY1, MBX2, MBY2) Then
Begin
WriteLn('Found Raw Lobster DTM In Bank.');
MMouse(X, Y, RandomRange(-2,2), RandomRange(-2,2));
Wait(500);
ClickMouse2(False);
R_ChooseOption('ithdraw-Al');
If (InvCount > 1) Then
Begin
WriteLn('Withdrew Items.');
If FindDTM(RawLobDtm, V, W, MIX1, MIY1, MIX2, MIY2)then
Begin
WriteLn('Found Raw Lobster DTM in Inventory.');
Wait(500 + Random(300));
AntiBan;
AntiRandoms;
End
Else
Begin
WriteLn('Could Not Find/Withdraw Raw Lobsters.');
End;
End;
End
Else
Begin
WriteLn('Could Not Find/Withdraw Raw Lobsters.');
LobsPresent := False;
End
End
Else
Begin
WriteLn('Could Not Deposit All The Items In The Inventory.');
End;
End
Else
Begin
WriteLn('The Bank Screen Is Not Open.');
End;
End;
End;
Procedure Walk(I: Integer);
Var
PlayerPosition: TPoint;
Position: String;
Begin
ToKitchen := [Point(3206, 3208), Point(3212, 3215), Point(3210,3219), Point(3205,3208)];
WriteLn('Running Procedure Walk(' + IntToStr(I) + ').');
Begin
Wait(500 + Random(300));
If (TileOnMM(ToKitchen[I])) then
Begin
WriteLn('The Point ' + ToStr(ToKitchen[I]) + ' Is On The Minimap.');
If(WalkToTile(ToKitchen[I], 0, 0))Then
Begin
WriteLn('Walking to Point ' + ToStr(ToKitchen[I]) + '.');
PlayerPosition := GetMyPos;
Position := ToStr(PlayerPosition);
WriteLn('Location = ' + Position + '.');
End
Else
Begin
WriteLn('Could Not Walk To Point ' + ToStr(ToKitchen[I]) + '.');
End;
End
Else
Begin
WriteLn('The Point ' + ToStr(ToKitchen[I]) + ' Is Not On The Minimap.');
End;
End;
End;
Procedure Staircase(Route: String);
Var
Sc: TPoint;
Which: String;
Begin
WriteLn('Running Staircase(' + Route + ').');
Begin
If (Route = 'Up') Then
Begin
Which := 'Bottom-Floor';
End
Else
Begin
Which := 'Top-Floor';
End;
End;
Sc := TileToMS(ToKitchen[3], 1);
WriteLn('Floor Variable Set To Point' + ToStr(ToKitchen[3]) + '.');
MMouse(Sc.x, Sc.y, RandomRange(-5,2), RandomRange(-5,2));
WriteLn('Moved The Mouse Over The ' + Which + ' Stairs.');
Wait(1000);
If IsUpText('Staircase') then
Begin
ClickMouse2(True);
WriteLn('Left-Clicked On The Stairs.');
Wait(1000);
MMouse(Sc.x, Sc.y, RandomRange(-5,2), RandomRange(-5,2));
WriteLn('Moved The Mouse To The Middle Stairs.');
Wait(1000);
If IsUpText('Staircase') then
Begin
ClickMouse2(False);
WriteLn('Right-Clicked On The Stairs.');
If R_ChooseOption(Route) then
Begin
WriteLn('Chose The Option "Climb-' + Route + '". Destination Reached.');
End
Else
Begin
WriteLn('Failed To Choose An Option.');
End
End
Else
Begin
WriteLn('Could Not Find The Correct UpText For The Middle Staircase.');
End
End
Else
Begin
WriteLn('Could Not Find The Correct Uptext For The ' + Which + ' Staircase.');
End;
End;
Procedure Walking(J: Integer);
Begin
If Not (LoggedIn) Then
Exit;
Case J of
1:
Begin
WriteLn('Running Procedure Walking(' + IntToStr(J) + ') To Range.');
Walk(0);
Staircase('Down');
Walk(1);
AntiRandoms;
End;
2:
Begin
WriteLn('Running Procedure Walking(' + IntToStr(J) + ') To Bank.');
Walk(0);
Staircase('Up');
Wait(500 + Random(300));
Walk(2);
AntiRandoms;
End;
End;
End;
Procedure CookFood;
Var
A, B, C, D, E, F, G, H: Integer;
StartedCooking: Boolean;
Begin
if not (LoggedIn) then
Exit;
Begin
WriteLn('Running CookYourFood.');
AntiRandoms;
If FindDTM(RawLobDtm, A, B, MIX1, MIY1, MIX2, MIY2)Then
Begin
WriteLn('Found Raw Lobster DTM.');
MMouse(A, B, RandomRange(-2,2), RandomRange(-2,2));
Wait(500);
If IsUpText('lobster') Then
Begin
ClickMouse2(true);
WriteLn('Clicked On A Raw Lobster In The Inventory.');
If FindColorSpiralTolerance(C, D, Range, MSCX, MSY1, MSX2, MSY2, 5) Then
Begin
WriteLn('Found Range Color.');
Wait(1500);
MMouse(C + 2, D - 2, RandomRange(-2,2), RandomRange(-2,2));
Begin
ClickMouse2(true)
WriteLn('Clicked On The Cooking Range.');
Wait(2000);
If FindDTM(RawLobDtm, E, F, MCX1, MCY1, MCX2, MCY2) Then
Begin
WriteLn('Found The RawLobDtm In The Chat Box.');
MMouse(E, F, RandomRange(-2,2), RandomRange(-2,2));
Wait(1000);
If IsUpText('Cook') then
Begin
ClickMouse2(true);
WriteLn('Clicked The Chat In An Attempt To Cook.');
Wait(500 + Random(300));
Repeat
If FindDTM(RawLobDtm, A, B, MIX1, MIY1, MIX2, MIY2)Then
Begin
StartedCooking := True;
WriteLn('Started Cooking The Raw Lobsters.');
Break;
End
Else
Begin
StartedCooking := False;
Inc(G);
WriteLn('Did Not Start Cooking The Raw Lobsters.');
WriteLn('Will Check To See If Started 10 Times.');
WriteLn('This Is Check Number ' + IntToStr(G) + '.');
Wait(500 + Random(300));
End;
Until (G = 10);
If (StartedCooking = False) Then
Begin
WriteLn('Did Not Start Cooking.');
Exit;
End
Else
Begin
H := 0;
Repeat
If (IsIdle) Then
Begin
Inc(H);
AntiRandoms;
AntiBan;
Wait(700);
WriteLn('Still Cooking.');
End;
Until (H >= 28);
WriteLn('Finished Cooking.');
End;
End
Else
Begin
WriteLn('Incorrect Uptext in Main Chat for Raw Lob DTM.');
End;
End
Else
Begin
WriteLn('Could not find RawLobDtm in Chat Box.');
End;
End;
End
Else
Begin
WriteLn('Cannot find range color.');
End;
End
Else
Begin
WriteLn('Incorrect DTM - Raw Lobster.');
Exit;
End
End
Else
Begin
WriteLn('Cannot find RawLobDtm.');
End;
End;
End;
Procedure FreeDTMs;
Begin
FreeDTM(RawLobDtm);
FreeDTM(CookedLobDtm);
End;
Procedure MainLoop;
Var
Current, Lobs: Integer;
Begin
Lobs := 1;
LobsPresent := True;
While (SetLobs <= Lobs) or (SetTime <= Time/60000) or (LobsPresent = True) Do
Begin
If Not (LoggedIn) Then
Exit;
Maintenance;
Bank;
Walking(1);
CookFood;
Walking(2);
Inc(Current);
Lobs := (Current * 28);
WriteLn('Total Time Running Is ' + IntToStr(Time/60000) + ' Minutes.');
WriteLn('LobsPresent = ' + BoolToStr(LobsPresent) + '.');
WriteLn('Lobsters Cooked = About ' + IntToStr(Lobs) + ' Or ' + IntToStr(Current) + ' Loads (Not Accurate).');
End;
End;
Begin
ClearDebug;
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
SetupSRL;
SetUpReflection;
DeclarePlayers;
LoginPlayer;
PlayerStartup;
LoadDTMs;
MainLoop;
FreeDTMs;
End.In addition to this, check out his other posts. He is extremely humble and seems very intelligent and tries his best to help and be useful.
What do you think?