zildjohn01
2008-05-02 21:22:29
Here it is, first draft, I ran it through one load (on tin) and it worked okay. Didn't get any randoms to test tho. Let me know what you think. If it fails at least try changing my colors before complaining :D
Instructions: Just locate your character anywhere where the new (veined) rocks are visible, and sit back and enjoy. Doesn't matter where the pick is. I tested it with tin in the Varrock east mines.
Uncommon feature – drops ore by DTM instead of blindly 1 through 28. I had a bunch of gems and money and crap in my inv and it kept those but dropped the ore. (h)
EDIT: second run through it failed to drop two of the ores… hmm. still no randoms.
Instructions: Just locate your character anywhere where the new (veined) rocks are visible, and sit back and enjoy. Doesn't matter where the pick is. I tested it with tin in the Varrock east mines.
Uncommon feature – drops ore by DTM instead of blindly 1 through 28. I had a bunch of gems and money and crap in my inv and it kept those but dropped the ore. (h)
EDIT: second run through it failed to drop two of the ores… hmm. still no randoms.
{*******************************************************************************
*************************** zildjohn01's Powerminer ****************************
********************************************************************************
* Weapon of choice: SCAR 3.15 / SRL 4.16 *
********************************************************************************
* Description: *
* The ubiquitous obligatory n00b powerminer *
********************************************************************************
* Instructions: *
* Low detail, 32-bit, highest brightness, crosshairs * *
* Set players and consts. *
* Run and enjoy. *
*******************************************************************************}
program PowerMiner;
{.include SRL\SRL.scar}
procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
Players[0].Name := 'ialmostforgot';
Players[0].Pass := 'toerase';
Players[0].Nick := 'myrealaccountlol';
Players[0].Strings[0] := 'tin'; // type of rock to mine
Players[0].Strings[1] := 'N'; // direction to run during fight
Players[0].Integers[0] := 5; // loads per logon
Players[0].Active := true;
CheckUserNicks;
end;
const
TotalRounds = 5;
{********** D O N ' T T O U C H B E L O W T H I S L I N E ***********}
SYSTEM_LAG = 1000; // higher for slower PCs
DEBUGGING = true; // useless crap to clutter debug box
ORE_TIN = $9898a4; ORE_COPPER = $48719d; ORE_IRON = $2d3b60;
var OreDTM : Integer;
procedure Outs(s : String); begin
writeLn('Player ' + IntToStr(CurrentPlayer) + ': ' + s);
end;
procedure OutD(s : String); begin
if(DEBUGGING) then Outs(s);
end;
procedure Anti; begin
LampSkill := 'mining';
FindNormalRandoms;
if FindFight then
RunAway(Players[CurrentPlayer].Strings[1], false, 3, 10000 + random(8000));
end;
function FirstFreeInvSlot : Integer; begin
for Result := 1 to 28 do
if not ExistsItem(Result) then
Exit;
Result := 0; // my script handles this condition elsewhere
end;
function AllInactive : Boolean;
var i : Integer; begin
Result := true;
for i := 0 to HowManyPlayers do
if Players[i].Active then
Result := false;
end;
function OreInSlot(i : Integer) : Boolean;
var x, y : Integer; b : TBox; begin
if not ExistsItem(i) then Exit;
b := InvBox(i);
Result := FindDTM(OreDTM, x, y, b.x1, b.y1, b.x2, b.y2)
end;
procedure DropOres;
var i : Integer; begin
OutD('Dropping all ore.');
for i := 1 to 28 do
if OreInSlot(i) then begin
OutD('Dropping inv #' + IntToStr(i));
DropItem(i);
end;
end;
function DoPlayer : Boolean;
var x, y, i, oreColor, failures, slot : Integer; begin
case Lowercase(Players[CurrentPlayer].Strings[0]) of
'tin': oreColor := ORE_TIN;
'copper' : oreColor := ORE_COPPER;
'iron' : oreColor := ORE_IRON;
else begin
Result := false;
Outs('Unknown rock type ''' + Players[CurrentPlayer].Strings[0] + '''.');
Exit;
end end;
//DropOres; // start fresh
if InvFull then begin
Outs('No room for more ore. Lighten yer load.');
Result := false;
Exit;
end;
repeat
repeat
slot := FirstFreeInvSlot;
OutD('First free slot: ' + IntToStr(slot));
if FindColorSpiralTolerance(x, y, ORE_TIN, MSX1, MSY1, MSX2, MSY2, 10) then begin
MMouse(x, y, 20, 20);
if not IsUpTextMultiCustom(['ine', 'ock']) then // Mine Rocks
MMouse(x, y, 5, 5);
if not IsUpTextMultiCustom(['ine', 'ock']) then // Mine Rocks
MMouse(x, y, 2, 2);
if not IsUpTextMultiCustom(['ine', 'ock']) then // Mine Rocks
MMouse(x, y, 0, 0);
if IsUpTextMultiCustom(['ine', 'ock']) then begin // Mine Rocks
//GetMousePos(x, y);
OutD('Clicking rock...');
repeat
case random(100) of
0: begin
Mouse(x, y, 0, 0, false);
ChooseOption('ospec'); // Prospect
Wait(2300 + random(1200));
if random(1) = 0 then begin // oops i meant "mine"
Mouse(x, y, 0, 0, false);
ChooseOption('ine');
end else
Mouse(x, y, 0, 0, true);
end;
1, 2, 3, 4, 5, 6: begin
Mouse(x, y, 0, 0, false);
ChooseOption('ine'); // Mine
end else
Mouse(x, y, 0, 0, true);
end;
Wait(1000 + random(500));
Anti;
for i := 0 to 8 + random(3) do begin
Wait(800 + random(400));
if ExistsItem(slot) then
Break;
end;
until ExistsItem(slot);
OutD('Ore successfully mined.');
end else begin
Outs('failed to click on ore...');
failures := failures + 1;
Wait(2000 + random(3000));
end;
end else begin
Outs('failed to find ore...');
failures := failures + 1;
Wait(5000 + random(4000));
end;
if(failures > 2) then begin
Outs('failed 3 times, switching players');
Result := false;
Exit;
end;
until InvFull;
DropOres;
Players[CurrentPlayer].Integers[90] := Players[CurrentPlayer].Integers[90] + 1;
if Players[CurrentPlayer].Integers[90] >= Players[CurrentPlayer].Integers[0] then begin
Outs('Finished all loads. Next account.');
NextPlayer(true);
Exit;
end else
Outs('Load finished. Keep on truckin...');
until false;
end;
begin
SetupSRL;
OreDTM := DTMFromString('78DA637460626008646440058C48249036264' +
'28D2D508D070135EE40352E04D40402D5781350E30B541346408D' +
'0B504D34A61A11643536F8CD61036200E7C904E0');
ClearDebug;
writeLn('************* zildjohn01''s Powerminer **************');
DeclarePlayers;
ActivateClient;
Wait(SYSTEM_LAG);
if not LoggedIn then LoginPlayer;
repeat
Wait(SYSTEM_LAG);
if not LoggedIn then NextPlayer(false);
NextPlayer(DoPlayer);
until AllInactive;
Outs('Future proggy here');
end. // yeah I should have freed the DTM, i know.....