Jump to content

¿Bug? - not really


Go to solution Solved by Jos,

Recommended Posts

Hi guys, I was writing this simple code and I found that some weird happens. Please, ignore the code, I was just joking with friends.

ToolTip('Press space to start the wiggle <3' & @CRLF & _
        'Press escape to stop the wiggle :(', 0, 0, 'WIGGLE WIGGLE WIGGLE', 0, 100)

HotKeySet('{SPACE}', '_WiggleWiggleWiggle')
HotKeySet('{ESC}', '_DontWiggleWiggleWiggle')

Global $Wiggle = 0
Global $WiggleWiggle = ''

Sleep(4000)

While True
    Sleep(100)
WEnd

Func _WiggleWiggleWiggle()
    ToolTip('')
    While True
        For $Wiggle = 1 To Random(1, 5, 1)
            $WiggleWiggle &= 'WIGGLE '
        Next
        Send($WiggleWiggle)
        Send('{ENTER}')
        $WiggleWiggle = ''
        Sleep(300)
        MsgBox(64, 'Title', $WiggleWiggle)
    WEnd
EndFunc

Func _DontWiggleWiggleWiggle()
    Exit
EndFunc
The bug is in the first function, and the cause is the space next to 'WIGGLE', If I write the space, the msgbox and the rest of the function is not called, and without the space it is. I really can't undestand why. Edited by Melba23
Amended title

Codes codes codes.

Link to comment
Share on other sites

  • Developers
  • Solution

You need to stop the HotKey for space or else you fire the func each time to send a space.

Add this to the top of the first func:

HotKeySet('{SPACE}')

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...