ogustuce
2019-07-31 23:11:58
hey guys, for a couple days now i've been working on a little project of mine. Its similar to the action bar function but to work with the sidebars (additionnal bars on screen)
so far i've made one that works fine but it relies on bitmaps to locate the bars(but it only locate them when they're in a certain position). So i started writing one that relies on other things to find the bars so ican find them no matter their positions.
So far what i made locates the bars, and reads the number in the yellow circle to identify them. However i cant manage to turn that function into a TpointArray for later use in the script. The script compiles fine but i get an access violation that i cant find the solution to.
here's the function
so far i've made one that works fine but it relies on bitmaps to locate the bars(but it only locate them when they're in a certain position). So i started writing one that relies on other things to find the bars so ican find them no matter their positions.
So far what i made locates the bars, and reads the number in the yellow circle to identify them. However i cant manage to turn that function into a TpointArray for later use in the script. The script compiles fine but i get an access violation that i cant find the solution to.
here's the function
function FindSidebars:Tpointarray;
var
i,k,h,x,y,f:integer;
p:tpoint;
Circle,circle2:Tpointarray;
box,box2,box3:Tbox;
circles:t2dpointarray;
begin
findcolorsspiraltolerance(x,y,circle,1343945,Getclientbounds,25);
circles:=SplitTPAex(circle,8,8);
h:=high(circles);
for i:=h downto 0 do
begin
box:=circles[i].getbounds;
filterpointspie(circles[i],0,360,6,8,middlebox(box).x,middlebox(box).y);
box:=circles[i].getBounds;
etl_drawbox(Box2,clred,false);
box:=circles[i].getBounds;
f:= strToIntdef(getTextAtEx(intToBox(box.x1, box.y1, box.x2,box.y2), 0, 0, 0, 3111603, 0, 'UpChars'), -1);
if f>0 then
begin
result[i]:=middlebox(circles[i].getBounds);
end
end
end