SCAR Code:
// Metagen's Fleshy Pounder.
// This script uses SCAR Divi 3.12 and SRL 4
// The basic idea is that it doesnt actually click on the monster, but
// the monster attacks you, very quickly.
// ----- Version 1.0 -----
//Lots of antirandom
//Auto-Eating
//Automatically walks down tunnel and comes back to reaggrivate
//Auto-opens rickety doors
//Some Anti-Ban stuff
// ----- Version 1.1 -----
// Multiplayer
// Added LOADS of failsafes
// ----- Version 1.2 -----
// - Fixed eating bug (should now eat more often in main room)
// - added failsafe for the door back (no longer get stuck between)
// - Added Further Anti-Ban (instead of checking for all randoms, just
// checks for talking randoms regularly, randomly checks for others)
// --- Version 1.3 ----
// - Progress reports
// - Fixed door (again)
// - Added DTM for the room
// - Fixed bug where you can die down the hallway if u run out of food
// - Better Looking script :p
// --- Version 1.4 ----
// - Better proggies -checks how much xp you made
// - Added Fight Style Changer
// - Added SRLPlayerForms
// - Much better DTM finding.
// - Fixed bug with
// ------How to use--------
//1.Move your army to the second level of the stronghold of security, the most
// south-eastern room. Set ur guys in the south-west corner of the room.
// 2. Make sure runescape is running on Low-Detail, and highest brightness
// 3. Set the client window, get the color of your food.
// 4. Click the shiney green arrow
// 5. Enter all the values :)
program New;
{.include srl/srl.scar}
{.include srl/srl/misc/users.scar}
//{.include srl/SRL\Core\GameTab.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}
var
x, y, i, misscount, xpcount, Mark, Mark2 : integer;
RoomDTM, temp : integer;
angle : extended;
const
DoorX = 238;
DoorY = 157;
text = 'ickety door';
procedure DeclarePlayers;
begin
SRLPLayerForm(true, [], ['Food Color', 'Eat Hp', 'Fight Style (1-4)'], ['Food Name', 'Skill To Proggy'], []);
end;
procedure LoadDTM;
begin
{RoomDTM := DTMFromString('78DA634C6562600862C00A1861740C504D00A' +
'ADCF757DF184490D5A400D5C41250530054134C404D16508D277E' +
'3500A6060F5B');
RoomDTM := DTMFromString('78DA634C656260B060C00A18617420116ACA8' +
'06A5409A84903AA8920A0A68D08BB92806A7209A8990954634740' +
'CD7422CC292342CD2CA09A10026AD2816A94F0AB0100A769086E');}
RoomDTM := DTMFromString('78DA636C656260F060C0003A8C0C0C40C4F01' +
'F0818C3806ADC51E523345918E418206A4080311AA8C691809A4C' +
'A01A57749B18199891D57403D5A81350331FA82688809A7AA09A3' +
'84C7F21AB010043460ACF');
end;
function EatCheck : boolean;
begin
temp := GetSkillInfo('hp', true);
if (temp < Players[CurrentPlayer].Integers[1]) then
begin
writeln('eating');
gametab(4);
if findcolortolerance(x,y, Players[CurrentPlayer].Integers[0], 552, 209, 729, 460, 5) then
begin
MMouse(x,y,0,0);
wait(150+random(21));
if isuptext(Players[CurrentPlayer].Strings[0]) then
begin
Mouse(x, y, 0, 0, true);
end else
begin
Result := False;
Exit;
end;
end else
begin
result := False;
exit;
end;
end;
result := True;
end;
procedure RoomLogout;
begin
MakeCompass('N');
mouse(593,119, 4, 4, true);
wait(2000);
mouse(593,119, 4, 4, true);
wait(random(3000));
Players[CurrentPlayer].loc := 'Out of food';
logout;
exit;
end;
procedure randoms;
begin
findNormalRandoms;
end;
function ScanName(name : string; var cx, cy: integer; Startx, Starty : integer; Down : Boolean) : boolean; // by me
var
PointX, PointY, PointY2 : integer;
begin
for PointX:= StartX to StartX + 100 do
begin
PointX := PointX + 5;
for PointY:= StartY to StartY + 60 do
begin
PointY := PointY + 20;
if down = false then
begin
PointY2 := 2 * StartY - PointY
end else
begin
PointY2 := PointY - 60
end;
mmouse(PointX, PointY2, 0, 0);
wait(100);
if(IsUpText(name)) then
begin
result := true;
cx := PointX;
cy := PointY2;
exit;
end;
end;
end;
result := False;
end;
function SecondDoorOpen : boolean;
var
rx : integer;
begin
mouse(616, 47, 4, 4, true); //walk to door
fflag(0);
if ScanName(text, x, y, Doorx, Doory, true) then
begin
for i := 1 to 5 do
begin
rx := random(10);
mmouse(x+5+rx, y+5+rx, 0, 0);
if isuptext(text) then
begin
for i := 1 to 60 do
begin
if not isuptext(text) then
begin
result := true;
exit;
end else
begin
mouse(x+5+rx, y+5+rx, 0, 0, true);
wait(2000+random(300));
end;
end;
end;
end;
end;
result := false;
end;
procedure AttemptRecovery;
begin
makeCompass('W');
mouse(649,22,0,0,true);
wait(3000+random(1000));
SecondDoorOpen;
makeCompass('E');
end;
procedure WalkHall;
begin
If not loggedin then exit;
Players[CurrentPlayer].loc := 'Walking Hallway';
//radialWalkex(x,y,643, 83, 15199724, 30, 270, 400, 30);
RadialWalk(15199724, 30, 270, 400, x, y);
mouse(x,y,0,0,true);
wait(200);
if flagpresent then
begin
FindNonInventoryRandoms;
fflag(0);
EatCheck;
//radialWalkex(x,y,643, 83, 15199724, 30, 270, 400, 65);
RadialWalk(15199724, 30, 270, 400, x, y);
mouse(x,y,0,0,true);
FindNonInventoryRandoms;
fflag(0);
EatCheck;
//radialWalkex(x,y,643, 83, 15199724, 30, 210, 150, 60);
RadialWalk(15199724, 30, 210, 150, x, y);
mouse(x,y,0,0,true);
FindNonInventoryRandoms;
fflag(0);
EatCheck;
//radialWalkex(x,y,643, 83, 15199724, 30, 210, 150, 60);
RadialWalk(15199724, 30, 210, 150, x, y);
mouse(x,y,0,0,true);
FindNonInventoryRandoms;
fflag(0);
mouse(325, 464, 4, 4, true); //this is basically a failsafe
//due to the confined space even if radialwalk misses this will click
//in the area on the other side of the door and walk u to it.
wait(1000+random(450));
MakeCompass('N');
MakeCompass('E');
end else if i < 3 then
begin
i := i + 1;
SecondDoorOpen;
WalkHall;
end;
end;
function FirstDoorOpen : boolean;
var
rx : integer;
begin
if ScanName(text, x, y, Doorx, Doory, false) then
begin
for i := 1 to 5 do
begin
rx := random(10);
mmouse(x+5+rx, y, 0, 0);
wait(200+random(100));
if isuptext(text) then
begin
mouse((x+5+rx), y, 0, 0, true);
result := true;
wait(3000+random(234));
exit;
end;
end;
end;
result := false;
wait(3000+random(234));
end;
procedure ToFirstDoor;
begin
//perfectnorth;
makecompass('N');
mouse(651, 78, 4, 4, true);
fflag(0);
makecompass('W');
//radialWalkex(x,y,643, 83, 15199724, 30, 270, 400, 50);
RadialWalk(15199724, 30, 270, 400, x, y);
makecompass('W');
mouse(x,y,0,0,true);
fflag(0);
end;
procedure RunDownHall;
begin
If not loggedin then exit;
writeln('Walking Down Hall');
SetRun(true);
i := 0;
repeat
i := i + 1;
ToFirstDoor;
Players[CurrentPlayer].loc := 'At First Door';
wait(500+random(200));
if i = 3 then
begin
writeln('Error, Could not locate first door.');
logout;
end;
Until FirstDoorOpen
if not EatCheck then
begin
Logout;
Exit;
end;
wait(500+random(200));
if not SecondDoorOpen then //this will most likely NEVER happen.
begin
writeln('Second Door Opening Failed');
AttemptRecovery;
Exit;
end;
Players[CurrentPlayer].loc := 'Start of hallway';
i:= 0;
WalkHall;
Players[CurrentPlayer].loc := 'Start of hallway';
FirstDoorOpen;
Players[CurrentPlayer].loc := 'In between the doors';
Randoms;
wait(3000+random(500));
if not EatCheck then
begin
Logout;
Exit;
end;
SecondDoorOpen;
mouse(630, 68, 2, 2, true);
wait(1000);
if not flagpresent then
begin
SecondDoorOpen;
mouse(630, 68, 2, 2, true);
if not flagpresent then
begin
SecondDoorOpen;
mouse(630, 68, 2, 2, true);
if not flagpresent then logout;
end;
end;
Players[CurrentPlayer].loc := 'In the room';
fflag(0);
end;
procedure RandomTab;
begin
if random(15) = 1 then
begin
gametab(random(random(14))); //causes unevenness in tabs
if random(9) = 1 then
begin
wait(300+random(432));
gametab(random(random(14))); //causes unevenness in tabs
wait(random(500));
gametab(random(random(14))); //causes unevenness in tabs
end;
wait2(3000, false);
end;
end;
procedure Proggy;
var
i : integer;
begin
writeln(' ');
writeln('<== Fleshy Pounding Carnage Report ==>');
writeln('Total Time: '+TimeRunning);
for i:=0 to getarraylength(players)-1 do
writeln(Players[i].Name + ': ' + inttostr(Players[i].Integers[4] / 1000 / 60) + ' Minutes and ' + inttostr((Players[i].Integers[4] / 1000)-((Players[i].Integers[4] / 1000 / 60)*60))+' Seconds -- Location: ' + Players[i].Loc + ' -- XP Gained: ' + inttostr( Players[i].Integers[6] - Players[i].Integers[5]));
writeln('<== End of Report ==>');
writeln(' ');
end;
procedure RoomMiddle;
var
RoomMark : integer;
begin
makecompass('N');
ToFirstDoor;
mouse(661, 105, 3, 2, true);
wait(500);
if not FlagPresent then
begin
MarkTime(RoomMark);
repeat
if (TimeFromMark(RoomMark) > 60000) then
begin
Roomlogout;
exit;
end;
MakeCompass('E');
SecondDoorOpen;
mouse(661, 105, 3, 3, true);
until (flagpresent)
end;
fflag(0);
end;
procedure FindRoomDTM;
begin
Randoms;
MakeCompass('N');
if not FindDtmRotated(RoomDTM, x, y, MMX1, MMY1, MMX2, MMY2, -1, 1, 0.01, angle) then
begin
SendArrowwait(1, 100+random(21));
SendArrowwait(3, 100+random(21));
MakeCompass('N');
if not FindDtmRotated(RoomDTM, x, y, MMX1, MMY1, MMX2, MMY2, -1, 1, 0.01, angle) then
begin
RoomMiddle;
Exit;
end;
end;
end;
procedure RoomMiddleDTM;
var
RoomMark : integer;
begin
if not loggedin then exit;
FindRoomDTM;
Mouse(x,y, 1, 1, true);
If not flagpresent then
begin
MarkTime(RoomMark);
repeat
if (TimeFromMark(RoomMark) > 60000) then
begin
Roomlogout;
exit;
end;
MakeCompass('E');
SecondDoorOpen;
MakeCompass('N');
FindRoomDTM;
Mouse(x,y, 1, 1, true);
until FlagPresent
end;
end;
procedure AggressiveCheck;
begin
setangle(true);
if findfight then
begin
xpcount := 0;
end else
begin
xpcount := xpcount + 1;
end;
if xpcount = 1 then
RoomMiddleDTM;
if xpcount > 3 then
begin
RunDownHall;
wait(random(2000));
xpcount := 0;
end;
end;
procedure StartScript;
begin
SetupSrl;
DeclarePlayers;
ActivateClient;
LoadDTM;
end;
procedure LoginTasks;
begin
LoginPlayer;
MarkTime(Mark);
MarkTime(Mark2);
MakeCompass('N');
Players[CurrentPlayer].Integers[5] := GetXp(Players[CurrentPlayer].Strings[1]);
if not SetFightMode(Players[CurrentPlayer].Integers[2]) then logout;
RoomMiddleDTM;
Players[CurrentPlayer].loc := 'In the room';
end;
procedure MainLoop;
begin
Wait2(500+random(500), false);
i := random(8);
case I of
2: Randoms;
3: RandomTab;
4: if random(1) = 2 then RoomMiddleDTM;
5: Players[CurrentPlayer].Integers[6] := GetXp(Players[CurrentPlayer].Strings[1]);
end;
AggressiveCheck;
FindNonInventoryRandoms;
if not EatCheck then RoomLogout;
Wait2(5000+random(100)*random(100), false);
if TimeFromMark(Mark2) > 300000 then
begin
Players[CurrentPlayer].Integers[6] := GetXp(Players[CurrentPlayer].Strings[1]);
proggy;
MarkTime(Mark2);
end;
end;
Procedure LogoutTasks;
begin
MissCount := 0;
i := 0;
Players[CurrentPlayer].Integers[4] := timefrommark(Mark);
Proggy;
NextPlayer(False);
end;
//Main Program
begin
StartScript;
For i:= 0 to (GetArrayLength(Players)-1) do
begin
LoginTasks;
repeat
MainLoop;
until LoggedIn = False
LogoutTasks;
end;
freeDTM(RoomDTM);
end.