I have looked around but have been able to figure out what to put as parameters forSCAR Code:GetSecondDoorColor(First: Integer): Integer;
I have looked around but have been able to figure out what to put as parameters forSCAR Code:GetSecondDoorColor(First: Integer): Integer;
So, Im not sure since I havent used SRL Door things much, but anyways, I think you can use "GetSecondDoorColor(GetFirstDoorColor);"
OK I will try it out thanks
EDIT:works but I am still gettingSCAR Code:GetSecondDoorColor(GetDoorColor);
Does anyone know what those vars are for?SCAR Code:Line 295: [Hint] (12530:1): Variable 'PLIST' never used in script
Line 321: [Hint] (12556:1): Variable 'TMPAOTPA' never used in script
Those hints are from when I changed somethings around so the variables aren't needed anymore. You can delete them from the var section on the given lines if you want.
GetSecondDoorColor is not designed to be used on its own, but I guess you can use it if you want.
Sometimes, when there are doors that go pretty much vertical and horizontal, and their are doors that go diagonal, there a 2 door colors (go to draynor to see what I mean). One for diagonal and one for the rest. (The same happens for wall color btw). When both colors are present, GetDoorColor will find the first one closest to top left. GetSecondDoorColor will skip over the color in parameters, so that you have both door colors. The higher level functions (which are lower down in DoorProfiles.scar) look at the output of both functions, and decide whether to use one or both, and then get every pixel of door color on the minimap.
If you read through DoorProfiles.scar you can figure out how to use stuff, but then you just be rewriting the higher level functions that are already in there.
So tell me what door you are trying to find, and I'll show you how to use GetDoors (the high level function designed for your use) for your situation.
Ok, well I am making a flax spinner script and I want to find and open/leave open the door getting to the Spinner, I was going to try to make a function for it, using the getdoorcolor stuff.
EDIT: In the lumby castle.
K should be easy, aren't many doors on second floor IIRC. BRB.
EDIT Try this
SCAR Code:program New;
{.include srl/srl.scar}
procedure GoToSpinningWheelDoor;
var
MyDoors: array of DoorProfile;
MyTPA: array of tpoint;
i:integer;
begin
MyDoors:= GetDoors;
setarraylength(MyTPA,getarraylength(MyDoors));
for i:=0 to getarraylength(MyDoors)-1 do
MyTPA[i]:=MyDoors[i].midpoint;
MyTPA:= RearrangeTPA(MyTPA,0,1,false,false);
Mouse(MyTPA[1].x,MyTPA[1].y,1,1,true);
Flag;
end;
begin
setupsrl;
GOtoSpinningWheelDoor;
end.
Ok. Thanks a lot Boreas. I am going to go pick up a school schedule soon, and then work, so I might not post reply for a while.
Could you try it in the next 5 mins? I gtg soon and my computer is bugging so Idk if it works.
Works perfectly thanks boreas.
Cool. In that case here's how it works (so you can make your own for other configurations:
BTW, if either the door in question or the one below it is covered up by symbols or people, it will go to the duke, so you might wanna do a failsafe where if it cant see the spinner or something, it will find the door again.
Always when using GetDoors, you need to declare an array of DoorProfile. Usually you also need a TPA too.
Then you need call GetDoors, setting it to the array, and then set the TPA to the same length.SCAR Code:var
MyDoors: array of DoorProfile;
MyTPA: array of tpoint;
Each of the DoorProfiles in the array has a tpoint part, called midpoint, because it is the point in the middle of the door, and is a good way to represent each door. Then you need to extract these tpoints into an array of tpoints, cuz we don't need the other information in each DoorProfile (in most cases, look at the top of DoorProfile.scar for the other info).SCAR Code:MyDoors:= GetDoors;
setarraylength(MyTPA,getarraylength(MyDoors));
So now we are working with an array of tpoints, where 1 tpoint is for each door.SCAR Code:for i:=0 to getarraylength(MyDoors)-1 do
MyTPA[i]:=MyDoors[i].midpoint;
That rearranges the TPA (duhSCAR Code:MyTPA:= RearrangeTPA(MyTPA,0,1,false,false);). The first boolean is the direction, false meaning north to south. The second is for going up, false meaning going down. So false,false will make the TPA start with the point that has the highest Y, and go down to the lowest Y. The 0,1 is what part of the array you want to return, this is so that you can take some of the points into a smaller array, and then sort them again in other direction. In this case, 0,1 means the first 2, which means the lowest 2 doors, with 0 being the lowest, and 1 being the second lowest.
So that will click the second lowest door. Flag waits til it isn't moving.SCAR Code:Mouse(MyTPA[1].x,MyTPA[1].y,1,1,true);
Flag;
You can copy that whole procedure for most situations, just change the 0,1,false,false and the [1] [1].
Ya you should make a tut, this helped me a lot.
Or Stickify it
There's the tut in tutorial section, this question, a couple other questions, and bit on the fix thread. When I get time I'll put it all together on the tut thread.
There are currently 1 users browsing this thread. (0 members and 1 guests)