Cstrike
2010-10-28 00:28:38
Yes Nava2, I need to make more constants for the interface and stuff :p!
This works pretty damn good… but needs testing. I successfully got out with it, but that's with one account only.
I have a really good failsafe in here that works flawlessly if the camera changes. I love it. /ego
1 more down, these are left:
Abyss
Certer
EvilBobScapeRune
Mordaut
Maze
Pillory
Prison
Then we own runescape after some patching up of these randoms.
This works pretty damn good… but needs testing. I successfully got out with it, but that's with one account only.
I have a really good failsafe in here that works flawlessly if the camera changes. I love it. /ego
{*******************************************************************************
function R_InPinballRandom : Boolean;
By: Cstrike
Description: Checks if we're in pinball random. Seems to sometimes fail though,
if someone can test this/fix this I'd appreciate it.
*******************************************************************************}
function R_InPinballRandom : Boolean;
begin
if not LoggedIn then Exit;
Result := ValidNPC ('Flippa');
end;
{*******************************************************************************
function R_PinballScoreTen : Boolean;
By: Cstrike
Description: If score is 10, returns true (false otherwise)
*******************************************************************************}
function R_PinballScoreTen : Boolean;
begin
if not LoggedIn then Exit;
if GetInterfaceText(243, 1) = 'Score: 10' then result := true else result := false;
end;
{*******************************************************************************
function R_PinballAngleDrasticChange (x, y, xMax, yMax : Integer) : Boolean;
By: Cstrike
Description: You input x and y as your current camera angle, and xMax, ymax is
the max value you will accept as the camera not having moved too far away to
cause a misclick. Returns true if the camera changes too drastically. Using 100
for x/yMax is good.
*******************************************************************************}
function R_PinballAngleDrasticChange (x, y, xMax, yMax : Integer) : Boolean;
var xnew, ynew : Integer;
begin
xnew := GetCamPosX;
ynew := GetCamPosY;
if (iAbs(x - xnew) > xMax) or (iAbs(y - ynew) > yMax) then result := true else result := false;
end;
{*******************************************************************************
function R_ReturnPinballActivePillar : TTile;
By: Cstrike
Description: Returns the Tile of the active pillar. Works flawless thus far.
*******************************************************************************}
function R_ReturnPinballActivePillar : TTile;
var ActivePillar : TRSObjectArray;
begin
if not LoggedIn then Exit;
result := Tile(0, 0);
ActivePillar := GetObjectsByID ([15000, 15002, 15004, 15006, 15008], OBJECT_TYPE_INTERACTABLE, 52);
if high(ActivePillar) = 0 then result := ActivePillar[0].Tile;
end;
{*******************************************************************************
function R_PinballClickTowerUntilTenScore : Boolean;
By: Cstrike
Description: This is the main procedure. Clicks on the towers to increase score.
Works pretty damn good. I had to change the time to ~3+ minutes since 2.5 mins
didn't cut it in time. I reduced the waits so this may change. I successfully
reached a score of 10 though.
*******************************************************************************}
function R_PinballClickTowerUntilTenScore : Boolean;
var x, y, t : Integer;
PillarTile : TTile;
TP : TPoint;
begin
if not LoggedIn then Exit;
result := false;
MarkTime(t);
repeat
PillarTile := R_ReturnPinballActivePillar;
if TileOnMS (PillarTile, 0) then // If this happens, move north of 'tilt' NPC
begin
TP := TileToMS (PillarTile, 0);
x := GetCamPosX;
y := GetCamPosY;
Mouse (TP.x, TP.y, 2, 3, false);
if not R_PinballAngleDrasticChange(x, y, 100, 100) then
begin
R_ChooseOption ('Tag Pinball Post');
end else
begin
writeln ('Failsafe: large camera change occured, not clicking.');
MMouse (690, 210, 30, 200);
end;
end; // If pillar isnt on MS for whatever reason, just wait
wait (4000+random(2000));
until (R_PinballScoreTen) or (TimeFromMark(t) > 200000) // 3.5 minutes is a long time IMO
if R_PinballScoreTen then result := true;
end;
{*******************************************************************************
function R_ExitPinballRandom : Boolean;
By: Cstrike
Description: Gets you out of the random.
*******************************************************************************}
function R_ExitPinballRandom : Boolean;
var ExitObj : TRSObject;
TP : TPoint;
t : Integer;
begin
if not LoggedIn then Exit;
result := false;
MakeCompass('s');
SetAngle(false);
ExitObj := GetObjectByID (15010, OBJECT_TYPE_INTERACTABLE, 52);
MarkTime(t);
repeat
wait (100);
if TileOnMS(ExitObj.Tile, 0) then
begin
TP := TileToMS(ExitObj.Tile, 0);
Mouse (TP.x, TP.y, 3, 3, false);
if ChooseOption ('Exit Cave Exit') then
begin
result := true;
Exit;
end;
end;
until (TimeFromMark(t) > 30000)
end;
{*******************************************************************************
function R_SolvePinballRandom : Boolean;
By: Cstrike
Description: Solves the random. Need to test the if not R_InPinballRandom since
it returned false (even when I was out) since the NPC name must of been missed.
Regardless, this function works!
*******************************************************************************}
function R_SolvePinballRandom : Boolean;
begin
if not LoggedIn then Exit;
result := false;
if R_InPinballRandom then
begin
if R_PinballClickTowerUntilTenScore then
begin
if R_ExitPinballRandom then
begin
wait (7000+random(4000));
if not R_InPinballRandom then
begin
result := true;
Exit;
end else writeln ('Were still in the random? Error!');
end else writeln ('Had trouble exiting the pinball arena');
end else writeln ('Was unable to get to a score of 10 in 150 seconds');
end else writeln ('Not in Pinball random'); // This NEEDS to be tested more
end; 1 more down, these are left:
Abyss
Certer
EvilBobScapeRune
Mordaut
Maze
Pillory
Prison
Then we own runescape after some patching up of these randoms.