PROBLEMA problema sintassi script

Pubblicità

mirkodls

Utente Attivo
Messaggi
777
Reazioni
74
Punteggio
67
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?
 
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
 
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)
 
Pubblicità
Pubblicità
Indietro
Top