Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/16/2015 in all areas

  1. Jon

    Major Forum Upgrade Incoming

    In the next week or so the forum will be upgraded to IPB4. I'm currently testing features with the MVPs. The upgrade should take a couple of hours so the site will be offline for that time. When it comes back online there are still about 12 hours worth of background tasks that will begin.   During these background tasks a lot of content will look incorrect or be completely broken: Search offline Emoticons Quotes / Trac links / Topic links - pretty much anything with BBCodes AutoIt/Plaintext code should look correct straight away - I'm pre-converting it myself. However we will have to switch to Prettify for code highlighting and direct links from code into documentation will no longer work. Do not re-edit your old posts during this time with the intention of cleaning them up. It will happen automatically and you are just wasting time. I'll post status updates of the rebuild process and when it is complete. The new site is a responsive design and therefore works much better on small devices. There is no "mobile" skin anymore. But obviously the look might not be to everyone's taste. I'm happy to tweak the template a little to fix minor cosmetic annoyances but I'm not going to go crazy with it as all the tweaks need to be redone on each upgrade.  If you want to have a taste then look the IPB main site at http://community.invisionpower.com/
    4 points
  2. Heron

    Another debugger for AutoIt

    DEMO VIDEO DBUG demo Update 4, files are changed! 28-jan-2010 - new buttons for debugging and managing the expressions list (add, delete, save, restore) - button images - pause button - mouse over variable names in the source code displays the current variable value as tooltip! Features - Debug the complete script or just parts of it - Display run status (linenumber of currently executed function) - GUI default always-on-top in the upper right corner for comfortable debugging - WM_NOTIFY and WM_COMMAND hook to prevent interference with possible message handlers - Display scope, type and value of variables, expressions, macro's and constants (global AND function local) - Execute commands in an immediate window. Can be expressions, functions and assignments - Detailed display of array, struct and object variables - Dynamic display of variable value in the source code (under cursor) Useage 1) #include <dbug.au3> as first line of the script to debug (after placing dbug.au3 in the include folder of course) 2) copy the images in a folder IMAGES on the same level as the Include folder 3) run the script! That's all. Take special care when debugging message handlers, when they don't return fast enough, strange things may happen. To prevent this, you may add a line ;STOP DBUG before the part you want to exclude from debugging until the line ;START DBUG (or the end of the script). Update 3, files are changed! Extended to debug complete scripts, not just lines. Update2 Although the GUI looks the same, the script is completely rewritten. Changes: - More reliable: debugger doesn't fail on constants and not declared variables. - No limitation to the count of variables that are read. - Determination of variable scope is correct. - Indication of breakpoint line when used with SciTE. - Re-entry of the debugger is prevented and indicated. Update Damn, I found a serious flaw in the script. The basic idea is to Execute() a function with the local variables as arguments. To be changable at debug time they are passed ByRef. This works wonderfull for variables but when constants are passed then the Execute() fails silently. I don't see how I can prevent this, anybody any idea? Original post Hi Gents, when playing with AutoIt I felt the need of an easy way to debug a bit more sophisticated then endless adding msgbox and consolewrites to my scripts. After looking around I start thinking of a way to make local variables visible outside there scope and came up with Dbug.au3. It's far from perfect but I wanted to share with you. Hope to hear your comments and maybe you find it usefull. By now the features are: - display scope, type and value of variables, expressions, macro's and constants (global AND function local) - execute commands in an immediate window. Can be expressions, functions and assignments - detailed display of array, struct and object variables - set a breakpoint expression Limitations are there also: - max 20 variables to display - scope display is not as reliable as it should be - when there is a not declared variable in the debugged function, debugging fails without an errormessage (Opt('MustDeclareVars', 1) helps) - multiple debug windows not allowed (but who does need them anyway?) - and without doubt more not yet discovered bugs! Examples: display: binary($var), @scriptdir, $var_a & $var_b, $arr[1][2], timerinit(), etc commands: $a = $b, ($c >= $d), $struc, $arr[3][4] = 'testDBUG', StringRegExp('TestDBUG', 'D(.*)', 2), etc, etc Usage: - Include the debug script dbug.au3 in the script you want to debug. - Write Execute(_debug()) on every line you want to inspect. - That's all! To play right away I supplied a little test script too (TestDBUG.au3) Files: dbug.au3 - debug script (Update 3 downloads: 94) IMAGES - Folder with fancy button images TestDBUG.au3 - declaration of some variables and calls to debugger I really like to know what you think of it and if you can use it. I spent far more time on it then planned So feedback is appreciated! IMAGES.ZIP Dbug.au3 TestDBUG.au3
    1 point
  3. AZJIO

    Pie chart files

    I wanted to make an analogue of Scanner It is necessary to drag and drop a folder in the window AutoIt v3.3.8.1 ; попытка идеального распределения #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Global $Stack[50], $Stack1[50], $a, $a1, $BL, $List='', $k ;, $a1[600][2] GUICreate("Графический просмотр каталога", 380, 410, -1, -1, -1, 0x00000010) $StatusBar = GUICtrlCreateLabel('Строка состояния AZJIO 2010.06.16', 5, 415 - 20, 370, 15, $SS_LEFTNOWORDWRAP) $CatchDrop = GUICtrlCreateLabel(" кинь сюда каталог", 0, 0, 380, 17, $SS_SUNKEN) GUICtrlSetState(-1, 8) $CatchDrop1 = GUICtrlCreateLabel("", 0, 20, 380, 360) GUICtrlSetState(-1, 136) $BL=GUICtrlCreateButton ("L", 360 ,24,18,18) GUICtrlSetTip(-1, 'список файлов') $RE=GUICtrlCreateButton ("R", 340 ,24,18,18) GUICtrlSetTip(-1, 'Перезапуск утилиты') GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = -13 If StringInStr(FileGetAttrib(@GUI_DragFile), "D") = 0 Then MsgBox(0, "Мелкая ошибка", 'Перетаскивайте каталог, а не файл.') ContinueLoop Else GUICtrlDelete($CatchDrop1) ;GUICtrlDelete($BL) GUICtrlDelete($a) GUICtrlDelete($a1) _Create() EndIf If $k = 0 Then $CatchDrop1 = GUICtrlCreateLabel("", 0, 20, 380, 360) GUICtrlSetState(-1, 136) EndIf Case $msg = $RE _restart() Case $msg = $BL If $k <50 Then MsgBox(0, 'Список файлов', $List) Else If MsgBox(4, 'Список файлов', 'Слишком много, более 50,'&@CRLF&' хотите отправить список в буфер?')=6 Then ClipPut($List) EndIf Case $msg = -3 Exit EndSelect WEnd Func _Create() GUICtrlSetData($CatchDrop, @GUI_DragFile) FileFindNextFirst(@GUI_DragFile) $SizeTot=DirGetSize(@GUI_DragFile,2) ; размер каталога, подсчёт общего размера файлов $SizeMin = $SizeTot / 360 ; определяем минимальный размер отображаемого файла, не меньше градуса, количество байт приходящихся на один градус $Zdiff=0 ;создание графика $nach = 0 $List='' $k=0 $kT=0 $SizeTmp0=0 ;$SizeTotal=0 $a = GUICtrlCreateGraphic(10, 20, 360, 360) While 1 $tempname = FileFindNext('', 0, 1) If $tempname = "" Then ExitLoop $List&=StringRegExpReplace($tempname, '(^.*)\\(.*)$', '\2')&@CRLF $SizeTmp= FileGetSize($tempname) $kT+=1 ;$SizeTotal+=$SizeTmp If $SizeTmp<$SizeMin Then $SizeTmp0+=$SizeTmp ContinueLoop EndIf $Zdiff+=Mod($SizeTmp,$SizeMin) ; складываем остатки от деления в общую сумму If $Zdiff/$SizeMin >= 1 Then $Zdiff-=$SizeMin $SizeTmp+=$SizeMin EndIf $grad=Int($SizeTmp/$SizeMin) ; размер файла в градусах, угол файла (ширина сектора) $k+=1 GUICtrlSetGraphic($a, $GUI_GR_COLOR, 0, Dec(Random(50, 99, 1) & Random(50, 99, 1) & Random(50, 99, 1))) ; цвет сектора, рандомный GUICtrlSetGraphic($a, $GUI_GR_PIE, 180, 180, 180, $nach, $grad) ; создание сектора ; $a1[$k][0] = GUICtrlCreateContextMenu($a) ; $a1[$k][1] = GUICtrlCreateMenuitem($tempname,$a1[$k][0]) ;MsgBox(0, 'ага', $nach&' начало сектора' &@CRLF& $grad& ' - размер сектора') ; попытка создать лейблы имён файлов ; If $k<7 Then ; GUICtrlCreateLabel($k, (90+$k*14)*cos($nach)+190, (90+$k*14)*sin($nach)+200, 10, 14) ; GUICtrlSetTip(-1, $tempname) ; EndIf $nach += $grad ; начальный угол отсчёта (смещение, сдвиг) WEnd GUICtrlSetState($a, 8) If $k = 0 Then Return $k ; жёлтый участок, размер этих файлов не позволяет задать угол в круговой диаграмме, так как он менее градуса. $grad=Int($SizeTmp0/$SizeMin) $k+=1 If $nach+$grad >= 359 Then $grad+=360-$nach-$grad GUICtrlSetGraphic($a, $GUI_GR_COLOR, 0, 0xe9de12) ; цвет сектора, жёлтый GUICtrlSetGraphic($a, $GUI_GR_PIE, 180, 180, 180, $nach, $grad) ; создание сектора GUICtrlSetState(-1, 8) ;$nach += $grad ;Круг по центру $a1 = GUICtrlCreateGraphic(10, 20, 360, 360) ;GUICtrlSetGraphic($a1, $GUI_GR_COLOR, 0, Dec(Random(50, 99, 1) & Random(50, 99, 1) & Random(50, 99, 1))) ; цвет сектора, рандомный GUICtrlSetGraphic($a1, $GUI_GR_COLOR, 0, 0xe0dfe3) GUICtrlSetGraphic($a1, $GUI_GR_ELLIPSE, 135, 135, 90, 90) GUICtrlSetGraphic($a1, $GUI_GR_REFRESH) ;MsgBox(0, 'Сообщение', $nach) ;MsgBox(0, 'ага', $SizeTot&' размер в байтах' &@CRLF& $SizeTot/1024/1024& ' - размер в мегабайтах'&@CRLF& $SizeTotal& ' - размер в байтах по файлам'&@CRLF& $SizeTotal/1024/1024& ' - размер в мегабайтах по файлам') GUICtrlSetData($StatusBar, 'Размер ' & Round($SizeTot / 1024 / 1024,1) & ' Мб колич ' & $kT & ' путь ' & @GUI_DragFile) If $k <50 Then GUICtrlSetTip($CatchDrop,$List) Else GUICtrlSetTip($CatchDrop,'Слишком много файлов, более 50') EndIf EndFunc ;==>_Create ;======================================== ; функция поиска всех файлов в каталоге (NIKZZZZ+мод_AZJIO) Func FileFindNextFirst($FindCat) $Stack[0] = 1 $Stack1[1] = $FindCat $Stack[1] = FileFindFirstFile($FindCat & "\*.*") Return $Stack[1] EndFunc ;==>FileFindNextFirst Func FileFindNext($type = 'log', $mode = 0, $Level = 49) While 1 $file = FileFindNextFile($Stack[$Stack[0]]) If @error Then FileClose($Stack[$Stack[0]]) If $Stack[0] = 1 Then Return "" Else $Stack[0] -= 1 ContinueLoop EndIf Else If StringInStr(FileGetAttrib($Stack1[$Stack[0]] & "\" & $file), "D") > 0 Then If $Stack[0] = $Level Then ContinueLoop $Stack[0] += 1 $Stack1[$Stack[0]] = $Stack1[$Stack[0] - 1] & "\" & $file $Stack[$Stack[0]] = FileFindFirstFile($Stack1[$Stack[0]] & "\*.*") If $mode = 2 Then Return $Stack1[$Stack[0]] Else ContinueLoop EndIf Else If $mode = 2 Then ContinueLoop If $mode = 1 Then If StringInStr(';' & $type & ';', ';' & StringRight($Stack1[$Stack[0]] & "\" & $file, 3) & ';') = 0 Then ContinueLoop Else Return $Stack1[$Stack[0]] & "\" & $file EndIf Else Return $Stack1[$Stack[0]] & "\" & $file EndIf EndIf EndIf WEnd EndFunc ;==>FileFindNext Func _restart() Local $sAutoIt_File = @TempDir & "\~Au3_ScriptRestart_TempFile.au3" Local $sRunLine, $sScript_Content, $hFile $sRunLine = @ScriptFullPath If Not @Compiled Then $sRunLine = @AutoItExe & ' /AutoIt3ExecuteScript ""' & $sRunLine & '""' If $CmdLine[0] > 0 Then $sRunLine &= ' ' & $CmdLineRaw $sScript_Content &= '#NoTrayIcon' & @CRLF & _ 'While ProcessExists(' & @AutoItPID & ')' & @CRLF & _ ' Sleep(10)' & @CRLF & _ 'WEnd' & @CRLF & _ 'Run("' & $sRunLine & '")' & @CRLF & _ 'FileDelete(@ScriptFullPath)' & @CRLF $hFile = FileOpen($sAutoIt_File, 2) FileWrite($hFile, $sScript_Content) FileClose($hFile) Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & $sAutoIt_File & '"', @ScriptDir, @SW_HIDE) Sleep(1000) Exit EndFunc ;==>_restart +GUICtrlCreateLabel ; попытка идеального распределения #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Global $Stack[50], $Stack1[50], $a, $a1, $BL, $List='', $k, $aLab, $y[20] =['','','','','','','','','','','','','','','','','','','',''] GUICreate("Графический просмотр каталога", 380, 410, -1, -1, -1, 0x00000010) $StatusBar = GUICtrlCreateLabel('Строка состояния AZJIO 2010.06.16', 5, 415 - 20, 370, 15, $SS_LEFTNOWORDWRAP) $CatchDrop = GUICtrlCreateLabel(" кинь сюда каталог", 0, 0, 380, 17, $SS_SUNKEN) GUICtrlSetState(-1, 8) $CatchDrop1 = GUICtrlCreateLabel("", 0, 20, 380, 360) GUICtrlSetState(-1, 136) $BL=GUICtrlCreateButton ("L", 360 ,24,18,18) GUICtrlSetTip(-1, 'Список крупных файлов') $RE=GUICtrlCreateButton ("R", 340 ,24,18,18) GUICtrlSetTip(-1, 'Перезапуск утилиты') GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = -13 If StringInStr(FileGetAttrib(@GUI_DragFile), "D") = 0 Then MsgBox(0, "Мелкая ошибка", 'Перетаскивайте каталог, а не файл.') ContinueLoop Else GUICtrlDelete($CatchDrop1) ; GUICtrlDelete($BL) For $i = 1 to 19 If $y[$i] <>'' Then GUICtrlDelete($y[$i]) Next GUICtrlDelete($a) GUICtrlDelete($a1) _Create() EndIf If $k = 0 Then $CatchDrop1 = GUICtrlCreateLabel("", 0, 20, 380, 360) GUICtrlSetState(-1, 136) EndIf Case $msg = $RE _restart() Case $msg = $BL MsgBox(0, 'Список крупных файлов', $List) ; If $k <50 Then ; MsgBox(0, 'Список крупных файлов', $List) ; Else ; If MsgBox(4, 'Список файлов', 'Слишком много, более 50,'&@CRLF&' хотите отправить список в буфер?')=6 Then ClipPut($List) ; EndIf Case $msg = -3 Exit EndSelect WEnd Func _Create() GUICtrlSetData($CatchDrop, @GUI_DragFile) FileFindNextFirst(@GUI_DragFile) $SizeTot=DirGetSize(@GUI_DragFile,2) ; размер каталога, подсчёт общего размера файлов $SizeMin = $SizeTot / 360 ; определяем минимальный размер отображаемого файла, не меньше градуса, количество байт приходящихся на один градус $Zdiff=0 ;создание графика $nach = 0 $List='' $k=0 $kT=0 $SizeTmp0=0 $Lab='' ;$SizeTotal=0 $a = GUICtrlCreateGraphic(10, 20, 360, 360) While 1 $tempname = FileFindNext('', 0, 1) If $tempname = "" Then ExitLoop ;$List&=StringRegExpReplace($tempname, '(^.*)\\(.*)$', '\2')&@CRLF $SizeTmp= FileGetSize($tempname) $kT+=1 ;$SizeTotal+=$SizeTmp If $SizeTmp<$SizeMin Then $SizeTmp0+=$SizeTmp ContinueLoop EndIf $Zdiff+=Mod($SizeTmp,$SizeMin) ; складываем остатки от деления в общую сумму If $Zdiff/$SizeMin >= 1 Then $Zdiff-=$SizeMin $SizeTmp+=$SizeMin EndIf $grad=Int($SizeTmp/$SizeMin) ; размер файла в градусах, угол файла (ширина сектора) $k+=1 GUICtrlSetGraphic($a, $GUI_GR_COLOR, 0, Dec(Random(50, 99, 1) & Random(50, 99, 1) & Random(50, 99, 1))) ; цвет сектора, рандомный GUICtrlSetGraphic($a, $GUI_GR_PIE, 180, 180, 180, $nach, $grad) ; создание сектора ;MsgBox(0, 'ага', $nach&' начало сектора' &@CRLF& $grad& ' - размер сектора') ; попытка создать лейблы имён файлов $rp=($nach+$grad/2)*0.0174532925199433 If $grad>10 Then $Lab&='|'&170*cos(-$rp)+185&'|'&170*sin(-$rp)+195&'|'&$tempname ;If $grad>20 Then MsgBox(0, 'Сообщение', $nach+$grad/2&@CRLF&cos($rp)&' - cos'&@CRLF&sin($rp)&' - sin') $nach += $grad ; начальный угол отсчёта (смещение, сдвиг) WEnd GUICtrlSetState($a, 8) If $k = 0 Then Return $k ; жёлтый участок, размер этих файлов не позволяет задать угол в круговой диаграмме, так как он менее градуса. $grad=Int($SizeTmp0/$SizeMin) $k+=1 If $nach+$grad >= 359 Then $grad+=360-$nach-$grad GUICtrlSetGraphic($a, $GUI_GR_COLOR, 0, 0xe9de12) ; цвет сектора, жёлтый GUICtrlSetGraphic($a, $GUI_GR_PIE, 180, 180, 180, $nach, $grad) ; создание сектора GUICtrlSetState(-1, 8) ;$nach += $grad ;Круг по центру $a1 = GUICtrlCreateGraphic(10, 20, 360, 360) ;GUICtrlSetGraphic($a1, $GUI_GR_COLOR, 0, Dec(Random(50, 99, 1) & Random(50, 99, 1) & Random(50, 99, 1))) ; цвет сектора, рандомный GUICtrlSetGraphic($a1, $GUI_GR_COLOR, 0, 0xe0dfe3) GUICtrlSetGraphic($a1, $GUI_GR_ELLIPSE, 135, 135, 90, 90) GUICtrlSetGraphic($a1, $GUI_GR_REFRESH) $aLab=StringSplit(StringTrimLeft($Lab, 1), '|') $rt=0 For $i = 1 to $aLab[0] Step 3 $rt+=1 $y[$rt]=GUICtrlCreateLabel($rt,$aLab[$i], $aLab[$i+1], 12, 14) ;Sleep(30) GUICtrlSetTip(-1, $aLab[$i+2]) ; $context = GUICtrlCreateContextMenu(-1) ; GUICtrlCreateMenuitem($aLab[$i+2],$context) $List&=$rt&') '&StringRegExpReplace($aLab[$i+2], '(^.*)\\(.*)$', '\2')&@CRLF ;MsgBox(0, 'Сообщение', $y[$rt]&' - ID'&@CRLF&$rt&' - №'&@CRLF&$aLab[$i]&' - слева'&@CRLF&$aLab[$i+1]&' - сверху'&@CRLF&$aLab[$i+2]) Next ;MsgBox(0, 'Сообщение', $nach) ;MsgBox(0, 'ага', $SizeTot&' размер в байтах' &@CRLF& $SizeTot/1024/1024& ' - размер в мегабайтах'&@CRLF& $SizeTotal& ' - размер в байтах по файлам'&@CRLF& $SizeTotal/1024/1024& ' - размер в мегабайтах по файлам') GUICtrlSetData($StatusBar, 'Размер ' & Round($SizeTot / 1024 / 1024,1) & ' Мб колич ' & $kT & ' путь ' & @GUI_DragFile) If $k <50 Then GUICtrlSetTip($CatchDrop,$List) Else GUICtrlSetTip($CatchDrop,'Слишком много файлов, более 50') EndIf EndFunc ;==>_Create ;======================================== ; функция поиска всех файлов в каталоге (NIKZZZZ+мод_AZJIO) Func FileFindNextFirst($FindCat) $Stack[0] = 1 $Stack1[1] = $FindCat $Stack[1] = FileFindFirstFile($FindCat & "\*.*") Return $Stack[1] EndFunc ;==>FileFindNextFirst Func FileFindNext($type = 'log', $mode = 0, $Level = 49) While 1 $file = FileFindNextFile($Stack[$Stack[0]]) If @error Then FileClose($Stack[$Stack[0]]) If $Stack[0] = 1 Then Return "" Else $Stack[0] -= 1 ContinueLoop EndIf Else If StringInStr(FileGetAttrib($Stack1[$Stack[0]] & "\" & $file), "D") > 0 Then If $Stack[0] = $Level Then ContinueLoop $Stack[0] += 1 $Stack1[$Stack[0]] = $Stack1[$Stack[0] - 1] & "\" & $file $Stack[$Stack[0]] = FileFindFirstFile($Stack1[$Stack[0]] & "\*.*") If $mode = 2 Then Return $Stack1[$Stack[0]] Else ContinueLoop EndIf Else If $mode = 2 Then ContinueLoop If $mode = 1 Then If StringInStr(';' & $type & ';', ';' & StringRight($Stack1[$Stack[0]] & "\" & $file, 3) & ';') = 0 Then ContinueLoop Else Return $Stack1[$Stack[0]] & "\" & $file EndIf Else Return $Stack1[$Stack[0]] & "\" & $file EndIf EndIf EndIf WEnd EndFunc ;==>FileFindNext Func _restart() Local $sAutoIt_File = @TempDir & "\~Au3_ScriptRestart_TempFile.au3" Local $sRunLine, $sScript_Content, $hFile $sRunLine = @ScriptFullPath If Not @Compiled Then $sRunLine = @AutoItExe & ' /AutoIt3ExecuteScript ""' & $sRunLine & '""' If $CmdLine[0] > 0 Then $sRunLine &= ' ' & $CmdLineRaw $sScript_Content &= '#NoTrayIcon' & @CRLF & _ 'While ProcessExists(' & @AutoItPID & ')' & @CRLF & _ ' Sleep(10)' & @CRLF & _ 'WEnd' & @CRLF & _ 'Run("' & $sRunLine & '")' & @CRLF & _ 'FileDelete(@ScriptFullPath)' & @CRLF $hFile = FileOpen($sAutoIt_File, 2) FileWrite($hFile, $sScript_Content) FileClose($hFile) Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & $sAutoIt_File & '"', @ScriptDir, @SW_HIDE) Sleep(1000) Exit EndFunc ;==>_restart . ; попытка идеального распределения #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Global $Stack[50], $Stack1[50], $a[600], $BL, $List='', $k ;, $a1[600][2] GUICreate("Графический просмотр каталога", 380, 410, -1, -1, -1, 0x00000010) $StatusBar = GUICtrlCreateLabel('Строка состояния AZJIO 2010.06.16', 5, 415 - 20, 370, 15, $SS_LEFTNOWORDWRAP) $CatchDrop = GUICtrlCreateLabel(" кинь сюда каталог", 0, 0, 380, 17, $SS_SUNKEN) GUICtrlSetState(-1, 8) $CatchDrop1 = GUICtrlCreateLabel("", 0, 20, 380, 360) GUICtrlSetState(-1, 136) $BL=GUICtrlCreateButton ("L", 360 ,24,18,18) GUICtrlSetTip(-1, 'список файлов') $RE=GUICtrlCreateButton ("R", 340 ,24,18,18) GUICtrlSetTip(-1, 'Перезапуск утилиты') GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = -13 If StringInStr(FileGetAttrib(@GUI_DragFile), "D") = 0 Then MsgBox(0, "Мелкая ошибка", 'Перетаскивайте каталог, а не файл.') ContinueLoop Else GUICtrlDelete($CatchDrop1) ;GUICtrlDelete($BL) For $i = 1 to $k+1 GUICtrlDelete($a[$i]) Next GUICtrlDelete($a) _Create() EndIf If $k = 0 Then $CatchDrop1 = GUICtrlCreateLabel("", 0, 20, 380, 360) GUICtrlSetState(-1, 136) EndIf Case $msg = $RE _restart() Case $msg = $BL If $k <50 Then MsgBox(0, 'Список файлов', $List) Else If MsgBox(4, 'Список файлов', 'Слишком много, более 50,'&@CRLF&' хотите отправить список в буфер?')=6 Then ClipPut($List) EndIf Case $msg = -3 Exit EndSelect WEnd Func _Create() GUICtrlSetData($CatchDrop, @GUI_DragFile) FileFindNextFirst(@GUI_DragFile) $SizeTot=DirGetSize(@GUI_DragFile,2) ; размер каталога, подсчёт общего размера файлов $SizeMin = $SizeTot / 360 ; определяем минимальный размер отображаемого файла, не меньше градуса, количество байт приходящихся на один градус $Zdiff=0 ;создание графика $nach = 0 $List='' $k=0 $kT=0 $SizeTmp0=0 ;$SizeTotal=0 While 1 $tempname = FileFindNext('', 0, 1) If $tempname = "" Then ExitLoop $List&=StringRegExpReplace($tempname, '(^.*)\\(.*)$', '\2')&@CRLF $SizeTmp= FileGetSize($tempname) $kT+=1 ;$SizeTotal+=$SizeTmp If $SizeTmp<$SizeMin Then $SizeTmp0+=$SizeTmp ContinueLoop EndIf $Zdiff+=Mod($SizeTmp,$SizeMin) ; складываем остатки от деления в общую сумму If $Zdiff/$SizeMin >= 1 Then $Zdiff-=$SizeMin $SizeTmp+=$SizeMin EndIf $grad=Int($SizeTmp/$SizeMin) ; размер файла в градусах, угол файла (ширина сектора) $k+=1 $a[$k] = GUICtrlCreateGraphic(10, 20, 360, 360) GUICtrlSetGraphic($a[$k], $GUI_GR_COLOR, 0, Dec(Random(50, 99, 1) & Random(50, 99, 1) & Random(50, 99, 1))) ; цвет сектора, рандомный GUICtrlSetGraphic($a[$k], $GUI_GR_PIE, 180, 180, 180, $nach, $grad) ; создание сектора GUICtrlSetState(-1, 8) ; $a1[$k][0] = GUICtrlCreateContextMenu($a[$k]) ; $a1[$k][1] = GUICtrlCreateMenuitem($tempname,$a1[$k][0]) ;MsgBox(0, 'ага', $nach&' начало сектора' &@CRLF& $grad& ' - размер сектора') ; попытка создать лейблы имён файлов ; If $k<7 Then ; GUICtrlCreateLabel($k, (90+$k*14)*cos($nach)+190, (90+$k*14)*sin($nach)+200, 10, 14) ; GUICtrlSetTip(-1, $tempname) ; EndIf $nach += $grad ; начальный угол отсчёта (смещение, сдвиг) WEnd If $k = 0 Then Return $k ; жёлтый участок, размер этих файлов не позволяет задать угол в круговой диаграмме, так как он менее градуса. $grad=Int($SizeTmp0/$SizeMin) $k+=1 If $nach+$grad >= 359 Then $grad+=360-$nach-$grad $a[$k] = GUICtrlCreateGraphic(10, 20, 360, 360) GUICtrlSetGraphic($a[$k], $GUI_GR_COLOR, 0, 0xe9de12) ; цвет сектора, жёлтый GUICtrlSetGraphic($a[$k], $GUI_GR_PIE, 180, 180, 180, $nach, $grad) ; создание сектора GUICtrlSetState(-1, 8) ;$nach += $grad ;Круг по центру $a[$k+1] = GUICtrlCreateGraphic(10, 20, 360, 360) ;GUICtrlSetGraphic($a[$k+1], $GUI_GR_COLOR, 0, Dec(Random(50, 99, 1) & Random(50, 99, 1) & Random(50, 99, 1))) ; цвет сектора, рандомный GUICtrlSetGraphic($a[$k+1], $GUI_GR_COLOR, 0, 0xe0dfe3) GUICtrlSetGraphic($a[$k+1], $GUI_GR_ELLIPSE, 135, 135, 90, 90) GUICtrlSetGraphic($a[$k+1], $GUI_GR_REFRESH) ;MsgBox(0, 'Сообщение', $nach) ;MsgBox(0, 'ага', $SizeTot&' размер в байтах' &@CRLF& $SizeTot/1024/1024& ' - размер в мегабайтах'&@CRLF& $SizeTotal& ' - размер в байтах по файлам'&@CRLF& $SizeTotal/1024/1024& ' - размер в мегабайтах по файлам') GUICtrlSetData($StatusBar, 'Размер ' & Round($SizeTot / 1024 / 1024,1) & ' Мб колич ' & $kT & ' путь ' & @GUI_DragFile) If $k <50 Then GUICtrlSetTip($CatchDrop,$List) Else GUICtrlSetTip($CatchDrop,'Слишком много файлов, более 50') EndIf EndFunc ;==>_Create ;======================================== ; функция поиска всех файлов в каталоге (NIKZZZZ+мод_AZJIO) Func FileFindNextFirst($FindCat) $Stack[0] = 1 $Stack1[1] = $FindCat $Stack[1] = FileFindFirstFile($FindCat & "\*.*") Return $Stack[1] EndFunc ;==>FileFindNextFirst Func FileFindNext($type = 'log', $mode = 0, $Level = 49) While 1 $file = FileFindNextFile($Stack[$Stack[0]]) If @error Then FileClose($Stack[$Stack[0]]) If $Stack[0] = 1 Then Return "" Else $Stack[0] -= 1 ContinueLoop EndIf Else If StringInStr(FileGetAttrib($Stack1[$Stack[0]] & "\" & $file), "D") > 0 Then If $Stack[0] = $Level Then ContinueLoop $Stack[0] += 1 $Stack1[$Stack[0]] = $Stack1[$Stack[0] - 1] & "\" & $file $Stack[$Stack[0]] = FileFindFirstFile($Stack1[$Stack[0]] & "\*.*") If $mode = 2 Then Return $Stack1[$Stack[0]] Else ContinueLoop EndIf Else If $mode = 2 Then ContinueLoop If $mode = 1 Then If StringInStr(';' & $type & ';', ';' & StringRight($Stack1[$Stack[0]] & "\" & $file, 3) & ';') = 0 Then ContinueLoop Else Return $Stack1[$Stack[0]] & "\" & $file EndIf Else Return $Stack1[$Stack[0]] & "\" & $file EndIf EndIf EndIf WEnd EndFunc ;==>FileFindNext Func _restart() Local $sAutoIt_File = @TempDir & "\~Au3_ScriptRestart_TempFile.au3" Local $sRunLine, $sScript_Content, $hFile $sRunLine = @ScriptFullPath If Not @Compiled Then $sRunLine = @AutoItExe & ' /AutoIt3ExecuteScript ""' & $sRunLine & '""' If $CmdLine[0] > 0 Then $sRunLine &= ' ' & $CmdLineRaw $sScript_Content &= '#NoTrayIcon' & @CRLF & _ 'While ProcessExists(' & @AutoItPID & ')' & @CRLF & _ ' Sleep(10)' & @CRLF & _ 'WEnd' & @CRLF & _ 'Run("' & $sRunLine & '")' & @CRLF & _ 'FileDelete(@ScriptFullPath)' & @CRLF $hFile = FileOpen($sAutoIt_File, 2) FileWrite($hFile, $sScript_Content) FileClose($hFile) Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & $sAutoIt_File & '"', @ScriptDir, @SW_HIDE) Sleep(1000) Exit EndFunc ;==>_restart .
    1 point
  4. After wakillon has provided the SID player code, I thought it's time to write a little intro in old school style with chip music from the old good C64. Here the result (download exe + source): CoSiNUs brOTHerS inTRO I hope it works properly on your PC. If not please report. WinXP is not supported! If your CPU is too weak to display the effects properly, change the line 118 the value 30 to 40 DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", 30, "int", 0) or a higher value or reduce in line 28 the $iStripes value to e.g. $iH / 3. Global $i, $c = 0, $j = 0, $f, $l, $k = 0, $m, $iStripes = $iH / 2 On my notebook the intro runs at ~30 fps! Have fun. @wakillon: Merci beaucoup! Screenshot: https://autoit.de/index.php/Attachment/115-CoSiNUs-brOTHerS-inTRO-png/ How it should look like (without sound):
    1 point
  5. @TheDcoder: please stop hijacking my topic by posting bullshit. Go and play in the sandbox if you want to be childish.
    1 point
  6. You can try this and say me if that work: Func Start() run("script.exe"&" /separate") EndFunc This is a windows atribut to run a process on a separate process ID this allow to use different user for the same process. It depend witch kind of process you try to run together with same name. For exemple if you try this with "Explorer.exe" You'll have the permition to run Multiple explorer.exe instance. only if you use the "/separate" atribut. Give me feedback plz
    1 point
  7. Do you by chance have this: _Singleton() in your code? As, this will only allow 1 instance of a script to run.
    1 point
  8. Can you show a reproducer? (A short example of code that shows what you try and what is not working?) Because this: run("notepad.exe") run("notepad.exe") ... starts two notepads just fine.
    1 point
  9. Full test functionality. For $i = 0 To 360 Step +1 $rod = Angle($centerX,$centerY, $i, $radius) ToolTip($i&"o:"&$rod[1] &":"& $rod[2]) MouseMove($rod[1] , $rod[2],0) Sleep(10) Next +90 degree offset check For $i = 0 To 360 Step +1 $angle = $i + 90 $rod = Angle($centerX,$centerY, $angle, $radius) ToolTip($angel&"o:"&$rod[1] &":"& $rod[2]) MouseMove($rod[1] , $rod[2],0) Sleep(10) Next
    1 point
  10. MuffettsMan, You need to check the returned value from the function. If using the default string return, you get an empty string if nothing is selected - if using the array return, the [0] element gives the count of selected items. This works fine for me: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <GuiListView.au3> $hGUI = GUICreate("Test", 500, 500) $cLV = GUICtrlCreateListView("Column", 10, 10, 200, 200) For $i = 0 To 9 GUICtrlCreateListViewItem("Item " & $i, $cLV) Next $cButton = GUICtrlCreateButton("Selected", 10, 300, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton $sSel = _GUICtrlListView_GetSelectedIndices($cLV) MsgBox($MB_SYSTEMMODAL, "Selected", "-" & $sSel & "-") ; shows when return is an empty string $aSel = _GUICtrlListView_GetSelectedIndices($cLV, True) MsgBox($MB_SYSTEMMODAL, "Selected count", $aSel[0]) ; Shows count of selected items EndSwitch WEnd All this is clearly explained in the Help file. M23
    1 point
  11. Kyan

    TP-LINK Manager v0.7.1

    Hello! Been working on this, SNMP UDF is a bit incomplete, but found a way to make it work as I wanted. Features Restarts wan connection Retrieve connected devices (Local IP/MAC address/device name) Displays: router external ip | up time | brand & model I made this for my home router, but probably works on others models and brands (except the restart function, that is a TP-LINK exclusive xD) TP-Link Manager v0.7.1.zip (v0.7 - 38 downloads) #Changelog
    1 point
  12. argumentum

    TP-LINK Manager v0.7.1

    cool, it does not show anything . I added that if nothing found, disable the buttons If StringRegExp($aFill[2],'(?i)TP.LINK') Then $isTPlink = 1 If StringStripWS(GUICtrlRead( $IPext ),8) = "" Then GUICtrlSetState($btnReset,$GUI_DISABLE) GUICtrlSetState($btnRLD,$GUI_DISABLE) GUICtrlSetData($Label1,"nothing to see, carry on..") EndIf
    1 point
  13. This will attach to an existing Word application, and closes all Word windows. #include <Word.au3> $oObject = _Word_Create() _Word_Quit($oObject, Default, Default, True) See the help file for the parameters for _Word_Quit if you want to save the documents on close.
    1 point
  14. I think your code is wrong...take a look at this and compare it to yours. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <INet.au3> #include <IE.au3> #include <Word.au3> #include <excel.au3> #include <ScreenCapture.au3> ;opt("MustDeclareVar" , 1) MainGUI() ;Name the Variables Func MainGUI() Global $SeondaryGUI , $Page2 , $hBmp , $Screen , $mygui , $newmsg , $Label3 , $Submit , $Edit , $Amysis , $CareManager , $CSA , $HealthX , $Kronos , $Google , $NCR , $NICEPerform , $NICEWFM , $MP , $ReportManager , $RXCLAIM Global $RxPortal , $ie , $Calc , $Password ,$IE , $Button14 , $HFHPAPP , $Button16 , $Label1 , $Label2 ,$Notepad , $Word , $Excel , $Groupwise, $Messenger , $HFlogo , $Button21 , $Pic1 , $CSapps , $msg ;Create the main GUI $mygui = GUICreate("Customer Service Launcher", 514, 711, 258, 173) GUISetCursor (2) GUISetFont(10, 800, 0, "MS Sans Serif") GUISetBkColor(0xA6CAF0) $secondGUI = GUICreate("Customer Service Launcher", 514, 711, 258, 173) GUISetCursor (2) GUISetFont(10, 800, 0, "MS Sans Serif") GUISetBkColor(0xA6CAF0) ;Assign the Variables $Amysis = GUICtrlCreateButton("Amysis", 16, 72, 139, 25) $CareManager = GUICtrlCreateButton("Care Manager", 16, 104, 139, 25) $CSA = GUICtrlCreateButton("CSA", 16, 136, 139, 25) $HealthX = GUICtrlCreateButton("Health X", 16, 168, 139, 25) $Kronos = GUICtrlCreateButton("Kronos", 16, 200, 139, 25) $Google = GUICtrlCreateButton("Google", 16, 232, 139, 25) $NCR = GUICtrlCreateButton("NCR", 16, 264, 139, 25) $NICEPerform = GUICtrlCreateButton("NICE Perform", 16, 296, 139, 25) $NICEWFM = GUICtrlCreateButton("NICE WFM ", 16, 328, 139, 25) $MP = GUICtrlCreateButton("Market Prominence", 16, 360, 139, 25) $ReportManager = GUICtrlCreateButton("Report Manager", 16, 392, 139, 25) $RXCLAIM = GUICtrlCreateButton("Rx Claim", 16, 424, 139, 25) $IE = GUICtrlCreateButton("Internet Explorer", 16, 552, 139, 25) $Dashboard = GUICtrlCreateButton("Dashboard", 16, 488, 139, 25) $HFHPAPP = GUICtrlCreateButton("HP App page", 16, 520, 139, 25) GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\Camera.jpg", 176, 288, 100, 60) $Screen = GUICtrlCreateButton("screen", 192, 340, 83, 25) $RxPortal = GUICtrlCreateButton("RxPortal", 16, 456, 139, 25) $Calc = GUICtrlCreateButton("Calculator", 192, 232, 83, 25) $Label1 = GUICtrlCreateLabel("Applications", 8, 32, 141, 29) GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20") $Label2 = GUICtrlCreateLabel("Tools", 200, 32, 62, 29) GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20") $Notepad = GUICtrlCreateButton("Notepad", 192, 72, 83, 25) $Word = GUICtrlCreateButton("Word", 192, 104, 83, 25) $Excel = GUICtrlCreateButton("Excel", 192, 136, 83, 25) $Groupwise = GUICtrlCreateButton("Groupwise", 192, 168, 83, 25) $HFlogo = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\HF logo.jpg", 288, 10, 180, 60) $Messenger = GUICtrlCreateButton("Messenger", 192, 200, 83, 25) $calendar = GUICtrlCreateMonthCal ("Calendar", 192 , 520 , 292 , 172 ) $Edit1 = GUICtrlCreateEdit("", 288, 72, 217, 353) GUICtrlSetData(-1, "Notes:") $Page2 = GUICtrlCreateButton("Page 2", 288, 432, 211, 57) $Password = GUICtrlCreatePic ("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\word.jpg" , 24 , 624 , 116 , 76) $Label3 = GUICtrlCreateLabel("Password Keeper", 24, 605, 136, 22) GUISetState() ;Run the gui until window is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE exit Case $msg = $Notepad Run ("notepad.exe") Case $msg = $Calc Run ("calc.exe") Case $msg = $Amysis ShellExecute ("http://hfhp-wcaa.dstcorp.net:8080/amisys-web/Controller?view=jsp/Pportal.jsp") Case $msg = $CareManager ShellExecute("https://apps-hfhp.healthedge.net/Citrix/XenApp/hfhp/auth/login.aspx") Case $msg = $CSA ShellExecute("http://hfhp-wccsa.dstcorp.net:8080/hfhp-PROD-csa/portal") Case $msg = $HealthX ShellExecute("https://secure.healthx.com/publicservice/loginv1/login.aspx?bc=c1503d12-e5a7-43ba-8dc8-4ce5cfc2b5e1&serviceid=8d6ab51b-6c4c-4735-a738-87341c01f849") Case $msg = $Kronos ShellExecute("http://hfvkron.health-first.org/wfc/logon/logonWFC.html") Case $msg = $Google ShellExecute ("https://www.google.com/?gws_rd=ssl") Case $msg = $NCR ShellExecute("http://hfepsprod1.priv.health-first.org/CVMEServer/Login.aspx") Case $msg = $NICEPerform ShellExecute("http://hfniceim1/NiceApplications/Desktop/WebPage/DeskTopWebForm.aspx") Case $msg = $NICEWFM ShellExecute("http://101.202.40.3/agent/") Case $msg = $MP run ("MPC4Cunlock.exe") Case $msg = $ReportManager ShellExecute("http://hfhpsql12p01.priv.health-first.org/Reports/Pages/Folder.aspx") Case $msg = $RXCLAIM ShellExecute("https://asp.rxclaim.catamaranrx.com/RxClaim.html") Case $msg = $IE ShellExecute("http://intranet.health-first.org/") Case $msg = $HFHPAPP ShellExecute("http://intranet.health-first.org/departments/health_plans/apps/index.cfm") Case $msg = $Word ;$Word = _WordCreate (@ScriptDir & "\Test.doc", 1) ; Check @extended return value to see if attach was successful If @extended Then MsgBox(0, "", "Attached to Existing Window") Else MsgBox(0, "", "Created New Window") EndIf Case $msg = $Excel ;$Excel = _ExcelBookNew() Case $msg = $Groupwise Run("grpwise.exe") Case $msg = $Messenger run("C:\Program Files (x86)\Novell\Messenger\NMCL32.exe") Case $msg = $Dashboard ShellExecute("https://10.8.3.27:8444/cuic/permalink/PermalinkViewer.htmx?viewId=B194CB921000013A02102C0A0A08031B&linkType=dashboard&uuid=9315d5a3-c745-406a-8ad9-43b27dc55749") Case $msg = $Password ;ShellExecute( "S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Files\BLANK Password Keeper.doc") Case $msg = $HFlogo ShellExecute ("https://www.youtube.com/watch?v=9cQgQIMlwWw") Case $msg = $Screen $hBmp = _ScreenCapture_Capture("") $Screen = _ScreenCapture_SaveImage(@DesktopDir & "\new_screenshot.jpg", $hBmp) Case $msg = $RxPortal ShellExecute("https://healthfirsttrain.rxportal.sxc.com/rxclaim/portal/memberLogin") Case $msg = $Page2 EndSelect WEnd EndFunc . Your code, does not have a button for taking a screen shot, rather an image that has a variable $Screen, I changed that, as it does not need a variable, and added a new button called Screen - you can change it to what you want.
    1 point
×
×
  • Create New...