Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/22/2017 in all areas

  1. Here is a complete example of combining Autoit with PHP and MySQL was written by me. Include: Sign in, sign out.Create, read, update and delete data between client (AutoIt) and server (PHP/MySQL).Only allow user to log into a client at the same time. Video demo: https://www.youtube.com/watch?v=gQyfXLO0pls Screenshot (Main GUI) Usage If you want to test on your computer, you will need to create a localhost. I recommend to use WAMP or XAMPP. First, create a new database by importing from SETUP.sql file (see video for more info). Then, edit your path to SERVER in AutoIt-PHP-MySQL.au3: Global Const $SERVER = 'http://localhost/AutoIt/index.php?act='Make sure you have copied all files in the folder "PHP + MySQL" into a folder named AutoIt in your Localhost (www or htdocs directory). Yeah, now you can open the file "AutoIt-PHP-MySQL.au3" and try it yourself! Default username and password is: admin Download: Tutorial-AutoIt-PHP-MySQL-v1.0.rar[Tutorial] AutoIt - PHP - MySQL v2.0.zip (Thank @JohnOne for having suggested using zip format)Changelog ----- Hope you enjoyed it!
    1 point
  2. True, because they both have to be blank with AND. If you want to error if either is blank the operator should be OR.
    1 point
  3. If guictrlread($input1) = "" AND guictrlread($input2) = "" something like that
    1 point
  4. The purpose is to find all differences between the two arrays. Explanation for everybody. $aAr2 is not a random array. 100 elements are copied from $aAr1. And there are 100 rows in $aAr1 between each element. Because there are 10,000 elements in $aAr1 I need no more than 14 comparisons (2^14 = 16,384) in a binary search to find a specific element. To find all 100 elements I need no more than 1,400 comparisons in a binary search. And the binary search is further optimized because both arrays are sorted. This means an even smaller number of comparisons. Because there are 100 rows in $aAr1 between each element which is copied to $aAr2, I need exactly 100 new comparisons in a linear scan to find the next element from $aAr2 in $aAr1. To find all 100 elements I need 100 * 100 = 10,000 comparisons which exactly matches the number of rows in $aAr1. Again it's utilized that both arrays are sorted. This can be verified by removing the comment character in front of the ConsoleWrites. Because the compare command, StringCompare( $s, $aAr1[$mi] ), is the most time consuming command in the code the fastest method is approximately decided by the number of comparisons. Since the binary search has the fewest number of comparisons it wins.
    1 point
  5. Sorry. Here is the logic : My script assumes that the 3 things you want to get in each line are : number, name, score Meaning, in this line "4 qqqq 40", get "4, qqqq, 40" and in this one : "<5>1 wwww 50", get "5, wwww, 50" So I used a regular expression to parse each concerned line, get the wanted parts and store them in a 1D array ($res) The For/Next loop after is used to order the parts nicely by building a 2D array ($res2D) with a row per line and 3 columns
    1 point
  6. @9252Survive look at TrayIconDebug under Opt in the help file. This should accomplish what you're after.
    1 point
  7. I made it work, only issue currently is IUnknown.Release is called on my object 3 or 1 time(s), depending if the object is used or not before calling $IRunningObjectTable.Revoke. I suspect this may be an error in my custom object returned from IDispatch(). If not i will look into the other interfaces requested when calling IUnknown.QueryInterface I will post the functional code in this post when i get home later today and can access my code. #include <WinAPIDiag.au3> #include "..\AutoItObject_Internal.au3" $IID_IRunningObjectTable = "{00000010-0000-0000-C000-000000000046}" $IID_IMoniker = "{0000000f-0000-0000-C000-000000000046}" $AutoItError = ObjEvent("AutoIt.Error", "ErrFunc") ; Install a custom error handler Func ErrFunc($oError) ConsoleWrite("!>COM Error !"&@CRLF&"!>"&@TAB&"Number: "&Hex($oError.Number,8)&@CRLF&"!>"&@TAB&"Windescription: "&StringRegExpReplace($oError.windescription,"\R$","")&@CRLF&"!>"&@TAB&"Source: "&$oError.source&@CRLF&"!>"&@TAB&"Description: "&$oError.description&@CRLF&"!>"&@TAB&"Helpfile: "&$oError.helpfile&@CRLF&"!>"&@TAB&"Helpcontext: "&$oError.helpcontext&@CRLF&"!>"&@TAB&"Lastdllerror: "&$oError.lastdllerror&@CRLF&"!>"&@TAB&"Scriptline: "&$oError.scriptline&@CRLF) EndFunc ;==>ErrFunc $IDispatch = IDispatch() $IDispatch.name = "my name is Danny" $IRunningObjectTable = DllCall("Ole32.dll","LONG","GetRunningObjectTable","DWORD",0,"PTR*",0) If @error<>0 Then Exit MsgBox(0, @ScriptLineNumber, @error) $IRunningObjectTable = ObjCreateInterface($IRunningObjectTable[2],$IID_IRunningObjectTable,"Register HRESULT(DWORD;PTR;PTR;DWORD*);Revoke HRESULT(DWORD);IsRunning HRESULT(PTR*);GetObject HRESULT(PTR;PTR*);NoteChangeTime HRESULT(DWORD;PTR*);GetTimeOfLastChange HRESULT(PTR*;PTR*);EnumRunning HRESULT(PTR*);",True) If @error<>0 Then Exit MsgBox(0, @ScriptLineNumber, @error) $sCLSID="AutoIt.COMDemo" $IMoniker=DllCall("Ole32.dll", "LONG", "CreateFileMoniker", "WSTR", $sCLSID, "PTR*", 0) If @error<>0 Then Exit MsgBox(0, @ScriptLineNumber, @error) Global Const $ROTFLAGS_REGISTRATIONKEEPSALIVE=0x01 Global Const $ROTFLAGS_ALLOWANYCLIENT=0x02 AddRef(Ptr($IDispatch)) $dwRegister=0 $r=$IRunningObjectTable.Register( 0, ptr($IDispatch), $IMoniker[2], $dwRegister ) If @error<>0 Then Exit 1 If $dwRegister=0 Then MsgBox(0, "", _WinAPI_GetErrorMessage($r)) Exit 2 EndIf $IMoniker = ObjCreateInterface($IMoniker[2], $IID_IMoniker) AddRef(Ptr($IDispatch)) AddRef(Ptr($IDispatch)) AddRef(Ptr($IDispatch));TODO: look into RunningObjectTable calling IUnknown:Release 3 times if used one or more times, but only once if not used before release @.@ $IMoniker=0 $IRunningObjectTable=0 Opt("GuiOnEventMode", 1) $hWnd=GUICreate("Title",700,320) GUISetState(@SW_SHOW,$hWnd) GUISetOnEvent(-3, "_MyExit", $hWnd) While 1 Sleep(10) WEnd Func _MyExit() Local $IRunningObjectTable = DllCall("Ole32.dll","LONG","GetRunningObjectTable","DWORD",0,"PTR*",0) If @error<>0 Then Exit MsgBox(0, @ScriptLineNumber, @error) $IRunningObjectTable = ObjCreateInterface($IRunningObjectTable[2],$IID_IRunningObjectTable,"Register HRESULT(DWORD;PTR;PTR;DWORD*);Revoke HRESULT(DWORD);IsRunning HRESULT(PTR*);GetObject HRESULT(PTR*;PTR**);NoteChangeTime HRESULT(DWORD;PTR*);GetTimeOfLastChange HRESULT(PTR*;PTR*);EnumRunning HRESULT(PTR*);",True) If @error<>0 Then Exit MsgBox(0, @ScriptLineNumber, @error) $IRunningObjectTable.Revoke($dwRegister) ConsoleWrite("IRunningObjectTable.Revoke"&@CRLF) $IRunningObjectTable=0 $IDispatch=0 Exit EndFunc AutoItObject_Internal.au3 Files to test while the script is running test.vbs com.php Change first parameter in IRunningObjectTable.Register to $ROTFLAGS_REGISTRATIONKEEPSALIVE and the object won't be released from the ROT until IRunningObjectTable.Revoke is called
    1 point
  8. Help file >> _GUICtrlComboBox_GetListArray OR _GUICtrlComboBox_GetList
    1 point
×
×
  • Create New...