Jump to content

Leaderboard

Popular Content

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

  1. Introduction ImGui is a popular library written by ocornut, it can make awesome user interface based on directx. It is being used by many big apps/games. The UI is nice and flexible, easy to use because of frame-by-frame drawing. So I decided to convert the entire ImGui library to AutoIt At first it's just an experiment, i converted some basic draw functions of imgui, compile to a dll, then using DllCall in autoit to call the functions. I was testing to see how much FPS i can get in autoit, and i was expected a low FPS, since autoit is slow. Suprisingly, the FPS turned out to be so high, it works really fast, even when drawing 1000 buttons at the same time. Features More than +270 functions converted from ImGui (compiled dll). Has 90% of the capability of what you can do in C++; Usable ImGuiIO and ImGuiStyle, so you can set whatever configurations you like. Preview Usage #include <WinAPI.au3> #include "ImGui.au3" ; Create a window Local $hwnd = _ImGui_GUICreate("AutoIt ImGui", 1024, 768) _WinAPI_ShowWindow($hwnd) ; Set style color _ImGui_StyleColorsLight() ;~ _ImGui_StyleColorsDark() Local $f_value = 5 While 1 ; when the user click close button on the window, this will return false if Not _ImGui_PeekMsg() Then Exit ; must call _ImGui_BeginFrame() _ImGui_Begin("Another window") _ImGui_Text("Hello there..") If _ImGui_Button("click me") Then $f_value = 5 _ImGui_SliderFloat("slider", $f_value, 2, 20) If _ImGui_IsItemHovered() Then _ImGui_ToolTip("what r u doing?") _ImGui_End() ; must call _ImGui_EndFrame() Wend Remark Most of the functions were converted automatically. I haven't tested all of them yet, if some function doesn't work for you, please tell me. Still missing some features of ImGui, please tell me if you needed any. Run \tools\imgui-au3-setup.au3 to add _ImGui functions to SciTE auto-complete. Source Code Require: DirectX GitHub: imgui-autoit
    1 point
  2. This doesn't work. The element I have to update is a text area of an embedded editor for a blog post which has an HTML writing mode.
    1 point
  3. @SkysLastChanceMost likely the first script is crashing because the second script closes existing instances of the webdriver. You can control this with _WD_Option and DRIVERDETECT / DRIVERCLOSE options.
    1 point
  4. I went for something proper than sending keyboard command. It works both with IEDriver and Geckodriver : Local $sElement = _WD_GetElementByName($oSelf.sWDSession, $sQuery) Local $sJsonElement = '{"element-6066-11e4-a52e-4f735466cecf":"' & $sElement & '"}' _WD_ExecuteScript($oSelf.sWDSession, "arguments[0].value = '' ;", $sJsonElement)
    1 point
  5. Hello. here is an example. You still need to download the Audio and maybe create some extra functions. #include <WinAPICom.au3> #include "Json\Json.au3" #include <Array.au3> Global Const $HTTP_STATUS_OK = 200 _TestFakeAPI() Func _TestFakeAPI() ;~ Local $aVoices = _FakeYouGetVoicesList() ;~ _ArrayDisplay($aVoices) ;~ Local $aVoicesCategories = _FakeYouGetVoicesCategoriesList() ;~ _ArrayDisplay($aVoicesCategories) ;~ Local $sInferenceJobToken = _FakeYouGenerateAudio("Hello World","TM:7wbtjphx8h8v") ;~ ConsoleWrite($sInferenceJobToken & @CRLF) ;~ Local $sJsonStatus=_FakeYouGetAudioStatus("JTINF:2mjzmgfph3g912cpp3rpnf9czm") ;~ ConsoleWrite($sJsonStatus & @CRLF) EndFunc ;==>_TestFakeAPI Func _FakeYouWaitForAudioComplete() EndFunc Func _FakeYouGetAudioStatus($sInferenceJobToken) Return __HttpGet("https://api.fakeyou.com/tts/job/" & $sInferenceJobToken) EndFunc Func _FakeYouGenerateAudio($sText,$sTSSModelToken, $sUUID = Default) If $sUUID = Default Then $sUUID = __GenerateUUID() ConsoleWrite($sUUID & @CRLF) Local $oJson=Null Json_Put($oJson, ".tts_model_token", $sTSSModelToken) Json_Put($oJson, ".uuid_idempotency_token", $sUUID) Json_Put($oJson, ".inference_text", $sText) Local $sJson=Json_Encode($oJson) ConsoleWrite($sJson & @CRLF) Local $sJsonReturn=__HttpPost("https://api.fakeyou.com/tts/inference",$sJson) ConsoleWrite($sJsonReturn & @CRLF) $oJson = Json_Decode($sJsonReturn) If $sJsonReturn = "" Or Not __FakeYou_IsSuccess($oJson) Then Return SetError(1, 0, "") Return Json_Get($oJson, '["inference_job_token"]') EndFunc ;==>_FakeYouGenerateAudio Func __GenerateUUID() Return StringLower(StringReplace(StringReplace(_WinAPI_CreateGUID(), "{", ""), "}", "")) EndFunc ;==>__GenerateUUID Func _FakeYouGetVoicesCategoriesList() Local $sJson = __HttpGet("https://api.fakeyou.com/category/list/tts") ;~ ConsoleWrite($sJson & @CRLF) Local $oJson = Json_Decode($sJson) If $sJson = "" Or Not __FakeYou_IsSuccess($oJson) Then Return SetError(1, 0, "") Local $aoJson = Json_Get($oJson, '["categories"]') If Not IsArray($aoJson) Then Return SetError(2, 0, "") Local $aVoicesCategories[UBound($aoJson)][12] Local $aMembers[] = ["category_token", "model_type", "maybe_super_category_token", "can_directly_have_models", "can_have_subcategories", _ "can_only_mods_apply", "name", "name_for_dropdown", "is_mod_approved", "created_at", _ "updated_at", "deleted_at"] For $i = 0 To UBound($aoJson) - 1 For $x = 0 To UBound($aMembers) - 1 $aVoicesCategories[$i][$x] = Json_Get($aoJson[$i], '["' & $aMembers[$x] & '"]') Next Next Return $aVoicesCategories EndFunc ;==>_FakeYouGetVoicesCategoriesList Func _FakeYouGetVoicesList() Local $sJson = __HttpGet("https://api.fakeyou.com/tts/list") ConsoleWrite($sJson & @CRLF) Local $oJson = Json_Decode($sJson) If $sJson = "" Or Not __FakeYou_IsSuccess($oJson) Then Return SetError(1, 0, "") Local $aoJson = Json_Get($oJson, '["models"]') If Not IsArray($aoJson) Then Return SetError(2, 0, "") Local $aVoices[UBound($aoJson)][15] Local $aMembers[] = ["model_token", "tts_model_type", "creator_user_token", "creator_username", "creator_display_name", _ "creator_gravatar_hash", "title", "ietf_language_tag", "ietf_primary_language_subtag", "is_front_page_featured", _ "is_twitch_featured", "maybe_suggested_unique_bot_command", "category_tokens", "created_at", "updated_at"] Local $sMemberValue = "" For $i = 0 To UBound($aoJson) - 1 For $x = 0 To UBound($aMembers) - 1 $sMemberValue = Json_Get($aoJson[$i], '["' & $aMembers[$x] & '"]') If $aMembers[$x] = "category_tokens" Then For $n = 0 To UBound($sMemberValue) - 1 $aVoices[$i][$x] &= Json_Get($sMemberValue, '[' & $n & ']') & (($n < UBound($sMemberValue) - 1) ? "|" : "") Next Else $aVoices[$i][$x] = $sMemberValue EndIf Next Next Return $aVoices EndFunc ;==>_FakeYouGetVoicesList Func __FakeYou_IsSuccess(ByRef $oJson) Return Json_ObjExists($oJson, 'success') EndFunc ;==>__FakeYou_IsSuccess Func __HttpGet($sURL, $sData = "") Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("GET", $sURL & "?" & $sData, False) If (@error) Then Return SetError(1, 0, 0) $oHTTP.SetRequestHeader("Content-Type", "application/json") $oHTTP.Send() If (@error) Then Return SetError(2, 0, 0) If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0) Return SetError(0, 0, $oHTTP.ResponseText) EndFunc ;==>__HttpGet Func __HttpPost($sURL, $sData = "") Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("POST", $sURL, False) If (@error) Then Return SetError(1, 0, 0) $oHTTP.SetRequestHeader("Content-Type", "application/json") $oHTTP.Send($sData) If (@error) Then Return SetError(2, 0, 0) If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0) Return SetError(0, 0, $oHTTP.ResponseText) EndFunc ;==>__HttpPost ; User's COM error function. Will be called if COM error occurs Func _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 ;==>_ErrFunc Saludos
    1 point
  6. I found where I managed to use FileCopy with our SharePoint site (for anyone who finds this later). I'm working in VBA, but the same principles apply. My company SharePoint homepage is: <CompanyName>.sharepoint.com My department's (sub) page is: <CompanyName>.sharepoint.com/system/<dept> The Documents directory is: <CompanyName>.sharepoint.com/system/<dept>/Documents/Forms/Standard View.aspx When copying I use: \\<CompanyName>.sharepoint.com@SSL\system\<dept>\Documents\* FileCopy never has had an issue with this (assuming I pass a correct filename)
    1 point
  7. Kanashius

    Chart_UDF

    This UDF can be used to Display bar charts in a window. I hope you can need it. Exampleimage: If you like it, please leave me a comment, also if you have any suggestions to make it better or if you found bugs. Chart_UDF_source.zip
    1 point
  8. AZJIO

    IniVirtual

    Download IniVirtual.7z (v0.6 20.07.2013) _IniVirtual_Delete _IniVirtual_Initial _IniVirtual_Read _IniVirtual_ReadSection _IniVirtual_ReadSectionNames _IniVirtual_RenameSection _IniVirtual_Write _IniVirtual_WriteSection _IniVirtual_Save _IniVirtual_IsDuplicateSections _IniVirtual_IsDuplicateKeys Converts the ini-file into an array and work with it in memory. Upon completion, you can save the file. There is no limitation section 32767 characters. If the beginning or end of the value is space, the value in quotes. For compatibility with version 3.3.10.2 (and 3.3.11.4), at the beginning of each regular expression add (*LF) Alternative: >IniVirtualSPE (AZJIO) >IniEx (DXRW4E) >IniString (ResNullius & MrCreatoR (G.Sandler)) >discussion
    1 point
  9. AZJIO

    IniVirtualSPE

    Download IniVirtualSPE (20.07.2013) _IniVirtualSPE_Delete _IniVirtualSPE_IsDuplicateKeys _IniVirtualSPE_IsDuplicateSection _IniVirtualSPE_Read _IniVirtualSPE_ReadSection _IniVirtualSPE_ReadSectionNames _IniVirtualSPE_RenameSection _IniVirtualSPE_Write _IniVirtualSPE_WriteSection _SectionExists Works with ini-file in a memory using SPE. There is no limitation section 32767 characters. If the beginning or end of the value is space, the value in quotes Alternative: >IniVirtual (recommended) >IniString
    1 point
  10. I think you just put two of them... WinActivate('Sticks && Stones')
    1 point
×
×
  • Create New...