Brandon
2011-12-27 06:30:29
How Long have You Played Runescape?
2 Year(s)
Are you affilated in anyway with Jagex LTD?
no
Were you Referred to SRL?
What is your general programming knowledge?
C++, C#, Objective-C, Javascript, HTML, PHP, Lua, Pascal, Delphi.
C++.Net (Managed).. C++ Win32-API
Are you a member of any other communities?
Xsellize
Tell us about yourself…
Please show us one (or multiple) of your scripts.
2 Year(s)
Are you affilated in anyway with Jagex LTD?
no
Were you Referred to SRL?
What is your general programming knowledge?
C++, C#, Objective-C, Javascript, HTML, PHP, Lua, Pascal, Delphi.
C++.Net (Managed).. C++ Win32-API
Are you a member of any other communities?
Xsellize
Tell us about yourself…
From: ggzz
Taking Mech Engineering.. Took Programming Already.
Highschool:
Physics, Adv Calc, Chem, etc.
Interests:
:S
Please show us one (or multiple) of your scripts.
//Kills Armoured Zombies.. Works flawlessly except for item picking up..
//Eating not yet implemented/finished. Start at Hartwin, chaos altar, zombie dungeon.. Anyone of those.
program ZombieKiller;
{$define SMART}
{$i srl/srl.scar}
{$i srl/srl/skill/fighting.scar}
{$i sps/sps.simba}
{$i SRL/SRL/misc/paintsmart.scar}
var
Prayers, Food: TStringArray;
SaveMe: Boolean;
//FILL THESE IN!
const
WTP = 50; //What prayer level to pray at? If prayer gets below this number, the bot will go prayer.
HPL = 99; //HP Level of your character.
FFS = True; //FlagFailSafe.. If FFlag is not working, set to true; otherwise false. HIGHLY recommended to set True..
NoSS = True; //Set to FALSE if using SoulSplit.. Again.. If you are NOT using soulsplit, leave this True.
QP = True; //QuickPrayer.. HIGHLY Recommended (MUCH FASTER & SAFER).. Set this before starting the bot.
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
WorldInfo := [27, 42, 45, 46, 48, 52, 59, 70, 72, 78, 79, 87, 104, 115, 117];
BoxRewards := ['XP','xp','lamp'];
LampSkill := 'Slayer';
Active := True;
//PLEASE FILL THESE TWO LINES IN..
Strings := ['harm', 'eath rune', 'lood rune', 'oul rune']; //Items to pickUp. DOES NOT WORK PERFECTLY.. Needs work badly!
Prayers := ['SS', 'Turm']; //Supports SS, Turmoil, Deflect melee.. SO FAR.. More to come later..
Food := ['lob', 'sword', 'shark'];
end;
end;
Function FindObjectMM(Colors: TIntegerArray; var X, Y, Dist: Integer; Width, Height, tol: integer): Boolean;
var
I: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
SetLength(TPA, Length(Colors));
For I:= 0 To High(Colors) do
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[i], MMX1, MMY1, MMX2, MMY2, tol); //Find colours starting from the middle outwards..
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 76.0, MMCX, MMCY); //Filter them so they are on the MM itself..
ATPA:= TPAToATPAEx(TPA, Width, Height); //Group TPA into cirles by Distance..
SortATPAFromFirstPoint(ATPA, Point(MMCX, MMCY)); //Sort the colours from the closest to the center.. AKA Me..
if(Length(ATPA) = 0) then
Exit;
MiddleTPAEx(ATPA[0], X, Y); //In that 2D Array, Pick out the closest to the middle a.k.a. the first one..
MMouse(X, Y, 0, 0); //Move the mouse to the colours found..
Wait(randomrange(200, 500));
begin
Dist:= Distance(X, Y, MMCX, MMCY);
Result:= True;
end;
GetMousePos(X, Y);
end;
Function FindObjectFX(Colors: TIntegerArray; Uptext: TStringArray; X1, Y1, X2, Y2, Width, Height, tol: integer): Boolean;
var
X, Y, I: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
SetLength(TPA, Length(Colors));
For I:= 0 To High(Colors) do
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[i], X1, Y1, X2, Y2, tol); //Find colours starting from the middle outwards..
ATPA:= TPAToATPAEx(TPA, Width, Height); //Group TPA into cirles by Distance..
SortATPAFrom(ATPA, Point(MSCX, MSCY)); //Sort the colours from the closest to the center..
if(Length(ATPA) = 0) then
Exit;
MiddleTPAEx(ATPA[0], X, Y); //In that 2D Array, Pick out the closest to the middle a.k.a. the first one..
MMouse(x, y, 5, 5); //Move the mouse to the colours found..
Wait(randomrange(200, 500)); //Wait for the uptext to show..
If(IsUpTextMultiCustom(UpText)) then
begin
ClickMouse2(False); //If it finds it, click the object/item..
wait(500);
if ChooseOptionMulti(UpText) then
begin
Result := True; //If it clicks the object, return true..
Exit;
end;
end else
Result := False; //Cannot find the uptext then its the wrong object, return false..
end;
Function FindColorMM(Colors: TIntegerArray; var X, Y: Integer; Width, Height, tol: integer): Boolean;
var
I: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
SetLength(TPA, Length(Colors));
For I:= 0 To High(Colors) do
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[i], MMX1, MMY1, MMX2, MMY2, tol); //Find colours starting from the middle outwards..
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 76.0, MMCX, MMCY); //Filter them so they are on the MM itself..
ATPA:= TPAToATPAEx(TPA, Width, Height); //Group TPA into cirles by Distance..
SortATPAFromFirstPoint(ATPA, Point(MMCX, MMCY)); //Sort the colours from the closest to the center.. AKA Me..
if(Length(ATPA) = 0) then
Exit;
MiddleTPAEx(ATPA[0], X, Y); //In that 2D Array, Pick out the closest to the middle a.k.a. the first one..
if(X AND Y <> 0) then
Result:= True;
end;
//Written By Flight..
Function FoundSymbol(Ident: Integer; var X, Y, Dist: Integer): Boolean;
var
B: TBox;
TPA: TPointArray;
L,i,CTS: Integer;
ATPA,ATPA2: T2DPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(TPA, 12632256, MMX1, MMY1, MMX2, MMY2, 10);
ColorToleranceSpeed(CTS);
if Length(TPA) < 1 then
Exit;
ATPA := TPAtoATPAEx(TPA, 8, 8);
L := High(ATPA);
SetArrayLength(ATPA2, L+1);
for i := 0 to L do
begin
B := GetTPABounds(ATPA[i]);
with B do
begin
if (Ident = 1) then
FindColorsTolerance(ATPA2[i], 16777215, B.X1-8, B.Y1-8, B.X2+8, B.Y2+8, 10) //Prayer Altar Symbol..
else if (Ident = 2) then
FindColorsTolerance(ATPA2[I], 1179385, B.X1-8, B.Y1-8, B.X2+8, B.Y2+8, 10);
Result := (Length(ATPA2[i]) > 0);
if Result then
begin
MiddleTPAEx(ATPA2[i], X, Y);
Dist := Distance(MMCX, MMCY, X, Y);
Exit;
end;
end;
end;
end;
//Edited from the Fighting.Scar include..
function AttackZombies(Colors: TIntegerArray; Tol, TimeOut: Integer): Boolean;
var
Mark: LongWord;
begin
Result := False;
if (not LoggedIn) or (FindDead) then exit;
if FindObjectFX(Colors, ['ttack', 'zombie', 'rmoured'], MSX1, MSY1, MSX2, MSY2, 10, 10, Tol) then
begin
Result := True;
Wait(1000 + Random(500));
FFlag(10);
Mark := GetSystemTime;
while (srl_InFight) and (TimeFromMark(Mark) < TimeOut) and (not FindNormalRandoms) do
begin
Wait(1000 + Random(500));
end;
end;
end;
Function PrayAltar: Boolean;
begin
if FindObjectFX([3816279, 8687513, 1711911], ['ray-at', 'haos altar', 'altar'], MSX1, MSY1, MSX2, MSY2, 20, 20, 5) then
Result:= True
else
Result:= False;
end;
Function PrayerLevel: Integer;
var
Prayer: Integer;
ColourString: String;
begin
Prayer:= GetMMLevels('Prayer', ColourString);
Result:= Prayer;
end;
Function WalkToLadder: Boolean;
var
Dist, X, Y: Integer;
begin
FindObjectMM([601693], X, Y, Dist, 10, 10, 10);
if ((Dist > 32) or ((PrayerLevel <= WTP) and (Dist > 8))) then
begin
FindObjectMM([601693], X, Y, Dist, 10, 10, 10);
ClickMouse2(true);
while isMoving do
wait(50);
Result:= (Dist < 10);
end;
end;
Function UpLadder: Boolean;
var
X, Y, Dist: Integer;
begin
ColorToleranceSpeed(2);
Repeat
WalkToLadder
FindObjectFX([2377298], ['adder'], MSX1, MSY1, MSX2, MSY2, 10, 10, 4);
wait(1000);
while IsMoving do
wait(100);
Until(FoundSymbol(1, X, Y, Dist) or PrayAltar);
Result:= True;
wait(2000);
end;
Function DownLadder: Boolean;
var
X, Y, Dist: Integer;
begin
MakeCompass('S');
ColorToleranceSpeed(2);
wait(2000);
repeat
if FindObjectFx([4473927, 6118754], ['rapdoor'], MSX1, MSY1, MSX2, MSY2, 10, 10, 5) then
begin
MMouse(X, Y, 0, 0);
wait(500);
ClickMouse2(True);
if(DidRedClick) then
break;
end;
until(FoundSymbol(1, X, Y, Dist) = False);
MakeCompass('W');
Result:= True;
end;
Function IsPrayerOn: Boolean;
var
TPA: TPointArray;
begin
ColorToleranceSpeed(2);
if FindColorsSpiralTolerance(723, 70, TPA, 7650956, 708, 53, 737, 85, 32) then
Result:= True
else
Result:= False;
end;
Function OutOfPrayer: Boolean;
var
TPA: TPointArray;
begin
ColorToleranceSpeed(2);
if FindColorsSpiralTolerance(723, 70, TPA, 6433597, 706, 55, 739, 81, 8) or IsPrayerOn or (PrayerLevel = 0) then
Result:= False
else
Result:= True;
end;
Procedure TurnPrayerOn(Prayer: TStringArray; QuickPrayer: Boolean);
begin
GameTab(Tab_Inv);
wait(1000);
if(QuickPrayer = True) then
begin
repeat
if OutOfPrayer Then
break;
MouseBox(706, 55, 739, 87, 1);
wait(1500);
Until(IsPrayerOn);
end;
end;
Procedure TalkHartwin;
var
X, Y, Dist: Integer;
begin
if FindObjectFX([6711915, 3954010, 855310, 6194317], ['alk-To Hart', 'Hartwin', 'artwin', 'o Hartwin'], MSX1, MSY1, MSX2, MSY2, 10, 10, 10) then
Repeat
repeat
ClickToContinue;
until(ClickToContinue = False);
wait(500);
FindNPCChatText('es', ClickLeft);
wait(2000);
Until(FoundSymbol(1, X, Y, Dist));
end;
Function HPLevel: Integer;
var
ColourString: String;
HP: Integer;
begin
HP:= GetMMLevels('HP', ColourString);
Result:= HP;
end;
Procedure PickUpItems(Items: TStringArray);
var
x, y: Integer;
Item: TPoint;
MS: TBox;
begin
if FindColorMM([591083], X, Y, 10, 10, 20) then
begin
Item:= MMToMS(Point(X, Y));
MS:= IntToBox(MSX1, MSY1, MSX2, MSY2);
if PointInBox(Item, MS) then
begin
MMouse(Item.X, Item.Y, 0, 0);
if IsUpTextMultiCustom(Items) then
ClickMouse2(True)
else
begin
ClickMouse2(False);
WaitOptionMulti(Items, 500);
end;
end;
end;
end;
Procedure SOS;
begin
if ((SaveMe = True) And (NoSS = True)) then
begin
repeat
writeln('Out of food AND not using SoulSplit.. Running Away..');
WalkToLadder;
UpLadder;
Logout;
until(Not LoggedIn);
writeln('Successfully Ran Away..');
TerminateScript;
end;
end;
Procedure RefillPrayer;
var
X, Y, Dist: Integer;
begin
if (PrayerLevel < WTP) then
begin
UpLadder;
while(FoundSymbol(1, X, Y, Dist) = False) do
wait(100);
repeat
PrayAltar;
while IsMoving do
wait(100);
Until(PrayerLevel > WTP);
if(FoundSymbol(1, X, Y, Dist) or (PrayerLevel > WTP)) then
DownLadder;
if (IsPrayerOn = False) then
TurnPrayerOn(Prayers, QP);
end;
end;
Procedure HealPlayer(Food: TStringArray);
var
Item, I, X, Y: Integer;
begin
if (HPLevel < ((HPL * 10)/2)) then
begin
GameTab(Tab_Inv);
wait(1000);
For I:= 0 To High(Food) do
begin
Case LowerCase(Food[I]) of
'shark':
Item:= DTMFromString('');
'lob', 'lobs', 'lobster', 'lobby', 'lobbies':
Item:= DTMFromString('');
'tuna':
Item:= DTMFromString('');
'sardine':
Item:= DTMFromString('');
'rocktail', 'rock', 'tail':
Item:= DTMFromString('');
'trout', 'cod', 'pike', 'salmon':
Item:= DTMFromString('');
'cake':
Item:= DTMFromString('');
'bass':
Item:= DTMFromString('');
'sword', 'swordy', 'swordfish', 'swords',
'swordies', 'sword fish':
Item:= DTMFromString('');
'monk', 'monkfish', 'monk fish', 'monks':
Item:= DTMFromString('');
'cave', 'cavefish', 'cave fish':
Item:= DTMFromString('');
'pizza', 'anchovies', 'anchovies pizza',
'pineapple pizza':
Item:= DTMFromString('');
'turtle', 'sea', 'sea turtle', 'squirtle':
Item:= DTMFromString('');
'manta', 'ray', 'manta ray', 'mantaray':
Item:= DTMFromString('');
'trout', 'cod', 'pike', 'salmon':
Item:= DTMFromString('');
'cake':
Item:= DTMFromString('');
'bass':
Item:= DTMFromString('');
end;
GameTab(Tab_Inv);
wait(500);
if FindDTM(Item, X, Y, MIX1, MIY1, MIX2, MIY2) then
repeat
MMouse(X, Y, 5, 5);
WaitUptextMulti(['at', 'eat', 'Eat'], 500);
ClickMouse2(true);
wait(2000);
Until((HPLevel > ((HPL * 10)/2)) or (FindDTM(Item, X, Y, MIX1, MIY1, MIX2, MIY2) = False));
if((HPLevel > ((HPL * 10)/2)) or (FindDTM(Item, X, Y, MIX1, MIY1, MIX2, MIY2) = False)) then
SaveMe:= True;
FreeDTM(Item);
end;
end;
end;
Procedure FightZombies;
begin
GameTab(Tab_Inv);
while (srl_InFight) do
begin
wait(50);
RefillPrayer;
HealPlayer(Food);
if ((IsPrayerOn = False) and (PrayerLevel > WTP)) then
TurnPrayerOn(Prayers, QP);
end;
if (not srl_InFight) then
begin
PickUpItems(Players[CurrentPlayer].Strings);
RefillPrayer;
HealPlayer(Food);
if ((IsPrayerOn = False) and (PrayerLevel > WTP)) then
TurnPrayerOn(Prayers, QP);
if Not srl_InFight then
AttackZombies([7301994, 4672074, 8229258], 5, 1000);
end;
end;
Procedure MainLoop;
var
X, Y, Dist: Integer;
begin
SOS;
TalkHartwin;
SOS;
RefillPrayer;
SOS;
if((IsPrayerOn = False) and (PrayerLevel > WTP)) then
TurnPrayerOn(Prayers, QP);
SOS;
HealPlayer(Food);
SOS;
if(FoundSymbol(1, X, Y, Dist) and (PrayerLevel > WTP)) then
DownLadder;
SOS;
FightZombies;
end;
begin
Smart_Server := 45;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
cleardebug;
SetAngle(True);
repeat
MainLoop;
until(false);
end.