示例#1
0
    def move(self, x, y):
               
        unitx, unity, sleeptime = Mathinator.createUnitVector(x, y, sleep)

        dx = unitx * ratio
        dy = unity * ratio

        self.moveToLocation(dx, dy, sleeptime)
        #v.channel_override = {"1" : int(1515 - dx), "2": int(1515 - dy)}

        self.cancelMovement(unitx, unity) # SHOULD THESE BE UNITX and Y? or DX and DY?
        #v.channel_override = {"1" : int(1515 + dx), "2": int(1515 + dy)}

        self.clearOverrride()        
示例#2
0
    def move(self, x, y):

        unitx, unity, sleeptime = Mathinator.createUnitVector(x, y, sleep)

        dx = unitx * ratio
        dy = unity * ratio

        self.moveToLocation(dx, dy, sleeptime)
        #v.channel_override = {"1" : int(1515 - dx), "2": int(1515 - dy)}

        self.cancelMovement(
            unitx, unity)  # SHOULD THESE BE UNITX and Y? or DX and DY?
        #v.channel_override = {"1" : int(1515 + dx), "2": int(1515 + dy)}

        self.clearOverrride()
示例#3
0
def move(x, y, ratio):
               
        unitx, unity, sleep = Mathinator.createUnitVector(x, y, sleep)

        dx = unitx * ratio
        dy = unity * ratio

        # initial command
        v.channel_override = {"1" : int(1515 + dx), "2": int(1515 + dy)}
        v.flush()

        sleep(sleeptime)

        # counteract
        v.channel_override = {"1" : int(1515 - dx / gimpfactor), "2": int(1515 - dy / gimpfactor)}
        v.flush()

        sleep(enbrakenator)

        # clear
        v.channel_override = { "1": 0, "2": 0 }
        v.flush()

        sleep(enbrakenator)