diff --git a/phasmo.ahk b/phasmo.ahk index ad9e3d9..d50eaf5 100644 --- a/phasmo.ahk +++ b/phasmo.ahk @@ -92,15 +92,12 @@ Epilogue(mouseX, mouseY) Sleep 100 ; prevent accidental repetition of macro } -PhasmoAdd(id, n:=1) +PhasmoClick(relX, relY, n:=1) { global winW, winH fakeW := 1.6 * winH off := (winW - fakeW) / 2 - If id between 1 and 15 - MouseMove % off + fakeW * 0.41, winH * (id + 11.5) / 37.1 - If id between 16 and 22 - MouseMove % off + fakeW * 0.72, winH * (id - 3.5) / 37.1 + MouseMove % off + fakeW * relX, winH * relY Sleep 10 Click Loop % n - 1 @@ -111,21 +108,18 @@ PhasmoAdd(id, n:=1) Sleep 10 } +PhasmoAdd(id, n:=1) +{ + If id between 1 and 15 + PhasmoClick(0.41, (id + 11.5) / 37.1, n) + If id between 16 and 22 + PhasmoClick(0.72, (id - 3.5) / 37.1, n) +} + PhasmoRemove(id, n:=1) { - global winW, winH - fakeW := 1.6 * winH - off := (winW - fakeW) / 2 If id between 1 and 15 - MouseMove % off + fakeW * 0.435, winH * (id + 11.5) / 37.1 + PhasmoClick(0.435, (id + 11.5) / 37.1, n) If id between 16 and 22 - MouseMove % off + fakeW * 0.745, winH * (id - 3.5) / 37.1 - Sleep 10 - Click - Loop % n - 1 - { - Sleep 50 - Click - } - Sleep 10 + PhasmoClick(0.745, (id - 3.5) / 37.1, n) }