View Full Version : How do you find an image that can rotate?
Kasmember13
01-18-2009, 10:02 PM
How do I find an image but when its in the game it rotates and hovers up and down. I tried finding the DTM buy I looks like DTMs can't be found if they're rotated.
Cazax
01-18-2009, 10:03 PM
You can use DTMRotated from SRL or FindDTMRotated from SCAR :)
Kasmember13
01-18-2009, 10:15 PM
Nvm I found out how to use it but, It still won't find the Image...
http://www.miniclip.com/games/monkey-snowfight/en/
Coconut in that game.
program Monkeysnowfight;
{.IncludeSRL/SRL.Scar}
Var
x, y, CocoDTM: Integer;
DTMAngle : Extended;
Procedure Init;
begin
CocoDTM := DTMFromString('78DA631467606090634001D73A2C1974181 91' +
'88088E13F10304A011902A86A5444D9C0342394CF280F2424 50D5' +
'24590AA0AA51006924A0461A4868A3AAE1E7E74755230C24B 450D' +
'5D8DBDBA3AA016951465513622E8DA9469A805D2240420455 8DAD' +
'A5098A1A0021300BB0');
end;
Procedure Createroom;
begin
end;
Procedure Setpower;
begin
HoldMouse(545, 215, True);
Wait(731);
ReleaseMouse(545, 215,True);
end;
Procedure Findpowerup;
begin
if FindDTMRotated(CocoDTM, x, y, 0, 0, 100, 180, -1, 360, 5, DTMAngle) then
Writeln('I found the DTM.');
end;
begin
Init;
Findpowerup;
Setpower;
end.
almost
01-18-2009, 10:45 PM
Your chances at finding something that rotates are pretty slim, even with using a few DTMs and rotating them, or the mordaut random wouldn't be such a problem.
What exactly is it that you need to find?
Your best bet will probably be TPointArrays, but it depends on what you are finding.
bullzeye95
01-18-2009, 10:48 PM
Your chances at finding something that rotates are pretty slim, even with using a few DTMs and rotating them, or the mordaut random wouldn't be such a problem.
What exactly is it that you need to find?
Your best bet will probably be TPointArrays, but it depends on what you are finding.
If the thing that is rotating is 2d, it's very easy. Using a TPointArray would just be.. stupid.
Kasmember13
01-18-2009, 10:59 PM
I'm trying to find the power ups that pop up out of the pipe.
Baked0420
01-18-2009, 11:10 PM
FindDtmRotated(.... should work for that, just use a TPA as a back up though
bullzeye95
01-18-2009, 11:28 PM
FindDtmRotated(.... should work for that, just use a TPA as a back up though
Mind explaining how he would even go about using a TPA..?
Baked0420
01-18-2009, 11:35 PM
FindColorsSpiralTolerance(x, y, Coconut, coconutcolor, x1, y1, x2, y2, 5)?
bullzeye95
01-18-2009, 11:41 PM
Yeah, but how could he use that to find something that's rotating?
Baked0420
01-18-2009, 11:44 PM
it's just finding a color, it doesn't matter if the object is rotating or not, right? how does it rotating mess up finding the color?
Wizzup?
01-18-2009, 11:47 PM
Yeah, but how could he use that to find something that's rotating?
Using TPA's for this isn't hard either...
bullzeye95
01-19-2009, 12:39 AM
Using TPA's for this isn't hard either...
Way harder than it could be.
almost
01-19-2009, 01:26 AM
If the thing that is rotating is 2d, it's very easy. Using a TPointArray would just be.. stupid.
Wtf are you talking about?
I didn't know if the object was rotating on 1, 2, or 3 axises.
If it is one (just moving around the screen or spinning) then you could use a DTM.
If it is rotating like in the mordaut random, use a TPA.
Otherwise you most likely won't find your object.
You can use a TPA no matter what kind of rotation it is doing though.
So that would be what I would go with, rather than messing with making a DTM and doing the testing to make sure it finds it at all the different angles.
Way harder than it could be.
Seriously, do you know what a TPA is?
bullzeye95
01-19-2009, 01:37 AM
Wtf are you talking about?
I didn't know if the object was rotating on 1, 2, or 3 axises. I didn't either. I think you misinterpreted the way I said that; I wasn't trying to say that what you said was stupid, but that if it's a rotating 2d object, then using a TPA would be overkill since you could use a DTM instead.
Seriously, do you know what a TPA is?
Yes..
Baked0420
01-19-2009, 01:46 AM
it is a 2D object, if you just click on the link real quick and play the game once you'd see, but it does exactly what he says, it moves up and down, and rotates in circles. I would just use a FindDtmRotated, it should find your coconut, so have you made something to find the coconut yet Kasmember?
Kasmember13
01-19-2009, 02:25 AM
I decided to use 'FindColorTolerance' It works fine because the colors are such that there is no confusion.
Does anyone have any hit on setting the angle of the cannon before it shoots? The problem is, it needs to find the button that angles the cannon and then from there it needs to adjust according to where it clicked. Idk how to explain it.
almost
01-19-2009, 02:50 AM
I just found out that this wasn't for RuneScape lol.
I clicked on the link and it says I can't connect to play the game though...
I didn't either. I think you misinterpreted the way I said that; I wasn't trying to say that what you said was stupid, but that if it's a rotating 2d object, then using a TPA would be overkill since you could use a DTM instead.
K gotchya :)
Just IMO DTMs are more work than TPAs.
Well, as far as RuneScape.
I can't take a look at this game though.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.