from time import strftime import random running = True def runHotkey(event): global running running = False Env.addHotkey(Key.F1, KeyModifier.CTRL, runHotkey) nw=switchApp('LOST ARK') print('Starting') #L=Screen(0).getBounds() #xmid=int(L.width / 2) #ymid=int(L.height / 2) Settings.MoveMouseDelay=2 mouseMove() randmousedelay=5 randmouse=random.randint(0,randmousedelay) attmouse = 0 while nw.isRunning() and running: mouseloc = Env.getMouseLocation() print(strftime('%Y%m%d_%H%M%S ')+'Mouse is '+str(mouseloc)) attmouse += 1 if attmouse > randmouse: randmouse=random.randint(1,randmousedelay) movemousespeed=float(random.randint(5,20)) / 10 Settings.MoveMouseDelay = movemousespeed mouseloc = Env.getMouseLocation() xs = random.randint(0,1) ys = random.randint(0,1) xmod=1 ymod=1 if xs==0: xmod = -1 if ys==0: ymod = -1 x=random.randint(50,100)*xmod y=random.randint(25,30)*ymod newmouseloc=mouseloc.offset(x,y) print(strftime('%Y%m%d_%H%M%S ')+'Moving mouse from '+str(mouseloc)+' to '+str(newmouseloc)+' in '+str(movemousespeed)+'s') # mouseMove(newmouseloc) rightClick(newmouseloc) attmouse=0 mouseMove() wait(1)