Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/27/2016 in all areas

  1. (This example uses a "flash" animation and therefore needs the "flash player" to work. Since "flash player" is discontinued and no longer present on many systems, this script may not work. I have therefore prepared a new script which does not use flash, but is based only on javascript. You can find it in this new post: www.autoitscript.com/forum/topic/206853-aquarium) If you set within a window, a given color as transparent, every area of that window painted with that color, act as an hole through wich you can see what's behind, and click on what's behind as well. What's funny is that if you embed a browser control within that window, the "transparent" color works even within the browser! This allow some interesting effects by simply opening any of the many javascript animations, or css effects or whatever within a browser control embedded into a GUI: Here, for example, is a simple effect of fishes swimming around on the screen. For lazyness I have embedded an ready made swf flash by a link to the web, but is of course possible embed any web page with javascripts css or whatever..... Have fun #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Misc.au3> ; for _IsPressed (23 END key) Local $hDLL = DllOpen("user32.dll"), $oIE = ObjCreate("Shell.Explorer.2") Local $hBackground = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUPWINDOW, $WS_EX_LAYERED + $WS_EX_TOPMOST) Local $AlphaKey = 0xF0F7FF ; everything with color $AlphaKey within this window will be transparent ; even if within an embedded browser control!..... _WinAPI_SetLayeredWindowAttributes($hBackground, $AlphaKey, 0, $LWA_COLORKEY) GUISetState(@SW_SHOW, $hBackground) $hIE = GUICtrlCreateObj($oIE, 0, 0, @DesktopWidth, @DesktopHeight) ; <- embedd $oIE in the AutoIt GUI GUISetBkColor($AlphaKey, $hBackground) ; $AlphaKey $hBackground transparent $oIE.navigate('http://cdn.abowman.com/widgets/fish/fish.swf') ; $oIE.navigate('http://cdn.abowman.com/widgets/spider/spider.swf') ; a spider goes around on the screen .... ; !! to use the spider.swf, you need to set $AlphaKey = 0xffffff on line 7 "! While True If _IsPressed("23", $hDLL) Then ExitLoop ; END key was pressed Sleep(250) WEnd $oIE = "" $hDLL = "" GUIDelete($hBackground)
    1 point
  2. You need to actually read the material on $CmdLine in the help file; you would find most of your own answers. If you do a search on Command Line Parameters, you will find an explanation of how to incorporate these into your script. In the case of the script in your OP, $neid is the first parameter, $neip is the second, $userid is third, and $password if last. So if you create a similar script, when you compile it to an executable you would run it like this: <ExecutableName> /neid /neip /userid /password Example: C:\MyExe.exe /neid1 /neip1 /JLogan3o13 /MyPassword2016! Again, all spelled out for you in the help file. Edit: As for decompiling an executable to retrieve the script, or the username and password, both subjects are off limits on this forum. Please familiarize yourself with the forum rules.
    1 point
  3. From AutoIt help file>GUICreate function>Remarks:- "The size specified is the size of the client area of the window. The border and title bar will make the window slightly larger than specified. Using menu controls will also change the windows height." WinGetPos() returns the outside dimensions of a window. WinGetClientSize() will return the window's client area, as specified in the GUICreate() function.
    1 point
  4. @TheDcoder, You would be happier with an edition in english, which you can buy used and delivered to India for really cheap. For instance: https://www.abebooks.com/book-search/isbn/0201100886/used/ The very first 1977 edition (the [english only] "Green dragon") is significantly outdated, but the next 198x edition ("Red dragon", like mine) is still very valuable for starters albeit I suspect the text in French of my "Red dragon" will be much harder for you to digest. The last edition "Purple dragon" goes deeper and brings advanced techniques to the scene, but it's a much harder reading for starters and the price is at least 10-fold.
    1 point
  5. Thanks, bro! Anyway I'll have a starting point to investigate this even if Udf is outdated. You have my respect =)
    1 point
  6. #include<array.au3> Local $aArray[8] = ["a", "a", "b", "b", "c" , "c" , "c" , "d"] Local $aOut[0][2] for $i = ubound($aArray) - 1 to 0 step -1 $aFound = _ArrayFindAll($aArray , $aArray[$i]) _ArrayAdd($aOut , $aArray[$aFound[0]] & "|" & ubound($aFound) , 0) _ArrayDelete($aArray , _ArrayToString($aFound , ";")) $i -= ubound($aFound) - 1 next _ArrayDisplay($aOut)
    1 point
  7. marko001, It makes life much easier if you explain what you want at the beginning of the thread rather then moving the goalposts as we go along. So you only want to check the first 2 elements and then overwrite any existing matches. Then you need to do a partial search of the existing file. I created 2 files to test - this is the original list: $hFile = FileOpen("List_1.txt", 2) For $i = 1 To 1500 FileWriteLine($hFile, "<z:row First_Name='" & $i & "' Last_Name='" & $i & "' Country =' ' Age=' '") Next FileClose($hFile)and this is the one with changes and one new line at the end: $hFile = FileOpen("List_2.txt", 2) For $i = 1 To 33 FileWriteLine($hFile, "ignore") Next For $i = 1 To 1600 Step 100 FileWriteLine($hFile, "<z:row First_Name='" & $i & "' Last_Name='" & $i & "' Country ='New' Age='New'") Next FileClose($hFile)Then we can use this script to produce a consolidated file where the original names have been updated and the new one added: #include <File.au3> #include <Array.au3> ; Declare the 2 arrays - List_1 is the orginal file, List_2 is the newer one we are checking Global $aFile_1, $aFile_2 ; Read the 2 files into the arrays _FileReadToArray("List_1.txt", $aFile_1) _FileReadToArray("List_2.txt", $aFile_2) ; Create master array to hold result by copying file 1 contents $aFile_Result = $aFile_1 ; Run through the newer For $i = 34 To $aFile_2[0] ; Extract the first elements of the line from the new file $sExtract = StringRegExpReplace($aFile_2[$i], "(?i)(?U).*\x20(.*)\x20country.*\z", "$1") ; Does this extract from the new file exist in the original file $iIndex = _ArraySearch($aFile_1, $sExtract, 0, 0, 0, 1) If @error Then ; Extract does not exist so add to the result _ArrayAdd($aFile_Result, $aFile_2[$i]) $aFile_Result[0] += 1 Else ; Extract exists so we need to overwrite current line $aFile_Result[$iIndex] = $aFile_2[$i] EndIf Next ; Write the new file = second file plus additional entries _FileWriteFromArray("List_Result.txt", $aFile_Result, 1)Are you happy now? M23 P.S. SRER explanation: (?i) - case insensitive (?U) - inverse greediness so we look for the smallest matches .*\x20 - any number of chars followed by a space (this reads the "<z:row " part before the bit we want) (.*) - capture the characters (the bit we want) up to... \x20country.*\z - a space followed by "country" and any other characters to the end of the line (this reads everything after the bit we want) $1 - use the first captured group - we only have one in this case
    1 point
  8. marko001, I would read the files into arrays and then deal with it in memory. I created a 1500-line file with this code: $hFile = FileOpen("List_1.txt", 1) For $i = 1 To 1500 FileWriteLine($hFile, "<z:row First_Name='" & $i & "' Last_Name='" & $i & "' Country =' ' Age=' '") Next FileClose($hFile) I copied it to a second file and deleted a few lines to force some errors. Then I ran this code to compare the two files: #include <File.au3> #include <Array.au3> ; Declare the 2 arrays Global $aFile_1, $aFile_2 ; Start a timer $iBegin = TimerInit() ; Read the 2 files into the arrays _FileReadToArray("List_1.txt", $aFile_1) _FileReadToArray("List_2.txt", $aFile_2) ; For the lines you want For $i = 35 To $aFile_1[0] - 2 ; Does this line in the forst file exist in the second _ArraySearch($aFile_2, $aFile_1[$i]) If @error Then ; If not then add to the second _ArrayAdd($aFile_2, $aFile_1[$i]) $aFile_2[0] += 1 EndIf Next ; Write the new file = second file plus additional entries _FileWriteFromArray("List_Combined.txt", $aFile_2, 1) ; Display the time ConsoleWrite("Time taken = " & Round(TimerDiff($iBegin) / 1000, 2) & " secs" & @CRLF) Takes less than 3 secs for it to check the 1500 lines and the final file has all the missing entries added. Will that do? M23
    1 point
×
×
  • Create New...