Simba Code:
program MehrunesHarper;
{$DEFINE SMART}
{$i srl-6/srl.simba}
Var
StartExp, NowExp, HourExp, ProgCount, Dust, HourDust, StartDust, Repeats, PlayTime, CamSpin, CheckExp, Mistakes: Integer;
//Start standing at the northmost harp, fill in line 119, hit run.
function tIntegerArray.contains(funcID: int32): boolean;
var
funcIndex: int32;
begin
for funcIndex to high(self) do
if self[funcIndex] = funcID then
begin
result := true;
break;
end;
exit(result);
end;
function smartGetParameters(out params: tStringArray): boolean; override;
var
funcAttempts, funcIndex, funcRandom, funcResultIndex: int32;
funcExcludeList: tIntegerArray = [13, 47, 55, 75, 90, 93, 94, 95, 101, 102, 107, 109, 110, 111, 112, 113, 118, 121, 122, 125, 126, 127, 128, 129, 130, 131, 132, 133];
funcPage: string;
funcPageExplode: tStringArray;
begin
for 0 to 10 do
begin
while true do
if not funcExcludeList.contains(funcRandom := random(1, 150)) then
break;
funcPage := getPage('http://world' + toStr(funcRandom) + '.runescape.com/jav_config_beta.ws');
if pos('404 - Page not found', funcPage) = 0 then
begin
setLength(params, length(funcPageExplode := explode(#10, funcPage)));
for funcIndex to high(funcPageExplode) do
if execRegExpr('^(codebase|param)=(.+)', funcPageExplode[funcIndex]) then
begin
params[funcResultIndex] := replaceRegExpr('^(codebase|param)=(.+)', funcPageExplode[funcIndex], '$2', true);
funcResultIndex += 1;
end;
break;
end;
end;
setLength(params, funcResultIndex);
exit(true);
end;
procedure playHarp();
var
HarpBox: TBox;
begin
HarpBox:= IntToBox(277,213,297,229);
MouseBox(HarpBox, Mouse_Left);
end;
procedure antiban();
begin
case (random(180) + 1) of
0..5:
pickUpMouse();
6..28:
sleepAndMoveMouse(randomRange(1000,3000));
29..51:
smallRandomMouse();
52..97:
mouseOffClient(OFF_CLIENT_RANDOM);
96..110:
begin
MainScreen.SetAngle(MS_ANGLE_LOW);
Wait(randomRange(100,7500));
MainScreen.SetAngle(MS_ANGLE_HIGH);
end;
111..115:
begin
hoverSkill(SKILL_CRAFTING);
sleepAndMoveMouse(random(460, 1230));
TabBackpack.Open;
end;
126..160:
Wait(randomRange(3000,13000));
161..181:
begin
repeat
CamSpin:= random(20);
MiniMap.SetAngle(randomRange(1, 359));
Wait(randomRange(50,7450));
until CamSpin > 15;
minimap.clickCompass;
Wait(randomRange(500,1500));
MainScreen.SetAngle(MS_ANGLE_HIGH);
end;
end;
end;
{*procedure proggy;
begin
ClearDebug;
NowExp := (ChatBox.GetXPBar - StartExp);
HourExp := Round(NowExp * (3600.0 / (GetTimeRunning / 1000.0)));
Dust := (getItemAmount(tabBackpack.getSlotBox(1)) - StartDust);
HourDust := Round(Dust * (3600.0 / (GetTimeRunning / 1000.0)));
writeln(PadR('|', 22) + PadR('Mehrunes Harper', 38) + '|');
writeln(PadR('| Running For: ' + TimeRunning, 60) + '|');
writeln(PadR('| Exp Earned: ' + GroupDigits(NowExp, ','), 40) + padR('Exp/Hour: ' + GroupDigits(HourExp, ','), 20) + '|');
writeln(PadR('| Dust Gained: ' + GroupDigits(Dust, ','), 40) + padR('Dust/Hour: ' + GroupDigits(HourDust, ','), 20) + '|');
end; *}
procedure SetUp();
begin
setupSRL;
smartPlugins := ['OpenGL32.dll','d3d9.dll'];
minimap.clickCompass;
MainScreen.SetAngle(MS_ANGLE_HIGH);
StartExp := ChatBox.GetXPBar;
StartDust := getItemAmount(tabBackpack.getSlotBox(1))
end;
begin
SetUp();
PlayTime := 6000; //In mins, will randomise
repeat
playHarp();
Repeats:= (Repeats + 1);
//proggy();
case (random(10) + 1) of
1..5:
begin
antiban();
Wait(randomRange(9867,44577));
end;
6..8:
begin
Wait(randomRange(19867,34577));
antiban();
end;
9..11:
begin
Wait(randomRange(2806,10805));
antiban();
Wait(randomRange(3305,10306));
end;
end;
CheckExp:= (ChatBox.GetXPBar - StartExp);
if CheckExp = NowExp
then Mistakes:= Mistakes + 1;
if CheckExp > NowExp
then Mistakes:= 0;
if Mistakes = 3
then TerminateScript;
until Repeats > ((PlayTime * 2) + random(15));
end.