Simba Code:
program new;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
var
{Break vars}
Sbreaks, Breaks, Sleeptime, TimeOnBreak, BreakTime: integer;
breakTimer, TimeOnBreakTimer, SleepTimer: TTimeMarker;
{Proggy vars}
ItemAcquired, Profit, ProfitPerHour, LoadsDone, PriceInteger: Integer;
ItemPrice, CurrentStatus: string;
const
Debug = true;
DrawOnSmart = false;
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'Acc username goes here';
password := 'Acc password goes here';
isActive := true;
isMember := true;
World := 6;
end;
currentPlayer := 0;
end;
{------------------------------------------------------------------------------}
procedure progressReport();
begin
profit := (ItemAcquired * (PriceInteger));
profitPerHour := round((profit * 60) / (getTimeRunning() / 60000));
TimeOnBreak := round(TimeOnBreakTimer.getTime() / 60000);
if not debug then
clearDebug();
{This will appear on the Debug each time we call it}
{--------------Report----------------------------------------------------------}
writeLn('========================================================');
writeLn('Progress Report');
writeLn('Time Run: ' + timeRunning);
writeLn('Items Acquired: ' + intToStr(ItemAcquired) + ' Profit Made: ' + intToStr(profit));
writeLn('Money P/H: ' + intToStr(profitPerHour));
writeLn('Time on Break: ' + intToStr(TimeOnBreak) + ' minutes ');
writeLn('Normal Breaks Taken: ' + intToStr(breaks) + ' Long Breaks Taken:' + intToStr(sbreaks));
writeLn('========================================================');
{------------------------------------------------------------------------------}
end;
{------------------------------------------------------------------------------}
procedure paintOnSmart();
var
doingString, moneyphString, timeString, progressString: string;
begin
if not isLoggedIn() then
exit;
{These will be printed always we call this procedure. It will only change when the Var's change.}
TimeString:= ('Time Run: ' + timeRunning);
DoingString := 'Activity we are doing';
progressString:= ('Items Picked/Made/Acquired: ' + intToStr(ItemAcquired));
MoneyphString:= ('Gp Per Hour: ' + intToStr(profitPerHour));
smartImage.clear;
//smartImage.drawBitmap({BMP name goes here}, point(0, 327)); //if we loaded a ProggyBMP erase "//" at the beggining of line
smartImage.drawText(DoingString, point(2, 0), upChars, false, 16777215); //Top left corner, white letters
smartImage.drawText(TimeString, point(2, 13), upChars, false, 16777215);
smartImage.drawText(progressString, point(2, 26), upChars, false, 16777215);
smartImage.drawText(MoneyphString, point(2, 39), upChars, false, 16777215);
smartImage.drawText(CurrentStatus, point(2, 52), upChars, false, 16777215);
//'Current Status' is to be changed at each procedure so we know what we are doing
end;
{------------------------------------------------------------------------------}
// To be called as: antiban(400); that means 10% chance
procedure antiban(rand: integer);
begin
mousespeed := 20 + random(5);
case random(rand) of
0..12: smallRandomMouse(500 + random(150));
13..25: sleepAndMoveMouse(randomRange(600, 5500));
26..28: wait(randomRange(5000, 7000));
29..40: pickUpMouse();
end;
end;
{------------------------------------------------------------------------------}
// To be called as: longAntiban(1000); that means 10% chance.
procedure longAntiban(rand: integer);
begin
case random(rand) of
1..40: begin
writeLn('Simulating Checking Social Networks');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(30000, 40000));
pickUpMouse();
end;
41..61: begin
writeLn('Simulating Bored Human');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(6000, 8000));
pickUpMouse();
mousespeed:= 19 + random(3);
smallRandomMouse(1000 + random(500));
end;
62..100: begin
writeLn('Simulating Small afk');
sleepAndMoveMouse(750 + random(500));
wait(randomRange(5000, 8000));
pickUpMouse();
end;
end;
end;
{------------------------------------------------------------------------------}
procedure doBreak();
begin
TimeOnBreakTimer.start();
if not isLoggedIn() then
exit;
CurrentStatus := ('Status: Breaking'); //Draws on smart
progressreport;
paintonsmart;
case randomRange(1,50) of
1..50: begin
clearDebug();
writeLn('Taking 10-12 minutes break');
progressreport;
paintonsmart;
players[currentPlayer].exitToLobby();
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(600000, 720000));
end;
51..100: begin
clearDebug();
writeLn('Taking (12-18 minutes break');
progressreport;
paintonsmart;
players[currentPlayer].exitToLobby();
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(480000, 1080000));
end;
end;
inc(breaks);
TimeOnBreakTimer.pause();
end;
{------------------------------------------------------------------------------}
procedure SleepBreak();
begin
CurrentStatus := ('Status: Sleeping Break');
progressreport;
paintonsmart;
TimeOnBreakTimer.start();
writeLn('Taking 7-8 hours "sleep" break');
players[currentPlayer].logout;
wait(randomRange(25200000, 28800000)); //7-8 hours
inc(Sbreaks);
TimeOnBreakTimer.pause();
end;
{------------------------------------------------------------------------------}
procedure GetPrice();
var
p : string;
begin
writeln('Recieving GE Prices');
p := getPage('Web Page where Price is goes here (GE page preferably)');
ItemPrice := between('Current Guide Price <span>', '</span>', p); //Place were Price is.
writeln('[ITEM NAME HERE]: ' +toStr(ItemPrice));
ItemPrice := replace(ItemPrice, ',', '', [rfReplaceAll]);
PriceInteger := strToInt(ItemPrice);
end;
{------------------------------------------------------------------------------}
procedure Setup();
begin
smartPlugins := ['d3d9.dll'];
clearDebug();
if drawonsmart then
smartEnableDrawing := true;
smartShowConsole := false;
setupSRL();
declarePlayers();
If Not Debug Then
DisableSRLDebug := True;
//SPS.setup('MAP NAME HERE', RUNESCAPE_OTHER); // If Using SPS MAP erase "//" at the beggining of the line
breaktime := randomrange(4600000, 5800000); //Time to break
sleeptime := randomrange(46800000, 54000000); // Time to do sleep break
//scriptPaintBMP := loadBitmap(appPath + '/Scripts/ImageName.png'); // If Using PAINT erase "//" at the beggining of the line
//Getprice(); //If We need to get the price of the GE erase "//" at the beggining of the line
breakTimer.start();
sleeptimer.start();
{------------Colors---------------} // if using global vars for colors load them here.
{------------End-Colors-----------}
end;
{------------------------------------------------------------------------------}
procedure customLogIn();
begin
players[currentPlayer].login();
writeln('Waiting for lag to go away');
wait(randomrange(4000, 5000));
exitTreasure();
minimap.clickCompass();
mainScreen.setAngle(MS_ANGLE_HIGH);
mainscreen.setZoom(true);
end;
{------------------------------------------------------------------------------}
procedure mainLoop();
begin
if breakTimer.getTime() >= breaktime then
begin
doBreak();
breakTimer.reset();
breakTimer.start();
if not isLoggedIn() then
customlogin;
end;
if sleeptimer.getTime() >= sleeptime then
begin
SleepBreak;
sleeptimer.reset();
sleeptimer.start();
if not isLoggedIn() then
customlogin;
end;
if not isLoggedIn() then
customlogin;
{Here we should call all the procedures that will carry out the actions of the script}
end;
{------MainLoop-------}
begin
Setup;
MainLoop;
end.
{-------The End-------}