added farm bot
fixed magic needles
This commit is contained in:
39
farm/main_farm.py
Normal file
39
farm/main_farm.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from Field_Representation import Field
|
||||
from time import time
|
||||
import cv2 as cv
|
||||
import keyboard
|
||||
|
||||
def run():
|
||||
field = Field()
|
||||
loop_time_p = time()
|
||||
pause = True
|
||||
|
||||
while True:
|
||||
if keyboard.is_pressed('p') == True:
|
||||
pause = True
|
||||
print('q pressed')
|
||||
elif keyboard.is_pressed('o') == True:
|
||||
pause = False
|
||||
print('o pressed')
|
||||
|
||||
if pause:
|
||||
# cv.waitKey(500)
|
||||
if (time() - loop_time_p) >= 5:
|
||||
loop_time_p = time()
|
||||
print("pausing")
|
||||
continue
|
||||
|
||||
|
||||
cords, screenshot = field.get_current_board_state()
|
||||
field.analyse_boardstate(cords)
|
||||
print(cords)
|
||||
cv.waitKey(1000)
|
||||
|
||||
|
||||
#cv.imshow("screenshot", screenshot)
|
||||
#cv.waitKey(150)
|
||||
#print(cords)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
Reference in New Issue
Block a user