Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/25/2013 in all areas

  1. Here is one way. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $btext[2] = ['Start', 'Stop'] Local $btnflag = 0 Local $pid #region ### START Koda GUI section ### Form= $Form1 = GUICreate("LATIHAN BUTTON", 273, 124, 192, 144) $START = GUICtrlCreateButton($btext[0], 80, 40, 89, 33) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $Msg = GUIGetMsg() If $Msg = $START Then START() EndIf Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func START() $btnflag = Not $btnflag If Not $btnflag Then ProcessClose($pid) Else $pid = Run("notepad.exe") EndIf GUICtrlSetData($START, $btext[$btnflag]) EndFunc ;==>START
    2 points
  2. dragan

    _IEAction

    Correct me if I'm wrong, but there's no waiting when you're going BACK, because the previous page is being loaded up from memory. Anyway, if you're going back to the point where previous page is no longer in your memory, you can use _IELoadWait again: #include <IE.au3> $oIE = _IECreate("http://www.yahoo.com/") MsgBox(0, 'message', 'Yahoo loaded!') _IENavigate($oIE, "http://www.google.com/") MsgBox(0, 'message', 'Google loaded!') _IEAction($oIE, "back") _IELoadWait($oIE) MsgBox(0, 'message', 'Loaded previous page.' & @CRLF & @CRLF & "Press OK to close script.") _IEQuit($oIE)
    1 point
  3. water

    StringInStr question

    If a string is found the position is returned, if not 0 is being returned. So modify your code this way: #include <IE.au3> $oIE = _IECreate("www.google.com/", 1) _IELoadWait($oIE) Func _SearchWord() $IEtxt = _IEBodyReadText($oIE) If StringInStr($IEtxt, "Images") > 0 Then ; DO SOME COMMANDS ElseIf StringInStr($IEtxt, "BLABLA") > 0 Then ; DO ANOTHER COMMANDS EndIf endfunc
    1 point
  4. If you want the simplest of ways, then check out IniWrite and the other ini commands. Some will tell you that INI files are redundant, but I've seen very little evidence of that ... and they've been saying that for years. They have their benefits ... especially manual edits with Notepad, size and portability.
    1 point
  5. Well, this is a WILD guess, I've no idea if this will work on IE8, but it seems that style is ALSO an object, so you use "SetAttribute" function to "style": #include <IE.au3> $oIE = _IECreate() Local $sHTML = '<html><body><img src="http://aut1.autoit-cdn.com/site/wp-content/themes/TheCorporation/images/logo@2x.png" width="210"height="72" alt="AutoItScript" id="logo" /></body></html>' _IEBodyWriteHTML($oIE, $sHTML) Local $AllImages = _IETagNameGetCollection($oIE, 'img') For $OneImage in $AllImages If $OneImage.id = 'logo' Then MsgBox(0, '', 'about to change') $OneImage.style.setAttribute('border', '5px solid green') MsgBox(0, '', 'after changing') ExitLoop EndIf Next
    1 point
  6. Look into help file. #include <SQLite.au3> #include <SQLite.dll.au3> Local $aResult, $iRows, $iColumns, $iRval _SQLite_Startup() If @error Then MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!") Exit -1 EndIf ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF) _SQLite_Open() ; Open a :memory: database If @error Then MsgBox(16, "SQLite Error", "Can't Load Database!") Exit -1 EndIf ;Example Table ; ID | Name | Age ; ----------------------- ; 1 Alice | 43 ; 2 Bob | 28 ; 3 Cindy | 21 If Not _SQLite_Exec(-1, "CREATE TEMP TABLE persons (ID,Name, Age);") = $SQLITE_OK Then _ MsgBox(16, "SQLite Error", _SQLite_ErrMsg()) If Not _SQLite_Exec(-1, "INSERT INTO persons VALUES (1,'Alice','43');") = $SQLITE_OK Then _ MsgBox(16, "SQLite Error", _SQLite_ErrMsg()) If Not _SQLite_Exec(-1, "INSERT INTO persons VALUES (2,'Bob','28');") = $SQLITE_OK Then _ MsgBox(16, "SQLite Error", _SQLite_ErrMsg()) If Not _SQLite_Exec(-1, "INSERT INTO persons VALUES (3,'Cindy','21');") = $SQLITE_OK Then _ MsgBox(16, "SQLite Error", _SQLite_ErrMsg()) ; Query $iRval = _SQLite_GetTable2d(-1, "SELECT * FROM persons;", $aResult, $iRows, $iColumns) If $iRval = $SQLITE_OK Then _SQLite_Display2DResult($aResult) ;~ $aResult looks like this: ;~ ;~ ID Name Age ;~ 1 Alice 43 ;~ 2 Bob 28 ;~ 3 Cindy 21 ;~ ;~ If the dimensions would be switched in _SQLite_GetTable2d the result would look like this: ;~ ;~ Name Alice Bob Cindy ;~ Age 43 28 21 Else MsgBox(16, "SQLite Error: " & $iRval, _SQLite_ErrMsg()) EndIf _SQLite_Close() _SQLite_Shutdown() regards
    1 point
  7. There's always a workaround: #include <IE.au3> $oIE = _IECreate() Local $sHTML = '<html><body><img src="http://aut1.autoit-cdn.com/site/wp-content/themes/TheCorporation/images/logo@2x.png" width="210"height="72" alt="AutoItScript" id="logo" /></body></html>' _IEBodyWriteHTML($oIE, $sHTML) Local $AllImages = _IETagNameGetCollection($oIE, 'img') For $OneImage in $AllImages If $OneImage.id = 'logo' Then If $OneImage.getAttribute("style") = '' Then MsgBox(0, '', 'about to change') $OneImage.outerhtml = StringTrimRight($OneImage.outerhtml, 1) & ' style="border:5px solid green;">' MsgBox(0, '', 'after changing') Else MsgBox(0, '', 'about to change') $OneImage.setAttribute("style") = "border:5px solid green;" MsgBox(0, '', 'after changing') EndIf ExitLoop EndIf Next
    1 point
  8. Hi, The variables are not interpreted like in PHP whenever they are in a string. You need to put it out like this : $var = Guictrlread(2) msgbox(0,"msg", "your pc will restart after " & $var)Next time, please take a look at the helpfile, there are tons of examples. Br, FireFox.
    1 point
  9. It works great and can find ADS on folders. Thank you. There is a small thing. While other two methods work as expected the FindStream method returns ":" when there is no ADS on the file. It does it only in case of files. Thank again.
    1 point
  10. Well I have received some PM's from the AutoIt staff and they have informed me that although I'm not breaking any rules by being here they do feel that I should rather have my own forum than to promote/track/update etc the status of Sputnik on this forum. Which is perfectly understandable considering many languages have their own forums such as PHP, QuickMacros, AutoHotKey and what not. I do wish to thank the staff at AutoIt for being kind and supportive of my project. If people wish to continue talking about Sputnik I'm afraid you will need to do it at my forum the link is here: http://uberfox.no-ip.org/forum It is an old forum I had years ago I used it for my mods and other projects however I recently just deleted everything on it and did a general reset to get rid of all spam and put Sputnik on it well it should still work despite how old it is. Edit; If you are having issues posting make sure to read the new member post: http://uberfox.no-ip.org/forum/showthread.php?31307-Welcome-new-Members! I will instantly promote anybody to full member who requests it.
    1 point
  11. You need to set the "style" attribute to your image object (answer lies here: http://msdn.microsoft.com/en-us/library/ie/ms536739%28v=vs.85%29.aspx ) #include <IE.au3> $oIE = _IECreate() Local $sHTML = '<html><body><img src="http://aut1.autoit-cdn.com/site/wp-content/themes/TheCorporation/images/logo@2x.png" width="210"height="72" alt="AutoItScript" id="logo" /></body></html>' _IEBodyWriteHTML($oIE, $sHTML) Local $AllImages = _IETagNameGetCollection($oIE, 'img') For $OneImage in $AllImages If $OneImage.id = 'logo' Then MsgBox(0, '', 'about to change') $OneImage.setAttribute("style", "border:5px solid green;") MsgBox(0, '', 'after changing') EndIf Next
    1 point
  12. _IEErrorHandlerRegister("MyErrFunc") Do Sleep(100) $oForm = _IEFormGetObjByName($oFrame, 'ClEquipmentTraceProfileForm') Until IsObJ($oForm) Func MyErrFunc() Return EndFunc ;==>MyErrFunc
    1 point
  13. ChrisL

    Ftp Download

    inetget ("Ftp://username:password@ftp.URL.co.uk","file.zip",1,1) While @InetGetActive TrayTip("Downloading File.zip", "Bytes = " & @InetGetBytesRead, 10, 17) Sleep(10) Wend
    1 point
×
×
  • Create New...