Lua code Editing Fortnite issues with MoveMouseRelative

MoveMouseRelative moves very fast but I noticed that when I make my mouse move up then right it often gets a shortcut. So I miss some squares when I edit. So instead of going up then right it seems to go across. I tried to add more sleep time in the movemouse or between two moves. In first case it moves too slowly and in the second it stills taking shortcuts.

This code is what is working the best (less worse), I make several up or down movements in order that smaller shortcuts are taken. But I'm sure it can be improved with a more simple code (less lines) and having à good drawing of the edit.

How can that be fixed please?

----------------
    -- Boutton 8 edit en rond ou du haut vers le bas mur ou escalier - MB8 round edit or up and down stair and wall             
    ----------------
    -- CapsLock OFF
    -- Edit en rond - Round edit
    
      if not IsKeyLockOn("capslock")then
            if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then
    
                        PressAndReleaseKey("BackSpace")-- Edit
                        FastSleep(5)
                        PressAndReleaseKey("T")-- Reset Edit
    
                if not IsMouseButtonPressed(3) then
    
                        --Regarder - Look
                            for i = 0, 20 do
                            MoveMouseRelative (0,127) -- bas - down
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
    
                        -- Dessiner Edit - Draw Edit
                            PressKey(13)-- Select Edit
    
                            for i = 0, 5 do
                            MoveMouseRelative (0,-127) -- haut - up
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 5 do
                            MoveMouseRelative (0,-127) -- haut - up
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 4 do
                            MoveMouseRelative (0,-127) -- haut - up
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 4 do
                            MoveMouseRelative (0,-127) -- haut - up
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 5 do
                            MoveMouseRelative (127,0) -- droite - right
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 6 do
                            MoveMouseRelative (0,127) -- bas - down
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 6 do
                            MoveMouseRelative (0,127) -- bas - down
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 6 do
                            MoveMouseRelative (0,-127) -- haut - up
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 5 do
                            MoveMouseRelative (-127,0) -- gauche- left
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 5 do
                            MoveMouseRelative (-127,0) -- gauche - left
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 6 do
                            MoveMouseRelative (0,127) -- bas - down
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 6 do
                            MoveMouseRelative (0,-127) -- haut - up
                           FastSleep(0.5)
                            end
                           FastSleep(1)
    
                            for i = 0, 5 do
                            MoveMouseRelative (0,-127) -- haut - up
                           FastSleep(0.5)
                            end
                           FastSleep(5)
    
                            for i = 0, 5 do
                            MoveMouseRelative (127,0) -- droite- right
                           FastSleep(0.5)
                            end
                           FastSleep(5)
                end

(....)

 if event == "MOUSE_BUTTON_RELEASED" and arg == 8 then

                    FastSleep(1)
                    ReleaseKey(13)-- Select Edit
                    FastSleep(1)
                    PressAndReleaseKey("F1")
                    PressAndReleaseKey(7) -- Alterner les raccourcis - Switch Quickbar
                    end
    end
  end


from Recent Questions - Stack Overflow https://ift.tt/3Ev5aMc
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation