Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2015 in all areas

  1. As you didn't explain just what you're trying to do, I assume you are looking for general suggestions. So I give you one that I wrote for a helpdesk person that was continually asking me questions without searching for himself: $input = InputBox( "Every answer to every question - Ever", "Please enter type in your question." ) ShellExecute ("http://www.lmgtfy.com/?q=" &$input)
    2 points
  2. Try something like this here: #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> AutoItSetOption("MouseCoordMode", 2) Global $g_hGUI, $g_hImage, $g_hGDIBitmap Example() Func Example() AutoItSetOption("GUIOnEventMode", 1) ; X64 running support Local $sWow64 = "" If @AutoItX64 Then $sWow64 = "\Wow6432Node" ;get AutoIt install dir Local $sRegPath = "HKLM\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt" Local $sFile = RegRead($sRegPath, "InstallDir") & "\Examples\GUI\logo4.gif" If Not FileExists($sFile) Then MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONHAND), "", $sFile & " not found!", 30) Exit EndIf $g_hGUI = GUICreate("GDI+", 800, 600) Local $iPic1 = GUICtrlCreatePic("", 20, 20, 169, 68) Local $iPic2 = GUICtrlCreatePic("", 200, 200, 169, 68) Local $iPic3 = GUICtrlCreatePic("", 400, 400, 169, 68) Local $iPic4 = GUICtrlCreatePic("", 500, 500, 169, 68) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetState(@SW_SHOW) _GDIPlus_Startup() $g_hImage = _GDIPlus_ImageLoadFromFile($sFile) $g_hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($g_hImage) Local $i For $i = 1 To 4 _WinAPI_DeleteObject(GUICtrlSendMsg(Execute("$iPic" & $i), 0x0172, $IMAGE_BITMAP, $g_hGDIBitmap)) ;$STM_SETIMAGE = 0x0172 Next Local $aMChk, $aCtrlPos, $iDX, $iDY Do $aMChk = GUIGetCursorInfo($g_hGUI) Switch $aMChk[4] Case $iPic1 $aCtrlPos = ControlGetPos($g_hGUI, "", $iPic1) $iDX = Abs(MouseGetPos(0) - $aCtrlPos[0]) $iDY = Abs(MouseGetPos(1) - $aCtrlPos[1]) While GUIGetCursorInfo($g_hGUI)[2] ControlMove($g_hGUI, "", $iPic1, MouseGetPos(0) - $iDX, MouseGetPos(1) - $iDY) Sleep(20) WEnd Case $iPic2 $aCtrlPos = ControlGetPos($g_hGUI, "", $iPic2) $iDX = Abs(MouseGetPos(0) - $aCtrlPos[0]) $iDY = Abs(MouseGetPos(1) - $aCtrlPos[1]) While GUIGetCursorInfo($g_hGUI)[2] ControlMove($g_hGUI, "", $iPic2, MouseGetPos(0) - $iDX, MouseGetPos(1) - $iDY) Sleep(20) WEnd Case $iPic3 $aCtrlPos = ControlGetPos($g_hGUI, "", $iPic3) $iDX = Abs(MouseGetPos(0) - $aCtrlPos[0]) $iDY = Abs(MouseGetPos(1) - $aCtrlPos[1]) While GUIGetCursorInfo($g_hGUI)[2] ControlMove($g_hGUI, "", $iPic3, MouseGetPos(0) - $iDX, MouseGetPos(1) - $iDY) Sleep(20) WEnd Case $iPic4 $aCtrlPos = ControlGetPos($g_hGUI, "", $iPic4) $iDX = Abs(MouseGetPos(0) - $aCtrlPos[0]) $iDY = Abs(MouseGetPos(1) - $aCtrlPos[1]) While GUIGetCursorInfo($g_hGUI)[2] ControlMove($g_hGUI, "", $iPic4, MouseGetPos(0) - $iDX, MouseGetPos(1) - $iDY) Sleep(20) WEnd EndSwitch Until Not Sleep(50) EndFunc ;==>Example Func _Exit() _WinAPI_DeleteObject($g_hGDIBitmap) _GDIPlus_ImageDispose($g_hImage) _GDIPlus_Shutdown() GUIDelete($g_hGUI) Exit EndFunc ;==>_Exit There is room for optimizations!
    1 point
  3. water

    Get selected text?

    IIRC there was a similar discussion some time ago. Unfortunately I can't remember the title of the thread. But I'm sure you will find an answer by searching the forum.
    1 point
  4. http://lmgtfy.com/?q=autoit+winhttp+site%3Awww.autoitscript.com
    1 point
  5. There are a couple of approaches that come to mind. One uses the WinHTTP funtions to retrieve the HTML and then you can parse it with Regex. The other uses an actual web browser to navigate to the site and then retrieve the URLs. There are examples for both methods on the forum.
    1 point
  6. Post your code showing what you have tried thus far, and be sure to describe how it isn't working as expected.
    1 point
  7. Thanks for the clarification! If you want to do it on Linux I'm not sure AutoIt will help because it only runs on Windows. On Linux you would have to install Wine and - even if Autoit and your script run successfully - I'm not sure if the measured values are accurate because of the Wine overhead. Aren't there any programs available on the web for fast typewriting? I did a quick search and found Typing Trainer and a few more.
    1 point
×
×
  • Create New...