Jump to content

ghetek

Active Members
  • Posts

    107
  • Joined

  • Last visited

Everything posted by ghetek

  1. Hi everybody! Apache Solr is an awesome search server that allows you to search through petabytes of data in milliseconds. It is used by many large organizations. It's kind of like MySQL with search in mind. If you would like to get started, download Apache Solr and run the example command, "bin/solr start -e techproducts" Now the example in the UDF should work. I am looking for any advice at all before I post this into the examples area. here is a walkthrough of what is happening in the example Func Example() Local $sHost = '127.0.0.1', $sPort = 8983, $sContainer = 'techproducts', $sWow64 = "" If @AutoItX64 Then $sWow64 = "\Wow6432Node" Local $dir_autoit = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt", "InstallDir") Local $st_URL = 'http://' & $sHost & ':' & $sPort & '/solr/' & $sContainer ;First lets see if its running, start if it is not If _solr_Webping($st_URL) = -1 Then _solr_cmdstart($SOLR_HOME, $sContainer) ;Enable stream overlay so that we can send commands via URL _solr_enablestreamoverlay($st_URL) ;delete the example data _solr_Webdelall($st_URL, True) ;Lets define some values for a document Local $aPairs[5][2] = [ _ [4, Default], _ ['literal.id', 5], _ ['literal.value_s', 'anything'], _ ['literal.resourcename', 'API Errors Constants'], _ ['literal.indextime_dt',_solr_tnow()]] ;now package up the document with the values _Solr_uploadPkg($dir_autoit & '\Include\APIErrorsConstants.au3', $st_URL, $aPairs, Null, 'commit=true&overrideLiterals=true') ;whoops, lets make a change to a single field _solr_Webupdate($st_URL, '[{"id":"' & 5 & '","value_s" : {"set":"something"}}]') ;and commit that change _solr_Webcommit($st_URL) ;we can also upload files from the SimplePostTool _solr_jarpost($SOLR_HOME & '\example\exampledocs\post.jar', $sContainer, $dir_autoit & '\Include\GuiListView.au3', 'literal.id=6&literal.cat=Help Files&commit=true') ;now we can query for something Local $qry_response = _solr_Webselect($st_URL, 'q=$ERROR_VOLSNAP_PREPARE_HIBERNATE') Local $json_response = Json_Encode($qry_response) json_dump($json_response) ConsoleWrite(json_get($qry_response, '.response.docs[0].content[0]') & @CRLF) EndFunc ;==>Example Thank you for your time! solr.au3 Json.au3 BinaryCall.au3
  2. You may want to look into compatibility shims for your autoit projects http://technet.microsoft.com/en-us/library/dd837644%28WS.10%29.aspx
  3. Hey guys, I am trying to automate the process of connecting to the Tor network. Currently they do use a nice GUI called Vidalia but I want to customize and simplify the process. Currently I am working with 2 executables, tor.exe and polipo.exe. Tor was super easy to tap into, just a stdoutread. Unfortunately Polipo would not give anything on the out stream and I had to use StdErr. The problem For some reason, while tor easily goes from stream to console, I only get output from Polipo after it has closed. The StdErr stream returns nothing while the application is open and then spits out everything as soon as it closes. has anybody else run into this problem when reading from a console? I have attached my current script but it is still in its infancy stages. #include <File.au3> #include <Constants.au3> OnAutoItExitRegister("ToolCleanup") Global $ConnectionState = 0 Global $Hnd_Tor, $Hnd_Polipo, _ $TorConsole, $PolipoConsole, _ $Dir_Tor = @ScriptDir & "\Tor", _ $DirPolipo = @ScriptDir & "\Polipo", _ $Exe_Tor = $Dir_Tor & "\tor.exe", _ $Conf_Tor = $Dir_Tor & "\torrc", _ $Exe_Polipo = $DirPolipo & "\polipo.exe", _ $Conf_Polipo = $DirPolipo & "\polipo.conf" TorConfig($Conf_Tor) While 1 Switch $ConnectionState Case 0 $Hnd_Tor = RunTor($Exe_Tor, $Conf_Tor) If $Hnd_Tor <> 0 Then $ConnectionState = 1 ConsoleWrite("Connection State 1 (Tor PID:" & $Hnd_Tor & ")" & @CRLF) EndIf Case 1 If StringInStr($TorConsole, "Bootstrapped 100%", 2) Then $Hnd_Polipo = RunPolipo($Exe_Polipo, $Conf_Polipo) If $Hnd_Polipo <> 0 Then $ConnectionState = 2 ConsoleWrite("Connection State 2 (Polipo PID:" & $Hnd_Polipo & ")" & @CRLF) EndIf EndIf EndSwitch $PolipoConsole = StdErrRead($Hnd_Polipo) $TorConsole = StdoutRead($Hnd_Tor) ConsoleWrite($TorConsole) ConsoleWrite($PolipoConsole) WEnd Func RunTor($Exe, $Conf) Do ProcessClose("tor.exe") Until ProcessExists("Tor.exe") = 0 $hTor = Run('"' & $Exe_Tor & '" -f "' & $Conf_Tor & '"', "", @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) Return $hTor EndFunc ;==>RunTor Func TorConfig($Conf) Local $aTorConf _FileReadToArray($Conf, $aTorConf) For $i = 1 To $aTorConf[0] If StringInStr($aTorConf[$i], "DataDirectory", 2) = 1 Then $aTorConf[$i] = "DataDirectory " & @ScriptDir & "\Tor\data" EndIf Next _FileWriteFromArray($Conf, $aTorConf, 1) EndFunc ;==>TorConfig Func RunPolipo($Exe_Polipo, $Conf_Polipo) Do ProcessClose("polipo.exe") Until ProcessExists("polipo.exe") = 0 $hPolipo = Run('"' & $Exe_Polipo & '" -c "' & $Conf_Polipo & '" ', "", @SW_SHOW, $STDIN_CHILD + $STDERR_CHILD) Return $hPolipo EndFunc ;==>RunPolipo Func ToolCleanup() Do ProcessClose("polipo.exe") Until ProcessExists("polipo.exe") = 0 Do ProcessClose("tor.exe") Until ProcessExists("Tor.exe") = 0 EndFunc ;==>ToolCleanup Here is a link to someone else with this issue (unresolved)
  4. Hey, I made a modification to your UDF. I wanted to get around using a sleep in my script so I added a timer. I have heard that people really hate timers but I hope this is a welcome change. Here is a sample script: #include <SLG.au3> Opt('GuiOnEventMode', 1) $GUI = GUICreate("GDI+ Scrolling Line Graph", 628, 297, -1, -1, -1, $WS_EX_TOPMOST) GUISetOnEvent(-3, '_Exit') GUISetState() $Increments = 100 $Graph1 = _SLG_CreateGraph($GUI, 18, 18, 596, 257, -100, 100, $Increments, -1, -1, -1, True) _SLG_SetGridLineColor($Graph1, 0xFF5C5C5C) While 1 $MemStats = MemGetStats() _SLG_SetLineValue($Graph1, $MemStats[0]) _SLG_UpdateGraph($Graph1) WEnd Func _Exit() Exit EndFunc ;==>_Exit Here is the UDF: #Region Header ; #INDEX# ======================================================================================================================= ; Title .........: SLG ; AutoIt Version : 3.3.4.0 ; Language ......: English ; Description ...: Functions to assist in creating and updating Scrolling Line Graphs ; Author(s) .....: Beege ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_SLG_CreateGraph ;_SLG_UpdateGraph ;_SLG_ClearGraph ;_SLG_SetLineColor ;_SLG_SetYRange ;_SLG_SetBackGroundColor ;_SLG_AddLine ;_SLG_SetLineValue ;_SLG_SetLineWidth ;_SLG_EnableGridLines ;_SLG_SetGridLineColor ; =============================================================================================================================== #Region User KeyWords and CallTips #cs Keywords: au3.keywords.user.udfs= _slg_creategraph _slg_updategraph _slg_cleargraph \ _slg_setlinecolor _slg_setyrange _slg_setbackgroundcolor _slg_addline \ _slg_setlinevalue _slg_setlinewidth _slg_enablegridlines _slg_setgridlinecolor CallTips: _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrements, $Line_Color = 0xFF00FF00, $Line_Width = 2, $iBackGround = 0xFF000000, $bGridlines = True) _SLG_UpdateGraph($iIndex) _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 2) _SLG_ClearGraph($iIndex) _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) _SLG_SetLineColor($iIndex, $iARGB, $iLine = 1) _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) _SLG_SetGridLineColor($iIndex, $iARGB = Default) _SLG_EnableGridLines($iIndex, $bGridlines = True) #ce #EndRegion User KeyWords and CallTips #include-once #include <GDIPlus.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() OnAutoItExitRegister('_SLG_Exit') #EndRegion Header #Region Global Variables and Constants Global Enum $g_hGraphic, $g_hBitmap, $g_hBuffer, $g_aPens, $g_iLeft, $g_iTop, $g_iWidth, $g_iHeight, $g_iIncrements, _ $g_iIncrement_Size, $g_iShift_Distance, $g_iY, $g_iY_Last, $g_iY_Min, $g_iY_Max, $g_iY_Range, $g_hDC, $g_hGUI, $g_iBackColor, _ $g_iX_counter, $g_iY_counter, $g_iX_counter_mem, $g_bGridlines, $g_iGridColor, $MAX Global $aGraphs[1][$MAX], $g_GraphSpeed_Counter, $g_GraphSpeedDef = 30 $aGraphs[0][0] = 0 #cs $aGraphs[0][0] = List Count [0][1-17] = Nothing $aGraphs[$i][0] = $Graphic Object Handle [$i][$g_hBitmap] = Bitmap Object Handle [$i][$g_hBuffer] = Buffer Handle [$i][$g_iLeft] = Left [$i][$g_iTop] = Top [$i][$g_iWidth] = Width [$i][$g_iHeight] = Height [$i][$g_iIncrements] = Step Count [$i][$g_iIncrement_Size]= Step Size [$i][$g_iShift_Distance]= Shift Distance [$i][$g_iY_Min] = Y Min [$i][$g_iY_Max] = Y Max [$i][$g_iY_Range] = Y Range [$i][$g_hDC] = Display device context Handle [$i][$g_hGUI] = GUI Handle [$i][$g_iBackColor] = BackGround Color value [$i][$g_iY_Last] = Array containing Last Y Cordnate for each Line [$i][$g_iY] = Array containing Y Cordnate for each Line [$i][$g_aPens] = Array containing Pen Handles for each Line [$i][$g_bGridlines] = Draw GridLines flag [$i][$g_iGridColor] = GridLines Color Value [$i][$g_iX_counter] = Counter for X GridLines [$i][$g_iY_counter] = Counter for Y GridLines [$i][$g_iX_counter_mem] = Original Counter Value #ce #EndRegion Global Variables and Constants #Region Public Functions ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_CreateGraph ; Description ...: Creates a Scrolling Line Graph ; Syntax.........: _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrement_Total, $Line_Color = 0xFF00FF00, $iBackGround = 0xFF000000) ; Parameters ....: $hGUI - Handle to parent or owner window ; $iLeft - Left side of the graph ; $iTop - Top side of the graph ; $iWidth - Width of the graph ; $iHeight - Height of the graph ; $iY_Min - Minimum Y Value ; $iY_Max - Maximum Y Value ; $iIncrements - How many parts the Graph is divided up into. More Parts means more history.. ; $Line_Color - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Green ; $iLine_Width - Line Width. Default = 1 ; $iBackGround - BackGround Color. Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Black ; $bGridlines - Enable Gridlines. Default = True ; Return values .: Success - Graph Index ; Author ........: Beege ; Remarks .......: Line index of line created is 1. ; =============================================================================================================================== Func _SLG_CreateGraph($hGUI, $iLeft, $iTop, $iWidth, $iHeight, $iY_Min, $iY_Max, $iIncrements, $Line_Color = 0xFF00FF00, $iLine_Width = 2, $iBackGround = 0xFF000000, $bGridlines = True) ReDim $aGraphs[UBound($aGraphs) + 1][UBound($aGraphs, 2)] $aGraphs[0][0] += 1 If $Line_Color = -1 Or $Line_Color = Default Then $Line_Color = 0xFF00FF00 If $iBackGround = -1 Or $iBackGround = Default Then $iBackGround = 0xFF000000 If $iLine_Width = -1 Or $iLine_Width = Default Then $iLine_Width = 2 If $bGridlines = -1 Or $bGridlines = Default Then $bGridlines = True $aGraphs[$aGraphs[0][0]][$g_hGraphic] = _GDIPlus_GraphicsCreateFromHWND($hGUI) $aGraphs[$aGraphs[0][0]][$g_hBitmap] = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $aGraphs[$aGraphs[0][0]][$g_hGraphic]) $aGraphs[$aGraphs[0][0]][$g_hBuffer] = _GDIPlus_ImageGetGraphicsContext($aGraphs[$aGraphs[0][0]][$g_hBitmap]) $aGraphs[$aGraphs[0][0]][$g_iLeft] = $iLeft $aGraphs[$aGraphs[0][0]][$g_iTop] = $iTop $aGraphs[$aGraphs[0][0]][$g_iWidth] = $iWidth $aGraphs[$aGraphs[0][0]][$g_iHeight] = $iHeight $aGraphs[$aGraphs[0][0]][$g_iIncrements] = $iIncrements $aGraphs[$aGraphs[0][0]][$g_iIncrement_Size] = Int($iWidth / $iIncrements) $aGraphs[$aGraphs[0][0]][$g_iShift_Distance] = $iWidth - $aGraphs[$aGraphs[0][0]][$g_iIncrement_Size] _SLG_AddLine($aGraphs[0][0], $Line_Color, $iLine_Width) $aGraphs[$aGraphs[0][0]][$g_iY_Min] = $iY_Min $aGraphs[$aGraphs[0][0]][$g_iY_Max] = $iY_Max _SLG_SetYRange($aGraphs[0][0], $iY_Min, $iY_Max) $aGraphs[$aGraphs[0][0]][$g_hDC] = _WinAPI_GetDC($hGUI) $aGraphs[$aGraphs[0][0]][$g_hGUI] = $hGUI _SLG_SetBackGroundColor($aGraphs[0][0], BitOR($iBackGround, 0xFF000000)) $aGraphs[$aGraphs[0][0]][$g_bGridlines] = $bGridlines $aGraphs[$aGraphs[0][0]][$g_iX_counter] = 20;$iX_c $aGraphs[$aGraphs[0][0]][$g_iX_counter_mem] = 20;$iX_c $aGraphs[$aGraphs[0][0]][$g_iY_counter] = 20;$iY_c $aGraphs[$aGraphs[0][0]][$g_iGridColor] = Default _GDIPlus_GraphicsSetSmoothingMode($aGraphs[$aGraphs[0][0]][$g_hBuffer], 2) _GDIPlus_GraphicsClear($aGraphs[$aGraphs[0][0]][$g_hBuffer], $aGraphs[$aGraphs[0][0]][$g_iBackColor]); If $bGridlines Then _FullGridLines($aGraphs[0][0]) Return $aGraphs[0][0] EndFunc ;==>_SLG_CreateGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_UpdateGraph ; Description ...: Updates Line Graph with new values ; Syntax.........: _SLG_UpdateGraph($iIndex, $iValue) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All Lines of the graph must be updated before calling this function. ; =============================================================================================================================== Func _SLG_UpdateGraph($iIndex) If $g_GraphSpeed_Counter = "" Then $g_GraphSpeed_Counter = TimerInit() If TimerDiff($g_GraphSpeed_Counter) > $g_GraphSpeedDef Then $g_GraphSpeed_Counter = "" If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aLineY = $aGraphs[$iIndex][$g_iY] For $i = 1 To $aLineY[0] If Not $aLineY[$i] Then Return Next Local $hShift_Section = _GDIPlus_BitmapCloneArea($aGraphs[$iIndex][$g_hBitmap], $aGraphs[$iIndex][$g_iIncrement_Size], 0, $aGraphs[$iIndex][$g_iShift_Distance], $aGraphs[$iIndex][$g_iHeight]); _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); _GDIPlus_GraphicsDrawImageRect($aGraphs[$iIndex][$g_hBuffer], $hShift_Section, 0, 0, $aGraphs[$iIndex][$g_iShift_Distance], $aGraphs[$iIndex][$g_iHeight]) If $aGraphs[$iIndex][$g_bGridlines] Then _AddGridLines($iIndex) Local $aLineYLast = $aGraphs[$iIndex][$g_iY_Last] Local $aPens = $aGraphs[$iIndex][$g_aPens] For $i = 1 To $aLineYLast[0] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iShift_Distance] - 1, $aLineYLast[$i], $aGraphs[$iIndex][$g_iWidth] - 1, $aLineY[$i], $aPens[$i]) Next _WriteBuffer($iIndex) _GDIPlus_BitmapDispose($hShift_Section) For $i = 1 To $aLineY[0] $aLineYLast[$i] = $aLineY[$i] Next $aGraphs[$iIndex][$g_iY_Last] = $aLineYLast Return 1 Else Return 0 EndIf EndFunc ;==>_SLG_UpdateGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineValue ; Description ...: Sets Line value ; Syntax.........: _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Value to add to graph ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineValue($iIndex, $iValue, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $iValue > $aGraphs[$iIndex][$g_iY_Max] Then $iValue = $aGraphs[$iIndex][$g_iY_Max] ElseIf $iValue < $aGraphs[$iIndex][$g_iY_Min] Then $iValue = $aGraphs[$iIndex][$g_iY_Min] EndIf Local $Percent = Abs($iValue - $aGraphs[$iIndex][$g_iY_Min]) / $aGraphs[$iIndex][$g_iY_Range] If $Percent > .992 Then $Percent = .992 Local $iY = Int($aGraphs[$iIndex][$g_iHeight] - ($Percent * $aGraphs[$iIndex][$g_iHeight])) Local $aLineYLast = $aGraphs[$iIndex][$g_iY_Last] If Not $aLineYLast[$iLine] Then $aLineYLast[$iLine] = $iY $aGraphs[$iIndex][$g_iY_Last] = $aLineYLast Return 0 Else Local $aLineY = $aGraphs[$iIndex][$g_iY] $aLineY[$iLine] = $iY $aGraphs[$iIndex][$g_iY] = $aLineY Return 1 EndIf EndFunc ;==>_SLG_SetLineValue ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_AddLine ; Description ...: Adds additional lines to the graph ; Syntax.........: _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iLine_Color - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB) ; $Line_Width - Line Width ; Return values .: Success - Line Index ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: Every line must have its value set before you can call _SLG_UpdateGraph() ; =============================================================================================================================== Func _SLG_AddLine($iIndex, $Line_Color = 0xFF00FF00, $Line_Width = 2) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $Line_Color = -1 Or $Line_Color = Default Then $Line_Color = 0xFF00FF00 If $Line_Width = -1 Or $Line_Width = Default Then $Line_Width = 1 Local $aLinesY = $aGraphs[$iIndex][$g_iY] Local $aLinesYLast = $aGraphs[$iIndex][$g_iY_Last] Local $aPens = $aGraphs[$iIndex][$g_aPens] If Not IsArray($aLinesYLast) Then Local $aLinesY[1] = [0] Local $aLinesYLast[1] = [0] Local $aPens[1] = [0] EndIf ReDim $aLinesYLast[UBound($aLinesYLast) + 1] ReDim $aLinesY[UBound($aLinesY) + 1] ReDim $aPens[UBound($aPens) + 1] $aLinesYLast[0] += 1 $aLinesY[0] += 1 $aPens[0] += 1 $aLinesYLast[$aLinesYLast[0]] = False $aLinesY[$aLinesY[0]] = False $aPens[$aPens[0]] = _GDIPlus_PenCreate($Line_Color, $Line_Width) $aGraphs[$iIndex][$g_iY_Last] = $aLinesYLast $aGraphs[$iIndex][$g_iY] = $aLinesY $aGraphs[$iIndex][$g_aPens] = $aPens Return $aLinesY[0] EndFunc ;==>_SLG_AddLine ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineColor ; Description ...: Sets Line Color of Graph ; Syntax.........: _SLG_SetLineColor($iIndex, $iARGB) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB) ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid iLine ; - 3 Error setting pen color ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineColor($iIndex, $iARGB, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] If $iLine > $aPens[0] Then Return SetError(2, @extended, 0) _GDIPlus_PenSetColor($aPens[$iLine], $iARGB) If @error Then Return SetError(3, @extended, 0) Return 1 EndFunc ;==>_SLG_SetLineColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetLineWidth ; Description ...: Sets Line Width ; Syntax.........: _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iValue - Width of Line ; $iLine - Line index returned from _SLG_AddLine() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid iLine index ; - 3 Error setting pen width ; Author ........: Beege ; Remarks .......: If your graph only has 1 line then the line index is 1 ; =============================================================================================================================== Func _SLG_SetLineWidth($iIndex, $iWidth, $iLine = 1) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] If $iLine > $aPens[0] Then Return SetError(2, @extended, 0) Local $aPens = $aGraphs[$iIndex][$g_aPens] _GDIPlus_PenSetWidth($aPens[$iLine], $iWidth) If @error Then Return SetError(3, @extended, 0) Return 1 EndFunc ;==>_SLG_SetLineWidth ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_ClearGraph ; Description ...: Clears all data from Graph ; Syntax.........: _SLG_ClearGraph($iIndex) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: none ; =============================================================================================================================== Func _SLG_ClearGraph($iIndex) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); If $aGraphs[$iIndex][$g_bGridlines] Then _FullGridLines($iIndex) _WriteBuffer($iIndex) Return 1 EndFunc ;==>_SLG_ClearGraph ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetYRange ; Description ...: Sets the Minimum and Maximum Y Values ; Syntax.........: _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iY_Min - Minimum Y Value ; $iY_Max - Maximum Y Value ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: User should most likly want to ClearGraph after changing Y Range ; =============================================================================================================================== Func _SLG_SetYRange($iIndex, $iY_Min, $iY_Max) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iY_Min] = $iY_Min $aGraphs[$iIndex][$g_iY_Max] = $iY_Max $aGraphs[$iIndex][$g_iY_Range] = Abs($iY_Max - $iY_Min) Return 1 EndFunc ;==>_SLG_SetYRange ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetBackGroundColor ; Description ...: Sets Graph BackGround Color ; Syntax.........: _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iARGB - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Black ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All previous data will be cleared ; =============================================================================================================================== Func _SLG_SetBackGroundColor($iIndex, $iARGB = 0xFF000000) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iBackColor] = $iARGB _SLG_ClearGraph($iIndex) Return 1 EndFunc ;==>_SLG_SetBackGroundColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_SetGridLineColor($iIndex) ; Description ...: Sets Graph GridLines Color Value ; Syntax.........: _SLG_SetGridLineColor($iIndex, $iARGB = Default) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $iARGB - Alpha, Red, Green and Blue Hex Value. (0xAARRGGBB). Default = Invert of Background Color. ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; Author ........: Beege ; Remarks .......: All previous data will be cleared ; =============================================================================================================================== Func _SLG_SetGridLineColor($iIndex, $iARGB = Default) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) $aGraphs[$iIndex][$g_iGridColor] = $iARGB _SLG_ClearGraph($iIndex) Return 1 EndFunc ;==>_SLG_SetGridLineColor ; #FUNCTION# ==================================================================================================================== ; Name...........: _SLG_EnableGridLines ; Description ...: Enables or Disables Drawing of Gridlines for Graph ; Syntax.........: _SLG_EnableGridLines($iIndex, $bGridlines = True) ; Parameters ....: $iIndex - Index returned from _SLG_CreateGraph() ; $bGridlines - GridLines flag: ; |True - GridLines will be drawn ; |False - GridLines will not be drawn ; Return values .: Success - 1 ; Failure - 0 and sets @ERROR: ; - 1 Invalid iIndex ; - 2 Invalid $bGridlines Value ; Author ........: Beege ; Remarks .......: none ; =============================================================================================================================== Func _SLG_EnableGridLines($iIndex, $bGridlines = True) If $iIndex > $aGraphs[0][0] Then Return SetError(1, @extended, 0) If $bGridlines <> True And $bGridlines <> False Then SetError(2, @extended, 0) $aGraphs[$iIndex][$g_bGridlines] = $bGridlines Return 1 EndFunc ;==>_SLG_EnableGridLines #EndRegion Public Functions #Region Internel Functions ; #FUNCTION# ==================================================================================================================== ; Author ........: UEZ ; Modified ......: Beege ; =============================================================================================================================== Func _AddGridLines($iIndex) Local $iGridlineColor = $aGraphs[$iIndex][$g_iGridColor] If $iGridlineColor = Default Or $iGridlineColor = -1 Then $iGridlineColor = BitOR(0xFF000000, (0xFFFFFFFF - $aGraphs[$iIndex][$g_iBackColor]));Invert Background RGB Local $iY1, $hPen = _GDIPlus_PenCreate($iGridlineColor) For $iY1 = 0 To $aGraphs[$iIndex][$g_iHeight] Step $aGraphs[$iIndex][$g_iY_counter] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iShift_Distance] - 1, $iY1, $aGraphs[$iIndex][$g_iWidth], $iY1, $hPen) Next If $aGraphs[$iIndex][$g_iX_counter] <= 0 Then _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iWidth] - 1, 0, $aGraphs[$iIndex][$g_iWidth] - 1, $aGraphs[$iIndex][$g_iHeight], $hPen) $aGraphs[$iIndex][$g_iX_counter] = $aGraphs[$iIndex][$g_iX_counter_mem] EndIf $aGraphs[$iIndex][$g_iX_counter] -= $aGraphs[$iIndex][$g_iIncrement_Size] _GDIPlus_PenDispose($hPen) EndFunc ;==>_AddGridLines Func _FullGridLines($iIndex) Local $iGridlineColor = $aGraphs[$iIndex][$g_iGridColor] If $iGridlineColor = Default Or $iGridlineColor = -1 Then $iGridlineColor = BitOR(0xFF000000, (0xFFFFFFFF - $aGraphs[$iIndex][$g_iBackColor]));Invert Background RGB Local $iY1, $hPen = _GDIPlus_PenCreate($iGridlineColor) Local $hShift_Section = _GDIPlus_BitmapCloneArea($aGraphs[$iIndex][$g_hBitmap], 0, 0, $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight]); _GDIPlus_GraphicsClear($aGraphs[$iIndex][$g_hBuffer], $aGraphs[$iIndex][$g_iBackColor]); _GDIPlus_GraphicsDrawImageRect($aGraphs[$iIndex][$g_hBuffer], $hShift_Section, 0, 0, $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight]) For $iY1 = 0 To $aGraphs[$iIndex][$g_iHeight] Step $aGraphs[$iIndex][$g_iY_counter] _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], 0, $iY1, $aGraphs[$iIndex][$g_iWidth], $iY1, $hPen) Next For $iX = 0 To $aGraphs[$iIndex][$g_iWidth] Step $aGraphs[$iIndex][$g_iIncrement_Size] If $aGraphs[$iIndex][$g_iX_counter] <= 0 Then _GDIPlus_GraphicsDrawLine($aGraphs[$iIndex][$g_hBuffer], $iX, 0, $iX, $aGraphs[$iIndex][$g_iHeight], $hPen) $aGraphs[$iIndex][$g_iX_counter] = $aGraphs[$iIndex][$g_iX_counter_mem] EndIf $aGraphs[$iIndex][$g_iX_counter] -= $aGraphs[$iIndex][$g_iIncrement_Size] Next _WriteBuffer($iIndex) _GDIPlus_BitmapDispose($hShift_Section) _GDIPlus_PenDispose($hPen) EndFunc ;==>_FullGridLines Func _WriteBuffer($iIndex) Local $hGDI_HBitmap, $hDC $hGDI_HBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aGraphs[$iIndex][$g_hBitmap]) $hDC = _WinAPI_CreateCompatibleDC($aGraphs[$iIndex][$g_hDC]) _WinAPI_SelectObject($hDC, $hGDI_HBitmap) _WinAPI_BitBlt($aGraphs[$iIndex][$g_hDC], $aGraphs[$iIndex][$g_iLeft], $aGraphs[$iIndex][$g_iTop], $aGraphs[$iIndex][$g_iWidth], $aGraphs[$iIndex][$g_iHeight], $hDC, 0, 0, $SRCCOPY) _WinAPI_DeleteObject($hGDI_HBitmap) _WinAPI_DeleteDC($hDC) EndFunc ;==>_WriteBuffer Func _SLG_Exit() Local $i, $j, $aPens If $aGraphs[0][0] Then For $i = 1 To $aGraphs[0][0] _GDIPlus_GraphicsDispose($aGraphs[$i][$g_hBuffer]) _GDIPlus_BitmapDispose($aGraphs[$i][$g_hBitmap]) _GDIPlus_GraphicsDispose($aGraphs[$i][$g_hGraphic]) $aPens = $aGraphs[$i][$g_aPens] For $j = 1 To $aPens[0] _GDIPlus_PenDispose($aPens[$j]) Next _WinAPI_ReleaseDC($aGraphs[$i][$g_hGUI], $aGraphs[$i][$g_hDC]) Next EndIf _GDIPlus_Shutdown() EndFunc ;==>_SLG_Exit #EndRegion Internel Functions BTW love SLG. It was good enough to #Include <"SLG.au3">
  5. Just found this today. great project! i hope you are still developing this.
  6. I am trying to create a simple code to create a symbolic link. I would like to utilize the Microsoft function within their kernel32.dll library. from what i understand there are only 3 parameters necessary, Symlink, Target, and the "dwflags". It looks like the dwflag is just a 0 or 1 that denotes a file or a directory (respectively) for the linking. Here is my code snippet so far: Func CreatePortalDLL($Entrance, $Exit) $result = DllCall("kernel32.dll", "int", "CreateSymbolicLink", "str", $Entrance, "str", $Exit, "int", 1) ConsoleWrite($result & @CRLF) EndFunc ;==>CreatePortalDLL Here is an example from microsoft in C#: [DllImport("kernel32.dll", EntryPoint="CreateSymbolicLinkW", CharSet=CharSet.Unicode)] public static extern int CreateSymbolicLink([In] string lpSymlinkFileName, [In] string lpTargetFileName, int dwFlags); Everytime that I run this I just get back a 0 as a result and there is no symbolic link created. Any ideas? Thanks in advance AutoIT community!
  7. ugh, should have read that... sry
  8. Hey guys, I am trying to create a resizeable graph on a GUI. This works but there must be a better way, right? Any help would be greatly appreciated. #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $hGUI, $sGUI_Title = 'Test Resizer', $hGraphic, $hPen, _ $sGUI_Width = 600, $sGUI_Height = 600, _ $hGUI = GUICreate($sGUI_Title, $sGUI_Width, $sGUI_Height, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) _GDIPlus_Startup() GUISetState() _DrawGraph() While 1 Switch GUIGetMsg() Case $GUI_EVENT_RESIZED $sGUI_Width = _WinAPI_GetWindowWidth($hGUI) $sGUI_Height = _WinAPI_GetWindowHeight($hGUI) ConsoleWrite('RESIZE Width:' & $sGUI_Width & ' Height:' & $sGUI_Height & @CRLF) _DrawGraph($sGUI_Width, $sGUI_Height) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd _GDIPlus_Shutdown() Func _DrawGraph($width = $sGUI_Width, $height = $sGUI_Height) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPen = _GDIPlus_PenCreate() ;Draw graph $width = $width - 50 ; just some padding $height = $height - 90 ; just some padding _GDIPlus_GraphicsDrawLine($hGraphic, 10, Int($height/2), $width + 10, Int($height/2), $hPen) _GDIPlus_GraphicsDrawLine($hGraphic, Int($width/2), 10, Int($width/2), $height + 10, $hPen) _GDIPlus_GraphicsDrawRect($hGraphic, 10, 10, $width, $height, $hPen) ; Clean up resources _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) EndFunc ;==>_DrawGraph
  9. Zibit, the script is well written but I do suggest that you do a little research on IP addressing standards and CIDR notation. Don't let the AutoIT elitists (jerks) get you down. Most of us are scripters here and we are all still learning every day. Thanks for posting and I hope to see more from you in the future. To the rude posts before me, regardless of the usability of the content, is this how you treat people who only want to share and expand the community? I am appalled.
  10. i think you are looking for the support area.
  11. sorry for being vague! i finally found what i was looking for. Thanks!
  12. hi everybody! I created a script and sent it over to a friend. it worked fine on my system but for some reason its throwing an error on their system: AutoIT Error Line -1: Error: Variable used without being declared The error is just too vague. i tried searching around in the example section but i couldnt find what i was looking for. Does anybody know of a good debuggin tool that i can include in teh script itself to generate more useful error reports? I remember seeing one here on the forums a while back with a really nice GUI and even gave line numbers to find the error. thanks in advance.
  13. this link isnt working for me. do you have the example up anywhere else?
  14. Hey guys! I was sitting in bed with my girlfriend and going over chocolates that we have tried and liked from CocoBella. Naturally I decided to record our notes in INI form because it seemed convenient at the time: Chocolate Notes.txt [tried and disliked] Vietnamese Cinnamon=Christopher Elbow Ginger Heart=Recchiuti [Tried and liked] Rasberry=Christopher Elbow Nougatelle=Michel Cluizel Peanut Brittle=Christopher Elbow Key Lime=Norman Love Cookies and Cream=Normal Love Peanut Butter and Jelly=Norman Love Venezuela Dark=Christopher Elbow [Want to try] Palet Frambois=Michel Cluizel Mint Chocolate Chip=Norman Love Rasberry Praline=Läderach Tiramisu Truffle=Mary Chocolatier New York Cheesecake=Norman Love Passionfruit Truffle=Läderach Strawberry Cup=Parlineur Van Coillie Coco Bello Praline=Läderach Vanilla Cupcake=Norman Love Rose Caramel=Recchiuti White Truffle=Läderach Champignon=Marquis De Sevigne Yuzu=Oriol Balaguer Soon I decided that I need to have a pretty GUI to look at. I hated the idea of making a static number of tabs so I came up with this: TabsByINI.au3 #include <GUIConstantsEx.au3> ;Opt('MustDeclareVars', 1) Dim $db = @ScriptDir & "\Chocolate Notes.txt" Dim $Sections = IniReadSectionNames($db) Local $TabItem[$Sections[0] + 1], $TabMenu, $msg GUICreate("INI by Tabs", 750, 650); will create a dialog box that when displayed is centered GUISetFont(9, 300) $TabMenu = GUICtrlCreateTab(10, 10, 735, 635) For $i = 1 To $Sections[0] $SectionContents = IniReadSection($db, $Sections[$i]) $TabItem[$i] = GUICtrlCreateTabItem($Sections[$i]) $TabItem[$i] = "" For $ii=1 To $SectionContents[0][0] ; [n][0]=key [n][1]=value $TabItem[$i] = $tabItem[$i] & $SectionContents[$ii][0] & " = " & $SectionContents[$ii][1] & @CRLF Next GUICtrlCreateLabel($TabItem[$i], 30, 80, 600, 20 * $ii) Next GUICtrlCreateTabItem(""); end tabitem definition GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $TabMenu Then ; display the clicked tab WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($TabMenu)) EndIf WEnd I really just slapped it together sorry for ugly code. Hope this helps someone.
  15. What about adding in options for Categories in Outlook 2007? I found the categories as an XML stream within PR_FOLDER_ASSOCIATED_CONTENTS Property of the default calendar. Here is an image: :edit: pic updated to NOT show my full name... hehe
  16. Well i think its more of a credential problem because Users are not allowed to create files on their C:\ drives. i just need to find a way to create a file in the C: root with elevated privileges.
  17. Hey everybody. I need to copy a file to the users @homedrive. the problem is that these users do not have permissions to do so. the file source is inside of a UNC path that all users have access to. How can i copy the file with higher credentials?
  18. Very nice utility. I am struggling to add in _GUICtrlListView_SortItems to the Select Process GUI. It would be nice to be able to sort those items.
  19. JKDefrag is no longer maintained. i am working on a new version that utilizes MyDefrag. MyDefrag
  20. I found out that you can perform jobs at your friends farms with this: $oIE = _IECreate ("http://apps.facebook.com/onthefarm/index.php?mission=weeds&friendId=" & $FriendID,1) _IELoadWait ($oIE) you can get friend IDs by hovering over their names in the "My Neighbors" tab. I tried multiple windows but game goes out of sync.
  21. update. Func ChangeWallpaper($FileLong, $State = 3) Local $String = $FileLong, $SPI_SETDESKWALLPAPER = 20, $SPIF_UPDATEINIFILE = 1, $SPIF_SENDCHANGE = 2 Do $FileLong = $String $String = StringReplace($FileLong, "/", "\") Until @extended = 0 If Not FileExists($FileLong) Then SetError(-1) Return 0 EndIf If StringRight($FileLong, 3) <> "bmp" Then SetError(-2) Return 0 EndIf Local $WDir = RegRead('HKLM\Software\Microsoft\Windows\CurrentVersion', 'WallPaperDir') $FileShort = StringSplit($FileLong, "\") $FileShort = $FileShort[$FileShort[0]] If StringInStr($WDir, @WindowsDir) <> 0 Then $WDir = StringTrimLeft($WDir, 12) $WDir = @WindowsDir & $WDir EndIf FileCopy($FileLong, $WDir, 1); make wallpaper available in desktop properties window FileCopy($FileLong, @UserProfileDir & '\Local Settings\Application Data\Microsoft\Wallpaper1.bmp', 1) RegWrite('HKCU\Control Panel\Desktop', 'Wallpaper', 'reg_sz', @UserProfileDir & '\Local Settings\Application Data\Microsoft\Wallpaper1.bmp') RegWrite('HKCU\Control Panel\Desktop', 'ConvertedWallpaper', 'reg_sz', $WDir & "\" & $FileShort) Switch $State Case 1; centered RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '0') RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '0') Case 2; tiled RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '1') RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '0') Case 3; stretched RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '0') RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '2') Case Else EndSwitch $Dll = DllCall("user32.dll", "int", "SystemParametersInfo", _ "int", $SPI_SETDESKWALLPAPER, _ "int", 0, _ "str", $FileLong, _ "int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) EndFunc;==>ChangeWallpaper
  22. Magic Jack is a great hardware platform, and a great deal. Unfortunately the poorly made software platform and the support is horrible! This is a "set-it-and-forget-it" solution. it removes the need to speak with support as well as the need to use their annoying software. The next version of this script will create a windows user to run the magic jack service that way all issues with MJ are within a specific system account. i took time to make this script and give it away. i find the following remark a bit offensive.
  23. I still need to add a bit more error checking but here you are for now! All you need to do is install the magic jack like usual and then run this script. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.13.13 (beta) Author: Alex Escalante Script Function: 1. Close all existing Magic Jack processes 2. Move Magic Jack application from users inveroment to shared enviroment 3. Find Magic Jack hardware and add script to root directory 4. Create the Magic Jack Service #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <Array.au3> #include <service.au3> $appTitle = "MJ Service Installer" If Not IsAdmin() Then MsgBox(48, $appTitle, "Administrator privileges required.", 10) Exit EndIf CloseVerify("mjsetup.exe") CloseVerify("magicJack.exe") CloseVerify("cdloader2.exe") CloseVerify("magicJackLoader.exe") TrayTip($appTitle, 'Closed existing "MJ" processes', 10, 1) RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "cdloader") RegDelete("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "cdloader") FileDelete(@DesktopDir & "\magicJack.lnk") DirMove(@AppDataDir & "\mjusbsp", @AppDataCommonDir & "\mjusbsp", 9) $Drives = DriveGetDrive("all") For $i = 1 To $Drives[0] Step 1 If FileExists($Drives[$i] & "\DONT USE THIS DRIVE") Then TrayTip($appTitle, "MJ found at " & $Drives[$i], 10, 1) Sleep(2000) FileCopy(@ScriptFullPath, $Drives[$i] & "\") TrayTip($appTitle, "Updated MJ device", 10, 1) Sleep(2000) EndIf Next $serviceres = _Service_Create("", "mjsvc", "Magic Jack Service", '"' & @AppDataCommonDir & "\mjusbsp\magicJackLoader.exe" & '"') Switch $serviceres Case 1 TrayTip($appTitle, "Service Installed", 10, 1) Sleep(2000) Case 0 TrayTip($appTitle, "Error installing service.", 10, 3) Sleep(2000) EndSwitch $res = MsgBox(4, "Magic Jack Service", "Done!" & @CRLF & "I suggest a restart. Should I do that now?") Switch $res Case 6;yes MsgBox(0, $appTitle, "Thanks! Please consider donating a few bucks via paypal to [email protected]") Shutdown(2) Case 7; no MsgBox(0, $appTitle, "Thanks! Please consider donating a few bucks via paypal to [email protected]") EndSwitch Func CloseVerify($proc) Do ProcessClose($proc) Sleep(150) Until ProcessExists($proc) = 0 EndFunc ;==>CloseVerify ; notes for v2 ; $mjUser = "MJSVCUser" ; $mjPass = "mi*=^=*im" ; $objUser = ObjGet("WinNT://" & @ComputerName & "/" & $mjUser) ; If @error Then ; $colAccounts = ObjGet("WinNT://" & @ComputerName & "") ; $objUser = $colAccounts.Create("user", $mjUser) ; $objUser.SetPassword($mjPass) ; $objUser.Put("Fullname", "Test User") ; $objUser.Put("Description", "Test User description") ; $objUser.SetInfo ; EndIf
×
×
  • Create New...