6 hour fix with proggy, xp get by ashaman
notices if not gaining xp and clicks harp
program ClarityHarps;
{$DEFINE SMART}
{$i srl-6/srl.simba}
{ClarityHarps v0.8}
const
scriptVersion = '0.8';
{SCRIPT SETTINGS}
const
VIGILANCE = 68; //100 is full focus, resetting harp whenever it goes out of tune. Don't set this so low that the harp fully detunes.
ANTIBAN_THRESHOLD = 7555; //lower threshold results in antiban more often
RIGHTCLICK_CHANCE = 12;
SPAMCLICK_CHANCE = 18;
MISSMOUSE_CHANCE = 17;
playerName = '';
playerFile = 'default';
{END SCRIPT SETTINGS}
var
x, y, j, k, antibanThreshold, debugCount, vg, sc, mm, StartXP, log, constant, noxp: integer;
cTPA, TPA, TPA2: TPointArray;
clickPoint: TPoint;
searchBox, filterBox: TBox;
runmarker: boolean;
{PROCEDURE -- ClarityDebug
Purpose: Custom debug procedure for my scripts.
Comments: None.}
procedure ClarityDebug(message: string);
begin
writeln(ToStr(debugCount) + ' | == ClarityDebug == | ' + message);
inc(debugCount);
end;
{PROCEDURE -- scriptStatus
Purpose: Paints current script activity onto the client if paint is enabled.
Comments: None.}
procedure scriptStatus(status: string);
begin
try
smartImage.clearArea(IntToBox(0, 331, 550, 372));
smartImage.drawText('STATUS: ', point(actionbar.x1 + 5, actionbar.y1 - 20), 'loginchars', true, clWhite);
smartImage.drawText(status, point(actionbar.x1 + 68, actionbar.y1 - 20), 'loginchars', true, clYellow);
except
end;
end;
procedure antiBan;
var
i, afk, idle, mSpeed: integer;
begin
if not isLoggedIn then
exit;
i := random(antibanThreshold);
afk := (random(40000));
idle := (random(10000));
mSpeed := gaussRangeInt(20, 40);
case i of
1..100:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Small Random Mouse');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Small Random Mouse');
smallRandomMouse();
end;
101..200:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Pick Up Mouse');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Pick Up Mouse');
pickUpMouse();
end;
201..300:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Sleep and Move Mouse');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Sleep and Move Mouse');
sleepAndMoveMouse(random(2000) + 500);
end;
301..400:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Idling for ' + toStr(idle) + 'ms');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Idling for ' + toStr(idle) + 'ms');
case i of
301..350:
begin
mouseOffClient(OFF_CLIENT_RANDOM);
wait(idle);
end;
351..400: sleepAndMoveMouse(idle + 500);
end;
end;
401..440:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Hover Skill');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Hover Skill');
if not gameTabs.isTabActive(TAB_BACKPACK) then
exit;
hoverSkill(SKILL_CRAFTING);
sleepAndMoveMouse(random(50, 450));
end;
441..450:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - AFKing for ' + toStr(afk) + 'ms');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - AFKing for ' + toStr(afk) + 'ms');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(afk);
mouseSpeed := mspeed;
mm := MISSMOUSE_CHANCE + random(-5, 5);
sc := SPAMCLICK_CHANCE + random(-5, 5);
k := RIGHTCLICK_CHANCE + random(-5, 5);
vg := random(VIGILANCE - 5, VIGILANCE + 5);
ClarityDebug('New mouse speed of ' + toStr(mspeed) + ', new vigilance of ' + toStr(vg));
scriptStatus('New mouse speed of ' + toStr(mspeed) + ', new vigilance of ' + toStr(vg));
end;
451..470:
begin
ClarityDebug('Performing antiban. (' + ToStr(i) + ') - Antiban variables recalculated.');
scriptStatus('Performing antiban. (' + ToStr(i) + ') - Antiban variables recalculated.');
mm := MISSMOUSE_CHANCE + random(-5, 5);
sc := SPAMCLICK_CHANCE + random(-5, 5);
k := RIGHTCLICK_CHANCE + random(-5, 5);
vg := random(VIGILANCE - 5, VIGILANCE + 5);
mouseSpeed := mspeed;
end;
471..antibanThreshold:
begin
exit;
end;
end;
end;
{PROCEDURE -- autoUpdateMe
Purpose: Autoupdates the script.
Comments: By Shuttleu, modified by Ashaman88 and Clarity}
procedure autoUpdateMe;
var
Neifile: Integer;
OnlineVersion, NewScript, NeiFeilNennen: string;
begin
ClarityDebug('Checking for script updates...');
OnlineVersion := GetPage('http://pastebin.com/raw.php?i=JrF9FYi8');
ClarityDebug('Online Script Version: ' + OnlineVersion);
ClarityDebug('Local Script Version: ' + ScriptVersion) if (trim(OnlineVersion) > ScriptVersion) then
begin
ClarityDebug('Newer script version online!');
ClarityDebug('Autoupdating to newer version.');
NewScript := GetPage('http://pastebin.com/raw.php?i=8LgfVWkA');
NeiFeilNennen := ScriptPath + 'ClarityHarps v' + OnlineVersion + '.simba';
Neifile := Rewritefile(NeiFeilNennen, true);
try
WriteFileString(Neifile, NewScript);
except
begin
ClarityDebug('Fatal error writing to ' + NeiFeilNennen + '!');
Terminatescript;
end;
end;
CloseFile(Neifile);
ClarityDebug('New script downloaded to ' + NeiFeilNennen + '! Terminating old script, please use the new version.');
writeln('New script downloaded to ' + NeiFeilNennen + '! Terminating old script, please use the new version.');
TerminateScript;
end
else
ClarityDebug('You have the latest version of the script!');
end;
procedure ClickHarp;
var
j, x: Integer;
begin
j := random(100);
if findColorsSpiralTolerance(x, y, TPA, 12498987, mainscreen.getBounds(), 10, colorSetting(2, 0.03, 0.52)) then
if findColorsSpiralTolerance(x, y, TPA2, 7328226, mainscreen.getBounds(), 20, colorSetting(2, 0.08, 1.92)) then
begin
TPA := combineTPA(TPA, TPA2);
smartImage.drawBox(filterBox);
TPA.filterPointsBox(326, 159, 430, 260);
if (length(TPA) < 1000) then exit;;
clickPoint := TPA[gaussRangeInt(low(TPA) + 1, high(TPA) - 1)];
smartImage.drawBox(IntToBox(clickPoint.x - 10, clickPoint.y - 10, clickPoint.x + 10, clickPoint.y + 10), false, clLime);
clickPoint.offSet(point(random(-10, 10), random(-10, 10)));
smartImage.drawCross(clickPoint, 6, clRed);
smartImage.drawCircle(clickPoint, 10, false, clYellow);
if (j <= mm) then missMouse(clickPoint, true) else mouse(clickPoint, MOUSE_MOVE, MOUSE_HUMAN);
if isMouseOverText(['une'], 600) then
begin
if (random(100) <= k) then
begin
fastClick(MOUSE_RIGHT);
chooseOption.select(['une']);
ClarityDebug('Right-clicked harp.');
sleepAndMoveMouse(250 + random(1750));
wait(500 + random(1000));
end else
begin
multiClick(clickPoint, sc, 4);
ClarityDebug('Left-clicked harp.');
sleepAndMoveMouse(250 + random(1750));
wait(500 + random(1000));
end;
end
end;
end
function trschatbox.getXP: Integer; //created by Ashaman88
var
b: TBox;
s: String;
tpa : TPointArray;
atpa : T2DPointArray;
i,cts,p: Integer;
begin
b := self.getBounds();
b.edit(+(b.x2-b.x1)-140, +10, -5, -94);
findColorsTolerance(tpa, 14013909, b, 4,colorSetting(2, 0.00, 0.00));
if length(tpa) < 2 then
begin
print('chatBox.getXP(): No XP found', TDebug.SUB);
Exit;
end;
atpa := tpa.cluster(5);
b:= atpa.getbounds;
b.edit(-2,-2,+2,+3);
s:=Replace(tesseractgettext(b.x1,b.y1,b.x2,b.y2, FILTER_SMALL_CHARS), ' ', '', [rfReplaceAll]);
P := Pos('x', S);
if P > 0 then
Result := StrToIntDef(ExtractFromStr(Copy(s, P, Length(S)), Numbers), 0)
else
Result := StrToIntDef(ExtractFromStr(S, Numbers), 0);
end;
procedure PrintProgress();
var
TotalXP, XPPerHour: integer;
begin
TotalXP := chatbox.getxp() - StartXP;
XPPerHour := Round(TotalXP * (3600.0 / (GetTimeRunning / 1000.0)));
smartImage.clearArea(IntToBox(0, 0, 380, 70));
smartimage.drawclippedbox(chatbox.getbounds, true, clblack);
smartImage.drawClippedText('Exp Gained : ' + toStr(TotalXP) + '', point(0, 0), 'LoginChars', true, clWhite);
smartimage.drawclippedtext('Exp Per Hour: ' + tostr(XPPerHour), point(0, 20), 'LoginChars', true, clwhite);
smartimage.drawclippedtext('Time running: ' + msToTime(GetTimeRunning, time_formal), point(0, 40), 'LoginChars', true, clwhite);
end;
function waituntil(what: boolean;milliseconds: integer): boolean;
var i: integer;
begin
i:=0;
repeat
i:=i+1;
begin
wait(1);
end;
until(what = true) or (i=milliseconds);
result:=true;
end;
begin
smartEnableDrawing := True;
disableSRLDebug := true;
autoUpdateMe;
smartPlugins := ['d3d9.dll'];
setupSRL();
mouseSpeed := gaussRangeInt(20, 40);
searchBox := IntToBox(6, 565, 163, 570);
filterBox := IntToBox(326, 159, 430, 260);
smartImage.drawBox(filterBox);
smartImage.drawBox(searchBox);
Players.Setup([PlayerName], PlayerFile);
SetLength(players,1);
with players[0] Do
begin
IsActive := True;
end;
CurrentPlayer := 0;
log := 0;
repeat
Inc(log);
antibanThreshold := ANTIBAN_THRESHOLD + random(-500, 500);
vg := random(VIGILANCE - 5, VIGILANCE + 5);
mm := MISSMOUSE_CHANCE + random(-5, 5);
sc := SPAMCLICK_CHANCE + random(-5, 5);
k := RIGHTCLICK_CHANCE + random(-5, 5);
if not IsLoggedIn then
players[currentplayer].login();
waituntil(IsLoggedIn, 60000);
minimap.clickCompass();
wait(200 + Random(500));
mouseScroll(point(263+randomrange(-10, 10), 229+randomrange(-10, 10)), 50, false);
wait(200 + Random(500));
MouseBox(IntToBox(375, 113, 428, 198), mouse_left);
wait(200 + Random(500));
MainScreen.SetAngle(MS_ANGLE_HIGH);
if log = 1 then
StartXP := chatbox.getxp();
repeat
if (findColorsSpiralTolerance(x, y, cTPA, 65956, searchBox, 40)) and (random(100) >= vg) or (chatbox.getxp() = noxp) then
ClickHarp;
printProgress;
smartImage.clearArea(IntToBox(136, 88, 527, 329));
antiban;
noxp := chatbox.getxp();
wait(gaussRangeInt(4000, 6000));
until (not isLoggedIn);
until(constant = 1);
end.