Jump to content

Marcelos

Active Members
  • Posts

    29
  • Joined

  • Last visited

About Marcelos

  • Birthday 08/31/1968

Profile Information

  • Location
    Buenos Aires , Argentina
  • Interests
    AutoIT :-)

Recent Profile Visitors

238 profile views

Marcelos's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Hi wanted to share this solution since I count find by goggling it the idea is to access an http folder and enumerate the files Hope it helps #include <Array.au3> $RepoProjectDB="http://acnalert.cloudapp.net/FGM/ProjectRepo" Local $sData = InetRead($RepoProjectDB) Local $nBytesRead = @extended local $files[1] $rawData=BinaryToString($sData) ;filter the fwanted iles $LinesArr=StringRegExp($rawData,">.*\.db</a>",3) for $i=0 to UBound($LinesArr)-1 $startFileName=StringInStr($LinesArr[$i],'href="')+6 $endFileName=StringInStr($LinesArr[$i],'">',0,1,$startFileName) $fileName=StringMid($LinesArr[$i],$startFileName,$endFileName-$startFileName) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $fileName = ' & $fileName & @crlf ) $files[$i]=$fileName redim $files[$i+2] next _ArrayDelete($files,UBound($files)-1) ConsoleWrite( "Total Bytes read: "& $nBytesRead & @CRLF & @CRLF & BinaryToString($sData)) _printfromarray($LinesArr) _printfromarray($files) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _PrintFromArray ; Description ...: Print an array to the console. ; Syntax ........: _PrintFromArray(Const Byref $aArray[, $iBase = Default[, $iUBound = Default[, $sDelimeter = "|"]]]) ; Parameters ....: $aArray - [in/out and const] The array to be written to the file. ; $iBase - [optional] Start array index to read, normally set to 0 or 1. Default is 0. ; $iUBound - [optional] Set to the last record you want to write to the File. Default is whole array. ; $sDelimeter - [optional] Delimiter character(s) for 2-dimension arrays. Default is "|". ; Return values .: Success - 1 ; Failure - 0 and sets @error to non-zero ; |@error: ; |1 - Input is not an array. ; |2 - Array dimension is greater than 2. ; |3 - Start index is greater than the size of the array. ; Author ........: guinness ; Modified ......: ; Remarks .......: ; Related .......: _FileWriteFromArray ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _PrintFromArray(ByRef Const $aArray, $iBase = Default, $iUBound = Default, $sDelimeter = "|") ; Check if we have a valid array as input If Not IsArray($aArray) Then Return SetError(1, 0, 0) ; Check the number of dimensions Local $iDims = UBound($aArray, 0) If $iDims > 2 Then Return SetError(2, 0, 0) ; Determine last entry of the array Local $iLast = UBound($aArray) - 1 If $iUBound = Default Or $iUBound > $iLast Then $iUBound = $iLast If $iBase < 0 Or $iBase = Default Then $iBase = 0 If $iBase > $iUBound Then Return SetError(3, 0, 0) If $sDelimeter = Default Then $sDelimeter = "|" ; Write array data to the console ConsoleWrite("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF) Switch $iDims Case 1 For $i = $iBase To $iUBound ConsoleWrite("[" & $i - $iBase & "] " & $aArray[$i] & @CRLF) Next Case 2 Local $sTemp = "" Local $iCols = UBound($aArray, 2) For $i = $iBase To $iUBound $sTemp = $aArray[$i][0] For $j = 1 To $iCols - 1 $sTemp &= $sDelimeter & $aArray[$i][$j] Next ConsoleWrite("[" & $i - $iBase & "] " & $sTemp & @CRLF) Next EndSwitch ConsoleWrite("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF) Return 1 EndFunc ;==>_PrintFromArray
  2. In my work place they blocked the application movemouse. so y decided to do one by myself , to cheat the system. I have used some peaces of code from another scripts I have, and also I have found in this forum Hope this helps $version="0.2" #include <Misc.au3> If _Singleton(@ScriptName, 1) = 0 Then ; allow only one instance MsgBox(0, "Warning", "An occurence of " & @ScriptName & " is already running") Exit EndIf #region tray icon #NoTrayIcon Opt("TrayIconHide", 0) Opt("TrayMenuMode", 1) TraySetToolTip("Ratoner "& $version) Local $exititem = TrayCreateItem("Exit") TraySetState(1) ; Show the tray menu. #endregion #region variables $BlockScreensaver=1 $flagMouse=1 $MouseNotMovedCounter=0 $posMouseMovedX=0 $posMouseMovedY=0 $Counter= 0 #endregion #region main Local $hTimer = TimerInit() while 1 $Counter=$Counter+1 if $Counter>1000 then CheckifMouseMove() if $MouseNotMovedCounter>2 then moveMouse() $Counter= 0 endif Switch TrayGetMsg() Case $exititem exit EndSwitch sleep(50) wend #endregion #region functions func CheckifMouseMove() ;~ ConsoleWrite("+CheckifMouseMove()" & @crlf) $posMouseMoved = MouseGetPos() if $posMouseMovedX<>$posMouseMoved[0]or $posMouseMovedY <> $posMouseMoved[1] then $posMouseMovedX=$posMouseMoved[0] $posMouseMovedY=$posMouseMoved[1] $MouseNotMovedCounter=0 ;~ ConsoleWrite('>$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf ) Else ;$MouseMoved=0 $MouseNotMovedCounter=$MouseNotMovedCounter+1 ;~ ConsoleWrite('--$MouseNotMovedCounter = ' & $MouseNotMovedCounter & @crlf ) endif EndFunc func moveMouse() ;~ ConsoleWrite("+moveMouse" & @crlf) Local $posMouse = MouseGetPos() $flagMouse=$flagMouse*-1 Local $new_y = $posMouse[1] + $flagMouse ; + (10*$flagMouse) MouseMove($posMouse[0],$new_y) $MouseNotMovedCounter=0 ;~ ConsoleWrite("+mouseMove $MouseNotMovedCounter" & $MouseNotMovedCounter & @crlf) endfunc #endregion
  3. HI long time I was struggling with having folded the functions in scite, since I needed a way to have a tidy view of y code. I use many files to hold functions, variables , forms views , etc. yet when in developing huge applications , I start having too much functions so I decided to write a program to create the .scite.session file I still refining it , but I started the way .... here is the code . I hope you find it useful Dim $filesArray[20] $k=0 $k = $k + 1 $filesArray[$k]="C:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\Main.au3" $k = $k + 1 $filesArray[$k]="C:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\MainProd.au3" $k = $k + 1 $filesArray[$k]="C:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\func_pos.au3" $k = $k + 1 $filesArray[$k]="c:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\controls\controles.au3" $k = $k + 1 $filesArray[$k]="c:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\controls\Functions.au3" $k = $k + 1 $filesArray[$k]="c:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\controls\Func_general.au3" $k = $k + 1 $filesArray[$k]="c:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\controls\Func_WM_NOTIFY.au3" $k = $k + 1 $filesArray[$k]="C:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\controls\Func_WM_COMMAND.au3" $k = $k + 1 $filesArray[$k]="c:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\variables.au3" $k = $k + 1 $filesArray[$k]="C:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\controls\RunFunctions.au3" $k = $k + 1 $filesArray[$k]="C:\Dropbox\Shared\RobertoI@MarceloSaied\FileGodMode\controls\Func_FGMagentconnector.au3" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $k = ' & $k & @crlf ) $sessionFile="ms.session" Local $fileSession = FileOpen($sessionFile, 2) For $i=1 to UBound($filesArray) Local $file = FileOpen( $filesArray[$i], 0) ; Check if file opened for reading OK If $file = -1 Then ConsoleWrite("Unable to open file." & $filesArray[$i]) Exit EndIf $counter=0 $result="" While 1 $counter=$counter+1 Local $line = FileReadLine($file) If @error = -1 Then ExitLoop If (StringInStr($line,"Func ")>0 And StringInStr($line,"EndFunc ")=0) Or StringInStr($line,"Case ")>0 Or StringInStr($line,"#region f-")>0 Or StringInStr($line,"#region f#")>0 Then $result=$result&","&$counter endif WEnd $linea='buffer.'&$i&'.path='& $filesArray[$i] FileWriteLine($fileSession,$linea) $linea='buffer.'&$i&'.folds='& StringTrimLeft($result,1) FileWriteLine($fileSession,$linea) ConsoleWrite('$result = ' & StringTrimLeft($result,1) & @crlf ) FileClose($file) next FileClose($fileSession)
  4. Nice one, ill check this code out , for an alternative to the other clients Thanks!!!
  5. Awesome idea also the use of the hexchat , it is cool. see you there.. ##Autoit
  6. Hi ALD+D is not useful if you have many files, and the consolewrite is in a file that is not the main . when I do ALD+d ( and im using the full SciTE4AutoIt3 version) I get ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hFile= ' & $hFile& @crlf ) the script name is not added, and even if I edit the properties file, to add @‌scriptdir or @ScriptFullPath is the main au3 file that the script runs. correct me if im wrong thanks
  7. HI Satanico64: I have found this workaround . ConsoleWrite(@ScriptDir & '\myfile.au3(' & @ScriptLineNumber & ',1) : WARNING: ' & @crlf )
  8. Thanks, ( took me time to see the difference between AutoIt3Wrapper and Aut2Exe
  9. Hi AdmiralAlkex & Jos I want to autoincrement the fileversion (at #AutoIt3Wrapper_Res_Fileversion) while compiling in commandline with Aut2Exe . this autoincrement , onluy works when compiling with ctrl-f7 #AutoIt3Wrapper_Res_Fileversion=0.3.4.329 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
  10. HI im compiling the "child" components of a script with Aut2Exe V3. I start this , from the ctrl-f7 interface , at the tab "run before/after". I want to autoincrement the fileversion (at #AutoIt3Wrapper ) AutoIt3Wrapper v.2.1.2.9 Environment(Language:0409 Keyboard:0000080A OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) thanks in advance Ex. start c:\myPath\CompilerDEV.cmd ----- the cmd content is c:\pathtoAUT2exe\Aut2exe.exe /In c:\myPath\FGMUpdater.au3 /out c:\myPath\FGMUpdater.exe /icon c:\myPath\Recycle.ico /comp 4 /nopack /gui -------- #AutoIt3Wrapper_Res_Fileversion=0.3.3.193 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
  11. I apologies , if im awaking an old post. but I think this worth share , since I didn't found the answer at goole :-) To test a network share path. I m using this regex test. and I get a 1 if it match. this match if the share pat is like \\server.name\share - server path can have or not dots - share name can be many folders deep - can only contain numbers and letters ( no $) - do not allow a trailing slash consoleWrite("!! " & StringRegExp(StringStripWS(GUICtrlRead($TXT_custsharepath),3) ,'(\A\\{2}[a-zA-Z0-9.]+(\\{1}[a-zA-Z0-9]+)+[a-zA-Z0-9]\z)',0) & @CRLf) StringRegExp($sharePath ,'(\A\\{2}[a-zA-Z0-9.]+(\\{1}[a-zA-Z0-9]+)+[a-zA-Z0-9]\z)') hope you find it useful
  12. OK. i solved the mistery. there is something in the way that SciTE does the Restart (ctrl-alt-F5) that invokes the keys CTRL+Break. since in my computer (Lenovo T430) the break key was eliminated, then the scite restart scrpt dont work :-( thanks all for your interest
  13. still the same behaviour. im checking if i have an application using that hotkesys thanks
  14. Any script. this is not script related. if you tell me that this works for all of you , then something in my computer needs to be done. thanks ex. $file = FileOpen("test.txt", 10) ; which is similar to 2 + 8 (erase + create dir) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileClose($file)
×
×
  • Create New...