Simba Code:
Program KnighPP;
{$I SRL/SRL.Simba}
{$I RLInclude.Simba}
Const
MaxHP = 990; //Your Total HP
StartEating = 24; // This will start eating food at 24% of your total HP
StopEating = 90; // This will sttop eating food at 90% of your total HP
// Figuring out HP Percentages \\
{
The HP Orb by the Minimap will start blinking red when you get 20-25%
below your Health. This should be the same at all levels.
HP Orb turns yellow at around 50-60% below health
HP Orb turns green around 80-90% below health
If you wish to figure out what percentage to use on your own,
visit [url]http://www.csgnetwork.com/csgpercent.html[/url] and use the
Calculate The Value Of A Percentage Of A Value Section.
}
Var
PickPockets, RockTail:Integer;
// ACA for Knight \\
function KnightColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.19, 0.78);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 11542895, MSX1, MSY1, MSX2, MSY2, 21);
if (Length(arP) = 0) then
begin
Writeln('Failed to find Knight, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 2.75) and (X <= 26.73) and (Y >= 1.72) and (Y <= 15.51) and (Z >= 7.95) and (Z <= 84.02) then
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('Failed to find the Knight');
end;
// Find and PickPocket Knight \\
procedure FindKnight;
var
X, Y:Integer;
begin
if FindColorTolerance(X, Y, KnightColor, 5, 3, 511, 329, 10) then
begin
WriteLn('Found Knight');
MMouse(x, y, 0, 0);
ClickMouse2(False);
wait(2000);
ChooseOption('Pickpocket Knight');
wait(250);
WriteLn('Picked Knight');
inc(PickPockets);
end;
end;
// Eat Rockatils when low HP \\
procedure EatFood;
var
X, Y, HPLevel, StartEatHP, StopEatHP:Integer;
ColourString:String;
begin
HPLevel := RL_GetMMLevels('hp', ColourString);
StartEatHP := Round(MaxHP / 100 * StartEating);
StopEatHP := Round(MaxHP / 100 * StopEating);
if (HPLevel <= StartEatHP) then // if the value we get is lower than 20% start eating.
begin
Repeat
if FindDTM(RockTail, X, Y, MIX1, MIY1,MIX2, MIY2) then
begin
MMouse(x, y, 0, 0);
ClickMouse2(True);
wait(1500);
WriteLn('Eating Rocktail...');
HPLevel := RL_GetMMLevels('hp', ColourString); //Call this again, to get new value
end else Exit; //Exits the procedure if we CANNOT find food , failsafe.
Until(HPLevel >= StopEatHP) // until we get the value of 80%
end;
end;
// Progress Report \\
procedure ProgressReport;
begin
wait(500);
ClearDebug;
WriteLn('***************PROGRESS REPORT*************************************');
WriteLn('* Script has run for : '+ TimeRunning +'');
WriteLn('* You have picpocketed '+ IntToStr(PickPockets) +' times!');
WriteLn('*******************************************************************');
end;
// Main Loop \\
begin
SetupSRL;
ClearDebug;
RockTail := DTMFromString('mWAAAAHicY2FgYDjKxMBwEogPA/ERIOZlZGBgB2JBIOYE4vyERIaO0jKGvYuXMDQXFjKgA0Y0DAIADxEJZA==');
Repeat
EatFood;
FindKnight;
ProgressReport;
Until (False)
end.