SRL Archive - Help and Support

Fix this up?


3Garrett3

2007-08-05 20:04:09

I made this in the Scripting Help, but nobody seemed to understand it I guess, or just didnt want to help me. Maybe someone else here can help me out with this. Here is a copy of what I typed:

Hey, I made a simple little function based off my "Amazing Idea" to wait for trees to be cut down. It needs a little work still, and I am going away for a bit today, so I was wondering if anyone might be able to help me.


procedure Waitforit;
var Colors: TPointArray;
Cx, Cy, Noc, CutTime: Integer;
begin
FFlag(0);
Flag;
Wait(1000 + Random(250));
GetMousePos(x, y);
if findcolorspiraltolerance(Tx, Ty, 332560, x - 40, y - 50, x + 40, y + 50, 5) then
begin
FindColorsSpiralTolerance(Cx, Cy, Colors, 332560, Tx - 20, Ty - 20, Tx + 20, Ty + 20, 10);
Noc := GetArrayLength(Colors);
If (Noc = 0) then Exit;
else
Writeln(IntToStr(Noc) + ' Colors Found');
MarkTime(CutTime);
repeat
Wait(111 + Random(111));
Randoms;
Wait(111 + Random(111));
FindColorsSpiralTolerance(Cx, Cy, Colors, 332560, Tx - 15, Ty - 15, Tx + 15, Ty + 15, 10);
Noc := GetArrayLength(Colors);
if (Noc = 0) then
begin
Writeln('Waited ' + Inttostr(TimeFromMark(CutTime)) + ' Seconds');
Break;
end;
until (TimeFromMark(CutTime) > (30 * 1000));
end;
end;

It isnt too complicated right now. The beggining part is just trying to find the closest tree to the mouse, because in the function before this one, it clicked the tree. All the flags are there, with the wait, because FFlag(0) didnt wait until he was completely stopped, so the colors that I was getting before the repeat didnt get the same as the colors after. It probably doesnt have great standards yet, I will work on that later.

Basically all I'm asking is for something to help update my tree coords better. If there is something wrong with the rest, feel free to tell me, and show me why of course.

Esteban

2007-08-07 11:16:16

sorry bub, can't really help you out here. Talk to JAD or someone like that, with a swoot WCer.

3Garrett3

2007-08-07 11:26:04

JAD! GET YOUR ASS OVER HERE AND HELP ME! :p

I guess maybe i should PM him instead of shouting?

Esteban

2007-08-07 15:57:40

yea, he used to get on MSN sometimes, but it's been a long time since i've seen him log on.

n3ss3s

2007-08-08 07:04:34

I can help, but I kinda didnt understand what do you need help for?

3Garrett3

2007-08-08 09:08:59

I need to know how to make sure the script still knows where the tree is after it moves. Update the coords of the tree. Because after it clicks, and moves to the new tree, the coords wont be the same, and I want to find the right tree to wait until its gone. My waiting procedure works, but when the tree moves too far away, it wont.

Bobarkinator

2007-08-08 10:56:31

Lorax I think made something like that.

3Garrett3

2007-08-08 10:58:01

Ya, well I made my own, wanna make it better? :p

~alex~

2007-08-08 11:32:50

Lorax made updatecolor and sb100 edited to make updatecoords. Updatecoords is in powerskills I think.