Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/23/2017 in all areas

  1. Recently I was working on TeamVierwer API . I had a little break, and wanted to check out another platform. Here is the result of my attempt: #include "GHAPI.au3" _GHAPI_AccessToken('b3e8.....de..........bdc3a0c.....bd27c6f') _GHAPI_GetUser("users/mLipok") _GHAPI_GetUserOrganizations("users/mLipok") _GHAPI_RootEndpoints() and GHAPI.au3 #include-once #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 #Tidy_Parameters=/sort_funcs /reel #Region GHAPI.au3 - Header ; #INDEX# ======================================================================================================================= ; Title .........: GHAPI UDF ; AutoIt Version : 3.3.10.2++ ; Language ......: English ; Description ...: This is an UDF for for communicate with https://api.github.com via GitHub RESTful API ; Author(s) .....: mLipok ; Modified ......: ; =============================================================================================================================== #cs Title: GHAPI UDF Filename: GHAPI.au3 Description: This is an UDF for for communicate with https://api.github.com via GitHub RESTful API Author: mLipok Modified: Last Update: 2017/05/23 Requirements: AutoIt 3.3.10.2 or higher #ce #EndRegion GHAPI.au3 - Header #Region GHAPI.au3 - Include #include <array.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #EndRegion GHAPI.au3 - Include #Region GHAPI.au3 - Declarations Global $oErrorHandler = ObjEvent("AutoIt.Error", "_GHAPI_ErrFunc") Global $__g_sGitHubAPI_BaseUrl = "https://api.github.com" ; URL of the GitHub API Global $__g_sGitHubAPI_Version = "v3" ; Put the current API version in here Global Enum _ $GHAPI_ERR_SUCCESS, _ $GHAPI_ERR_GENERAL, _ $GHAPI_ERR_COMERROR, _ $GHAPI_ERR_STATUS, _ $GHAPI_ERR_COUNTER Global Enum _ $GHAPI_EXT_DEFAULT, _ $GHAPI_EXT_PARAM1, _ $GHAPI_EXT_PARAM2, _ $GHAPI_EXT_PARAM3, _ $GHAPI_EXT_COUNTER Global Enum _ $GHAPI_RET_SUCCESS, _ $GHAPI_RET_FAILURE, _ $GHAPI_RET_COUNTER #EndRegion GHAPI.au3 - Declarations #Region GHAPI.au3 - API Functions Func _GHAPI_ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_GHAPI_ErrFunc Func _GHAPI_AccessToken($sParam = Default) ; https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/ ; https://github.com/settings/tokens Local Static $sAccessToken = '' If $sParam <> Default Then $sAccessToken = $sParam Return $sAccessToken EndFunc ;==>_GHAPI_AccessToken Func _GHAPI_GetUser($sUser) Local $oHTTP = __GHAPI_HTTP_Open("GET", $sUser) Local $oJSON = __GHAPI_HTTP_Send($oHTTP) If @error Then Return SetError(@error, @extended, False) #forceref $oJSON EndFunc ;==>_GHAPI_GetUser Func _GHAPI_GetUserOrganizations($sUser) Local $oHTTP = __GHAPI_HTTP_Open("GET", $sUser & '/orgs') Local $oJSON = __GHAPI_HTTP_Send($oHTTP) If @error Then Return SetError(@error, @extended, False) #forceref $oJSON EndFunc ;==>_GHAPI_GetUserOrganizations Func _GHAPI_RootEndpoints() Local $oHTTP = __GHAPI_HTTP_Open("GET", '') Local $oJSON = __GHAPI_HTTP_Send($oHTTP) If @error Then Return SetError(@error, @extended, False) #forceref $oJSON EndFunc ;==>_GHAPI_RootEndpoints #EndRegion GHAPI.au3 - API Functions #Region GHAPI.au3 - INTERNAL Functions Func __GHAPI_HTTP_Open($sMethod, $sCommand, $sURLParameters = '') Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") Local $sURL = $__g_sGitHubAPI_BaseUrl & "/" & $sCommand & $sURLParameters ;~ __GHAPI_DebugOut("> $sURL=" & $sURL & @CRLF) $oHTTP.Open($sMethod, $sURL, False) If @error Then Return SetError(@error, @extended, Null) $oHTTP.setRequestHeader("Authorization", "Bearer " & _GHAPI_AccessToken()) ; Accept: application/vnd.github.v3+json $oHTTP.setRequestHeader("Accept", "application/vnd.github." & $__g_sGitHubAPI_Version & "+json") ; User-Agent: Awesome-Octocat-App $oHTTP.setRequestHeader("User-Agent", "AutoIt UDF") Return $oHTTP EndFunc ;==>__GHAPI_HTTP_Open Func __GHAPI_HTTP_Send(ByRef $oHTTP, $sSendParameter = Default) If $sSendParameter = Default Then $oHTTP.Send() Else $oHTTP.Send($sSendParameter) EndIf ConsoleWrite('+' & $oHTTP.Status & @CRLF) ConsoleWrite('>' & $oHTTP.StatusText & @CRLF) ConsoleWrite($oHTTP.ResponseText & @CRLF) ConsoleWrite(@CRLF) If @error Then Return SetError(@error, @extended, $GHAPI_RET_FAILURE) ;~ Return SetError($GHAPI_ERR_SUCCESS, $oJSON.Size, $oJSON) EndFunc ;==>__GHAPI_HTTP_Send #EndRegion GHAPI.au3 - INTERNAL Functions #Region GHAPI.au3 - HOWTO / DOCS / HELP #CS https://developer.github.com/v3/ https://developer.github.com/v3/guides/ https://developer.github.com/program/ https://github.com/contact?form%5Bsubject%5D=New+GitHub+Integration https://developer.github.com/ http://stackoverflow.com/questions/28796941/github-api-authentication-with-msxml2-xmlhttp #CE #EndRegion GHAPI.au3 - HOWTO / DOCS / HELP REMARKS: This is just a modest start up and not a whole fully workable UDF, just so for a try, but maybe someone will be useful Regards, mLipok EDIT 1: If you need to make it workable just ask about specyfic feature. EDIT 2: Some changes in using word "GitHub" - to meet this rules: https://github.com/logos
    1 point
  2. So I was playing with INet and downloading files and made a simple video downloader, or it can even be used for any file really. Just follow the reference section in INet_Settings.ini , and then run the script. Main Script <snip> INet_Settings.ini URL - The target URL of the video you're trying to grab Data - This is the starting string, and ending string reference to look for the download URL itself. Settings - Only setting here currently, is the delay in which to wait for the file to download ### Reference for Start and End points for various websites <snip> Credits to : https://www.autoitscript.com/forum/profile/31965-progandy/ for the URL Encode and Decode.
    1 point
  3. _Metro_CreateRadio("1", "Yes", 424, 40, 185, 30, $GUIThemeColor, $FontThemeColor,"Segoe UI", "14") Hi, thanks for reminding me. I had not enough time and motivation to work on it yet. I would like to finish my plans for MetroGUI UDF and use it in TV-Show-Manager V5. I am lacking the motivation and time that I had before that allowed me to finish such things within 2-3 days I ran into some compatibility problems on Windows 7 and lower, with some of the effects I used which caused a lot of time to be wasted and was a set back for the project.. I will for sure finish it as I have put a lot of work in the current state of it, it is just a question of time. And yes, the check for updates should work.
    1 point
  4. jchd

    DLL calls

    Because a wchar isn't a char. A wchar represents an encoding unit of the UTF16-LE encoding, hence 16-bit. Note that for Windows this doesn't reflect reality since a Unicode codepoint in UTF16 may need two 16-bit encoding units (using a surrogate). This is necessary to represent characters in higher Unicode planes than the BMP (Basic multilingual Plane). But since AutoIt is essentially using a slightly restricted character set (UCS2) than the full Unicode range, you can approximate that a wchar represents a single Unicode character, coded as a 16-bit unit. Also realize that in any Unicode encoding a "character" (in the sense of "the composed glyph that a user can see displayed on the screen") may be represented by an unbounded number of codepoints.
    1 point
  5. Here's the beginnings of SFML (the Simple and Fast Multimedia Library) for AutoIT. This library provides a wealth of features for developing games and multimedia applications. You can read up more about SFML here -> http://www.sfml-dev.org. It uses OpenGL as the renderer for 2D graphics such as sprites, so it's performance is quite good. Currently my interest is in 2D sprite engines, so my focus is on the sprite and window APIs. This is the precursor to another separate UDF I'm working on and will release soon. If there's any interest I'll flesh out more of this API for the community. CSFML is the "C" binding / API for SFML, and it's this API that I'm building this UDF against. REQUIREMENTS: AutoIt3 3.2 or higher LIST OF FUNCTIONS (so far): _CSFML_Startup _CSFML_Shutdown _CSFML_sfClock_create _CSFML_sfClock_getElapsedTime _CSFML_sfClock_restart _CSFML_sfVector2f_Constructor _CSFML_sfVector2f_Update _CSFML_sfVector2f_Move _CSFML_sfColor_Constructor _CSFML_sfColor_fromRGB _CSFML_sfSizeEvent_Constructor _CSFML_sfEvent_Constructor _CSFML_sfVideoMode_Constructor _CSFML_sfRenderWindow_create _CSFML_sfRenderWindow_setVerticalSyncEnabled _CSFML_sfRenderWindow_isOpen _CSFML_sfRenderWindow_pollEvent _CSFML_sfRenderWindow_clear _CSFML_sfRenderWindow_drawText _CSFML_sfRenderWindow_drawSprite _CSFML_sfRenderWindow_display _CSFML_sfRenderWindow_close _CSFML_sfTexture_createFromFile _CSFML_sfSprite_create _CSFML_sfSprite_destroy _CSFML_sfSprite_setTexture _CSFML_sfSprite_setPosition _CSFML_sfSprite_setRotation _CSFML_sfSprite_rotate _CSFML_sfSprite_setOrigin _CSFML_sfFont_createFromFile _CSFML_sfText_create _CSFML_sfText_setString _CSFML_sfText_setFont _CSFML_sfText_setCharacterSize _CSFML_sfText_setFillColor EXAMPLE: Currently I only have one example, which is the "Short example" described in the CSFML API documentation, plus some extra features. Essentially a window (GUI) allowing you to move a sprite around with the keyboard (including rotation). DOWNLOAD: You can download this UDF, including the example and associated files, from the following GitHub page: https://github.com/seanhaydongriffin/CSFML-UDF Cheers, Sean.
    1 point
  6. 1 point
  7. psyko, And now I have translated your post in its entirety I see that Danyfirex is correct. You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing game automation - before you post again and then you will understand why you will get no help and this thread will now be locked. M23
    1 point
  8. Hola. En este foro no se brinda ayuda para crear Bots para juegos. Pasate a leer las reglas. Saludos
    1 point
  9. what app/website are you trying to automate?
    1 point
  10. Quite a few issues in how the code is laid out. @ComSpec needs a /k or /c proceeding Your $nResult variable declaration would need quotes around it to make it a string. I wrote a full GUI for Spotify to use on a Windows tablet because it was too hard to push the tiny little buttons on a 8" tablet, so I made big buttons with a GUI, and the tablet screen should shut off, so the code also keeps the tablet awake. I'll just post the full code incase you see anything you like, but it does have a "now playing" piece that you can look at. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIButton.au3> #include <WindowsConstants.au3> FileInstall("VolDown.jpg", @TempDir & "\VolDown.jpg", 1) FileInstall("Mute.jpg", @TempDir & "\Mute.jpg", 1) FileInstall("VolUp.jpg", @TempDir & "\VolUp.jpg", 1) FileInstall("Back.jpg", @TempDir & "\Back.jpg", 1) FileInstall("Forward.jpg", @TempDir & "\Forward.jpg", 1) FileInstall("Play.jpg", @TempDir & "\Play.jpg", 1) FileInstall("Pause.jpg", @TempDir & "\Pause.jpg", 1) FileInstall("Spotify.jpg", @TempDir & "\Spotify.jpg", 1) AdLibRegister("KeepAlive", 60000) $Form1 = GUICreate("Patrick's Tablet Audio GUI", 621, 545, 192, 124) $Button1 = GUICtrlCreatePic(@TempDir & "\VolDown.jpg", 56, 416, 90, 90) $Button2 = GUICtrlCreatePic(@TempDir & "\Mute.jpg", 269, 418, 90, 90) $Button3 = GUICtrlCreatePic(@TempDir & "\VolUp.jpg", 493, 418, 90, 90) $Button4 = GUICtrlCreatePic(@TempDir & "\Back.jpg", 60, 223, 90, 90) $Button5 = GUICtrlCreatePic(@TempDir & "\Play.jpg", 225, 169, 180, 180) $Button6 = GUICtrlCreatePic(@TempDir & "\Forward.jpg", 491, 222, 90, 90) $Button7 = GUICtrlCreatePic(@TempDir & "\Spotify.jpg", 260, 20, 110, 110) $Label1 = GUICtrlCreateLabel("Spotify Now Playing Export Tool", 36, 140, 457, 24) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) GUICtrlSetImage($Button5, @TempDir & "\Pause.jpg") Global $vToggle = 1 Global $sWindow Global $sWindow2 While 1 If $sWindow <> $sWindow2 Then $sWindow = WinGetTitle("[CLASS:SpotifyMainWindow]", "") GUICtrlSetData($Label1, $sWindow) If StringRegExp($sWindow, "(?i)spotify") Then GUICtrlSetImage($Button5, @TempDir & "\Play.jpg") Else GUICtrlSetImage($Button5, @TempDir & "\Pause.jpg") EndIf EndIF $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Send("{VOLUME_DOWN 5}") Case $Button2 Send("{VOLUME_MUTE}") Case $Button3 Send("{VOLUME_UP 5}") Case $Button4 Send("{MEDIA_PREV}") Case $Button5 Send("{MEDIA_PLAY_PAUSE}") ;$vToggle +=1 ;If MOD($vToggle, 2) Then ; GUICtrlSetImage($Button5, @TempDir & "\Pause.jpg") ;Else ; GUICtrlSetImage($Button5, @TempDir & "\Play.jpg") ;EndIf Case $Button6 Send("{MEDIA_NEXT}") Case $Button7 If ProcessExists("Spotify.exe") Then ProcessClose("Spotify.exe") Else ShellExecute(@UserProfileDir & "\AppData\Roaming\Spotify\Spotify.exe") EndIf EndSwitch Sleep(10) $sWindow2 = WinGetTitle("[CLASS:SpotifyMainWindow]", "") WEnd Func KeepAlive() $aCurrentPos = MouseGetPos() MouseMove($aCurrentPos[0]+1, $aCurrentPos[1]) MouseMove($aCurrentPos[0]-1, $aCurrentPos[1]) EndFunc
    1 point
  11. wakillon

    Mp3SilenceRemover

    Version 1.0.1.6

    757 downloads

    Mp3SilenceRemover can trim a bunch of mp3 files that have silence at the beginnings and ends, automatically. Script scans each file for when the sound starts and ends, by detecting a pre-determined silence threshold, then reencode them without silent parts found. Usefull if you want use mp3 files for a mix or avoid long silences between tracks. Multiple settings are available for preserving mp3 quality. Mp3Gain can be used for avoid a too big difference in sound level between 2 tracks. Main Id3 Tags can be preserved and the fade at end of the track too. Script use : bass.dll, bassenc.dll, bassext.dll, tags.dll, lame.exe and mp3gain.exe.
    1 point
  12. orbs: You're right; in a multi-user environment to test for idle one would need to enumerate among the non-zero sessions. However, in my case, I am interested in the user session that started my script; hence the need to just check session 1.
    1 point
  13. Jefrey

    JSONgen: JSON generator

    Hey folks! I bring this JSON generator I made, which uses a syntax that reminds OOP a little. Here's an example: #include "JSONgen.au3" $oJson = New_Json() ; Let's add some stand-alone elements Json_AddElement($oJson, "test") ; A string Local $aArray[2] = ['hai', 'halo'] Json_AddElement($oJson, $aArray) ; An array ; Let's add some associative elements Json_AddElement($oJson, "hey", 2.55) Json_AddElement($oJson, "delete", "me") ; We will delete this one Json_AddElement($oJson, "hoo", True) Json_AddElement($oJson, "edit", "this") ; And edit this one ; Let's do some editing Json_DeleteElement($oJson, "delete") ; Deleting that one Json_EditElement($oJson, "edit", "that") ; Editing that one ; Let's now add an associated (non-associative) array :) Local $aArray[2] = ['hey', 'bye'] Json_AddElement($oJson, 'array', $aArray) ; Now we get the JSON $sTheJsonCode = Json_GetJson($oJson) MsgBox(0, "Json code", $sTheJsonCode)This will show: Includes help. License: CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/) Download: https://www.autoitscript.com/forum/files/file/345-jsongen-json-generator/
    1 point
  14. I haven't tried the COM method but it looks quite good. I posted put my UDF on the forum is because AutoitSteve tried using the COM method and other methods but couldn't send binary data because a byte of value 0 is seen as the end of a string. I offered him my method and he got his application working, and his opinion was that it was easier. So I thought it might help somene else. Also, you don't need to have any special software installed; just have my dll in the script dir. There are plenty of things my UDF/dll doesn't do, but on the other hand they could be added. ('Could' <> 'Will' of course).
    1 point
  15. arcker

    Multithread...

    recently, i've stopped with autoit, because of his singlethread conception i know i'm really boring, and that's it's difficult, but when you want to make multiple loops, autoit is not enough powerful so, my question is: will autoit manage to multithread in the future ? because i love it, and i hate .NET long life to autoit, our first script langage in our firm now...
    1 point
×
×
  • Create New...