Rick
2007-01-07 15:59:58
r!ch!e - SRL Member Application Form
r!ch!e
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
Other Communitys
Moparisthebest.com, Drewley.net
How Long have You Played Runescape
6-7 months
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
I came here a few months ago and didnt know ANYTHING about how to script, but now after reading a few tutorials and the general helpfullness of the members i understand how to. I really enjoy scripting and helping with errors.
(Is that enough?…)
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
——————————————————
r!ch!e
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
Other Communitys
Moparisthebest.com, Drewley.net
How Long have You Played Runescape
6-7 months
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
I came here a few months ago and didnt know ANYTHING about how to script, but now after reading a few tutorials and the general helpfullness of the members i understand how to. I really enjoy scripting and helping with errors.
(Is that enough?…)
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
{=========================================================================]
[ RichPowerMiner ]
[ Version: 1.12 ]
[=========================================================================]
| Description: |
| A Macro that automaticly mines for you |
[=========================================================================]
[Setup: Fill in the const, run the script, and fill in the player form ]
[ ]
[=========================================================================]
[Version: ]
[0.1- Began making the miner ]
[0.5- Decided to leave the script until i knew more SRL procedures ]
[0.9- Continued With the script and made it alot better ]
[1.0- Put in global stats ]
[1.1- Tweaked Mining loop ]
[1.11- Altered and Improved some antiban procedures ]
[1.12- Fixed a bug causing total runs to go incredibly high ]
[=========================================================================]
[Future Updates: Forms, Forms, Forms!!!! and other nifty procedures ]
[ ]
[------If there is something you wish for me to update please tell me-----]
[=========================================================================]
[Notes: Occasional error in my randommouse procedure. ]
[=========================================================================}
Program RichPowerMiner;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Mining.scar}
{.include SRL/SRL/extended/xMapWalk.scar}
{.include SRL/SRL/Misc/Trade.scar}
{.include SRL/SRL/extended/xAntiRandoms.Scar}
{.include SRL/SRL/Misc/PlayerForm.Scar}
const
LoginTime = 1000; // Time to stay logged in. (Mins)
RandomTime = 200; // Random time added to above ^^^^
OreToMine = ''; // Copper, Tin, Clay, Iron, Silver, Coal, Gold, Mithril, Adamant, Runite
IsPickEquiped = True; // Is your pickaxe equiped
RandomNextPlayers= False; // Random Next Player?
YourSRLStatsID = ''; // Your SRL Stats ID#, Must be a string!
YourSRLStatsPass = ''; // Your SRL Stats Password, Must be a string!
OreTol = 9; // Anything between 4 - 19.
RunDir = 'N'; // RunDirection when you find a fight.
RunFar = False; // Run Far when you find a fight
Speed = 5; // Speed of script. Best to leave this.
LoginFace = 'N'; // Face this direction when you login
RockWaitTime = 18; // Seconds to wait whilst mining the ore
EatDwarfItems = True; // Eat dwarf items instead of dropping them?
AutoColor = True; // Auto Color?
MinCount = 4; // Don't change unless you know what your doing
usecustomrandoms = False; // Occasionally let the script search for the antirandoms specified by you
fTalk = True; // Search for Talk
fMisc = True; // Search for Misc Randoms
fLamp = True; // Search for Lamps
fBox = True; // Search for Box
fDemon = True; // Search for Demon
fScapeRune = True; // Search for ScapeRune
fTrade = True; // Search for Trades
fGameTab = True; // Search for No Game Tab
fPinball = True; // Search for PinBall
fFrog = True; // Search for Frog
fCerter = True; // Search for Certers
fSandwich = True; // Search for Sandwich Lady
fPlant = True; // Search for Plant
fBlack = True; // Search for Black
fClickContinue = True; // Search for Any Click To Continue's
var
OreMask, OreCounter,z, Dx, Dy,RandomTime2,LoginTime2,PlayTime, STime,CalTime,TotalOres,TotalRuns : Integer;
ScriptStartTime1, ScriptStartTime2,FindNorMalRandomsTime, FindFastRandomsTime: LongInt;
PlayerTrue: Boolean;
var
Copper,Tin,Clay,Iron,Silver,Coal,Gold,Mithril,Adamant,Runite : integer;
const
Version = '1.12'; //leave this
{******(-------)******)
(***(--- Bmp's ---)***)
(******(-------)******}
procedure LoadBmps;
begin
OreMask := BitmapFromString(9, 8, 'z78DA333040076E6080C9C60' +
'F064A17F17A71E9C2AFD70D03E09725DE4CF2DC0F00DCD05C59');
end;
{**********(-------)*********)
(****(--- Ore Colors ---)****)
(**********(-------)*********}
procedure DeclareOreColors;
begin
case random(1) of
0: begin
Copper := 4088198;
Tin := 9277080;
Clay := 4553880;
Iron := 2371664;
Silver := 12434885;
Coal := 2834753;
Gold := 5161431;
Mithril := 7359564;
Adamant := 6322272;
Runite := 8681306;
end;
1: begin
Copper := 4286610;
Tin := 9277080;
Clay := 4553880;
Iron := 1910851;
Silver := 12434885;
Coal := 2834753;
Gold := 1881051;
Mithril := 7359564;
Adamant := 6322272;
Runite := 8681306;
end;
end;
end;
Procedure SetOreColor;
Begin
Case LowerCase(Players[CurrentPlayer].String1) Of
'copper' : OreColor1:=Copper;
'tin' : OreColor1:=Tin;
'clay' : OreColor1:=Clay;
'iron' : OreColor1:=Iron;
'silver' : OreColor1:=Silver;
'coal' : OreColor1:=Coal;
'gold' : OreColor1:=Gold;
'mithril' : OreColor1:=Mithril;
'adamant' : OreColor1:=Adamant;
'runite' : OreColor1:=Runite;
End;
End;
Procedure AutoGetRockColors; //Taken From Wizzup.
Var
ATPoint : TPoint;
Begin
WriteLn('AutoColor:');
If FindObjOre(ATPoint.X, ATPoint.Y, 'Mine', OreColor1, 9, MinCount) Then
OreColor1 := GetColor(ATPoint.X, ATPoint.Y);
WriteLn(Players[CurrentPlayer].String1+' Color = '+IntToStr(OreColor1));
End;
{**************(-------)*************)
(****(--- Usefull Pocedure's ---)****)
(**************(-------)*************}
procedure EatDwarfItem;
var
tp: TPointArray;
i: Integer;
begin
GameTab(4);
tp := FindItems(1876180, 10, 'Drink Be', 0);
for i := 0 to (GetArrayLength(tp) - 1) do
begin
Mouse(tp[i].x, tp[i].y, 1, 1, true);
Wait(500 + random(500));
Mouse(tp[i].x, tp[i].y, 1, 1, false);
ClickOption('Drop', 2);
end;
tp := FindItems(6591919, 10, 'Eat Ke', 0);
for i := 0 to (GetArrayLength(tp) - 1) do
Mouse(tp[i].x, tp[i].y, 1, 1, true);
tp := FindItems(5470833, 10, 'Eat', 0);
for i := 0 to (GetArrayLength(tp) - 1) do
Mouse(tp[i].x, tp[i].y, 1, 1, true);
end;
procedure EatSandwichLadyItem; //Still working on this
var
tp: TPointArray;
i: Integer;
begin
GameTab(4);
tp := FindItems(6591919{need color}, 10, 'Eat Tria', 0);
for i := 0 to (GetArrayLength(tp) - 1) do
Mouse(tp[i].x, tp[i].y, 1, 1, true);
tp := FindItems(5470833{need color}, 10, 'Eat', 0);
for i := 0 to (GetArrayLength(tp) - 1) do
Mouse(tp[i].x, tp[i].y, 1, 1, true);
end;
Procedure Destroy(reason:string; PlayerLost: Boolean);
begin
Writeln(reason);
if playerlost then
Players[CurrentPlayer].Loc := reason;
if(LoggedIn)then Logout;
NextPlayer(false);
PlayerTrue := false;
end;
procedure MyRunAway(Double, RunBak: Boolean; RunDir: string);
var
TempMouseSpeed, Rx, Ry : integer;
begin
TempMouseSpeed := MouseSpeed
MouseSpeed := 1;
SetRun(true);
Writeln('Running away from fight!');
case LowerCase(RunDir) of
'n' : begin Rx := 646; Ry := 46; end;
'e' : begin Rx := 683; Ry := 85; end;
'w' : begin Rx := 609; Ry := 84; end;
's' : begin Rx := 650; Ry := 122; end;
end;
Mouse(Rx, Ry, 5, 5, true);
FFlag(0);
if(Double)then
begin
Mouse(Rx, Ry, 5, 5, true);
FFlag(0);
end;
IdleTime(10000 + Random(10000), 500, 1.0);
case LowerCase(RunDir) of
'n' : begin Rx := 652; Ry := 122; end;
'e' : begin Rx := 611; Ry := 81; end;
'w' : begin Rx := 685; Ry := 81; end;
's' : begin Rx := 646; Ry := 46; end;
End;
Mouse(Rx, Ry, 5, 5, true);
FFlag(0);
if(Double)then
begin
Mouse(Rx, Ry, 5, 5, true);
FFlag(0);
end;
if RunBak then
RunBack;
MouseSpeed := TempMouseSpeed;
end;
Procedure PlayerStats;
var Active,Equipped: string;
var i: Integer;
begin
if Players[CurrentPlayer].Active=True then
Active:='True'
else
Active:='False';
if EquipPick then
Equipped:='True'
else
Equipped:='False';
writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
writeln('Name : '+ Players[CurrentPlayer].Name);
writeln('Number : '+ inttostr(CurrentPlayer));
writeln('Active : '+ Active);
writeln('Pick Equipped: '+ Equipped);
writeln('Location : '+ Players[CurrentPlayer].loc);
writeln('Mining Level : '+ inttostr(Players[CurrentPlayer].Level[15]));
writeln('Ores Mined : '+ floattostr(Players[CurrentPlayer].Extended1));
writeln('Loads Done : '+ floattostr(Players[CurrentPlayer].Extended2));
writeln('Worked for : '+ TimeRunning);
if(Players[CurrentPlayer].Banked > 0) then
writeln('Banked : '+ inttostr(Players[CurrentPlayer].Banked) + ' times.');
writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
for i := 0 to HowManyPlayers-1 do
begin
if Players[i].Active=True then Active:='True' else Active:='False';
writeln( (inttostr(i))+' : '+Players[i].name+ ' = '+Active
+'. - Lvl: '+inttostr(Players[i].Level[15])
+'. - W: '+ TimeRunning
+' - Ores: '+floatToStr(Players[i].Extended1)
+'. - Loads: '+floatToStr(Players[i].Extended2)
+'. - Loc: '+Players[i].loc);
end
writeln('**********************************************');
end;
procedure ProgReport; //I have gathered many other prog repots and mashed them into one.
var PActive: string;
begin
If Players[CurrentPlayer].Active then PActive:='True' else PActive:='False';
Writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
Writeln('|RichPowerMiner ' + Version + ' Progress Report');
Writeln('|Total Runs This Script Has Had ' + inttostr(TotalRuns) + '.');
Writeln('|Mined A Grand Total of '+intToStr(TotalOres)+' ores.');
//If(GasAvoided > 0)Then Writeln('|Avoided gas '+inttostr(GasAvoided)+' times.');
WriteLn('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>')
WriteLn('')
Writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
Writeln(' Name : '+Players[CurrentPlayer].Name);
Writeln(' Mining Lvl : '+IntToStr(Players[CurrentPlayer].Level[15]));
Writeln(' Active : '+PActive);
Writeln(' Location : '+Players[CurrentPlayer].Loc);
Writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
PlayerStats;
SRLRandomsReport;
end;
function PlayerNoPick(player : integer) : boolean;
begin
result := Players[Player].Boolean2;
end;
procedure NextPlayer2(active: Boolean);
begin
if RandomNextPlayers then begin
RandomNextPlayer(active);
end else
NextPlayer(active);
end;
{**********(-------)**********)
(**(--- Random Activity ---)**)
(**********(-------)**********}
procedure RandomMouse(Time: Integer; InsideClient: Boolean); //Occasional errors... :( Other than that, works like a charm
var
Width, Height: Integer;
StartTime: Integer;
begin
GetClientDimensions(Width, Height);
StartTime:= GetTickCount;
repeat
if InsideClient then begin
MMouse(width - random(1000), height - random(1000),1,1);
end else
MMouse(Random(Width) - 10, Random(Height) - 10,random(500),random(500));
until(GetTickCount - StartTime >= Time);
end;
procedure RandomCompass;
var H,Key:integer;
begin
case random(1) of
0: begin
case random(3) of
0: MakeCompass('n');
1: MakeCompass('e');
2: MakeCompass('s');
3: MakeCompass('w');
end;
end;
1: begin
case Random(1) of
0: key := 37; //left arrow
1: key := 39; //right arrow
end;
MarkTime(H);
while TimeFromMark(H) < 1000 + random(2000) - random(2000) do
KeyDown(key);
KeyUp(key);
end;
end;
end;
procedure RandomGameTab;
var i,a,px,py : integer;
begin
i := 1 + Random(12);
GameTab(i);
Case i of
1: SetFightMode(1 + random(3));
2: HoverSkill('random',false);
4: begin
a := 1 + random(27);
if ExistsItem(a) then
begin
MMouseItem(a);
GetMousePos(px,py);
ChooseOption(px,py,'xami');
end;
end;
12: RandomEmote;
end;
end;
procedure RandomMovement2;
var s: String;
begin
case random(2) of
0: case random(2) of
0: RandomMouse(2000,True);
1: RandomCompass;
2: RandomGameTab;
end;
1: Case Random(6) of
0: if Random(5) < 1 then GhostSpeak('Mining');
1: AntiBan;
2: if Random(5) < 1 then RandomChat;
3: begin
if Random(5) < 1 then
RandomGameTab;
end;
4: if Random(5) < 1 then
begin
Case Random(3) of
0: s := 'n';
1: s := 's';
2: s := 'w';
3: s := 'e';
end;
Case Random(1) of
0: RandomCompass;
1: MakeCompass(s);
end;
end;
5: ;
6: BoredHuman;
end;
2: if random(5) < 1 then
if random(1) = 0 then begin
RandomMovement;
end else
RandomMovement2;
end;
end;
{******(-------)******)
(**(--- Randoms ---)**)
(******(-------)******}
Function FindFastRandoms: Boolean; // By WT-Fakawi.
Var
i: Integer;
Begin
For I := 1 To 12 Do
Begin
Case I Of
1: If FindDead Then
Result := True;
2: If FindMod Then
Result := True;
3: If FindMime Then
Result := True;
4: If FindMaze Then
Result := True;
5: If FindQuiz Then
Result := True;
6: If FindDemon Then
Result := True;
7: Begin
If NoGameTab Then
Begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
End;
End;
8: Begin
If InBlack Then
Begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
End;
End;
9 : If RC Then
Result := True;
10 : If FindFight Then
Begin
Result := True;
//RunTo(RunDir, RunFar);
MyRunAway(RunFar, True, RunDir);
End;
11: If FindTalk Then
Result := True;
12: If HandleTrade Then
Result := True;
End;
Wait(1);
End;
End;
Procedure RichFTWaitAll(Time:Integer);
var t: integer;
begin
For T:=1 to Time do
begin
Wait(50+Random(50));
FindTalk;
RC;
HandleTrade;
end;
if usecustomrandoms then begin
FindNormalRandomsChoice(fTalk,fMisc,fLamp,fBox,fDemon,fScapeRune,fTrade,fGameTab,fPinball,fFrog,fCerter,fSandwich,fPlant,fBlack,fClickContinue);
end else
FindFastRandoms;
MarkTime(FindNormalRandomsTime);
if FindNormalRandomsTime-ScriptStartTime1 >(10000+Random(5000)) Then
begin
FindNormalRandoms;
MarkTime(ScriptStartTime1);
end;
MarkTime(FindFastRandomsTime);
if FindFastRandomsTime-ScriptStartTime2 >(1500+Random(1500)) Then
begin
FindFastRandoms;
MarkTime(ScriptStartTime2);
end;
end;
{***********(-------)***********)
(**(--- Mining Procedures ---)**)
(***********(-------)***********}
//The Following two functions are stolen from wizzup's great PowerMiner
//Function FindOre(MaxTol:Integer):Boolean;
//Function Mine:Boolean;
Function FindOre(MaxTol:Integer):Boolean;
Var
Tol, X, Y:Integer;
D: Extended;
Begin
If OreCounter > 3 Then OreCounter := 1;
Case OreCounter Of
1: OreColor:= OreColor1;
2: OreColor:= OreColor2;
3: OreColor:= OreColor3;
End;
x := MSCX;
y := MSCY;
If FindObjOre2(Dx, Dy, 'Mine', OreColor, Tol, MinCount) Then
Begin
OreColor := GetColor(Dx, Dy);
D := distance(x, y, Dx, Dy);
dx := dx + trunc( (Random(10) + 7) * (dx - x) / d);
dy := dy + trunc( (Random(10) + 7) * (dy - y) / d);
Result := True;
End;
End;
Function Mine:Boolean;
Var
RockMark: Integer;
Failed: Boolean;
Begin
repeat
if not(LoggedIn)then Exit;
If Not FindOre(OreTol) Then
Begin
OreCounter := OreCounter + 1;
Exit;
End;
GetMousePos(X, Y);
If FindGas(X, Y) Then
// If FindGas(X, Y - 20) Then
Begin
RichFTWaitAll(200);
Exit;
End;
Mouse(X, Y, 0, 0, True);
OreCounter := 1;
OreColor := GetColor(X, Y);
MarkTime(RockMark)
Repeat
Wait(Speed);
X := Dx;
Y := Dy;
If Not FindColorSpiralTolerance(Dx, Dy, OreColor, MSX1, MSY1, MSX2, MSY2, OreTol)
Or (Distance(X, Y, Dx, Dy) > 20) Then
Begin
Failed := True;
Break;
End;
Until (TimeFromMark(RockMark) > 1500);
If GetColor(195, 426) = 0 Then Failed := False;
If Failed Then
Exit;
X := Dx;
Y := Dy;
FindPick;
Result := True;
MarkTime(RockMark);
Repeat
Wait(Speed);
// If FindGas(Dx, Dy - 20) Then
If FindGas(Dx, Dy) Then
Begin
Mouse(646, 82, 3, 3, True);
RichFTWaitAll(250);
End;
If Random(4) = 3 Then FindNormalRandoms;
Dx := X;
Dy := Y;
If Not FindColorSpiralTolerance(Dx, Dy, OreColor, MSX1, MSY1, MSX2, MSY2, OreTol) Then
Begin
Exit;
End;
FindPick;
if random(2) = 0 then
RandomMovement2;
if FindFight then begin MyRunAway(RunFar, True, RunDir); end;
if(NoPick)then begin
Destroy('No more Pick Axes', False);
NoPick := False;
end;
{If FindFight Then
Begin
MakeCompass('N');
RunTo(RunDir, True);
MakeCompass(LoginFace);
Break;
End;}
Until (TimeFromMark(RockMark) > RockWaitTime * 1000) Or (Distance(X, Y, Dx, Dy) > 10);
until(InvFull)
End;
{*******(-------)*******)
(**(--- Drop Ores ---***)
(*******(-------)*******}
Procedure DropOre;
var j: String;
jj,k: Integer;
begin
TotalOres := TotalOres + CountItemBmpMaskTol(OreMask, 5, 5);
ReportVars[0] := ReportVars[0] + TotalOres;
k:= TotalOres;
j:= LoadSetting('Totals', 'Total Ores');
if (j='') then
j:='0';
JJ:= strtoint(J);
if (JJ= 0) then begin
JJ:= K;
end else
JJ := JJ + K;
SaveSetting('Totals','Total Ores', inttostr(JJ));
Players[CurrentPlayer].Extended1:= Players[CurrentPlayer].Extended1 + CountItemBmpMaskTol(OreMask, 5, 5);
Players[CurrentPlayer].Extended2:= Players[CurrentPlayer].Extended2 + 1; //amount of loads
ClickAllItemsBmpMaskTolWait('rop', OreMask, 10, 5, 300);
if EatDwarfItems then begin
EatDwarfItem
end else
DwarfItem;
ClickAllItemsBmpMaskTolWait('rop', OreMask, 10, 5, 300);
if EatDwarfItems then begin
EatDwarfItem
end else
DwarfItem;
end;
{******(-------)******)
(***(--- Setup ---)***)
(******(-------)******}
Procedure SetupChats;
Begin
SetChat('On', 1);
SetChat('On', 1);
SetChat('Friends', 2);
SetChat('Friends', 2);
SetChat('On', 3);
SetChat('On', 3);
End;
Procedure SetupScript;
var j: String;
jj: Integer;
begin
j:= LoadSetting('Totals', 'Total Runs');
JJ:= strtoint(J);
if (JJ= 0) then begin
JJ:= 1;
end else
JJ := JJ + 1;
TotalRuns:= JJ;
SaveSetting('Totals','Total Runs', inttostr(TotalRuns));
ReportVars[1] := ReportVars[1] + 1;
SetupSRL;
ScriptID := '49';
SetupSRLMining;
SetUpSRLReport;
SRLID := YourSRLSTATSID;
SRLPassword:= YOURSRLSTATSPASS;
LoadBmps;
SetupPlayers;
Players[CurrentPlayer].String1:= OreToMine;
Players[CurrentPlayer].Boolean1:= IsPickEquiped;
LoginTime2:= LoginTime * 1000 * 60;
RandomTime2:= RandomTime * 1000 * 60;
PlayTime:= LoginTime2 + Random(RandomTime2);
DeclareOreColors
SetOreColor;
ActivateClient;
end;
procedure SetupRS;
begin
MarkTime(STime);
MakeCompass(LoginFace);
SetupChats;
SetRun(True);
If AutoColor Then AutoGetRockColors;
EquipPick := Players[CurrentPlayer].Boolean1;
FindPickHeadColor;
Players[CurrentPlayer].Level[15] := GetSkillLevel('mining');
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
Procedure Regulate;
begin
HighestAngle;
SetupChats;
SetRun(true);
GetAllLevels;
end;
Procedure PowerMineLoop;
begin
repeat
if not LoggedIn or WeAreDead or (TimeFromMark(STime) > PlayTime) then break;
Mine;
DropOre;
if not LoggedIn or PlayerNoPick(CurrentPlayer) then break;
if(TimeFromMark(CalTime) > 150000 + random(100000))then
begin
Regulate;
ProgReport;
MarkTime(CalTime);
end;
until(TimeFromMark(STime) > PlayTime)
end;
{********(-------)********)
(***(--- Main Loop ---)***)
(********(-------)********}
begin
ClearDebug;
SetupScript;
for z := 0 to HowManyPlayers - 1 do
Wait(1000);
LoginPlayer;
Logs:= Logs + 1;
repeat
SetupRS;
PowerMineLoop;
if WeAreDead or PlayerNoPick(CurrentPlayer) or not LoggedIn then NextPlayer2(False) else NextPlayer2(True);
until(false)
end.——————————————————