├── .gitattributes ├── .gitignore ├── .nojekyll ├── Local-Client ├── Installer_resources │ ├── ahk_banner.bmp │ ├── ahk_install.ico │ ├── ahk_remove.ico │ └── license.txt ├── Lib │ ├── Arguments.ahk │ ├── DownloadFile.ahk │ ├── Ignore.ahk │ ├── Install.ahk │ ├── JSON_Beautify.ahk │ ├── JSON_FromObj.ahk │ ├── JSON_ToObj.ahk │ ├── LV_Colors.ahk │ ├── LV_InCellEdit.ahk │ ├── Licenses.ahk │ ├── Manifest.ahk │ ├── NetworkAPI.ahk │ ├── Package.ahk │ ├── Ping.ahk │ ├── SetEditPlaceholder.ahk │ ├── Settings.ahk │ └── Util.ahk ├── Make_Install.nsi ├── MetaDataViewer_Test.ahk ├── Package_Builder.ahk ├── Package_Installer.ahk ├── Package_Lister.ahk ├── Package_Moderator.ahk ├── Package_Remover.ahk ├── Res │ ├── ahk.ico │ ├── ahk.png │ └── greenpixel.bmp ├── Test_Packages │ ├── AHKsock │ │ ├── Doc │ │ │ ├── documentation.html │ │ │ └── documentation.md │ │ ├── Lib │ │ │ └── AHKsock.ahk │ │ ├── README.md │ │ ├── example_1_client.ahk │ │ ├── example_1_server.ahk │ │ ├── example_2_client.ahk │ │ ├── example_2_server_multiple_clients.ahk │ │ ├── example_2_server_single_client.ahk │ │ ├── example_2_server_transmitfile.ahk │ │ ├── example_3.ahk │ │ ├── example_4.ahk │ │ └── package.json │ ├── anchor │ │ ├── Lib │ │ │ └── Anchor.ahk │ │ ├── anchor-example.ahk │ │ └── package.json │ ├── gdip │ │ ├── Gdip.Tutorial.1-Draw.Shapes.ahk │ │ ├── Gdip.Tutorial.10-Rotate.Flip.or.Mirror.an.image.ahk │ │ ├── Gdip.Tutorial.11-Using.BRAs.to.perform.animations.ahk │ │ ├── Gdip.Tutorial.12-Pixelate.a.bitmap.using.machine.code.ahk │ │ ├── Gdip.Tutorial.2-Draw.Outlined.Shapes.ahk │ │ ├── Gdip.Tutorial.3-Create.Gui.From.Image.ahk │ │ ├── Gdip.Tutorial.4-Draw.Circles.ahk │ │ ├── Gdip.Tutorial.5-Create.Bitmap.ahk │ │ ├── Gdip.Tutorial.6-Image.Editing.ahk │ │ ├── Gdip.Tutorial.7-Draw.draggable.rounded.rectangle.ahk │ │ ├── Gdip.Tutorial.8-Write.text.onto.a.gui.ahk │ │ ├── Gdip.Tutorial.9-Create.a.progress.bar.on.standard.gui.ahk │ │ ├── Lib │ │ │ └── Gdip.ahk │ │ └── package.json │ ├── isbinfile │ │ ├── Lib │ │ │ └── IsBinFile.ahk │ │ └── package.json │ ├── libcrypt │ │ ├── Examples │ │ │ ├── ASCII.ahk │ │ │ ├── Base64.ahk │ │ │ ├── BinHex.ahk │ │ │ ├── CRC32.ahk │ │ │ ├── Caesar.ahk │ │ │ ├── Div2.ahk │ │ │ ├── HMAC.ahk │ │ │ ├── MD2.ahk │ │ │ ├── MD4.ahk │ │ │ ├── MD5.ahk │ │ │ ├── RC4.ahk │ │ │ ├── ROT.ahk │ │ │ ├── RSHash.ahk │ │ │ ├── SHA-1.ahk │ │ │ ├── SHA-256.ahk │ │ │ ├── SHA-384.ahk │ │ │ ├── SHA-512.ahk │ │ │ ├── SecureSalted.ahk │ │ │ ├── URI.ahk │ │ │ ├── Vigenere.ahk │ │ │ ├── VxE.ahk │ │ │ ├── XOR.ahk │ │ │ └── nnnik21.ahk │ │ ├── Lib │ │ │ └── libcrypt.ahk │ │ └── package.json │ ├── loadlibrary │ │ ├── Lib │ │ │ └── loadlibrary.ahk │ │ └── package.json │ ├── midi │ │ ├── Lib │ │ │ └── midi.ahk │ │ └── package.json │ ├── sample_extra │ │ ├── Lib │ │ │ └── sample.txt │ │ └── package.json │ ├── sample_tool │ │ ├── leading_spaces │ │ ├── !ignore.test │ │ ├── .aspdm_ignore │ │ ├── __ignored_folder__ │ │ │ ├── file.a │ │ │ ├── file.b │ │ │ ├── file.c │ │ │ ├── file.d │ │ │ └── file.e │ │ ├── bat.txt │ │ ├── cat.txt │ │ ├── docs.html │ │ ├── execute.ahk │ │ ├── files │ │ │ ├── #file123.test │ │ │ ├── file#1285.md │ │ │ ├── folder │ │ │ ├── ignore_me_also.r │ │ │ ├── main_script.ahk │ │ │ ├── prefix_test.g │ │ │ └── some_text.txt │ │ ├── folder │ │ │ ├── stuff.o │ │ │ └── thingy.test │ │ ├── foo │ │ │ ├── bar │ │ │ │ └── testfile.txt │ │ │ └── test │ │ │ │ └── somefile.txt │ │ ├── ignore_me.r │ │ ├── install.ahk │ │ ├── notfolder │ │ ├── package.json │ │ ├── prefix_testing.file │ │ ├── rat.txt │ │ └── remove.ahk │ ├── samples │ │ ├── Lib │ │ │ ├── sample.c │ │ │ ├── sample.lua │ │ │ └── sample │ │ │ │ ├── sample.ahk │ │ │ │ ├── sample.bat │ │ │ │ └── sample │ │ │ │ └── sample.au3 │ │ └── package.json │ ├── socket_class │ │ ├── Lib │ │ │ └── socket_class.ahk │ │ └── package.json │ └── winfade │ │ ├── Example.ahk │ │ ├── Lib │ │ └── WinFade.ahk │ │ └── package.json ├── Tests │ ├── Alphasort_Test.ahk │ ├── CustomURI_Handler.ahk │ ├── CustomURI_SetupURI.ahk │ ├── CustomURI_Test-SetupURI.ahk │ ├── CustomURI_Test.ahk │ ├── Ignore_Test-DirTree.ahk │ ├── Ignore_Test.ahk │ ├── Install_Test.ahk │ ├── JSON_Format_test.ahk │ ├── NetworkAPI_Test.ahk │ ├── OpenWith_Handler.ahk │ ├── Package_Lister.single-stdlib.ahk │ ├── Package_Moderator-v1.ahk │ ├── Packaging_Test.ahk │ ├── Screenshot_Test.ahk │ ├── SinglePackage_Lister.ahk │ ├── Validate_Test.ahk │ └── geekdude_version.ahk └── rHandler.ahk ├── Network ├── .htaccess ├── about.php ├── api-php │ ├── info.php │ ├── list.php │ └── status.php ├── client │ ├── archive.php │ ├── get.php │ ├── index.php │ ├── style.css │ └── update.ini ├── dev │ └── index.php ├── dl_file.php ├── error_docs │ ├── 400.html │ ├── 401.html │ ├── 403.html │ ├── 404.html │ ├── 500.html │ └── error.css ├── favicon.ico ├── footer.php ├── header.php ├── home.php ├── index.php ├── lib │ ├── JSON_Beautify.php │ ├── db_info.php │ ├── pagelock.php │ ├── server.php │ └── utils.php ├── login.php ├── logout.php ├── navmenu.php ├── p_login.php ├── p_submit.php ├── packs │ └── tmp │ │ └── folder ├── src │ ├── 2fh_icon.png │ ├── ValidateForm.js │ ├── ahk.png │ ├── arch.png │ ├── bootstrap.css │ ├── bootstrap_buttons-theme.min.css │ ├── bootstrap_buttons.min.css │ ├── font-awesome-4.0.3 │ │ ├── css │ │ │ ├── font-awesome.css │ │ │ └── font-awesome.min.css │ │ └── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ ├── get_aspdm.png │ ├── install48.png │ ├── jquery-1.11.0.min.js │ ├── jquery.form.js │ ├── jquery.hashchange.min.js │ ├── ladda.min.css │ ├── ladda.min.js │ ├── loader.gif │ ├── loader2.gif │ ├── modal.css │ ├── modal.js │ ├── sorttable.js │ ├── spin.min.js │ └── style.css └── submit.php ├── README.md └── Specifications ├── Database.md ├── Guidelines.md ├── License.md └── NetworkAPI.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.* text eol=crlf 3 | *.ahk text eol=crlf 4 | *.png binary 5 | *.jpg binary 6 | *.gif binary 7 | *.bmp binary 8 | *.ico binary 9 | *.otf binary 10 | *.ttf binary 11 | *.eot binary 12 | *.woff binary -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.bak 3 | *.ahkp 4 | *.7z 5 | *.zip 6 | *.db 7 | *~ 8 | ~* 9 | -------------------------------------------------------------------------------- /.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/.nojekyll -------------------------------------------------------------------------------- /Local-Client/Installer_resources/ahk_banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Installer_resources/ahk_banner.bmp -------------------------------------------------------------------------------- /Local-Client/Installer_resources/ahk_install.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Installer_resources/ahk_install.ico -------------------------------------------------------------------------------- /Local-Client/Installer_resources/ahk_remove.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Installer_resources/ahk_remove.ico -------------------------------------------------------------------------------- /Local-Client/Installer_resources/license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 The ASPDM group (http://aspdm.ahkscript.org) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Local-Client/Lib/Arguments.ahk: -------------------------------------------------------------------------------- 1 | /* From LibCon.ahk Docs 2 | 3 | args is an Object that is used to reference the arguments the script has received. 4 | The object is created only when the number of arguments is greater than zero. 5 | Note: if (args) will return true, if the object exists, otherwise, it will return false. 6 | 7 | args.CSV (or args["CSV"]) - Contains the arguments in CSV format. 8 | args[n] - where 'n' (n>0) is the n'th argument 9 | args[0] - is equal to argc 10 | 11 | Note: argc exists only if the args Object exists. It is set to the number of arguments received. 12 | */ 13 | 14 | ;Get Arguments 15 | if 0 > 0 16 | { 17 | argc=%0% 18 | args:=[] 19 | args[0]:=argc 20 | 21 | Loop, %0% 22 | { 23 | args.Insert(%A_Index%) 24 | args["CSV"]:=args["CSV"] """" %A_Index% "" ((A_Index==args[0]) ? """" : """,") 25 | } 26 | } -------------------------------------------------------------------------------- /Local-Client/Lib/DownloadFile.ahk: -------------------------------------------------------------------------------- 1 | ; Script by brutosozialprodukt 2 | ; http://ahkscript.org/boards/viewtopic.php?f=6&t=1674 3 | 4 | ; Revision: joedf 5 | ; Changes: - Changed progress bar style & colors 6 | ; - Changed Display Information 7 | ; - Commented-out Size calculation 8 | ; - Added ShortURL() 9 | ; - Added short delay 100 ms to show the progress bar if download was too fast 10 | ; - Added ProgressBarTitle 11 | ; - Try-Catch "backup download code" 12 | ; ---------------------------------------------------------------------------------- 13 | 14 | DownloadFile(UrlToFile, SaveFileAs, Overwrite := True, UseProgressBar := True, ProgressBarTitle:="Downloading...") { 15 | ;Check if the file already exists and if we must not overwrite it 16 | If (!Overwrite && FileExist(SaveFileAs)) 17 | Return 18 | ;Check if the user wants a progressbar 19 | If (UseProgressBar) { 20 | _surl:=ShortURL(UrlToFile) 21 | ;Initialize the WinHttpRequest Object 22 | WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1") 23 | ;Download the headers 24 | WebRequest.Open("HEAD", UrlToFile) 25 | WebRequest.Send() 26 | ;Store the header which holds the file size in a variable: 27 | try 28 | FinalSize := WebRequest.GetResponseHeader("Content-Length") 29 | catch 30 | { 31 | ;throw Exception("could not get Content-Length for URL: " UrlToFile) 32 | Progress, CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, , %ProgressBarTitle%, %_surl% 33 | UrlDownloadToFile, %UrlToFile%, %SaveFileAs% 34 | Sleep 100 35 | Progress, Off 36 | return 37 | } 38 | ;Create the progressbar and the timer 39 | Progress, CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, , %ProgressBarTitle%, %_surl% 40 | SetTimer, __UpdateProgressBar, 100 41 | } 42 | ;Download the file 43 | UrlDownloadToFile, %UrlToFile%, %SaveFileAs% 44 | ;Remove the timer and the progressbar because the download has finished 45 | If (UseProgressBar) { 46 | Sleep 100 47 | Progress, Off 48 | SetTimer, __UpdateProgressBar, Off 49 | } 50 | Return 51 | 52 | ;The label that updates the progressbar 53 | __UpdateProgressBar: 54 | ;Get the current filesize and tick 55 | CurrentSize := FileOpen(SaveFileAs, "r").Length ;FileGetSize wouldn't return reliable results 56 | CurrentSizeTick := A_TickCount 57 | ;Calculate the downloadspeed 58 | ;Speed := Round((CurrentSize/1024-LastSize/1024)/((CurrentSizeTick-LastSizeTick)/1000)) . " Kb/s" 59 | ;Save the current filesize and tick for the next time 60 | ;LastSizeTick := CurrentSizeTick 61 | ;LastSize := FileOpen(SaveFileAs, "r").Length 62 | ;Calculate percent done 63 | PercentDone := Round(CurrentSize/FinalSize*100) 64 | ;Update the ProgressBar 65 | _csize:=Round(CurrentSize/1024,1) 66 | _fsize:=Round(FinalSize/1024) 67 | Progress, %PercentDone%, Downloading: %_csize% KB / %_fsize% KB [ %PercentDone%`% ], %_surl% 68 | Return 69 | } 70 | 71 | ShortURL(p,l=50) { 72 | VarSetCapacity(_p, (A_IsUnicode?2:1)*StrLen(p) ) 73 | DllCall("shlwapi\PathCompactPathEx" 74 | ,"str", _p 75 | ,"str", p 76 | ,"uint", abs(l) 77 | ,"uint", 0) 78 | return _p 79 | } -------------------------------------------------------------------------------- /Local-Client/Lib/Ignore.ahk: -------------------------------------------------------------------------------- 1 | ;Mimic/emulate ".gitignore", see http://git-scm.com/docs/gitignore 2 | 3 | Ignore_GetPatterns(ignorefile) 4 | { 5 | i_fp := Util_FullPath(ignorefile) 6 | SplitPath,i_fp,,baseDir 7 | StringReplace,baseDir,baseDir,\,/,All 8 | 9 | ignore_patterns:=[] 10 | ignore_patterns.negate:=[] 11 | Loop,Read,%ignorefile% 12 | { 13 | if StrLen(current_line:=Trim(A_LoopReadLine)) ;A blank line matches no files, so it can serve as a separator for readability. 14 | { 15 | tf:=SubStr(current_line,1,2) ;two first chars 16 | fc:=SubStr(tf,1,1) ;first char 17 | 18 | if (fc=="#") ;A line starting with # serves as a comment. 19 | continue 20 | if (fc=="!") { 21 | ignore_patterns.negate.Insert(SubStr(current_line,2)) 22 | continue 23 | } 24 | if (tf=="\ ") ;escape for leading spaces 25 | || (tf=="\#") ;Put a backslash ("\") in front of the first hash for patterns that begin with a hash. 26 | || (tf=="\!") { ;escape for literal '!' 27 | ignore_patterns.Insert(SubStr(current_line,2)) 28 | continue 29 | } else { 30 | ignore_patterns.Insert(Trim(current_line)) 31 | } 32 | } 33 | } 34 | ignore_patterns.negate := Ignore_PatternTransform(ignore_patterns.negate,baseDir) 35 | return Ignore_PatternTransform(ignore_patterns,baseDir) 36 | } 37 | 38 | Ignore_PatternTransform(patterns,baseDir) 39 | { 40 | for each, pat in patterns 41 | { 42 | if each is not integer 43 | continue 44 | _tmp:=pat 45 | if (SubStr(_tmp,1,1)=="/") 46 | _tmp := chr(8) baseDir "/" SubStr(_tmp,2) 47 | StringReplace,_tmp,_tmp,/**/, % chr(2) ,All 48 | StringReplace,_tmp,_tmp,/,\\,All 49 | StringReplace,_tmp,_tmp,**, % chr(3),All 50 | StringReplace,_tmp,_tmp,\[, % chr(4),All 51 | StringReplace,_tmp,_tmp,\], % chr(5),All 52 | StringReplace,_tmp,_tmp,\?, % chr(6),All 53 | StringReplace,_tmp,_tmp,?, % chr(7),All 54 | 55 | ;Normal "escapes", because not in Glob specs 56 | static _ := ".^$(){}|+" 57 | Loop, Parse, _ 58 | StringReplace,_tmp,_tmp,%A_LoopField%,\%A_LoopField%,All 59 | 60 | StringReplace,_tmp,_tmp,[!,[^,All 61 | StringReplace,_tmp,_tmp,*,[^\\]+,All 62 | StringReplace,_tmp,_tmp, % chr(2) ,\\+.*\\*,All 63 | StringReplace,_tmp,_tmp, % chr(3) ,.*,All 64 | StringReplace,_tmp,_tmp, % chr(4) ,\[,All 65 | StringReplace,_tmp,_tmp, % chr(5) ,\],All 66 | StringReplace,_tmp,_tmp, % chr(7) ,.,All 67 | StringReplace,_tmp,_tmp, % chr(6) ,\?,All 68 | StringReplace,_tmp,_tmp, % chr(8) ,^,All 69 | 70 | patterns[each]:=_tmp 71 | } 72 | return patterns 73 | } 74 | 75 | Ignore_DirTree(dir,patterns) 76 | { 77 | data := [], ldir := StrLen(dir)+1 78 | Loop, %dir%\*.*, 1 79 | { 80 | StringTrimLeft, name, A_LoopFileFullPath, %ldir% 81 | e := { name: name, fullPath: A_LoopFileLongPath } 82 | 83 | ;quick-ignore the package metadata files 84 | if name in package.json,.aspdm_ignore 85 | continue 86 | 87 | ;check attrib 88 | IfInString, A_LoopFileAttrib, D 89 | e.isDir := true 90 | 91 | ;check ignores 92 | for j, pat in patterns 93 | { 94 | if j is not integer 95 | continue 96 | if (SubStr(pat,-1)=="\\") { 97 | if (e.isDir) 98 | StringTrimRight,pat,pat,2 99 | else 100 | continue 101 | } 102 | if RegExMatch(e.fullPath,"m)" pat "$") { 103 | ; Start of confusing code 104 | for k, npat in patterns.negate 105 | { 106 | if (SubStr(npat,-1)=="\\") { 107 | if (e.isDir) 108 | StringTrimRight,npat,npat,2 109 | else 110 | continue 111 | } 112 | if RegExMatch(e.fullPath,"m)" npat "$") { 113 | break 2 114 | } 115 | } 116 | ; End of confusing code 117 | continue 2 118 | } 119 | } 120 | 121 | ;continue parsing inside directories 122 | if (e.isDir) 123 | e.contents := Ignore_DirTree(A_LoopFileFullPath,patterns) 124 | 125 | data.Insert(e) 126 | } 127 | return data 128 | } -------------------------------------------------------------------------------- /Local-Client/Lib/Install.ahk: -------------------------------------------------------------------------------- 1 | Install := { Error_NonAdministrator: 0x01 2 | ,Error_InvalidParameters: 0x02 3 | ,Error_NonExistantFile: 0x03 4 | ,Error_NonExistantDir: 0x04 5 | ,Error_Extraction: 0x05 6 | ,Error_CopyToStdLib: 0x06 7 | ,Error_CreateRepoDir: 0x07 8 | ,Error_CreateRepoSubDir: 0x08 9 | ,Error_CreateArchiveDir: 0x09 10 | ,Error_ArchiveBackup: 0x0A 11 | ,Error_DeleteStdLib: 0x0B 12 | ,Error_DeleteStdLibSubDir: 0x0C 13 | ,Error_DeleteRepoSubDir: 0x0D 14 | ,Error_ToolInstallScript: 0x0E 15 | ,Error_ToolRemoveScript: 0x0F 16 | ,Error_AhkVersionInvalid: 0x10 17 | ,Error_NoAction: 0x11 18 | ,Error_RunInstaller: "ERROR" 19 | ,Success: 0xDEAD } ;random chosen value, "Maximum" value is 0x80000000 20 | ;see http://msdn.microsoft.com/en-us/library/system.environment.exitcode.aspx 21 | Install_ExitCode(e) { 22 | global Install 23 | for i, code in Install 24 | if (e==code) 25 | return i 26 | return "Error_Unknown" 27 | } -------------------------------------------------------------------------------- /Local-Client/Lib/JSON_Beautify.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | * "JSON_Beautify.ahk" by Joe DF (joedf@users.sourceforge.net) 3 | * ______________________________________________________________________ 4 | * "Transform Objects & JSON strings into nice or ugly JSON strings." 5 | * Uses VxE's JSON_FromObj() 6 | * 7 | * Released under The MIT License (MIT) 8 | * ______________________________________________________________________ 9 | * 10 | */ 11 | 12 | JSON_Uglify(JSON) { 13 | if IsObject(JSON) { 14 | return JSON_FromObj(JSON) 15 | } else { 16 | if JSON is space 17 | return "" 18 | StringReplace,JSON,JSON, `n,,A 19 | StringReplace,JSON,JSON, `r,,A 20 | StringReplace,JSON,JSON, % A_Tab,,A 21 | StringReplace,JSON,JSON, % Chr(08),,A 22 | StringReplace,JSON,JSON, % Chr(12),,A 23 | StringReplace,JSON,JSON, \\, % Chr(1),A ;watchout for escape sequence '\\', convert to '\1' 24 | _JSON:="", in_str:=0, l_char:="" 25 | Loop, Parse, JSON 26 | { 27 | if ( (!in_str) && (asc(A_LoopField)==0x20) ) 28 | continue 29 | if( (asc(A_LoopField)==0x22) && (asc(l_char)!=0x5C) ) 30 | in_str := !in_str 31 | _JSON .= (l_char:=A_LoopField) 32 | } 33 | StringReplace,_JSON,_JSON, % Chr(1),\\,A ;convert '\1' back to '\\' 34 | return _JSON 35 | } 36 | } 37 | 38 | JSON_Beautify(JSON, gap:="`t") { 39 | ;fork of http://pastebin.com/xB0fG9py 40 | JSON:=JSON_Uglify(JSON) 41 | StringReplace,JSON,JSON, \\, % Chr(1),A ;watchout for escape sequence '\\', convert to '\1' 42 | 43 | indent:="" 44 | 45 | if gap is number 46 | { 47 | i :=0 48 | while (i < gap) { 49 | indent .= " " 50 | i+=1 51 | } 52 | } else { 53 | indent := gap 54 | } 55 | 56 | _JSON:="", in_str:=0, k:=0, l_char:="" 57 | 58 | Loop, Parse, JSON 59 | { 60 | if (!in_str) { 61 | if ( (A_LoopField=="{") || (A_LoopField=="[") ) { 62 | _s:="" 63 | Loop % ++k 64 | _s.=indent 65 | _JSON .= A_LoopField "`n" _s 66 | continue 67 | } 68 | else if ( (A_LoopField=="}") || (A_LoopField=="]") ) { 69 | _s:="" 70 | Loop % --k 71 | _s.=indent 72 | _JSON .= "`n" _s A_LoopField 73 | continue 74 | } 75 | else if ( (A_LoopField==",") ) { 76 | _s:="" 77 | Loop % k 78 | _s.=indent 79 | _JSON .= A_LoopField "`n" _s 80 | continue 81 | } 82 | } 83 | if( (asc(A_LoopField)==0x22) && (asc(l_char)!=0x5C) ) 84 | in_str := !in_str 85 | _JSON .= (l_char:=A_LoopField) 86 | } 87 | StringReplace,_JSON,_JSON, % Chr(1),\\,A ;convert '\1' back to '\\' 88 | return _JSON 89 | } -------------------------------------------------------------------------------- /Local-Client/Lib/JSON_FromObj.ahk: -------------------------------------------------------------------------------- 1 | ; Copyright © 2013 VxE. All rights reserved. 2 | 3 | ; Serialize an object as JSON-like text OR format a string for inclusion therein. 4 | ; NOTE: scientific notation is treated as a string and hexadecimal as a number. 5 | ; NOTE: UTF-8 sequences are encoded as-is, NOT as their intended codepoint. 6 | json_fromobj( obj ) { 7 | 8 | If IsObject( obj ) 9 | { 10 | isarray := 0 ; an empty object could be an array... but it ain't, says I 11 | for key in obj 12 | if ( key != ++isarray ) 13 | { 14 | isarray := 0 15 | Break 16 | } 17 | 18 | for key, val in obj 19 | str .= ( A_Index = 1 ? "" : "," ) ( isarray ? "" : json_fromObj( key ) ":" ) json_fromObj( val ) 20 | 21 | return isarray ? "[" str "]" : "{" str "}" 22 | } 23 | else if obj IS NUMBER 24 | return obj 25 | ; else if obj IN null,true,false ; AutoHotkey does not natively distinguish these 26 | ; return obj 27 | 28 | ; Encode control characters, starting with backslash. 29 | StringReplace, obj, obj, \, \\, A 30 | StringReplace, obj, obj, % Chr(08), \b, A 31 | StringReplace, obj, obj, % A_Tab, \t, A 32 | StringReplace, obj, obj, `n, \n, A 33 | StringReplace, obj, obj, % Chr(12), \f, A 34 | StringReplace, obj, obj, `r, \r, A 35 | StringReplace, obj, obj, ", \", A 36 | StringReplace, obj, obj, /, \/, A 37 | While RegexMatch( obj, "[^\x20-\x7e]", key ) 38 | { 39 | str := Asc( key ) 40 | val := "\u" . Chr( ( ( str >> 12 ) & 15 ) + ( ( ( str >> 12 ) & 15 ) < 10 ? 48 : 55 ) ) 41 | . Chr( ( ( str >> 8 ) & 15 ) + ( ( ( str >> 8 ) & 15 ) < 10 ? 48 : 55 ) ) 42 | . Chr( ( ( str >> 4 ) & 15 ) + ( ( ( str >> 4 ) & 15 ) < 10 ? 48 : 55 ) ) 43 | . Chr( ( str & 15 ) + ( ( str & 15 ) < 10 ? 48 : 55 ) ) 44 | StringReplace, obj, obj, % key, % val, A 45 | } 46 | return """" obj """" 47 | } ; json_fromobj( obj ) -------------------------------------------------------------------------------- /Local-Client/Lib/JSON_ToObj.ahk: -------------------------------------------------------------------------------- 1 | ; Copyright © 2013 VxE. All rights reserved. 2 | 3 | ; Uses a two-pass iterative approach to deserialize a json string 4 | json_toobj( str ) { 5 | 6 | quot := """" ; firmcoded specifically for readability. Hardcode for (minor) performance gain 7 | ws := "`t`n`r " Chr(160) ; whitespace plus NBSP. This gets trimmed from the markup 8 | obj := {} ; dummy object 9 | objs := [] ; stack 10 | keys := [] ; stack 11 | isarrays := [] ; stack 12 | literals := [] ; queue 13 | y := nest := 0 14 | 15 | ; First pass swaps out literal strings so we can parse the markup easily 16 | StringGetPos, z, str, %quot% ; initial seek 17 | while !ErrorLevel 18 | { 19 | ; Look for the non-literal quote that ends this string. Encode literal backslashes as '\u005C' because the 20 | ; '\u..' entities are decoded last and that prevents literal backslashes from borking normal characters 21 | StringGetPos, x, str, %quot%,, % z + 1 22 | while !ErrorLevel 23 | { 24 | StringMid, key, str, z + 2, x - z - 1 25 | StringReplace, key, key, \\, \u005C, A 26 | If SubStr( key, 0 ) != "\" 27 | Break 28 | StringGetPos, x, str, %quot%,, % x + 1 29 | } 30 | ; StringReplace, str, str, %quot%%t%%quot%, %quot% ; this might corrupt the string 31 | str := ( z ? SubStr( str, 1, z ) : "" ) quot SubStr( str, x + 2 ) ; this won't 32 | 33 | ; Decode entities 34 | StringReplace, key, key, \%quot%, %quot%, A 35 | StringReplace, key, key, \b, % Chr(08), A 36 | StringReplace, key, key, \t, % A_Tab, A 37 | StringReplace, key, key, \n, `n, A 38 | StringReplace, key, key, \f, % Chr(12), A 39 | StringReplace, key, key, \r, `r, A 40 | StringReplace, key, key, \/, /, A 41 | while y := InStr( key, "\u", 0, y + 1 ) 42 | if ( A_IsUnicode || Abs( "0x" SubStr( key, y + 2, 4 ) ) < 0x100 ) 43 | key := ( y = 1 ? "" : SubStr( key, 1, y - 1 ) ) Chr( "0x" SubStr( key, y + 2, 4 ) ) SubStr( key, y + 6 ) 44 | 45 | literals.insert(key) 46 | 47 | StringGetPos, z, str, %quot%,, % z + 1 ; seek 48 | } 49 | 50 | ; Second pass parses the markup and builds the object iteratively, swapping placeholders as they are encountered 51 | key := isarray := 1 52 | 53 | ; The outer loop splits the blob into paths at markers where nest level decreases 54 | Loop Parse, str, % "]}" 55 | { 56 | StringReplace, str, A_LoopField, [, [], A ; mark any array open-brackets 57 | 58 | ; This inner loop splits the path into segments at markers that signal nest level increases 59 | Loop Parse, str, % "[{" 60 | { 61 | ; The first segment might contain members that belong to the previous object 62 | ; Otherwise, push the previous object and key to their stacks and start a new object 63 | if ( A_Index != 1 ) 64 | { 65 | objs.insert( obj ) 66 | isarrays.insert( isarray ) 67 | keys.insert( key ) 68 | obj := {} 69 | isarray := key := Asc( A_LoopField ) = 93 70 | } 71 | 72 | ; arrrrays are made by pirates and they have index keys 73 | if ( isarray ) 74 | { 75 | Loop Parse, A_LoopField, `,, % ws "]" 76 | if ( A_LoopField != "" ) 77 | obj[key++] := A_LoopField = quot ? literals.remove(1) : A_LoopField 78 | } 79 | ; otherwise, parse the segment as key/value pairs 80 | else 81 | { 82 | Loop Parse, A_LoopField, `, 83 | Loop Parse, A_LoopField, :, % ws 84 | if ( A_Index = 1 ) 85 | key := A_LoopField = quot ? literals.remove(1) : A_LoopField 86 | else if ( A_Index = 2 && A_LoopField != "" ) 87 | obj[key] := A_LoopField = quot ? literals.remove(1) : A_LoopField 88 | } 89 | nest += A_Index > 1 90 | } ; Loop Parse, str, % "[{" 91 | 92 | If !--nest 93 | Break 94 | 95 | ; Insert the newly closed object into the one on top of the stack, then pop the stack 96 | pbj := obj 97 | obj := objs.remove() 98 | obj[key := keys.remove()] := pbj 99 | If ( isarray := isarrays.remove() ) 100 | key++ 101 | 102 | } ; Loop Parse, str, % "]}" 103 | 104 | Return obj 105 | } ; json_toobj( str ) -------------------------------------------------------------------------------- /Local-Client/Lib/Licenses.ahk: -------------------------------------------------------------------------------- 1 | ;from https://github.com/ahkscript/ASPDM/blob/3c480181729a339a84d8e1d0c3672f1954c1320b/Network/lib/utils.php#L140-L176 2 | license(_s) { 3 | _s := Trim(_s) 4 | if ( (StrLen(_s)<2) || (InStr(_s,"ASPDM")) ) 5 | return {name:"ASPDM Default License",url:"https://github.com/ahkscript/ASPDM/blob/master/Specifications/License.md"} 6 | if (InStr(_s,"MIT")) 7 | return {name:"MIT License",url:"http://opensource.org/licenses/MIT"} 8 | if (InStr(_s,"BSD")) { 9 | if (InStr(_s,"2")) 10 | return {name:"BSD 2-Clause License",url:"http://opensource.org/licenses/BSD-2-Clause"} 11 | else if (InStr(_s,"3")) 12 | return {name:"BSD 3-Clause License",url:"http://opensource.org/licenses/BSD-3-Clause"} 13 | else 14 | return {name:_s,url:"http://opensource.org/licenses/BSD-3-Clause"} 15 | } 16 | if (InStr(_s,"LGPL")) { 17 | if (InStr(_s,"2.1")) 18 | return {name:"LGPL v2.1",url:"http://opensource.org/licenses/LGPL-2.1"} 19 | else if (InStr(_s,"3")) 20 | return {name:"LGPL v3.0",url:"http://opensource.org/licenses/LGPL-3.0"} 21 | else 22 | return {name:_s,url:"http://opensource.org/licenses/lgpl-license"} 23 | } 24 | if (InStr(_s,"GPL")) { 25 | if (InStr(_s,"2")) 26 | return {name:"GPL v2.0",url:"http://opensource.org/licenses/GPL-2.0"} 27 | else if (InStr(_s,"3")) 28 | return {name:"GPL v3.0",url:"http://opensource.org/licenses/GPL-3.0"} 29 | else 30 | return {name:_s,url:"http://opensource.org/licenses/gpl-license"} 31 | } 32 | if (InStr(_s,"Apache")) 33 | return {name:"Apache License v2.0",url:"http://opensource.org/licenses/Apache-2.0"} 34 | if (InStr(_s,"MPL") || InStr(_s,"Mozilla")) 35 | return {name:"Mozilla Public License v2.0",url:"http://opensource.org/licenses/MPL-2.0"} 36 | if (InStr(_s,"CC0") || "Public domain") 37 | return {name:"Public domain (CC0 1.0)",url:"http://creativecommons.org/publicdomain/zero/1.0"} 38 | if ( (InStr(_s,"CC")) || (InStr(_s,"creative")) || (InStr(_s,"commons")) ) 39 | return {name:_s,url:"http://creativecommons.org/licenses"} 40 | } -------------------------------------------------------------------------------- /Local-Client/Lib/Manifest.ahk: -------------------------------------------------------------------------------- 1 |  2 | Manifest_FromPackage(fileName) 3 | { 4 | try 5 | { 6 | if !FileExist(fileName) 7 | throw Exception("File does not exist!`nFile: """ fileName """") 8 | FileRead, data, *c %fileName% 9 | pData := &data 10 | if StrGet(pData, 8, "UTF-8") != "AHKPKG00" 11 | throw Exception("Invalid format!`nFile: """ fileName """") 12 | sz := NumGet(pData+8, "UInt") 13 | return StrGet(pData+12, sz, "UTF-8") 14 | } 15 | catch e 16 | throw e ; Propagate exception 17 | return 0 18 | } 19 | 20 | Manifest_FromFile(fileName) 21 | { 22 | try FileRead, tman, % fileName 23 | catch 24 | throw Exception("Cannot read manifest!") 25 | 26 | return Manifest_FromStr(tman) 27 | } 28 | 29 | Manifest_FromStr(tman) 30 | { 31 | man := JSON_ToObj(tman) 32 | if !IsObject(man) 33 | throw Exception("Manifest parse error!") 34 | 35 | out := {} 36 | 37 | ; Validation 38 | _ManValidateField(out, man, "id") 39 | if !_IsValidAHKIdentifier(out.id) 40 | throw Exception("Invalid package identifier (should be a valid AHK identifier): '" out.id "'") 41 | _ManValidateField(out, man, "name") 42 | _ManValidateField(out, man, "version") 43 | _ManValidateField(out, man, "type") 44 | _ManValidateField(out, man, "ahkbranch") 45 | _ManValidateField(out, man, "ahkversion") 46 | _ManValidateField(out, man, "ahkflavour") 47 | _ManValidateField(out, man, "author") 48 | _ManOptionalField(out, man, "description") 49 | _ManOptionalField(out, man, "license", "ASPDM Default License") 50 | _ManOptionalField(out, man, "tags") 51 | _ManOptionalField(out, man, "required") 52 | _ManOptionalField(out, man, "forumurl") 53 | _ManOptionalField(out, man, "screenshot") 54 | return out 55 | } 56 | 57 | _IsValidAHKIdentifier(x) 58 | { 59 | return !!RegExMatch(x, "^(?:[a-zA-Z0-9#_@\$]|[^\x00-\x7F])+$") 60 | } 61 | 62 | ObjHasNonEmptyKey(obj, field) 63 | { 64 | return ObjHasKey(obj, field) && obj[field] != "" 65 | } 66 | 67 | _ManValidateField(out, man, field) 68 | { 69 | if !ObjHasNonEmptyKey(man, field) 70 | throw Exception("Missing manifest field: '" field "'") 71 | out[field] := man[field] 72 | } 73 | 74 | _ManOptionalField(out, man, field, defValue := "") 75 | { 76 | out[field] := ObjHasNonEmptyKey(man, field) ? man[field] : defValue 77 | } 78 | 79 | -------------------------------------------------------------------------------- /Local-Client/Lib/Ping.ahk: -------------------------------------------------------------------------------- 1 | ; Ping() - http://ahkscript.org/boards/viewtopic.php?f=5&t=349#p3292 2 | 3 | Ping(Address="8.8.8.8",Timeout = 1000,ByRef Data = "",Length = 0,ByRef Result = "",ByRef ResultLength = 0) { 4 | NumericAddress := DllCall("ws2_32\inet_addr","AStr",Address,"UInt") 5 | If NumericAddress = 0xFFFFFFFF ;INADDR_NONE 6 | Return 0 ;throw Exception("Could not convert IP address string to numeric format.") 7 | 8 | If DllCall("LoadLibrary","Str","icmp","UPtr") = 0 ;NULL 9 | Return 0 ;throw Exception("Could not load ICMP library.") 10 | 11 | hPort := DllCall("icmp\IcmpCreateFile","UPtr") ;open port 12 | If hPort = -1 ;INVALID_HANDLE_VALUE 13 | Return 0 ;throw Exception("Could not open port.") 14 | 15 | StructLength := 278 ;ICMP_ECHO_REPLY structure 16 | VarSetCapacity(Reply,StructLength) 17 | Count := DllCall("icmp\IcmpSendEcho","UPtr",hPort,"UInt",NumericAddress,"UPtr",&Data,"UShort",Length,"UPtr",0,"UPtr",&Reply,"UInt",StructLength,"UInt",Timeout) 18 | 19 | If NumGet(Reply,4,"UInt") = 11001 ;IP_BUF_TOO_SMALL 20 | { 21 | VarSetCapacity(Reply,StructLength * Count) 22 | DllCall("icmp\IcmpSendEcho","UPtr",hPort,"UInt",NumericAddress,"UPtr",&Data,"UShort",Length,"UPtr",0,"UPtr",&Reply,"UInt",StructLength * Count,"UInt",Timeout) 23 | } 24 | 25 | If NumGet(Reply,4,"UInt") != 0 ;IP_SUCCESS 26 | Return 0 ;throw Exception("Could not send echo.") 27 | 28 | If !DllCall("icmp\IcmpCloseHandle","UInt",hPort) ;close port 29 | Return 0 ;throw Exception("Could not close port.") 30 | 31 | ResultLength := NumGet(Reply,12,"UShort") 32 | VarSetCapacity(Result,ResultLength) 33 | DllCall("RtlMoveMemory","UPtr",&Result,"UPtr",NumGet(Reply,16),"UPtr",ResultLength) 34 | Return, NumGet(Reply,8,"UInt") 35 | } -------------------------------------------------------------------------------- /Local-Client/Lib/SetEditPlaceholder.ahk: -------------------------------------------------------------------------------- 1 | /* http://ahkscript.org/boards/viewtopic.php?f=9&t=503&p=4648#p4263 2 | ## Funktion: SetEditPlaceholder 3 | ## Beschreibung: Setzt einen Platzhalter für ein Edit-Feld. Dieser ist nur sichtbar, solange nichts in dem Feld steht. Entspricht dem Attribut placeholder in HTML. 4 | ## Parameter: 5 | # control: Entweder ein HWND oder die zugewiesene Variable (als String!) des Steuerelements. 6 | # string: Der Text, der als Platzhalter im Steuerelement stehen soll. 7 | # showalways: Bestimmt, ob der Text auch angezeigt werden soll, während das Steuerelement Fokus hat. Standard: 0 (deaktiviert) 8 | ## return: "" (kein besonderer Wert) 9 | */ 10 | 11 | SetEditPlaceholder(control, string, showalways = 0){ 12 | if control is not number 13 | GuiControlGet, control, HWND, %control% 14 | if(!A_IsUnicode){ 15 | VarSetCapacity(wstring, (StrLen(wstring) * 2) + 1) 16 | DllCall("MultiByteToWideChar", UInt, 0, UInt, 0, UInt, &string, Int, -1, UInt, &wstring, Int, StrLen(string) + 1) 17 | } 18 | else 19 | wstring := string 20 | DllCall("SendMessageW", "UInt", control, "UInt", 0x1501, "UInt", showalways, "UInt", &wstring) 21 | return 22 | } -------------------------------------------------------------------------------- /Local-Client/Lib/Settings.ahk: -------------------------------------------------------------------------------- 1 | ;Settings Saved in AppData or A_scriptDir ("portable mode") 2 | 3 | Settings_File(sf:="settings.json") { 4 | if !FileExist(d:=(A_AppData "\aspdm")) 5 | FileCreateDir, % d 6 | f:=d "\" sf 7 | return f 8 | } 9 | 10 | Settings_Get() { 11 | f:=Settings_File() 12 | if !FileExist(f) { 13 | ;Save default settings 14 | Settings_Save(Settings_Default()) 15 | } 16 | FileRead,s, % f 17 | return Settings_Validate(JSON_ToObj(s)) 18 | } 19 | 20 | Settings_Validate(j) { 21 | j_default:=Settings_Default() 22 | vars:="stdlib_folder|userlib_folder|customlib_folder|local_repo|local_archive|hide_installed|Show_AllPackSources|only_show_stdlib|package_source|package_sources|Check_ClientUpdates|ContentSensitiveSearch|DefaultLibMode|RememberLibMode" 23 | loop,Parse,vars,`| 24 | if (!j.Haskey(A_LoopField)) 25 | j[A_LoopField]:=j_default[A_LoopField] 26 | return j 27 | } 28 | 29 | Settings_Default(key="") { 30 | j:={stdlib_folder: RegExReplace(A_AhkPath,"\w+\.exe","lib") 31 | ,userlib_folder: A_MyDocuments "\AutoHotkey\Lib" 32 | ,customlib_folder: A_MyDocuments "\AutoHotkey\aspdm\Lib" 33 | ,local_repo: A_AppData "\aspdm\repo" 34 | ,local_archive: A_AppData "\aspdm\archive" 35 | ,hide_installed: true 36 | ,Show_AllPackSources: false 37 | ,only_show_stdlib: false 38 | ,package_source: "aspdm.ahkscript.org" 39 | ,package_sources: ["aspdm.ahkscript.org","aspdm.2fh.co","aspdm.1eko.com"] 40 | ,Check_ClientUpdates: true 41 | ,ContentSensitiveSearch: true 42 | ,DefaultLibMode: "Global" 43 | ,RememberLibMode: false} 44 | if (key=="") 45 | return j 46 | return j[key] 47 | } 48 | 49 | Settings_Save(j) { 50 | s:=JSON_FromObj(j) 51 | f:=Settings_File() 52 | FileDelete, % f 53 | if ( FileExist(f) && (ErrorLevel) ) 54 | return ErrorLevel 55 | FileAppend, % s, % f 56 | return ErrorLevel 57 | } 58 | 59 | Settings_InstallGet(f) { 60 | f := f . "\aspdm.json" 61 | if !FileExist(f) { 62 | Settings_InstallSave(f,false) 63 | } 64 | FileRead,s, % f 65 | j:=JSON_ToObj(s) 66 | if IsObject(j.installed) 67 | return j 68 | return j:={installed:{}} 69 | } 70 | 71 | Settings_InstallSave(f,j) { 72 | if (j) 73 | j.installed:=Util_ArraySort(j.installed) 74 | else 75 | j := {installed:{}} 76 | s:=JSON_FromObj(j) 77 | f := f . "\aspdm.json" 78 | FileDelete, % f 79 | if ( FileExist(f) && (ErrorLevel) ) 80 | return ErrorLevel 81 | FileAppend, % s, % f 82 | return ErrorLevel 83 | } -------------------------------------------------------------------------------- /Local-Client/Lib/Util.ahk: -------------------------------------------------------------------------------- 1 |  2 | Util_VersionCompare(other,local) { 3 | ver_other:=StrSplit(other,".") 4 | ver_local:=StrSplit(local,".") 5 | for _index, _num in ver_local 6 | if ( (ver_other[_index]+0) > (_num+0) ) 7 | return 1 8 | else if ( (ver_other[_index]+0) < (_num+0) ) 9 | return 0 10 | return 0 11 | } 12 | 13 | ;Rename this Function. I don't have a good name for it now... 14 | Util_CSV2TagsObj(rawCSV:="") { 15 | obj:=Object() 16 | Loop, Parse, rawCSV, CSV 17 | if ( (k:=Trim(A_LoopField)) != "") 18 | obj.Insert(k) 19 | return obj 20 | } 21 | 22 | Util_TagsObj2CSV(TagsObj:="") { 23 | if !IsObject(TagsObj) 24 | return "" 25 | CSV:="" 26 | for index, tag in TagsObj 27 | if ( (k:=Trim(tag)) != "") 28 | CSV := CSV k "," 29 | return SubStr(CSV,1,-1) 30 | } 31 | 32 | Util_StrRepeat(s,r) { 33 | Loop % r 34 | k .= s 35 | return k 36 | } 37 | 38 | Util_SingleArray2Str(Arr,Delimiter:="",before:=0) { 39 | s:="" 40 | if (before) { 41 | for each, item in Arr 42 | if each is not integer 43 | continue 44 | else 45 | s.= Delimiter item 46 | } else { 47 | for each, item in Arr 48 | if each is not integer 49 | continue 50 | else 51 | s.= item Delimiter 52 | s:=SubStr(s,1,(-1*Abs(StrLen(Delimiter)))) 53 | } 54 | return s 55 | } 56 | 57 | Util_ArrayInsert(ByRef Arr,InsArr) { 58 | for each, item in InsArr 59 | Arr.Insert(item) 60 | return Arr 61 | } 62 | 63 | Util_ObjCount(obj) { 64 | ;see http://ahkscript.org/boards/viewtopic.php?f=37&t=3950&p=21579#p21578 65 | return NumGet(&obj+4*A_PtrSize) ; obj->mFieldCount -- OK for v1.1.15.01 and v2.0-a48 66 | } 67 | 68 | Util_ArraySort(Arr) { ;AutoSort 69 | t:=Object() 70 | for k, v in Arr 71 | t[RegExReplace(v,"\s")]:=v 72 | for k, v in t 73 | Arr[A_Index]:=v 74 | return Arr 75 | } 76 | 77 | Util_ShortPath(p,l=50) { 78 | VarSetCapacity(_p, (A_IsUnicode?2:1)*StrLen(p) ) 79 | DllCall("shlwapi\PathCompactPathEx" 80 | ,"str", _p 81 | ,"str", p 82 | ,"uint", abs(l) 83 | ,"uint", 0) 84 | return _p 85 | } 86 | 87 | Util_FullPath(p) { 88 | Loop, %p% 89 | return A_LoopFileLongPath 90 | } 91 | 92 | Util_TempDir(outDir="") 93 | { 94 | Loop 95 | tempName := "~temp" A_TickCount ".tmp", tempDir := ((!outDir)?A_Temp:outDir) "\" tempName 96 | until !FileExist(tempDir) 97 | return tempDir 98 | } 99 | 100 | Util_TempFile(d:="") 101 | { 102 | if ( !StrLen(d) || !FileExist(d) ) 103 | d:=A_Temp 104 | Loop 105 | tempName := d "\~temp" A_TickCount ".tmp" 106 | until !FileExist(tempName) 107 | return tempName 108 | } 109 | 110 | Util_FileAlign(f) 111 | { 112 | while f.Pos & 3 113 | f.WriteUChar(0) 114 | } 115 | 116 | Util_FileWriteStr(f, ByRef str) 117 | { 118 | pos := f.Pos 119 | f.WriteUInt(0) 120 | f.Write(str) 121 | size := (tmp := f.Pos) - pos - 4 122 | f.Pos := pos 123 | f.WriteUInt(size) 124 | f.Pos := tmp 125 | Util_FileAlign(f) 126 | } 127 | 128 | Util_ReadLenStr(ptr, ByRef endPtr) 129 | { 130 | len := NumGet(ptr+0, "UInt") 131 | endPtr := ptr + ((len+7)&~3) 132 | return StrGet(ptr+4, len, "UTF-8") 133 | } 134 | 135 | Util_DirTree(dir) 136 | { 137 | data := [], ldir := StrLen(dir)+1 138 | Loop, %dir%\*.*, 1 139 | { 140 | StringTrimLeft, name, A_LoopFileFullPath, %ldir% 141 | e := { name: name, fullPath: A_LoopFileLongPath } 142 | 143 | if name in package.json,.aspdm_ignore ;ignores will parsed here in future for effeciency 144 | continue 145 | IfInString, A_LoopFileAttrib, D 146 | { 147 | e.isDir := true 148 | e.contents := Util_DirTree(A_LoopFileFullPath) 149 | } 150 | data.Insert(e) 151 | } 152 | return data 153 | } 154 | 155 | Util_isASCII(s) 156 | { 157 | Loop, Parse, s 158 | { 159 | z:=Asc(A_LoopField) 160 | ;if ( (z<=8) || (z==11) || (z==12) || (z==127) || ((z>=14) && (z<=31)) ) 161 | if ( z==0x09 || z==0x0A || z==0x0D || (0x20 <= z && z <= 0x7E) ) 162 | continue 163 | else 164 | return 0 165 | } 166 | return 1 167 | } 168 | -------------------------------------------------------------------------------- /Local-Client/MetaDataViewer_Test.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | ;#Warn ; Recommended for catching common errors. 3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | #Include Lib\NetworkAPI.ahk 6 | #Include Lib\Licenses.ahk 7 | 8 | Gui, Add, ListView, x4 y4 w500 h250 gListViewEvents, File|Name|Version|Author|index 9 | Gui, Show,,%A_scriptName% - DoubleClick to view screenshot... 10 | 11 | Gui, projector:+ToolWindow 12 | Gui, projector:Margin, 0, 0 13 | Gui, projector:Add, ActiveX, w600 h400 vWB, Shell.Explorer 14 | WB.silent := true 15 | 16 | LV_Add("","Downloading...") 17 | LV_ModifyCol(1,"100") 18 | LV_ModifyCol(2,"220") 19 | LV_ModifyCol(3,"60") 20 | LV_ModifyCol(4,"80") 21 | LV_ModifyCol(5,"0") 22 | if !Ping() { 23 | MsgBox, 16, , Network Error : Check your internet connection.`nThe program will now exit. 24 | ExitApp 25 | } 26 | Progress CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, Waiting..., Loading Package List... 27 | Progress Show 28 | 29 | packs:=API_ListAll() 30 | total:=Util_ObjCount(packs) 31 | for each, info in packs 32 | LV_Add("",info["id"] ".ahkp",info["name"],info["version"],info["author"],each) 33 | LV_Delete(1) 34 | Sleep 100 35 | Progress, Off 36 | return 37 | 38 | ListViewEvents: 39 | if A_GuiEvent = DoubleClick 40 | { 41 | if (!A_EventInfo) 42 | return 43 | 44 | Gui +OwnDialogs 45 | LV_GetText(objRef,A_EventInfo,5) 46 | t := packs[objRef].id ".ahkp - Screenshot" 47 | pName := packs[objRef].name 48 | pAuthor := packs[objRef].author 49 | pType := packs[objRef].type 50 | pVer := packs[objRef].version 51 | pReq := packs[objRef].required, pReq:=(StrLen(pReq))?pReq:"None." 52 | pURL := packs[objRef].forumurl, _:=license(packs[objRef].license) 53 | pLicense := _.name, pLicenseURL:=_.url 54 | pScreenshot := packs[objRef].screenshot, d := packs[objRef].description 55 | pDesc := (StrLen(d))?d:"No description." 56 | 57 | Gui 1:+Disabled 58 | Gui, projector:+Owner1 59 | pImgErr:=(StrLen(pScreenshot))?"ERROR: failed to load screenshot.":"No screenshot." 60 | HTML_page = 61 | ( 62 | 63 | 64 | 65 | 66 |

%pName%

67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
Package details
Version : %pVer%
Type : %pType%
Author : %pAuthor%
URL : %pURL%
Required Packages : %pReq%
License : %pLicense%
76 | 77 |
78 |

Screenshot

79 | %pImgErr% 80 | 81 | 82 | ) 83 | Display(WB,HTML_page) 84 | Gui, projector:Show,,%t% 85 | } 86 | return 87 | 88 | Display(wb,html_str) { 89 | wb.Navigate("about:blank") 90 | while wb.readystate != 4 91 | sleep, 50 92 | wb.document.Write(html_str) 93 | } 94 | 95 | projectorGuiClose: 96 | Gui 1:-Disabled 97 | Gui projector:hide 98 | return 99 | 100 | GuiClose: 101 | ExitApp 102 | -------------------------------------------------------------------------------- /Local-Client/Package_Moderator.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 3 | #Include Lib\LV_InCellEdit.ahk 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | ;<<<<<<<< HEADER END >>>>>>>>> 6 | 7 | all_vars:=["id","version","name","ahkbranch","ahkflavour","description","author","license","required","forumurl","screenshot","type","tags"] 8 | 9 | Gui, Add, ListView, w430 h270 vLVMetaData +Grid -Readonly hwndHLV1 AltSubmit, Attribute|Value 10 | Gui, Add, TreeView, wp h135 vTVFiles 11 | Gui, Add, Button, w80 gOpen, Open 12 | Gui, Add, Button, yp x+4 w80 gSave +Disabled, Save As... 13 | Gui, Add, Button, yp x+4 w150 gOpenPKG +Disabled vopkgBtn, Open in Package Builder 14 | Gui, Add, Button, yp x+4 w80 gotmpdir +Disabled vtmpdirBtn, Inspect files... 15 | Gui, Show 16 | 17 | LV_ModifyCol(1,"80") 18 | LV_ModifyCol(2,"340") 19 | gosub,PrepLV 20 | gosub,PrepTV 21 | return 22 | 23 | GuiClose: 24 | FileRemoveDir, %A_temp%\ASPDM_tmp, 1 25 | ExitApp 26 | 27 | GuiDropFiles: 28 | Loop, parse, A_GuiEvent, `n 29 | { 30 | FirstFile = %A_LoopField% 31 | Break 32 | } 33 | if FileExist(FirstFile) { 34 | thePack:=FirstFile 35 | gosub,_open 36 | } else { 37 | MsgBox, 16, , Could not open the dragged file. 38 | } 39 | return 40 | 41 | PrepTV: 42 | TV_Delete() 43 | TV_baseDirID := TV_Add("Package Base Dir") 44 | return 45 | 46 | PrepLV: 47 | LV_Delete() 48 | for each, item in all_vars 49 | LV_Add("",item) 50 | ICELV1 := New LV_InCellEdit(HLV1) 51 | ICELV1.SetColumns(2) 52 | return 53 | 54 | Open: 55 | Gui +OwnDialogs 56 | FileSelectFile, thePack, 3, , Open AHKP Package, AHKP Package (*.ahkp) 57 | if !ErrorLevel 58 | gosub,_open 59 | return 60 | 61 | _open: 62 | ; Package Metadata 63 | mdata:=Manifest_FromStr(Manifest_FromPackage(thePack)) 64 | LV_Delete() 65 | for each, item in mdata 66 | { 67 | if (IsObject(item)) 68 | LV_Add("",each,Util_TagsObj2CSV(item)) 69 | else 70 | LV_Add("",each,item) 71 | } 72 | 73 | ; Package tree 74 | tmpDir:=Util_TempDir(A_Temp "\ASPDM_tmp") 75 | eTree:=Package_Extract(tmpDir,thePack,1) 76 | gosub,PrepTV 77 | GuiControl, -Redraw, TVFiles 78 | eObj2TV(eTree,TV_baseDirID) 79 | GuiControl, +Redraw, TVFiles 80 | GuiControl, -Disabled, tmpdirBtn 81 | 82 | ; Save a copy of the extracted manifest in the extraction folder 83 | outman:=JSON_Beautify(mdata) 84 | FileAppend, %outman%, %tmpDir%\package.json 85 | 86 | GuiControl, -Disabled, opkgBtn 87 | return 88 | 89 | OpenPKG: 90 | MsgBox, Once you close %A_ScriptName%, all the package files that were extracted to a temporary folder will be deleted. 91 | Run, Package_Builder.ahk "%tmpDir%\package.json" 92 | return 93 | 94 | eObj2TV(obj,parentID) { 95 | for key, val in obj 96 | { 97 | if IsObject(val) { 98 | kName:=SubStr(key,2) 99 | SplitPath,kName,kName 100 | SubID:=TV_Add(kName,parentID) 101 | eObj2TV(val,SubID) 102 | } else { 103 | SplitPath,val,kName 104 | TV_Add(kName,parentID) 105 | } 106 | } 107 | } 108 | 109 | Save: 110 | return 111 | 112 | otmpdir: 113 | Run, explorer.exe %tmpDir% 114 | return 115 | -------------------------------------------------------------------------------- /Local-Client/Res/ahk.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Res/ahk.ico -------------------------------------------------------------------------------- /Local-Client/Res/ahk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Res/ahk.png -------------------------------------------------------------------------------- /Local-Client/Res/greenpixel.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Res/greenpixel.bmp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/AHKsock/README.md: -------------------------------------------------------------------------------- 1 | AHKsock - A simple AHK implementation of Winsock (TCP/IP) 2 | ========================================================= 3 | 4 | AHKsock is a high-level wrapper which I have written to facilitate the use of 5 | the Winsock APIs in AHK. It will allow you to create clients and servers that 6 | can communicate with each other, purely written in AHK! Forum thread is [here] 7 | (http://www.autohotkey.com/board/topic/53827-ahksock-a-simple-ahk-implementation 8 | -of-winsock-tcpip/). 9 | 10 | AHKsock includes three [examples](examples/): 11 | * In Example 1, the server listens for clients and sends some data to any client 12 | that connects. This is a very simple example to show the basics of AHKsock. 13 | * In Example 2, the server sends a file to any client that connects. There are 14 | three types of servers. The first one uses the TransmitFile() function provided 15 | by Windows while the second one reads from the file itself and transfer to a 16 | single client at a time. The third type can serve multiple clients 17 | simultaneously. 18 | * In Example 3, two peers connect to each other to start chatting. This is a 19 | great example of a symmetrical connection. Whichever is started first becomes 20 | the server, while the second becomes the client. However, they both behave in 21 | exactly the same way once connected to each other. 22 | * In Example 4, we can look up IPs from hostnames and vice-versa. 23 | 24 | Additional resources on Winsock and sockets in general: 25 | * [Winsock Programmer's FAQ](http://tangentsoft.net/wskfaq/) 26 | * [WinSock Development Information](http://sockets.com/) 27 | * [MSDN Windows Sockets 2 Reference](http://msdn.microsoft.com/en-us/library/ms740673) 28 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/AHKsock/example_4.ahk: -------------------------------------------------------------------------------- 1 | /*! TheGood 2 | AHKsock - A simple AHK implementation of Winsock. 3 | AHKsock Example 4 - Hostname & IP Lookups 4 | http://www.autohotkey.com/forum/viewtopic.php?p=355775 5 | Last updated: August 24th, 2010 6 | 7 | This is just a very simple example that demonstrates the use of two inverse functions: AHKsock_GetAddrInfo and 8 | AHKsock_GetNameInfo. The code should be simple enough to follow. 9 | */ 10 | ;We'll need to allow more than one instance to test it on the same machine 11 | #SingleInstance, Off 12 | 13 | ;Needed if AHKsock isn't in one of your lib folders 14 | ;#Include %A_ScriptDir%\AHKsock.ahk 15 | 16 | ;Set up an OnExit routine 17 | OnExit, GuiClose 18 | 19 | ;Make the GUI 20 | Gui, Add, Text,, What would you like to do? 21 | Gui, Add, Button, wp gbtnGAI, Hostname to IP(s) 22 | Gui, Add, Button, wp gbtnGNI, IP to Hostname 23 | Gui, Show 24 | Return 25 | 26 | GuiClose: 27 | GuiEscape: 28 | AHKsock_Close() ;No sockets to actually close here. We just do it to cleanup WinSock. 29 | ExitApp 30 | 31 | btnGAI: 32 | Gui, +OwnDialogs 33 | 34 | ;Random examples for the default value of the InputBox 35 | sEx1 := "www.google.com" 36 | sEx2 := "localhost" 37 | sEx3 := A_ComputerName 38 | Random, Default, 1, 3 39 | 40 | ;Ask for the hostname 41 | InputBox, sName, Hostname to IP(s), Please enter the hostname to look up:,,, 120,,,,, % sEx%Default% 42 | If ErrorLevel 43 | Return 44 | 45 | ;Get the IPs 46 | If (i := AHKsock_GetAddrInfo(sName, sIPList)) { 47 | MsgBox 0x10, Error, % "AHKsock_GetAddrInfo failed.`nReturn value = " i ".`nErrorLevel = " ErrorLevel 48 | Return 49 | } 50 | 51 | ;Display 52 | MsgBox 0x40, Results, % "Hostname:`n" sName "`n`nIP addresses found:`n" sIPList 53 | 54 | Return 55 | 56 | btnGNI: 57 | Gui, +OwnDialogs 58 | 59 | ;Random service examples for the default value of the InputBox 60 | sEx1 := 7 ;echo 61 | sEx2 := 21 ;ftp 62 | sEx3 := 25 ;SMTP 63 | sEx4 := 80 ;http 64 | Random, Default, 1, 4 65 | 66 | ;Ask for the IP 67 | InputBox, sIPandPort, IP to Hostname, Please enter the IP address (and optionally the port) to look up:,,, 120,,,,, % "127.0.0.1:" sEx%Default% 68 | If ErrorLevel 69 | Return 70 | 71 | ;Separate the IP and the port 72 | If Not (i := InStr(sIPandPort, ":")) 73 | sIP := sIPandPort, sPort := 0 74 | Else sIP := SubStr(sIPandPort, 1, i - 1), sPort := SubStr(sIPandPort, i + 1) 75 | 76 | ;Get the hostname 77 | If (i := AHKsock_GetNameInfo(sIP, sName, sPort, sService)) { 78 | MsgBox 0x10, Error, % "AHKsock_GetNameInfo failed.`nReturn value = " i ".`nErrorLevel = " ErrorLevel 79 | Return 80 | } 81 | 82 | ;Display 83 | MsgBox 0x40, Results, % "IP address: " sIP (sPort ? "`nPort: " sPort : "") "`n`nHostname: " sName (sPort ? "`nService: " sService : "") 84 | 85 | Return 86 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/AHKsock/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.13.01", 9 | "author":"TheGood", 10 | "description":"AHKsock - A simple AHK implementation of Winsock.\nLast updated: January 19, 2011\n\nAHKsock is a high-level wrapper which I have written to facilitate the use of the Winsock APIs in AHK. It will allow you to create clients and servers that can communicate with each other, purely written in AHK!", 11 | "forumurl":"http:\/\/www.autohotkey.com\/board\/topic\/53827-ahksock-a-simple-ahk-implementation-of-winsock-tcpip\/", 12 | "id":"AHKsock", 13 | "license":"GPL", 14 | "name":"AHKsock - A simple AHK implementation of Winsock.", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "winsock", 21 | "socket", 22 | "internet", 23 | "server", 24 | "client", 25 | "connection" 26 | ], 27 | "type":"Library", 28 | "version":"1.0.0.0" 29 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/anchor/Lib/Anchor.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | Revised version for 64-bit/unicode - author unknown // posted by uname 3 | http://www.autohotkey.com/board/topic/91997-gui-anchor-for-current-version-of-ahk/?p=580170 4 | 5 | 6 | Function: Anchor 7 | Defines how controls should be automatically positioned relative to the new dimensions of a window when resized. 8 | 9 | Parameters: 10 | cl - a control HWND, associated variable name or ClassNN to operate on 11 | a - (optional) one or more of the anchors: 'x', 'y', 'w' (width) and 'h' (height), 12 | optionally followed by a relative factor, e.g. "x h0.5" 13 | r - (optional) true to redraw controls, recommended for GroupBox and Button types 14 | 15 | Examples: 16 | > "xy" ; bounds a control to the bottom-left edge of the window 17 | > "w0.5" ; any change in the width of the window will resize the width of the control on a 2:1 ratio 18 | > "h" ; similar to above but directrly proportional to height 19 | 20 | Remarks: 21 | To assume the current window size for the new bounds of a control (i.e. resetting) simply omit the second and third parameters. 22 | However if the control had been created with DllCall() and has its own parent window, 23 | the container AutoHotkey created GUI must be made default with the +LastFound option prior to the call. 24 | For a complete example see anchor-example.ahk. 25 | 26 | License: 27 | - Version 4.60a 28 | - Dedicated to the public domain (CC0 1.0) 29 | */ 30 | Anchor(i, a := "", r := false) { 31 | static c, cs := 12, cx := 255, cl := 0, g, gs := 8, gl := 0, gpi, gw, gh, z := 0, k := 0xffff, ptr 32 | if z = 0 33 | VarSetCapacity(g, gs * 99, 0), VarSetCapacity(c, cs * cx, 0), ptr := A_PtrSize ? "Ptr" : "UInt", z := true 34 | if !WinExist("ahk_id" . i) { 35 | GuiControlGet t, Hwnd, %i% 36 | if ErrorLevel = 0 37 | i := t 38 | else ControlGet i, Hwnd,, %i% 39 | } 40 | VarSetCapacity(gi, 68, 0), DllCall("GetWindowInfo", "UInt", gp := DllCall("GetParent", "UInt", i), ptr, &gi) 41 | , giw := NumGet(gi, 28, "Int") - NumGet(gi, 20, "Int"), gih := NumGet(gi, 32, "Int") - NumGet(gi, 24, "Int") 42 | if (gp != gpi) { 43 | gpi := gp 44 | loop %gl% 45 | if NumGet(g, cb := gs * (A_Index - 1), "UInt") == gp { 46 | gw := NumGet(g, cb + 4, "Short"), gh := NumGet(g, cb + 6, "Short"), gf := 1 47 | break 48 | } 49 | if !gf 50 | NumPut(gp, g, gl, "UInt"), NumPut(gw := giw, g, gl + 4, "Short"), NumPut(gh := gih, g, gl + 6, "Short"), gl += gs 51 | } 52 | ControlGetPos dx, dy, dw, dh,, ahk_id %i% 53 | loop %cl% 54 | if NumGet(c, cb := cs * (A_Index - 1), "UInt") == i { 55 | if (a = "") { 56 | cf := 1 57 | break 58 | } 59 | giw -= gw, gih -= gh, as := 1, dx := NumGet(c, cb + 4, "Short"), dy := NumGet(c, cb + 6, "Short") 60 | , cw := dw, dw := NumGet(c, cb + 8, "Short"), ch := dh, dh := NumGet(c, cb + 10, "Short") 61 | loop Parse, a, xywh 62 | if A_Index > 1 63 | av := SubStr(a, as, 1), as += 1 + StrLen(A_LoopField) 64 | , d%av% += (InStr("yh", av) ? gih : giw) * (A_LoopField + 0 ? A_LoopField : 1) 65 | DllCall("SetWindowPos", "UInt", i, "UInt", 0, "Int", dx, "Int", dy 66 | , "Int", InStr(a, "w") ? dw : cw, "Int", InStr(a, "h") ? dh : ch, "Int", 4) 67 | if r != 0 68 | DllCall("RedrawWindow", "UInt", i, "UInt", 0, "UInt", 0, "UInt", 0x0101) ; RDW_UPDATENOW | RDW_INVALIDATE 69 | return 70 | } 71 | if cf != 1 72 | cb := cl, cl += cs 73 | bx := NumGet(gi, 48, "UInt"), by := NumGet(gi, 16, "Int") - NumGet(gi, 8, "Int") - gih - NumGet(gi, 52, "UInt") 74 | if cf = 1 75 | dw -= giw - gw, dh -= gih - gh 76 | NumPut(i, c, cb, "UInt"), NumPut(dx - bx, c, cb + 4, "Short"), NumPut(dy - by, c, cb + 6, "Short") 77 | , NumPut(dw, c, cb + 8, "Short"), NumPut(dh, c, cb + 10, "Short") 78 | return true 79 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/anchor/anchor-example.ahk: -------------------------------------------------------------------------------- 1 | ; #Include Anchor.ahk ; this is only requred if the script is not in your StdLib directory 2 | 3 | Gui, +Resize +MinSize 4 | Gui, Add, Edit, vMyEdit w400 h150, Resize this window 5 | Gui, Add, Button, vMyButton x300 y160 Default gWin2, Open Window 2 6 | Gui, Add, GroupBox, vMyGroup Section xm h10 w250, Relative positions are also supported ... 7 | Gui, Add, ComboBox, vMyCombo Section xs+50 ys+25, Item 1|Item 2||Item 3 8 | Gui, Add, Text, vMyText ys, Select 9 | GuiControl, Focus, MyButton 10 | Gui, Show, , Anchor Example 11 | 12 | Gui, 2:Default 13 | Gui, +Resize +MinSize +ToolWindow 14 | Gui, Add, Text, , More sizing... 15 | Gui, Add, ListBox, vLB Section xm r8, Item 1|Item 2||Item 3 16 | Gui, Add, Edit, vEdit ys r8 17 | Gui, Add, Button, vCloseButton w50 gGuiClose, Close 18 | 19 | Gui, 1:Default 20 | Return 21 | 22 | F10:: ; reset control position 23 | GuiControl, Move, MyEdit, w100 h100 ; move control to a size relative to current Gui dimensions 24 | ; since this script uses multiple GUIs it's necessary to indicate which one Anchor should use by prefixing the name as done here: 25 | Anchor("1:MyEdit") ; reset by passing only the first parameter 26 | Return 27 | 28 | Win2: 29 | Gui, 2:Show, , Window 30 | Return 31 | 32 | GuiSize: 33 | Anchor("MyEdit", "wh") 34 | Anchor("MyButton", "xy") 35 | Anchor("MyGroup", "yw", true) 36 | Anchor("MyCombo", "y") 37 | Anchor("MyText", "y") 38 | Return 39 | 40 | 2GuiSize: 41 | Anchor("LB", "w0.5 h") 42 | Anchor("Edit", "x0.5 w0.5 h") 43 | Anchor("CloseButton", "x0.75 y") 44 | Return 45 | 46 | ~*Esc:: 47 | GuiClose: 48 | ExitApp 49 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/anchor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.14.03", 9 | "author":"polyethene", 10 | "description":"Revised version for 64-bit\/unicode - author unknown \/\/ posted by uname\nhttp:\/\/www.autohotkey.com\/board\/topic\/91997-gui-anchor-for-current-version-of-ahk\/?p=580170\n\n\nFunction: Anchor\n\tDefines how controls should be automatically positioned relative to the new dimensions of a window when resized.\n\nParameters:\n\tcl - a control HWND, associated variable name or ClassNN to operate on\n\ta - (optional) one or more of the anchors: 'x', 'y', 'w' (width) and 'h' (height),\n\t\toptionally followed by a relative factor, e.g. \"x h0.5\"\n\tr - (optional) true to redraw controls, recommended for GroupBox and Button types\n\nExamples:\n\t> \"xy\" ; bounds a control to the bottom-left edge of the window\n\t> \"w0.5\" ; any change in the width of the window will resize the width of the control on a 2:1 ratio\n\t> \"h\" ; similar to above but directrly proportional to height\n\nRemarks:\n\tTo assume the current window size for the new bounds of a control (i.e. resetting) simply omit the second and third parameters.\n\tHowever if the control had been created with DllCall() and has its own parent window,\n\t\tthe container AutoHotkey created GUI must be made default with the +LastFound option prior to the call.\n\tFor a complete example see anchor-example.ahk.\n\nLicense:\n\t- Version 4.60a \n\t- Dedicated to the public domain (CC0 1.0) ", 11 | "forumurl":"http:\/\/www.autohotkey.com\/board\/topic\/4105-control-anchoring-v4-for-resizing-windows\/", 12 | "id":"anchor", 13 | "license":"Public domain (CC0 1.0)", 14 | "name":"Anchor", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "window", 21 | "GUI", 22 | "position", 23 | "size", 24 | "sizing", 25 | "dimensions", 26 | "controls" 27 | ], 28 | "type":"Library", 29 | "version":"4.60.1.0" 30 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/gdip/Gdip.Tutorial.1-Draw.Shapes.ahk: -------------------------------------------------------------------------------- 1 | ; gdi+ ahk tutorial 1 written by tic (Tariq Porter) 2 | ; Requires Gdip.ahk either in your Lib folder as standard library or using #Include 3 | ; 4 | ; Tutorial to draw a single ellipse and rectangle to the screen 5 | 6 | #SingleInstance, Force 7 | #NoEnv 8 | SetBatchLines, -1 9 | 10 | ; Uncomment if Gdip.ahk is not in your standard library 11 | ;#Include, Gdip.ahk 12 | 13 | ; Start gdi+ 14 | If !pToken := Gdip_Startup() 15 | { 16 | MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system 17 | ExitApp 18 | } 19 | OnExit, Exit 20 | 21 | ; Set the width and height we want as our drawing area, to draw everything in. This will be the dimensions of our bitmap 22 | Width :=1400, Height := 1050 23 | 24 | ; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption 25 | Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs 26 | 27 | ; Show the window 28 | Gui, 1: Show, NA 29 | 30 | ; Get a handle to this window we have created in order to update it later 31 | hwnd1 := WinExist() 32 | 33 | ; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything 34 | hbm := CreateDIBSection(Width, Height) 35 | 36 | ; Get a device context compatible with the screen 37 | hdc := CreateCompatibleDC() 38 | 39 | ; Select the bitmap into the device context 40 | obm := SelectObject(hdc, hbm) 41 | 42 | ; Get a pointer to the graphics of the bitmap, for use with drawing functions 43 | G := Gdip_GraphicsFromHDC(hdc) 44 | 45 | ; Set the smoothing mode to antialias = 4 to make shapes appear smother (only used for vector drawing and filling) 46 | Gdip_SetSmoothingMode(G, 4) 47 | 48 | ; Create a fully opaque red brush (ARGB = Transparency, red, green, blue) to draw a circle 49 | pBrush := Gdip_BrushCreateSolid(0xffff0000) 50 | 51 | ; Fill the graphics of the bitmap with an ellipse using the brush created 52 | ; Filling from coordinates (100,50) an ellipse of 200x300 53 | Gdip_FillEllipse(G, pBrush, 100, 500, 200, 300) 54 | 55 | ; Delete the brush as it is no longer needed and wastes memory 56 | Gdip_DeleteBrush(pBrush) 57 | 58 | ; Create a slightly transparent (66) blue brush (ARGB = Transparency, red, green, blue) to draw a rectangle 59 | pBrush := Gdip_BrushCreateSolid(0x660000ff) 60 | 61 | ; Fill the graphics of the bitmap with a rectangle using the brush created 62 | ; Filling from coordinates (250,80) a rectangle of 300x200 63 | Gdip_FillRectangle(G, pBrush, 250, 80, 300, 200) 64 | 65 | ; Delete the brush as it is no longer needed and wastes memory 66 | Gdip_DeleteBrush(pBrush) 67 | 68 | 69 | ; Update the specified window we have created (hwnd1) with a handle to our bitmap (hdc), specifying the x,y,w,h we want it positioned on our screen 70 | ; So this will position our gui at (0,0) with the Width and Height specified earlier 71 | UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width, Height) 72 | 73 | 74 | ; Select the object back into the hdc 75 | SelectObject(hdc, obm) 76 | 77 | ; Now the bitmap may be deleted 78 | DeleteObject(hbm) 79 | 80 | ; Also the device context related to the bitmap may be deleted 81 | DeleteDC(hdc) 82 | 83 | ; The graphics may now be deleted 84 | Gdip_DeleteGraphics(G) 85 | Return 86 | 87 | ;####################################################################### 88 | 89 | Exit: 90 | ; gdi+ may now be shutdown on exiting the program 91 | Gdip_Shutdown(pToken) 92 | ExitApp 93 | Return -------------------------------------------------------------------------------- /Local-Client/Test_Packages/gdip/Gdip.Tutorial.12-Pixelate.a.bitmap.using.machine.code.ahk: -------------------------------------------------------------------------------- 1 | ; gdi+ ahk tutorial 12 written by tic (Tariq Porter) 2 | ; Requires Gdip.ahk either in your Lib folder as standard library or using #Include 3 | ; 4 | ; Tutorial to pixelate a bitmap using machine code 5 | 6 | #SingleInstance, Force 7 | #NoEnv 8 | SetBatchLines, -1 9 | 10 | ; Uncomment if Gdip.ahk is not in your standard library 11 | ;#Include, Gdip.ahk 12 | 13 | ; Start gdi+ 14 | If !pToken := Gdip_Startup() 15 | { 16 | MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system 17 | ExitApp 18 | } 19 | OnExit, Exit 20 | 21 | ; Create a layered window that is always on top as usual and get a handle to the window 22 | Gui, 1: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop 23 | Gui, 1: Show, NA 24 | hwnd1 := WinExist() 25 | 26 | ; If the image we want to work with does not exist on disk, then download it... 27 | If !FileExist("MJ.jpg") 28 | UrlDownloadToFile, http://www.autohotkey.net/~tic/MJ.jpg, MJ.jpg 29 | 30 | ; Get a bitmap from the image 31 | pBitmap := Gdip_CreateBitmapFromFile("MJ.jpg") 32 | ;pBitmap := Gdip_BitmapFromScreen() 33 | If !pBitmap 34 | { 35 | MsgBox, 48, File loading error!, Could not load the image specified 36 | ExitApp 37 | } 38 | ; Get the width and height of the bitmap we have just created from the file 39 | Width := Gdip_GetImageWidth(pBitmap), Height := Gdip_GetImageHeight(pBitmap) 40 | 41 | ; We also need to create 42 | pBitmapOut := Gdip_CreateBitmap(Width, Height) 43 | 44 | ; As normal create a gdi bitmap and get the graphics for it to draw into 45 | hbm := CreateDIBSection(Width, Height), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm) 46 | G := Gdip_GraphicsFromHDC(hdc) 47 | 48 | ; Call WM_LBUTTONDOWN every time the gui is clicked, to allow it to be dragged 49 | OnMessage(0x201, "WM_LBUTTONDOWN") 50 | 51 | ; Update the window with the hdc so that it has a position and dimension for future calls to not 52 | ; have to explicitly pass them 53 | UpdateLayeredWindow(hwnd1, hdc, (A_ScreenWidth-Width)//2, (A_ScreenHeight-Height)//2, Width, Height) 54 | 55 | ; Set a timer to update the gui with our pixelated bitmap 56 | SetTimer, Update, 50 57 | return 58 | 59 | ;####################################################################### 60 | 61 | Update: 62 | ; Some simple checks to see if we are increasing or decreasing the pixelation 63 | ; v is the block size of the pixelation and dir is the direction (inc/decreasing) 64 | if (v <= 1) 65 | v := 1, dir := !dir 66 | else if (v >= 30) 67 | v := 30, dir := !dir 68 | 69 | ; Call Gdip_PixelateBitmap with the bitmap we retrieved earlier and the block size of the pixels 70 | ; The function returns the pixelated bitmap, and doesn't dispose of the original bitmap 71 | Gdip_PixelateBitmap(pBitmap, pBitmapOut, dir ? ++v : --v) 72 | 73 | ; We can optionally clear the graphics we will be drawing to, but if we know there will be no transparencies then 74 | ; it doesn't matter 75 | ;Gdip_GraphicsClear(G) 76 | 77 | ; We then draw our pixelated bitmap into our graphics and dispose of the pixelated bitmap 78 | Gdip_DrawImage(G, pBitmapOut, 0, 0, Width, Height, 0, 0, Width, Height) 79 | 80 | ; We can now update our window, and don't need to provide a position or dimensions as we don't want them to change 81 | UpdateLayeredWindow(hwnd1, hdc) 82 | return 83 | 84 | ;####################################################################### 85 | 86 | ; This is called on left click to allow to drag 87 | WM_LBUTTONDOWN() 88 | { 89 | PostMessage, 0xA1, 2 90 | } 91 | 92 | ;####################################################################### 93 | 94 | ; On exit, dispose of everything created 95 | Esc:: 96 | Exit: 97 | Gdip_DisposeImage(pBitmapOut), Gdip_DisposeImage(pBitmap) 98 | SelectObject(hdc, obm), DeleteObject(hbm), DeleteDC(hdc) 99 | Gdip_DeleteGraphics(G) 100 | Gdip_Shutdown(pToken) 101 | ExitApp 102 | return -------------------------------------------------------------------------------- /Local-Client/Test_Packages/gdip/Gdip.Tutorial.2-Draw.Outlined.Shapes.ahk: -------------------------------------------------------------------------------- 1 | ; gdi+ ahk tutorial 2 written by tic (Tariq Porter) 2 | ; Requires Gdip.ahk either in your Lib folder as standard library or using #Include 3 | ; 4 | ; Tutorial to draw a single ellipse and rectangle to the screen, but just the outlines of these shapes 5 | 6 | #SingleInstance, Force 7 | #NoEnv 8 | SetBatchLines, -1 9 | 10 | ; Uncomment if Gdip.ahk is not in your standard library 11 | ;#Include, Gdip.ahk 12 | 13 | ; Start gdi+ 14 | If !pToken := Gdip_Startup() 15 | { 16 | MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system 17 | ExitApp 18 | } 19 | OnExit, Exit 20 | 21 | ; Set the width and height we want as our drawing area, to draw everything in. This will be the dimensions of our bitmap 22 | Width := 600, Height := 400 23 | 24 | ; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption 25 | Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs 26 | 27 | ; Show the window 28 | Gui, 1: Show, NA 29 | 30 | ; Get a handle to this window we have created in order to update it later 31 | hwnd1 := WinExist() 32 | 33 | ; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything 34 | hbm := CreateDIBSection(Width, Height) 35 | 36 | ; Get a device context compatible with the screen 37 | hdc := CreateCompatibleDC() 38 | 39 | ; Select the bitmap into the device context 40 | obm := SelectObject(hdc, hbm) 41 | 42 | ; Get a pointer to the graphics of the bitmap, for use with drawing functions 43 | G := Gdip_GraphicsFromHDC(hdc) 44 | 45 | ; Set the smoothing mode to antialias = 4 to make shapes appear smother (only used for vector drawing and filling) 46 | Gdip_SetSmoothingMode(G, 4) 47 | 48 | ; Create a fully opaque red pen (ARGB = Transparency, red, green, blue) of width 3 (the thickness the pen will draw at) to draw a circle 49 | pPen := Gdip_CreatePen(0xffff0000, 3) 50 | 51 | ; Draw an ellipse into the graphics of the bitmap (this being only the outline of the shape) using the pen created 52 | ; This pen has a width of 3, and is drawing from coordinates (100,50) an ellipse of 200x300 53 | Gdip_DrawEllipse(G, pPen, 100, 50, 200, 300) 54 | 55 | ; Delete the pen as it is no longer needed and wastes memory 56 | Gdip_DeletePen(pPen) 57 | 58 | ; Create a slightly transparent (66) blue pen (ARGB = Transparency, red, green, blue) to draw a rectangle 59 | ; This pen is wider than the last one, with a thickness of 10 60 | pPen := Gdip_CreatePen(0x660000ff, 10) 61 | 62 | ; Draw a rectangle onto the graphics of the bitmap using the pen just created 63 | ; Draws the rectangle from coordinates (250,80) a rectangle of 300x200 and outline width of 10 (specified when creating the pen) 64 | Gdip_DrawRectangle(G, pPen, 250, 80, 300, 200) 65 | 66 | ; Delete the brush as it is no longer needed and wastes memory 67 | Gdip_DeletePen(pPen) 68 | 69 | ; Update the specified window we have created (hwnd1) with a handle to our bitmap (hdc), specifying the x,y,w,h we want it positioned on our screen 70 | ; So this will position our gui at (0,0) with the Width and Height specified earlier 71 | UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width, Height) 72 | 73 | 74 | ; Select the object back into the hdc 75 | SelectObject(hdc, obm) 76 | 77 | ; Now the bitmap may be deleted 78 | DeleteObject(hbm) 79 | 80 | ; Also the device context related to the bitmap may be deleted 81 | DeleteDC(hdc) 82 | 83 | ; The graphics may now be deleted 84 | Gdip_DeleteGraphics(G) 85 | Return 86 | 87 | ;####################################################################### 88 | 89 | Exit: 90 | ; gdi+ may now be shutdown on exiting the program 91 | Gdip_Shutdown(pToken) 92 | ExitApp 93 | Return -------------------------------------------------------------------------------- /Local-Client/Test_Packages/gdip/Gdip.Tutorial.4-Draw.Circles.ahk: -------------------------------------------------------------------------------- 1 | ; gdi+ ahk tutorial 4 written by tic (Tariq Porter) 2 | ; Requires Gdip.ahk either in your Lib folder as standard library or using #Include 3 | ; 4 | ; Tutorial to fill the screen with randomly hatched ellipses 5 | 6 | #SingleInstance, Force 7 | #NoEnv 8 | SetBatchLines, -1 9 | 10 | ; Uncomment if Gdip.ahk is not in your standard library 11 | ;#Include, Gdip.ahk 12 | 13 | ; Start gdi+ 14 | If !pToken := Gdip_Startup() 15 | { 16 | MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system 17 | ExitApp 18 | } 19 | OnExit, Exit 20 | 21 | ; Get the dimensions of the primary monitor 22 | SysGet, MonitorPrimary, MonitorPrimary 23 | SysGet, WA, MonitorWorkArea, %MonitorPrimary% 24 | WAWidth := WARight-WALeft 25 | WAHeight := WABottom-WATop 26 | 27 | ; Create a layered window (+E0x80000) that is always on top (+AlwaysOnTop), has no taskbar entry or caption 28 | Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs 29 | 30 | ; Show the window 31 | Gui, 1: Show, NA 32 | 33 | ; Get a handle to this window we have created in order to update it later 34 | hwnd1 := WinExist() 35 | 36 | ; Create a gdi bitmap with width and height of the work area 37 | hbm := CreateDIBSection(WAWidth, WAHeight) 38 | 39 | ; Get a device context compatible with the screen 40 | hdc := CreateCompatibleDC() 41 | 42 | ; Select the bitmap into the device context 43 | obm := SelectObject(hdc, hbm) 44 | 45 | ; Get a pointer to the graphics of the bitmap, for use with drawing functions 46 | G := Gdip_GraphicsFromHDC(hdc) 47 | 48 | ; Set the smoothing mode to antialias = 4 to make shapes appear smother (only used for vector drawing and filling) 49 | Gdip_SetSmoothingMode(G, 4) 50 | 51 | ; Set a timer to draw a new ellipse every 200ms 52 | SetTimer, DrawCircle, 200 53 | Return 54 | 55 | ;####################################################################### 56 | 57 | DrawCircle: 58 | ; Get a random colour for the background and foreground of hatch style used to fill the ellipse, 59 | ; as well as random brush style, x and y coordinates and width/height 60 | Random, RandBackColour, 0x00000000, 0xffffffff 61 | Random, RandForeColour, 0x00000000, 0xffffffff 62 | Random, RandBrush, 0, 53 63 | Random, RandElipseWidth, 1, 200 64 | Random, RandElipseHeight, 1, 200 65 | Random, RandElipsexPos, %WALeft%, % WAWidth-RandElipseWidth ;% 66 | Random, RandElipseyPos, %WATop%, % WAHeight-RandElipseHeight ;% 67 | 68 | ; Create the random brush 69 | pBrush := Gdip_BrushCreateHatch(RandBackColour, RandForeColour, RandBrush) 70 | 71 | ; Fill the graphics of the bitmap with an ellipse using the brush created 72 | Gdip_FillEllipse(G, pBrush, RandElipsexPos, RandElipseyPos, RandElipseWidth, RandElipseHeight) 73 | 74 | ; Update the specified window 75 | UpdateLayeredWindow(hwnd1, hdc, WALeft, WATop, WAWidth, WAHeight) 76 | 77 | ; Delete the brush as it is no longer needed and wastes memory 78 | Gdip_DeleteBrush(pBrush) 79 | Return 80 | 81 | ;####################################################################### 82 | 83 | Exit: 84 | ; Select the object back into the hdc 85 | SelectObject(hdc, obm) 86 | 87 | ; Now the bitmap may be deleted 88 | DeleteObject(hbm) 89 | 90 | ; Also the device context related to the bitmap may be deleted 91 | DeleteDC(hdc) 92 | 93 | ; The graphics may now be deleted 94 | Gdip_DeleteGraphics(G) 95 | 96 | ; ...and gdi+ may now be shutdown 97 | Gdip_Shutdown(pToken) 98 | ExitApp 99 | Return -------------------------------------------------------------------------------- /Local-Client/Test_Packages/gdip/Gdip.Tutorial.5-Create.Bitmap.ahk: -------------------------------------------------------------------------------- 1 | ; gdi+ ahk tutorial 5 written by tic (Tariq Porter) 2 | ; Requires Gdip.ahk either in your Lib folder as standard library or using #Include 3 | ; 4 | ; Example to create a bitmap, fill it with some shapes and save to file 5 | 6 | #SingleInstance, Force 7 | #NoEnv 8 | SetBatchLines, -1 9 | 10 | ; Uncomment if Gdip.ahk is not in your standard library 11 | ;#Include, Gdip.ahk 12 | 13 | ; Start gdi+ 14 | If !pToken := Gdip_Startup() 15 | { 16 | MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system 17 | ExitApp 18 | } 19 | 20 | ; Create a 400x400 pixel gdi+ bitmap 21 | pBitmap := Gdip_CreateBitmap(400, 400) 22 | 23 | ; Get a pointer to the graphics of the bitmap, for use with drawing functions 24 | G := Gdip_GraphicsFromImage(pBitmap) 25 | 26 | ; Set the smoothing mode to antialias = 4 to make shapes appear smoother (only used for vector drawing and filling) 27 | Gdip_SetSmoothingMode(G, 4) 28 | 29 | ; Create a hatched brush with background and foreground colours specified (HatchStyleBackwardDiagonal = 3) 30 | pBrush := Gdip_BrushCreateHatch(0xff553323, 0xffc09e8e, 31) 31 | ; Draw into the graphics of the bitmap from coordinates (100,80) a filled rectangle with 200 width and 250 height using the brush created 32 | Gdip_FillRectangle(G, pBrush, (400-200)//2, (400-250)//2, 200, 250) 33 | ; Delete the brush created to save memory as we don't need the same brush anymore 34 | Gdip_DeleteBrush(pBrush) 35 | 36 | ; Create a hatched brush with background and foreground colours specified (HatchStyleBackwardDiagonal = 3) 37 | pBrush := Gdip_BrushCreateHatch(0xff000000, 0xff4d3538, 31) 38 | ; Draw an ellipse into the graphics with the brush we just created. 40 degree sweep angle starting at 250 degrees (0 degrees from right horizontal) 39 | Gdip_FillPie(G, pBrush, (400-80)//2, (400-80)//2, 80, 80, 250, 40) 40 | ; Delete the brush created to save memory as we don't need the same brush anymore 41 | Gdip_DeleteBrush(pBrush) 42 | 43 | ; Create a white brush 44 | pBrushWhite := Gdip_BrushCreateSolid(0xffffffff) 45 | ; Create a black brush 46 | pBrushBlack := Gdip_BrushCreateSolid(0xff000000) 47 | 48 | ; Loop to draw 2 ellipses filling them with white then black in the centre of each 49 | Loop, 2 50 | { 51 | x := (A_Index = 1) ? 120 : 220, y := 100 52 | Gdip_FillEllipse(G, pBrushWhite, x, y, 60, 60) 53 | x += 15, y+=15 54 | Gdip_FillEllipse(G, pBrushBlack, x, y, 30, 30) 55 | } 56 | ; Delete both brushes 57 | Gdip_DeleteBrush(pBrushWhite), Gdip_DeleteBrush(pBrushBlack) 58 | 59 | ; Create a hatched brush with background and foreground colours specified (HatchStyle30Percent = 10) 60 | pBrush := Gdip_BrushCreateHatch(0xfff22231, 0xffa10f19, 10) 61 | ; Again draw another ellipse into the graphics with the specified brush 62 | Gdip_FillPie(G, pBrush, 150, 200, 100, 80, 0, 180) 63 | ; Delete the brush 64 | Gdip_DeleteBrush(pBrush) 65 | 66 | ; Create a 3 pixel wide slightly transparent black pen 67 | pPen := Gdip_CreatePen(0xbb000000, 3) 68 | 69 | ; Create some coordinates for the lines in format x1,y1,x2,y2 then loop and draw all the lines 70 | Lines = 180,200,130,220|180,190,130,195|220,200,270,220|220,190,270,195 71 | Loop, Parse, Lines, | 72 | { 73 | StringSplit, Pos, A_LoopField, `, 74 | Gdip_DrawLine(G, pPen, Pos1, Pos2, Pos3, Pos4) 75 | } 76 | ; Delete the pen 77 | Gdip_DeletePen(pPen) 78 | 79 | 80 | ; Save the bitmap to file "File.png" (extension can be .png,.bmp,.jpg,.tiff,.gif) 81 | ; Bear in mind transparencies may be lost with some image formats and will appear black 82 | Gdip_SaveBitmapToFile(pBitmap, "File.png") 83 | 84 | ; The bitmap can be deleted 85 | Gdip_DisposeImage(pBitmap) 86 | 87 | ; The graphics may now be deleted 88 | Gdip_DeleteGraphics(G) 89 | 90 | ; ...and gdi+ may now be shutdown 91 | Gdip_Shutdown(pToken) 92 | ExitApp 93 | Return -------------------------------------------------------------------------------- /Local-Client/Test_Packages/gdip/Gdip.Tutorial.6-Image.Editing.ahk: -------------------------------------------------------------------------------- 1 | ; gdi+ ahk tutorial 6 written by tic (Tariq Porter) 2 | ; Requires Gdip.ahk either in your Lib folder as standard library or using #Include 3 | ; 4 | ; Example to take files from disk, load them onto a background and save back to disk 5 | 6 | #SingleInstance, Force 7 | #NoEnv 8 | SetBatchLines, -1 9 | 10 | ; Uncomment if Gdip.ahk is not in your standard library 11 | ;#Include, Gdip.ahk 12 | 13 | ; Specify both of the files we are going to use 14 | File1 = mario.png 15 | File2 = link.png 16 | 17 | ; Start gdi+ 18 | If !pToken := Gdip_Startup() 19 | { 20 | MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system 21 | ExitApp 22 | } 23 | 24 | ; If the images we want to work with do not exist on disk, then download them... 25 | If !(FileExist(File1) && FileExist(File2)) 26 | { 27 | UrlDownloadToFile, http://www.autohotkey.net/~tic/mario.png, mario.png 28 | UrlDownloadToFile, http://www.autohotkey.net/~tic/link.png, link.png 29 | } 30 | 31 | 32 | ; Create a 500x500 pixel gdi+ bitmap (this will be the entire drawing area we have to play with) 33 | pBitmap := Gdip_CreateBitmap(600, 600) 34 | 35 | ; Get a pointer to the graphics of the bitmap, for use with drawing functions 36 | G := Gdip_GraphicsFromImage(pBitmap) 37 | 38 | ; Create a green brush (this will be used to fill the background with green). The brush is fully opaque (ARGB) 39 | pBrush := Gdip_BrushCreateSolid(0xff00ff00) 40 | 41 | ; Filll the entire graphics of the bitmap with the green brush (this will be out background colour) 42 | Gdip_FillRectangle(G, pBrush, 0, 0, 600, 600) 43 | 44 | ; Delete the brush created to save memory as we don't need the same brush anymore 45 | Gdip_DeleteBrush(pBrush) 46 | 47 | 48 | ; Get bitmaps for both the files we are going to be working with 49 | pBitmapFile1 := Gdip_CreateBitmapFromFile(File1), pBitmapFile2 := Gdip_CreateBitmapFromFile(File2) 50 | 51 | ; Get the width and height of the 1st bitmap 52 | Width := Gdip_GetImageWidth(pBitmapFile1), Height := Gdip_GetImageHeight(pBitmapFile1) 53 | 54 | ; Draw the 1st bitmap (1st image) onto our "canvas" (the graphics of the original bitmap we created) with the same height and same width 55 | ; at coordinates (25,30).....We will be ignoring the matrix parameter for now. This can be used to change opacity and colours when drawing 56 | Gdip_DrawImage(G, pBitmapFile1, 25, 30, Width, Height, 0, 0, Width, Height) 57 | 58 | 59 | ; Do the same again for the 2nd file, but change the coordinates to (250,260)..... 60 | 61 | Width := Gdip_GetImageWidth(pBitmapFile2), Height := Gdip_GetImageHeight(pBitmapFile2) 62 | Gdip_DrawImage(G, pBitmapFile2, 250, 260, Width, Height, 0, 0, Width, Height) 63 | 64 | ; Dispose of both of these bitmaps we created from the images on disk, as they are now been used...They are on 65 | ; the graphics of the bitmap of our created "canvas" 66 | Gdip_DisposeImage(pBitmapFile1), Gdip_DisposeImage(pBitmapFile2) 67 | 68 | 69 | ; Save the bitmap to file "File.png" (extension can be .png,.bmp,.jpg,.tiff,.gif) 70 | ; Bear in mind transparencies may be lost with some image formats and will appear black 71 | Gdip_SaveBitmapToFile(pBitmap, "FinalImage.png") 72 | 73 | ; The bitmap can be deleted 74 | Gdip_DisposeImage(pBitmap) 75 | 76 | ; The graphics may now be deleted 77 | Gdip_DeleteGraphics(G) 78 | 79 | ; ...and gdi+ may now be shutdown 80 | Gdip_Shutdown(pToken) 81 | ExitApp 82 | Return -------------------------------------------------------------------------------- /Local-Client/Test_Packages/gdip/Gdip.Tutorial.7-Draw.draggable.rounded.rectangle.ahk: -------------------------------------------------------------------------------- 1 | ; gdi+ ahk tutorial 7 written by tic (Tariq Porter) 2 | ; Requires Gdip.ahk either in your Lib folder as standard library or using #Include 3 | ; 4 | ; Tutorial to draw a rounded rectangle as a gui that you can drag 5 | 6 | #SingleInstance, Force 7 | #NoEnv 8 | SetBatchLines, -1 9 | 10 | ; Uncomment if Gdip.ahk is not in your standard library 11 | ;#Include, Gdip.ahk 12 | 13 | ; Start gdi+ 14 | If !pToken := Gdip_Startup() 15 | { 16 | MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system 17 | ExitApp 18 | } 19 | OnExit, Exit 20 | 21 | ; Set the width and height we want as our drawing area, to draw everything in. This will be the dimensions of our bitmap 22 | Width := 300, Height := 200 23 | 24 | ; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption 25 | Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs 26 | 27 | ; Show the window 28 | Gui, 1: Show, NA 29 | 30 | ; Get a handle to this window we have created in order to update it later 31 | hwnd1 := WinExist() 32 | 33 | ; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything 34 | hbm := CreateDIBSection(Width, Height) 35 | 36 | ; Get a device context compatible with the screen 37 | hdc := CreateCompatibleDC() 38 | 39 | ; Select the bitmap into the device context 40 | obm := SelectObject(hdc, hbm) 41 | 42 | ; Get a pointer to the graphics of the bitmap, for use with drawing functions 43 | G := Gdip_GraphicsFromHDC(hdc) 44 | 45 | ; Set the smoothing mode to antialias = 4 to make shapes appear smother (only used for vector drawing and filling) 46 | Gdip_SetSmoothingMode(G, 4) 47 | 48 | ; Create a partially transparent, black brush (ARGB = Transparency, red, green, blue) to draw a rounded rectangle with 49 | pBrush := Gdip_BrushCreateSolid(0x77000000) 50 | 51 | ; Fill the graphics of the bitmap with a rounded rectangle using the brush created 52 | ; Filling the entire graphics - from coordinates (0, 0) the entire width and height 53 | ; The last parameter (20) is the radius of the circles used for the rounded corners 54 | Gdip_FillRoundedRectangle(G, pBrush, 0, 0, Width, Height, 20) 55 | 56 | ; Delete the brush as it is no longer needed and wastes memory 57 | Gdip_DeleteBrush(pBrush) 58 | 59 | 60 | ; Update the specified window we have created (hwnd1) with a handle to our bitmap (hdc), specifying the x,y,w,h we want it positioned on our screen 61 | ; With some simple maths we can place the gui in the centre of our primary monitor horizontally and vertically at the specified heigth and width 62 | UpdateLayeredWindow(hwnd1, hdc, (A_ScreenWidth-Width)//2, (A_ScreenHeight-Height)//2, Width, Height) 63 | 64 | ; By placing this OnMessage here. The function WM_LBUTTONDOWN will be called every time the user left clicks on the gui 65 | OnMessage(0x201, "WM_LBUTTONDOWN") 66 | 67 | 68 | ; Select the object back into the hdc 69 | SelectObject(hdc, obm) 70 | 71 | ; Now the bitmap may be deleted 72 | DeleteObject(hbm) 73 | 74 | ; Also the device context related to the bitmap may be deleted 75 | DeleteDC(hdc) 76 | 77 | ; The graphics may now be deleted 78 | Gdip_DeleteGraphics(G) 79 | Return 80 | 81 | ;####################################################################### 82 | 83 | ; This function is called every time the user clicks on the gui 84 | ; The PostMessage will act on the last found window (this being the gui that launched the subroutine, hence the last parameter not being needed) 85 | WM_LBUTTONDOWN() 86 | { 87 | PostMessage, 0xA1, 2 88 | } 89 | 90 | ;####################################################################### 91 | 92 | Exit: 93 | ; gdi+ may now be shutdown on exiting the program 94 | Gdip_Shutdown(pToken) 95 | ExitApp 96 | Return -------------------------------------------------------------------------------- /Local-Client/Test_Packages/gdip/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.0,v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.0.48.05", 9 | "author":"tic (Tariq Porter)", 10 | "description":"Package includes Gdip.ahk, Gdip_All.ahk and all the given examples.\n\nFull featured gdi+ library with examples by me tic (Tariq Porter)\nSupports AHK and AHK_L\n\nThis library can be distributed for commercial and non-commercial use and I actively encourage both. I would appreciate it if people give acknowledgement for my work and would be nice to have pasted once at the top of your script something similar to:\n\nThanks to tic (Tariq Porter) for his GDI+ Library\nhttp:\/\/www.autohotkey.com\/forum\/viewtopic.php?t=32238\n\nor anything more elaborate if you feel like it!", 11 | "forumurl":"http:\/\/www.autohotkey.com\/forum\/viewtopic.php?t=32238", 12 | "id":"gdip", 13 | "license":"ASPDM Default License", 14 | "name":"GDI+ standard library", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "gdip", 21 | "graphics", 22 | "image", 23 | "stdlib", 24 | "draw", 25 | "animation" 26 | ], 27 | "type":"Library", 28 | "version":"1.45.0.0" 29 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/isbinfile/Lib/IsBinFile.ahk: -------------------------------------------------------------------------------- 1 | isBinFile(Filename,NumBytes=32,Minimum=4,complexunicode=1) { 2 | 3 | file:=FileOpen(Filename,"r") 4 | file.Position:=0 ;force position to 0 (zero) 5 | nbytes:=file.RawRead(rawbytes,NumBytes) ;read bytes 6 | file.Close() ;close file 7 | 8 | if (nbytes < Minimum) ;recommended 4 minimum for unicode detection 9 | return 0 ;asume text file, if too short 10 | 11 | t:=0, i:=0, bytes:=[] ;Initialize vars 12 | 13 | loop % nbytes ;create c-style bytes array 14 | bytes[(A_Index-1)]:=Numget(&rawbytes,(A_Index-1),"UChar") 15 | 16 | ;determine BOM if possible/existant 17 | if (bytes[0]=0xFE && bytes[1]=0xFF) 18 | || (bytes[0]=0xFF && bytes[1]=0xFE) 19 | return 0 ;text Utf-16 BE/LE file 20 | if (bytes[0]=0xEF && bytes[1]=0xBB && bytes[2]=0xBF) 21 | return 0 ;text Utf-8 file 22 | if (bytes[0]=0x00 && bytes[1]=0x00 23 | && bytes[2]=0xFE && bytes[3]=0xFF) 24 | || (bytes[0]=0xFF && bytes[1]=0xFE 25 | && bytes[2]=0x00 && bytes[3]=0x00) 26 | return 0 ;text Utf-32 BE/LE file 27 | 28 | if (complexunicode) { 29 | while(i126) 79 | or ((bytes[(A_Index-1)]<32) and (bytes[(A_Index-1)]>13)) 80 | return 1 81 | } 82 | 83 | return 0 84 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/isbinfile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.13.01", 9 | "author":"joedf", 10 | "description":"Detect wether a file is text-based or simply a \"binary\" file.\n\nUsage: isBinFile(Filename,NumBytes=32,Minimum=4,complexunicode=1)\n\nNumbytes is the number of btes to read for detection, less is faster but not as accurate. 32 should be enough.\n\nMinimum is the number of bytes for a file to be possibly considered as binary file. In other words, if the file is too short, it will be assumed to be a text file.", 11 | "forumurl":"http:\/\/ahkscript.org\/boards\/viewtopic.php?f=5&t=144&start=20#p1806", 12 | "id":"isbinfile", 13 | "license":"MIT License", 14 | "name":"IsBinFile", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "binary", 21 | "files", 22 | "detection", 23 | "test", 24 | "text", 25 | "analyse", 26 | "unicode" 27 | ], 28 | "type":"Library", 29 | "version":"1.0.0.0" 30 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/ASCII.ahk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/libcrypt/Examples/ASCII.ahk -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/Base64.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | FileSelectFile, FilePath,, %A_MyDocuments%\..\Pictures, %A_ScriptName% - Pick a (small) PNG, Images (*.png) 4 | if !ErrorLevel 5 | { 6 | PngFile := FileOpen(FilePath, "r") 7 | PngFile.RawRead(PngData, PngFile.Length) 8 | LC_Base64_Encode(Base64, PngData, PngFile.Length) 9 | Clipboard := "data:image/png;base64," Base64 10 | MsgBox, Paste into your browsers address bar 11 | } 12 | 13 | Loop, 50 14 | { 15 | Random, Char, 100, 1000 16 | Unicode .= Chr(Char) 17 | } 18 | 19 | Base64 := LC_Base64_EncodeText(Unicode) 20 | MsgBox, % Unicode "`n`n-> LC_Base64_EncodeText ->`n`n" 21 | . Base64 "`n`n-> LC_Base64_DecodeText ->`n`n" 22 | . LC_Base64_DecodeText(Base64) 23 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/BinHex.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | ; Generate some random binary 4 | Size := 32 5 | VarSetCapacity(Var, Size, 0) 6 | Loop, %Size% 7 | { 8 | Random, Rand, 0, 255 9 | NumPut(Rand, Var, A_Index-1, "UChar") 10 | Hex .= Format("{:02x}", Rand) 11 | } 12 | 13 | ; Compare Bin2Hex against what we put in 14 | LC_Bin2Hex(Out, Var, Size) 15 | MsgBox, % Hex "`n" Out 16 | 17 | ; Pull a string from a hat 18 | Hex := "48656c6c6f20576f726c642100" 19 | LC_Hex2Bin(Out, Hex) 20 | MsgBox, % StrGet(&Out, "CP0") 21 | 22 | ; Put a string in and display it prettily 23 | String := ":) :\ :| :/ :( ^_^ .-. .______. <(^_^)> <(^_^)^" 24 | Size := StrPut(String, "CP0") 25 | VarSetCapacity(Var, Size, 0) 26 | StrPut(String, &Var, "CP0") 27 | LC_Bin2Hex(Out, Var, Size, True) 28 | Gui, Font,, Consolas 29 | Gui, Add, Text,, % Out 30 | Gui, Show 31 | return 32 | 33 | Escape:: 34 | GuiClose: 35 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/CRC32.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | str := "The quick brown fox jumps over the lazy dog" 8 | MsgBox, % "String:`n" (str) "`n`nCRC32:`n" LC_CRC32(str) 9 | 10 | hex := "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67" 11 | MsgBox, % "Hex:`n" (hex) "`n`nCRC32:`n" LC_HexCRC32(hex) 12 | 13 | file := "C:\Windows\notepad.exe" 14 | MsgBox, % "File:`n" (file) "`n`nCRC32:`n" LC_FileCRC32(file) 15 | 16 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/Caesar.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | MsgBox % LC_Caesar("Hello", 2) "`n" LC_Caesar("Hello", 20) 8 | 9 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/Div2.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | Original := "Jack was here" 4 | Encoded := LC_Div2_encode(Original) 5 | Decoded := LC_Div2_decode(Encoded) 6 | 7 | MsgBox, 8 | ( 9 | Original :`t%Original% 10 | Encoded :`t%Encoded% 11 | Decoded :`t%Decoded% 12 | ) -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/HMAC.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | message := "The quick brown fox jumps over the lazy dog" 8 | key := "key" 9 | 10 | MsgBox, % "Message:`t`t" (message) "`nKey:`t`t" (key) "`n`n" 11 | . "MD2:`t`t" LC_MD2(message) "`nMD2 + LC_HMAC:`t" LC_HMAC(key, message, "md2") "`n`n" 12 | . "MD4:`t`t" LC_MD4(message) "`nMD4 + LC_HMAC:`t" LC_HMAC(key, message, "md4") "`n`n" 13 | . "MD5:`t`t" LC_MD5(message) "`nMD5 + LC_HMAC:`t" LC_HMAC(key, message, "md5") "`n`n" 14 | . "SHA:`t`t" LC_SHA(message) "`nSHA + LC_HMAC:`t" LC_HMAC(key, message, "sha") "`n`n" 15 | . "SHA256:`t`t" LC_SHA256(message) "`nSHA256 + LC_HMAC:`t" LC_HMAC(key, message, "sha256") "`n`n" 16 | . "SHA384:`t`t" LC_SHA384(message) "`nSHA384 + LC_HMAC:`t" LC_HMAC(key, message, "sha384") "`n`n" 17 | . "SHA512:`t`t" LC_SHA512(message) "`nSHA512 + LC_HMAC:`t" LC_HMAC(key, message, "sha512") 18 | 19 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/MD2.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | str := "The quick brown fox jumps over the lazy dog" 8 | MsgBox, % "String:`n" (str) "`n`nMD2:`n" LC_MD2(str) 9 | 10 | hex := "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67" 11 | MsgBox, % "Hex:`n" (hex) "`n`nMD2:`n" LC_HexMD2(hex) 12 | 13 | file := "C:\Windows\notepad.exe" 14 | MsgBox, % "File:`n" (file) "`n`nMD2:`n" LC_FileMD2(file) 15 | 16 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/MD4.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | str := "The quick brown fox jumps over the lazy dog" 8 | MsgBox, % "String:`n" (str) "`n`nMD4:`n" LC_MD4(str) 9 | 10 | hex := "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67" 11 | MsgBox, % "Hex:`n" (hex) "`n`nMD4:`n" LC_HexMD4(hex) 12 | 13 | file := "C:\Windows\notepad.exe" 14 | MsgBox, % "File:`n" (file) "`n`nMD4:`n" LC_FileMD4(file) 15 | 16 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/MD5.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | str := "The quick brown fox jumps over the lazy dog" 8 | MsgBox, % "String:`n" (str) "`n`nMD5:`n" LC_MD5(str) 9 | 10 | hex := "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67" 11 | MsgBox, % "Hex:`n" (hex) "`n`nMD5:`n" LC_HexMD5(hex) 12 | 13 | file := "C:\Windows\notepad.exe" 14 | MsgBox, % "File:`n" (file) "`n`nMD5:`n" LC_FileMD5(file) 15 | 16 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/RC4.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | Message := "Secret Message!" 4 | Password := "Password" 5 | Encrypted := LC_RC4_Encrypt(Message,Password) 6 | Decrypted := LC_RC4_Decrypt(Encrypted,Password) 7 | Test := LC_RC4(LC_RC4(Message,Password),Password) 8 | 9 | MsgBox, 10 | ( 11 | Message : `t%Message% 12 | Password : `t%Password% 13 | Encrypted : `t%Encrypted% 14 | Decrypted : `t%Decrypted% 15 | Test `t: `t%Test% 16 | ) -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/ROT.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | n:="`n" 4 | MsgBox % LC_Rot5("abcdef1234567890") n "abcdef6789012345" n n 5 | . LC_Rot13("Secret Message!") n "Frperg Zrffntr!" n n 6 | . LC_Rot18("H3ll0 w0rld!") n "U8yy5 j5eyq!" n n 7 | . LC_Rot47("The Quick Brown Fox Jumps Over The Lazy Dog.") n "`%96 ""F:4< qC@H? u@I yF>AD ~G6C `%96 {2KJ s@8]" -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/RSHash.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | s:="21EC2020-3AEA-4069-A2DD-08002B30309D" 4 | MsgBox % "Input: " . "" . s . "" . "`nOutput: " . LC_RSHash(s) 5 | ; should output: 1866374240 -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/SHA-1.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | str := "The quick brown fox jumps over the lazy dog" 8 | MsgBox, % "String:`n" (str) "`n`nSHA:`n" LC_SHA(str) 9 | 10 | hex := "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67" 11 | MsgBox, % "Hex:`n" (hex) "`n`nSHA:`n" LC_HexSHA(hex) 12 | 13 | file := "C:\Windows\notepad.exe" 14 | MsgBox, % "File:`n" (file) "`n`nSHA:`n" LC_FileSHA(file) 15 | 16 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/SHA-256.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | str := "The quick brown fox jumps over the lazy dog" 8 | MsgBox, % "String:`n" (str) "`n`nSHA-256:`n" LC_SHA256(str) 9 | 10 | hex := "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67" 11 | MsgBox, % "Hex:`n" (hex) "`n`nSHA-256:`n" LC_HexSHA256(hex) 12 | 13 | file := "C:\Windows\notepad.exe" 14 | MsgBox, % "File:`n" (file) "`n`nSHA-256:`n" LC_FileSHA256(file) 15 | 16 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/SHA-384.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | str := "The quick brown fox jumps over the lazy dog" 8 | MsgBox, % "String:`n" (str) "`n`nSHA-384:`n" LC_SHA384(str) 9 | 10 | hex := "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67" 11 | MsgBox, % "Hex:`n" (hex) "`n`nSHA-384:`n" LC_HexSHA384(hex) 12 | 13 | file := "C:\Windows\notepad.exe" 14 | MsgBox, % "File:`n" (file) "`n`nSHA-384:`n" LC_FileSHA384(file) 15 | 16 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/SHA-512.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | str := "The quick brown fox jumps over the lazy dog" 8 | MsgBox, % "String:`n" (str) "`n`nSHA-512:`n" LC_SHA512(str) 9 | 10 | hex := "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67" 11 | MsgBox, % "Hex:`n" (hex) "`n`nSHA-512:`n" LC_HexSHA512(hex) 12 | 13 | file := "C:\Windows\notepad.exe" 14 | MsgBox, % "File:`n" (file) "`n`nSHA-512:`n" LC_FileSHA512(file) 15 | 16 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/SecureSalted.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | message := "The quick brown fox jumps over the lazy dog" 8 | salt := "key" 9 | 10 | MsgBox, % "Message:`t`t" (message) "`nSalt:`t`t" (salt) "`n`n" 11 | . "MD2:`t`t" LC_MD2(message) "`nMD2 + Salt:`t" LC_SecureSalted(salt, message, "md2") "`n`n" 12 | . "MD4:`t`t" LC_MD4(message) "`nMD4 + Salt:`t" LC_SecureSalted(salt, message, "md4") "`n`n" 13 | . "MD5:`t`t" LC_MD5(message) "`nMD5 + Salt:`t" LC_SecureSalted(salt, message, "md5") "`n`n" 14 | . "SHA:`t`t" LC_SHA(message) "`nSHA + Salt:`t" LC_SecureSalted(salt, message, "sha") "`n`n" 15 | . "SHA256:`t`t" LC_SHA256(message) "`nSHA256 + Salt:`t" LC_SecureSalted(salt, message, "sha256") "`n`n" 16 | . "SHA384:`t`t" LC_SHA384(message) "`nSHA384 + Salt:`t" LC_SecureSalted(salt, message, "sha384") "`n`n" 17 | . "SHA512:`t`t" LC_SHA512(message) "`nSHA512 + Salt:`t" LC_SecureSalted(salt, message, "sha512") 18 | 19 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/URI.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | URI := "some weird URI !@$%^&*().php?somevar=text" 4 | Encoded := LC_UriEncode(URI) 5 | Decoded := LC_UriDecode(Encoded) 6 | 7 | URL := "http://example.com/pages/links(stuff)/script(s).php?var=s p a c e s !&var2=3+5#ref" 8 | Encoded2 := LC_URLEncode(URL) 9 | Decoded2 := LC_URLDecode(Encoded2) 10 | 11 | MsgBox, 12 | ( 13 | URI : `n%URI%`n 14 | Encoded : `n%Encoded%`n 15 | Decoded : `n%Decoded% 16 | 17 | --------------------------------------- 18 | 19 | URL : `n%URL%`n 20 | Encoded2 : `n%Encoded2%`n 21 | Decoded2 : `n%Decoded2% 22 | ) -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/Vigenere.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | #NoEnv 4 | #SingleInstance Force 5 | SetBatchLines, -1 6 | 7 | Key := "VIGENERECIPHER" 8 | Text := "The quick brown fox jumps over the lazy dog" 9 | 10 | MsgBox, % "Key:`t`t" Key "`n" 11 | . "Plaintext:`t`t" Text "`n`n" 12 | . "Ciphertext:`t" (c := LC_VigenereCipher(Text, Key)) "`n" 13 | . "Decrypted:`t" LC_VigenereDecipher(c, key) 14 | 15 | exitapp 16 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/VxE.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | SetBatchLines,-1 3 | #NoEnv 4 | 5 | m := "[VxE]-89 is a text-friendly encryption method." 6 | l := StrLen(m) 7 | 8 | Encrypted89 := LC_VxE_Encrypt89( "Password0001", m1:=m ) 9 | Decrypted89 := LC_VxE_Decrypt89( "Password0001", m2:=m1 ) 10 | 11 | Encrypted251 := LC_VxE_Encrypt251( "Password0002", m3:=m , l ) 12 | Decrypted251 := LC_VxE_Decrypt251( "Password0002", m4:=m3, l ) 13 | 14 | MsgBox, 15 | ( 16 | Original: 17 | ---------------------------- 18 | %m% 19 | 20 | VxE89: 21 | ---------------------------- 22 | Encrypted89 = %m1% 23 | Decrypted89 = %m2% 24 | 25 | VxE251: 26 | ---------------------------- 27 | Encrypted251 = %m3% 28 | Decrypted251 = %m4% 29 | ) -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/XOR.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | Message := "Secret Message!" 4 | Password := "Password" 5 | Encoded := LC_XOR_Encrypt(Message,Password) 6 | Decoded := LC_XOR_Decrypt(Encoded,Password) 7 | 8 | MsgBox, 9 | ( 10 | Message : `t%Message% 11 | Password : `t%Password% 12 | Encoded : `t%Encoded% 13 | Decoded : `t%Decoded% 14 | ) -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/Examples/nnnik21.ahk: -------------------------------------------------------------------------------- 1 | #Include ..\lib\libcrypt.ahk 2 | 3 | Message := "Secret Message!" 4 | Password := "Password" 5 | Encoded := LC_nnnik21_EncryptStr(Message,Password) 6 | Decoded := LC_nnnik21_DecryptStr(Encoded,Password) 7 | 8 | MsgBox, 9 | ( 10 | Message : `t%Message% 11 | Password : `t%Password% 12 | Encoded : `t%Encoded% 13 | Decoded : `t%Decoded% 14 | ) 15 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/libcrypt/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.24.00", 9 | "author":"ahkscript", 10 | "description":"A collection of crypting and encoding functions from the community.\n\nCurrently included function:\n- Hashing: CRC32, MD2, MD4, MD5, SHA-1, SHA-2 (SHA-256, SHA-384, SHA-512), HMAC (Checksums), Secure Salted (Checksums)\n\n- Hashing (Custom): RSHash (Robert Sedgewick's string hashing algorithm)\n\n- En-\/Decryption: Caesar Cipher, RC4, Vigen\u00E8re Cipher, XOR, ROT5, ROT13, ROT18, ROT47\n\n- En-\/Decryption (Custom): Div2, nnnik21, VxE (VxE-89, VxE-251)\n\n- En-\/Decoding: ASCII \/ Binary, Base64, Bin \/ Hex, Dec (2 to 36), URI\/URL encode\/decode\n\nMore functions are on the way!\n\nA special thanks to: Bentschi, @AHK-just-me, @IsNull, @jNizM, @G33kDude, @joedf, @nnnik and others", 11 | "forumurl":"https:\/\/github.com\/ahkscript\/libcrypt.ahk\/issues", 12 | "id":"libcrypt", 13 | "license":"MIT", 14 | "name":"Libcrypt.ahk", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "crypt", 21 | "encode", 22 | "decode", 23 | "secret", 24 | "encryption", 25 | "message", 26 | "hash", 27 | "collection", 28 | "CRC32", 29 | "MD2", 30 | "MD4", 31 | "MD5", 32 | "SHA1", 33 | "SHA2", 34 | "checksum", 35 | "Base64", 36 | "URL", 37 | "URI", 38 | "Binary", 39 | "ASCII", 40 | "Hex" 41 | ], 42 | "type":"Library", 43 | "version":"0.0.21.01" 44 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/loadlibrary/Lib/loadlibrary.ahk: -------------------------------------------------------------------------------- 1 | ; LoadLibrary & FreeLibrary by Bentschi 2 | ; Easier DLLCalls! 3 | ; http://www.autohotkey.com/board/topic/90266-funktionen-loadlibrary-freelibrary-schnellere-dllcalls/ 4 | 5 | LoadLibrary(filename) 6 | { 7 | static ref := {} 8 | if (!(ptr := p := DllCall("LoadLibrary", "str", filename, "ptr"))) 9 | return 0 10 | ref[ptr,"count"] := (ref[ptr]) ? ref[ptr,"count"]+1 : 1 11 | p += NumGet(p+0, 0x3c, "int")+24 12 | o := {_ptr:ptr, __delete:func("FreeLibrary"), _ref:ref[ptr]} 13 | if (NumGet(p+0, (A_PtrSize=4) ? 92 : 108, "uint")<1 || (ts := NumGet(p+0, (A_PtrSize=4) ? 96 : 112, "uint")+ptr)=ptr || (te := NumGet(p+0, (A_PtrSize=4) ? 100 : 116, "uint")+ts)=ts) 14 | return o 15 | n := ptr+NumGet(ts+0, 32, "uint") 16 | Loop, % NumGet(ts+0, 24, "uint") 17 | { 18 | if (p := NumGet(n+0, (A_Index-1)*4, "uint")) 19 | { 20 | o[f := StrGet(ptr+p, "cp0")] := DllCall("GetProcAddress", "ptr", ptr, "astr", f, "ptr") 21 | if (Substr(f, 0)==((A_IsUnicode) ? "W" : "A")) 22 | o[Substr(f, 1, -1)] := o[f] 23 | } 24 | } 25 | return o 26 | } 27 | 28 | FreeLibrary(lib) 29 | { 30 | if (lib._ref.count>=1) 31 | lib._ref.count -= 1 32 | if (lib._ref.count<1) 33 | DllCall("FreeLibrary", "ptr", lib._ptr) 34 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/loadlibrary/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.13.01", 9 | "author":"Bentschi", 10 | "description":"", 11 | "forumurl":"http:\/\/www.autohotkey.com\/board\/topic\/90266-funktionen-loadlibrary-freelibrary-schnellere-dllcalls\/", 12 | "id":"loadlibrary", 13 | "license":"ASPDM Default License", 14 | "name":"LoadLibrary & FreeLibrary for easier DLLCalls", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "dllcall", 21 | "winapi", 22 | "loadlibrary", 23 | "freelibrary", 24 | "object" 25 | ], 26 | "type":"Library", 27 | "version":"1.0.0.0" 28 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/midi/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.13.01", 9 | "author":"Bentschi", 10 | "description":"", 11 | "forumurl":"http:\/\/www.autohotkey.com\/board\/topic\/91046-midi-library-midiout\/", 12 | "id":"midi", 13 | "license":"ASPDM Default License", 14 | "name":"MIDI Library (MidiOut)", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "midi", 21 | "music", 22 | "sound", 23 | "interface", 24 | "class", 25 | "object" 26 | ], 27 | "type":"Library", 28 | "version":"1.0.0.0" 29 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_extra/Lib/sample.txt: -------------------------------------------------------------------------------- 1 | This is a metadata json test for the project.json -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_extra/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.15.00", 9 | "author":"Joe DF", 10 | "description":"Pack of packages, extra metadata, etc. This is a sample description.\nThis is the second sentence of this description.", 11 | "forumurl":"http:\/\/forum.com\/?topic=1234", 12 | "id":"sample_extra", 13 | "license":"ASPDM Default License", 14 | "name":"Sample extra test", 15 | "screenshot":"http:\/\/example.com\/preview.png", 16 | "tags":[ 17 | "file", 18 | "sample", 19 | "lua", 20 | "test", 21 | "package", 22 | "example" 23 | ], 24 | "type":"Library", 25 | "version":"1.0.0.0", 26 | "number": 123, 27 | "string": "Hello World" 28 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/ leading_spaces: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/ leading_spaces -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/!ignore.test: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/.aspdm_ignore: -------------------------------------------------------------------------------- 1 | ##comment## 2 | # NOTE! THESE ARE GLOB PATTERNS, NOT REGEX! 3 | 4 | # ignore all files with '.r' extension 5 | *.r 6 | 7 | # ignore all files with '.bak' extension 8 | *.bak 9 | 10 | # ignore 'thumbs.db' 11 | thumbs.db 12 | 13 | # another pattern 14 | __*__ 15 | 16 | # should match 'cat.txt', 'bat.txt', ... 17 | ?at.txt 18 | 19 | # Use only '/' for paths, '\' is invalid 20 | # Behaviour is UNDEFINED when using '\' instead of '/'. 21 | # '\' is for escaping ONLY. 22 | # Example: "C:\user\file.txt" is NOT VALID. 23 | # Example: "C:/user/file.txt" is VALID. 24 | 25 | # Escape '#' character 26 | \#file123.test 27 | 28 | # if line does not start with '#', it is not a comment. 29 | file#1285.md 30 | 31 | # File names with leading/trailing spaces are discouraged. 32 | # Escape leading spaces, "[10 spaces]leading_spaces" 33 | \ leading_spaces 34 | 35 | # Escape trailing spaces, "trailing_spaces[10 spaces]" 36 | ## NOT SUPPORTED ON WINDOWS ## illegal filename, tested to be true on: 37 | ## Windows XP, Windows 7 & Windows 8 38 | ## therefore, escaping trailing spaces will NOT be supported. 39 | ## for this flavour of 'gitignore' 40 | ##trailing_spaces \ 41 | 42 | # ignore objects and archives, anywhere in the tree. 43 | *.[oa] 44 | 45 | # ignore generated html files, 46 | *.html 47 | 48 | # except foo.html 49 | ##NOT YET SUPPORTED## !foo.html 50 | 51 | # ignore folders named 'a' or 'c' 52 | [ac]/ 53 | 54 | # ignore items named 'folder' 55 | folder 56 | 57 | # ignore items that start with 'prefix' 58 | # Example : 'files/prefix_test.g' 59 | prefix* 60 | 61 | # Two consecutive leading asterisks ("**/") matching 62 | # matches everything that ends with '/x' 63 | # example: "a/x", "c/a/x", "c/a/g/x" 64 | **/x 65 | 66 | # Two consecutive trailing asterisks ("/**") matching 67 | # matches everything inside folder '/a/' but the folder itself 68 | /a/** 69 | 70 | # Two consecutive asterisks with backslashes ("/**/") matching 71 | # matches : "a/b", "a/x/b" "a/x/y/b", "c/a/g/b" 72 | a/**/b 73 | 74 | # matches anything that has '#' 75 | **#** 76 | 77 | # single asterisk with backslashes ("/*/") matching 78 | # matches : "a/x/b", "a/g/b" 79 | a/*/b 80 | 81 | # matches everything that ends with '/x', only one folder deep 82 | /*/x 83 | 84 | # ignore items named 'notfolder' 85 | notfolder 86 | 87 | # ignore items named 'folder', directories only 88 | folder/ 89 | 90 | # exclude everything in foo/ except directory foo/bar 91 | /foo/ 92 | ##NOT YET SUPPORTED## !/foo/bar 93 | 94 | ################################ 95 | # ---- Negate '!' Examples ---- 96 | ################################ 97 | 98 | # Ignore everything... 99 | ** 100 | 101 | # Except for... 102 | # AutoHotkey Scripts and "files/some_text.txt" 103 | !*.ahk 104 | !/files/ 105 | !/files/some_text.txt 106 | 107 | # "!/files/" is needed, otherwise "/files/" will be completely ignored 108 | # ... that means everything inside it too. 109 | # This is as per the officail git documentation : 110 | # 111 | # An optional prefix "!" which negates the pattern; any matching file 112 | # excluded by a previous pattern will become included again. It is not 113 | # possible to re-include a file if a parent directory of that file is 114 | # excluded. Git doesn't list excluded directories for performance reasons, 115 | # so any patterns on contained files have no effect, no matter where they 116 | # are defined. Put a backslash ("\") in front of the first "!" for patterns 117 | # that begin with a literal "!", for example, "\!important!.txt". 118 | 119 | 120 | # Escape '!' example.. 121 | # Ignore files beginning with '!' 122 | # "\!ignore.ahk" will not in this case since "!*.ahk" has priority. Therefore, 123 | # the file named "!ignore.ahk" will still be included. 124 | # That is why I am using "!ignore.test" instead for this example. 125 | 126 | \!ignore.test 127 | 128 | 129 | # when using the negate '!' feature, leading spaces don't need to be escaped, 130 | # since we have a non-space character (negate char '!') before the leading spaces. 131 | # Example: "! file_with_leading_spaces.txt" -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/__ignored_folder__/file.a: -------------------------------------------------------------------------------- 1 | TEST -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/__ignored_folder__/file.b: -------------------------------------------------------------------------------- 1 | TEST -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/__ignored_folder__/file.c: -------------------------------------------------------------------------------- 1 | TEST -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/__ignored_folder__/file.d: -------------------------------------------------------------------------------- 1 | TEST -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/__ignored_folder__/file.e: -------------------------------------------------------------------------------- 1 | TEST -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/bat.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/bat.txt -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/cat.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/cat.txt -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/docs.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/docs.html -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/execute.ahk: -------------------------------------------------------------------------------- 1 | ;Launch script 2 | 3 | #NoEnv 4 | #NoTrayIcon 5 | #SingleInstance,off 6 | SetWorkingDir %A_ScriptDir% 7 | RunWait,files\main_script.ahk 8 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/files/#file123.test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/files/#file123.test -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/files/file#1285.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/files/file#1285.md -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/files/folder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/files/folder -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/files/ignore_me_also.r: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | printf("Hello World! :D"); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/files/main_script.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | #Warn ; Recommended for catching common errors. 3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | ;<<<<<<<< HEADER END >>>>>>>>> 6 | 7 | FileRead,stuff,some_text.txt 8 | MsgBox Sample tool`n`nContents of "some_text.txt" :`n`n%stuff% 9 | 10 | ExitApp -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/files/prefix_test.g: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/files/prefix_test.g -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/files/some_text.txt: -------------------------------------------------------------------------------- 1 | 1234567890 2 | abcdefghijklmnopqrstuvwxyz 3 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 4 | !@#$%^&*()`~-_=+,./<>?;'\:"|[]{} -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/folder/stuff.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/folder/stuff.o -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/folder/thingy.test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/folder/thingy.test -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/foo/bar/testfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/foo/bar/testfile.txt -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/foo/test/somefile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/foo/test/somefile.txt -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/ignore_me.r: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | printf("Hello World! :D"); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/install.ahk: -------------------------------------------------------------------------------- 1 | ;empty since no registry or any special handling is needed. -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/notfolder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/notfolder -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.22.09", 9 | "author":"Joe DF", 10 | "description":"This is a sample description.\nThis is the second sentence of this description.", 11 | "forumurl":"http:\/\/forum.com\/?topic=1234", 12 | "id":"sample_tool", 13 | "license":"ASPDM Default License", 14 | "name":"Sample tool", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"http:\/\/ahkscript.org\/static\/ahk_logo.png", 19 | "tags":[ 20 | "sample", 21 | "tool", 22 | "test" 23 | ], 24 | "type":"Tool", 25 | "version":"1.0.0.0" 26 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/prefix_testing.file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/prefix_testing.file -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/rat.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Local-Client/Test_Packages/sample_tool/rat.txt -------------------------------------------------------------------------------- /Local-Client/Test_Packages/sample_tool/remove.ahk: -------------------------------------------------------------------------------- 1 | ;empty since no registry or any special handling is needed. -------------------------------------------------------------------------------- /Local-Client/Test_Packages/samples/Lib/sample.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | printf("Hello World! :D"); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/samples/Lib/sample.lua: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/lua 2 | --[[ 3 | ; 4 | ; Lua Version: 5.2.1 5 | ; Language: English 6 | ; Author: Joe DF | http://example.com | joedf@example.com 7 | ; Date: January 1st, 2013 8 | ; 9 | ; Script Function: 10 | ; Template Lua script. 11 | ; 12 | --]] 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/samples/Lib/sample/sample.ahk: -------------------------------------------------------------------------------- 1 | ; 2 | ; AutoHotkey Version: 1.1.13.01 3 | ; Language: English 4 | ; Dev Platform: Windows 7 Home Premium x64 5 | ; Author: Joe DF | http://example.com | joedf@users.sourceforge.net 6 | ; Date: October 15th, 2013 7 | ; 8 | ; Script Function: 9 | ; Template AutoHotkey script. 10 | ; 11 | 12 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 13 | #Warn ; Recommended for catching common errors. 14 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 15 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 16 | ;<<<<<<<< HEADER END >>>>>>>>> 17 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/samples/Lib/sample/sample.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | goto start 3 | 4 | Author: Joe DF | http://example.com | joedf@example.com 5 | Date: January 1st, 2013 6 | 7 | Script Function: 8 | Template Batch script. 9 | 10 | :start 11 | 12 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/samples/Lib/sample/sample/sample.au3: -------------------------------------------------------------------------------- 1 | #cs ---------------------------------------------------------------------------- 2 | 3 | AutoIt Version: 3.3.8.1 4 | Author: Joe DF | http://example.com | email@example.com 5 | 6 | Script Function: 7 | Template AutoIt script. 8 | 9 | #ce ---------------------------------------------------------------------------- 10 | 11 | 12 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/samples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.15.00", 9 | "author":"Joe DF", 10 | "description":"This is a sample description.\nThis is the second sentence of this description.", 11 | "forumurl":"http:\/\/forum.com\/?topic=1234", 12 | "id":"samples", 13 | "license":"ASPDM Default License", 14 | "name":"Sample files in C, Lua, AHK, Batch, AutoIt", 15 | "required":[ 16 | "isbinfile", 17 | "winfade" 18 | ], 19 | "screenshot":"http:\/\/example.com\/preview.png", 20 | "tags":[ 21 | "file", 22 | "sample", 23 | "lua", 24 | "test", 25 | "package", 26 | "example" 27 | ], 28 | "type":"Library", 29 | "version":"1.0.0.0" 30 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/socket_class/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "ahkbranch":"v1.1", 3 | "ahkflavour":[ 4 | "a32", 5 | "u32", 6 | "u64" 7 | ], 8 | "ahkversion":"1.1.13.01", 9 | "author":"Bentschi", 10 | "description":"", 11 | "forumurl":"http:\/\/www.autohotkey.com\/board\/topic\/94376-socket-class-%C3%BCberarbeitet\/", 12 | "id":"socket_class", 13 | "license":"ASPDM Default License", 14 | "name":"Socket Class", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "internet", 21 | "socket", 22 | "connection", 23 | "server", 24 | "client", 25 | "class", 26 | "object" 27 | ], 28 | "type":"Library", 29 | "version":"1.0.0.0" 30 | } -------------------------------------------------------------------------------- /Local-Client/Test_Packages/winfade/Example.ahk: -------------------------------------------------------------------------------- 1 | ; Uncomment if WinFade.ahk is not in your stdlib 2 | ;#Include WinFade.ahk 3 | 4 | ;http://www.autohotkey.com/board/topic/72536-solved-click-through-a-gui/ 5 | SetWinDelay, 0 6 | setbatchlines, 0 7 | Gui Color, 0x1A1A1A 8 | Gui +E0x20 -Caption +LastFound +ToolWindow +AlwaysOnTop +hwndHgui 9 | WinSet, Transparent, 0 10 | Gui Show, x0 y0 w%A_screenwidth% h%A_screenHeight% 11 | winfade("ahk_id " Hgui,100,5) ;winfade("ahk_id" Hgui,100,5) 12 | sleep 1000 13 | winfade("ahk_id " Hgui,10,5) ;winfade("ahk_id" Hgui,10,-5) 14 | goto guiclose 15 | return 16 | 17 | guiclose: 18 | exitapp 19 | -------------------------------------------------------------------------------- /Local-Client/Test_Packages/winfade/Lib/WinFade.ahk: -------------------------------------------------------------------------------- 1 | winfade(w:="",t:=128,i:=1,d:=10) { 2 | w:=(w="")?("ahk_id " WinActive("A")):w 3 | t:=(t>255)?255:(t<0)?0:t 4 | WinGet,s,Transparent,%w% 5 | s:=(s="")?255:s ;prevent trans unset bug 6 | WinSet,Transparent,%s%,%w% 7 | i:=(st):(s current, increases current transparency [i+]\nif : t < current, decreases current transparency [i-]", 11 | "forumurl":"http:\/\/ahkscript.org\/boards\/viewtopic.php?f=6&t=512", 12 | "id":"winfade", 13 | "license":"MIT License", 14 | "name":"Smart WinFade", 15 | "required":{ 16 | 17 | }, 18 | "screenshot":"", 19 | "tags":[ 20 | "window manipulation", 21 | "animation", 22 | "fade", 23 | "window", 24 | "gui" 25 | ], 26 | "type":"Library", 27 | "version":"1.0.0.0" 28 | } -------------------------------------------------------------------------------- /Local-Client/Tests/Alphasort_Test.ahk: -------------------------------------------------------------------------------- 1 | ;"Floating Alphanumeric" sorting by joedf [18:03 2014/06/10] 2 | 3 | arr:=["Jack","Bob","Charles","Albert","John","Kate","Sasha","REALLY_LONG_STRING_of_DooOOOOoOOooOOoOMMMMmmmMMMmm!!!!!"] 4 | ;arr:=["jACK","Jack"] 5 | ;MsgBox % stringNumbify("REALLY_LONG_STRING_KHGD_fdsfdsfsda_sdfakhflsdjkfhksdjfsad_sdfdsSHSGF")+0 6 | ;MsgBox % stringNumbify("Jack") " | " stringNumbify("John") " | " stringNumbify("Albert") " | " stringNumbify("Sasha") " | " asc("a") "\" asc("o") 7 | MsgBox % arr2str(arr,"`n") 8 | ;MsgBox % stringNumbify("Jack",0) " \ " stringNumbify("jACK",0) 9 | MsgBox % arr2str(alphasort(arr),"`n") 10 | MsgBox % arr2str(autosort(arr),"`n") 11 | 12 | Autosort(obj) { ;AutoSort ... by joedf 13 | newObj:=Object() 14 | for key, val in obj 15 | newObj[RegExReplace(val,"\s")]:=val 16 | for key, val in newObj 17 | obj[A_Index]:=val 18 | return obj 19 | } 20 | 21 | AlphaSort(obj,ic:=1,precise:=0) { 22 | newObj:=Object(), retObj:=Object() 23 | for key, val in obj 24 | newObj[stringNumbify(val,ic,precise)]:=val 25 | for key, val in newObj 26 | retObj[A_Index]:=val 27 | return retObj 28 | } 29 | 30 | stringNumbify(str,ic:=1,precise:=0) { 31 | if (precise) 32 | SetFormat, float, 0.15 33 | if (ic) 34 | StringLower,str,str 35 | k:=(ic>0)?97:65 ;Assuming ASCII 36 | num:="" 37 | loop, Parse, str 38 | num .= (asc(A_LoopField)-k)+10 39 | return ( "0." ((num=="")?0:num) ) 40 | } 41 | 42 | arr2str(o,d:=",",q:=1) { 43 | s:="" 44 | for i, v in o 45 | if (q) 46 | s .= """" v """" d 47 | else 48 | s .= v d 49 | return SubStr(s,1,-1) 50 | } -------------------------------------------------------------------------------- /Local-Client/Tests/CustomURI_Handler.ahk: -------------------------------------------------------------------------------- 1 | #NoTrayIcon 2 | 3 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 4 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 5 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 6 | #Include Lib\Arguments.ahk 7 | #Include Lib\NetworkAPI.ahk 8 | 9 | ; Custom URI Documentation : http://msdn.microsoft.com/en-us/library/ie/aa767914 10 | 11 | if (!A_IsCompiled) { 12 | MsgBox, 48, , Please run "CustomURI_SetupURI.ahk" first. 13 | ExitApp 14 | } 15 | /* 16 | if (!A_IsAdmin) { 17 | MsgBox, 16, , Error: Please run as Administrator. 18 | ExitApp 19 | } 20 | */ 21 | if (!args) { 22 | MsgBox, 16, , Error: no args 23 | ExitApp 24 | } 25 | 26 | URI_raw:=args[1] 27 | URI_str:=Trim(RegExReplace(URI_raw,".*:\/*")) ; ex: aspdm://domain.name/packid - see issue #10 (https://github.com/ahkscript/ASPDM/issues/10) 28 | URI_:=StrSplit(URI_str,"/") 29 | URI_Source:=Trim(URI_[1]) 30 | URI_PackID:=Trim(URI_[2]) 31 | 32 | if !URI_PackID 33 | { 34 | URI_PackID:=URI_Source ;source unspecified, using default 35 | } else { 36 | if !API_SetSource(URI_Source) { 37 | MsgBox, 48, , [URI Error] The specified package source is invalid or failed to respond correctly:`n`n`t%URI_Source%`n`nThe program will now exit. 38 | ExitApp 39 | } 40 | } 41 | if !StrLen(URI_PackID) { 42 | MsgBox, 48, , [URI Error] The specified URI is invalid:`n`n`t%URI_raw%`n`nThe program will now exit. 43 | ExitApp 44 | } 45 | 46 | if !Ping() { 47 | MsgBox, 48, , [Network Error] Check your internet connection.`nThe program will now exit. 48 | ExitApp 49 | } 50 | Progress CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, Waiting..., Loading Package List... 51 | Progress Show 52 | info:=JSON_ToObj(raw:=API_info(URI_PackID ".ahkp")) ;assuming only one package. Future: CSV Elements -> Loop for each 53 | if (!strlen(info["id"])) { 54 | Progress, Off 55 | if (InStr(raw,"suspended")) 56 | raw_reason:="ERROR: Server suspended for 24 hours." 57 | else if (InStr(raw,"File does not exist.")) { 58 | MsgBox, 48, , The following package does not exist:`n%URI_PackID%.ahkp`n`nServer Response:`n[[%raw%]] 59 | ExitApp 60 | } else 61 | raw_reason:=raw 62 | MsgBox, 48, , The ASPDM API is not responding.`nThe server might be down.`nPlease try again in while (5 min).`n`nServer Response:`n[[%raw_reason%]] 63 | ExitApp 64 | } 65 | pack_id:=info["id"] 66 | load_progress(URI_str,1,1) 67 | Sleep 100 68 | Progress, Off 69 | if (StrLen(trim(pack_id))==0) { 70 | MsgBox, 16, , Error: Non existent Package ("%URI_PackID%.ahkp")? 71 | ExitApp 72 | } 73 | run Package_Lister.ahk "--source" "%URI_Source%" "%pack_id%.ahkp",,UseErrorLevel 74 | if ErrorLevel 75 | MsgBox, 48, , ASPDM could not start properly.`nError: (%ErrorLevel%)[%A_LastError%] 76 | ExitApp 77 | 78 | load_progress(t,c,f) { 79 | p:=Round((c/f)*100) 80 | Progress, %p% , Loading: %c% / %f% items [ %p%`% ] , %t% 81 | } 82 | -------------------------------------------------------------------------------- /Local-Client/Tests/CustomURI_SetupURI.ahk: -------------------------------------------------------------------------------- 1 | #NoTrayIcon 2 | 3 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 4 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 5 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 6 | 7 | ; Custom URI Documentation : http://msdn.microsoft.com/en-us/library/ie/aa767914 8 | 9 | if not A_IsAdmin 10 | { 11 | Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+ 12 | ExitApp 13 | } 14 | Gui, Add, Button, x0 y0 w300 h30 gev_Install, Install 15 | Gui, Add, Button, xp y+0 wp hp gev_Remove, Remove 16 | Gui, Add, Button, xp y+0 wp hp gCancel, Cancel 17 | Gui, Show, w300 h90, Setup "aspdm://" Test URI 18 | return 19 | 20 | Cancel: 21 | MsgBox Canceled : Nothing was changed. 22 | GuiClose: 23 | ExitApp 24 | 25 | ev_Install: 26 | gosub,Install 27 | ExitApp 28 | 29 | ev_Remove: 30 | gosub,Remove 31 | ExitApp 32 | 33 | Install: 34 | if !FileExist("CustomURI_Handler.exe") { 35 | MsgBox, 48, , First, please try to compile "CustomURI_Handler.ahk" to "CustomURI_Handler.exe". 36 | return 37 | } 38 | if (k:=Setup_CustomURI("aspdm",A_ScriptDir "\CustomURI_Handler.exe")) 39 | if (k==2048) { 40 | MsgBox, 36, , Seems to be already installed... Do you want to reinstall? 41 | IfMsgBox,Yes 42 | { 43 | gosub,Remove 44 | goto,ev_Install 45 | } 46 | } 47 | else 48 | MsgBox, 64, , Seems to be installed.`nNow try out "aspdm://samples.ahkp" ... 49 | else 50 | MsgBox, 48, , It seems the install has failed. 51 | return 52 | 53 | Remove: 54 | RegRead,x_testvar,HKEY_CLASSES_ROOT,aspdm 55 | if ErrorLevel 56 | { 57 | MsgBox, 48, , Nothing was installed. 58 | return 59 | } 60 | RegDelete,HKEY_CLASSES_ROOT,aspdm 61 | if (!ErrorLevel) 62 | { 63 | RegRead,x_testvar,HKEY_CLASSES_ROOT,aspdm 64 | if ErrorLevel 65 | { 66 | MsgBox, 64, , The removal seems to be successful. 67 | return 68 | } 69 | } 70 | MsgBox, 48, , It seems the removal has failed. 71 | return 72 | 73 | Setup_CustomURI(ProtocolName,ProtocolHandler,ProtocolHandlerIcon="") { 74 | ;Admin rights possibly required 75 | 76 | ;Check URI RegKey Existance 77 | RegRead,x_tempvar,HKEY_CLASSES_ROOT,%ProtocolName% 78 | if !ErrorLevel 79 | return 2048 80 | 81 | ;Write URI RegKey 82 | StringUpper,uProtocolName,ProtocolName 83 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%,URL Protocol 84 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%,,URL:%uProtocolName% Protocol 85 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\DefaultIcon 86 | if !ProtocolHandlerIcon 87 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\DefaultIcon,,"%ProtocolHandler%",1 88 | else 89 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\DefaultIcon,,"%ProtocolHandlerIcon%" 90 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\shell 91 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\shell\open 92 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\shell\open\command 93 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\shell\open\command,,"%ProtocolHandler%" "`%1" 94 | return !ErrorLevel 95 | } -------------------------------------------------------------------------------- /Local-Client/Tests/CustomURI_Test-SetupURI.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 3 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 4 | 5 | ; Custom URI Documentation : http://msdn.microsoft.com/en-us/library/ie/aa767914 6 | 7 | if not A_IsAdmin 8 | { 9 | Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+ 10 | ExitApp 11 | } 12 | Gui, Add, Button, x0 y0 w300 h30 gInstall, Install 13 | Gui, Add, Button, xp y+0 wp hp gRemove, Remove 14 | Gui, Add, Button, xp y+0 wp hp gCancel, Cancel 15 | Gui, Show, w300 h90, Setup "aspdm://" Test URI 16 | return 17 | 18 | Cancel: 19 | MsgBox Canceled : Nothing was changed. 20 | GuiClose: 21 | ExitApp 22 | 23 | Install: 24 | if !FileExist("CustomURI_Test.exe") { 25 | MsgBox, 48, , First, please compile "CustomURI_Test.ahk" to "CustomURI_Test.exe". 26 | return 27 | } 28 | if (Setup_CustomURI("aspdm",A_ScriptDir "\CustomURI_Test.exe")) 29 | MsgBox, 64, , Seems to be installed.`nNow try out "aspdm://samples.ahkp" ... 30 | else 31 | MsgBox, 48, , It seems the install has failed. 32 | ExitApp 33 | 34 | Remove: 35 | RegRead,x_testvar,HKEY_CLASSES_ROOT,aspdm 36 | if ErrorLevel 37 | { 38 | MsgBox, 48, , Nothing was installed. 39 | return 40 | } 41 | RegDelete,HKEY_CLASSES_ROOT,aspdm 42 | if (!ErrorLevel) 43 | { 44 | RegRead,x_testvar,HKEY_CLASSES_ROOT,aspdm 45 | if ErrorLevel 46 | { 47 | MsgBox, 64, , The removal seems to be successful. 48 | ExitApp 49 | } 50 | } 51 | MsgBox, 48, , It seems the removal has failed. 52 | ExitApp 53 | 54 | 55 | Setup_CustomURI(ProtocolName,ProtocolHandler,ProtocolHandlerIcon="") { 56 | ;Admin rights possibly required 57 | 58 | ;Check URI RegKey Existance 59 | RegRead,x_tempvar,HKEY_CLASSES_ROOT,%ProtocolName% 60 | if !ErrorLevel 61 | return 2048 62 | 63 | ;Write URI RegKey 64 | StringUpper,uProtocolName,ProtocolName 65 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%,URL Protocol 66 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%,,URL:%uProtocolName% Protocol 67 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\DefaultIcon 68 | if !ProtocolHandlerIcon 69 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\DefaultIcon,,"%ProtocolHandler%",1 70 | else 71 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\DefaultIcon,,"%ProtocolHandlerIcon%" 72 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\shell 73 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\shell\open 74 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\shell\open\command 75 | RegWrite,REG_SZ,HKEY_CLASSES_ROOT,%ProtocolName%\shell\open\command,,"%ProtocolHandler%" "`%1" 76 | return !ErrorLevel 77 | } -------------------------------------------------------------------------------- /Local-Client/Tests/CustomURI_Test.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | #Warn ; Recommended for catching common errors. 3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | #Include Lib\Arguments.ahk 6 | #Include Lib\NetworkAPI.ahk 7 | 8 | ; Custom URI Documentation : http://msdn.microsoft.com/en-us/library/ie/aa767914 9 | 10 | if (!A_IsCompiled) { 11 | MsgBox, 48, , Please run "CustomURI_Test-SetupURI.ahk" first. 12 | ExitApp 13 | } 14 | /* 15 | if (!A_IsAdmin) { 16 | MsgBox, 16, , Error: Please run as Administrator. 17 | ExitApp 18 | } 19 | */ 20 | if (!args) { 21 | MsgBox, 16, , Error: no args 22 | ExitApp 23 | } 24 | 25 | URI_str:=RegExReplace(args[1],"(aspdm:|\/+)") ; ex: aspdm://samples.ahkp/ or aspdm:samples.ahkp 26 | 27 | if !Ping() { 28 | MsgBox, 16, , Network Error : Check your internet connection.`nThe program will now exit. 29 | ExitApp 30 | } 31 | Progress CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, Waiting..., Loading Package List... 32 | Progress Show 33 | info:=JSON_ToObj(raw:=API_info(URI_str)) ;assuming only one package. Future: CSV Elements -> Loop for each 34 | if (!strlen(info["id"])) { 35 | Progress, Off 36 | if (InStr(raw,"suspended")) 37 | raw_reason:="ERROR: Server suspended for 24 hours." 38 | else 39 | raw_reason:=raw 40 | MsgBox, 48, , The ASPDM API is not responding.`nThe server might be down.`nPlease try again in while (5 min).`n`nServer Response:`n[[%raw_reason%]] 41 | ExitApp 42 | } 43 | pack_id:=info["id"] 44 | pack_name:=info["name"] 45 | pack_copy:=info["license"] 46 | pack_desc:=info["description"] 47 | load_progress(URI_str,1,1) 48 | Sleep 100 49 | Progress, Off 50 | if (StrLen(trim(pack_id))==0) { 51 | MsgBox, 16, , Error: Non existent Package ("%URI_str%")? 52 | ExitApp 53 | } 54 | MsgBox, 68, , Download Package?`nID: `t%pack_id%`nName: `t%pack_name%`nLicense: `t%pack_copy%`n`nDescription: `n%pack_desc% 55 | IfMsgBox, Yes 56 | { 57 | Gui +OwnDialogs 58 | FileSelectFile, _SelectedFile, S18, %pack_id%.ahkp, Save package : %pack_name%, AHKP file (*.ahkp) 59 | if _SelectedFile = 60 | MsgBox, 64, , Package file was not saved. 61 | else 62 | { 63 | tmp_file:=API_Get(pack_id ".ahkp") 64 | FileMove,%tmp_file%,%_SelectedFile%,1 65 | if ( (!FileExist(tmp_file)) && (FileExist(_SelectedFile)) ) 66 | MsgBox, 64, , Download Successful 67 | else 68 | MsgBox, 16, , Error: Download Unsuccessful 69 | } 70 | } 71 | ExitApp 72 | 73 | load_progress(t,c,f) { 74 | p:=Round((c/f)*100) 75 | Progress, %p% , Loading: %c% / %f% items [ %p%`% ] , %t% 76 | } 77 | -------------------------------------------------------------------------------- /Local-Client/Tests/Ignore_Test.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 3 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 4 | ;<<<<<<<< HEADER END >>>>>>>>> 5 | 6 | baseDir:="Test_Packages\sample_tool" 7 | if FileExist(ignorefile:=baseDir "\.aspdm_ignore") 8 | ignore_patterns:=Ignore_GetPatterns(ignorefile) 9 | Original_tree := JSON_Beautify(Obj_StripKey(Util_DirTree(baseDir),"fullPath"),3) 10 | New_tree := JSON_Beautify(Obj_StripKey(Ignore_DirTree(baseDir,ignore_patterns),"fullPath"),3) 11 | patterns := Util_SingleArray2Str(ignore_patterns,"`n") "`n-----------`nNegate patterns`n-----------`n" Util_SingleArray2Str(ignore_patterns.negate,"`n") 12 | Num_patterns := ignore_patterns.MaxIndex() + (ignore_patterns.negate.MaxIndex()+0) 13 | Num_matches := StrCount("""name"":",Original_tree) - StrCount("""name"":",New_tree) 14 | 15 | Gui, Font, s8, Courier New 16 | Gui, Add, Edit, x3 w400 h300, % Original_tree 17 | Gui, Add, Edit, x+4 yp wp hp, % New_tree 18 | Gui, Add, Edit, x3 y+4 w804 h150, % patterns 19 | Gui, Add, StatusBar,, Number of patterns : %num_patterns% | Number of matches : %Num_matches% 20 | Gui, Show 21 | return 22 | 23 | GuiClose: 24 | ExitApp 25 | 26 | StrCount(Needle,Haystack) { 27 | StringReplace,Haystack,Haystack,%Needle%,,UseErrorLevel 28 | return ErrorLevel 29 | } 30 | 31 | Obj_StripKey(Obj,keyname) { 32 | Obj := Obj.Clone() 33 | for key, val in Obj 34 | { 35 | if key = %keyname% 36 | { 37 | Obj.Remove(keyname) 38 | continue 39 | } 40 | if IsObject(val) 41 | Obj[key]:=Obj_StripKey(val,keyname) 42 | } 43 | return Obj 44 | } -------------------------------------------------------------------------------- /Local-Client/Tests/Install_Test.ahk: -------------------------------------------------------------------------------- 1 | ;InstallTest 2 | 3 | #Include Lib\Install.ahk 4 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 5 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 6 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 7 | 8 | ;Should specify fullpaths 9 | packs:="~built_packs~\winfade.ahkp" 10 | 11 | ;TODO: check for "required" aka dependencies 12 | 13 | Runwait *RunAs Package_Installer.ahk "%packs%",,UseErrorLevel 14 | 15 | if ( (ecode:=ErrorLevel)==Install.Success ) 16 | MsgBox, 64, , Installation finished successfully. 17 | else 18 | MsgBox, 16, , % "An installation error occured.`n(ExitCode: " ecode " [""" Install_ExitCode(ecode) """])" -------------------------------------------------------------------------------- /Local-Client/Tests/JSON_Format_test.ahk: -------------------------------------------------------------------------------- 1 | FileRead,JSON, % "Test_Packages\samples\package.json" 2 | MsgBox % j:=JSON_Beautify(JSON,3) 3 | MsgBox % JSON_Uglify(j) 4 | -------------------------------------------------------------------------------- /Local-Client/Tests/NetworkAPI_Test.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | #Warn ; Recommended for catching common errors. 3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | #Include Lib\NetworkAPI.ahk 6 | /* 7 | API temporarily hosted @ api-php.aspdm.1eko.com 8 | See https://trello.com/c/V27ITnHO/16-web-server-api 9 | 10 | info.php -- Get JSON info from a package in "packs/" 11 | Usage: ?f=FILENAME&c=JSONITEM 12 | If 'JSONITEM' is specified, it returns a normal string. 13 | Otherwise, a JSON string is returned. 14 | 15 | list.php -- List all files in "packs/" 16 | Usage: no arguments 17 | Returns a list of all packages seperated by '`n' 18 | */ 19 | CheckUpdate("0.9.0.0",-1) 20 | Gui, Add, ListView, x4 y4 w500 h250 gListViewEvents, File|Name|Version|Author|Description 21 | Gui, Show,,%A_scriptName% - DoubleClick to Download... 22 | 23 | LV_Add("","Downloading...") 24 | LV_ModifyCol(1,"100") 25 | LV_ModifyCol(2,"120") 26 | LV_ModifyCol(3,"60") 27 | LV_ModifyCol(4,"80") 28 | LV_ModifyCol(5,"290") 29 | if !Ping() { 30 | MsgBox, 16, , Network Error : Check your internet connection.`nThe program will now exit. 31 | ExitApp 32 | } 33 | Progress CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, Waiting..., Loading Package List... 34 | Progress Show 35 | /* 36 | packs:=API_list() 37 | total:=packs.MaxIndex() 38 | Loop % total 39 | { 40 | info:=JSON_ToObj(raw:=API_info(packs[A_Index])) 41 | if InStr(raw,"error") 42 | info:={name:raw} 43 | LV_Add("",packs[A_Index],info["name"],info["version"],info["author"],info["description"]) 44 | load_progress(packs[A_Index],A_Index,total) 45 | } 46 | */ 47 | packs:=API_ListAll() 48 | total:=Util_ObjCount(packs) 49 | for each, info in packs 50 | LV_Add("",info["id"] ".ahkp",info["name"],info["version"],info["author"],info["description"]) 51 | LV_Delete(1) 52 | Sleep 100 53 | Progress, Off 54 | return 55 | 56 | ListViewEvents: 57 | if A_GuiEvent = DoubleClick 58 | { 59 | if (!A_EventInfo) 60 | return 61 | 62 | LV_GetText(FileName,A_EventInfo,1) 63 | LV_GetText(pack_name,A_EventInfo,2) 64 | LV_GetText(pack_desc,A_EventInfo,5) 65 | MsgBox, 68, , Download Package?`nName: %pack_name%`nDesc: %pack_desc% 66 | IfMsgBox, Yes 67 | { 68 | Gui +OwnDialogs 69 | FileSelectFile, _SelectedFile, S18, %FileName%, Save package, AHKP file (*.ahkp) 70 | if _SelectedFile = 71 | MsgBox, 64, , Package file was not saved. 72 | else 73 | { 74 | tmp_file:=API_Get(FileName) 75 | FileMove,%tmp_file%,%_SelectedFile%,1 76 | if ( (!FileExist(tmp_file)) && (FileExist(_SelectedFile)) ) 77 | MsgBox, 64, , Download Successful 78 | else 79 | MsgBox, 16, , Error: Download Unsuccessful 80 | } 81 | } 82 | } 83 | return 84 | 85 | GuiClose: 86 | ExitApp 87 | 88 | load_progress(t,c,f) { 89 | p:=Round((c/f)*100) 90 | Progress, %p% , Loading: %c% / %f% items [ %p%`% ] , %t% 91 | } 92 | 93 | -------------------------------------------------------------------------------- /Local-Client/Tests/OpenWith_Handler.ahk: -------------------------------------------------------------------------------- 1 | #NoTrayIcon 2 | 3 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 4 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 5 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 6 | #Include Lib\Arguments.ahk 7 | 8 | if (!A_IsCompiled) { 9 | MsgBox, 48, , Please compile this script first / Please run "CustomURI_SetupURI.ahk" first. 10 | ExitApp 11 | } 12 | /* 13 | if (!A_IsAdmin) { 14 | MsgBox, 16, , Error: Please run as Administrator. 15 | ExitApp 16 | } 17 | */ 18 | if (!args) { 19 | MsgBox, 16, , Error: no args 20 | ExitApp 21 | } 22 | 23 | if (!FileExist(FILE_str:=args[1])) { 24 | MsgBox, 16, , Error: Could not open file:`n`n`t"%FILE_str%" 25 | ExitApp 26 | } 27 | 28 | Progress CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, Waiting..., Loading Package... 29 | Progress Show 30 | info:=JSON_ToObj(Manifest_FromPackage(FILE_str)) ;assuming only one package. Future: CSV Elements -> Loop for each 31 | pack_id:=info["id"] 32 | load_progress(pack_id,1,1) 33 | Sleep 100 34 | Progress, Off 35 | if (StrLen(trim(pack_id))==0) { 36 | MsgBox, 16, , Error: The following package seems to be invalid:`n`n`t"%FILE_str%" 37 | ExitApp 38 | } 39 | run Package_Lister.ahk "--local" "%FILE_str%",,UseErrorLevel 40 | if ErrorLevel 41 | MsgBox, 48, , ASPDM could not start properly.`nError: (%ErrorLevel%)[%A_LastError%] 42 | ExitApp 43 | 44 | load_progress(t,c,f) { 45 | p:=Round((c/f)*100) 46 | Progress, %p% , Loading: %c% / %f% items [ %p%`% ] , %t% 47 | } 48 | -------------------------------------------------------------------------------- /Local-Client/Tests/Package_Moderator-v1.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 3 | #Include Lib\LV_InCellEdit.ahk 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | ;<<<<<<<< HEADER END >>>>>>>>> 6 | 7 | all_vars:=["id","version","name","ahkbranch","ahkflavour","description","author","license","required","forumurl","screenshot","type","tags"] 8 | 9 | Gui, Add, ListView, w430 h270 vLVMetaData +Grid -Readonly hwndHLV1 AltSubmit, Attribute|Value 10 | Gui, Add, TreeView, wp h135 vTVFiles 11 | Gui, Add, Button, w80 gOpen, Open 12 | Gui, Add, Button, yp x+4 wp gotmpdir +Disabled vtmpdirBtn, Inspect files... 13 | Gui, Add, Button, yp x+4 wp gSave, Save As... 14 | Gui, Show 15 | 16 | LV_ModifyCol(1,"80") 17 | LV_ModifyCol(2,"340") 18 | gosub,PrepLV 19 | gosub,PrepTV 20 | return 21 | 22 | GuiClose: 23 | FileRemoveDir, %A_temp%\ASPDM_tmp, 1 24 | ExitApp 25 | 26 | PrepTV: 27 | TV_Delete() 28 | TV_baseDirID := TV_Add("Package Base Dir") 29 | return 30 | 31 | PrepLV: 32 | LV_Delete() 33 | for each, item in all_vars 34 | LV_Add("",item) 35 | ICELV1 := New LV_InCellEdit(HLV1) 36 | ICELV1.SetColumns(2) 37 | return 38 | 39 | Open: 40 | Gui +OwnDialogs 41 | FileSelectFile, thePack, 3, , Open AHKP Package, AHKP Package (*.ahkp) 42 | if !ErrorLevel 43 | { 44 | ; Package Metadata 45 | mdata:=Manifest_FromStr(Manifest_FromPackage(thePack)) 46 | LV_Delete() 47 | for each, item in all_vars 48 | { 49 | if (IsObject(mdata[item])) 50 | LV_Add("",item,Util_TagsObj2CSV(mdata[item])) 51 | else 52 | LV_Add("",item,mdata[item]) 53 | } 54 | 55 | ; Package tree 56 | tmpDir:=Util_TempDir(A_Temp "\ASPDM_tmp") 57 | eTree:=Package_Extract(tmpDir,thePack,1) 58 | gosub,PrepTV 59 | GuiControl, -Redraw, TVFiles 60 | eObj2TV(eTree,TV_baseDirID) 61 | GuiControl, +Redraw, TVFiles 62 | GuiControl, -Disabled, tmpdirBtn 63 | 64 | ; Save a copy of the extracted manifest in the extraction folder 65 | outman:=JSON_Beautify(mdata) 66 | FileAppend, %outman%, %tmpDir%\package.json 67 | } 68 | return 69 | 70 | eObj2TV(obj,parentID) { 71 | for key, val in obj 72 | { 73 | if IsObject(val) { 74 | kName:=SubStr(key,2) 75 | SplitPath,kName,kName 76 | SubID:=TV_Add(kName,parentID) 77 | eObj2TV(val,SubID) 78 | } else { 79 | SplitPath,val,kName 80 | TV_Add(kName,parentID) 81 | } 82 | } 83 | } 84 | 85 | Save: 86 | return 87 | 88 | otmpdir: 89 | Run, explorer.exe %tmpDir% 90 | return 91 | -------------------------------------------------------------------------------- /Local-Client/Tests/Packaging_Test.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | ; #Warn ; Enable warnings to assist with detecting common errors. 3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | 6 | outP := A_ScriptDir "\package_test.ahkp" 7 | testDir := A_ScriptDir "\Test_Packages\samples" 8 | tempDir := Util_TempDir() 9 | 10 | Package_Build(outP, testDir) 11 | MsgBox % Manifest_FromPackage(outP) 12 | 13 | if Package_Extract(tempDir, outP) 14 | { 15 | MsgBox, 68, , Extraction was successful!`nOpen in Explorer? 16 | IfMsgBox, Yes 17 | Run, Explorer.exe "%tempDir%" 18 | } else 19 | { 20 | FileRemoveDir, %tempDir%, 1 21 | MsgBox, 16, , Extraction failed! 22 | } 23 | -------------------------------------------------------------------------------- /Local-Client/Tests/Screenshot_Test.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | ;#Warn ; Recommended for catching common errors. 3 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 4 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 5 | #Include Lib\NetworkAPI.ahk 6 | 7 | Gui, Add, ListView, x4 y4 w500 h250 gListViewEvents, File|Name|Version|Author|index 8 | Gui, Show,,%A_scriptName% - DoubleClick to view screenshot... 9 | 10 | Gui, projector:+ToolWindow 11 | Gui, projector:Margin, 0, 0 12 | Gui, projector:Add, ActiveX, w320 h240 vWB, Shell.Explorer 13 | WB.silent := true 14 | 15 | LV_Add("","Downloading...") 16 | LV_ModifyCol(1,"100") 17 | LV_ModifyCol(2,"220") 18 | LV_ModifyCol(3,"60") 19 | LV_ModifyCol(4,"80") 20 | LV_ModifyCol(5,"0") 21 | if !Ping() { 22 | MsgBox, 16, , Network Error : Check your internet connection.`nThe program will now exit. 23 | ExitApp 24 | } 25 | Progress CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, Waiting..., Loading Package List... 26 | Progress Show 27 | 28 | packs:=API_ListAll() 29 | total:=Util_ObjCount(packs) 30 | for each, info in packs 31 | LV_Add("",info["id"] ".ahkp",info["name"],info["version"],info["author"],each) 32 | LV_Delete(1) 33 | Sleep 100 34 | Progress, Off 35 | return 36 | 37 | ListViewEvents: 38 | if A_GuiEvent = DoubleClick 39 | { 40 | if (!A_EventInfo) 41 | return 42 | 43 | Gui +OwnDialogs 44 | LV_GetText(objRef,A_EventInfo,5) 45 | t := packs[objRef].id ".ahkp - Screenshot" 46 | s := packs[objRef].screenshot 47 | if StrLen(s) { 48 | Gui 1:+Disabled 49 | Gui, projector:+Owner1 50 | HTML_page := "" 51 | Display(WB,HTML_page) 52 | Gui, projector:Show,,%t% 53 | } else { 54 | MsgBox No screenshot to show. 55 | } 56 | } 57 | return 58 | 59 | Display(wb,html_str) { 60 | wb.Navigate("about:blank") 61 | while wb.readystate != 4 62 | sleep, 50 63 | wb.document.Write(html_str) 64 | } 65 | 66 | projectorGuiClose: 67 | Gui 1:-Disabled 68 | Gui projector:hide 69 | return 70 | 71 | GuiClose: 72 | ExitApp 73 | -------------------------------------------------------------------------------- /Local-Client/Tests/Validate_Test.ahk: -------------------------------------------------------------------------------- 1 | ;Test Package Validation 2 | 3 | Gui, Add, Button, x0 y0 w50 h20 gBrowse, Browse 4 | Gui, Add, Edit, x+0 yp w170 hp +ReadOnly vPath, 5 | Gui, Add, Button, x0 y+0 w220 hp gValidate, Validate 6 | Gui, Show, w220 h40, Package Validation 7 | return 8 | 9 | GuiClose: 10 | ExitApp 11 | 12 | Browse: 13 | FileSelectFile, SelectedFile, 3, , Open a Package file, AHKP file (*.ahkp) 14 | if StrLen(SelectedFile) 15 | GuiControl,,Path, % Util_ShortPath(Path:=SelectedFile,32) 16 | return 17 | 18 | Validate: 19 | if Package_Validate(Path) 20 | { 21 | SplitPath,Path,,,x 22 | if x = AHKP 23 | MsgBox, 64, , The package seems to be valid. 24 | else 25 | MsgBox, 48, , The package seems to be valid.`nNotice: The extension "%x%" should be "AHKP" 26 | } 27 | else 28 | { 29 | MsgBox, 16, , The package is invalid! 30 | } 31 | return -------------------------------------------------------------------------------- /Local-Client/Tests/geekdude_version.ahk: -------------------------------------------------------------------------------- 1 |  ; http://ahk.uk.to/?p=2ae86b 2 | Http := ComObjCreate("WinHttp.WinHttpRequest.5.1") 3 | Http.Open("GET", "http://api-php.aspdm.2fh.co/list.php?full", false) 4 | Http.Send() 5 | 6 | ; Use Coco or VxE's JSON lib. I have Coco's lib wrapped like VxE's 7 | Libraries := Json_ToObj(http.ResponseText) 8 | 9 | Gui, Add, ListView, w640 h480 gMyListView, Name|Author|Version|Branch|Package 10 | for Package, Library in Libraries 11 | LV_Add("", Library.Name, Library.Author, Library.Version, Library.AHKBranch, Package) 12 | Loop, 5 13 | LV_ModifyCol(A_Index, "AutoHdr") 14 | Gui, Show 15 | return 16 | 17 | GuiClose: 18 | ExitApp 19 | return 20 | 21 | MyListView: 22 | if (A_GuiEvent == "DoubleClick") 23 | { 24 | LV_GetText(Package, A_EventInfo, 5) 25 | Run, % Libraries[Package].ForumUrl 26 | } 27 | return -------------------------------------------------------------------------------- /Local-Client/rHandler.ahk: -------------------------------------------------------------------------------- 1 | #NoTrayIcon 2 | 3 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 4 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 5 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 6 | #Include Lib\Arguments.ahk 7 | #Include Lib\NetworkAPI.ahk 8 | 9 | ; Custom URI Documentation : http://msdn.microsoft.com/en-us/library/ie/aa767914 10 | 11 | if (!A_IsCompiled) { 12 | MsgBox, 48, , Please compile this script first. 13 | ExitApp 14 | } 15 | /* 16 | if (!A_IsAdmin) { 17 | MsgBox, 16, , Error: Please run as Administrator. 18 | ExitApp 19 | } 20 | */ 21 | if (!args) { 22 | MsgBox, 16, , Error: no args 23 | ExitApp 24 | } 25 | 26 | ;////////////////////////////////////// 27 | if (!!FileExist(args[1])) 28 | gosub, FILE_MODE 29 | else 30 | gosub, URL_MODE 31 | ExitApp 32 | ;////////////////////////////////////// 33 | 34 | FILE_MODE: 35 | if (!FileExist(FILE_str:=args[1])) { 36 | MsgBox, 16, , Error: Could not open file:`n`n`t"%FILE_str%" 37 | ExitApp 38 | } 39 | 40 | Progress CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, Waiting..., Loading Package... 41 | Progress Show 42 | info:=JSON_ToObj(Manifest_FromPackage(FILE_str)) ;assuming only one package. Future: CSV Elements -> Loop for each 43 | pack_id:=info["id"] 44 | load_progress(pack_id,1,1) 45 | Sleep 100 46 | Progress, Off 47 | if (StrLen(trim(pack_id))==0) { 48 | MsgBox, 16, , Error: The following package seems to be invalid:`n`n`t"%FILE_str%" 49 | ExitApp 50 | } 51 | run Package_Lister.ahk "--local" "%FILE_str%",,UseErrorLevel 52 | if ErrorLevel 53 | MsgBox, 48, , ASPDM could not start properly.`nError: (%ErrorLevel%)[%A_LastError%] 54 | return 55 | 56 | URL_MODE: 57 | URI_raw:=args[1] 58 | URI_str:=Trim(RegExReplace(URI_raw,".*:\/*")) ; ex: aspdm://domain.name/packid - see issue #10 (https://github.com/ahkscript/ASPDM/issues/10) 59 | URI_:=StrSplit(URI_str,"/") 60 | URI_Source:=Trim(URI_[1]) 61 | URI_PackID:=Trim(URI_[2]) 62 | URI_LIBDIR:=Trim(URI_[3]) 63 | 64 | if !URI_PackID 65 | { 66 | URI_PackID:=URI_Source ;source unspecified, using default 67 | } else { 68 | if !API_SetSource(URI_Source) { 69 | MsgBox, 48, , [URI Error] The specified package source is invalid or failed to respond correctly:`n`n`t%URI_Source%`n`nThe program will now exit. 70 | ExitApp 71 | } 72 | } 73 | if !StrLen(URI_PackID) { 74 | MsgBox, 48, , [URI Error] The specified URI is invalid:`n`n`t%URI_raw%`n`nThe program will now exit. 75 | ExitApp 76 | } 77 | 78 | if !Ping() { 79 | MsgBox, 48, , [Network Error] Check your internet connection.`nThe program will now exit. 80 | ExitApp 81 | } 82 | Progress CWFEFEF0 CT111111 CB468847 w330 h52 B1 FS8 WM700 WS700 FM8 ZH12 ZY3 C11, Waiting..., Loading Package List... 83 | Progress Show 84 | info:=JSON_ToObj(raw:=API_info(URI_PackID ".ahkp")) ;assuming only one package. Future: CSV Elements -> Loop for each 85 | if (!strlen(info["id"])) { 86 | Progress, Off 87 | if (InStr(raw,"suspended")) 88 | raw_reason:="ERROR: Server suspended for 24 hours." 89 | else if (InStr(raw,"File does not exist.")) { 90 | MsgBox, 48, , The following package does not exist:`n%URI_PackID%.ahkp`n`nServer Response:`n[[%raw%]] 91 | ExitApp 92 | } else 93 | raw_reason:=raw 94 | MsgBox, 48, , The ASPDM API is not responding.`nThe server might be down.`nPlease try again in while (5 min).`n`nServer Response:`n[[%raw_reason%]] 95 | ExitApp 96 | } 97 | pack_id:=info["id"] 98 | load_progress(URI_str,1,1) 99 | Sleep 100 100 | Progress, Off 101 | if (StrLen(trim(pack_id))==0) { 102 | MsgBox, 16, , Error: Non existent Package ("%URI_PackID%.ahkp")? 103 | ExitApp 104 | } 105 | LIBMODE := "" 106 | if StrLen(URI_LIBDIR)>1 107 | LIBMODE := "-L" URI_LIBDIR 108 | run Package_Lister.ahk %LIBMODE% "--source" "%URI_Source%" "%pack_id%.ahkp",,UseErrorLevel 109 | if ErrorLevel 110 | MsgBox, 48, , ASPDM could not start properly.`nError: (%ErrorLevel%)[%A_LastError%] 111 | return 112 | 113 | 114 | load_progress(t,c,f) { 115 | p:=Round((c/f)*100) 116 | Progress, %p% , Loading: %c% / %f% items [ %p%`% ] , %t% 117 | } 118 | -------------------------------------------------------------------------------- /Network/.htaccess: -------------------------------------------------------------------------------- 1 | Options -Indexes 2 | 3 | AddType application/octet-stream .ahkp .bin .exe 4 | 5 | ErrorDocument 400 /error_docs/400.html 6 | ErrorDocument 401 /error_docs/401.html 7 | ErrorDocument 403 /error_docs/403.html 8 | ErrorDocument 404 /error_docs/404.html 9 | ErrorDocument 500 /error_docs/500.html -------------------------------------------------------------------------------- /Network/about.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | About | ASPDM 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

ASPDM - AHKScript.org's Package/StdLib Distribution and Management

22 |
23 | 24 | 27 | 28 |

About ASPDM

29 |
30 | ASPDM stands for AHKScript.org's Package/StdLib Distribution and Management. It is meant to provide an easy and practical way to install libraries and tools written for and in the AutoHotkey scripting language. It is recommended to read the official guidelines and other specifications prior to releasing packages for the ASPDM package manager. The ASPDM local client is entirely written in AutoHotkey itself and requires AutoHotkey v1.1.13.00+ to be installed (older versions and v2+ are not officially supported). ASPDM also aims to standardise the organisation of community-shared scripts and libraries: to create a "defacto"/official Standard Library (or known as "StdLib"). The ASPDM code itself is released under the MIT/ADPL(?) License. If you would like to contribute to this project, you may do so through many ways such as reporting bugs, providing code improvements or even discuss ideas on either our GitHub repository, Trello board or Forum topic. 31 |
32 | 33 |

Credits

34 |
35 | Thanks to the whole AutoHotKey team and its contributors, and especially to @george2, @perfaram, @fincs, and @joedf, who worked on the ASPDM project! 36 |
37 |
38 | 39 |

Notice

40 |

Content terms and conditions

41 |

42 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at scelerisque magna, sed hendrerit enim. Aliquam interdum, felis non euismod dignissim, arcu nisi eleifend enim, sed mollis sem sem quis sem. Donec in iaculis quam, sed pretium quam. Donec congue, nunc vitae elementum tempus, nibh neque scelerisque ante, at tempus lacus augue convallis dui. Maecenas vitae elit consequat, volutpat nisl nec, mollis mi. Curabitur non tellus ut enim tristique commodo. Nulla pulvinar tellus augue, eget auctor est euismod nec. Maecenas vestibulum tortor at lacus aliquet, sed rhoncus leo elementum. Aliquam eleifend aliquet odio ut euismod. Morbi volutpat orci in ipsum facilisis, porttitor eleifend ipsum viverra. Nullam quis vehicula nisi. 43 |

44 |
45 | 46 | 47 | 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /Network/api-php/info.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/api-php/list.php: -------------------------------------------------------------------------------- 1 | 1) 21 | echo ','; 22 | echo '"'.$entry.'":'; 23 | print_metadata($entry,NULL); 24 | } 25 | } 26 | else 27 | { 28 | while (false !== ($entry = readdir($handle))) { 29 | if ($entry != "." && $entry != ".." && $entry != "tmp") { 30 | $i = $i + 1; 31 | if ($i>1) 32 | echo ','; 33 | echo '"'.$entry.'":'; 34 | print_metadata($entry,NULL); 35 | } 36 | } 37 | } 38 | closedir($handle); 39 | } 40 | echo "}"; 41 | } 42 | else if (isset($_GET["lim"])) 43 | { 44 | $lim=abs(intval($_GET["lim"])); 45 | $origin=abs(intval($_GET["origin"])); //Defaults to '0' (zero) 46 | 47 | if ($lim!=$origin) { 48 | echo "{"; 49 | $i = 0; 50 | $k = 1; 51 | if ($handle = opendir('../packs')) { 52 | if (isset($_GET["sort"])) 53 | { 54 | $files = array(); 55 | while(false != ($entry = readdir($handle))) { 56 | if ($entry != "." && $entry != ".." && $entry != "tmp") { 57 | $files[] = $entry; // put in array. 58 | } 59 | } 60 | natcasesort($files); // natural sort array 61 | foreach($files as $entry) { 62 | if ($k>=$origin) { 63 | $i+=1; 64 | if ($i>1) 65 | echo ','; 66 | echo '"'.$entry.'":'; 67 | print_metadata($entry,NULL); 68 | if ($i==$lim) 69 | break; 70 | } 71 | $k+=1; 72 | } 73 | } 74 | else 75 | { 76 | while (false !== ($entry = readdir($handle))) { 77 | if ($entry != "." && $entry != ".." && $entry != "tmp") { 78 | if ($k>=$origin) { 79 | $i+=1; 80 | if ($i>1) 81 | echo ','; 82 | echo '"'.$entry.'":'; 83 | print_metadata($entry,NULL); 84 | if ($i==$lim) 85 | break; 86 | } 87 | $k+=1; 88 | } 89 | } 90 | } 91 | closedir($handle); 92 | } 93 | echo "}"; 94 | } 95 | } 96 | else 97 | { 98 | if ($handle = opendir('../packs')) { 99 | if (isset($_GET["sort"])) 100 | { 101 | $files = array(); 102 | while(false != ($entry = readdir($handle))) { 103 | if ($entry != "." && $entry != ".." && $entry != "tmp") { 104 | $files[] = $entry; // put in array. 105 | } 106 | } 107 | natcasesort($files); // natural sort array 108 | foreach($files as $entry) { 109 | echo $entry . "\n"; 110 | } 111 | } 112 | else 113 | { 114 | while (false !== ($entry = readdir($handle))) { 115 | if ($entry != "." && $entry != ".." && $entry != "tmp") { 116 | echo $entry . "\n"; 117 | } 118 | } 119 | } 120 | closedir($handle); 121 | } 122 | } 123 | ?> -------------------------------------------------------------------------------- /Network/api-php/status.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/client/archive.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Client | ASPDM 7 | 8 | 9 | 17 | 18 | 19 |
20 |

21 | 22 | ASPDM : Package Manager 23 | 24 |

25 |

Download archive

26 |

27 | 28 | EST with Daylight Savings Time 30 | $timetype = date("I")?"EDT":"EST"; 31 | if (isset($_REQUEST["hash"]) || isset($_REQUEST["checksum"])) { 32 | $hash = 1; 33 | echo ''; 34 | } else { 35 | $hash = 0; 36 | echo ''; 37 | } 38 | ?> 39 | 40 | '; 45 | $i = $i + 1; 46 | } 47 | else 48 | foreach (glob("*.{exe,zip}",GLOB_BRACE) as $file) { 49 | echo ''; 50 | $i = $i + 1; 51 | } 52 | if (!$i) 53 | if ($hash) 54 | echo ''; 55 | else 56 | echo ''; 57 | ?> 58 | 59 |
FileLast modified '.'('.$timetype.')'.'SizeChecksum
FileLast modified '.'('.$timetype.')'.'Size
'.$file.''.date("Y-m-d H:i",filemtime($file)).''.formatSizeUnits(filesize($file)).'[ MD5 ] '.md5_file($file).'
[SHA-1] '.sha1_file($file).'
'.$file.''.date("Y-m-d H:i",filemtime($file)).''.formatSizeUnits(filesize($file)).'
----
---
60 |
61 |
62 | 71 |
72 | 73 | -------------------------------------------------------------------------------- /Network/client/get.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/client/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Client | ASPDM 7 | 8 | 18 | 19 | 20 |
21 |

22 | 23 | ASPDM : Package Manager 24 | 25 |

26 |


27 | '; 30 | $file = 'ASPDM_Install-v'.$version.'.exe'; 31 | echo ''; 32 | ?> 33 | 34 | 35 | 36 | Download
Version '.$version.' (beta)'; 38 | ?> 39 | 40 |
Logo
41 |
42 |
43 | EST with Daylight Savings Time 45 | $timetype = date("I")?"EDT":"EST"; 46 | echo '

Last updated: '.date("F jS, Y H:i:s",filemtime($file)).' ('.$timetype.')

'; 47 | echo '

MD5: '.md5_file($file).'
SHA-1: '.sha1_file($file).'

'; 48 | ?> 49 |

50 |
51 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Network/client/style.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family:Helvetica,Arial,sans-serif; 3 | text-align:center; 4 | margin:auto; 5 | } 6 | 7 | a { color:#0088cc;text-decoration:none; } 8 | a:active { position:relative;top:1px; } 9 | 10 | h1 a { color:black; } 11 | h1 { font-size:24px; } 12 | 13 | hr { border: #666 solid;border-width: 1px 0 0; } 14 | 15 | #logo { 16 | height:48px; 17 | width:48px; 18 | vertical-align:middle; 19 | } 20 | 21 | #footer a:hover { text-decoration:underline; } 22 | #footer { font-size:10px; } -------------------------------------------------------------------------------- /Network/client/update.ini: -------------------------------------------------------------------------------- 1 | [Update] 2 | Version=1.0.0.0 3 | URL=http://aspdm.ahkscript.org/client -------------------------------------------------------------------------------- /Network/dev/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/dl_file.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/error_docs/400.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ASPDM - Error 400 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

ASPDM - AHKScript.org's Package/StdLib Distribution and Management

14 |
15 |
400
16 |

Error 400 - Bad request

17 |

Woah there! Looks your browser doesn't even know what it wants.
It speaks some kind of obscure jibber-jabber. Seriously, try checking for errors, then hit the refresh button on your browser.

18 |
19 | 22 | 23 | -------------------------------------------------------------------------------- /Network/error_docs/401.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ASPDM - Error 401 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

ASPDM - AHKScript.org's Package/StdLib Distribution and Management

14 |
15 |
401
16 |

Error 401 - Authorization required

17 |

Tsk tsk... Looks like you're trying to be a sneaky little devil.
The page you are trying to view requires authorization. If you feel you got this message by mistake, try contacting support.

18 |
19 | 22 | 23 | -------------------------------------------------------------------------------- /Network/error_docs/403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ASPDM - Error 403 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

ASPDM - AHKScript.org's Package/StdLib Distribution and Management

14 |
15 |
403
16 |

Error 403 - Forbidden

17 |

Oh noes! Looks like you're on the naughty list.
The page you are trying to view is forbidden. If you feel you got this message by mistake, try contacting support.

18 |
19 | 22 | 23 | -------------------------------------------------------------------------------- /Network/error_docs/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ASPDM - Error 404 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

ASPDM - AHKScript.org's Package/StdLib Distribution and Management

14 |
15 |
404
16 |

Error 404 - File not found

17 |

Awww man... Looks like the page you're looking for doesn't exist.
Try checking the URL for errors, then hit the refresh button on your browser.

18 |
19 | 22 | 23 | -------------------------------------------------------------------------------- /Network/error_docs/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ASPDM - Error 500 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

ASPDM - AHKScript.org's Package/StdLib Distribution and Management

14 |
15 |
500
16 |

Error 500 - Internal server error

17 |

Oh noes! Looks like the server is pooped.
Give it at least a 2 minute break,
then try reloading this page.

18 |
19 | 22 | 23 | -------------------------------------------------------------------------------- /Network/error_docs/error.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: "Arial",sans-serif; 3 | padding: 0; 4 | margin: 0; 5 | background-color: #eee; 6 | min-height: 600px; 7 | min-width: 600px; 8 | } 9 | 10 | h1 { 11 | color: #fff; 12 | background-color: #111111; 13 | font-weight: bold; 14 | font-size: 20px; 15 | padding: 24px; 16 | width: 100%; 17 | text-shadow: -1px -1px #666; 18 | margin: 0; 19 | position: fixed; 20 | z-index: 2; 21 | } 22 | 23 | h1 * { 24 | text-decoration: none !important; 25 | color: #fff !important; 26 | } 27 | 28 | .large { 29 | margin: auto; 30 | text-align: center; 31 | padding: 24px; 32 | font-size: 64px; 33 | text-shadow: 1px 1px white; 34 | } 35 | 36 | h2 { 37 | color: #666; 38 | text-shadow: 1px 1px white; 39 | font-size: 20px; 40 | font-weight: bold; 41 | text-align: center; 42 | margin: 0; 43 | } 44 | 45 | p { 46 | color: #666; 47 | text-shadow: 1px 1px white; 48 | font-size: 16px; 49 | text-align: center; 50 | margin: auto; 51 | width: 480px; 52 | padding-top: 16px; 53 | } 54 | 55 | .footer { 56 | position: absolute; 57 | bottom: 0; 58 | left: 0; 59 | width: 100%; 60 | color: #fff; 61 | text-align: center; 62 | font-size: 11px; 63 | background-color: #111111; 64 | padding-top: 32px; 65 | padding-bottom: 32px; 66 | margin: auto; 67 | position: fixed; 68 | z-index: 2; 69 | } 70 | 71 | #content { 72 | width:500px; 73 | margin:auto; 74 | position: absolute; 75 | top:30%; 76 | left:50%; 77 | margin-left: -250px; 78 | border:1px dashed #333; 79 | padding-bottom: 24px; 80 | background-color: #F8F8F8; 81 | } 82 | 83 | a:hover, a:focus { 84 | color: rgb(42, 100, 150); 85 | text-decoration: underline; 86 | } 87 | a:active, a:hover { outline: 0; } 88 | a { 89 | color: rgb(66, 139, 202); 90 | text-decoration: none; 91 | } -------------------------------------------------------------------------------- /Network/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/favicon.ico -------------------------------------------------------------------------------- /Network/footer.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/header.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/lib/JSON_Beautify.php: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Network/lib/db_info.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/lib/pagelock.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/lib/server.php: -------------------------------------------------------------------------------- 1 | '; 64 | echo 'alert("'.$m.'")'; 65 | echo ''; 66 | } 67 | 68 | function js_redirect($url="") { 69 | echo ''; 72 | } 73 | 74 | ?> -------------------------------------------------------------------------------- /Network/logout.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | Logout 12 | 13 | 14 |

logged out.

15 |

You will be redirected in 3 second(s). 16 |
Click here to be redirected immediately.

17 | 28 | 29 | -------------------------------------------------------------------------------- /Network/navmenu.php: -------------------------------------------------------------------------------- 1 | Hi, ' . $_SESSION["sess_username"] . ' Sign Out'; 8 | else 9 | echo 'Sign In'; 10 | } 11 | 12 | if (strcasecmp($pageName,"index.php")!=0) 13 | echo ' List Packages'; 14 | 15 | if(isset($sess_valid) && $sess_valid) { 16 | if (strcasecmp($pageName,"submit.php")!=0) 17 | echo ' Submit Package'; 18 | } 19 | 20 | if (strcasecmp($pageName,"about.php")!=0) 21 | echo ' About ASPDM'; 22 | ?> -------------------------------------------------------------------------------- /Network/p_login.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Network/packs/tmp/folder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/packs/tmp/folder -------------------------------------------------------------------------------- /Network/src/2fh_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/2fh_icon.png -------------------------------------------------------------------------------- /Network/src/ValidateForm.js: -------------------------------------------------------------------------------- 1 | function ValidateForm(frm) { 2 | if (isBlank(frm.username.value)) { 3 | alert("Please provide your username."); 4 | frm.username.focus(); 5 | return false; 6 | } 7 | if (isBlank(frm.password.value)) { 8 | alert("Please provide your password."); 9 | frm.password.focus(); 10 | return false; 11 | } 12 | return true; 13 | } 14 | 15 | function isBlank(s) { 16 | return s.match(/^$|\s+/); 17 | } -------------------------------------------------------------------------------- /Network/src/ahk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/ahk.png -------------------------------------------------------------------------------- /Network/src/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/arch.png -------------------------------------------------------------------------------- /Network/src/font-awesome-4.0.3/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/font-awesome-4.0.3/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /Network/src/font-awesome-4.0.3/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/font-awesome-4.0.3/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /Network/src/font-awesome-4.0.3/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/font-awesome-4.0.3/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /Network/src/font-awesome-4.0.3/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/font-awesome-4.0.3/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /Network/src/get_aspdm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/get_aspdm.png -------------------------------------------------------------------------------- /Network/src/install48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahkscript/ASPDM/4471f8b39c52a5919d697a59a7f9f7e51528bdb7/Network/src/install48.png -------------------------------------------------------------------------------- /Network/src/jquery.hashchange.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery hashchange event - v1.3 - 7/21/2010 3 | * http://benalman.com/projects/jquery-hashchange-plugin/ 4 | * 5 | * Copyright (c) 2010 "Cowboy" Ben Alman 6 | * Dual licensed under the MIT and GPL licenses. 7 | * http://benalman.com/about/license/ 8 | */ 9 | (function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('