Leaderboard
Popular Content
Showing content with the highest reputation on 11/14/2016 in Posts
-
Form Builder beta
mLipok and one other 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.zip2 points -
Software Installer
bundyal reacted to abberration for a topic
Software Installer Version: 2.0 It's been been a long year, but I finally got some time to rework this project. I re-wrote everything from scratch because the old version was getting too complicated with so many options and sub-menus. This new version is much easier to use and I have been testing for a few days and it seems very stable. For those who are new to this software, it helps you install software silently/unattended. This new version tries to determine the silent switch automatically. You can also re-organize the order in which the software installs by dragging & dropping them in the listview. It now supports creating profiles and checks for missing software (and automatically unchecks them, so it does not attempt to install non-existent software). One feature I included was because I have seen several people on Youtube talk about disliking bright screens at night. So, now you can choose from a few color theme (half of them are dark). I dabbled a bit more into GDI+ to draw a few things and show my logo with a transparent background (hint: I'm not good at GDI+). Under the Help menu, you will find a User Guide, which goes through most of it's features. I included a new icon if you want to use when you compile the script (in the Assets > Misc folder). If you have questions, comments or suggestions, all are welcome. Hope you enjoy! Here it is in action: Software_Installer_2.0.zip1 point -
_Excel_RangeWrite - How Do I go to next row before looping
water reacted to SkysLastChance for a topic
I can't thank you enough.1 point -
_Excel_RangeWrite - How Do I go to next row before looping
SkysLastChance reacted to water for a topic
Try: Local $i = 1 Do $oIE = _IE_Example("basic") $oDiv = _IEGetObjById($oIE, "line1") _Excel_RangeWrite($oExcel,Default, $oDiv.innertext, "A" & $i) $oDiv = _IEGetObjById($oIE, "line2") _Excel_RangeWrite($oExcel,Default, $oDiv.innertext, "B" & $i) $oDiv = _IEGetObjById($oIE, "line3") _Excel_RangeWrite($oExcel,Default, $oDiv.innertext, "C" & $i) $i = $i + 1 Until $i > $sBox1 point -
_IEGetObjById and _Excel_RangeWrite Help
SkysLastChance reacted to Jfish for a topic
_Excel_RangeWrite($oExcel,Default, $oDiv.innertext, "A3") You were writing the object to Excel. The "innertext" of the object is what contains the text you are looking for. Looks like you used the help file example but modified it. When you did that and you lost the message box you forgot the reference to innertext.1 point -
Insert Values to Array Column
antonioj84 reacted to kylomas for a topic
try it like this #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <WindowsConstants.au3> Local $idListview ; Create GUI Local $hgui = GUICreate("ListView Add Array", 550, 300) $idListview = GUICtrlCreateListView("", 2, 2, 650, 268) ; ctlid actioned by lv notification routine Local $lv_Dummy = GUICtrlCreateDummy() GUISetState(@SW_SHOW) ; routine to run for lv notification messages GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Add columns _GUICtrlListView_AddColumn($idListview, "Network", 100) _GUICtrlListView_AddColumn($idListview, "IP", 100) _GUICtrlListView_AddColumn($idListview, "Sub ", 100) _GUICtrlListView_AddColumn($idListview, "Gateway ", 100) _GUICtrlListView_AddColumn($idListview, "DNS ", 100) Local $aItems = [ _ ['Black Network', 123, 323, 453, 001], _ ['White Netblock', 124, 324, 454, 999], _ ['LTE Netblock', 125, 325, 455, 'N/A'] _ ] _GUICtrlListView_AddArray($idListview, $aItems) ; Loop until the user exits. Local $msg While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $lv_Dummy MsgBox(0, '', _GUICtrlListView_GetItemTextString($idListview, -1), 5, $hgui) EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam, $ilParam Local $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) Switch $tNMHDR.IDFrom Case $idListview Switch $tNMHDR.Code Case $nm_dblclk GUICtrlSendToDummy($lv_Dummy) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY1 point -
Insert Values to Array Column
antonioj84 reacted to kylomas for a topic
antonioj84, Glad you got it working. Two points: 1 - By itself the code is pretty much useless except to display some info 2 - labeling cell data within the cell is a bad idea for several reasons. Additions/changes in code below: 1 - Added dummy control and notification routine to retrieve lv data on DBL-click. 2 - listview rearranged to reflect an x,y table. 3 - Eliminated unused declarations. 4 - eliminated calling the main prog from a function (make life easier in the notification routine). 5 - added var to guicreate function. 6 - changed message loop to process messages. #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <WindowsConstants.au3> Local $idListview ; Create GUI Local $hgui = GUICreate("ListView Add Array", 550, 300) $idListview = GUICtrlCreateListView("", 2, 2, 650, 268) ; ctlid actioned by lv notification routine Local $lv_Dummy = GUICtrlCreateDummy() GUISetState(@SW_SHOW) ; routine to run for lv notification messages GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Add columns _GUICtrlListView_AddColumn($idListview, "Network", 100) _GUICtrlListView_AddColumn($idListview, "IP", 100) _GUICtrlListView_AddColumn($idListview, "Sub ", 100) _GUICtrlListView_AddColumn($idListview, "Gateway ", 100) _GUICtrlListView_AddColumn($idListview, "DNS ", 100) Local $aItems = [ _ ['Black Network', 123, 323, 453, 001], _ ['White Netblock', 124, 324, 454, 999], _ ['LTE Netblock', 125, 325, 455, 'N/A'] _ ] _GUICtrlListView_AddArray($idListview, $aItems) ; Loop until the user exits. Local $msg While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $lv_Dummy MsgBox(0, '', _GUICtrlListView_GetItemTextString($idListview, -1), 5, $hgui) EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) Switch $tNMHDR.IDFrom Case $idListview Switch $tNMHDR.Code Case $nm_dblclk GUICtrlSendToDummy($lv_Dummy) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY I understand that you are new and working from examples, however, take the code apart piece by piece and it will start to make sense. Good Luck, kylomas1 point -
Insert Values to Array Column
antonioj84 reacted to kylomas for a topic
antonioj84, Is this how you want your array to look? (run the code) #include <array.au3> local $aArray = [ _ [123,124,125,224], _ [323,324,325,113], _ [453,454,455,'n/a'] _ ] _arraydisplay($aArray) kylomas1 point -
Au3Stripper Keeps stripping Exit scripts
Daeth reacted to InunoTaishou for a topic
What version of the Stripper are you using? After compiling I got this for the Au3Stripper v16.612.1119.0 stripped file #NoTrayIcon OnAutoItExitRegister("_0") Func _0() ConsoleWrite("kek") EndFunc1 point -
use GUICtrlSetData($Label2, $mtime) instead of _GUICtrlEdit_SetText($Label2, $mtime)1 point
-
[Solved] _ExcelReadSheetToArray into _Excel_RangeRead
SkysLastChance reacted to JLogan3o13 for a topic
You are creating a 1D array (use _ArrayDisplay to look at it), but referencing a 2nd dimension in your For loop. This would work just fine. #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, @DesktopDir & "\Test.xlsx") Local $aArray = _Excel_RangeRead($oWorkbook, Default, Default) For $i = 0 To UBound($aArray) - 1 $sR1 = $aArray[$i]; Entry Number ControlSend("[CLASS:Notepad]", "", "Edit1", $sR1 & @CR) Next1 point -
[Solved] _ExcelReadSheetToArray into _Excel_RangeRead
SkysLastChance reacted to JLogan3o13 for a topic
I had to write your code from scratch and make a couple of assumptions as what you have posted is not runnable (always helps to post runnable code when requesting assistance). But this works for me: #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, @DesktopDir & "\Test.xls") Local $aArray = _Excel_RangeRead($oWorkbook, Default, Default) For $i = 1 To UBound($aArray) - 1 $sR1 = $aArray[$i][0] ; Entry Number $sR2 = $aArray[$i][1] ; Weight $sR3 = $aArray[$i][2] ; Value ControlSend("[CLASS:Notepad]", "", "Edit1", $sR1 & @CR) ControlSend("[CLASS:Notepad]", "", "Edit1", $sR2 & @CR) ControlSend("[CLASS:Notepad]", "", "Edit1", $sR3 & @CR) Next1 point -
Need Help with Error
SkysLastChance reacted to water for a topic
After _Excel_Open you could call _Excel_Booklist. If you get an empty array no workbooks are open.1 point -
Need Help with Error
SkysLastChance reacted to water for a topic
Another idea is not to check for a running Excel instance but for open workbooks. If you like I can post an example.1 point -
Need Help with Error
SkysLastChance reacted to water for a topic
I would add some minor modifications to make it more readable: #Include <Excel.au3> #Include <File.au3> Global $oExcel, $sExcelFile, $ms While ProcessExists("EXCEL.EXE") $iReply = MsgBox(5,"","Process error. You have an Excel sheet open. You must close it in order to let this program work. Please close it now.") If $iReply = 2 Then Exit Sleep(250) WEnd $sExcelFile = FileOpenDialog("Choose/Create Excel File", @ScriptDir, "(*.xls)") $oExcel = _Excel_Open() If FileExists($sExcelFile) Then MsgBox(0,"","Book Opened") $oWorkbook = _Excel_BookOpen($oExcel,$sExcelFile) ;this will open the chosen xls file. If @error = 0 Then ConsoleWrite("Excel book " & $sExcelFile & " has been opened." & @CRLF) Else $oWorkbook = _Excel_BookNew($oExcel, 2);this is here to create the xls file if it does not exist. EndIf1 point -
loop my entire script
SkysLastChance reacted to water for a topic
Yes, I'm working my butt off to help newbies But on the other side I learn something new every day1 point -
Synchronize Scrolling Multiple ListViews?
argumentum reacted to UEZ for a topic
Something like this here? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiTreeView.au3> #include <GuiListView.au3> #include <Misc.au3> #include <GuiScrollBars.au3> Global Const $iMax = 40 $hGUI = GUICreate("Synchro Pair", 195, 240, -1, -1) $cLV_2 = GUICtrlCreateListView("LV_2", 60, 5, 85, 220) $hLV_2 = GUICtrlGetHandle($cLV_2) GUISetState(@SW_SHOW) $hGUI_Child = GUICreate("", 50, 220, 10, 5, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) $cLV_1 = GUICtrlCreateListView("LV_1", 0, 0, 85, 220) $hLV_1 = GUICtrlGetHandle($cLV_1) GUISetState() For $i = 1 To $iMax GUICtrlCreateListViewItem("Item " & $i, $cLV_1) GUICtrlCreateListViewItem("Item " & $i, $cLV_2) Next Global $aRect = _GUICtrlListView_GetItemRect($hLV_2, 0) Global Const $iDeltaY = $aRect[3] - $aRect[1] GUIRegisterMsg($WM_NOTIFY, "_WM_Notify") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_Notify($hWnd, $Msg, $wParam, $lParam) Local Const $iLines = _SendMessage($hLV_2, $LVM_GETTOPINDEX) - _SendMessage($hLV_1, $LVM_GETTOPINDEX) _SendMessage($hLV_1, $LVM_SCROLL, 0, $iLines * $iDeltaY) Return "GUI_RUNDEFMSG" EndFunc ;==>_WM_Notify1 point -
How to create a a progress bar when downloading
meoit reacted to abberration for a topic
I basically did the same kind of function for a program I wrote for my job. Mine was different in that I used a Do... Until loop using the the remote file size and the local file size. I have been using it for years with no trouble. Basically, it looks something like this: $remoteFile = "http://somewebsite.com/File.exe" $remoteFileSize = InetGetSize($remoteFile) $download = InetGet($remoteFile) ProgressOn("blah blah blah") Do $localFileSize = FileGetSize(@DesktopDir & "\File.exe") ProgressSet("blah blah blah") Until $localFileSize = $remoteFileSize1 point -
[Noob] Help Looping a code.
SkysLastChance reacted to Prime03 for a topic
#include <Excel.au3> $oExcel = _ExcelBookOpen($sFilePath , 1, true) For $i = 1 to 100 Step 1 ;this would do 100 rows at a time, change it to whatever you need _ExcelBookSave($oExcel) $CellString = _ExcelReadCell($oExcel, $i, 1) ;Row =$i, column = 1) Select Case $CellString = "No" ;Do something Case $CellString = "Yes" ;Do something Case Else $CellString = "Maybe" ;Do something EndSelect Next Check out the excel UDFs, makes life a bit easier! http://www.autoitscript.com/autoit3/docs/libfunctions/Excel%20Management.htm Edit: Forgot an Else after the last case.1 point