Drakan
2008-05-17 03:40:28
<!– BEGIN TEMPLATE: formanswers –>
The[Cheese] - SRL Member Application Form
The[Cheese]
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
Java, HTML, CSS, VB.net
Other Communitys
MIB for a little, Nexus for a little, SRL FTW!
How Long have You Played Runescape
about 3-4 years
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Hello all, I'm The[Cheese]! I'm from the USA, and I pretty much love to script. I started off programming in java for school, and then I found here and have been working my butt off to learn as much as possible.
I am a very dedicated hard worker, and I'm falling asleep as I'm writing this. lol.. I am a quick learner and I get the job done. I don't want to be an SRL member for the scripts, but for the opportunity to share more with the community and help out around the house. When I want something done, I get it done.
My sample code is my very own, Varrock East Miner and Banker! It comes complete with deathwalking, great walking back and forth to bank, fast mining, and much more.
I wanted to demonstrate myself by using as advanced techniques as I can learn. In my script I use many DDTM's, DTM's, TPA's AutoColoring (thanks to ACA really), RadialRoadWalking, version checking, news checking, and much more. I put many failsafes, but of course I always have room for improvement.
Vote for me as the next president of the united states, and all your dreams will come true! (falls asleep on keyboard at 4 in the morning….)
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
Enjoy! Grade me well ;)
——————————————————
<!– END TEMPLATE: formanswers –>
The[Cheese] - SRL Member Application Form
The[Cheese]
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
Java, HTML, CSS, VB.net
Other Communitys
MIB for a little, Nexus for a little, SRL FTW!
How Long have You Played Runescape
about 3-4 years
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Hello all, I'm The[Cheese]! I'm from the USA, and I pretty much love to script. I started off programming in java for school, and then I found here and have been working my butt off to learn as much as possible.
I am a very dedicated hard worker, and I'm falling asleep as I'm writing this. lol.. I am a quick learner and I get the job done. I don't want to be an SRL member for the scripts, but for the opportunity to share more with the community and help out around the house. When I want something done, I get it done.
My sample code is my very own, Varrock East Miner and Banker! It comes complete with deathwalking, great walking back and forth to bank, fast mining, and much more.
I wanted to demonstrate myself by using as advanced techniques as I can learn. In my script I use many DDTM's, DTM's, TPA's AutoColoring (thanks to ACA really), RadialRoadWalking, version checking, news checking, and much more. I put many failsafes, but of course I always have room for improvement.
Vote for me as the next president of the united states, and all your dreams will come true! (falls asleep on keyboard at 4 in the morning….)
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
{(*==================================================================]
[ Cheesy Varrock East Miner and Banker ]
[ ]
[ NAME : The[Cheese]'s VEM Banker. ]
[ WRITER : The[Cheese] ]
[ CATEGORY : Mining. ]
[ DESCRIPTION : Mines tin, copper, or iron at VEM and banks]
[ USAGE : Start in either bank or mine with pick. ]
[ AUTOCOLOR : Yes ]
[ SRL Used : 4.0, Revision 16. ]
[ SCAR Used : 3.15b. ]
[ ]
[===================================================================]
[ Instructions. ]
[===================================================================]
[ 1. Use RuneScape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Setup lines below. ]
[ 4. Setup DeclarePlayers below. ]
[ 5. Start in varrock east bank or varrock east mine. ]
[ 6. Pick wielded or first slot in inventory. ]
[ 7. Put picks in order from greatest to least in bank. ]
[ 6. Start script Logged Out. ]
[ 8. POST ALL PROGGIES IN THE THREAD! ]
[===================================================================]
[ Some more info: ]
[ 1. The pick withdrawing will select the first pick it comes to in ]
[ your bank. So set them in order of what you want used ;) ]
[ 2. Walking is MUCH BETTER now! ]
[ 3. You can now have wielded picks! Just setup the boolean in ]
[ DeclarePlayers! (Players[0].Booleans[0] :=true) ]
[ 4. Now will sleep everyone once-in-a-while for good anti-ban! ]
[ 5. Will switch worlds if you want it to! ]
[===================================================================]
[ ]
[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*)
program CheesyVEM;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL/srl.scar}
{.include SRL/srl/skill/mining.scar}
const
SmartWorld= 118; // World that S.M.A.R.T. should load.
Signed= true; // Load signed or unsigned?
YourSRLID = ''; // Insert your SRL Stats ID here (It is different than your Forum's username!)
YourSRLPassword = ''; // SRL Stats password here.
FullDebug= false; // Prints out a TON of crap so you can see whats going on. I use for debugging.
TakeScreens= true; // If it messes up or gets lost or something, it will take a SS.
ProggieType= 1; // If 1, will print full progress report, 2 will print short one. 1 recommended!
procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; // Name
Players[0].Pass :=''; // Pass
Players[0].Nick :=''; // Nickname 3 - 4 Letter's of character's name. NO CAPS!
Players[0].Active :=true; // Dont change this unless you don't want the player to mine. TRUE IS DEFAULT.
Players[0].Skill := 'mining'; // Skill used for the Lamp random.
Players[0].Strings[0] :='copper'; // Which ore? tin copper iron?
Players[0].Booleans[0] :=false; // Wield the pick?
Players[0].Integers[0] :=50; // How many loads?
Players[0].Integers[1] :=6000; // Longest rock wait time in ms?
Players[0].Integers[3] :=4; // How many loads to do before taking a short break? I recommend 4-8ish. Randomness will be added on.
Players[0].Booleans[1] :=true; // Switch worlds after sleep? IF YOU ARE IN UNSIGNED, CHOOSE FALSE! Great for antiban!
Players[1].Name :=''; // Name
Players[1].Pass :=''; // Pass
Players[1].Nick :=''; // Nickname 3 - 4 Letter's of character's name. NO CAPS!
Players[1].Active :=true; // Dont change this unless you don't want the player to mine. TRUE IS DEFAULT.
Players[1].Skill := 'mining'; // Skill used for the Lamp random.
Players[1].Strings[0] :='copper'; // Which ore? tin copper iron?
Players[1].Booleans[0] :=false; // Wield the pick?
Players[1].Integers[0] :=50; // How many loads?
Players[1].Integers[1] :=6000; // Longest rock wait time in ms?
Players[1].Integers[3] :=4; // How many loads to do before taking a short break? I recommend 4-8ish. Randomness will be added on.
Players[1].Booleans[1] :=true; // Switch worlds after sleep? IF YOU ARE IN UNSIGNED, CHOOSE FALSE! Great for antiban!
end;
var x,y:integer;
var
Rock_Color, BankDTM, Iron_Color, Tin_Color, Copper_Color, TimesSlept: integer;
TotalLoads, CR2DTM, CR3DTM, CR4DTM, RoadColor2: integer;
IsPickaxe, Mining: Boolean;
OresMined, LoadsToSleep, Chat, Responded: integer;
var CrossRoadDTM:Integer;
var ADTM:Integer; //Varrock East Mine DDTM.
ADtmMP: TDTMPointDef;
ADtmSP: array[0..8] of TDTMPointDef;
ADtmSkel: TDTM;
const
CRoadTol=15; //Don't touch unless you know what you're doing.
CRoadArea=1; //Don't touch unless you know what you're doing.
BankTol=15; //Don't touch unless you know what you're doing.
BankArea=1; //Don't touch unless you know what you're doing.
Version='3.1';//NEVER TOUCH :P
{*******************************************************************************
procedure Debug(thestring: string);
By: ACAv2
Description: AutoColor procedure made with ACA2, finds the iron vain color. =]
*******************************************************************************}
procedure Debug(thestring: string);
begin
if(FullDebug)then Writeln(thestring);
end;
{*******************************************************************************
function MyGetTime : string;
By: RsN (fixed by Ron)
Description: Returns current time as a string
//I took out the :'s and put -'s
*******************************************************************************}
function MyGetTime: string;
var
Hour, Mins, Secs, MSecs : Word;
begin
DecodeTime(Date, Hour, Mins, Secs, MSecs);
Hour := Hour - 12;
Result := Inttostr(Hour) + '-' + inttostr(Mins);
end;
{*******************************************************************************
procedure Procedure TakeScreenShot(reason:String; number:Integer);
By: Jukka?? idk
Description: Takes Screenie.
*******************************************************************************}
procedure TakeScreenShot(reason:String);
var
Screen: Integer;
begin
if(not Loggedin)then Exit;
if(TakeScreens)then
begin
try
Screen:= BitmapFromString(764, 502, '');
CopyClientToBitmap(Screen, MSX1, MSY1, 764, 502);
SaveBitmap(Screen, ScriptPath + Players[CurrentPlayer].nick +'-'+ reason +'-'+ MyGetTime + '.bmp');
writeln('Screenshot taken: ' + reason + ' for user: ' +Players[CurrentPlayer].name+ 'at time: ' +MyGetTime);
FreeBitmap(Screen);
except
Writeln('Error In ScreenShot');
Exit;
end;
end;
end;
{*******************************************************************************
procedure KillPlayer;
By: The[Cheese]
Description: Makes player inactive and logout.
*******************************************************************************}
procedure KillPlayer(Reason: string; SS: boolean);
begin
Players[CurrentPlayer].active := false;
Logout;
Writeln(Players[CurrentPlayer].name + ' is now inactive.');
Writeln('Reason: ' + Reason);
if(SS)then TakeScreenShot(Reason);
end;
{*******************************************************************************
function SwitchRandomWorld(Members, Lowest: boolean): boolean;
By: The[Cheese]
Description: Attempts to switch worlds for you =]
*******************************************************************************}
function SwitchRandomWorld(Members, Lowest: boolean): boolean;
var
RandomWorld: integer;
begin
if(LoggedIn)then Logout;
MouseBox(9, 466, 97, 489, 1);
wait(1000);
if not(FindText(x, y, 'Select a world', UpChars, 19, 2, 127, 18))then
begin
Writeln('Couldn''t enter world switching screen...');
Result := false;
Exit;
end;
case Lowest of
true: MouseBox(408, 8, 412, 13, 1);
false: MouseBox(393, 8, 398, 14, 1);
end;
Wait(500 + Random(500));
case Members of
true: MouseBox(614, 8, 618, 13, 1);
false: MouseBox(629, 7, 633, 13, 1);
end;
wait(500 + Random(500));
MouseBox(65, 37, 141, 488, 1);
if not(FindText(x, y, 'Welcome to RuneScape', UpChars, 300, 230, 470, 259))then
begin
Writeln('Failed to switch worlds!');
Result := false;
MouseBox(703, 5, 751, 16, 1);
Exit;
end;
Writeln('Switched worlds successfully!');
Inc(Players[CurrentPlayer].Integers[24]);
Result := true;
end;
{*******************************************************************************
function FindStoneColor2: Integer;
By: Tarajunky
Description: Autodetecs Stone (Mine Rock) Color on Minimap
*******************************************************************************}
// Colors updated, and took out the Writeln;
function FindStoneColor2: Integer;
var
GC, a, l, TestColor: integer;
var
P:array of Tpoint;
begin
GC := 3561615;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1,MMY1,MMX2,MMY2, 60);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
TestColor := GetColor(P[a].x,P[a].y);
if (GetColor(P[a].x-1,P[a].y)=TestColor-527120) then
begin
Result := TestColor;
Debug('Stone Color = ' + IntToStr(TestColor));
Exit;
end;
end;
Debug('Could not find Stone Color!');
Result := 0;
end;
{*******************************************************************************
function FindVarrockRoadColor2: Integer;
By: Tarajunky
Description: Autodetects Varrock Road Color on Minimap
*******************************************************************************}
function FindVarrockRoadColor2: Integer;
var
GC, a, l, TestColor, Red, Green, Blue : integer;
var
P:array of Tpoint;
begin
GC := 7304312;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
if rs_OnMinimap(P[a].x,P[a].y) then
begin
TestColor := GetColor(P[a].x,P[a].y);
if SimilarColors(TestColor,GC,60) then
begin
red := (TestColor mod 256);
green := ((TestColor / 256) mod 256);
blue := ((TestColor / 256) / 256);
if Red - Blue <= 12 then if Red - Blue >= 8 then
if Red - Green <= 6 then if Red - Green >= -1 then
if Green - Blue <= 10 then if Green - Blue >= 4 then
if GetColor(P[a].x + 5, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 3) = TestColor then
if GetColor(P[a].x, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 5, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y) = TestColor then
if GetColor(P[a].x + 5, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 5) = TestColor then
begin
Result := TestColor;
Debug('Varrock RoadColor = ' +
IntToStr(TestColor));
Exit;
end;
end;
end;
end;
Debug('Could not find Varrock Road Color!');
Result := 0;
end;
{*******************************************************************************
function AutoColorIron: Integer;
By: ACAv2
Description: AutoColor procedure made with ACA2, finds the iron vain color. =]
*******************************************************************************}
function AutoColorIron: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.14);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2108230, MSX1, MSY1, MSX2, MSY2, 9);
if (Length(arP) = 0) then
begin
Debug('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
try
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
Except
Writeln('Memory leakage! Restart scar!!');
TerminateScript;
end;
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 1.36) and (X <= 7.31) and (Y >= 1.19) and (Y <= 6.20) and (Z >= 0.76) and (Z <= 3.31) then
begin
Result := arC[i];
Debug('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Debug('AutoColor failed in finding the color.');
end;
{*******************************************************************************
function AutoColorCopper: Integer;
By: ACAv2
Description: AutoColor procedure made with ACA2, finds the copper vain color. =]
*******************************************************************************}
function AutoColorCopper: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.04);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 4285835, MSX1, MSY1, MSX2, MSY2, 10);
if (Length(arP) = 0) then
begin
Debug('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
try
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
Except
Writeln('Memory leakage! Restart scar!!');
TerminateScript;
end;
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 9.27) and (X <= 25.47) and (Y >= 8.64) and (Y <= 23.67) and (Z >= 4.18) and (Z <= 10.83) then
begin
Result := arC[i];
Debug('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Debug('AutoColor failed in finding the color.');
end;
{*******************************************************************************
function AutoColorTin: Integer;
By: ACAv2
Description: AutoColor procedure made with ACA2, finds the tin vain color. =]
*******************************************************************************}
function AutoColorTin: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.12, 0.11);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 7171448, MSX1, MSY1, MSX2, MSY2, 18);
if (Length(arP) = 0) then
begin
Debug('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
try
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
Except
Writeln('Memory leakage! Restart scar!!');
TerminateScript;
end;
for i := 0 to High(arP) do
begin
Result := arC[i];
Debug('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Debug('AutoColor failed in finding the color.');
end;
{*******************************************************************************
procedure LoadCrossRoadsDDTM;
By: The[Cheese]
Description: Loads the Cross-Roads DDTM.
*******************************************************************************}
procedure LoadCrossRoadsDDTM;
var
CRoadMP: TDTMPointDef;
CRoadSP: array[0..2] of TDTMPointDef;
CRoadDTMSkel: TDTM;
Begin
if not(LoggedIn)then Exit;
CRoadMP.x:=81;
CRoadMP.y:=55;
CRoadMP.areasize:=1;
CRoadMP.areashape:=0;
CRoadMP.color:=RoadColor;
CRoadMP.tolerance:=5;
CRoadSP[0].x:=92;
CRoadSP[0].y:=25;
CRoadSP[0].areasize:=1;
CRoadSP[0].areashape:=0;
CRoadSP[0].color:=RoadColor;
CRoadSP[0].tolerance:=5;
CRoadSP[1].x:=56;
CRoadSP[1].y:=54;
CRoadSP[1].areasize:=1;
CRoadSP[1].areashape:=0;
CRoadSP[1].color:=RoadColor;
CRoadSP[1].tolerance:=5;
CRoadSP[2].x:=91;
CRoadSP[2].y:=77;
CRoadSP[2].areasize:=1;
CRoadSP[2].areashape:=0;
CRoadSP[2].color:=RoadColor;
CRoadSP[2].tolerance:=5;
CRoadDTMSkel.MainPoint:=CRoadMP;
CRoadDTMSkel.SubPoints:=CRoadSP;
CrossRoadDTM:=AddDTM(CRoadDTMSkel);
end;
{*******************************************************************************
function FindBankDTM: boolean;
By: The[Cheese]
Description: Loads the bank DTM of the bankers.
*******************************************************************************}
function FindBankDTM(Click: boolean): boolean;
begin
if not(LoggedIn)then Exit;
BankDTM := DTMFromString('78DA63AC626260886100034608C5F0EF9F300' +
'32B94FF1F0818416A1220724C0C30C0085703E61511A126970835' +
'F544A86926424D39613500A9DE0C46');
if(DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
if(Click)then
begin
Mouse(x, y-5, 0, 0, true);
Flag;
end;
Result := true;
Debug('Found bank DTM.');
FreeDTM(BankDTM);
Exit;
end else
begin
Result := false;
FreeDTM(BankDTM);
Debug('Didn`t find bank DTM.');
end;
end;
{*******************************************************************************
procedure LoadADDTM;
By: The[Cheese]
Description: Loads the DDTM above the mine.
*******************************************************************************}
procedure LoadADDTM;
var
ADtmMP: TDTMPointDef;
ADtmSP: array[0..4] of TDTMPointDef;
ADtmSkel: TDTM;
begin
if not(LoggedIn)then Exit;
ADtmMP.x:=86;
ADtmMP.y:=81;
ADtmMP.areasize:=1;
ADtmMP.areashape:=0;
ADtmMP.color:=0;
ADtmMP.tolerance:=255;
ADtmSP[0].x:=71;
ADtmSP[0].y:=63;
ADtmSP[0].areasize:=1;
ADtmSP[0].areashape:=0;
ADtmSP[0].color:=RoadColor;
ADtmSP[0].tolerance:=5;
ADtmSP[1].x:=58;
ADtmSP[1].y:=73;
ADtmSP[1].areasize:=1;
ADtmSP[1].areashape:=0;
ADtmSP[1].color:=RoadColor;
ADtmSP[1].tolerance:=5;
ADtmSP[2].x:=103;
ADtmSP[2].y:=95;
ADtmSP[2].areasize:=1;
ADtmSP[2].areashape:=0;
ADtmSP[2].color:=RoadColor;
ADtmSP[2].tolerance:=5;
ADtmSP[3].x:=109;
ADtmSP[3].y:=75;
ADtmSP[3].areasize:=1;
ADtmSP[3].areashape:=0;
ADtmSP[3].color:=RoadColor;
ADtmSP[3].tolerance:=5;
ADtmSP[4].x:=91;
ADtmSP[4].y:=56;
ADtmSP[4].areasize:=1;
ADtmSP[4].areashape:=0;
ADtmSP[4].color:=RoadColor;
ADtmSP[4].tolerance:=5;
ADtmSkel.MainPoint:=ADtmMP;
ADtmSkel.SubPoints:=ADtmSP;
ADTM:=AddDTM(ADtmSkel);
end;
{*******************************************************************************
procedure ClickADTM;
By: The[Cheese]
Description: Clicks on the DDTM above VEM.
*******************************************************************************}
function ClickADTM: boolean;
begin
if not(LoggedIn)then Exit;
RoadColor := FindVarrockRoadColor2;
LoadADDTM;
if(DTMRotated(ADTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
Mouse(x, y, 0, 0, true);
Debug('Clicked ADTM.');
Result := True;
FreeDTM(ADTM);
Exit;
end else
begin
Debug('Couldn`t click ADTM.');
Result := False;
FreeDTM(ADTM);
end;
end;
{*******************************************************************************
function ClickCrossRoads: boolean;
By: The[Cheese]
Description: Clicks on the CrossRoads DTM.
*******************************************************************************}
function ClickCrossRoads: boolean;
begin
if not(LoggedIn)then Exit;
LoadCrossRoadsDDTM;
if(DTMRotated(CrossRoadDTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(x, y, 1, 1, true);
Flag;
Result := true;
Debug('Clicked CRoads.');
end else
begin
Result := false;
Debug('Couldn`t click CRoads.');
end;
end;
procedure LoadCR2DDTM;
var
CR2MP: TDTMPointDef;
CR2SP: array[0..4] of TDTMPointDef;
CR2DTMSkel: TDTM;
Begin
if not(LoggedIn)then Exit;
CR2MP.x:=653;
CR2MP.y:=76;
CR2MP.areasize:=1;
CR2MP.areashape:=0;
CR2MP.color:=RoadColor;
CR2MP.tolerance:=5;
CR2SP[0].x:=634;
CR2SP[0].y:=85;
CR2SP[0].areasize:=1;
CR2SP[0].areashape:=0;
CR2SP[0].color:=RoadColor;
CR2SP[0].tolerance:=5;
CR2SP[1].x:=667;
CR2SP[1].y:=83;
CR2SP[1].areasize:=1;
CR2SP[1].areashape:=0;
CR2SP[1].color:=RoadColor;
CR2SP[1].tolerance:=5;
CR2SP[2].x:=654;
CR2SP[2].y:=64;
CR2SP[2].areasize:=1;
CR2SP[2].areashape:=0;
CR2SP[2].color:=RoadColor;
CR2SP[2].tolerance:=5;
CR2SP[3].x:=677;
CR2SP[3].y:=82;
CR2SP[3].areasize:=1;
CR2SP[3].areashape:=0;
CR2SP[3].color:=RoadColor;
CR2SP[3].tolerance:=5;
CR2SP[4].x:=619;
CR2SP[4].y:=87;
CR2SP[4].areasize:=1;
CR2SP[4].areashape:=0;
CR2SP[4].color:=RoadColor;
CR2SP[4].tolerance:=5;
CR2DTMSkel.MainPoint:=CR2MP;
CR2DTMSkel.SubPoints:=CR2SP;
CR2DTM:=AddDTM(CR2DTMSkel);
end;
function FindCR2DDTM(Click: boolean): boolean;
begin
RoadColor := FindRoadColor;
LoadCR2DDTM;
if(DTMRotated(CR2DTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
Result := True;
Writeln('Found CR2DTM.');
if(Click)then Mouse(x, y, 1, 1, true);
end;
FreeDTM(CR2DTM);
end;
procedure LoadCR3DDTM;
var
CR3MP: TDTMPointDef;
CR3SP: array[0..2] of TDTMPointDef;
CR3DTMSkel: TDTM;
Begin
if not(LoggedIn)then Exit;
CR3MP.x:=642;
CR3MP.y:=62;
CR3MP.areasize:=1;
CR3MP.areashape:=0;
CR3MP.color:=RoadColor2;
CR3MP.tolerance:=5;
CR3SP[0].x:=640;
CR3SP[0].y:=84;
CR3SP[0].areasize:=1;
CR3SP[0].areashape:=0;
CR3SP[0].color:=RoadColor;
CR3SP[0].tolerance:=5;
CR3SP[1].x:=620;
CR3SP[1].y:=61;
CR3SP[1].areasize:=1;
CR3SP[1].areashape:=0;
CR3SP[1].color:=RoadColor2;
CR3SP[1].tolerance:=5;
CR3SP[2].x:=661;
CR3SP[2].y:=56;
CR3SP[2].areasize:=1;
CR3SP[2].areashape:=0;
CR3SP[2].color:=RoadColor2;
CR3SP[2].tolerance:=5;
CR3DTMSkel.MainPoint:=CR3MP;
CR3DTMSkel.SubPoints:=CR3SP;
CR3DTM:=AddDTM(CR3DTMSkel);
end;
function FindCR3DDTM(Click: boolean): boolean;
begin
RoadColor := FindRoadColor;
RoadColor2 := FindVarrockRoadColor;
LoadCR3DDTM;
if(DTMRotated(CR3DTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
Result := True;
Writeln('Found CR3DTM.');
if(Click)then Mouse(x, y, 1, 1, true);
end;
FreeDTM(CR3DTM);
end;
procedure LoadCR4DDTM;
var
CR4MP: TDTMPointDef;
CR4SP: array[0..2] of TDTMPointDef;
CR4DTMSkel: TDTM;
Begin
if not(LoggedIn)then Exit;
CR4MP.x:=652;
CR4MP.y:=87;
CR4MP.areasize:=1;
CR4MP.areashape:=0;
CR4MP.color:=RoadColor2;
CR4MP.tolerance:=5;
CR4SP[0].x:=647;
CR4SP[0].y:=61;
CR4SP[0].areasize:=1;
CR4SP[0].areashape:=0;
CR4SP[0].color:=RoadColor2;
CR4SP[0].tolerance:=5;
CR4SP[1].x:=626;
CR4SP[1].y:=92;
CR4SP[1].areasize:=1;
CR4SP[1].areashape:=0;
CR4SP[1].color:=RoadColor2;
CR4SP[1].tolerance:=5;
CR4SP[2].x:=667;
CR4SP[2].y:=102;
CR4SP[2].areasize:=1;
CR4SP[2].areashape:=0;
CR4SP[2].color:=RoadColor2;
CR4SP[2].tolerance:=5;
CR4DTMSkel.MainPoint:=CR4MP;
CR4DTMSkel.SubPoints:=CR4SP;
CR4DTM:=AddDTM(CR4DTMSkel);
end;
function FindCR4DDTM(Click: boolean): boolean;
begin
RoadColor2 := FindVarrockRoadColor;
LoadCR4DDTM;
if(DTMRotated(CR4DTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
Result := True;
Writeln('Found CR4DTM.');
if(Click)then Mouse(x, y, 1, 1, true);
end;
FreeDTM(CR4DTM);
end;
{*******************************************************************************
function ConfirmLocation(loc: string): boolean;
By: The[Cheese]
Description: Checks to see if you are at a specific location.
*******************************************************************************}
function ConfirmLocation(loc: string): boolean;
begin
if not(LoggedIn)then Exit;
case Lowercase(loc) of
'vem':
begin
if not(FindSymbol(x, y, 'mining spot'))then
begin
SymbolAccuracy := 0.5;
Debug('Can`t find Mine Symbol!');
end else
begin
Debug('Found VEM with mining spot symbol.');
Result := True;
Exit;
end;
end;
'bank':
begin
if(FindBankDTM(false))then
begin
Result := True;
Debug('Found Bank with DDTM.');
Exit;
end else
begin
Debug('Bank not found.');
Result := false;
Exit;
end;
end;
'crossroads':
begin
RoadColor := FindVarrockRoadColor2;
LoadCrossRoadsDDTM;
if not(DTMRotated(CrossRoadDTM, x, y, MMX1, MMY1, MMX2, MMY2))then
begin
Result := False;
Debug('Could not find CrossRoads.');
FreeDTM(CrossRoadDTM);
Exit;
end else
begin
Result := True;
Debug('Found Cross-Roads.');
FreeDTM(CrossRoadDTM);
Exit;
end;
end;
end;
end;
{*******************************************************************************
function GoInMine: boolean;
By: The[Cheese]
Description: Attempts to walk into the mine using TPA's.
*******************************************************************************}
function GoInMine: boolean;
var
RockColorTPA: TPointArray;
begin
if not(LoggedIn)then Exit;
if(FindStoneColor2 = 0)then
begin
Debug('Couldn`t find stone color.');
Exit;
end;
FindColorsSpiralTolerance(x, y, RockColorTPA, FindStoneColor2, MMX1, MMY1, MMX2, MMY2, 5);
if (High(RockColorTPA) > 0)then
begin
MiddleTPAEx(RockColorTPA, x, y);
Mouse(x, y, 1, 1, true);
Flag;
Debug('We are in the mine.');
Result := true;
end else
begin
Debug('Unable to enter the mine.');
Result := false;
end;
end;
{*******************************************************************************
procedure WalkToMine;
By: The[Cheese]
Description: Walks to the VEM mine.
*******************************************************************************}
procedure WalkToMine;
var
Tries: integer;
begin
if not(LoggedIn)then Exit;
Tries := 0;
Debug('Walking part 1.');
RoadColor := FindVarrockRoadColor2;
repeat
wait(100);
Inc(Tries);
until((RadialRoadWalk(RoadColor, 16, 90, 50, 1, 1)) or (Tries > 5));
if(Tries > 5)then
begin
KillPlayer('To Mine Part 1 failed.', true);
Exit;
end;
Debug('Walking part 2.');
RoadColor := FindVarrockRoadColor2;
Tries := 0;
repeat
RadialRoadWalk(RoadColor, 70, 125, 60, 1, 1)
until((ClickCrossRoads) or (Tries > 6));
if(Tries > 6)then
begin
KillPlayer('To Mine Part 2 failed.', true);
Exit;
end;
Debug('Walking part 3.');
RoadColor := FindVarrockRoadColor2;
Tries := 0;
repeat
RoadColor := FindVarrockRoadColor2;
RadialRoadWalk(RoadColor, 115, 215, 55, 1, 1)
Inc(Tries);
if(Tries > 3)then
begin
if(ClickADTM)then
begin
if not(GoInMine)then
begin
KillPlayer('To Mine Part 3 failed.', true);
Exit;
end else
begin
Debug('Welcome to VEM ;)');
Exit;
end;
end;
end;
until(Tries > 9);
KillPlayer('To Mine Failed', true);
end;
{*******************************************************************************
procedure WalkToBank;
By: The[Cheese]
Description: Walks to the bank from the Mine. Uses DDTM's and radial walking.
*******************************************************************************}
procedure WalkToBank;
var
i, walked: integer;
CrossRoads: boolean;
begin
if not(LoggedIn)then Exit;
SetAngle(true);
SetRun(false);
if not(ConfirmLocation('vem'))then
begin
KillPlayer('Player Got Lost.', true);
Exit;
end;
if not(ClickADTM)then
begin
if not(GoInMine)then
begin
ClickADTM;
Flag;
Wait(500);
end else
begin
Flag;
wait(500);
end;
if not (ClickADTM)then
begin
if not(RadialRoadWalk(RoadColor, 28, 70, 60, 1, 1))then Debug('RRW # 0.5 has messed up.');
end;
end;
i := 0;
CrossRoads := false;
Walked := 0;
repeat
RoadColor := FindVarrockRoadColor2;
Inc(i);
if(RadialRoadWalk(RoadColor, 310, 410, 55, 1, 1))then Inc(Walked);
if(walked > 3)then
begin
CrossRoads := ClickCrossRoads;
end;
until((CrossRoads) or (i > 10) or (Walked > 3));
if(i > 9)then
begin
KillPlayer('Lost To Bank1', true);
Exit;
end;
i := 0;
repeat
RadialRoadWalk(RoadColor, 220, 318, 55, 1, 1);
Inc(i);
until((FindBankDTM(true)) or (i > 6));
if(i > 6)then
begin
KillPlayer('Lost To Bank2', true);
Exit;
end;
if not(ConfirmLocation('bank'))then
begin
Writeln('We got lost walking to the bank. Report this to The[Cheese]');
KillPlayer('Lost To Bank3', true);
Exit;
end;
Debug('Arrived at the bank!');
end;
{*******************************************************************************
function DeathWalk: boolean;
By: The[Cheese]
Description: 0mGz0rz 1tz d34th w41k???? :P Yah, thats right.
*******************************************************************************}
function DeathWalk: boolean;
var
Walks, Tries: integer;
DDTMed: boolean;
begin
//Part 1
Walks := 0;
Tries := 0;
DDTMed := False;
RoadColor := FindRoadColor;
repeat
if RadialRoadWalk(RoadColor, 30, 100, 58, 1, 1) then Inc(Walks);
if(Walks > 1)then
begin
if(FindCR2DDTM(true))then DDTMed := true;
end;
Inc(Tries);
Flag;
until((Tries > 5) or (DDTMed));
//Part 2
Walks := 0;
Tries := 0;
DDTMed := False;
RoadColor := FindRoadColor;
repeat
if RadialRoadWalk(RoadColor, 315, 450, 58, 1, 1) then Inc(Walks);
Inc(Tries);
if(Walks > 9)then
begin
if(FindCR3DDTM(true))then DDTMed := true;
end;
Flag;
until((Tries > 20) or(DDTMed));
//Part 3
Walks := 0;
Tries := 0;
DDTMed := False;
RoadColor := FindVarrockRoadColor;
repeat
if RadialRoadWalk(RoadColor, 45, 135, 58, 2, 1) then Inc(Walks);
Inc(Tries);
if(Walks > 1)then
begin
if(FindCR4DDTM(true))then DDTMed := true;
end;
Flag;
until((Tries > 5) or(DDTMed));
//Part 4
Walks := 0;
Tries := 0;
DDTMed := False;
RoadColor := FindVarrockRoadColor;
repeat
if RadialRoadWalk(RoadColor, 315, 405, 58, 2, 1) then Inc(Walks);
Inc(Tries);
if((Walks > 1) and (FindSymbol(x, y, 'mining spot')))then
begin
if(GoInMine)then DDTMed := true;
end;
if(Walks > 2)then
begin
if(ClickADTM)then DDTMed := true;
end;
Flag;
until((Tries > 10) or(DDTMed));
if not(ConfirmLocation('vem'))then
begin
Result := false;
end else
begin
Result := true;
Writeln('We deathwalked!');
ReportVars[5] := ReportVars[5] + 1;
SendSRLReport;
end;
end;
{*******************************************************************************
procedure Flag2;
By: The[Cheese]
Description: Waits untill flag is gone or 6 seconds are up. Not for long
distance traveling.
*******************************************************************************}
procedure Flag2;
var
i: integer;
b: boolean;
begin
if not(LoggedIn)then Exit;
repeat
wait(100);
b := FlagPresent;
i := i + 100;
if((b) and (i = 5000))then
begin
Mouse(247, 152, 5, 5, true);
end;
until((not b) or (i = 5000))
wait(100);
end;
{*******************************************************************************
procedure GetPlayersRockColor;
By: The[Cheese]
Description: Sets the CurrentPlayers rock color for mining.
*******************************************************************************}
procedure GetPlayersRockColor;
begin
if not(LoggedIn)then Exit;
case Lowercase(Players[CurrentPlayer].Strings[0]) of
'iron':
begin
Iron_Color := AutoColorIron;
Rock_Color := Iron_Color;
end;
'tin':
begin
Tin_Color := AutoColorTin;
Rock_Color := Tin_Color;
end;
'copper':
begin
Copper_Color := AutoColorCopper;
Rock_Color := Copper_Color;
end;
end;
end;
{*******************************************************************************
function ChatCheck: boolean;
By: The[Cheese]
Description: Checks for the black chat messages to check if mining, lost pick,
no ore in rock, etc.
*******************************************************************************}
function ChatCheck: boolean;
var
LastChat: String;
begin
if not(LoggedIn)then Exit;
Flag;
wait(100);
Result := true;
LastChat := GetBlackChatMessage;
if(LastChat = 'There is no ore currently available in this rock.')then
begin
Mining := False;
Result := false;
end;
if(LastChat = 'The blast damages your pickaxe!')then
begin
Writeln('Gas broke our pick.');
Result := false;
end;
end;
{*******************************************************************************
procedure WithdrawPick;
By: The[Cheese]
Description: Will look in bank down each row for a DTM of a pickaxe. It will
withdraw the first one it comes to.
*******************************************************************************}
function WithdrawPick: boolean;
var
i1, i2, i3: integer;
BY1, BY2, BX1, BX2: integer;
PickDTM: integer;
begin
if not(LoggedIn)then Exit;
PickDTM := DTMFromString('78DA63E460616078C4C8800C0C95D81858813' +
'448F43F1030F201D55C415503918591405A12A8E6010135FF9819' +
'186E1250C30834E70D01352C4035EFF0AB0100352F0B04');
i3 := 0;
BY1 := 60;
BY2 := 97;
for i2 := 1 to 6 do
begin
if(i2 > 1)then
begin
BY1 := BY1 + 37;
BY2 := BY2 + 37;
end;
BX1 := 71;
BX2 := 118;
for i1 := 1 to 8 do
begin
if(i1 > 1)then
begin
BX1 := BX1 + 37;
BX2 := BX2 + 37;
end;
if(FindDTM(PickDTM, x, y, BX1, BY1, BX2, BY2))then
begin
Debug('Withdrawing pick.');
Mouse(x, y, 8, 8, true);
wait(1000);
if(FindDTM(PickDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Result := True;
Debug('Withdrew Pick in row ' + inttostr(i2) + ' at column ' + inttostr(i1));
FreeDTM(PickDTM);
IsPickaxe := true;
Exit;
end;
end;
end;
end;
Writeln('Could not withdraw pickaxe.');
Result := False;
FreeDTM(PickDTM);
end;
{*******************************************************************************
procedure HandlePick;
By: The[Cheese]
Description: Handles pick retrieving from bank. Opens bank, withdraws, closes.
*******************************************************************************}
procedure HandlePick;
begin
if not(LoggedIn)then Exit;
OpenBankQuiet('veb');
DepositAll;
FixBank;
WithdrawPick;
CloseBank;
MMouseItem(1);
wait(500);
if((IsUpTextMultiCustom(['wield', 'wie', 'ield']) and (Players[CurrentPlayer].Booleans[0])))then
begin
Mouse(x, y, 0, 0, true);
wait(1000);
end;
end;
{*******************************************************************************
function CheckPick: boolean;
By: The[Cheese]
Description: Checks for pick inside inventory.
*******************************************************************************}
function CheckPick: boolean;
var
PickDTM: integer;
begin
if not(LoggedIn)then Exit;
if not(Players[CurrentPlayer].Booleans[0])then
begin
repeat
wait(100);
until(GameTab(4));
end else
begin
repeat
wait(100);
until(GameTab(5));
end;
wait(200);
PickDTM := DTMFromString('78DA63E460616078C4C8800C0C95D81858813' +
'448F43F1030F201D55C415503918591405A12A8E6010135FF9819' +
'186E1250C30834E70D01352C4035EFF0AB0100352F0B04');
if not(FindDTM(PickDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Result := false;
Writeln('We don`t have our pick.');
if not(FindPick)then
begin
if(ConfirmLocation('vem'))then WalkToBank;
HandlePick;
WalkToMine;
Result := true;
IsPickaxe := true;
end;
end else
begin
Result := true;
IsPickaxe := true;
FreeDTM(PickDTM);
end;
end;
{*******************************************************************************
procedure AntiBan;
By: The[Cheese]
Description: Simple anti-ban to do while waiting.
*******************************************************************************}
procedure AntiBan;
begin
if not(LoggedIn)then Exit;
case Random(2) of
0: PickUpMouse;
1: Exit;
end;
end;
{*******************************************************************************
Function w_WizzupGas(cx,cy: integer): Boolean;
By: Wizzup?
Description: Wizzup?'s gas finding!
*******************************************************************************}
Function w_WizzupGas(cx,cy: integer): Boolean;
Var
CTS, I, Le, T, Time: Integer;
P, P2: TPointArray;
C, C2: TIntegerArray;
R, G, B: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
GP: TPoint;
Begin
if not(LoggedIn)then Exit;
Result := False;
Time := GetSystemTime;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 0.46);
GP.X := cx;
GP.Y := cy;
GP.Y := GP.Y - 20;
FindColorsTolerance(P, 9083807, GP.x - 25, GP.y - 25, GP.X + 25, GP.Y + 25, 15);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
If Length(P) < 60 Then
Exit;
try
C := GetColors(P);
C2 := C;
ClearSameIntegers(C);
except
Writeln('Memory leakage! Restart scar!!');
TerminateScript;
end;
If Length(C) < 40 Then // Maybe lower the value.
//If Length(C) < 60 Then
Begin
Exit;
End;
Debug('Passed Color Diversity: ' + IntToStr(Length(C)));
Debug('Total colors found: ' + IntToStr(Length(P)));
SetLength(C, 0);
SetLength(C, Length(C2));
SetLength(P2, Length(P));
Le := High(C2);
For I := 0 To Le Do
Begin
ColorToRGB(C2[i], R, G, B);
//If ((R - G) <= 6) And (G - B > 7) Then
If ((R - G) <= 10) And (G - B > 7) Then
Begin
ColorToHSL(C2[i], H, S, L);
If (H > 11.5) And (H < 16.0) And (S < 16.0) And (S > 2.0) And (L > 42.0) And (L < 71.0) Then
Begin
ColorToXYZ(C2[i], X, Y, Z);
If (X >= 18.0) And (X <= 45.0) And (Y >= 20.0)
And (Y <= 48.0) And (Z >= 15.0)
And (Z <= 47.0) And (Abs(X - Y) < 3.0)
And (Abs(X - Z) < 5.0) And (Abs(Y - Z) < 6.5)
Then
Begin
C[T] := C2[i];
P2[T] := P[i];
T := T + 1;
End;
End;
End;
End;
SetLength(C, T);
ClearSameIntegers(C);
If Length(C) < 25 Then
Begin
Exit;
End;
Debug('Passed Color Diversity after filtering the colors: ' + IntToStr(Length(C)));
Debug('Total colors found, after filtering: ' + IntToStr(Length(P2)));
Result := True;
Debug('Gas Gave TRUE');
Debug('Time taken: ' + IntToStr(GetSystemTime - Time));
End;
{*******************************************************************************
Function MKFindGas:boolean;
By: MasterKill
Description: FindGas by MasterKill.
*******************************************************************************}
Function MKFindGas:boolean;
begin
if not LoggedIn then Exit;
if (FindColorTolerance (x, y, 10596274, 0, 0, 500, 500, 1))
or (FindColorTolerance (x, y, 8950933, 0, 0, 500, 500, 1))
or (FindColorTolerance (x, y, 9017755, 0, 0, 500, 500, 1))
or (FindColorTolerance (x, y, 7900302, 0, 0, 500, 500, 1)) then result:= true;
end;
{*******************************************************************************
procedure AntiGas;
By: The[Cheese]
Description: Finds and handles gas.
*******************************************************************************}
procedure AntiGas;
begin
if not(LoggedIn)then Exit;
if((w_WizzupGas(x, y)) or (MKFindGas))then
begin
ReportVars[6] := ReportVars[6] + 1;
TakeScreenShot('Gas');
Inc(Players[CurrentPlayer].Integers[22]);
RunAway('N', false, 1, 10000 + Random(6000));
GoInMine;
SetRun(True);
Mining := False;
SendSRLReport;
end;
end;
{*******************************************************************************
function Lost: boolean;
By: The[Cheese]
Description: Checks if we are lost.
*******************************************************************************}
function Lost: boolean;
begin
if not(LoggedIn)then Exit;
SymbolAccuracy := 0.4
if not(FindSymbol(x, y, 'mining spot'))then
begin
Result := true;
Writeln('Player lost while mining. Probably a random.');
TakeScreenShot('MaybeLost');
if not(GameTab(7))then
begin
KillPlayer('LostRandom', true);
Exit;
end else
begin
SetRun(false);
GameTab(7);
wait(500);
MouseBox(566, 232, 574, 241, 1);
if not(IsChatBlackTextAnyLine('You must wait'))then
begin
wait(14000 + Random(5000));
if not(DeathWalk)then
begin
KillPlayer('FailedDeathwalk', true);
Exit;
end else
begin
Result := false;
Writeln('Wow we deathwalked successfully... Now isn''t that amazing?');
SetRun(true);
end;
end else
begin
Writeln('Character can''t use home tele. Deactivating player.');
KillPlayer('LostNoSpell', true);
Exit;
end;
end;
end else
Result := false;
Debug('Not lost!');
end;
{*******************************************************************************
procedure AntiRandoms;
By: The[Cheese]
Description: Simple anti-randoms.
*******************************************************************************}
procedure AntiRandoms;
begin
if not(LoggedIn)then Exit;
Debug('Looking for dead.');
if(FindDead)then
begin
TakeScreenShot('Dead');
Writeln('You are dead!');
Players[CurrentPlayer].active := false;
Logout;
exit;
end;
Debug('Checking for pick.');
if not(Players[CurrentPlayer].Booleans[0])then CheckPick;
Debug('Finding normal randoms.');
FindNormalRandoms;
Debug('Checking for fight.');
If FindFight Then runAway('N', true, 1, 4000 + Random(2000));
Debug('Checking for pickhead.');
FindPick;
Debug('Randoms report.');
SRLRandomsReport;
end;
{*******************************************************************************
function InChatMulti(text: TStringArray): boolean;
By: Cazax
Description: Checks to see if any of the string array appears in the chat.
*******************************************************************************}
function InChatMulti(text: TStringArray): boolean;
var
i : integer;
s: string;
begin
if not(LoggedIn)then Exit;
for i:=0 to high(text) do
begin
if (not (GetLastChatText(s))) then
LastChatter(s);
Result := (Pos(Text[i], s) > 0);
end;
end;
{*******************************************************************************
procedure AutoRespond;
By: The[Cheese]
Description: Responds to messages.
*******************************************************************************}
procedure AutoRespond;
begin
if not(LoggedIn)then Exit;
if(TimeFromMark(Chat) > 10000)then
begin
MarkTime(Chat);
If InChatMulti(['mining lvl', 'mining level', 'mine lvl', 'mine level']) then
begin
case Random(5) of
0: SayCurrentLevels('mining');
1: TypeSend('Mine is ' + inttostr(Players[CurrentPlayer].Level[15]));
2: TypeSend('i said mine like 5 times today. lol');
3: TypeSend('Look it up :P');
4: TypeSend('only '+ inttostr(Players[CurrentPlayer].Level[15]));
end;
Inc(Responded);
end;
If InChatMulti(['sup', 'hello', 'hey', 'hi', 'whats up']) then
begin
case Random(5) of
0: TypeSend('Hola');
1: TypeSend('sup');
2: TypeSend('waz happenin?');
3: TypeSend('hey');
4: TypeSend('hi');
end;
Inc(Responded);
end;
end;
end;
{*******************************************************************************
function ClickRock(Rock_Color: integer): boolean;
By: The[Cheese]
Description: Finds the specific rock then clicks to mine it. Chooses random
right or left click.
*******************************************************************************}
function ClickRock(Rock_Color: integer): boolean;
var
RockTPA: TPointArray;
I: Integer;
begin
if not(LoggedIn)then Exit;
GetPlayersRockColor;
FindColorsSpiralTolerance(257, 173, RockTPA, Rock_Color, MSX1, MSY1, MSX2, MSY2, 5);
for I := 0 to High(RockTPA) do
begin
MMouse(RockTPA[i].x, RockTPA[i].y, 1, 1);
Wait(100 + Random(100));
if(IsUpTextMultiCustom(['Min', 'ine', 'Roc', 'ocks'])) then
begin
case Random(4) of
0,1,2: Mouse(RockTPA[i].x, RockTPA[i].y, 1, 2, true);
3: Mouse(RockTPA[i].x, RockTPA[i].y, 1, 2, false);
end;
wait(100);
ChooseOption('Mine');
Flag2;
Mining := True;
Result := True;
Exit;
end;
end;
Result := false;
end;
{*******************************************************************************
procedure CheesyMining;
By: The[Cheese]
Description: The main mining procedure.
*******************************************************************************}
procedure CheesyMining;
var
time, icount, icountnew, i: integer;
begin
if not(LoggedIn)then Exit;
if ((not(Players[CurrentPlayer].active)) or (InvFull))then Exit;
if(Lost)then exit;
if(ClickRock(Rock_Color))then
begin
icount := InvCount;
MarkTime(Time);
repeat
Debug('AntiGas');
AntiGas;
Debug('Checking inv count.');
icountnew := InvCount;
if(icountnew > icount) then Mining := False;
if(Mining)then
begin
Debug('AntiBan');
AntiBan;
Debug('AntiRandoms');
AntiRandoms;
end;
if(Mining)then
begin
Debug('Checking chat 1');
ChatCheck;
end;
if(Lost)then exit;
until((TimeFromMark(Time) >= Players[CurrentPlayer].Integers[1]) or (not (Mining)) or (not(IsPickaxe)));
end else
begin
Inc(i);
if(i > 2)then GoInMine;
end;
end;
{*******************************************************************************
procedure MinersDeposit;
By: The[Cheese]
Description: This aMaZiNg funtion will deposit everything but your picks. It
will deposit broken picks too.
*******************************************************************************}
procedure MinersDeposit;
var i: integer;
begin
if not(LoggedIn)then Exit;
for i := 2 to 28 do
begin
if(ExistsItem(i))then
begin
MMouseItem(i);
if not(IsUpTextMultiCustom(['pic', 'ick', 'pick', 'pickaxe', 'kaxe', 'axe', 'ickaxe', 'picka'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, false);
wait(150 + Random(200));
ChooseOption('All');
wait(150 + Random(200));
end;
wait(500 + Random(250));
end;
end;
end;
{*******************************************************************************
procedure Sleep;
By: The[Cheese]
Description: Takes a short nap!
*******************************************************************************}
procedure TakeNap;
var
NapTime, Mins, Secs: integer;
begin
if(LoadsToSleep=0)then
begin
NapTime := 1 + Random(8) * 60000;
Mins := NapTime / 60000;
Secs := Random(55000);
Writeln('Time to nap! Will be back in ' + inttostr(Mins) + ' minutes and '+ inttostr(Secs) + ' seconds!');
LogOut;
ReportVars[7] := ReportVars[7] + 1;
wait(NapTime + Secs - 60000);
Writeln('Logging in in 60 seconds!');
wait(60000);
SwitchRandomWorld(false, true);
LoginPlayer;
LoadsToSleep := Players[CurrentPlayer].Integers[3] + Random(4);
Inc(TimesSlept);
Inc(Players[CurrentPlayer].Integers[23]);
SendSRLReport;
end;
end;
{*******************************************************************************
procedure Bank;
By: The[Cheese]
Description: Opens the bank, then uses MinersDeposit, then closes the bank.
*******************************************************************************}
procedure Bank;
var
i: integer;
begin
if not(LoggedIn)then Exit;
i := 0;
Debug('Opening bank...');
repeat
if(i > 0)then FindBankDTM(true);
OpenBankQuiet('veb');
Inc(i);
until((i > 3) or (BankScreen));
if(i>3)then
begin
KillPlayer('ErrorAtBank', true);
Exit;
end;
flag;
wait(500);
MinersDeposit;
CloseBank;
end;
{*******************************************************************************
function ActivePlayers: integer;
By: The[Cheese]
Description: Finds out how many players are currently active. If none, then
returns zero and debugs 'All Players Inactive!'.
*******************************************************************************}
function ActivePlayers: integer;
var
i, HowManyActive: integer;
begin
HowManyActive := 0;
for i:=0 to High(Players) do
if (Players[i].active) then
Inc(HowManyActive)
else Debug('All Players Inactive!');
Result := HowManyActive;
Debug('There are ' + inttostr(HowManyActive) + ' players active.');
end;
{*******************************************************************************
function CheckLatest: Integer;
By: Pretty much inspired by Hy's version checker on the Caver!
Description: Checks your current version vs. the latest version and news.
*******************************************************************************}
function CheckLatest: Integer;
var
NewVersion, GetNews, News, GetNews2, News2: string;
Current: Extended;
begin
ClearDebug;
NewVersion := GetPage('http://www.designerdummies.com/TCVEMversion.txt');
GetNews := GetPage('http://www.designerdummies.com/TCVEMnews1.txt');
GetNews2 := GetPage('http://www.designerdummies.com/TCVEMnews2.txt');
try
begin
Current := StrToFloat(NewVersion);
News := GetNews;
News2 := GetNews2;
Writeln('...');
Writeln('/~~~~~~~~~~~~~~~~~~~~~Version~~~~~~~~~~~~~~~~~~~~~\');
if(StrToFloat(Version) < Current)then
begin
Writeln('| Script needs to be updated! |');
Writeln('| Please do that now! |');
Writeln('| Latest Version: '+NewVersion+' |');
Writeln('| Your Version: '+Version+' |');
Writeln('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
TerminateScript;
end else
begin
Writeln('| You are up to date! |');
end;
Writeln('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
Writeln('/~~~~~~~~~~~~~~~~~~~~~~News~~~~~~~~~~~~~~~~~~~~~~~\');
Writeln(News);
Writeln(News2);
Writeln('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
end;
except
WriteLn('Couldn''t check version or news! Allow scar to connect!');
end;
Writeln('Script will start in 5');
Wait(1000);
Writeln('Script will start in 4');
Wait(1000);
Writeln('Script will start in 3');
Wait(1000);
Writeln('Script will start in 2');
Wait(1000);
Writeln('Script will start in 1');
Wait(1000);
Writeln('Script will start in 0');
end;
{*******************************************************************************
procedure SetupSmart;
By: Unknown
Description: Sets up S.M.A.R.T. for autoing.
*******************************************************************************}
procedure SetupSmart;
begin
SmartSetupEx(SmartWorld, false, Signed);
WriteLn('Setting up Smart... Please Hold...');
Wait(10000 + random(5000));
SetTargetDC(SmartGetDC);
While not(SmartReady) do Wait(100);
end;
{*******************************************************************************
procedure SetUpScript;
By: The[Cheese]
Description: Gets the script ready to auto.
*******************************************************************************}
procedure SetUpScript;
begin
SetupSRL;
CheckLatest;
SetupSmart;
DeclarePlayers;
SRLID := YourSRLID;
SRLPassword := YourSRLPassword;
ScriptID := '852';
ActivateClient;
wait(2000);
TotalLoads := 0;
end;
{*******************************************************************************
procedure ProgressReport;
By: The[Cheese]
Description: Prints a detailed progress report.
*******************************************************************************}
procedure ProgressReport;
var
Time: String;
i: integer;
begin
Time := TimeRunning;
if(ProggieType = 1)then
begin
Writeln(' ___________________________________________');
Writeln('/-------------Progress Report---------------\');
Writeln(' CheesyVEM - By The[Cheese]');
Writeln(' Version: '+ Version);
Writeln('|-------------------------------------------|');
Writeln('Worked for: ' + Time);
Writeln('Players: ' + inttostr(HowManyPlayers));
Writeln('Players Active: ' + inttostr(ActivePlayers));
Writeln(' ');
Writeln('Total Ores Mined: ' + inttostr(OresMined));
Writeln('Loads Done: ' + inttostr(TotalLoads));
Writeln('Slept: ' + inttostr(TimesSlept));
Writeln('|-------------------------------------------|');
for i := 0 to HowManyPlayers-1 do
begin
Writeln('Player: ' + Players[i].nick);
Writeln(Players[i].Strings[0] +' mined: '+inttostr(Players[i].Integers[20]));
Writeln('Loads Done: ' +inttostr(Players[i].Integers[21]));
Writeln('Gas Found: ' +inttostr(Players[i].Integers[22]));
Writeln('Slept: ' +inttostr(Players[i].Integers[23]));
Writeln('Worlds Switched: '+inttostr(Players[i].Integers[24]));
Writeln('Active: ' + booltostr(Players[i].active));
Writeln('Loads till nap: ' + inttostr(LoadsToSleep));
Writeln('|-------------------------------------------|');
end;
end;
if(ProggieType = 2)then
begin
Writeln(' ___________________________________________');
Writeln('/-------------------------------------------\');
Writeln(' CheesyVEM - By The[Cheese]');
Writeln(' Version: '+ Version);
Writeln('|-------------------------------------------|');
Writeln('Worked for: ' + Time);
Writeln('Players: ' + inttostr(HowManyPlayers));
Writeln(' ');
Writeln('Total Ores Mined: ' + inttostr(OresMined));
Writeln('Loads Done: ' + inttostr(TotalLoads));
Writeln('\-------------------------------------------/');
end;
end;
{*******************************************************************************
procedure PlayersLoop;
By: The[Cheese]
Description: Main loop each player goes through.
*******************************************************************************}
procedure PlayersLoop;
var
i: integer;
begin
if not(Players[CurrentPlayer].active)then exit;
i := 0;
Players[CurrentPlayer].Integers[20] := 0; //Ores mined.
Players[CurrentPlayer].Integers[21] := 0; //Loads done.
Players[CurrentPlayer].Integers[22] := 0; //Gas found.
Players[CurrentPlayer].Integers[23] := 0; //Times slept.
Players[CurrentPlayer].Integers[24] := 0; //Worlds Switched.
repeat
if not(LoggedIn)then Exit;
GameTab(11);
wait(2000);
SetRun(True);
CheckPick;
repeat
if not(LoggedIn)then Exit;
AntiGas;
AntiRandoms;
CheesyMining;
i := i + 1;
if not(IsPickaxe)then
begin
Writeln('We lost or broke our pick!');
WalkToBank;
AntiRandoms;
if not(LoggedIn)then Exit;
HandlePick;
WalkToMine;
AntiRandoms;
AntiGas;
end;
until(InvFull);
CheckPick;
OresMined := OresMined + 27;
ReportVars[0] := ReportVars[0] + 27;
case Lowercase(Players[CurrentPlayer].Strings[0]) of
'iron': ReportVars[1] := ReportVars[1] + 27;
'copper': ReportVars[2] := ReportVars[2] + 27;
'tin': ReportVars[3] := ReportVars[3] + 27;
end;
Players[CurrentPlayer].Integers[20] := Players[CurrentPlayer].Integers[20] + 27;
WalkToBank;
if not(LoggedIn)then Exit;
AntiRandoms;
Bank;
Inc(Players[CurrentPlayer].Integers[21]);
Inc(TotalLoads);
ReportVars[4] := ReportVars[4] + 1;
AntiRandoms;
if(LoadsToSleep > 0)then Dec(LoadsToSleep);
Writeln('Will sleep in ' +inttostr(LoadsToSleep) + ' loads!');
ProgressReport;
SendSRLReport;
TakeNap;
WalkToMine;
AntiRandoms;
until((Players[CurrentPlayer].Integers[21] = Players[CurrentPlayer].Integers[0]) or (not(LoggedIn)));
end;
{*******************************************************************************
~MAIN LOOP~
*******************************************************************************}
begin
SetUpScript;
repeat
LoginPlayer;
LoadsToSleep := Players[CurrentPlayer].Integers[3] + Random(4);
Players[0].Integers[CurrentPlayer] := Players[0].Integers[CurrentPlayer] + Random(6);
TimesSlept := 0;
wait(3000);
LampSkill := Players[CurrentPlayer].skill;
Players[CurrentPlayer].Integers[2] := 0;
SetAngle(true);
Chat := 11000
Responded := 0;
if((not(ConfirmLocation('vem')) and (ConfirmLocation('bank'))))then
begin
if(InvFull)then
begin
Bank;
end;
if not(CheckPick)then
begin
HandlePick;
end;
WalkToMine;
end;
if(CheckPick)then
begin
IsPickaxe := true;
end;
wait(100);
SetRun(True);
PlayersLoop;
Debug('Attempting next player!');
Players[CurrentPlayer].active := false;
Logout;
if(ActivePlayers > 0) then
begin
Debug('Next player!');
NextPlayer(false);
end;
until(ActivePlayers = 0);
end.Enjoy! Grade me well ;)
——————————————————
<!– END TEMPLATE: formanswers –>