SRL Archive - Research & Development Lounge

[REQUEST] Lumbridge Stair Handler


benjaa

2008-05-06 06:58:51

I'm currently working on a AutoCook Banker that cooks every kind of F2P food (and a few P2P foods), but I am having GREAT difficulty handling the stairs.

Could someone please design a:

LumbyStairs(dir:string);
OR
LumbyStairs(up:boolean)


function.

"dir" would be the LowerCase of which option it chooses after right-clicking.
..or something along those lines.

so basically it needs to;
- find the stairs
- right-click it
- choose option (dependant on "dir")
- wait

rep++ and credit in my script will be issued

i want the function to be efficient, and low detectibility

ps. Sorry if I'm not allowed to post requests in here… but i couldnt see anything that said not too :rolleyes:

Gu3st...

2008-05-06 07:38:56

maybe LumbyStairs(up:boolean); would be better?

Edit: Omg wasted my 300th post on this…

benjaa

2008-05-06 07:53:04

From: Zytex!
maybe LumbyStairs(up:boolean); would be better?

Edit: Omg wasted my 300th post on this…


uhh… thanks for the input… :)

Naum

2008-05-06 15:57:05

Here take it from my lumby yewz script ;)

Function FindStairCase: boolean;
Begin
If FindObjCustom(x,y,['imb','lad','der'],[603213,3751748,803168],20) then
Begin
Result :=True;
end;
end;

Pretty easy and always works :)


EDIT: You can make it simpler:

Function FindStairCase: boolean;
Begin
Result := FindObjCustom(x,y,['imb','lad','der'],[603213,3751748,803168],20);
end;

Hope I Helped :)

benjaa

2008-05-06 17:54:08

woah… is it efficient??

i thought i needed some 30 line code-age for it

XcanadamanX

2008-05-06 18:28:46

this was my stairs procedure. a bit old and can be much shorter but here:
Procedure UpStairs(LeftClick,MiddleStair:Boolean);
var i,x,y,color:integer;
points:array of tpoint;
point1:tpoint;
Begin
wait(250);
point1.x:=MSCX;
point1.y:=MSCY
colortolerancespeed(2)
FindColorsTolerance(Points,869474,MSx1,MSy1,MSCX-12,MSCY-10,15)
writeln(inttostr(length(points)))
SortTPAFrom(points,point1)
Mousespeed:=25+random(10)
wait(250)
For i:=0 to (length(Points)-1) do
begin
wait(2)
If FindColoredAreaTolerance(x,y,3752264,points[i].x-20,points[i].y-20,points[i].x+20,
points[i].y+20,10,20) then
begin
MMouse(x,y,6,4)
wait(100+random(100))
If IsUpTextMulti('lim','tair','case') then
Begin
GetMousePos(x,y)
Mouse(x,y,0,0,LeftClick)
if LeftClick then
begin
Mousespeed:=MSpeed;
if MiddleStair then
begin
repeat
wait(10)
until (GetColor(37, 369)=10264383)
wait(100)
if not(ClickNpcChatText('up t',true)) then
exit;
end else
begin
wait(100)
Repeat
wait(20)
until(not(getcolor(377, 263)=16777215))
wait(500)
end;
end else
begin
ChooseOption('mb-up')
end;
break;
end;
end;
end;
colortolerancespeed(1)
wait(100)
end;

Procedure DownStairs(LeftClick,MiddleStair:boolean);
var i,x,y,color:integer;
points:array of tpoint;
point1:tpoint;
Begin
wait(250);
point1.x:=MSCX;
point1.y:=MSCY
colortolerancespeed(2)
FindColorsTolerance(Points,869474,MSx1,MSy1,MSCX-12,MSCY-10,15)
writeln(inttostr(length(points)))
SortTPAFrom(points,point1)
Mousespeed:=25+random(10)
wait(250)
For i:=0 to (length(Points)-1) do
begin
wait(2)
If FindColoredAreaTolerance(x,y,3752264,points[i].x-20,points[i].y-20,points[i].x+20,
points[i].y+20,10,20) then
begin
MMouse(x,y,6,4)
wait(100+random(100))
If IsUpTextMulti('lim','tair','case') then
Begin
GetMousePos(x,y)
Mouse(x,y,0,0,LeftClick)
if LeftClick then
begin
Mousespeed:=MSpeed;
if middlestair then
begin
repeat
wait(10)
until (GetColor(37, 369)=10264383)
if not(ClickNpcChatText('b down',true)) then
exit;
end else
begin
wait(100)
Repeat
wait(20)
until(not(getcolor(377, 263)=16777215))
wait(400)
end;
end else
begin
ChooseOption('mb-down')
end;
break;
end;
end;
end;
colortolerancespeed(1)
end;

Procedure Stairs(Up,LeftClick:boolean);
Begin
SetAngle(true);
if (Up) then
begin
UpStairs(true,false)
IdleTime(400, 400, 0.5);
wait(600)
UpStairs(LeftClick,true)
end else
begin
DownStairs(true,false)
IdleTime(400, 400, 0.5);
wait(500)
DownStairs(LeftClick,true)
wait(500)
end;
End;

R0b0t1

2008-05-06 19:32:01

Well, banjaa, FindObj functions are usually 50+ lines….

benjaa

2008-05-07 02:03:10

[offtopic] nice dp r0b0t [/offtopic]

yeah i suppose thats right

XCanadamanX, i will test yours to see how well it works :)

XcanadamanX

2008-05-07 08:00:21

it may need the colors changed…i havent used it for awhile

benjaa

2008-05-07 09:00:08

Kk, thats sweet :)