scuz 10
2010-01-24 17:17:42
7 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
C, C++, pascal, some java
Are you a member of any other communities?
No
Tell us about yourself…
From: scuz 10
I am 19 years old, in College and majoring in Electrical Engineering. I have taken several college courses on C and C++, and I eager to learn more. I have been playing runescape for over 7 years (since i was in 6th grade), and my main account is level 138. I've been playing since rs1 and I know everything there is to know about the game. I enjoy scripting in scar, and I am always ready to learn new things.
Please show us one (or multiple) of your scripts.
{.Script Info:
# ScriptName = varrock miner
# Author = scuz 10
# Description = mines any type of ore - tin, copper, iron (only one type though). will add more options soon
# Version = 0.2
# Date = 1/19/2010
# Comments = start logged out with pickaxe in first inventory slot in varrock bank.
# SRL App Tool = You should Apply for members if you havent cheated!
[==================================]
[= Result: 95%
[==================================]
# credits: bobbohobbo for the application tool
coh3n for his tutorial
the srl community :D
/Script Info}
//comment smart.scar '//' to use runescape
program New;
//{.Include srl/srl/Misc/smart.Scar}
// {.Include srl/srl.scar}
{.Include srl/srl.scar}
{.Include srl/srl/Misc/debug.Scar}
{.Include SRL/SRL/Misc/Users.Scar}
type RandomClick = (Percent50Chance,Percent20Chance,
Percent10Chance);
TRock = record
Name: String;
Color:TColor;
Huemod, Satmod : Extended;
Tol : Integer;
Func : function: Boolean;
end;
TRockArray=array Of TRock;
function LoadRockInfo(Name : string) : TRock; forward;
Var
Rocks: TRockArray;
foundRock:Boolean;
var
x,y,i, iii, PrevCount, loads : Integer;
procedure WalktoMine();
var
TPA : TPointArray;
ATPA : T2DPointArray;
begin
if not LoggedIn then Exit;
writeln('Walking path one');
FindColorsSpiralTolerance(MMCX + 60, MMCY,TPA, 5790807, MMX1, MMY1, MMX2, MMY2, 14);
ATPA :=TPAToATPA(TPA,3);
SortATPAFrom(ATPA, Point(MMCX + 60, MMCY));
//debugatpa(atpa, '');
x:= (iAbs((atpa[0][0].x - atpa[1][0].x)) + atpa[0][0].x);
y:= (iAbs((atpa[0][0].y - atpa[1][0].y)) + atpa[0][0].y);
If Mouseflag(x, y - 10, 0,0,0) then
begin
writeln('made path one');
wait(2000+Random(450));
end else
begin
writeln('didn''t make path one');
nextplayer(false);
exit;
end;
writeln('Walking Path 2');
if FindColorsSpiralTolerance(MMCX + 15, MMCY - 10,TPA, 198383, MMCX-40, MMCY-40, MMCX+40, MMCY+40, 15)then
begin
mouse(tpa[0].x + 40, tpa[0].y, 10, 3, True);
debugatpa(atpa, '');
end else
begin
writeln('didn''t make path two :(');
nextplayer(false);
exit;
end;
fflag(0);
//main mouse procs
begin
writeln('Walking path 3');
for i:= 0 to 3 do
if FindColor(x,y, FindTreeColor, 632-(10*i), 156-(10*i),632+(10*i), 156+(10*i))then
begin
Mouse(x + 10,y, 5, 0, True);
break;
end else
wait(80);
if not Flagpresent then
begin
writeln('didn''t make path three :(');
nextplayer(false);
exit;
end else
fflag(0);
writeln('Walking fouth path');
FindColorsSpiralTolerance(MMCX - 60, MMCY + 40,TPA, 5790807,MMX1, MMY1, MMX2, MMY2, 14);
Mouse(TPA[0].x + 80,TPA[0].y,5,5,True);
if not Flagpresent then
begin
writeln('didn''t make path fiur :(');
nextplayer(false);
exit;
end else
fflag(0);
WriteLn('Walking path 5');
Mouse(650, 152,5,5,True);
if not Flagpresent then
begin
writeln('didn''t make path five :(');
nextplayer(false);
exit;
end else
fflag(0);
WriteLn('Walking path 6, at mine!');
Mouse(mmcx + 60, mmcy,5,5,True);
if not Flagpresent then
begin
writeln('didn''t make path 6:(');
nextplayer(false);
exit;
end else
fflag(0);
if FindSymbol(X, Y, 'mining spot') Then
mouse(x - 15, y + 5, 2, 2, True)
else
begin
Writeln('could not make mine :-(');
nextplayer(false);
exit;
end;
flag;
end;
WriteLn('Time to hit rocks :)');
end;
function FindRocks : Boolean;
var TPA : TPointArray;
ATPA :T2DPointArray;
I, T :Integer;
Info: TRock;
begin
if not LoggedIn then Exit;
Info:= LoadRockInfo(Players[CurrentPlayer].Strings[0]);
GameTab(4);
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(Info.HueMod,Info.SatMod);
writeLn('Finding '+Info.Name+' Rock!');
FindColorsSpiralTolerance(MSCX,MSCY, TPA, Info.Color, MSX1, MSY1, MSX2, MSY2, Info.Tol);
ATPA:=SplitTPA(TPA, 7);
SortATPAFromSize(ATPA, 90,True);
T := GetSystemTime;
for i:= 0 to High(ATPA) Do
if MiddleTPAEx(ATPA[i], x, y) then
begin
MMouse(x,y, 0, 0);
if not Animating(IntToBox(x-40, y-40, x+40, y+40), 200, 130) then
if WaitUpText('ock', 330) then
begin
Mouse(x,y, 0, 0, true);
FoundRock := True;
Result:= True;
writeln('Found rock in: '+IntToStr(GetSystemTime-T)+' msec..');
Break;
end;
end;
end;
function LoadRockInfo(Name : string) : TRock;
begin
if not LoggedIn then Exit;
SetLength(Rocks,3); //0 - tin, 1 - copper, 2 - iron
case Lowercase(Name) of
'tin' : begin
Rocks[0].Name:= 'Tin';
Rocks[0].Color:= 8092546;
Rocks[0].Huemod:= 0.24;
Rocks[0].Satmod:= 0.07;
Rocks[0].Tol:= 14;
end;
'copper': begin
Rocks[1].Name:= 'Copper';
Rocks[1].Color:= 4022666;
Rocks[1].Huemod:= 0.03;
Rocks[1].Satmod:= 0.08;
Rocks[1].Tol:= 9;
end;
'iron': begin
Rocks[2].Name:= 'Iron';
Rocks[2].Color:= 2568006;
Rocks[2].Huemod:= 0.07;
Rocks[2].Satmod:= 0.13;
Rocks[2].Tol:= 5;
end;
end;
for iii:= 0 to High(Rocks) Do
begin
Rocks[iii].Func:= @FindRocks;
if not (Lowercase(Name) <> Rocks[iii].Name) then
begin
Result := Rocks[iii];
Break;
end;
end;
end;
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
0: RandomRClick;
1: PickUpMouse();
2: RandomMovement;
3: ExamineInv();
4..7: begin
GameTab(RandomRange(TAB_Combat,TAB_LOgout));
Wait(800+Random(700));
FindNormalRandoms;
end;
8..10 : SleepAndMoveMouse(2000);
end;
end;
procedure WaitWhileMine;
var iy : shortint;
begin
if not LoggedIn then Exit;
while (invcount = prevcount) and (Iy < 100) do
begin
if Integer(Trunc(Sin(90))*2=Random(4)) > 0 Then
AntiBan;
Inc(iy)
end;
if invcount > prevcount then
writeln('Mined Rock');
wait(8);
Exit;
end;
procedure MineOres;
begin
if not LoggedIn then Exit;
repeat
FoundRock:= False;
PrevCount := InvCount();
If not Rocks[iii].Func() then
WaitWhileMine
else
if FoundRock then
begin
writeln('found the rock!');
WaitWhileMine;
end;
until(InvFull) XOR (Integer(LoggedIn) <1);
if not LoggedIn then
begin
Writeln('The currentplayer logged out');
NextPlayer(False);
end;
end;
function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..5] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 663;
dtmMainPoint.y := 47;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindTreeColor;
dtmMainPoint.Tolerance := 50;
dtmSubPoints[0].x := 663;
dtmSubPoints[0].y := 47;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindTreeColor;
dtmSubPoints[0].Tolerance := 255;
dtmSubPoints[1].x := 667;
dtmSubPoints[1].y := 45;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindTreeColor;
dtmSubPoints[1].Tolerance := 90;
dtmSubPoints[2].x := 666;
dtmSubPoints[2].y := 49;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 604732;
dtmSubPoints[2].Tolerance := 90;
dtmSubPoints[3].x := 661;
dtmSubPoints[3].y := 44;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindTreeColor;
dtmSubPoints[3].Tolerance := 90;
dtmSubPoints[4].x := 669;
dtmSubPoints[4].y := 34;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 8817034;
dtmSubPoints[4].Tolerance := 90;
dtmSubPoints[5].x := 675;
dtmSubPoints[5].y := 41;
dtmSubPoints[5].AreaSize := 0;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := 8817034;
dtmSubPoints[5].Tolerance := 90;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
function GetToVEB : Boolean;
var
BankerTPA :TPointArray;
ATPA :T2DPointArray;
P:TPoint;
begin
if not LoggedIn then Exit;
if not FindSymbol(x, y, 'bank') then
writeln('Symbol not found - trying TPABankers')
else
begin
Result := True;
MouseFlag(x,y, 0,0,0);
Exit;
end;
FindColorsTolerance(BankerTPA,195836, MMX1, MMY1, MMX2, MMY2,15);
ATPA:= SplitTPA(BankerTPA,7);
SortATPASize(ATPA,True);
P:= MiddleTPA(ATPA[0]);
Mouse(P.X -15,P.Y -10, 30, 3, True);
//debugatpa(atpa, '');
if not Flagpresent then
Result:= False
else
fflag(0);
end;
procedure Bank;
var TempDTM:Integer;
TP:TPointArray;
begin
if not LoggedIn then Exit;
TempDTM:= SetDDTM;
if DTMRotated(TempDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then
begin
Mouse(X + 9,Y,0,0, True);
FFlag(0);
end;
FreeDTM(TempDTM);
begin
TP := [Point(Round(60 * Sin(335 * Pi / 180)) + MMCX,
Round(-60 * Cos(335 * Pi / 180)) + MMCY),
Point(Round(70 * Sin(346 * Pi / 180)) + MMCX,
Round(-70 * Cos(346 * Pi / 180)) + MMCY),
{ next path}
Point(Round(65 * Sin(360 * Pi / 180)) + MMCX,
Round(-65 * Cos(360 * Pi / 180)) + MMCY),
Point(Round(70 * Sin(350 * Pi / 180)) + MMCX,
Round(-70 * Cos(350 * Pi / 180)) + MMCY),
{ next path}
Point(Round(65 * Sin(340 * Pi / 180)) + MMCX,
Round(-65 * Cos(340 * Pi / 180)) + MMCY),
Point(Round(70 * Sin(330 * Pi / 180)) + MMCX,
Round(-70 * Cos(330 * Pi / 180)) + MMCY)];
Mouse(RandomRange(TP[0].x, TP[1].x),
RandomRange(TP[0].y, TP[1].y), 2, 2, True);
FFlag(0);
writeln('Walked path one');
Mouse(RandomRange(TP[2].x, TP[3].x),
RandomRange(TP[2].y, TP[3].y), 2, 2, True);
FFlag(0);
writeln('Walked path two');
Mouse(RandomRange(TP[4].x, TP[5].x),
RandomRange(TP[4].y, TP[5].y), 2, 2, True);
FFlag(0);
writeln('Walked path three');
end;
MouseFlag(MMCX - 70,MMCY,0,0,0);
if not GetToVEB then
begin
writeln('didn''t make the bank :-----{');
nextplayer(false);
exit;
end;
if OpenBankFast('veb') then
if BankScreen then
Deposit(2, 28, True);
CloseBank;
Inc(Loads);
disguise('Banked '+IntToStr(Loads)+' loads!');
Writeln('banked :)');
end;
begin
SetupSRL;
SRLPlayerForm(False, [], ['Loads'],
['Rock to mine (Tin, Copper or Iron)'], []);
{$IFDEF SRL_SMART}
SetTargetDC(SMARTGetDC);
{$ENDIF}
writeln('loaded!');
if not loggedin then loginplayer;
repeat
repeat
WalktoMine;
MineOres;
Bank;
until (loads >= Players[CurrentPlayer].Integers[0]) or not loggedin;
NextPlayer(loads >= Players[CurrentPlayer].Integers[0]);
until(PlayersActive=0);
terminatescript;
end.