PDA

View Full Version : Error with first script !help!



wtf i sp4nk
11-19-2006, 11:08 PM
Thnx for helping every1 JR helped me figure it out

Boreas
11-19-2006, 11:13 PM
When mouse is in the top left it means the coords are 0,0, probably means findcolorspiral(x,y,treecolor,3,3,515,336 failed, so use tolerance.

wtf i sp4nk
11-19-2006, 11:29 PM
ok ill try that

wtf i sp4nk
11-19-2006, 11:37 PM
amm i put tolerance to 1, 1 and it still just goes to right corner any way to make new color finding procedure that will work better?

Ransom
11-20-2006, 12:17 AM
Tolerance is not a boolean. Meaning it have many values. The higher you set the tolerance the more difference it will look for. Without actually testing your script i'm not positive whats happening but for tolerance to be effective you need a large number such as 20. I've had to have a tolerance of 50 at one point. So it all depends. If this doesn't help i'll look at it further

Ransom

wtf i sp4nk
11-20-2006, 12:35 AM
did u read edit with the benmouse errors do u think by any chance my mouse click is outdated cause im just using 1 i learned from tuts never bothered to look through SRL core for a procedure

Junior
11-20-2006, 01:43 AM
I PM'ed you the script at Mopar, check that out it should have no problems. and work pretty well. I didnt test it so anything else you have to ask just do so.
READ THE WHOLE SCRIPT!!!
I have added alot of very little important things, I put notes here and there, and other things so just make sure you look at it very carefully.
~jR

tarajunky
11-20-2006, 02:32 AM
One way to stop the mouse from moving to the top left is to make the mouse movement dependent on finding the color. Right now you search for a color. Then you move the mouse no matter whether you found the color or didn't find the color.

If you made it all conditional on first finding the color by using an if... then statement it would stop that from happening.


procedure cuttree;
begin
repeat
if findcolorspiraltolerance(x,y,treecolor,3,3,515,336 ,10) then
begin
mmouse(x,y,3,3);
if istextat2(9,9,treetocut,20) then
begin
mouse(x,y,2,2,true);
TreesCut :=TreesCut+1;
end;
end;
wait(treewait+random(500));
until(Invfull);
end;


Anytime you want to run two or more commands after an if... then statement, you need to collect them together in a begin... end grouping.

IF you find the color, you want to move the mouse and check the text. Then IF the text matches, you want to click the mouse and add 1 to your tree count.

I also changed FindColor to FindColorTolerance. It still may not work based on the colors you are using, but hopefully it will help you understand how to organize a script.