Jump to content

Recommended Posts

Posted (edited)

Is it possible to create an artificial mouse inside a GUI, that just interacts inside the GUI, so basically it can click things for you inside the GUI, so your main one doesn't have to? Thanks, just curious.

GUI

PS - An example would be those Runescape Bots from RsBots.net or something. Exemplified here : http://www.rsbots.net/videos/AutoFarmer-Pro/AutoFarmer-Pro.html

In the video, it's all inside a GUI, and the orange thing is the artificial mouse that moves & clicks, without controlling your main mouse.

Edited by Gui
Posted

Global Const $OCR_NORMAL = 0x32512
Global Const $OCR_IBEAM = 0x32513
Global Const $OCR_WAIT = 0x32514

$GUI = GUICreate("test")
GUISetState()
Local $hWaitCur
$hWaitCur = _LoadCursor($OCR_WAIT)
_SetSystemCursor($hWaitCur, $OCR_IBEAM)
While 1
    If GUIGetMsg() = -3 Then ExitLoop
    Sleep(10)
WEnd
_SetSystemCursor($hWaitCur, $OCR_NORMAL)
$hWaitCur = 0

Func _LoadCursor($iCursor)
    Return SetError(@error, @extended, _API(DllCall("user32.dll", "int", "LoadCursorA", "hwnd", 0, "int", $iCursor)))
EndFunc   ;==>_LoadCursor

Func _SetSystemCursor($hCursor, $iCursor)
    Return SetError(@error, @extended, _API(DllCall("user32.dll", "int", "SetSystemCursor", "int", $hCursor, "int", $iCursor)))
EndFunc   ;==>_SetSystemCursor

Func _API($v_ret)
    Local $err = @error
    ConsoleWrite($err & @CRLF)
    Local $ext = @extended
    ConsoleWrite($ext & @CRLF)
    If Not $err Then
        If IsArray($v_ret) Then
            Return $v_ret[0]
        Else
            Return $v_ret
        EndIf
    EndIf
    Return SetError($err, $ext, 0)
EndFunc   ;==>_API

Works better than the original example.

Posted (edited)

Sorry for the delay reply, but THANKS for replying guys!

@ Zedna, thanks I'll check em' out.

@ James, thanks but it doesn't work when I tested it. It says AU3 has stopped working : o.

And EDIT : It's not just changing the icon. It's basically creating a second mouse, that moves on it's own when directed, maybe inside an IE Embedded, then clicks. If making a second mouse isn't possible, maybe a Cross Hair icon, that moves in a loop, I just don't understand how I would do that.

Edited by Gui
Posted

Does the user really need to see the mouse? Won't ControlSend() and ControlClick() do it?

James

Not completely. They can do some, but a secondary mouse would be a great addition as well as make things a lot easier. I know it's possible in Java, hopyfully AutoIt too. :( I think I have you added on WindowsLive James, i'll talk there if you'd like.
Posted

Not completely. They can do some, but a secondary mouse would be a great addition as well as make things a lot easier. I know it's possible in Java, hopyfully AutoIt too. :( I think I have you added on WindowsLive James, i'll talk there if you'd like.

Hey Gui,

Did you found a way to do it yet?

Ive started 2 days agos, but im kinda good, Ive already worked with vb6/vb.net/c++.

Posted

Hey Gui,

Did you found a way to do it yet?

Ive started 2 days agos, but im kinda good, Ive already worked with vb6/vb.net/c++.

No luck yet, sorry.

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
  • Recently Browsing   0 members

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