Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Yesterday
  3. Sorry here's some runable script, which should draw a straight line (given you have the brush tool selected) but instead nothing happens #include <WinAPIGdiDC.au3> #include <SendMessage.au3> $hWnd = WinWait("Untitled - Paint") Func Mousedrag($x1,$y1,$x2,$y2) Local $WM_MOUSEMOVE = 0x0200 Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 _SendMessage($hwnd, $WM_MOUSEMOVE, 0, _WinAPI_MakeLong($x1, $y1)) _SendMessage($hwnd, $WM_LBUTTONDOWN, $MK_LBUTTON, _WinAPI_MakeLong($x1, $y1)) _SendMessage($hwnd, $WM_MOUSEMOVE, 0, _WinAPI_MakeLong($x2, $y2)) _SendMessage($hwnd, $WM_LBUTTONUP, $MK_LBUTTON, _WinAPI_MakeLong($x2, $y2)) EndFunc Mousedrag(484,554,732,554)
  4. Producing only a func as code is hardly helpful. Maybe you should give a runable script that expresses precisely the problem you are facing.
  5. @LinkOut SendMessage doesn't works for me and refers to WinHTTP file I've enabled OpenVPN too, because I'm in restricted country please fix this problem, this UDF is very important for me please add the feature if connection was slow or disconnected then waits for connection
  6. That would work but i'm trying to automate it so it can run in the background Thanks for the quick reply, I regularly visit the forums but try to solve my problems just by searching but this one has just got me stumped.
  7. ah, now i understand. okay that fills another hole in my understanding. thanks for that. i dare not ask about the FileClose() because in another topic i was told that i did not close the opened file because i closed the file with FileClose($filename) and it must be a "handle", which is something i do not quite understand yet, but okay. bit by bit i am learning. everything one step at a time.
  8. @phi7ip welcome to the forum. Have you tried just MouseClickDrag? This works great for drawing a line in paint: MouseClickDrag("left", 100, 200, 400, 400)
  9. Hi, have been banging my head against a wall for days everything I can find says that this should work but for the life of me can't get it to work I'm trying to automate the testing of an app in the background, which requires "drags" but when I execute this it registers as two separate events not a single drag I also tried testing it in paint and nothing happens when it should draw a ine Any input would be appreciated xx Func Mousedrag($x1,$y1,$x2,$y2) Local $WM_MOUSEMOVE = 0x0200 Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 _SendMessage($hwnd, $WM_MOUSEMOVE, 0, _WinAPI_MakeLong($x1, $y1)) _SendMessage($hwnd, $WM_LBUTTONDOWN, $MK_LBUTTON, _WinAPI_MakeLong($x1, $y1)) _SendMessage($hwnd, $WM_MOUSEMOVE, 0, _WinAPI_MakeLong($x2, $y2)) _SendMessage($hwnd, $WM_LBUTTONUP, $MK_LBUTTON, _WinAPI_MakeLong($x2, $y2)) EndFunc
  10. @Bea I would say consider yourself fortunate you encountered Melba, who is arguably much more patient than others of us. Even with your thread being reopened, your being nasty to the Moderation team doesn't exactly earn you any points for future issues.
  11. You could start look at IE.udf especially the _IEGetObjById () function. Price is obj.innerText...
  12. IniWrite overwrites the values of the keys which already exist, while FileOpen(... , 2) overwrites the whole file The previous script first creates a .ini file, 150 lines. OK. After deletion of duplicates, you get about 110 values Using only IniWrite, you will overwrite the first 110 lines. There will still be 150 lines in the final ini, including possible duplicates in the last 40 lines which are kept unchanged Using FileOpen, you delete all the old lines and then re-create 110 new ones. No possible duplicates BTW don't forget FileClose() after the job is done
  13. Another easy solution is to use notification like this : GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iIDFrom = _WinAPI_LoWord($wParam) Local $iCode = _WinAPI_HiWord($wParam) If $iIDFrom = $idEdit Then If $iCode = $EN_SETFOCUS Then GUISetAccelerators("") If $iCode = $EN_KILLFOCUS Then GUISetAccelerators($Arr) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_WM_COMMAND
  14. I accidentally pasted the version with the deletion of gui and re-creation. Just ignore the GUIDelete($Gui_) and Call("MacroManagerGUI") - these are added to remove and create back the first gui so everything works fine. Also, I don't know how to edit posts, so sorry about it.
  15. Thanks ! It works flawlessly. I feel a bit ashamed, I didn't think about this ^^
  16. Func MacroManagerGui() ;Opt("GUICoordMode", 2) ;Opt("GUIResizeMode", 1);those two change something with button scaling Opt("GUIOnEventMode", 1) Opt("GUICloseOnESC", 0) Global $Gui_ = GUICreate("Macro manager", 260, 75);, 1325, 760) GUICtrlCreatePic("PirateShip.jpg", -1, -1, 260, 75) GUICtrlSetState(-1, 128);allows the buttons to be pressed as fuck GUISetIcon("Randomicon.ico") Global $Hkey_ = GUICtrlCreateButton("Attach hotkey", 10, 10);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($Hkey_, "ButtonAttachmentGUI");"AssignNewHotkey") Global $ClickAcceleration = GUICtrlCreateButton("Accelerate clicking rate", 135, 10);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($ClickAcceleration, "AccelerateMouseClicks") Global $disableScript = GUICtrlCreateButton("Toggle the script", 10, 40);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($disableScript, "EnableDisableHotkeys") Global $clickNormalization = GUICtrlCreateButton("Normalize mouse clicks", 135, 40);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($clickNormalization, "NormalizeClicks") Global $oythor = GUICtrlCreateButton("Author", 92, 10);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($oythor, "Oythor") Global $helpOfDoom = GUICtrlCreateButton(" ? ", 106, 40);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($helpOfDoom, "HelpAsFuck") GUISetState(@SW_SHOW, $Gui_) GUISetOnEvent($GUI_EVENT_CLOSE, "KillTheProgram") ;GUISetOnEvent($GUI_EVENT_MINIMIZE, "KillTheProgram") ;GUISetOnEvent($GUI_EVENT_RESTORE, "KillTheProgram") EndFunc Second Gui: Func ButtonAttachmentGUI() ;Opt("GUICoordMode", 2) ;Opt("GUIResizeMode", 802);those two change something with button scaling ;Opt("GUIOnEventMode", 1) Opt("GUICloseOnESC", 0) Global $BAGui_ = GUICreate("Hotkey Assignment", 55, 190, -1, -1, 0x00040000);, 1325, 760) ;GUICtrlSetResizing($BAGui_, 802) ;GUICtrlCreatePic("PirateShip.jpg", -1, -1, 260, 75) GUICtrlSetState(-1, 128);allows the buttons to be pressed as fuck GUISetIcon("Randomicon.ico") Global $Hkey1_ = GUICtrlCreateButton("SET NUMPAD 999", 8, 10);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($Hkey1_, "HotkeyAssignment1") Global $Hkey2_ = GUICtrlCreateButton("SET NUMPAD 999", 8, 40);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($Hkey2_, "HotkeyAssignment2") Global $Hkey3_ = GUICtrlCreateButton("SET NUMPAD 999", 8, 70);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($Hkey3_, "HotkeyAssignment3") Global $Hkey4_ = GUICtrlCreateButton("SET NUMPAD 999", 8, 100);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($Hkey4_, "HotkeyAssignment4") Global $Hkey5_ = GUICtrlCreateButton("SET NUMPAD 999", 8, 130);, StringLen("Increase clicking rate")*10) GUICtrlSetOnEvent($Hkey5_, "HotkeyAssignment5") GUISetState(@SW_SHOW, $BAGui_) GUIDelete($Gui_) Call("CheckHKeyAvailability", $Hkey1_, 1) Call("CheckHKeyAvailability", $Hkey2_, 4) Call("CheckHKeyAvailability", $Hkey3_, 7) Call("CheckHKeyAvailability", $Hkey4_, 10) Call("CheckHKeyAvailability", $Hkey5_, 13) GUISetOnEvent($GUI_EVENT_CLOSE, "CloseHKeyGui") ;GUISetOnEvent($GUI_EVENT_MINIMIZE, "KillTheProgram") ;GUISetOnEvent($GUI_EVENT_RESTORE, "KillTheProgram") ;Const $GWL_STYLE = -16 ;Const $WS_SIZEBOX = 262144 Local $hWnd = WinGetHandle("Hotkey Assignment") Local $style = _WinAPI_GetWindowLong($hWnd, -16) If BitXOR($style,262144) <> BitOr($style,BitXOR($style,262144)) Then _WinAPI_SetWindowLong($hWnd,-16,BitXOR($style,262144)) EndFunc Func CloseHKeyGui() GUIDelete($BAGui_) Call("MacroManagerGUI") EndFunc
  17. Yolowbeard, I suggest posting your code - see here how to do it. Then we might get an idea as to why this is happening. M23
  18. Case $msg = $Enter_KEY If ControlGetFocus ($hGUI) = "Edit2" Then ControlSend ($hGUI,"","Edit2", @LF) Something as simple as that ?
  19. Hi, The OP has told me, albeit in a rather unpleasant manner, that the site concerned is actually not a game as such and so despite the comment: the interaction is not with the game itself. As such I am reopening the thread should anyone wish to offer assistance. However, I would point out that although the Moderation team are open to reasoned argument as to why a thread should be reopened, it is not a good idea to start by using insults and a generally unpleasant tone when approaching us. We are only human and can make mistakes just like anyone else - but as shown here we are quite prepared to reverse decisions if there is sufficient cause. All that happens when we are attacked is that we will no longer offer any flex to the person concerned - which might be prejudicial in any future interactions. M23
  20. Hello, I am new here. I've started my adventure with AutoIt about a month ago. I am NOT a hacker or cheater and everything I do with AutoIt is meant to help me at work. On topic: I've created a macro managing program, this program has two gui's, the first one is a general one, where I can set up multiple clicks or open a window that allows me to allocate hotkeys, which, for example, set up an "if" condition I usually use, a loop, function and other stuff I use on a daily basis. The macro button is the issue, because I made it to open a new window (gui) that allows me to set up a button, and when this particular window opens, the first gui loses help button (is grayed) and, in some cases, two other buttons sometimes pick up values of the second gui, and say "No hotkey" instead of "Attach hotkey" and "Normalize mouse clicks". This is how it's supposed to look: This is how it looks after the new gui appears: You see the "?" button is grayed now. Nothing else changed because I was lucky or something, and if I close the second gui, nothing changes in the first one. This is still work in progress, so it sure looks ugly. I "solved" that by deleting the first gui after the second is created, and then create the first one after deleting the second, but it doesn't have a pretty good effect. Is there any way to fix this? PS: all buttons have different variables assigned to them. I checked 5 times to make sure I didn't F up anything.
  21. Hey im looking for a way to read the COM Port from 2 special devices in the device manager, they got a fix name, someone knows how to do it?
  22. Hi, In my script I'm using the following code : Global $Arr[1][2] = [["{ENTER}", $Enter_KEY]] GUISetAccelerators($Arr) So when the "Enter" key is used, some fuction are executed based on the Control currently focused. It works vers well for my 2 input boxes, but it breaks" the "$ES_WANTRETURN" flag I'm using for my Edit control. I've written a custom Func which reproduce the line feed/carriage return in the edit box, and i'm using this func to replace the carret on the correct line : https://www.autoitscript.com/forum/topic/118476-how-to-position-the-cursor-in-a-multi-line-edit/?tab=comments#comment-824334 But is there a way to skip this control so it receive the normal message and performs a carriage return like it would without an accelerator ?
  23. @Nine I believe the issue is related to browser restrictions limiting access to cross-domain elements. I was actually able to make it work by navigating to the domain that contains the desired data -- #include <IE.au3> #include <array.au3> $oIE = _IECreate("https://www.cmegroup.com/trading/interest-rates/countdown-to-fomc.html") _IENavigate($oIE, "https://cmegroup-tools.quikstrike.net/User/QuikStrikeView.aspx?viewitemid=IntegratedFedWatchTool") $oTable = _IETableGetCollection($oIE, 4) $aData = _IETableWriteToArray($oTable) _ArrayDisplay($aData)
  24. excuseme, this script writes even old datas that already written by different program can you guide me to only get new data?
  25. @Danp2 Id is always changing. And for some reason _IEFrameGetCollection doesn't work for that site. Only way I was able to access it is by using this code : #include <IE.au3> Opt ("MustDeclareVars", 1) Local $oIE = _IECreate("https://www.cmegroup.com/trading/interest-rates/countdown-to-fomc.html") If Not IsObj ($oIE) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error creating IE object") Local $oFrames = _IEFrameGetCollection ($oIE) ConsoleWrite ("Number of frames : " & $oFrames.length & @CRLF) For $oFrame in $oFrames ConsoleWrite (ObjName ($oFrame) & @CRLF) ; it doesn't write anything Next Local $oDivs = _IETagNameGetCollection ($oIE, "div") Local $oObject For $oDiv in $oDivs if $oDiv.className = " cmeIframeContainer" then ConsoleWrite ($oDiv.className & @CRLF) $oObject = $oDiv.firstElementChild ExitLoop EndIf Next MsgBox ($MB_SYSTEMMODAL,"",ObjName($oObject) & "/" & $oObject.id) But then the frame object seems empty, no tagcollection is working, empty...
  1. Load more activity
  • Create New...