Example of DDTM being called in a function to load it.
Simba Code:
function LoadDDTMWalk(WalkNumber: Integer): Integer; var dtmMainPoint: TDTMPointDef; dtmSubPoints:array[0..3]of TDTMPointDef; TempTDTM: TDTM; begin case WalkNumber of 1:begin
TempTDTM.MainPoint := dtmMainPoint; TempTDTM.SubPoints := dtmSubPoints; Result := AddDTM(TempTDTM); end;
end; end;
Example of DDTM in use.
Simba Code:
function WalkToAltar: Boolean; var WalkDTM: integer; aFound: Extended; begin WalkDTM := LoadDDTMWalk(3); if FindDTMRotated(WalkDTM, x, y, MMX1, MMY1, MMX2, MMY2,-Pi/2, Pi/2, Pi/30, aFound)then begin Mouse(X, Y,2,2, True); FFlag(0); WriteDebug('Balloon Point 1 done'); end else WriteDebug('Cant find the DDTM');
WalkDTM := LoadDDTMWalk(4); if FindDTMRotated(WalkDTM, x, y, MMX1, MMY1, MMX2, MMY2,-Pi/2, Pi/2, Pi/30, aFound)then begin Mouse(X, Y,2,2, True); FFlag(0); WriteDebug('Balloon Point 2 done'); end else writedebug('Cant find the DDTM');
WalkDTM := LoadDDTMWalk(5); if FindDTMRotated(WalkDTM, x, y, MMX1, MMY1, MMX2, MMY2,-Pi/2, Pi/2, Pi/30, aFound)then begin Mouse(X, Y,2,2, True); FFlag(0); WriteDebug('Balloon Point 1 done'); end else WriteDebug('Cant find the DDTM'); end;
Didnt cover this in the video, should have.
How to AutoColor points:
Credit to NKN for writing the code for me in skype!
Simba Code:
function FindTheColor(color: integer): Integer; var x,y:integer; TPA:TPointArray; begin if FindColorSpiralTolerance(x, y, color, MMX1, MMY1, MMX2, MMY2,30)then
result := GetColor(x, y) else result :=-1; end;
How to use it in a DDTM procedure :
Simba Code:
function LoadDDTMWalk(WalkNumber: Integer): Integer; var dtmMainPoint: TDTMPointDef; dtmSubPoints:array[0..3]of TDTMPointDef; TempTDTM: TDTM; begin case WalkNumber of 1:begin
Can you think of some to do? Im open to anything :P
Are you good with TPAs? Lots of people seem to be having trouble with those. Plus, a video on that would be stinking amazing! I would for sure give it a watch!
Are you good with TPAs? Lots of people seem to be having trouble with those. Plus, a video on that would be stinking amazing! I would for sure give it a watch!
It was an amazing guide! It is great now to have an alternate to sps walking!
Yes another! A guide to TPAs would be fantastic!
+Rep whatever I can give!
Last edited by TheeMason; 05-07-2013 at 09:02 PM.
Reason: +Rep
Are you good with TPAs? Lots of people seem to be having trouble with those. Plus, a video on that would be stinking amazing! I would for sure give it a watch!
Im pretty good with TPA's, Ill do a few videos on them, basic, intermediate and advanced!
Originally Posted by TheeMason
It was an amazing guide! It is great now to have an alternate to sps walking!
Yes another! A guide to TPAs would be fantastic!
+Rep whatever I can give!
Great Tut, should add an explanation of ddtm offsets.
I can add a text part to it if you like, are you talking about in the editor? If I am right, doesn't it just make the point it returns offset either by x or y that much? So I could have a DDTM that then clicks to so many spaces to the right left ect?
Im pretty good with TPA's, Ill do a few videos on them, basic, intermediate and advanced!
Working on the first video tongiht :P
I can add a text part to it if you like, are you talking about in the editor? If I am right, doesn't it just make the point it returns offset either by x or y that much? So I could have a DDTM that then clicks to so many spaces to the right left ect?
I would love to see those 3 tutorials. And please add the text part. The more info, the better.
I would love to see those 3 tutorials. And please add the text part. The more info, the better.
I will do them tonight, I will cover basic TPA finding functions to MMToMSEx and functions with finding with that, to ATPA's ect. I will also brush up on wrappers to hopefully be able to explain those as well, if I remember wrappers stop memory leaks?
I will do them tonight, I will cover basic TPA finding functions to MMToMSEx and functions with finding with that, to ATPA's ect. I will also brush up on wrappers to hopefully be able to explain those as well, if I remember wrappers stop memory leaks?
I look forward to learning your knowledge!! Its gonna be great!!
But, I am not good with wrappers, so dont ask me about those... Lol.
I can add a text part to it if you like, are you talking about in the editor? If I am right, doesn't it just make the point it returns offset either by x or y that much? So I could have a DDTM that then clicks to so many spaces to the right left ect?
Yer, you got it, its because in your video you were talking about not knowing how often the dock would show up, if you selected a mainpoint which is more reliable I.E one closer to the center of the compass then you could just add an offset to where you wanna click in relation to where your reference point was found. Remember to add the offset with the compass angle taken into account. You can do this by rotating the offset in point form (Point(X, Y)) by the angle the ddtm is found (i think the function is called RotatePoint). FindDTMRotated returns the angle in radians at which the ddtm was found, in your case this variable was aFound.
I look forward to learning your knowledge!! Its gonna be great!!
But, I am not good with wrappers, so dont ask me about those... Lol.
Lol I hope it goes well..Im not the best with wrappers either XD
Originally Posted by Kasi
Yer, you got it, its because in your video you were talking about not knowing how often the dock would show up, if you selected a mainpoint which is more reliable I.E one closer to the center of the compass then you could just add an offset to where you wanna click in relation to where your reference point was found. Remember to add the offset with the compass angle taken into account. You can do this by rotating the offset in point form (Point(X, Y)) by the angle the ddtm is found (i think the function is called RotatePoint). FindDTMRotated returns the angle in radians at which the ddtm was found, in your case this variable was aFound.