OK working script becomes inoperative when auto-updating snippet is added to it

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
A Keymaker
Posts: 457
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

OK working script becomes inoperative when auto-updating snippet is added to it

23 Sep 2023, 07:14

[Continuing my work from this topic viewtopic.php?f=76&t=119158]

I have this script which works in a standalone AHK file

Code: Select all

#Persistent

Status_Of_The_Mouse_Button := 0
Time_Count_Of_The_Mouse_Button_Being_In_A_Given_State := 0

SetTimer, Checking_Status_Of_The_Mouse_Button, 11

Return

Checking_Status_Of_The_Mouse_Button:

GetKeyState, Status_Of_The_Mouse_Button, XButton1

if (Status_Of_The_Mouse_Button = "D")
    {

    if (Time_Count_Of_The_Mouse_Button_Being_In_A_Given_State = 0)
        {
        Time_Count_Of_The_Mouse_Button_Being_In_A_Given_State := A_TickCount
        }
    }

else
    {

    if (Time_Count_Of_The_Mouse_Button_Being_In_A_Given_State > 0)
        {

        if (A_TickCount - Time_Count_Of_The_Mouse_Button_Being_In_A_Given_State >= 333)

            {
            Send {XButton1 Down}
            }

        else
            {

            Send TEST HAS BEEN EXECUTED SUCCESSFULLY
            }

        Send {XButton1 Up}
        }

    Time_Count_Of_The_Mouse_Button_Being_In_A_Given_State := 0
    }

Return
but when I put above this code also these instructions for automated updating

Code: Select all

#SingleInstance Force

SetTimer, Update_This_Script, 333
Return

Update_This_Script:
    FileGetAttrib, attribs, %A_ScriptFullPath%

    IfInString, attribs, A
        {
        FileSetAttrib, -A, %A_ScriptFullPath%
        SplashTextOn, 200, 200, ● ● ● ● ● ● ● ● ● ● ● ●,`n S C R I P T`n`n U P D A T E D `n`n ● ● ● ● ● ● ● ● ●
        WinSet, AlwaysOnTop, Off, ● ● ● ● ● ● ● ● ● ● ● ●
        SetTimer, Remove_Pop_Up_Window, 1111
        SetTimer, Reload_This_Whole_File, 2222
        }
Return

Remove_Pop_Up_Window:
    SplashTextOff
    SetTimer, Remove_Pop_Up_Window, Off
Return

Reload_This_Whole_File:
    Reload
Return
then that first one concerning the behavior of Backward Mouse Button does not kick in as pressing of BBW is no longer altered. How can I fix this?

That auto-update part I have been using for quite long now in my bulk AHK file that holds various alterations to my programs and it does not block those numerous other ones - hence do not understand how it can affect this one
User avatar
A Keymaker
Posts: 457
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: OK working script becomes inoperative when auto-updating snippet is added to it

22 Oct 2023, 08:38

Anyone?

Any ideas?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot], Marium0505 and 282 guests