def roof5tokenaction(): controller.move_mouse(controller.get_position(), (384,351), delta=0.0) controller.click() time.sleep(controller.add_time_noise(1.4)) controller.move_mouse(controller.get_position(), (416,340 ), delta=1) controller.click() time.sleep(controller.add_time_noise(6.9))
def roof3tokenaction(): controller.move_mouse(controller.get_position(), (352,369),delta=0.0) controller.click() time.sleep(controller.add_time_noise(2.1)) controller.move_mouse(controller.get_position(), (308,352), delta=0.0) controller.click() time.sleep(controller.add_time_noise(4.6))
def roof4tokenaction(): controller.move_mouse(controller.get_position(), (366,364),delta=0.0) controller.click() time.sleep(controller.add_time_noise(1.8)) controller.move_mouse(controller.get_position(), (382,394)) controller.click() time.sleep(controller.add_time_noise(3.8))
def roof1tokenaction(): controller.move_mouse(controller.get_position(), (387,280)) controller.click() time.sleep(controller.add_time_noise(1.85)) controller.move_mouse(controller.get_position(), (380,277)) controller.click() time.sleep(controller.add_time_noise(3.7))
def roof2tokenaction(): controller.move_mouse(controller.get_position(), (370,311)) controller.click() time.sleep(controller.add_time_noise(1.1)) controller.move_mouse(controller.get_position(), (310,340)) controller.click() time.sleep(controller.add_time_noise(4.2))
def floor2action(): controller.move_mouse(controller.get_position(), (755,186), delta=0.0) controller.click() time.sleep(controller.add_time_noise(8)) controller.move_mouse(controller.get_position(), (533,348), delta=0.0) controller.click() time.sleep(controller.add_time_noise(8))
def roof1stuckaction(): controller.move_mouse(controller.get_position(), (690,116), delta=0.0) controller.click() time.sleep(controller.add_time_noise(3.2)) controller.move_mouse(controller.get_position(), (378,308)) controller.click() time.sleep(controller.add_time_noise(4.55))
def roof6stuckaction(): controller.move_mouse(controller.get_position(), (745,153), delta=0.0) controller.click() time.sleep(controller.add_time_noise(5.2)) controller.move_mouse(controller.get_position(), (410,320), delta=0.0) controller.click() time.sleep(controller.add_time_noise(3.0))
import pyscreenshot import numpy as np from PIL import Image import cv2 import sys sys.path.insert(0, '/Users/yingliu/Desktop/rsbot') import controller import time while True: controller.move_mouse(controller.get_position(), (742, 289)) controller.click() time.sleep(controller.add_time_noise(0.5)) controller.move_mouse(controller.get_position(), (731, 271)) controller.click() time.sleep(controller.add_time_noise(0.9)) controller.move_mouse(controller.get_position(), (692, 289)) controller.click() time.sleep(controller.add_time_noise(2.4))
def roof7action(): controller.move_mouse(controller.get_position(), (385,230)) controller.click() time.sleep(controller.add_time_noise(4.4))
def roof6action(): controller.move_mouse(controller.get_position(), (618,323)) controller.click() time.sleep(controller.add_time_noise(7.05))
def floor3action(): controller.move_mouse(controller.get_position(), (400,165), delta=0.0) controller.click() time.sleep(controller.add_time_noise(10))
def floor1action(): controller.move_mouse(controller.get_position(), (350,255)) controller.click() time.sleep(controller.add_time_noise(7.0))
def GET(self, x, y): controller.move_mouse(int(x), int(y))
events = sys.argv[1].split(',') for _e in events: e = _e.split('~') t = int(e[0]) / 1000 if e[1] == "u" or e[1] == "d": #keyboard event numType = 1 if e[ 1] == "d" else 2 #key#d(own) = press, #key#u(p) = release key = e[2] shift = e[3] controller.press(key, type=numType, shift=shift) else: #mouse event #scroll if e[1] == "scrllms": controller.scroll_mouse(screen_width * float(e[2]), screen_height * float(e[3])) #move, set if e[1] == "mm": controller.move_mouse(screen_width * float(e[2]), screen_height * float(e[3])) if e[1] == "sm": controller.set_mouse(screen_width * float(e[2]), screen_height * float(e[3])) #press if e[1].startswith('p'): controller.press_mouse(True if e[1][1] == "r" else False) #release if e[1].startswith('r'): controller.release_mouse(True if e[1][1] == "r" else False) if t: time.sleep(t)