Skip to content

Cannot open console input buffer for writing randomly appears during the ahk works #226

@MIFIKUS

Description

@MIFIKUS

Discussed in #225

Originally posted by MIFIKUS August 14, 2023
Hello!
I made an ahk script for Lineage 2M. And during the script works i get Cannot open console input buffer for writing.
It apperars absolutely randomly.
My code looks like this.

if action == 'move':
            move = f'''\
            #MaxThreads 20
            CoordMode, Mouse, Screen  ;
            DllCall("SetCursorPos", int, {x}, int, {y})
            Sleep, 120
            Exit

            '''
            while autohotkey.get_mouse_position(coord_mode='Screen') != (x, y):
                autohotkey.run_script(move)
            time.sleep(0.9*MULTIPLIER)
            return

        elif action == 'click':
            click = '''\
            #MaxThreads 20
            SendEvent {Click}
            Sleep, 120
            Exit
            '''

            autohotkey.run_script(click)
            time.sleep(0.9*MULTIPLIER)
            return

        elif action == 'drag':
            drag = f'''\
            #MaxThreads 20
            Click down
            Sleep, 120
            MouseMove, {x}, {y}, 1, {direction}
            Sleep, 120
            Click up
            Sleep, 120
            Sleep, 120
            Exit
            '''
            autohotkey.run_script(drag)
            time.sleep(0.5*MULTIPLIER)
            return

        elif action == 'wheel':
            wheel = f'''\
            #MaxThreads 20
            MouseClick,WheelDown,,,1,0,D,R
            Sleep, 120 
            Exit
            '''

I tried to google this error but didn't find anything.
To set a MaxThreads and Exit from script in the end didn't help too

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions