PROBLEMA problema sintassi script

mirkodls

Utente Attivo
773
73
CPU
i7 8700k 5.3
Dissipatore
corsair gtx h110 gtx
Scheda Madre
asus strix z370
HDD
m2 wdblack
RAM
16 GB DDR3 GSKILL
GPU
gigabyte 1080 ti oc 2000mhz
Monitor
asus pb287q 4k in over hz 65
PSU
SEASONIC 1000W PLATINUM
Case
THERMALTAKE chaser MK-I
OS
WINDOWS 10 PRO
ciao a tutti. quando inserisco questo script funziona bene ma vorrei che su 3 tasti si attivi un movimento diverso
questo funziona:
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
--Sleep(35)
Sleep(8)
MoveMouseRelative(0, 8)

until not IsMouseButtonPressed(1)
end
end
end

ma quando vado a inserire questo

function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then
recoil = not recoil
spot = not spot
if (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then
recoil = not recoil
spot = not spot
if (event == "MOUSE_BUTTON_PRESSED" and arg == 6) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
--Sleep(35)
Sleep(8)
MoveMouseRelative(0, 8)

until not IsMouseButtonPressed(1)
end
end
end

oppure questo:
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
--Sleep(35)
Sleep(8)
MoveMouseRelative(0, 8)

until not IsMouseButtonPressed(1)
end
end
end
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
--Sleep(35)
Sleep(8)
MoveMouseRelative(0, 8)

until not IsMouseButtonPressed(1)
end
end
end
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 6) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
--Sleep(35)
Sleep(8)
MoveMouseRelative(0, 8)

until not IsMouseButtonPressed(1)
end
end
end

non funziona su tutti e 3 i tasti. in teoria vorrei per ogni tasto un valore di movimento diverso come posso scriverlo in modo che possa funzionare?
 

mirkodls

Utente Attivo
773
73
CPU
i7 8700k 5.3
Dissipatore
corsair gtx h110 gtx
Scheda Madre
asus strix z370
HDD
m2 wdblack
RAM
16 GB DDR3 GSKILL
GPU
gigabyte 1080 ti oc 2000mhz
Monitor
asus pb287q 4k in over hz 65
PSU
SEASONIC 1000W PLATINUM
Case
THERMALTAKE chaser MK-I
OS
WINDOWS 10 PRO
no mi ha preso la sintassi giusta copiando e incollando...
 

mirkodls

Utente Attivo
773
73
CPU
i7 8700k 5.3
Dissipatore
corsair gtx h110 gtx
Scheda Madre
asus strix z370
HDD
m2 wdblack
RAM
16 GB DDR3 GSKILL
GPU
gigabyte 1080 ti oc 2000mhz
Monitor
asus pb287q 4k in over hz 65
PSU
SEASONIC 1000W PLATINUM
Case
THERMALTAKE chaser MK-I
OS
WINDOWS 10 PRO
Codice:
function OnEvent(event, arg)
    OutputLogMessage("event = %s, arg = %d\n", event, arg)
    if (event == "PROFILE_ACTIVATED") then
        EnablePrimaryMouseButtonEvents(true)
    elseif event == "PROFILE_DEACTIVATED" then
        ReleaseMouseButton(2)  -- to prevent it from being stuck on
    end
    if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then
        recoil = not recoil
        spot = not spot
    end
   if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
        if recoil then
            repeat
                --Sleep(35)
                Sleep(8)
                MoveMouseRelative(0, 8)
              
            until not IsMouseButtonPressed(1)
        end
    end
end

ecco perché comunque questo funziona dovrei creare uno script che mi da 3 valori a 3 tasti diversi
 

TheJudge

Utente Attivo
335
84
CPU
i5-8600k
Dissipatore
Cooler Master TX3 EVO
Scheda Madre
MSI Z370 SLI PLUS
HDD
SAMSUNG 840 Pro 250GB + SSD Sandisk 250GB
RAM
Hiperx 2x8GB DDR4 @2666Hz
GPU
Asus Strix 1070TI
Monitor
1 Asus 24" fullHD + BENQ 27" fullHD
PSU
EVGA SuperNova 850W 80+ gold
Case
NZXT S340
OS
Windows 10 Pro
Bello questo no recoil per i giochi. :D
Comunque, se il mouse è un logitech con il loro software puoi provare il profilo.
1- Verifica che effettivamente i tasti che premi siano gli stessi che stai impostando (aggiungi un banale log),
2- verifica che durante il normale run dello script lo stesso non crashi (lo capisci perchè ti si chiude la schermata di programmazione del profilo),
3- Verifica che lo script una volta che lasci il tasto non vada in stuck (lo capisci perchè il mouse continua a spostarsi verso il basso)
 

Entra

oppure Accedi utilizzando
Discord Ufficiale Entra ora!