
-
Similar Content
-
By XinYoung
For fun, I'm building an app that opens a webpage and refreshes it every 30 seconds.
But once the script performs _IEAction($oIE, "refresh"), the GUI closes.
Any help is appreciated.
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPIFiles.au3>
#include <Array.au3>
#include <File.au3>
#include <Excel.au3>
#include <DateTimeConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIShellEx.au3>
#include <MsgBoxConstants.au3>
#include <Date.au3>
#include <ComboConstants.au3>
#include <guimenu.au3>
#include <IE.au3>
HotKeySet("{F4}", "_Exit")
;Open the file(s) in the selected folder
$extension = ".txt"
$app2openWith = @SystemDir & "\notepad.exe"
Func Begin()
Global $loopTrick = 0
#Region ### START Koda GUI section ### Form=c:\users\mchu\downloads\autoit\my code\form1.kxf
Global $UI = GUICreate("Hit Em Up!", 256, 113, -1, -1)
GUISetBkColor(0x000000)
$menu = _GUICtrlMenu_GetSystemMenu($UI)
_GUICtrlMenu_EnableMenuItem($menu, $SC_CLOSE, 1, False)
Global $url = GUICtrlCreateInput("https://www.youtube.com/watch?v=dQw4w9WgXcQ", 81, 8, 160, 21)
$Label1 = GUICtrlCreateLabel("Target:", 16, 8, 55, 17)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FF00)
Global $StartBut = GUICtrlCreateButton("Start", 16, 40, 67, 25)
GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0x008000)
$Label2 = GUICtrlCreateLabel("(Press F4 to Exit)", 96, 40, 8000, 17)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FF00)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$UIfunc = GUIGetMsg()
Select
Case $UIfunc = $GUI_EVENT_CLOSE
_Exit()
Case $UIfunc = $StartBut
If GUICtrlRead($url) = "" Then
MsgBox(48, "Um...", "Give me a target you idiot.")
Else
GUICtrlSetState($url, $GUI_DISABLE)
GUICtrlSetState($StartBut, $GUI_DISABLE)
Start()
EndIf
EndSelect
WEnd
EndFunc ;==>Begin
Func Start()
If $loopTrick = 0 Then
Global $oIE = _IECreate(GUICtrlRead($url))
_IELoadWait($oIE)
Again()
ElseIf $loopTrick = 1 Then
Sleep(3000)
_IEAction($oIE, "refresh")
Sleep(3000)
Start()
EndIf
EndFunc ;==>Start
Func Again()
$loopTrick = 1
Start()
EndFunc ;==>Again
Func _Exit()
Exit
EndFunc ;==>_Exit
-
By kcvinu
Hi all,
I have a button created with _GUICtrlButton_Create function. I know that this function returns a handle of button instead of an ID. So i have obtain control ID by calling _WinAPI_GetDlgCtrlID function. After that i have tried the GUICtrlSetBkColor function. But it didnt worked. Any suggestions will be appreciated. Thanks in advance.
Note : - The window which carries this button is not created with native gui create function. Instead, it is created with CreateWindowEx api function.
-
By TheAutomator
Is this better to check a variable before you assign it to a value that could be the same?
for example:
local $EmptyLog = false func WriteLog($text) _guictrledit_appendtext($log, ($EmptyLog ? @CRLF : $empty) & $text) If $EmptyLog Then $EmptyLog = False endfunc or does AutoIt behind the scenes already check this?
i guess overwriting memory with the same value over and over again is not good if you can prevent this with a check?
-
By Robdog1955
I'm trying to click a button on a web page. I have added a couple of MsgBox lines to allow me to watch what happens on the page. As you can see the first half of my script enters data into text boxes on the page. I have no problem there. I just cannot click on the region buttons. The "set focus" line causes an outline to appear around the EU button and the "click button" line causes the "Pick a Region" text to disappear. Here is the code I have so far.
#include <IE.au3> Local $oIE = _IECreate("http://questchecker.com/") Local $iQuestID = "123456" Local $sCharacterName = "CharacterName" Local $colForms = _IEFormGetCollection($oIE) $iCount = 0 For $oForm In $colForms $oFormElements = _IEFormElementGetCollection($oForm) For $oFormElement In $oFormElements $iCount = $iCount + 1 Local $sTagName = StringLower($oFormElement.tagName) Local $sElementType = $oFormElement.type Local $sElementName = $oFormElement.name Switch $iCount Case 6 _IEFormElementSetValue($oFormElement, "MyRealm", 0) ; realm Case 7 _IEFormElementSetValue($oFormElement, $sCharacterName, 0) Case 8 _IEFormElementSetValue($oFormElement, $iQuestID, 0) EndSwitch Next Next Local $oButtons = _IEGetObjByName($oIE, "questForm") For $oButton In $oButtons If _IEFormElementGetValue($oButton) = "US" Then MsgBox(0, "", "Click Okay to set focus") _IEAction($oButton, "focus") MsgBox(0, "", "Click Okay to click button") _IEAction($oButton, "click") ExitLoop EndIf Next MsgBox(0, "", "Click Okay to quit") _IEQuit($oIE) Exit
-
By PINTO1927
Hello guys,
I need to bring up a MsgBox when the user clicks a button on the Internet Explorer page.
This is the button on the HTML page:
<button id="NOT_READY_BTN-btnEl" type="button" class="x-btn-center" hidefocus="true" disabled="disabled" role="button" autocomplete="off" data-qtip="ENTRA" style="width: 169px; height: 24px;"> <span id="NOT_READY_BTN-btnInnerEl" class="x-btn-inner" style="width: 169px;">ENTRA</span> <span id="NOT_READY_BTN-btnIconEl" class="x-btn-icon " style="background-image:url(img/icons/ENTRA.gif)"></span></button> Thanks
-