Code (Text): program TopChop; var x,y: Integer; begin if(FindColor(x,y,65400,0,0,470,200)) then begin SendKeys(' '); end; repeat until(FindColor(x,y,26316,0,0,400,400)); end. hmmmm?
Did some corrections Mainly, I doubt senkeys(' ') will work and you're not looping in the first part until the bar meet the green zone Try this.... it may not work right, I just wrote this based on yours and didn't tested it. Code (Text): program TopChop; Var x,y: Integer; Begin Repeat Wait(100); Until(FindColor(x,y,65400,0,0,470,200)); KeyDown(32); Wait(100); KeyUp(32); Repeat Wait(100); Until(FindColor(x,y,26316,0,0,400,400)); End.
Doesn't the end; end the if statement and then it loops through? Sorry, I'm new to this. And yay it works! But what's this whole KeyDown, Wait, and KeyUp business? I get why Key Down is necessary, but why does it have to wait? Or is that how long it presses it for? Blah It also oftentimes goes when the bar is completely in the red, and other times it works perfectly. I tried changing the color but it still does it. Thanks youuu <3
The reason I put a wait between the 2 keys is because sometimes, it may happen to fast for the system to pickup. That's just from my experience tho. But I prefer not taking any chance and don't forget the keyup. I once did and it happens to be in a loop and it was the "enter" key. Try to do something while someone press the key :arf: I'll take a look if I have time 2morrow and see why the script is working sporadicly.
Code (Text): program SlapChop; var x,y: Integer; begin if(FindColor(x,y,65400,0,0,470,200)) then begin SendKeys(' '); end; repeat until(FindColor(x,y,26316,0,0,400,400)); end. Fixed.