Simba Code:
Program JJsSummoner;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i SRL/SRL/misc/debug.simba}
{$i SRL/SRL/misc/smartgraphics.simba}
Var
PouchesToMake: Integer;
///////////////////////////////////////////////////////////////////////
// //
// Begin of user setup //
// Fill in the fields below //
// //
///////////////////////////////////////////////////////////////////////
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
With Players[0] Do
Begin
Name := ''; // ***RS Username***
Pass := ''; // ***RS Pass***
Pin := ''; // ***RS Pin***
PouchesToMake := 32000; // ***How many pouches to make?***
BoxRewards := ['Coins', 'oins'];
Active := True;
End;
End;
///////////////////////////////////////////////////////////////////////////////////////////
// //
// End of user setup //
// Don't touch below this line unless you know what you're doing!! //
// //
///////////////////////////////////////////////////////////////////////////////////////////
Var
FoundMagestix,FoundObelisk,Start: Boolean;
B,T,PouchesMade,Selling,StartTime,
MagestixX,MagestixY,ObeliskX,ObeliskY,
PouchesPH,StartingExperience,XP,XPH: Integer;
Const
ScriptVersion='2.0';
Procedure SetupLogin;
Begin
ClearDebug;
{$IFDEF SIMBAMAJOR980}
SMART_SERVER := 10;
SMART_MEMBERS := TRUE;
SMART_SIGNED := TRUE;
SMART_SUPERDETAIL := FALSE;
{$ELSE}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}
SetupSRL;
DeclarePlayers;
LoginPlayer;
UseFindMod:=False;
ToggleXPBar(True);
StartingExperience := GetXPBarTotal;
StartTime:=GetSystemTime;
ClickNorth(SRL_ANGLE_HIGH);
B:= 0;
Start:=True;
MarkTime(T);
End;
Function WaitPixelChange(Time:Integer;Points:TPointArray):Boolean;
Var
T:Integer;
ColorPoints: TPointArray;
InitialColors: TIntegerArray;
Begin
ColorPoints:=Points;
InitialColors:= GetColors(ColorPoints);
MarkTime(T);
Repeat
If InitialColors<>GetColors(ColorPoints) Then
Break;
If TimeFromMark(T) > Time Then
Begin
Result := False;
Exit;
End;
Until(False);
Result := True;
End;
Function WaitInvCountInc(Time:Integer):Boolean;
Var
Inv1,Inv2,T:Integer;
Begin
MarkTime(T);
Inv1 := InvCount;
Repeat
Wait(10);
Inv2 := InvCount;
If TimeFromMark(T) > Time Then
Begin
Result := False;
Exit;
End;
If InvFull Then
Break;
Until(Inv2 > Inv1);
Result := True;
End;
Function WaitInvCountDec(Time:Integer):Boolean;
Var
Inv1,Inv2,T:Integer;
Begin
MarkTime(T);
Inv1 := InvCount;
Repeat
Wait(10);
Inv2 := InvCount;
If TimeFromMark(T) > Time Then
Begin
Result := False;
Exit;
End;
Until(Inv2 < Inv1);
Result := True;
End;
Function IsShopUp: Boolean;
Begin
ColorToleranceSpeed(1);
Result := (CountColorTolerance(3779306, 490, 81, 501, 203, 15) > 100); // Orange scrolling bar
End;
Function IsObeliskUp: Boolean;
Begin
ColorToleranceSpeed(1);
Result := (CountColorTolerance(105157, 200, 37, 211, 47, 1) > 30); // Yellow X
End;
Function IsMainSpotUp: Boolean;
Begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 1.56);
Result := (CountColorTolerance(6529477, MSX1, MSY1, MSX2, MSY2, 11) > 2000); // Light brown of the logs
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
End;
Function SellTime: Boolean;
Begin
Inc(B);
Inc(Selling);
If (B > 22) Then
Begin
B := 0;
Selling := (Selling - 1);
End;
If (Selling = 2) Then
Begin
Selling := 0;
Result := True;
End;
If Start Then
Result:=True;
End;
Function TradeMagestix: Boolean;
Var
Colors: TPointArray;
SplitColors: Array of TPointArray;
P: TPoint;
Begin
If Not LoggedIn Then
Exit;
FindNormalRandoms;
If Not(FoundMagestix) Then
Begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.17, 1.45);
If FindColorsSpiralTolerance(MSCX, MSCY, Colors, 1546700, MSCX-30, MSCY-80, MSCX+30, MSCY, 14) Then
Begin
SplitTPAExWrap(Colors, 3, 3, SplitColors);
SortATPASize(SplitColors, True);
P := MiddleTPA(SplitColors[0]);
MMouse(P.X+RandomRange(-4, 4), P.Y+RandomRange(20, 28), RandomRange(-5, 5), RandomRange(-5, 5));
If WaitUpTextMulti(['alk', 'ages', 'tix'], 500) Then
Begin
FoundMagestix := True;
MagestixX := P.X;
MagestixY := P.Y+24;
ClickMouse2(False);
If WaitOptionMulti(['rade', 'Trade'], 500) Then
Result:=True;
End;
End;
End Else
Begin
MMouse(MagestixX, MagestixY, RandomRange(-2, 2), RandomRange(-2, 2));
ClickMouse2(False);
If WaitOptionMulti(['rade', 'Trade'], 500) Then
Result:=True;
End;
End;
Function SellSecondary: Boolean;
Begin
If Not LoggedIn Then
Exit;
If FindNormalRandoms Then
Exit;
If WaitFunc(@IsShopUp, RandomRange(50, 100), 6000) Then
Begin
If SellTime And ExistsItem(1) Then
Begin
Mousebox(567, 217, 589, 237, Mouse_Right);
If WaitOptionMulti(['50', 'Sell 50', 'l 5'], 1000) Then
Result:=True;
If Start Then
Begin
Start:=False;
WaitPixelChange(5000,[Point(565,218),Point(572,217),Point(580,217),Point(571,220)]);
End;
End Else
Begin
Result:=True;
End;
End;
End;
Function BuySecondary: Boolean;
Begin
If Not LoggedIn Then
Exit;
If FindNormalRandoms Then
Exit;
Mousebox(180, 199, 211, 218, Mouse_Right);
If WaitOptionMulti(['50', 'y 5', 'All', '500', 'Buy 50'], 1000) Then
Begin
Mousebox(491, 13, 506, 27, Mouse_Move);
WaitInvCountInc(2000);
If PinScreen Then
Begin
InPin(Players[0].Pin);
Wait(2000 + Random(2000));
TradeMagestix;
BuySecondary;
End;
Result:=True;
End;
End;
Function CloseShop: Boolean;
Var
X,Y: Integer;
Begin
If Not LoggedIn Then
Exit;
If FindNormalRandoms Then
Exit;
GetMousePos(X,Y);
If Not PointInBox(Point(X,Y),IntToBox(491,13,506,27)) Then
Mousebox(491, 13, 506, 27, Mouse_Left) Else
ClickMouse2(True);
MMouse(ObeliskX, ObeliskY, RandomRange(-15, 15), RandomRange(-15, 15));
If WaitFunc(@IsMainSpotUp, RandomRange(50, 100), 5000) Then
Result:=True;
End;
Function OpenObelisk: Boolean;
Var
Colors: TPointArray;
SplitColors: Array of TPointArray;
P: TPoint;
Begin
If Not InvFull Then
Exit;
If Not LoggedIn Then
Exit;
FindNormalRandoms;
If Not(FoundObelisk) Then
Begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.11, 0.13);
If FindColorsSpiralTolerance(MSCX, MSCY, Colors, 9147284, MSX1, MSY1, MSX2, MSY2, 17) Then
Begin
SplitTPAExWrap(Colors, 5, 5, SplitColors);
SortATPASize(SplitColors, True);
P := MiddleTPA(SplitColors[0]);
Repeat
MMouse(P.X, P.Y, RandomRange(-15, 15), RandomRange(-15, 15));
If WaitUpTextMulti(['fuse', 'ouch', 'lisk'], RandomRange(300,400)) Then
Begin
ObeliskX := P.X;
ObeliskY := P.Y;
FoundObelisk := True;
ClickMouse2(True);
End;
If FindNormalRandoms Then
Exit;
Wait(Random(500));
Until IsObeliskUp;
Result:=True;
End;
End Else
Begin
If Not IsUpTextMultiCustom(['fuse', 'ouch', 'lisk']) Then
MMouse(ObeliskX, ObeliskY, RandomRange(-15, 15), RandomRange(-15, 15));
If WaitUpTextMulti(['fuse', 'ouch', 'lisk'], RandomRange(300,400)) Then
Begin
Repeat
Wait(Random(500));
ClickMouse2(True);
If FindNormalRandoms Then
Exit;
Until IsObeliskUp;
End;
Result:=True;
End;
End;
Function MakePouches: Boolean;
Begin
If Not LoggedIn Then
Exit;
If FindNormalRandoms Then
Exit;
If WaitFunc(@OpenObelisk,RandomRange(50,100),6000) Then
Begin
MouseBox(51,68,76,94,Mouse_Right);
If WaitOptionMulti(['All','Infuse-All'],1000) Then
Begin
WaitPixelChange(1000,[Point(709,416),Point(704,410),Point(708,401),Point(700,403)]);
IncEx(PouchesMade,23);
Result:=True;
End;
End;
End;
Function MakeScrolls: Boolean;
Begin
If Not LoggedIn Then
Exit;
If FindNormalRandoms Then
Exit;
If WaitFunc(@OpenObelisk,RandomRange(50,100),5000) Then
Begin
MouseBox(110,35,155,50,Mouse_Left);
WaitPixelChange(1000,[Point(65,100),Point(62,88),Point(82,98),Point(49,104)]);
Mousebox(51,68,76,94,Mouse_Right);
If WaitOptionMulti(['All','Infuse-All'],1000) Then
Result:=True;
WaitInvCountDec(1000);
End;
End;
Procedure FailSafe;
Begin
FindNormalRandoms;
If (TimeFromMark(t) > 15000) Then
Begin
MarkTime(T);
If FindChatBoxText('inventory',8,clBlack) Then
CloseShop;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06,1.58);
If CountColorTolerance(1803469,494,16,502,24,13) >= 25 Then
Begin
CloseShop;
End else
Begin
MouseBox(479, 35, 492, 48, 1);
End;
end;
end;
Procedure DrawProggy;
Var
Bmp: Integer;
Begin
SMART_ClearCanvas;
Bmp := BitmapFromString(53, 55, 'meJztmHlslGUex7trNpGrB1Bks4' +
'luYnZXy7FerG1pRUVEChH/2exGE42bkKyumFUIYpQNnlmRo0JvSu+' +
'7tLQcPabT+8aWntOZ6Zyd+z3n7kWF/T7v045dQdBllH/2zS9PhtC+' +
'/cz3dz/Xr///uf0TEhISGXnfmjX3rV4dGR4ecbdx/ut5dONjq1ZFA' +
'm/16jWRkWtwhoaG322o+SdmU8yTj0dHrATffWADZ1hYeHR0/Nq1v7' +
'7baOR5KeGlRzY8SvFWrly9ZMnSN998p7dX+eCDv4PH7y7by39+ede' +
'2Xesf3gC8iIiVy5YtP3Toc4djiudnn39+593Fc7nczY0t257a9vAf' +
'olaEhoWFRXz++QmWnWWYabf72ltv7btbeKLLC/N6/TabY89re+7/z' +
'f3AS0rKFsVvzGY3DOplZRX//HgUbGp6luUEmM8/XVZydm3k2pMnM9' +
'3u6yaTa2LCqddzDDPZ1TUUEvKLnxkM5vb4Od7JCy7R6cFng9FSXl7' +
'DcbNWqxdsOh1rNArAGx3V/5zqAezq3HVQMZwoiB7R6WVY0cEIZrPT' +
'bp+0WLxms8tkcs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
'lQkf8+mtJYlo7ADVdqqTgULb3JqlhfdwHMwWLhcBgPWQMFq9QEPkz' +
'BObKxjbVWYCmhGDNaRDqJpLTH3nAMnxaPqkbuFijSMBMEqLKTczXy' +
'DDdps4Y1kl5m/U8K5cEniMegYRVOZomH+omBEygttW5m+oxyzOom3' +
'qnQae8gRyBgsPPw6VlSXx2+xkrV04bILSeHQaFiwETN5NEqjQj7fJ' +
'mjFA6S+vQyDFslcqdzRzR3TLKo08DDpBQVv5uo1xBvLztpsk4CBYg' +
'DT6TicFgu5ATNOuMdHxiCdUqrGMKyWSmkBQWogRwKrMU5apYF353W' +
'PjCj9gwyL0PKK4jXp7tcv3YoQ/0rXmFgleMOEWzM0rJTnoc+ONxfT' +
'rRy60Q0dXl7AS6N48HVgXLlDPJbzorLpdCDxWywkF6CYzeaXTp+0V' +
'rvNVr92sE8lz4NcSAeas2gcqMwqMmvl0eVOupxJozmCkSBIeLN0fQ' +
'aJtESzUgQKNOqgJMNMWYDX36FuzEciBKjolkRvYFDoEHKUUBr8UoO' +
'FhxMwDse0hEeSAqlhNIoQDeGH02r1msweTU/DeFOBrr2ctozxlhK6' +
'Ziql7gY8GM0O6eYkGT23gdzJnLzz1MDjcl2nhgSBWxFy81FnEKRrY' +
'ed450V1UwHJBTmZQkF1pSYbuqnmJ9LMy9Xf4mGgIniFidiDgtVzF0' +
'PCoJtWyxiN5ArRYhZUrRXq5kK1lBfzkx5283qSyxha4Fni3Co62Kf' +
'TaRnqYXQJ7jh6IydMZD3GrkpDR5kOe0czKSYoxehrUpEhlzB0c6fr' +
'Rh+5kU6FW1tKkqBnEPFu5Lzx0baW6trLIKC6uUjTWgpClGUohmYBQ' +
'gTkrdfVn/oJ/F0UEySypqVE01KMKn23eG763Hap/1HPfwCWogq+');
SetTransparentColor(Bmp,clWhite);
FastReplaceColor(Bmp,clWhite,0);
SMART_DrawBitmap(False,Bmp,Point(31, 218));
FreeBitmap(Bmp);
End;
Procedure ProgressReport;
Var
Sec: Integer;
Begin
ClearDebug;
XP := (GetXPBarTotal - StartingExperience);
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
PouchesPH := Round((PouchesMade * (3600.0 / (GetTimeRunning / 1000.0))));
Sec := (1+((GetSystemTime-StartTime)/1000));
SMART_ClearCanvasArea(IntToBox(0, 324, 350, 388));
SMART_DrawText(5, 247, UpCharsEx, 'JJ''s v'+ScriptVersion, RGBToColor(100, 190, 225));
SMART_DrawText(5, 275, UpCharsEx, 'Running for: '+TimeRunning+'', ClWhite);
SMART_DrawText(5, 290, UpCharsEx, 'Pouches made: '+IntToStr(PouchesMade)+' at '+ToStr(PouchesPH)+' per hour', ClWhite);
SMART_DrawText(5, 305, UpCharsEx, 'Scrolls made: '+IntToStr(10*(PouchesMade))+' at '+IntToStr(((PouchesMade*36000)/Sec))+' per hour', ClWhite);
SMART_DrawText(5, 320, UpCharsEx, ''+ToStr(XP)+' Summoning xp gained at '+ToStr((XPH))+' per hour', ClWhite);
Writeln('=========JJs Summoner=========');
Writeln('=========Version: '+ScriptVersion+'=========');
Writeln('Time Running: ' + TimeRunning);
Writeln('Pouches Made: ' + IntToStr(PouchesMade));
Writeln('Experience Earned: ' + IntToStr(XP));
Writeln('Experience/Hour: ' + IntToStr(XPH));
Writeln('Pouches/H: ' + IntToStr(PouchesPH));
Writeln('===============================');
End;
Begin
SetUpLogin;
DrawProggy;
Repeat
If TradeMagestix Then
Begin
SellSecondary;
BuySecondary;
CloseShop;
MakePouches;
MakeScrolls;
ProgressReport;
End Else
FailSafe;
If Not LoggedIn Then
LoginPlayer;
Until (AllPlayersInactive) Or (PouchesMade >= PouchesToMake);
End.