Jump to content

Button on a programm


Recommended Posts

I'm a bit confused because you're hard to understand... you want to know how to "click" on grey square in minesweeper?

Btw there's a faster way to put your name in the best score... even without actually running a bot. Just use T-search :)

Edited by MikeP
Link to comment
Share on other sites

okay thanx but now i got another question ... in the game Silkroad Online you have a textbox .. maybe you know it

you can write in it

now i want that wehn i write /menu a menu appears IN the textbox ... that means that in the textbox appears a text which will guide you trough the menu ....

is that possible with autoIT or do i need to do it with c++

Link to comment
Share on other sites

okay thanx but now i got another question ... in the game Silkroad Online you have a textbox .. maybe you know it

you can write in it

now i want that wehn i write /menu a menu appears IN the textbox ... that means that in the textbox appears a text which will guide you trough the menu ....

is that possible with autoIT or do i need to do it with c++

If it's a game it's most likely that the textbox is drawn by the game, not windows. And therefore it's most likely that it's impossible to write your own controls in it. AutoIt and C++, doesn't matter.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

I can't give the correct credit to the author of this script (that I found on this forum) but I think it can help you start your own, it displays a Tooltip when you type a certain sequence of letters (two words are triggering it here, Jon and Autoit), which is what you want to do since you want something to happen when you type '/menu' . Here it is :

Global Const $WH_KEYBOARD_LL = 13
Global $hHook
Global $hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
Global $hmod = DllCall("kernel32.dll", "hwnd", "GetModuleHandle", "ptr", 0)
Global $hHook = DllCall("user32.dll", "hwnd", "SetWindowsHookEx", "int", _
        $WH_KEYBOARD_LL, "ptr", DllCallbackGetPtr($hStub_KeyProc), "hwnd", $hmod[0], "dword", 0)
Global $buffer = ""

MsgBox(4096, "", "Click OK, then open notepad and type..." & _
        @LF & @LF & "Jon" & @LF & "AutoIt")


While 1
    Sleep(10)
WEnd

Func EvaluateKey($keycode)
    If (($keycode > 64) And ($keycode < 91)) _
            Or (($keycode > 47) And ($keycode < 58)) Then
        $buffer &= Chr($keycode)
        Switch $buffer
            Case "Jon"
                ToolTip("What can you say?")
            Case "AUTOIT"
                ToolTip("AutoIt Rocks")
        EndSwitch
    ElseIf ($keycode > 159) And ($keycode < 164) Then
        Return
    Else
        $buffer = ""
    EndIf
EndFunc   ;==>EvaluateKey

Func _KeyProc($nCode, $wParam, $lParam)
    Local $ret, $KEYHOOKSTRUCT
    If $nCode < 0 Then
        $ret = DllCall("user32.dll", "long", "CallNextHookEx", "hwnd", $hHook[0], _
                "int", $nCode, "wparam", $wParam, "lparam", $lParam)
        Return $ret[0]
    EndIf
    If $wParam = 256 Then
        $KEYHOOKSTRUCT = DllStructCreate("dword;dword;dword;dword;ptr", $lParam)
        EvaluateKey(DllStructGetData($KEYHOOKSTRUCT, 1))
    EndIf
    $ret = DllCall("user32.dll", "long", "CallNextHookEx", "hwnd", $hHook[0], _
            "int", $nCode, "ptr", $wParam, "ptr", $lParam)
    Return $ret[0]
EndFunc   ;==>_KeyProc

Func OnAutoItExit()
    DllCall("user32.dll", "int", "UnhookWindowsHookEx", "hwnd", $hHook[0])
    DllCallbackFree($hStub_KeyProc)
EndFunc   ;==>OnAutoItExit
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...