Yoriz
Active Members-
Posts
346 -
Joined
-
Last visited
Recent Profile Visitors
1,022 profile views
Yoriz's Achievements
Universalist (7/7)
7
Reputation
-
20Ice18 reacted to a post in a topic:
EzMySql UDF - Use MySql Databases with autoit
-
robertocm reacted to a post in a topic:
EzMySql UDF - Use MySql Databases with autoit
-
PoojaKrishna reacted to a post in a topic:
EzMySql UDF - Use MySql Databases with autoit
-
WIHedgehog reacted to a post in a topic:
Close Gui after a certain time of inactivity
-
kuhicop reacted to a post in a topic:
EzMySql UDF - Use MySql Databases with autoit
-
mLipok reacted to a post in a topic:
EzMySql UDF - Use MySql Databases with autoit
-
galan2015 reacted to a post in a topic:
GUICtrlCreateCombo
-
EzMySql UDF - Use MySql Databases with autoit
Yoriz replied to Yoriz's topic in AutoIt Example Scripts
Sorry not used autoit or been on forum in a while, the download still works ok for me. -
You could give my GDIPlusDispose UDF a try and not have to worry about the disposing, it will be done automatically see the link in signature.
-
Hi, What about putting the text in an edit control so it takes care of the scrollbars for you. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Tabbed Notebook Dialog", 623, 442, 192, 124) $Tab1 = GUICtrlCreateTab(8, 8, 609, 425) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlSetState(-1,$GUI_SHOW) $Edit1 = GUICtrlCreateEdit("", 16, 40, 593, 385) GUICtrlSetData(-1, StringFormat("\r\n\r\n\r\n\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n\r\n\r\n\r\n\r\nhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n\r\n\r\n\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n\r\n\r\nhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n\r\n\r\nhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n")) $TabSheet3 = GUICtrlCreateTabItem("TabSheet3") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
-
Close Gui after a certain time of inactivity
Yoriz replied to Naveed's topic in AutoIt GUI Help and Support
Hi, Here is a way of doing it, have a TimerInit() before the start of the windows msg loop, check for it reaching a idle maximum duration as one of the cases, after any other case reset the timmer. i made a little example that has two button that will reset the timmer and a status to show the idle time in seconds. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> _Form1() Func _Form1() #Region ### START Koda GUI section ### Form= Local $Form1 = GUICreate("Form1", 196, 94, -1, -1) Local $hButton1 = GUICtrlCreateButton("Button1", 20, 24, 75, 25) Local $hButton2 = GUICtrlCreateButton("Button2", 100, 24, 75, 25) Local $hStatusBar1 = _GUICtrlStatusBar_Create($Form1) _GUICtrlStatusBar_SetSimple($hStatusBar1) _GUICtrlStatusBar_SetText($hStatusBar1, "Idle Time: ") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $iTimmer = TimerInit() Local $iTimmerDuraction = 20000 Local $sStatusText While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Exit Case $nMsg = $hButton1 MsgBox(0, "Button1", "Idle timmer reset") $iTimmer = TimerInit() Case $nMsg = $hButton2 MsgBox(0, "Button2", "Idle timmer reset") $iTimmer = TimerInit() Case TimerDiff($iTimmer) >= $iTimmerDuraction MsgBox(0, "Times up", "Idle time limit reached") ExitLoop Case Else Local $sNewTimeText = "Idle Time: " & Round(TimerDiff($iTimmer) / 1000) If $sStatusText <> $sNewTimeText Then $sStatusText = $sNewTimeText _GUICtrlStatusBar_SetText($hStatusBar1, $sStatusText) EndIf EndSelect WEnd EndFunc ;==>_Form1 -
Hi , welcome to the forum, there are examples in this thread.
-
How to kill an AutoIT exe after itscompletion
Yoriz replied to getafix's topic in AutoIt General Help and Support
Hey, Your code looks like it might be getting stuck on one of the WinWait or WinWaitActive. you could use the optional timeout parameter to give your code a way out if something it is waiting for doesn't happen. If WinWaitActive($title, "", 10) Then MsgBox(0, "Good", "It didn't time out so i can continue with the normal code") Else MsgBox(0, "Doh", "It timed out , what should i do instead?, maybe just exit") Exit EndIf -
Generating random Numbers for tooltip x and y coordinates
Yoriz replied to focksie's topic in AutoIt General Help and Support
Hey, You should use the 3rd parameter of random to ensure you get a whole number. ToolTip( "Riveting story", Random(0, 1680, 1), Random(0, 1050, 1), "Cool Story Bro") -
SQLite with command line parameters for import
Yoriz replied to Jfish's topic in AutoIt General Help and Support
Your welcome , One thing to note when importing, watch out for any of the data having coma's it will throw the delimeter all out of wack. -
SQLite with command line parameters for import
Yoriz replied to Jfish's topic in AutoIt General Help and Support
SQLite> testimport.db SQLite> .separator , SQLite> .import importdata.csv testdata = _SQLite_SQLiteExe($sDatabaseFilePath, ".separator ," & @CRLF & ".import '" & FileGetShortName($hImportFilePath) & "' TableName" & @CRLF, $sOutputFile) #include <File.au3> #include <SQLite.au3> _CreateDatabaseFile() _ImportTxtToSql() _ReadArrayToSql() Func _CreateDatabaseFile() Local $hFile = @ScriptDir & "\Test.Txt" If FileExists($hFile) Then Return Local $iArraysize = 1000, $aArray[$iArraysize] For $i = 0 To $iArraysize - 1 Step 1 $aArray[$i] = $i & "-One," & $i & "-Two," & $i & "-Three," & $i & "-Four" Next _FileWriteFromArray($hFile, $aArray) EndFunc ;==>_CreateDatabaseFile Func _ImportTxtToSql() Local $sDatabaseFile = @ScriptDir & "\Test.Db", $sOutputFile Local $hFile = @ScriptDir & "\Test.Txt" If FileExists($sDatabaseFile) Then FileDelete($sDatabaseFile) _SQLite_SQLiteExe($sDatabaseFile, "CREATE TABLE test (ColOne,ColTwo,ColThree,ColFour);", $sOutputFile) Local $iTimmer = TimerInit() _SQLite_SQLiteExe($sDatabaseFile, ".mode csv" & @CRLF & ".import '" & FileGetShortName($hFile) & "' test" & @CRLF, $sOutputFile) ConsoleWrite(TimerDiff($iTimmer) & " :Time to import file" & @CR) EndFunc ;==>_ImportTxtToSql Func _ReadArrayToSql() Local $sDatabaseFile = @ScriptDir & "\Test.Db", $sOutputFile Local $hFile = @ScriptDir & "\Test.Txt" If FileExists($sDatabaseFile) Then FileDelete($sDatabaseFile) Local $aArray _FileReadToArray($hFile, $aArray) _SQLite_Startup() _SQLite_Open($sDatabaseFile) _SQLite_Exec(-1, "CREATE TABLE test (ColOne,ColTwo,ColThree,ColFour);") Local $iTimmer = TimerInit() _SQLite_Exec(-1, "Begin") For $i = 1 To $aArray[0] Step 1 _SQLite_Exec(-1, "INSERT INTO test values ('" & StringReplace($aArray[$i], ",", "','") & "');") Next _SQLite_Exec(-1, "END ;") ConsoleWrite(TimerDiff($iTimmer) & " :Time to read & insert array" & @CR) _SQLite_Close() _SQLite_Shutdown() EndFunc ;==>_ReadArrayToSql -
24th December, 2008 - v3.3.0.0 AutoIt: Added: New flag for StringSplit() to not return the count in element 0. UDFs: Removed: _StringSplit, no longer needed Looks like StringSplit was possibly made to work like _StringSplit so check the parameters your giving and you might just have remove the _ from your function calls.
-
Set the max number of characters that can be in an editbox with func GUICtrlSetLimit
-
Link: is there a function for reading images into 2d arrays?
-
Is this any good ? #include <GuiImageList.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> $hGUI = GUICreate("") $hGUIListView = _GUICtrlListView_Create($hGUI, "", 0, 0, 212, 300, BitOR($LVS_LIST, $LVS_ICON, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS)) $hImageList = _GUIImageList_Create(24, 24, 5) _GUIImageList_AddIcon($hImageList, "icon.ico", 0, True) _GUICtrlListView_SetImageList($hGUIListView, $hImageList, 1) _GUICtrlListView_AddItem($hGUIListView, "1", 0) _GUICtrlListView_AddItem($hGUIListView, "2", 0) _GUICtrlListView_AddItem($hGUIListView, "3", 0) GUISetState() MsgBox(0, "", "moving index 2 to index 0 position") _guiCtrlListViewMoveIndex($hGUIListView, 2, 0) MsgBox(0, "", "moving index 1 to index 2 position") _guiCtrlListViewMoveIndex($hGUIListView, 1, 2) While 1 If GUIGetMsg() = -3 Then Exit WEnd Func _guiCtrlListViewMoveIndex($hWnd, $iCurrentIndex, $iNewIndex) $sText = _GUICtrlListView_GetItemText($hWnd, $iCurrentIndex) _GUICtrlListView_DeleteItem($hWnd, $iCurrentIndex) _GUICtrlListView_InsertItem($hWnd, $sText, $iNewIndex) EndFunc ;==>_guiCtrlListViewMoveIndex
-
Link: is there a function for reading images into 2d arrays?
-
I dont know what _Crypt_HashData returns but the code checks the password is correct with this line so alter it to suit. Case $sPassword = "Correct" To have ESC key and when user hits OK just leaving the input box blank count as an attempt to login just comment out the following. Case $sPassword = "" If @error = 1 Then Return 0 Locking the mouse/keyboard sounds a bit harsh, why not just set that user to disabled , then once that user account has been investigated it can be reanabled or lock it out for a certain time or something.