SRL Archive - Reflection Development

Pinball random solved


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

{*******************************************************************************
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.

Naike

2010-10-28 04:18:41

Going to work and finish maze of today I think..

Good going cstrike :)

Cstrike

2010-10-28 11:09:45

From: Naike
Going to work and finish maze of today I think..

Good going cstrike :)


Work AND finish the MAZE?

De er gud ;) [theres some practice]



EDIT: I just realized it actually has been solved, but:
{*******************************************************************************
function R_SolvePinball : Boolean;
by: lordsaturn
Description: Solves Pinball Random.
*******************************************************************************}
function R_SolvePinball : Boolean;
var
CurrPole: TRSObject;
P: TPoint;
t, lastscore, currscore: integer;
begin
if not R_InPinball then Exit;
while R_InPinball do
begin
lastscore := Pinball_GetScore;
currscore := Pinball_GetScore;
if(currscore >= 10)then
begin
Writeln('Done tagging pillars! Score is 10!');
Result := True;
Pinball_Leave;
Break;
end;
while R_ClickToContinue do
wait(900+Random(900));
CurrPole := Pinball_GetPillar;
if (CurrPole <> NULL_RSOBJECT)then
begin
P := TileToMS(CurrPole.Tile, 400);
Mouse(P.x, P.y, 3, 3, false);
if R_ChooseOption('tag')then
begin
Writeln('Tagged!');
MarkTime(t);
while((currscore = lastscore) and (TimeFromMark(t) < 10000))do
begin
if CharacterMoving then
MarkTime(t);
currscore := Pinball_GetScore;
end;
end;
end;
end;
R_ClickToContinue;
Result := not R_InPinball;
if Result then
Inc(RSolved[RPinballs])
else
Inc(RFailed[RPinballs]);
end;

If there was a way to combine my procedure and LordSaturn's one here, it'd work best.
The one I made has a failsafe for the angle camera changing (don't know if one is in LordSaturns), which actually does affect clicking of the posts and can reset one to zero.

weequ

2010-10-28 14:04:41

Good job and thanks for the list.
If I get like pillory random I might try to make a script for it :)

Cstrike

2010-10-28 14:09:44

From: antti mies
Good job and thanks for the list.
If I get like pillory random I might try to make a script for it :)


That'd be awesome :)
If you get any in 'any' random, try and test them with some of the R_Randoms or send new ones this way

Naike

2010-10-28 14:38:01

Cstrike, if you give me a finished whole include, I can do something..
Otherwise it'll all have to wait until sunday I'm afraid.

Overtime

2010-10-28 15:04:25

my pinball just worked fine with the one reflection uses.

solved it on the first try while cleaning herbs.

didn't think there was anything wrong with it.

Cstrike

2010-10-28 15:07:59

From: Squancy
my pinball just worked fine with the one reflection uses.

solved it on the first try while cleaning herbs.

didn't think there was anything wrong with it.


Did you watch it? Or did you just see a report after that 'pinball was solved'?

If it works then there's no need in adding my script. I'll keep it here in case we have any trouble in the future with the camera change. As long as they're working that's all I want :)

Overtime

2010-10-28 15:15:42

i watched it. i was on Teamviewer when it was doing it so it didn't look so clear.

However it did misclick as soon as the camera angle changed and it had to start all over. but it still did it none the less

maybe this "stealth" update fixed it. Because it happened around 9:45 am central time.

Cstrike

2010-10-28 15:31:59

From: Squancy
i watched it. i was on Teamviewer when it was doing it so it didn't look so clear.

However it did misclick as soon as the camera angle changed and it had to start all over. but it still did it none the less

maybe this "stealth" update fixed it. Because it happened around 9:45 am central time.


Based on this idea, I wonder if I can add my camera change idea as a failsafe to the main script. This I shall attempt soon upon getting another account in the random

Overtime

2010-10-28 15:34:59

yea test yours to see if it solves. ill add it to mine as well.

If it works add it too reflection. I rather have a updated one rather than one that got updated a few months back.