SRL Archive - Archive

trojan - SRL Member Application


trojan

2011-05-15 08:10:33

How Long have You Played Runescape?
9 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Visual Basic 6, Pascal. (Learning C++ after exams)


Are you a member of any other communities?
No


Tell us about yourself…
From: trojan
I am a student studying Computing, Maths and Accountancy at college. This is my final year and after this I am studying Computer Science at Lancaster University.
I enjoy programming, going to the gym and eating (haha).



Please show us one (or multiple) of your scripts.
program RimmingtonIronMinerBanker;
{==============================================================================)

Rimmington M1D1 Iron Miner
by Trojan

================================================================================
Features:

x Fully Reflection
x Mines and banks iron ore
x Recommended Rune Pickaxe
x Accurate ore counting
x Anti-Ban
x Supports Explorer Ring Teleport

================================================================================
Requirements:

x Any Pickaxe
x 15 Mining

================================================================================
Setup:
x Fill out declare players
x Have player stood at either the deposit box or at the west of the mine
x Have a pickaxe wielded (Preferably Rune)

================================================================================
Versions
x 1.0 - Script working mines, banks.

x 1.1 - Picks up iron from floor, mining loop more efficient.

x 1.2 - Walking greatly improved/Banking fixed
Added gem counting

x 1.3 - Added Breaking
- Added Multi-Player

x 1.4 - Added option to drop/bank

x 1.5 - Added option to use explorer ring


(==============================================================================}
{$DEFINE SMART}
{$i srl\srl.scar}
{$i SRL/SRL/Misc/stats.simba}
{$i reflection\reflection.simba}

const
IronXp = 35;
IronPrice = 103; {services.runescape.com/m=itemdb_rs/Iron_ore/viewitem.ws?obj=440}
IronID = 440;
SaphID = 1623;
EmerID = 1621;
RubyID = 1619;
DiamID = 1617;
SRLStats_User = '';
SRLStats_Pass = '';
Debugger = False;
Version = 1.5;

var
RockID, ExhaustedRock :Array[0..1] of Integer;
RockTile :Array[0..1] of TTile;
LastCheckPickup :LongInt;
LastBreakTime, NextBreakTime :LongInt;
TimeToBreak :Integer;
PlayDrop :boolean;
Tries :integer;

Procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';

Integers[1] := 500; //How many ores to mine
Integers[2] := 250; //Randomness to add to ores to mine
Integers[3] := 30; //Minutes between breaks, random 20% added/taken
Integers[4] := 6; //Minutes to break for, random 20% added/taken

//Please don't put [0] true and [1] false for obvious reasons...
Booleans[0] := True; //Pickup ore? Mining still takes priority
Booleans[1] := True; //True = Bank. False = Drop.

Active := True;
end;

with Players[1] do
begin
Name := '';
Pass := '';
Nick := '';

Integers[1] := 250; //How many ores to mine
Integers[2] := 200; //Randomness to add to ores to mine
Integers[3] := 30; //Minutes between breaks, random 20% added/taken
Integers[4] := 10; //Minutes to break for, random 20% added/taken

//Please don't put [0] true and [1] false for obvious reasons...
Booleans[0] := True; //Pickup ore? Mining still takes priority
Booleans[1] := True; //True = Bank. False = Drop.

Active := True;
end;

{
Integers[10] = Levels Gained
Integers[11] = Ore Picked Up
Integers[12] = Ore Mined
Integers[13] = Time Run
Integers[14] = Time Breaking
Integers[15] = Number of Breaks
Integers[16] = AntiBan Times
Integers[17] = Times Banked
Integers[20] = Saphires
Integers[21] = Emeralds
Integers[22] = Rubies
Integers[23] = Diamonds
Integers[24] = Start Time
Integers[25] = Start Level
Strings[0] = Reason Player Terminated
}
end;

Procedure AntiBan;
var
x :integer;
begin
x := Random(200);
if x < 5 then
begin
Inc(Players[CurrentPlayer].Integers[16]);
Case (Random(9)) of
0..1: RandomMovement;
2: PickUpMouse;
3: GameTab(26);
4: GameTab(23);
5: HoverSkill('Mining', False);
6: BoredHuman;
7: ExamineInv;
8: RandomRClick;
9: begin
ExitToLobby;
Writeln('Dont Worry taking a random short rest');
Wait(15000 + Random(90000));
LogInPlayer;
end;
end;
end;
end;

Procedure Proggy;
var
HoursRun :Extended;
i :integer;
TotalOre :integer;
OreMined, OrePickedUp :integer;
TimeRun :Extended;
Level :integer;
begin
Players[CurrentPlayer].Integers[13] := GetTimeRunning - Players[CurrentPlayer].Integers[24];
Writeln('|==================================================================|');
Writeln('|Rimmington Iron Miner/Banker Version ' + FloatToStr(Version));
Writeln('|==================================================================|');
Writeln('|Total time run = ' + IntToStr(GetTimeRunning/60000) + ' minutes');
Writeln('|==================================================================|');
for i := 0 to (HowManyPlayers - 1) do
begin
TimeRun := Players[i].Integers[13] - Players[i].Integers[14]
HoursRun := (TimeRun / 3600000)
OreMined := Players[i].Integers[12];
OrePickedUp := Players[i].Integers[11];
TotalOre := OrePickedUp + OreMined;
Level := Players[i].Integers[25] + Players[CurrentPlayer].Integers[10]

Writeln('|Welcome ' + Players[i].Nick);
if Players[i].Booleans[1] then
begin
Writeln('|Gems gained: S = ' +IntToStr(Players[i].Integers[20])
+ ' E = ' + IntToStr(Players[i].Integers[21])
+ ' R = ' + IntToStr(Players[i].Integers[22])
+ ' D = ' + IntToStr(Players[i].Integers[23]));
Writeln('|Banked ' + IntToStr(Players[i].Integers[17]) + ' times');
end;

Writeln('|Ran for ' + IntToStr(Round(TimeRun/60000)) + ' minutes');
if Players[i].Booleans[0] then
Writeln('|Ore picked up = ' + IntTostr(OrePickedUp));
Writeln('|Ore mined = ' + IntToStr(OreMined));
Writeln('|Ore mined/Hour = ' + IntToStr(Round((OreMined)/(HoursRun))));
Writeln('|Total ore/Hour = ' + IntToStr(Round((TotalOre)/(HoursRun))));
Writeln('|Xp gained = ' + IntToStr(OreMined*IronXp));
Writeln('|Xp/Hour = ' + IntToStr(Round((OreMined*IronXp)/(HoursRun))));
Writeln('|Gained ' + IntToStr((Players[i].Integers[10])) + ' levels');
Writeln('|Mining Level = ' + IntToStr(Level));
Writeln('|Player Status = ' + Players[CurrentPlayer].Strings[0]);
if Players[i].Booleans[1] then
begin
Writeln('|Money Gained = ' + IntToStr(IronPrice*TotalOre) + 'gp');
Writeln('|Money Gained / Hour = ' + IntToStr(Round((TotalOre*IronPrice)/(HoursRun))) + 'gp');
end;
Writeln('|Ran antiban ' + IntToStr((Players[i].Integers[16])) + ' times');
Writeln('|==================================================================|');
stats_Commit;
end;
end;

Function K_LoggedIn :boolean;
var
i :integer;
begin
Result := False;
i := 0
if LoggedIn then Result := True;
While not Result and (i < 8) do
begin
inc(i);
if LoggedIn then
Result := True;
wait(200 + Random(100));
end;
end;

Function MouseWithin(X1, Y1, X2, Y2 :integer) :boolean;
var
x, y:integer;
begin
Result := False;
GetMousePos(x, y);
if (x > X1) and (x < X2) then
if (y > Y1) and (y < Y2) then
Result := True;
end;

Function MouseDistancePoint(Rx, Ry, Distance :integer) :boolean;
var
x, y :integer;
begin
Result := False;
GetMousePos(x, y);
if (x > Rx - Distance) and (x < Rx + Distance) then
if (y > Ry - Distance) and (y < Ry + Distance) then
Result := True;
end;

Function AtMine :boolean;
begin
Result := False;
if TileOnMM(Tile(2979, 3238)) then Result := True;
end;

Function AtBank :boolean;
begin
Result := False;
if TileOnMM(Tile(3047, 3236)) then Result := True;
end;

Function AtCabbage :boolean;
begin
Result := False;
if TileOnMM(Tile(3054, 3289)) then Result := True;
end;

Function ExplorerRing :boolean;
var
Ring :TEquipment;
begin
Result := False;
if not K_LoggedIn then exit;
Ring := GetEquippedItemAt(9);
if Ring.ID = 13562 then
Result := True;
if Debugger then
if Result then
Writeln('Ring Found')
else
Writeln('No Ring');
end;

Procedure TakeAKitkat;
var
TimeToEndBreak :LongInt;
LengthOfBreak :Integer;
Randomness :Integer;
begin
LengthOfBreak := Players[CurrentPlayer].Integers[4] * 60000;
Randomness := Round(LengthOfBreak * 0.4);
Randomness := Random(Randomness) - Round(Randomness / 2);
TimeToEndBreak := GetTimeRunning + LengthOfBreak + Randomness;
Writeln('Breaking for ' + IntToStr(Round((TimeToEndBreak - GetTimeRunning) / 60000)) + ' minutes');
Players[CurrentPlayer].Integers[14] := Players[CurrentPlayer].Integers[14] + (TimeToEndBreak-GetTimeRunning);
inc(Players[CurrentPlayer].Integers[15]);
ExitToLobby;
Repeat
Wait(10000 + Random(1000));
Writeln('Time left = ' + IntToStr(Round((TimeToEndBreak - GetTimeRunning) / 60000)) + ' minutes');
Until(GetTimeRunning > TimeToEndBreak);
Writeln('Finished breaking');
LastBreakTime := GetTimeRunning;
LogInPlayer;
end;

Procedure GetNextBreakTime;
var
BreakInterval :integer;
Randomness :integer;
begin
BreakInterval := Players[CurrentPlayer].Integers[3] * 60000;
Randomness := Round(BreakInterval * 0.4);
Randomness := Random(Randomness) - Round(Randomness / 2);
NextBreakTime := LastBreakTime + BreakInterval + Randomness;
Writeln('Next break due in ' + IntToStr(Round((NextBreakTime-GetTimeRunning)/60000)) + ' minutes');
end;

Procedure CheckBreak;
begin
if NextBreakTime = 0 then
begin
Writeln('Setting first break');
GetNextBreakTime;
Exit;
end;
Writeln(IntToStr(NextBreakTime));
Writeln(IntToStr(GetTimeRunning));
if NextBreakTime < GetTimeRunning then
begin
Writeln('Having a break');
TakeAKitkat;
GetNextBreakTime;
end;
end;

function K_WalkPath(Tiles: TTileArray): boolean;
var
i, t, attempts: integer;
P: TPoint;
next: boolean;
label
ProcStart;
begin
Inc(attempts);
ProcStart:
i := -1;
Result := false;
if(DistanceFrom(Tiles[High(Tiles)]) < 4)then
begin
Result := true;
Exit;
end;

//Getting the starting index.
for i := High(Tiles) downto 0 do
if(TileOnMM(Tiles[i]))then
begin
i := i;
Break;
end;
if(i = -1)then
Exit;

//Walk remainder of the path.
for i := i to High(Tiles) do
begin
Wait(3 + Random(6));
next := false;
if not(TileOnMM(Tiles[i]))then
begin
Writeln('Tile not on MM.');
break;
end;
P := TileToMM(Tiles[i]);
Mouse(P.x, P.y, 1, 1, true);
while(DistanceFromFlag <> 0)do
begin
Wait(2 + Random(5));
if not WaitToMove(3000)then
begin
Wait(2 + Random(5));
MarkTime(t);
while(TimeFromMark(t) < 7000)do
if(WaitToMove(1000))then break;
if(TimeFromMark(t) >= 7000)then
begin
Writeln('***Didn''t move for 10 seconds. Exiting***');
next := false;
break;
end;
end;
if(i < High(Tiles))then
begin
if(TileOnMM(Tiles[i+1]))then
begin
next := true;
break;
end;
end;
end;
if(i < High(Tiles))then
if(TileOnMM(Tiles[i+1]))then
next := true;
if not next then
break;
end;
Result := DistanceFrom(Tiles[High(Tiles)]) <= 5;
if not Result then
begin
if(attempts > 7)then
begin
Writeln('Failed more than ten attempts.');
Exit;
end;
While(GetSpeed > 0)do wait(100+Random(100));
goto ProcStart;
end;
While(GetSpeed > 0)do wait(100+Random(100));
end;

Function R_OpenDepositBoxSarim :boolean;
var
i :integer;
PSBankPos :TRSObject;
PSBank :TPoint;

begin
Result := False;
if not(K_LoggedIn) then Exit;
if not (DepositScreen) then
begin
if DistanceFrom(Tile(3047, 3237)) > 4 then
begin
if not TileOnMM(Tile(3047, 3236)) then
begin
Writeln('Lost :(');
Exit;
end else
begin
WalkToTile(Tile(3047, 3236), 0, 0);
writeln('Stood at bank.');
Wait(300 + Random(500));
FFlag(0);
end;
end;
PSBankPos := GetObjectAt(Tile(3047, 3237), OBJECT_TYPE_INTERACTABLE);
if PSBankPos.ID = 36788 then
begin
PSBank := TileToMS(Tile(3047, 3237), 3);
if Debugger Then Writeln('x = ' + IntToStr(PSBank.x) + ' y = ' + IntToStr(PSBank.y));
Mouse(PSBank.x , PSBank.y, 3, 3, True);
Writeln('Clicked Bank');
i := 0
Repeat
Inc(i);
Wait(300 + Random(500));
Until((DepositScreen) or (i > 10))
if i > 10 then
begin
Writeln('Deposit Screen didn''t appear');
Exit;
end else
begin
Result := True;
Writeln('Bank Opened!');
Wait(600 + Random(700));
end;
end else
begin
Writeln('Bank ID is wrong :S');
Exit;
end;
end else
Result := True;
end;

Function OpenDepositBoxSarim :boolean;
var
x, y :integer;
mt :TTile;
begin
Result := False;
if not(K_LoggedIn) then Exit;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.02, 0.95);
if not DepositScreen then
if not FindObj(x, y, 'eposit', 5267824, 6) then
begin
Writeln('Not found Bank..');
mt := GetMyPos;
Writeln('Moving to tile in front of bank and retrying');
if not mt = Tile(3047, 3236) then
WalkToTile(Tile(3047, 3236), 0, 0);
Exit;
end else
begin
Wait(400 + Random(200));
if IsUpText('deposit') then
begin
Mouse(x, y, 0, 0, False);
Wait(500 + Random(200));
ChooseOption('eposit');
Wait(500 + Random(500));
end;
end;
if DepositScreen then Result := True;
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
Wait(200 + Random(200));
end;

Function ClickGate:boolean;
var
TP1, Tp2 :TPoint;
x, y :integer;
mt :TTile;
begin
Writeln('Clicking Gate');
Result := False;
if not TileOnMS(Tile(3053, 3285), 0) then
begin
if not TileOnMM(Tile(3053, 3284)) then
Exit
else
WalkToTile(Tile(3053, 3284), 0, 0);
end else
begin
TP1 := TileToMS(Tile(3052, 3284), 0);
TP2 := TileToMS(Tile(3053, 3283), 0);
if FindColorSpiralTolerance(x, y, 5003875, TP1.x, TP1.y, TP2.x, TP2.y, 3) then
begin
MMouse(x, y, 0, 0)
if WaitUptext('pen', 2000) then
begin
ClickMouse2(True);
Wait(500 + Random(200));
Result := True;
if Debugger then Writeln('Clicked gate');
end else
begin
WalkToTile(Tile(3053, 3284), 0, 0);
Exit;
end;
end else
begin
mt := GetMyPos;
if not (mt = Tile(3053, 3284)) then
WalkToTile(Tile(3053, 3284), 0, 0);
end;
end;
end;

Function DoAction(stage :function :boolean) :boolean;
begin
Result := False;
Repeat
if not (Stage()) then
begin
Writeln('Trying again');
Writeln('On the ' + IntToStr(Tries) + ' try');
inc(Tries);
Wait(500 + Random(500));
end else
begin
Result := True;
Tries := 0
Break;
end;
until (Tries > 3);
if tries > 3 then
begin
Writeln('Action Failed 4 times :/');
Logout;
Exit;
end;
end;

Function OpenGate :boolean;
var
GateRS :TRSObject;
begin
Writeln('Opening Gate');
Result := True;
if not K_LoggedIn then Exit;
if not TileOnMM(Tile(3052, 3283)) then Exit;
GateRS := GetObjectAt(Tile(3052,3283), OBJECT_TYPE_WALLOBJECT);
if (GateRS.ID = 7049) then
DoAction(@ClickGate);
Result := True;
end;

Procedure DepositOre;
begin
Players[CurrentPlayer].Integers[20] := Players[CurrentPlayer].Integers[20] + R_CountItem(SaphID);
Players[CurrentPlayer].Integers[21] := Players[CurrentPlayer].Integers[21] + R_CountItem(EmerID);
Players[CurrentPlayer].Integers[22] := Players[CurrentPlayer].Integers[22] + R_CountItem(RubyID);
Players[CurrentPlayer].Integers[23] := Players[CurrentPlayer].Integers[23] + R_CountItem(DiamID);
Writeln('Depositing');
Wait(400 + Random(200));
if not R_OpenDepositBoxSarim then
begin
Writeln('Not Kieran Ref Opened');
if not DoAction(@OpenDepositBoxSarim) then
begin
Writeln('Not Color Opened');
Logout;
Players[CurrentPlayer].Strings[0] := 'Couldn''t open bank'
Exit;
end;
end;
Inc(Players[CurrentPlayer].Integers[17]);
stats_IncVariable('Times Banked', 1);
Mouse(349, 277, 5, 5, True);
//R_DepositAllButEx([1265, 1269 ,1267, 1273, 1279, 1275]);
Wait(600 + Random(600));
Proggy;
GameTab(tab_Inv);
end;

Procedure WalkToMine;
var
MinePath : TTileArray;
x : integer;
AlternatePath :TTile;
begin
if not K_LoggedIn then Exit;
R_FindRandoms;
x := Random(3);
if x = 1 then AlternatePath := Tile(3015, 3231)
else AlternatePath := Tile(3015, 3241);

MinePath := [Tile(3035, 3236), Tile(3026, 3241), AlternatePath,
Tile(3004, 3232), Tile(2993, 3232), Tile(2981,3232),
Tile(2969, 3239)];


if RunEnergy(35 + Random(20)) then SetRun(True);
Writeln('Walking to mine');
K_WalkPath(MinePath);
Wait(300+Random(500));
end;

Procedure WalkToDepositFromCabbage;
var
BankPath : TTileArray;
begin
if not K_LoggedIn then Exit;
R_FindRandoms;
if RunEnergy(40 + Random(10)) then SetRun(True);
WalkToTile(Tile(3053, 3285), 0, 0);
if DoAction(@OpenGate) then
begin
BankPath := [Tile(3056, 3271), Tile(3055, 3262), Tile(3055, 3254),
Tile(3048, 3246), Tile(3046, 3237)];

Writeln('Walking to deposit from cabbage');
K_WalkPath(BankPath);
Wait(300+Random(500));
end;
end;

Procedure WalkToDepositFromMine;
var
BankPath : TTileArray;
x : integer;
AlternatePath : TTile;
begin
if not K_LoggedIn then Exit;
R_FindRandoms;
x := Random(3);
if x = 1 then AlternatePath := Tile(3015, 3231)
else AlternatePath := Tile(3015, 3241);

BankPath := [Tile(2981,3237), Tile(2992, 3231), Tile(3004, 3232),
AlternatePath, Tile(3025, 3241), Tile(3035, 3237),
Tile(3046, 3236)];

if RunEnergy(40 + Random(10)) then SetRun(True);
Writeln('Walking to deposit');
K_WalkPath(BankPath);
Wait(300+Random(500));
end;

Procedure WalkToDeposit;
var
i :integer;
x, y :integer;
begin
if not K_LoggedIn then Exit;
R_FindRandoms;
if Players[CurrentPlayer].Booleans[2] then
begin
GameTab(tab_Equip);
if not ExplorerRing then
begin
Writeln('No explorer ring');
if not ExplorerRing then
if not ExplorerRing then
begin
Writeln('Defo no explorer ring');
Players[CurrentPlayer].Booleans[2] := False;
WalkToDepositFromMine;
Exit;
end;
end;
begin
Writeln('Ring found');
FindColorTolerance(x, y, 2280941, MIX1, MIY1, MIX2, MIY2, 5);
Mouse(x, y, 6, 6, False);
Wait(200 + Random(200));
ChooseOption('age-por'); //Cabb|age-por|t
Wait(2500 + Random(500));
i := 0
Repeat
Wait(150 + Random(50));
inc(i);
if Debugger then Writeln('Teleporting');
until(i > 30) or (AtCabbage);
if i > 50 then
begin
Writeln('Not at cabbages :S');
Exit;
Players[CurrentPlayer].Booleans[2] := False;
end else
Wait(3500 + Random(500));
WalkToDepositFromCabbage;
end;
end else
WalkToDepositFromMine;
end;

Procedure DropOre;
var
OreDropped :integer;
begin
OreDropped := R_CountItem(440);
if Debugger then Writeln('Found ' + IntToStr(OreDropped) + ' iron ore');
if OreDropped > 0 then
begin
if Debugger then Writeln('Dropping items');
R_DropAllItemsBy(440);
end;
end;

Procedure SpamClick(MinTimes, Ran :integer);
var
i :integer;
begin
for i := 0 to (MinTimes + Random(Ran)) do
begin
ClickMouse2(True);
Wait(50 + Random(150));
end
end;

Procedure PickupOre;
var
GroundItems :TGroundItemArray;
i :integer;
MyTile :TTile;
OrePoint :TPoint;
PrevCount :integer;
begin
MyTile := GetMyPos;
GroundItems := GetItemsAt(MyTile);
if length(GroundItems) < 1 then Exit;
for i := 0 to high(GroundItems) do
begin
if debugger then Writeln(IntToStr(GroundItems[i].Id));
if GroundItems[i].ID = IronID then
begin
PrevCount := R_CountItem(IronID);
Writeln('Previous count ' + IntToStr(PrevCount));
OrePoint := TileToMS(GroundItems[i].tile, 0);
Mouse(OrePoint.x, OrePoint.y, 7, 7, True);
SpamClick(4, 4);
Break;
end;
end;
Players[CurrentPlayer].Integers[11] := Players[CurrentPlayer].Integers[11] + R_CountItem(IronID) - PrevCount;
Writeln('Picked up ' + IntToStr(Players[CurrentPlayer].Integers[11] - PrevCount) + ' ore');
GroundItems := [];
end;

Procedure PickupOre1;
var
PrevCount :integer;
begin
if Debugger then
Writeln('Checking uptext randomly');
if IsUpText('ron ore') then
begin
PrevCount := R_CountItem(IronID);
Writeln('Mouse is over iron ore, clicking 1-5 times');
SpamClick(1, 4);
Players[CurrentPlayer].Integers[11] := Players[CurrentPlayer].Integers[11] + R_CountItem(IronID) - PrevCount;
end;
end;

Function CheckPickup :boolean;
begin
Result := False;
if Players[CurrentPlayer].Booleans[0] = True then
if (GetTimeRunning > (LastCheckPickup + 25000)) then
begin
Writeln('Checking for pickup');
Result := True;
LastCheckPickup := GetTimeRunning - 10000 + Random(20000);
end;
end;

Function RockAvailable :integer;
var
Rocks :TRSObject;
i :Integer;
begin
if Debugger then Writeln('Started Rock Available');
Result := -1;
for i := 0 to 1 do
begin
Rocks := GetObjectAt(RockTile[i], OBJECT_TYPE_INTERACTABLE);
if Rocks.ID = RockID[i] then
begin
Result := i;
Exit;
end;
end;
end;

Function MineOre(RockIndex :integer) :boolean;
var
ObjectPoint :TPoint;
RockMining :TRSObject;
LostRock :boolean;
PrevCount:integer;
begin
Result := False;
RockMining := GetObjectAt(RockTile[RockIndex], OBJECT_TYPE_INTERACTABLE);
if Debugger then
begin
Writeln('Started mining with ' + IntToStr(PrevCount) + ' ore');
Writeln('Rock Checked = ' + IntToStr(RockMining.ID));
Writeln('Rock mining = ' + IntToStr(RockIndex));
Writeln(IntToStr(ExhaustedRock[RockIndex]));
Writeln(IntToStr(RockMining.ID));
end;

if (RockMining.ID = ExhaustedRock[RockIndex]) then
begin
Wait(10 + Random(10));
if Debugger then
Writeln('Rock exhausted');
Exit;
end else if (RockMining.ID = RockID[RockIndex]) then
begin
PrevCount := R_CountItem(IronID);
ObjectPoint := TileToMS(RockTile[RockIndex], 1);
Mouse(ObjectPoint.x, ObjectPoint.y, 2, 2, True);
if Debugger then Writeln('Clicked Rock ' + IntToStr(RockIndex));
Wait(1000 + Random(100));
Repeat
Wait(50 + Random(50));
R_FindRandoms;
RockMining := GetObjectAt(RockTile[RockIndex], OBJECT_TYPE_INTERACTABLE);
if RockMining.ID = ExhaustedRock[RockIndex] then
LostRock := True;
Until Not(CharacterAnimating) or LostRock;
Wait(350 + Random(50));
if R_CountItem(IronID) > PrevCount then
Result := True;
end;
end;

Procedure MineOreLoop;
var
OreToMinex :Integer;
begin
if Debugger then Writeln('Started Mine Ore Proc');
While Not(InvFull) do
begin
if Players[CurrentPlayer].Integers[1] <= (Players[CurrentPlayer].Integers[12]) then
begin
Writeln('Finished mining, exiting mining loop...');
Exit;
end;
if Debugger then Writeln('In Mine or loop');
if not(K_LoggedIn) then Exit;
R_FindRandoms;
if LevelUp then Inc(Players[CurrentPlayer].Integers[10]);
Wait(250 + Random(80));
OreToMinex := RockAvailable;
if OreToMinex <> -1 then
begin
if Debugger then
Writeln('Rock Available, calling mine ore');
if MineOre(OreToMinex) then
begin
Inc(Players[CurrentPlayer].Integers[12]);
stats_IncVariable('Iron Ore (Mined)', 1);
stats_IncVariable('Mining EXP (Gained)', IronXp);
if PlayDrop then
begin
DropOre;
Break;
end;
end else
If Debugger then
Writeln('Lost ore :/');
end else
begin
if not MouseDistancePoint(MSCX, MSCY, 25) then
MMouse(MSCX, MSCY, 10, 10);
PickupOre1;
if Debugger then
Writeln('No ore Available');
if CheckPickup then
PickupOre;
end;
end;
end;

Procedure SetupPlayer;
var
Me :TMe;
begin
if not (Players[CurrentPlayer].Booleans[1]) and Players[CurrentPlayer].Booleans[0] then
begin
Writeln('how can you drop ore and pickup ore :S');
Writeln('Setting Pickup ore to false just for you ;)');
Players[CurrentPlayer].Booleans[0] := False;
end;
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + Random(Players[CurrentPlayer].Integers[2]);
Players[CurrentPlayer].Integers[24] := GetTimeRunning;
Writeln('Mining ' + IntToStr(Players[CurrentPlayer].Integers[1]) + ' ore');
SetAngle(True);
MakeCompass('N');
NextBreakTime := 0;
Players[CurrentPlayer].Strings[0] := 'Ran Fine';
LastBreakTime := GetTimeRunning;
Me := GetMe;
Players[CurrentPlayer].Integers[25] := Me.Levels[14];
Writeln('Start mining level = ' + IntToStr(Players[CurrentPlayer].Integers[25]));
PlayDrop := not (Players[CurrentPlayer].Booleans[1]);
if not ExplorerRing then
if not ExplorerRing then
if not ExplorerRing then
begin
Players[CurrentPlayer].Booleans[2] := False;
Exit;
end;
Players[CurrentPlayer].Booleans[2] := True;
end;

Procedure SetupScript;
begin
ClearDebug;
Smart_Members := false;
Smart_Server := 121;
Smart_Signed := true;
SetupSRL;
if Debugger then Writeln('Setup SRL');
SetUpReflection;
if Debugger then Writeln('Setup Reflection');
SetupSRLStats(98, SRLStats_User, SRLStats_Pass);
if Debugger then Writeln('Setup Stats');
DeclarePlayers;
Wait(500 + Random(500));
LoginPlayer;
if Debugger then Writeln('Player Logged In');
RockID[0] := 9719;
RockID[1] := 9717;
RockTile[0] := Tile(2968, 3239);
RockTile[1] := Tile(2969, 3240);
ExhaustedRock[0] := 9725;
ExhaustedRock[1] := 9723;
if Debugger then Writeln('Setup Tile Vars');
end;

Procedure MainLoop;
begin
if Debugger then Writeln('Started main loop');
if not(K_LoggedIn) then Exit;
if Debugger then Writeln('Checking Randoms');
R_FindRandoms;
AntiBan;
CheckBreak;
Proggy;
Wait(100 + Random(100));
if AtMine then
begin
if PlayDrop then
begin
Writeln('Calling Mine ore');
MineOreLoop;
end else
begin
if Debugger then Writeln('At Mine');
if InvFull then
begin
if Debugger then Writeln('Inv Full, Banking');
WalkToDeposit;
end else
begin
if Debugger then Writeln('Inv Not Full, Mining');
MineOreLoop;
end;
end;
end else if AtBank then
begin
if PlayDrop then
begin
Writeln('Why are we at the bank :S');
Writeln('Walking to mine anyway');
WalkToMine;
end else
begin
if not InvEmpty then
DepositOre
else
WalkToMine;
end;
end else if AtCabbage then
begin
Writeln('At Cabbage');
WalkToDepositFromCabbage;
end else
begin
Writeln('Not at bank or mine :S');
Writeln('Logging out for safety');
Logout;
Players[CurrentPlayer].Strings[0] := 'Lost';
Exit;
end;
end;

begin
SetupScript;
Repeat
SetupPlayer;
Repeat
if not (K_LoggedIn) then
begin
Writeln('Not logged in');
if Players[CurrentPlayer].Strings[0] = 'Ran Fine' then
Players[CurrentPlayer].Strings[0] := 'Unknown';
Break;
end;
MainLoop;
until (Players[CurrentPlayer].Integers[1] <= (Players[CurrentPlayer].Integers[12]));
Proggy;
NextPlayer(False);
Until(AllPlayersInactive);
end.

Shuttleu

2011-05-15 08:19:54

lots to read, but im would like to have seen more of the SRL include instead of so much Reflection

i shall hold my vote, but i have a idea where it will go

~shut

trojan

2011-05-15 08:26:59

I have used colour to find the deposit box but for everything else reflection seemed better, I could use an ATPA to find the deposit box instead of findobj if that would increase my chances?

Floor66

2011-05-15 09:21:38

I agree with shut but if you'd just show some knowledge of TPA's and BMPs or DTMs it's a yes.

Also on opening the deposit box, you can just use a TileToMS since it's a static object. Reflection has some memory leaks with objects (right?).

Holding my vote.

Shuttleu

2011-05-15 09:23:27

From: Floor66
I agree with shut but if you'd just show some knowledge of TPA's and BMPs or DTMs it's a yes.

Also on opening the deposit box, you can just use a TileToMS since it's a static object. Reflection has some memory leaks with objects (right?).

Holding my vote.

floor objects

~shut

trojan

2011-05-15 09:26:23

I could use a DTM to find the explorer ring I suppose, what could I use TPA's for though? any ideas?

Shuttleu

2011-05-15 09:28:12

rock finding

use several TPA functions such as SplitTPA

~shut

Floor66

2011-05-15 09:28:34

You can use TPA's in your ClickGate procedure?

trojan

2011-05-15 09:36:02

ahhhhh :) I forgot about that click gate one, I didn't really want to use it for finding rocks otherwise it wouldn't just mine them 2 rocks and that's the only reason it beats all the other bots. Ill add it for the click gate procedure asap

Shuttleu

2011-05-15 09:39:24

why would it only mine 2 rocks?

~shut

trojan

2011-05-15 09:47:05

Because there are so many bots they all just run around chasing the 4 iron ore there, if I stand still and win 2 of them everytime then it is irrelivant how many other bots are there and I am getting 50% of the iron and they are sharing 50% between the lot of them, plus iron respawn rate is on average 10 seconds. The dropping system is M1D1 btw and gets around 30k xp/h and that has literally no time spent doing nothing

Shuttleu

2011-05-15 09:53:00

From: trojan
Because there are so many bots they all just run around chasing the 4 iron ore there, if I stand still and win 2 of them everytime then it is irrelivant how many other bots are there and I am getting 50% of the iron and they are sharing 50% between the lot of them, plus iron respawn rate is on average 10 seconds. The dropping system is M1D1 btw and gets around 30k xp/h and that has literally no time spent doing nothing


im not sure i understand, are you saying that color is too slow to get all 4 fast enough?

~shut

trojan

2011-05-15 10:04:49

Okay, my bot stands in a position next to 2 iron rocks, stands there and mines them both and doesn't move, Other bots, mine all 4 rocks, however they only click a rock as it respawns so they usually have to run over to the rock and by then I've mined it.

I don't know how I would make it mine just 2 of the rocks using colour though :/ in colour wouldn't it just end up like the other bots running after all 4 rocks? unless I just made it look for rocks on them tiles but then that makes it reflection so I can't imagine how I would achieve that.

Shuttleu

2011-05-15 10:07:46

limit its location of color finding

so instead of using MSX1, MSY1, ,MSX2, MSY2. use 44, 30, 356, 234

and if it overlaps to other rocks, you can set the compass to a certain angle, or, even better, get the color and do a count color around it

~shut

Awkwardsaw

2011-05-15 10:16:12

i llike the script, reflection or not.

It's not like using the srl include is different than using the reflection include

trojan

2011-05-15 10:27:28

Thank you awkward, I do see where Shuttleu is coming from though, we are supposed to be a colour community and if we do seem to be turning into another RSBot/whatever else uses this stuff :P, I'm going to make a fully colour script after this more as a challenge and to make myself a better programmer.

Another reason is if Runescape fix all of this reflection stuff which I'm sure they quite easily could then we need some scripts to still be working.

Awkwardsaw

2011-05-15 10:43:39

From: trojan
Thank you awkward, I do see where Shuttleu is coming from though, we are supposed to be a colour community and if we do seem to be turning into another RSBot/whatever else uses this stuff :P, I'm going to make a fully colour script after this more as a challenge and to make myself a better programmer.

Another reason is if Runescape fix all of this reflection stuff which I'm sure they quite easily could then we need some scripts to still be working.


Yes theres that, but I'm judging on scripting ability, avoiding a transformation to rsbot is only important as a community, not an SRL member application :)

trojan

2011-05-15 11:23:03

How long does this poll last btw?

Gu3st...

2011-05-15 11:38:00

From: trojan
How long does this poll last btw?
This poll will close on 05-29-2011 at 02:10 PM

Rich

2011-05-15 13:12:36

Most of the time though the apps end early if the outcome is obvious.

Echo_

2011-05-15 13:43:55

Loled at naming your break handler "TakeAKitkat". This is a pretty good script, has a nice amount of failsafes and it looks like your adding some color functions to the mix.

Yes from me :)

footballjds

2011-05-15 20:34:58

TakeAKitKat :D
Yes from me. Just one thing i noticed real quickly:

Procedure AntiBan;
var
x :integer;
begin
x := Random(200);
if x < 5 then
begin
Inc(Players[CurrentPlayer].Integers[16]);
Case (Random(9)) of
0..1: RandomMovement;
2: PickUpMouse;
3: GameTab(26);
4: GameTab(23);
5: HoverSkill('Mining', False);
6: BoredHuman;
7: ExamineInv;
8: RandomRClick;
9: begin
ExitToLobby;
Writeln('Dont Worry taking a random short rest');
Wait(15000 + Random(90000));
LogInPlayer;
end;
end;
end;
end;
could be shortened to:
Procedure AntiBan;
begin
Inc(Players[CurrentPlayer].Integers[16]);
Case (Random(360)) of
0..1: RandomMovement;
2: PickUpMouse;
3: GameTab(26);
4: GameTab(23);
5: HoverSkill('Mining', False);
6: BoredHuman;
7: ExamineInv;
8: RandomRClick;
9: begin
ExitToLobby;
Writeln('Dont Worry taking a random short rest');
Wait(15000 + Random(90000));
LogInPlayer;
end;
else Dec(Players[CurrentPlayer].Integers[16]);
end;
end;
Pretty sure random(360) will return about the same as random(200) < 5

cycrosism

2011-05-16 02:12:44

Was scrolling through and saw most of it as reflection.

I saw how you used FindObj, thats a good start but you should be making your own TPA's and getting to the advanced things now.

Saw no colour walking or banking or rock finding. No from me

trojan

2011-05-16 04:20:08

From: footballjds
TakeAKitKat :D
Yes from me. Just one thing i noticed real quickly:

Procedure AntiBan;
var
x :integer;
begin
x := Random(200);
if x < 5 then
begin
Inc(Players[CurrentPlayer].Integers[16]);
Case (Random(9)) of
0..1: RandomMovement;
2: PickUpMouse;
3: GameTab(26);
4: GameTab(23);
5: HoverSkill('Mining', False);
6: BoredHuman;
7: ExamineInv;
8: RandomRClick;
9: begin
ExitToLobby;
Writeln('Dont Worry taking a random short rest');
Wait(15000 + Random(90000));
LogInPlayer;
end;
end;
end;
end;
could be shortened to:
Procedure AntiBan;
begin
Inc(Players[CurrentPlayer].Integers[16]);
Case (Random(360)) of
0..1: RandomMovement;
2: PickUpMouse;
3: GameTab(26);
4: GameTab(23);
5: HoverSkill('Mining', False);
6: BoredHuman;
7: ExamineInv;
8: RandomRClick;
9: begin
ExitToLobby;
Writeln('Dont Worry taking a random short rest');
Wait(15000 + Random(90000));
LogInPlayer;
end;
else Dec(Players[CurrentPlayer].Integers[16]);
end;
end;
Pretty sure random(360) will return about the same as random(200) < 5


It wouldn't make that much difference though would it? and it seemed easier to read keeping them seperate e.g. having the chance of it calling first, then which one is called second and I could record how many times antiban was called my way :D, your way would increment antiban even if no antiban took place

Shuttleu

2011-05-16 04:23:10

From: trojan
It wouldn't make that much difference though would it? and it seemed easier to read keeping them seperate e.g. having the chance of it calling first, then which one is called second and I could record how many times antiban was called my way :D, your way would increment antiban even if no antiban took place

sorry to burst your bubble, but he has a
Dec(Players[CurrentPlayer].Integers[16]);
so if one of the antibans dont get called, then it will take that one off again

~shut

trojan

2011-05-16 10:24:37

Ahh okay I didn't see that :P Ill change it now

Edit: Just out of curiosity is this better because it is tidier or because it is slightly more efficient?

footballjds

2011-05-16 11:19:22

From: trojan
Ahh okay I didn't see that :P Ill change it now

Edit: Just out of curiosity is this better because it is tidier or because it is slightly more efficient?


same thing less code
also there is no reason to create a temp variable and assign it a number :p

cycrosism

2011-05-18 06:20:25

I wouldn't consider a script being "Fully Reflection" to be a "feature", what if the hooks are outdated? Instead of using Gametab which is colour, you would be using R_Gametab, which is reflection and wont work if the hooks are outdated

Gu3st...

2011-05-18 07:22:34

Nothing can be 'fully reflection' anyways.. I don't see a R_LoginPlayer anywhere

smurg

2011-05-18 13:45:26

Looks pretty good for what I looked over.

Lol @ anyone getting their panties in a bunch over "too much reflection".

Everything has a time and a place. (color backups or completely color scripts, but if you include reflection in the first place, then may as well use it in the more reliable areas)

Yes from me.

trojan

2011-05-19 13:32:45

Thanks smurg, loved your jackofalltrades script btw, used it alot for cutting maples and superheat mithril bars lol

WT-Fakawi

2011-05-19 15:45:33

In. Welcome!