View Full Version : Mining
Bad Boy JH
10-07-2010, 05:32 AM
I am creating a Al-Kharid Iron Miner/Smelter/Banker. I have a question about what people think I should do...
to find the rocks, should I use GetObjectByID and then click that, or have a set of 2 or 3 rocks, which are in a group and just check those rocks, choosing a rock which has no players, and if all rock sets have players, choose one at random or world hop, or do the first option (check for closest rock).
Also please note in my sig, I am 10 levels away from 1000 total level on my main, which I mostly play on (as in I don't bot often), No real need for that, I just noticed, and was excited
i luffs yeww
10-07-2010, 05:50 AM
Try out both, see which is fastest and most accurate? I think having the set of rocks would be more human-like and faster, but I'd have a couple sets (PrimaryIron := []; and SecondaryIron := []; or something); if all the iron in PrimaryIron is empty, try SecondaryIron. :)
TomTuff
10-07-2010, 05:52 AM
prioritize by sets, if it fails to get ore more than x amount of times in y amount of minutets, go to next set. If it goes through all sets, world hop, repeat.
Bad Boy JH
10-07-2010, 11:55 AM
I think I will go with Sets, and as a fall back go to searching for the closest...
Also holy crap, i just got 27 iron bars from 28 iron ores...lucky me...
i luffs yeww
10-07-2010, 02:27 PM
I assume you're f2p, then.
You should add ring of forging support. :)
Bad Boy JH
10-08-2010, 02:52 AM
I don't fully understand how they work,
If you want to tell me how they work, and give me uptext and a bitmap, I should be able to do so...
i luffs yeww
10-08-2010, 06:39 PM
"When equipped, rings of forging increase the chance of successfully smelting iron ore from 50% (80% after 45 smithing is reached) to 100%. The bonus only applies when smelting iron ore in a furnace; it will not trigger when using Superheat Item. After smelting 140 such ores, the ring will disintegrate."
(http://runescape.wikia.com/wiki/Ring_of_forging)
It makes you profit 110 (ish) (before 45 smith) each bar, rather than -60 (ish) (before 45 smith) without it.
Bad Boy JH
10-09-2010, 01:25 PM
so...basically...
I need to have something check how many charges it has, if its disintegrated, withdraw another, equip it, and continue?
can someone think of a better way of doing this...It has reflection and srl included (and smithing.scar - and yes I know some of that is stuffed up...)
Function LoadRocks(WhichSet: Integer): TRSObjectArray;
var
ThePoint: TPoint;
begin
Case WhichSet of
1 : begin
SetLength(Result, 3);
Result[0] := NewObject(37307, 0, Tile(3296, 3312));
Result[1] := NewObject(37308, 0, Tile(3297, 3311));
Result[2] := NewObject(37309, 0, Tile(3297, 3310));
end;
2 : begin
SetLength(Result, 2);
Result[0] := NewObject(37307, 0, Tile(3302, 3309));
Result[1] := NewObject(37307, 0, Tile(3303, 3310));
end;
3 : begin
SetLength(Result, 2);
Result[0] := NewObject(37309, 0, Tile(3301, 3301));
Result[1] := NewObject(37307, 0, Tile(3302, 3302));
end;
4 : begin
SetLength(Result, 2);
Result[0] := NewObject(37307, 0, Tile(3300, 3287));
Result[1] := NewObject(37309, 0, Tile(3300, 3286));
end;
end;
end;
Function MineRock(WhichSet: Integer): Boolean;
var
I, Mark: Integer;
ThePoint: TPoint;
Rocks: TRSObjectArray;
begin
if R_GetMMLevels('run') > 80 then
SetRun(True);
Rocks := LoadRocks(WhichSet);
For I := 0 to High(Rocks) do
if FindRSObject(Rocks[i]) then
Break;
if I > High(Rocks) then Exit;
ThePoint := TileToMS(Rocks[i].Tile, RandomRange(4, 10));
MMouse(ThePoint.x, ThePoint.y, 5, 5);
if R_IsUpText('Mine') then
begin
Result := True;
ClickMouse2(True)
end else begin
ClickMouse2(False);
Result := R_ChooseOption('Mine');
end;
Wait(RandomRange(500, 1000));
if Result then
begin
Result := False;
MarkTime(Mark);
While TimeFromMark(Mark) < 15000 do
begin
Wait(RandomRange(150, 250));
If not CharacterMoving then
begin
MarkTime(Mark);
While TimeFromMark(Mark) < 30000 do
begin
Wait(RandomRange(150, 250));
If not CharacterAnimating then
begin
Result := True;
Exit;
end;
end;
end;
end;
end;
end;
i luffs yeww
10-09-2010, 03:40 PM
I don't like the WhichSet thing.. I just think that if it doesn't find anything from the top tier rocks, go down a level, doesn't find from second tier, go down a level, etc.
Other than that, it looks good from a quick skim. :)
Bad Boy JH
10-10-2010, 08:23 AM
There was going to be another function (which I have created now) which dectects which sets of rocks to use. Interesting issue, if you are competing against someone for the rock you continue animating, and CharacterAnimating stays true (which I assume jagex did screw around with Java Bots). So I now have it checking for the rocks dissapearance.
So far I have the Walking, Banking, Smelting done. Just need to fix some issues with the mining, and fix up things like gem dropping (optional obviously) and add progress report style stuff... then look out world, here comes some smithing levels...
Also...will this execute procedures in order? ie proc1, then proc2 then proc3. and double check, it will exit if any of them return false...
[simba] if not(Proc1 and Proc2 and proc 3) then
exit;
i luffs yeww
10-10-2010, 08:36 AM
It depends on if they're true or false. IceFire just looked into this (along with TRiLeZ, but IceFire gave an easier-to-understand example of it, in my opinion).
Very interesting
program new;
function a: boolean;
begin
Wait(1000);
Writeln('a');
Result := False;
end;
function b: boolean;
begin
Wait(1000);
Writeln('b');
Result := False;
end;
function c: Boolean;
begin
Wait(1000);
Writeln('c');
Result := False;
end;
var
T: Integer;
begin
T := GetSystemTime;
if (a and b and c) then
Writeln('k');
WriteLn(GetSystemTime - T);
end.
Simba :
Compiled succesfully in 15 ms.
a
1107
Successfully executed.
SCAR 3.25
Successfully compiled (78 ms)
a
998
Successfully executed (998 ms)
but SCAR 3.23 and older
Successfully compiled (2568 ms)
a
b
c
2995
Successfully executed
Nice find.
So you should do if(Proc1)then if(Proc2)then if(Proc3)then exit; I think.
Bad Boy JH
10-10-2010, 09:22 AM
I only want it to exit if any are false, should I use
if not ProcA then
Exit;
if not ProcB then
Exit;
if not ProcC then
Exit;
i luffs yeww
10-10-2010, 09:31 AM
if(not(ProcA))then
Exit
else
if(not(ProcB))then
Exit
else
if(not(ProcC))then
Exit;
:) Doesn't really change anything. You've the right idea.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.