Log in

View Full Version : Any one Want to Help Push me in right Direction?



wantonman
04-17-2012, 04:33 AM
Hello can some one revise this with a little of their expertise? show me some techniques for learning and also help me understand things a bit more better...

i guess nobdys perfect here is what im on


program wheat_picker;
{$I SRL\SRL.SIMBA }


function find_wheat: tpoint;

var
cts,x,y,z,w,h,i:integer;
point_:tpoint;
wheat_tpa:tpointarray;
wheat_2dtpa:t2dpointarray;

begin
GetClientDimensions ( W , H ) ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.21 , 0.80 ) ;
FindColorsSpiralTolerance ( x , y , wheat_TPA , 5804686 , 0 , 0 , 515 , 336 , 7 ) ;
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
if length(wheat_tpa)<1 then
exit else
begin
TPAtoATPAExWrap(wheat_TPA,3,6,wheat_2dtpa);
for i:=0 to high(wheat_2dtpa) do
begin
MiddleTPAEx(wheat_2dtpa[i],point_.x,point_.y);
end;
result:= point_;
end;
end;



function my_funk: boolean;
var
x,y,c,t,t2:integer;
begin
if not IsUpTextMultiCustom(['ick','hea']) then
exit else
begin
ClickMouse2(1);
C := InvCount;
MarkTime(T);
repeat
//kjshflkajh
until(invcount>C) or (TimeFromMark(T)>8000+Random(450));
result:=true;
end;
end;

procedure pick_wheat;
var
x,y,z:integer;
begin
MMouse(find_wheat.x,find_wheat.y,5,5);
if IsUpTextMultiCustom(['ick','hea']) then
my_funk
else
pick_wheat;
end;






begin
SetupSRL;
repeat
pick_wheat;
until false;
end.

x[Warrior]x3500
04-17-2012, 04:42 AM
umm quick comment: in your function find_wheat x,y is never used. so change them to mscx, mscy. then it will always find the closest wheat for your character.

also, its hard to read cus u dont follow standards

Imanoobbot
04-17-2012, 04:45 AM
Hello can some one revise this with a little of their expertise? show me some techniques for learning and also help me understand things a bit more better...

i guess nobdys perfect here is what im on


program wheat_picker;
{$I SRL\SRL.SIMBA }


function find_wheat: tpoint;

var
cts,x,y,z,w,h,i:integer;
point_:tpoint;
wheat_tpa:tpointarray;
wheat_2dtpa:t2dpointarray;

begin
GetClientDimensions ( W , H ) ;
CTS := GetColorToleranceSpeed ;
ColorToleranceSpeed ( 2 ) ;
SetColorspeed2Modifiers ( 0.21 , 0.80 ) ;
FindColorsSpiralTolerance ( x , y , wheat_TPA , 5804686 , 0 , 0 , 515 , 336 , 7 ) ;
SetColorspeed2Modifiers( 0.2 , 0.2 ) ;
ColorToleranceSpeed ( CTS ) ;
if length(wheat_tpa)<1 then
exit else
begin
TPAtoATPAExWrap(wheat_TPA,3,6,wheat_2dtpa);
for i:=0 to high(wheat_2dtpa) do
begin
MiddleTPAEx(wheat_2dtpa[i],point_.x,point_.y);
end;
result:= point_;
end;
end;



function my_funk: boolean;
var
x,y,c,t,t2:integer;
begin
if not IsUpTextMultiCustom(['ick','hea']) then
exit else
begin
ClickMouse2(1);
C := InvCount;
MarkTime(T);
repeat
//kjshflkajh
until(invcount>C) or (TimeFromMark(T)>8000+Random(450));
result:=true;
end;
end;

procedure pick_wheat;
var
x,y,z:integer;
begin
MMouse(find_wheat.x,find_wheat.y,5,5);
if IsUpTextMultiCustom(['ick','hea']) then
my_funk
else
pick_wheat;
end;






begin
SetupSRL;
repeat
pick_wheat;
until false;
end.




You should not write it like an arrow. Look into other scripts and see how to change it. Looks really strange :)

wantonman
04-17-2012, 05:02 AM
okay will do... yeah standards are cool to do properly...

and i think i do use wheat funk... but uh yeah mscx mscy is good ill adjust it... was not using smart thats why...

x[Warrior]x3500
04-17-2012, 05:11 AM
and i think i do use wheat funk... but uh yeah mscx mscy is good ill adjust it... was not using smart thats why...

any coordinate constants (msx1,mmy1, etc) are not reliant upon smart. now i said to get rid of the x,y in that function because u never initialize them. they will always be the coordinates 0,0. so it will always start the search at the top left corner, and not the center. this will mean that your ATPA[0] will be in the top left.

Imagine
04-17-2012, 04:54 PM
You also use FindColorsSpiralTolerance, but only use one color.

x[Warrior]x3500
04-17-2012, 05:00 PM
You also use FindColorsSpiralTolerance, but only use one color.

findColorsSpiralTolerance returns a array of tpoint (he called it wheat_TPA). its not find color 000, and 111, and 222. its find all the positions of a color.
findColorSpiralTolerance will only return 1 tpoint.

Imagine
04-17-2012, 09:31 PM
^Really? Let me check my scripts, I might be using one or the other subconsciously :O


http://screensnapr.com/e/TJaX35.png

Yeah, you're right :P I don't think about what I write most of the time...