Originally Posted by
xujnea
Hello guys, I never been programming in my life,but I decided to learn. I need to find/climb ladders,but not sure how to do this. I tried using "FindColorSpiralTolerance",but it seems it doesn't work with "HumanMMouse",cause it requires Tpoint. I tried creating var x, y = Integer; But it doesnt work that way.
I also thought about using "findMSObjectSimple",but what the hell is "cols: TIntegerArray" and how can i find it? :/ Or maybe you know even better ways to find ladder? Thanks for your time
o/
Simba Code:
procedure UseLadder
var
x, y : Integer;
begin
WriteLn('Looking for ladder');
if(FindColorSpiralTolerance(x, y, 2576744, 29, 33, 466, 300, 6)) then
begin
WriteLn('Ladder found');
HumanMMouse([point(x,y)], 5, 5);
fastClick(mouse_Right);
Wait(200 + random(400));
ChooseOption('imb-up');
WriteLn('Up');
Wait(100 + random(400));
end;
end;
Hey there! I had some problems finding objects too but today I figured I could do something. I guess you're using lape reflection for 07 rs and this is how i did it in a script I am making:
Code:
procedure FindLectern;
begin
if lectern.Find(objGame, 'Lectern', 20) then
begin
if not lectern.IsOnMS then Reflect.Tiles.RotateCameraToTile(lectern.GetTile);
lectMSPt := Reflect.Tiles.TileToMS(lectern.GetTile);
x1 := lectMSPt.X - 15; //Made some kind of box which centre point is lectern tile ms point
y1 := lectMSPt.Y - 15;
x2 := lectMSPt.X + 10;
y2 := lectMSPt.Y + 10;
if x1 <= 0 then x1 := 2; //if box parameters passes 0 it gives error so when it's 0 or below it goes back to 2 (needs to be fixed a bit)
if y1 <= 0 then y1 := 2;
if FindColorSpiralTolerance(x, y, 3294041, x1, y1, x2, y2, 15) then //searched for specific color of an object in that box i made earlier
begin
truePt.X := x; //truePt - point where color was found (which should be on object you want to find)
truePt.Y := y;
Reflect.Mouse.Move(truePt, 0, 0);
if Reflect.Text.IsUpText('Study Lectern') then //checks if there is right uptext and clicks if it's true
begin
Reflect.Mouse.Click(mouse_right);
Reflect.Text.ChooseOption('Study Lectern');
end;
end;
end;
end;
end;
Hope it helps you in some way, if you don't understand something you can allways pm or quote Have fun scripting
if you were wondering how you can assign seperate integers to TPoint you can do it like this
Code:
procedure Points;
var
x, y, : integer;
somePoint : TPoint;
begin
x := 10;
y := 20;
somePoint.x := x;
somePoint.y := y;
Writeln(somePoint);
end;
^ This will output: Point(20, 10) and values of x and y will be assigned to somePoint. There may be other ways to do that but I found that way by myself