Simba Code:
program SimplyPrifSummoner;
///////////////////////////////////////
// //
// //
// //
// JUST HIT DAT PLAY BUTTON //
// //
// //
// //
///////////////////////////////////////
{$DEFINE SMART}
{$i srl-6/srl.simba}
{$I SPS/lib/SPS-RS3.Simba}
{$i SRL-6/LIB/MISC/SRLPLAYERFORM.simba}
var
failSafe : TTimeMarker;
loadsDone, mistakes, pouchesMake, startingXP : integer;
const
version = '1.1';
procedure declarePlayers();
var
i: integer;
begin
players.setup(playerForm.players);
currentPlayer := 0;
for i := 0 to high(players) do
with players[i] do
begin
integers[0] := strToInt(playerForm.players[i].settings[0]);
integers[1] := strToInt(playerForm.players[i].settings[1]);
world := integers[0];
pouchesMake := strToInt(playerForm.players[i].settings[1]);
end;
end;
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'SimplyPrifSummonerV1.1';
editBoxLabels := ['Preferred World', 'Number of Pouches to Make'];
editBoxDefaults := ['0', '-1'];
editBoxHints := [
'Pick a world, any world! Actually, not any world, but whatever.',
'Default is -1 which will attempt to do the max amount of pouches possible'
];
end;
end;
procedure forceTerminate(reason : string);
begin
writeln('-- FORCED TERMINATION -- ' + reason);
//players[currentPlayer].exitToLobby();
//smartKillClient(__smartCurrentPID); I like force closing my SMART client to save resources in case I'm overnighting
terminateScript;
end;
procedure findXp();
begin
startingXP := chatBox.getXPBar();
end;
procedure antiAds();
begin
exitTreasure();
claimTicket();
closePopup();
end;
procedure antiBan();
var
i, mSpeed: integer;
begin
if not isLoggedIn() then
exit();
mSpeed := mouseSpeed;
i := random(300);
case i of
1..100:
begin
writeLn('Performing antiban. (' + ToStr(i) + ') - Small Random Mouse');
smallRandomMouse();
end;
101..200:
begin
writeLn('Performing antiban. (' + ToStr(i) + ') - Pick Up Mouse');
pickUpMouse();
end;
201..300:
begin
writeLn('Performing antiban. (' + ToStr(i) + ') - Sleep and Move Mouse');
sleepAndMoveMouse(random(2000) + 500);
end;
end;
end;
procedure setup();
begin
//minimap.clickCompass();
//mainScreen.setAngle(MS_ANGLE_HIGH);
//mainScreen.setZoom(true);
end;
//Camel's Code
procedure Mmoving(xs, ys, gravity, wind, minwait, maxwait, targetArea : Extended; updateP : procedure(var p : TPoint));
var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,D: extended;
lastX,lastY,MSP,W,TDist: integer;
pointi : TPoint;
T : LongWord;
sqrt2,sqrt3,sqrt5,maxStep,rCnc: extended;
begin
MSP := mouseSpeed + 20;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
updateP(pointI);
if PointI.x = -1 then
exit;
TDist := distance(round(xs), round(ys), pointI.x, pointI.y);
t := getSystemTime() + 10000;
repeat
if (getSystemTime() > t) then
break;
updateP(pointI);
if PointI.x = -1 then
exit;
dist:= hypot(xs - pointI.x, ys - pointI.y);
wind:= minE(wind, dist);
if (dist < 1) then
dist := 1;
D := (round((round(TDist)*0.3))/7);
if (D > 25) then
D := 25;
if (D < 5) then
D := 5;
rCnc := random(6);
if (rCnc = 1) then
D := randomRange(2,3);
if (D <= round(dist)) then
maxStep := D
else
maxStep := round(dist);
if dist >= targetArea then
begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
end else
begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
end;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (PointI.x - xs) / dist;
veloY:= veloY + gravity * (PointI.y - ys) / dist;
if (hypot(veloX, veloY) > maxStep) then
begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
end;
lastX:= round(xs);
lastY:= round(ys);
xs:= xs + veloX;
ys:= ys + veloY;
if (lastX <> round(xs)) or (lastY <> round(ys)) then
moveMouse(round(xs), round(ys));
W := (random((round(100/MSP)))*6);
if (W < 5) then
W := 5;
W := round(W*0.9);
wait(W);
lastdist:= dist;
until(hypot(xs - PointI.x, ys - PointI.y) < 3);
end;
function mMovingObject(button: integer; updateP : procedure(var p : TPoint)) : boolean;
var
randSpeed: extended;
x, y, ms: integer;
begin
if (button = MOUSE_NONE) then
exit;
ms := mouseSpeed + 20;
randSpeed := (random(mouseSpeed) / 2.0 + mouseSpeed) / 10.0;
getMousePos(x,y);
Mmoving(x, y, MOUSE_HUMAN, 5, 10.0/randSpeed, 10.0/randSpeed, 10.0*randSpeed, @updateP);
fastClick(button);
wait(100);
if chooseOption.optionsExist(['nfuse']) then
begin
chooseOption.select(['nfuse'], gaussRangeInt(300, 400));
if productionScreen.isOpen(5000) then exit(true);
end else if chooseOption.optionsExist(['ank']) then
begin
chooseOption.select(['ank'], gaussRangeInt(330, 450));
if bankScreen.isOpen(5000) then exit(true);
end else pickUpMouse();
exit(false);
end;
procedure findAltar(var p : TPoint);
var
TPA : TPointARray;
x, y, i : integer;
ATPA : T2DPointArray;
begin
findColorsSpiralTolerance(x, y, TPA, 7632517, mainscreen.getBounds(), 10, colorSetting(2, 0.17, 0.17));
if length(TPA) < 1 then
exit;
ATPA := TPA.cluster(10);
ATPA.filterBetween(0, 20);
smartimage.debugATPA(atpa);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
for (i := 0) to high(ATPA) do
begin
p := middleTPA(ATPA[i]);
end;
end;
procedure findBank(var p : TPoint);
var
TPA : TPointARray;
x, y, i : integer;
ATPA : T2DPointArray;
begin
findColorsSpiralTolerance(x, y, TPA, 3314396, mainscreen.getBounds(), 8, colorSetting(2, 0.07, 4.46));
if length(TPA) < 1 then
exit;
ATPA := TPA.cluster(20);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(point(300, 300));
for (i := 0) to high(ATPA) do
begin
p := middleTPA(ATPA[i]);
end;
end;
procedure walkToAltar();
var
p : TPoint;
attempts : integer;
label
tryAgain;
begin
if failsafe.getTime > 180000 then
forceTerminate(' Failure at ''walkToAltar''; Please post on the thread your inventory and details about what you think happened');
mouse(point(randomRange(634, 636), randomRange(27, 33)), MOUSE_LEFT);
antiBan();
wait(gaussRangeInt(1400, 1700));
repeat
wait(300);
until (minimap.findSymbol(p, MM_SYMBOL_TRANSPORTATION, minimap.getBounds())) //or failsafe.getTime > 180000);
if failsafe.getTime > 180000 then forceTerminate('Never found Transportation symbol');
tryAgain:
wait(gaussRangeInt(350, 400));
if minimap.findSymbol(p, MM_SYMBOL_TRANSPORTATION, minimap.getBounds()) then
begin
mouse(p.offSet(point(randomRange(30, 35), randomRange(-5, -2))), MOUSE_LEFT);
mouse(point(mainScreen.playerPoint.x + randomRange(-10, 70), mainScreen.playerPoint.y + gaussRangeInt(-160, -100)), MOUSE_MOVE);
smallRandomMouse();
wait(gaussRangeInt(2100, 2300));
if mMovingObject(MOUSE_RIGHT, @findAltar) then productionScreen.clickStart()
else if attempts <= 3 then
begin
inc(attempts);
setUp();
goto tryAgain;
end else forceTerminate('Couldn''t find altar, script is exiting');
smartimage.clear;
end;
end;
function craftPouches() : boolean;
begin
if failsafe.getTime > 180000 then
forceTerminate(' Failure at ''craftPouches''; Please post on the thread your inventory and details about what you think happened');
if not tabBackpack.isItemInSlot(28) then inc(mistakes) else inc(loadsDone);
end;
procedure walkToBank();
var
p : TPoint;
attempts : integer;
label
tryAgain;
begin
if failsafe.getTime > 180000 then
forceTerminate(' Failure at ''walkToBank''; Please post on the thread your inventory and details about what you think happened');
p := minimap.getBounds().getMiddle();
mouse(point(p.x + randomRange(10, 13), p.y + randomRange(87, 90)), MOUSE_LEFT);
repeat
wait(300);
until minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds()) //or failsafe.getTime > 180000;
if failsafe.getTime > 180000 then forceTerminate('Never found Bank symbol');
tryAgain:
wait(gaussRangeInt(350, 400));
if minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds()) then
begin
mouse(p.offSet(point(randomRange(4, 9), randomRange(8, 12))), MOUSE_LEFT);
wait(gaussRangeInt(6300, 6500));
if mMovingObject(MOUSE_RIGHT, @findBank) then exit
else if attempts <= 3 then
begin
inc(attempts);
setUp();
goto tryAgain;
end else forceTerminate('Couldn''t find bank chest, script is exiting');
end;
end;
procedure prepInventory();
begin
if failsafe.getTime > 180000 then
forceTerminate(' Failure at ''prepInventory''; Please post on the thread your inventory and details about what you think happened');
if bankScreen.isOpen() then
begin
wait(gaussRangeInt(450, 750));
bankScreen.clickButton(BANK_BUTTON_PRESET_1);
tabBackpack.waitWhileLocked();
if not bankScreen.isOpen() then
begin
if not tabBackpack.isItemInSlot(28) then forceTerminate('Ran out of secondaries');
if not tabBackpack.isItemInSlot(1) then forceTerminate('Ran out of spirit shards');
if not tabBackpack.isItemInSlot(2) then forceTerminate('Ran out of charms');
if not tabBackpack.isItemInSlot(3) then forceTerminate('Ran out of pouches');
end;
end;
end;
function weDoneBoys() : boolean;
begin
if (pouchesMake <> -1) and (loadsDone * 25 >= pouchesMake) then exit(true);
end;
procedure progressReport();
var
xpGained, xpPerHour : integer;
begin
xpGained := chatBox.getXPBar() - startingXP;
xpPerHour := round(xpGained * (3600.0 / (GetTimeRunning / 1000.0)));
writeLn('========================================================');
writeLn('Overlord''s Simple Prifddinas Summoner -----------------');
writeLn('Time Ran: ' + timeRunning);
writeLn('Loads Completed: ' + intToStr(loadsDone));
writeLn('Pouches Made: ' + intToStr(loadsDone * 25));
writeLn('XP Gained: ' + intToStr(xpGained));
writeLn('XP/H: ' + intToStr(xpPerHour));
writeLn('========================================================')
end;
{PROCEDURE -- autoUpdateMe
Purpose: Autoupdates the script.
Comments: By Shuttleu, modified by Ashaman88 and Clarity, Stolen by yourule97 :D}
procedure autoUpdateMe;
var
Neifile: Integer;
OnlineVersion, NewScript, NeiFeilNennen: string;
begin
OnlineVersion := GetPage('http://pastebin.com/raw.php?i=qrdu4eNi');
writeLn('Online Script Version: ' + OnlineVersion);
writeLn('Local Script Version: ' + version) if (trim(OnlineVersion) > version) then
begin
writeLn('Newer script version online!');
writeLn('Autoupdating to newer version.');
NewScript := GetPage('http://pastebin.com/raw.php?i=2VGw0NZA');
NeiFeilNennen := ScriptPath + 'ClarityBurialArmour v' + OnlineVersion + '.simba';
Neifile := Rewritefile(NeiFeilNennen, true);
try
WriteFileString(Neifile, NewScript);
except
begin
writeLn('Fatal error writing to ' + NeiFeilNennen + '!');
Terminatescript;
end;
end;
CloseFile(Neifile);
writeLn('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
writeLn('You have the latest version of the script!');
end;
procedure mainLoop();
begin
failSafe.start;
prepInventory();
walkToAltar();
craftPouches();
progressReport();
walkToBank();
failSafe.reset;
end;
begin
clearDebug();
smartPlugins := ['d3d9.dll'];
smartEnableDrawing := true;
smartShowConsole := false;
initPlayerForm();
runPlayerForm();
if (not playerForm.isScriptReady) then
exit;
declarePlayers();
setupSRL();
if not isLoggedin() then
begin
players[currentPlayer].login();
wait(gaussRangeInt(3300, 5500));
end;
antiAds();
setup();
findXp();
mMovingObject(MOUSE_RIGHT, @findBank);
repeat
mainLoop();
until weDoneBoys();
end;