Jump to content

sigh.. newbie question


go0b3r
 Share

Recommended Posts

ok well i saw this script somewhere else, but dont know how to use this?

#include <misc.au3>

HotKeySet ("{ESC}", "quitme")

While 1

For $i = 1 To 255

If _IsPressed (Hex ($i)) Then

MsgBox (0, "pressed", $i)

EndIf

Next

WEnd

Func quitme()

Exit

EndFunc

Ive tried useing other scripts like that but get errors each time. Do i need to add something?? Sorry for being so noobish lol.

Link to comment
Share on other sites

I don't really get what u're trying to do...

anyway, I've amended the script abit and this works

#include <misc.au3>

HotKeySet ("{ESC}", "quitme")

$dll = DllOpen("user32.dll")

While 1
    For $i = 1 To 255
        If _IsPressed (Hex ($i, $dll)) Then
            MsgBox (0, "pressed", $i)
        EndIf
    Next
WEnd

DllClose($dll)

Func quitme()
Exit
EndFunc

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Link to comment
Share on other sites

I don't really get what u're trying to do...

anyway, I've amended the script abit and this works

#include <misc.au3>

HotKeySet ("{ESC}", "quitme")

$dll = DllOpen("user32.dll")

While 1
    For $i = 1 To 255
        If _IsPressed (Hex ($i, $dll)) Then
            MsgBox (0, "pressed", $i)
        EndIf
    Next
WEnd

DllClose($dll)

Func quitme()
Exit
EndFunc
@Shibuya - what did you do? You don't need to open and close the dll (the _IsPressed function does it automatically), and you put the variable $dll inside the hex function as the "length" parameter. If that actually does work, I'm amazed.

@goob3r - I believe the original post was my code. It works fine if you're using (and running) the beta version of AutoIt.

-EDIT-

The message box doesn't really help right now. It should also include Hex ($i), since that's the format that the _IsPressed function uses. As for what this does, it gets the numerical and (if included) hex value of the key that is pressed.

Edited by greenmachine
Link to comment
Share on other sites

im using v3, does it need the beta version? ITs not that script in particular im inquiring about, just almost any complex scripts on here i cant run. Also, if there somewhere that explains what those complex commands mean lol, its all gibberish to me.

Link to comment
Share on other sites

@greenmachine

ooops...my bad...somehow my scite returned me this:

ERROR: Hex() [built-in] called with wrong number of args.

so i thought it could be a missing dll call like what the help file did for _IsPressed.

:lmao:

The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Link to comment
Share on other sites

@goob3r - I believe the original post was my code. It works fine if you're using (and running) the beta version of AutoIt.

Notice I did say beta in that sentence. So yes, beta is good.

Link: http://www.autoitscript.com/autoit3/files/beta/autoit/

Also, if you don't already have it, I strongly suggest using Scite, a text editor built to be used with AutoIt. You can get it here:

http://www.autoitscript.com/autoit3/scite/downloads.php

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...