Fragen zur Mauskontrolle ;)

  • Huhu ^^,

    ich habe ein paar fragen zur Mauskontrolle :P

    und zwar möchte ich 2x Label immer die genaue mausposition anzeigen lassen (X und Y) weiß nurnich wie das geht ^^

    und mit MouseMove(500, 500) bewegt sich meine maus zwar auf den punkt 500 500 aber wenn ich aus der zahl MouseMove($POSX, $POSY) mache geht er immer zum punkt 0 ,0 obwohl in den 2 textfeldern höhere zahlen stehen ;)

    Lg

    ich^^

  • ich habs mal mit einem ToolTip gemacht. die GUI kannst du dir ja selber baun :D

    [autoit]

    $pos_old = MouseGetPos()

    [/autoit][autoit][/autoit][autoit]

    While 1
    $pos = MouseGetPos()
    If $pos[0] <> $pos_old[0] Or $pos[1] <> $pos_old[1] Then
    $pos_old = $pos
    ToolTip("x: "&$pos[0]&", y: "&$pos[1], 0, 0)
    EndIf
    Sleep(5)
    WEnd

    [/autoit]
  • hier wäre denn ma der ganze script :P

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <IE.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Embedded = _IECreateEmbedded ()
    $1 = 'http://google.de'

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Form1", 1053, 751, -1, -1)
    GUICtrlCreateObj ($Embedded, 24,16,1006,607)
    $Group1 = GUICtrlCreateGroup("XD", 24, 632, 305, 113)
    $mobx = GUICtrlCreateInput("0", 32, 656, 89, 21)
    $moby = GUICtrlCreateInput("0", 127, 656, 89, 21)
    $fightx = GUICtrlCreateInput("0", 32, 683, 89, 21)
    $fighty = GUICtrlCreateInput("0", 127, 683, 89, 21)
    $Label1 = GUICtrlCreateLabel("Mob - Pos.", 224, 657, 55, 17)
    $Label2 = GUICtrlCreateLabel("Fight - Pos.", 224, 687, 57, 17)
    $Label3 = GUICtrlCreateLabel("1", 288, 652, 15, 28)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    $Label4 = GUICtrlCreateLabel("2", 288, 680, 15, 28)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    $aoex = GUICtrlCreateInput("0", 32, 721, 89, 21)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $aoey = GUICtrlCreateInput("0", 127, 721, 89, 21)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Label5 = GUICtrlCreateLabel("AoE - Pos.", 224, 722, 54, 17)
    $Label6 = GUICtrlCreateLabel("3", 288, 715, 15, 28)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    $CheckAOE = GUICtrlCreateCheckbox("AoE - Enable ?", 64, 704, 97, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------------------------
    $POS = GUICtrlCreateLabel("X x Y", 360, 632, 25, 17)
    GUISetState()
    While guigetmsg()<>-3
    sleep(10)
    guictrlsetdata($POS,mousegetpos(0)&" x "&mousegetpos(1))
    if guigetmsg()=$POS then
    sleep(2000)
    mousemove(stringleft(guictrlread($POS),stringinstr(guictrlread($POS)," ")-1),stringmid(guictrlread($POS),stringinstr(guictrlread($POS),"x")+2))
    endif
    wend
    ;---------------------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    $shopbu = GUICtrlCreateButton("Shop", 344, 656, 41, 17, 0)
    $eqbu = GUICtrlCreateButton("Equip", 389, 656, 41, 17, 0)
    $statbu = GUICtrlCreateButton("Stats", 344, 676, 41, 17, 0)
    $upbu = GUICtrlCreateButton("Upgrade", 389, 676, 41, 17, 0)
    GUICtrlSetFont(-1, 7, 400, 0, "MS Sans Serif")
    $Group2 = GUICtrlCreateGroup("Killed Mobs", 352, 696, 73, 49)
    $Label7 = GUICtrlCreateLabel("0", 384, 720, 10, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group3 = GUICtrlCreateGroup("Area", 448, 640, 177, 105)
    $Check160 = GUICtrlCreateCheckbox("", 456, 664, 17, 17)
    GUICtrlSetState(-1, $GUI_CHECKED)
    $Check61120 = GUICtrlCreateCheckbox("", 456, 688, 17, 17)
    $bu160 = GUICtrlCreateButton("1 - 60 Mobs", 472, 664, 81, 17, 0)
    $bu61120 = GUICtrlCreateButton("61 - 120 Mobs", 472, 688, 81, 17, 0)
    $scrollbu = GUICtrlCreateButton("Scroll", 560, 656, 57, 49, 0)
    $CheckSCROLL = GUICtrlCreateCheckbox("Scrolling ?", 488, 720, 97, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Start = GUICtrlCreateButton("Start", 640, 648, 137, 97, 0)
    GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
    $Stop = GUICtrlCreateButton("Stop", 786, 648, 137, 97, 0)
    GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
    $Save = GUICtrlCreateButton("Save Options", 936, 648, 97, 33, 0)
    $Logout = GUICtrlCreateButton("Logout", 936, 681, 97, 33, 0)
    $PageStart = GUICtrlCreateButton("Start Page", 936, 714, 97, 33, 0)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _IENavigate ($Embedded, $1)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Start
    _IENavigate($Embedded, $1)
    Sleep(1000)
    MouseMove(GuiCtrlRead($mobx),GuiCtrlRead($moby),20)
    Sleep(300)
    MouseMove(GuiCtrlRead($fightx),GuiCtrlRead($fighty),20)
    Sleep(300)

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von Kasoki (13. Januar 2009 um 06:23)

  • Nur mal zur info, ach doch bitte deine Scripte in AutoIt felder, sonst werden mache Zeichen in smileys umgewandelt!
    Also ich weiß ja nicht was alles funktionieren soll, aber bei mir öffnet sich google, und die maus funktioniert auch richtig!

    mfg. Jam00

  • das mit den koordinaten geht doch..
    du musst halt nur noch das label ein bisschen breiter machen! (war bei mir so)

  • Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <IE.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Embedded = _IECreateEmbedded()
    $1 = 'http://google.de'

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Form1", 1053, 751, -1, -1)
    GUICtrlCreateObj($Embedded, 24, 16, 1006, 607)
    $Group1 = GUICtrlCreateGroup("XD", 24, 632, 305, 113)
    $mobx = GUICtrlCreateInput("0", 32, 656, 89, 21)
    $moby = GUICtrlCreateInput("0", 127, 656, 89, 21)
    $fightx = GUICtrlCreateInput("0", 32, 683, 89, 21)
    $fighty = GUICtrlCreateInput("0", 127, 683, 89, 21)
    $Label1 = GUICtrlCreateLabel("Mob - Pos.", 224, 657, 55, 17)
    $Label2 = GUICtrlCreateLabel("Fight - Pos.", 224, 687, 57, 17)
    $Label3 = GUICtrlCreateLabel("1", 288, 652, 15, 28)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    $Label4 = GUICtrlCreateLabel("2", 288, 680, 15, 28)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    $aoex = GUICtrlCreateInput("0", 32, 721, 89, 21)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $aoey = GUICtrlCreateInput("0", 127, 721, 89, 21)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Label5 = GUICtrlCreateLabel("AoE - Pos.", 224, 722, 54, 17)
    $Label6 = GUICtrlCreateLabel("3", 288, 715, 15, 28)
    GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
    $CheckAOE = GUICtrlCreateCheckbox("AoE - Enable ?", 64, 704, 97, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    [/autoit] [autoit][/autoit] [autoit]

    $shopbu = GUICtrlCreateButton("Shop", 344, 656, 41, 17, 0)
    $eqbu = GUICtrlCreateButton("Equip", 389, 656, 41, 17, 0)
    $statbu = GUICtrlCreateButton("Stats", 344, 676, 41, 17, 0)
    $upbu = GUICtrlCreateButton("Upgrade", 389, 676, 41, 17, 0)
    GUICtrlSetFont(-1, 7, 400, 0, "MS Sans Serif")
    $Group2 = GUICtrlCreateGroup("Killed Mobs", 352, 696, 73, 49)
    $Label7 = GUICtrlCreateLabel("0", 384, 720, 10, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group3 = GUICtrlCreateGroup("Area", 448, 640, 177, 105)
    $Check160 = GUICtrlCreateCheckbox("", 456, 664, 17, 17)
    GUICtrlSetState(-1, $GUI_CHECKED)
    $Check61120 = GUICtrlCreateCheckbox("", 456, 688, 17, 17)
    $bu160 = GUICtrlCreateButton("1 - 60 Mobs", 472, 664, 81, 17, 0)
    $bu61120 = GUICtrlCreateButton("61 - 120 Mobs", 472, 688, 81, 17, 0)
    $scrollbu = GUICtrlCreateButton("Scroll", 560, 656, 57, 49, 0)
    $CheckSCROLL = GUICtrlCreateCheckbox("Scrolling ?", 488, 720, 97, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Start = GUICtrlCreateButton("Start", 640, 648, 137, 97, 0)
    GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
    $Stop = GUICtrlCreateButton("Stop", 786, 648, 137, 97, 0)
    GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
    $Save = GUICtrlCreateButton("Save Options", 936, 648, 97, 33, 0)
    $Logout = GUICtrlCreateButton("Logout", 936, 681, 97, 33, 0)
    $PageStart = GUICtrlCreateButton("Start Page", 936, 714, 97, 33, 0)
    $POS = GUICtrlCreateLabel("X x Y", 360, 632, 60, 17)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    _IENavigate($Embedded, $1)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $POS
    Sleep(2000)
    MouseMove(StringLeft(GUICtrlRead($POS), StringInStr(GUICtrlRead($POS), " ") - 1), StringMid(GUICtrlRead($POS), StringInStr(GUICtrlRead($POS), "x") + 2))
    Case $Start
    _IENavigate($Embedded, $1)
    Sleep(1000)
    MouseMove(GUICtrlRead($mobx), GUICtrlRead($moby), 20)
    Sleep(300)
    MouseMove(GUICtrlRead($fightx), GUICtrlRead($fighty), 20)
    Sleep(300)
    EndSwitch
    GUICtrlSetData($POS, MouseGetPos(0) & " x " & MouseGetPos(1))
    WEnd

    [/autoit]