Leaderboard
Popular Content
Showing content with the highest reputation on 03/08/2019 in all areas
-
New version - 13 Jan 2019 - Added: 2 new functions to hide/show and existing marquee. New UDF and example script in zip format: Marquee.zip As always, ready for compliments and/or complaints! M231 point
-
This is the "General Help and Support" thread for the WebDriver UDF. The UDF itself can be downloaded here. So if you have any questions, suggestions or errors please post here.1 point
-
Create DLL to Start script if script process closed
RestrictedUser reacted to Jos for a topic
Yes, and how is this a logical answer to the proposed solution? Either way: it is quite easy to write a script that shell itself another time and have that monitor the original script. Just look at autoit3wrapper.au3 as example which has that mechanism build in. Jos1 point -
Command line output
RestrictedUser reacted to FrancescoDiMuro for a topic
@Colduction STDInWrite. Look in the Help file.1 point -
Try this : #include <ScreenCapture.au3> #include <GDIPlus.au3> #include <Date.au3> #include <Memory.au3> Global $RaportFileName = @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & "_" & @MIN & "_" & @SEC & ".html" $text = "This is first line text" & @CRLF &"and this is next line" _Raport($text, 1) FileWrite(@ScriptDir & "\" & $RaportFileName, "</pre></html>") ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Raport ; Description ...: ; Syntax ........: _Raport($sText1[, $Screen = 0]) ; Parameters ....: $sText1 - a string value. ; $Screen - [optional] an unknown value. Default is 0. ; 0 - Default - do not screenshot ; 1 - added screenshot full desktop ; Return values .: None ; Author ........: Your Name ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Raport($sText1, $Screen=0) Local $sText = "" Local $sHead = "" ; Define HTML file header and style $sHead = '<html>' & @CRLF & '<head><meta charset="utf-8"></head>' & @CRLF $sHead = $sHead & '<style>img{border:3px solid #FF0000;}</style>' & @CRLF $sHead = $sHead & '<style>pre{font-family: monospace;}</style>' & @CRLF $sHead = $sHead & '<style>pre{font-size: large;}</style>' & @CRLF $sHead = $sHead & '<pre>' & @CRLF If NOT FileExists(@ScriptDir & "\" & $RaportFileName) Then ; If file Raport not exist then create FileOpen(@ScriptDir & "\" & $RaportFileName, 258) FileWrite(@ScriptDir & "\" & $RaportFileName, $sHead) EndIf If StringInStr($sText1, @CRLF) > 0 Then ; @CRLF (ENTER) change the @CRLF and 11 space (indentation on width "[GG:MM:SS] ") $sText1 = StringReplace($sText1, @CRLF, @CRLF & ' ') EndIf $sText = $sText & $sText1 If $Screen <> 0 Then Local $hBitMap = _ScreenCapture_Capture("") _GDIPlus_Startup() Local $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($hBitMap) Local $bString = Image2BinaryString($hImage) $sText = $sText & @CRLF & '<br> ' & '<img src="data:image/png;base64,' & _ _ConvertToBase64($bString) & '"/>' _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject($hBitMap) _GDIPlus_Shutdown() EndIf FileWrite(@ScriptDir & "\" & $RaportFileName, "[" & _NowTime(5) & "] " & $sText & "<br><br>"&@CRLF) ; write to file Raport EndFunc Func _ConvertToBase64($bString) $objXML=ObjCreate("MSXML2.DOMDocument") $objNode=$objXML.createElement("b64") $objNode.dataType="bin.base64" $objNode.nodeTypedValue=Binary($bString) Return $objNode.Text EndFunc Func Image2BinaryString($hBitmap) ; based on UEZ code Local $sImgCLSID, $tGUID, $tParams, $tData $sImgCLSID = _GDIPlus_EncodersGetCLSID("PNG") $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Local $hStream = _WinAPI_CreateStreamOnHGlobal() _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID)) Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) Local $iMemSize = _MemGlobalSize($hMemory) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) _WinAPI_ReleaseStream($hStream) _MemGlobalFree($hMemory) Return $bData EndFunc1 point
-
Retrieve info from google sheets - (Moved)
FrancescoDiMuro reacted to water for a topic
Looks very promising! Would be interesting to modfiy the Excel UDF (let's say by adding a flag to _Excel_Open) and check how may of the example scripts still work1 point -
A little bit of googling, and I found GSpread.NET. I have never used it, so I cannot say how good it is. You may be able to use it with the Excel UDF, but I'm not certain. Adam1 point
-
1 point
-
Some websites hide elements in a <div> class or ID... referenced only by CSS. So you would need to view the CSS in order to see what is actually happening. In other cases, the jQuery or JavaScript is responsible for handling certain elements.1 point
-
#include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <Array.au3> ;You extract a string into a variable. $Str = "ABC" ;You split each character from that string. $Arr = StringSplit ( $str , "" ) ;Let's check what do we got. _ArrayDisplay ($Arr) ;Now you add the wanted charactere into your splited string. ;This extra line is not needed it will replace the index 0 from our array so we're not confuse with the number 3 $Arr[0] = "" ;Let's say we want to be able to use 2 methode Global $UsedMethode = 1 ;We declare our metode in the global scope ;that will be userfull if we do a custom function with it so the value "1" will be readable inside it. ;For your understanding i'll use numbers so we can see easy what happening in our string. Local $Methode1Array [10]= [1111,2222,3333,4444,5555,6666,7777,8888,9999] Local $Methode0Array = ["9999","8888","7777","6666","5555","4444","3333","2222","1111"] $NewString = "" If $UsedMethode = 1 Then $Raws = UBound ($Arr) ;"ABC" = 3 Lines ;One solution is to make a for loop to loop on the Raws number that will allow your script to work same way even with different amount of charactere in our strings. For $i = 1 to $Raws Step 1 ;$Raws = 3 $NewString = $NewString & $Arr[$i-1] & $Methode1Array[$i-1] Next ElseIf $UsedMethode = 0 Then $Raws = UBound ($Arr) ;"ABC" = 3 Lines For $i = 0 to $Raws Step 1 ;$Raws = 3 $NewString =$NewString & $Arr[$i] & $Methode0Array [$i-1] Next EndIf ;Or ;If $UsedMethode = 1 Then ;Else ;EndIf ;Now let's try this code $usedMethode = 1 $NewString = "" ; We reset result anyway before new generation If $UsedMethode = 1 Then $Raws = UBound ($Arr) ;"ABC" = 3 Lines For $i = 1 to $Raws Step 1 ;$Arr = 3 $NewString =$NewString & $Arr[$i-1] & $Methode1Array [$i-1] Next ElseIf $UsedMethode = 0 Then $Raws = UBound ($Arr) ;"ABC" = 3 Lines For $i = 1 to $Raws Step 1 ;$Arr = 3 $NewString =$NewString & $Arr[$i-1] & $Methode0Array [$i-1] Next EndIf ;We check our string with methode 1 : MsgBox (0 , "NewString Methode1" , $NewString ) $usedMethode = 0 $NewString = "" ; We reset result anyway before new generation If $UsedMethode = 1 Then $Raws = UBound ($Arr) ;"ABC" = 3 Lines For $i = 1 to $Raws Step 1 ;$Arr = 3 $NewString =$NewString & $Arr[$i-1] & $Methode1Array [$i-1] Next ElseIf $UsedMethode = 0 Then $Raws = UBound ($Arr) ;"ABC" = 3 Lines For $i = 1 to $Raws Step 1 ;$Arr = 3 $NewString =$NewString & $Arr[$i-1] & $Methode0Array [$i-1] Next EndIf ;We check our string with methode 0 : MsgBox (0 , "NewString Methode0" , $NewString ) I did it fast the simple way for me. There is 50 possibility to do that in different way. Now i looked further, and there is a problem with this line. $NewString =$NewString & $Arr[$i-1] & $Methode1Array [$i-1] I am not checking how much time i can loop $Methode1Array [$i-1] Becose if i leave the code like that after 10 loops we will have $Methode1Array [-1] And out array dont have an index with the value -1 how can we do ? Answer in my next post.1 point
-
DISPLAY/PREVIEW GUI
FrancescoDiMuro reacted to TheDcoder for a topic
Scripting.Dictionary could be useful in this case but sadly no one has made a proper wrapper for it in AutoIt as far as I know. @Daniza If you are feeling adventurous then you can install the Beta version of AutoIt and use the new Map datatype to store information (like quantity) related to an item. This should help you get started: You can probably use the Word UDF to make a new document and export it as a PDF file, see this function: _Word_DocExport Microsoft Word needs to be installed on the running computer of course, a free alternative might be the LibreOffice UDF that I have seen in this forum, not sure if that UDF supports export to PDF...1 point -
Run("NET USE \\computername\IPC$ mypassword /USER:myuser") Run("shutdown /m \\computername /r /t 0") You could do it this way.1 point
-
Has anyone seen _Crypt_DeriveKey failures?
FrancescoDiMuro reacted to AdamUL for a topic
This looks like a 32-bit redirection issue on the 64-bit systems with a 32-bit script. Try adding the following to the top of your script. #include <WinAPIFiles.au3> ;Disable x86 redirection mechanism for a 32-bit script. If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) Adam1 point -
That's one solution. Other options would be -- Passing the session id as a parameter to the 2nd script Use IPC to pass the session id between scripts Combine everything into a single script that remains running in the background1 point
-
Form Builder beta
mLipok reacted to BuckMaster for a topic
Update v1.0.6 Major script overhaul, I literally started over from scratch only adding parts of code from the old script that were solid. I don’t have a help file made as of now so I am going to explain all of the functionality in this post - Form Builder is no longer bi-directional, you now toggle between script mode and GUI mode using a button in the top right or F4 - The script no longer recompiles on every change but instead inserts changes into the script - Form Builder no longer cares about Event mode or GuiGetMsg mode - No more .gui files, you now edit .au3 scripts directly - Script edit is now a SciLexer control, includes syntax highlighting, folding, call tips, keywords, and inline error annotations. - Script output console is now at the bottom in script mode - Main GUI menu redone, most functions from SciTe have been added along with their hotkeys - All restrictions to editing the script have been removed - GDI+ and Graphic editors removed - Cleanup of script, stability greatly increased - Hotkeys no longer use _IsPressed they now use GUIAccelerator keys (with exception to a few) - Multiple scripts can be open - Form Builder buffers the open scripts and adds an asterisk * to scripts that have been modified - Rich Edit, GUIScrollbars, Dummy, and Updown are disabled for now until I can add them - GUI Menu controls cannot be created as of now but will be rendered in the editor - Undo and Redo actions in script mode and GUI mode added, the GUI undo and redo buffer is cleared switching between modes - The Undo and Redo buffers do not have a limit but are cleared when switching between modes or scripts - Undo and Redo actions do not work for controls that have no control handle - The Treeview now works as a Go to function for controls and functions in script mode - Form Builder now tries to preserve as much of the original content as possible, it will save whitespace in-between parameters and comments on controls - Treeview context menu reworked, much more responsive - Unicode support added File -> Encoding -> UTF-8 - Language support added, I added a couple of language files and used Google translate just so I could size my GUI's for different languages, I do not support what those language files say - Selecting a GUI in the Treeview in GUI mode will allow you to change the GUI's Handle, Position, Background Color, State, Cursor, Font, Font Size and Font Attributes - Auto Declare is no longer hiding in the settings, it is now on the top right and is a toggle between Off, Global and Local - Help File Lookup added (Ctrl + H), allows you to search selected text in the help file, Any variable will be searched and the first result will be displayed, any string will be searched as a keyword in the index - Added current script line, column, and selection length in the bottom left - Standard undeclared style constants are checked before script execution and the script will prompt if an undefined style constant is found - You can now toggle script whitespace, EOL characters, line numbers, margins and output in the View menu - View -> Toggle All Folds works as it does in SciTe, only base level folds are changed and the first fold found determines whether to expand or contract - Form Builder Settings redone - Bugs with submitting data and control selection have been fixed - Fixed problems with frequently called repetitive functions causing issues with large scripts - Fixed bugs with B, I, U and S font attribute buttons getting stuck and called when enter was pressed Update v1.0.7 - Help File Look-up hotkey changed to Ctrl+B - Replace hotkey changed to Ctrl+H - Changes to $SCN_MODIFIED so only text events are notified - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark - Allows you to change foreground and background colors of Bookmarks - Added F2 hotkey for Next Bookmark - Added Shift+F2 hotkey for Previous Bookmark - Fixed a bug that made it so script annotation did not show up for some people - Script errors and warnings now add a Bookmark on each line - Ctrl+E hotkey added to clear all Bookmarks and Annotations - Minor GUI tweaks - Fixed a bug with the GUI Style undo action - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected - F4 Hotkey no longer switches modes, switching modes is now F10 - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console - Shift+F4 Hotkey added to toggle previous error or warning message - Shift+F5 Hotkey added to clear script output - Ctrl+F5 Hotkey added as SyntaxCheck Prod - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning - Language Select Menu Added Settings -> Lanugage - Icons added to main menu - Languages added to all new menu items and msgbox's - Language Files updated for new data - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ] - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected - Added redo button next to undo button - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels Update v1.0.8 - Somehow a main function got deleted causing the script to crash on some changes - Fixed some issues with updating Languages Hotkeys Ctrl + N - New Blank Script Ctrl + G - New GUI Script Ctrl + O - Open Script Ctrl + Shift + S - Save As Ctrl + S - Save Esc - Close Open Script Alt + F4 - Exit Ctrl + Z - Undo Ctrl + Y - Redo Ctrl + X - Cut Ctrl + C - Copy Ctrl + V - Paste Ctrl + A - Select All Ctrl + W - Clear inline script annotation Ctrl + E - Clear inline script annotation and bookmarks Ctrl + F - Find Ctrl + F3 - Find Next Shift + F3 - Find Previous (doesn’t work yet) Ctrl + B - Help File Lookup F5 - Go Alt + F5 - Beta Run F7 - Build Ctrl + F7 - Compile F11 - Full screen F8 - Toggle Show/Hide Script Output Ctrl + I - Open Include Ctrl + H - Replace F1 - AutoIt Help File Ctrl + D - Duplicate Control Delete - Delete Control Ctrl + Shift + 8 - Toggle Show/Hide Script Whitespace Ctrl + Shift + 9 - Toggle Show/Hide Script EOL characters Ctrl - GUI Mode multicontrol selection F10 - Switch Modes F4 - Next Message Shift+F4 - Previous Message Shift+F5 - Clear Output Ctrl+M - Add Bookmark F2 - Next Bookmark Shift+F2 - Previous Bookmark Basic GUI Mode How To Create a Control - click a control on the left - click in the GUI you wish to add the control Left Click: Click and drag to auto resize the control Right Click: Creates the control at a standard size Select a Control - click inside the control or select it in the treeview Change a controls Data - First select the control - modify the controls data on the right, press enter to submit changes state, cursor, font and resizing update when you change the data - when modifying the data parameter the script recognizes if there is a variable in the data and will add quotes accordingly ex. data parameter = $data, End result in script: GUICtrlCreateButton($data, 50, 50, 100, 20) ex. data parameter = data, End result in script: GUICtrlCreateButton("data", 50, 50, 100, 20) ex. data parameter = "data"&$data, End result in script: GUICtrlCreateButton("data"&$data, 50, 50, 100, 20) Applying an Image to a control - select a control - control styles must be applied to some controls before adding an image - click the ... button next to the Image input in the Control Properties area in the bottom right - select the image you want to display, allows jpg, bmp, gif, ico and dll files - selecting a dll will open another prompt to choose which resource to display Control Grouping - multiple controls must be selected - press the group controls button - control grouping allows you to resize and move multiple controls at the same time, as of now groups are deleted when leaving GUI mode I only have a couple odds and ends to finish up before everything should be complete, I need to add Undo and Redo actions for copying and duplicating controls and a couple other minor things, eventually I want to try to add all of the UDF controls as well. If people are willing to translate the language file I would be very grateful, the ones I have right now are from Google translate, I only used them for testing and have no idea what they say. I want to thank Kip, Prog@ndy, Isi360 and all of the other contributors on this forum, without you guys i don't think i could have written this script. Please post any comments, problems or suggestions, BuckMaster * I only used one "magic number" on my main close case statement, only for faster locating, and i don't care. Form Builder Source.zip Form Builder.zip1 point -
What is NetFlare Web Server? NetFlare is a standalone web server written in pure AutoIt3 with some features: Virtual Hosts Server-side scripting For testing virtual host capability, editing etchosts file is required in most cases. File: C:WindowsSystem32driversetchosts 127.0.0.1 this.is.my.dom 127.0.0.1 private.mycompany.com Souce code (Daemon Main): #include "./Lib/Net/Http/HttpServer.au3" #include "./Lib/IO/Console.au3" _Main() Func _Main() HttpServer_SetPort(80) HttpServer_RegisterHost("this.is.my.dom") HttpServer_RegisterHost("private.mycompany.com", @ScriptDir & "\WebRoot\custompath\deeper\private.mycompany.com") ConsoleWrite("NetFlare Web Server 0.2, By Dhilip89" & @CRLF & @CRLF) ConsoleWrite("Registered virtual hosts: " & @CRLF) $HostList = HttpServer_GetRegisteredHosts() For $i = 0 To HttpServer_CountRegisteredHosts() - 1 ConsoleWrite("[" & $i+1 & "] " & $HostList[$i] & @CRLF) Next HttpServer_Start() ConsoleWrite(@CRLF & "Server is running..." & @CRLF) While 1 Sleep(1000) WEnd EndFunc - Screenshots (0.2): Screenshots (0.3): Animated GIF (Stress testing, using meta refresh): <= Click or download to view Download Links: (Version 0.1): http://www.mediafire.com/download/an1gngni6qeh5x9/NetFlare_v0.1.zip (Version 0.2): http://www.mediafire.com/download/3a88m1sgyrth48a/NetFlare_v0.2.zip (Version 0.3): http://www.mediafire.com/download/q3prydlbkygl7jd/NetFlare_v0.3.zip1 point
-
1 point