Log in

View Full Version : How do you get up those stairs?



beats-
03-30-2011, 09:20 AM
I've got walking down.

Now i've walked into lumbridge castle and im sitting next to stairs.
I just can't seem to figure it out.
Findobj?
tpas?
dtms?
=\
so confused.

Push me in the right direction please.

As most tuts are in scar and its hard to find proper info.

YoHoJo
03-30-2011, 09:28 AM
The coding for SCAR and Simba is pretty much identical.
I would use ACA (AutoColor Aid) to find an object like stairs on the mainscreen.

Sorry I can't help super much more in detail right now, but search Auto Color Aid on the forums and see if it helps any.

FindObj might do the trick too as long as you get good colors chosen.
There are many different ways.

You may also want to learn reflection (Much easier to script and very reliable and gets the job done, but very basic so if you want better experience try using color somehow).

I'm sure the great community will help you out with their posts below good luck!

Ogre
03-30-2011, 09:41 AM
Maybe try finding the stairs on the minimap with a FindDTMRotated (not necessary if the compass is always north, probably) or something and use MMToMS() ?

DeSnob
03-30-2011, 04:47 PM
Use tpas. However, use ACA to get the info you need such as the modifiers and the other values. I made my own custom TPA's, and used the program to get all the important stuff. If you do, the procedure you make will be very accurate, and it counts as your own work in an SRL Member application (as long as you don't copy/paste the func it returns).

NCDS
03-30-2011, 04:50 PM
Check out the code in my old Flax spinner: http://villavu.com/forum/showthread.php?t=50010

It's pretty old, but should show you the concepts pretty well.

Yago
03-30-2011, 08:40 PM
If you want here is some code from my cooker:

It work practically flawlessly... no problems with it so far. Fell free to use/edit if you want.

You would have to declare the points:

ToKitchen[3] := Point(3205, 3208); //Point1 On The Staircase
ToKitchen[4] := Point(3205, 3207); //Point2 On The Staircase

and use this (WaitUntil) or replace it with repeat -- until's:

Function WaitUntil(Time: Integer; Condition: Boolean): Boolean;

var
Timer: Integer;

begin
Result := False;
MarkTime(Timer);
while (not(Condition)) and (TimeFromMark(Timer) <= Time) do
begin
Wait(RandomRange(30,70));
end;
if (TimeFromMark(Timer) >= Time) then
begin
Result := False;
Exit;
end;
if (Condition) then
Result := True
else
Result := False;
end;

function MouseStaircase(Click: Boolean): Boolean;

var
MoveCounter, ClickCounter: Integer;
Clicked: Boolean;
Sc1, Sc2: TPoint;

begin
if not (LoggedIn) then
Exit;

ClickCounter := 0;
repeat
if (IsIdle) then
begin
MoveCounter := 0;
AntiRandoms;
repeat
SetAngle(True);
if (MoveCounter >= 5) then
begin
Sc1 := Sc2;
end
else
begin
Sc1 := TileToMS(ToKitchen[3], 0);
Sc2 := TileToMs(ToKitchen[4], 0);
end;
if IsMenuOpen then
MouseBox(MSX1, MSY1, MSX2, MSCY, 3);
Inc(MoveCounter);
WriteLn('Staircase Uptext Attempt ' + IntToStr(MoveCounter) + '.');
MMouse(Sc1.x, Sc1.y, RandomRange(-5,2), RandomRange(-5,2));
WriteLn('Moved The Mouse Over The Staircase.');
until R_WaitUpText('staircase',500 + Random(300)) or (MoveCounter >= 10);
begin
if (MoveCounter >= 10) then
Writeln('Unable To Get The Correct Bottom Floor Staircase Uptext Using Sc1 and Sc2.')
else
begin
ClickMouse2(Click);
if (Click = True) then
begin
if WaitUntil(500, DidRedClick) then
Clicked := True
else
Inc(ClickCounter);
end
else
begin
if WaitUntil(500, IsMenuOpen) then
Clicked := True
else
Inc(ClickCounter);
end;
end;
end;
end
else
begin
Continue;
end;
until (Clicked = True) or (ClickCounter >= 5);
if (ClickCounter >= 5) then
begin
Writeln('Function MouseStaircase is False.');
Result := False;
end
else
Writeln('Function MouseStaircase is True.');
Result := True;
end;

Procedure StaircaseTo(Route: String);

var
Counter1, Counter2, Counter3, GoalFloor, OppositeFloor, MidFloor: Integer;

begin
if not (LoggedIn) then
Exit;

WriteLn('Running StaircaseTo(' + Route + ').');
MidFloor := 1;
if (Route = 'Up') then
begin
GoalFloor := 2;
OppositeFloor := 0;
end
else if (Route = 'Down') then
begin
GoalFloor := 0;
OppositeFloor := 2;
end;

case GetPlaneIndex of

GoalFloor: Writeln('Already On The ' + Route + ' Floor.');

OppositeFloor:
begin
Counter1 := 0;
if (MouseStaircase(True)) then
begin
repeat
Inc(Counter1);
Writeln('Counter1 Is ' + IntToStr(Counter1) + '.');
if WaitUntil(3000, (GetPlaneIndex = 1) or (GetPlaneIndex = GoalFloor)) then
StaircaseTo(Route)
else if (GetPlaneIndex = GoalFloor) then
Break
else if (GetPlaneIndex = MidFloor) then
StaircaseTo(Route);
until (Counter1 >= 5) or (GetPlaneIndex = GoalFloor);
begin
if (Counter1 >= 5) then
EndScript('Could Not Get To The ' + Route + ' Floor.')
else
WriteLn('Successfully Reached The ' + Route + ' Floor.');
end;
end
else
EndScript('MouseStaircase Is False');
end;

MidFloor:
begin
Counter1 := 0;
Counter2 := 0;
Counter3 := 0;
WriteLn('On The Middle Floor Continuing.');
repeat
Inc(Counter2);
WriteLn('Counter2 Equals ' + IntToStr(Counter2) + '.');
if (MouseStaircase(False)) then
begin
repeat
Inc(Counter1);
R_ChooseOption(Route);
until (DidRedClick) or (Counter1 >= 20);
if not (Counter1 >= 20) then
begin
WriteLn('Clicked On Option ' + Route + '.');
if (not (WaitUntil(3000, (GetPlaneIndex = GoalFloor)))) then
EndScript('Somehow Failed To Get To GoalFloor.');
end
else
WriteLn('Counter1 Is ' + IntToStr(Counter1) + '. Unable To Go To Choose An Option. Will Try Again.');
end
else
Writeln('MouseStaircase Is False.');
until (GetPlaneIndex = GoalFloor) or (Counter2 >=10);
if (Counter2 >= 10) then
EndScript('Counter2 Equals ' + IntToStr(Counter2) + '. Unable To Go To The ' + Route + ' Floor.');
end;
end;
end;

BTW, Endscript is the procedure i call to end my script or current player.

Floor66
03-30-2011, 08:42 PM
That's reflection, Yago :p
I think he's asking for colour methods.

Yago
03-30-2011, 08:44 PM
Oh sorry then... You would probably change the tiles to tpa's or something i guess and replace mouse staircase wit ha simple click staircase.

lordsaturn
03-31-2011, 12:30 AM
iirc in my RM runner I used ACA to get colors for the brown railing on the staircase.

beats-
03-31-2011, 01:47 AM
Being checking out ACA. Cool stuff. Gonna try this staircase railing thing.
:P

thx for all the great feedback.