SRL Archive - Reflection Help

Offsets help


kingarabian

2010-12-30 18:34:00

Im trying to click an item inside of a tile by using offsets. However it keeps randomizing to much which makes it unreliable. Also the more tiles I am away from that specified tile the offsets decrease by .1 and its really annoying.


Shuttleu

2010-12-30 18:36:45

if i understand by the image then the wine is directly on top of all four tiles
so why not get the top right corner of one of the tiles and put a height of 0

~shut

TomTuff

2010-12-30 19:15:38

the picture provided was very inspecific.

so, let's say this is it (red dot = wine)
Example 1:
The black outline is 1 tile. The wine is somewhere entirely in that tile. use specific TileToMSEx offsets to calculate the point.
Example2: Green outlines = 4 different tiles. Using one of the other tiles, use offsets of 1, 1 (That would be the northwest tile, since 1, 1 would provide the bottom right coords) to click wine.

kingarabian

2010-12-30 19:20:17

My bad. No that is just one whole tile, with the red circle the place where I went to have the script click on that tile. Its not more than one.

TomTuff

2010-12-30 19:23:21

are the random points all made from the same camera angle? if not, i would try it that way (i.e. set compass to north and make the camera highest first every time) and see if that works.

kingarabian

2010-12-30 19:31:30

From: TomTuff
are the random points all made from the same camera angle? if not, i would try it that way (i.e. set compass to north and make the camera highest first every time) and see if that works.


It's at north all the time. I mean I don't mind if it randomizes a bit, but it makes the script misclick everything I want. I removed all the randomness from Mouse and MMouse but still…

TomTuff

2010-12-30 19:41:37

tbh, just use color dude.

or get the bounds of the tile it's on and search for the color there if you still want to use ref

Feroc1ty

2010-12-30 20:19:01

Try using this function I made for zammy wines.

function SearchForColorOnTile(var x,y:integer;tile:TTile;heigth,spread,color,tolerance,number:integer):boolean;
var pt:TPoint;
tpa:TPointArray;
begin
result := false;
if not TileOnMS(tile,heigth) then
begin
writeln('Attempting to search for color on a tile that''s outside the main screen!');
exit;
end;
pt := TileToMS(tile,heigth);
FindColorsTolerance(tpa, color, (pt.x - (spread/2)), (pt.y - (spread/2)), (pt.x + (spread/2)), (pt.y + (spread/2)), tolerance);
result := Length(tpa) >= number;
if result then
MiddleTPAEx(tpa, x, y);
end;

kingarabian

2010-12-30 20:29:47

From: Feroc1ty
Try using this function I made for zammy wines.

function SearchForColorOnTile(var x,y:integer;tile:TTile;heigth,spread,color,tolerance,number:integer):boolean;
var pt:TPoint;
tpa:TPointArray;
begin
result := false;
if not TileOnMS(tile,heigth) then
begin
writeln('Attempting to search for color on a tile that''s outside the main screen!');
exit;
end;
pt := TileToMS(tile,heigth);
FindColorsTolerance(tpa, color, (pt.x - (spread/2)), (pt.y - (spread/2)), (pt.x + (spread/2)), (pt.y + (spread/2)), tolerance);
result := Length(tpa) >= number;
if result then
MiddleTPAEx(tpa, x, y);
end;


I've been using it and it works pretty fine, however can you add a wait to it?

TomTuff

2010-12-30 20:45:06

From: kingarabian
I've been using it and it works pretty fine, however can you add a wait to it?


can't you? lol

kingarabian

2010-12-30 21:09:18

From: TomTuff
can't you? lol


Ill try. But waitfunc basically adds the wait.

Anyway I wanted those specific offsets because its faster to detect uptext than color.

Feroc1ty

2010-12-31 04:16:46

My telegrab function uses that function to find the wines color above the tile, hover over it, and than check the uptext to see if it's matching, if not then it right clicks and finds the right option.

Naike

2010-12-31 08:08:14

TileToMSEx(Tile(0, 0), 0, 0, 0);

And use it on the top right tile.

[][] <- This one.
[][]

Should be like that, don't screw around with the offsets though. Keep them at 0 :)

TomTuff

2010-12-31 08:17:31

From: Naike
TileToMSEx(Tile(0, 0), 0, 0, 0);

And use it on the top right tile.

[][] <- This one.
[][]

Should be like that, don't screw around with the offsets though. Keep them at 0 :)


that's not what he wants :O read previous posts, pic in the original post was poorly explained