Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/09/2024 in all areas

  1. Thought I tested that a while ago.... so sorry for the misguidance there. Will have a look when I have some time whether this is possible or not. Edit: You have to set this property to allow escaped characters in the text: calltip.au3.use.escapes=1 after which an \n does work. calltip.lexer.use.escapes calltip.*.use.escapes When set to 1 the API file may contain C style backslash escapes which are listed in the command line arguments section. The * form is used if there is no lexer specific setting.
    2 points
  2. A sort of billboard based on the Edge browser and 'served' by AutoIt. Main script engine taken from this post by @Danyfirex: https://www.autoitscript.com/forum/topic/207856-show-parsed-html-code-in-default-browser-not-ie-moved/?do=findComment&comment=1499455 Basically the smallest embedded web server ever. Obviously the content displayed in the browser is generated by the HTML/CSS/Javascript listing embedded in the AutoIt script. AutoIt simply runs msEdge and "serves" the web page. Nothing special, but an interesting way to contain everything in one file. Reports of errors and suggestions for improvements are welcome Cheers P.S. To easily adapt and prepare the HTML listing, ready to be embedded into the AutoIt listing, see this other post: https://www.autoitscript.com/forum/topic/204362-microsoft-edge-webview2-embed-web-code-in-your-native-application/?do=findComment&comment=1474817 #cs a kind of billboard based on Edge browser and 'served' by AutoIt Main script engine taken from this post by @Danyfirex: https://www.autoitscript.com/forum/topic/207856-show-parsed-html-code-in-default-browser-not-ie-moved/?do=findComment&comment=1499455 basically the smallest embedded web server ever #ce OnAutoItExitRegister('_Done') _EdgeBroswerLoadPage() Func _EdgeBroswerLoadPage() Local $sUrl = "http://127.0.0.1:80" TCPStartup() ; https://learn.microsoft.com/en-us/deployedge/microsoft-edge-configure-kiosk-mode ; https://developer.chrome.com/blog/autoplay ; $pid = Run('"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --app=' & $sUrl & ' --kiosk --edge-kiosk-type=public-browsing --no-first-run --window-size="800,800" --kiosk-idle-timeout-minutes=0 --autoplay-policy=no-user-gesture-required') $pid = Run(@ComSpec & " /c start msedge.exe --app=" & $sUrl & ' --kiosk --edge-kiosk-type=public-browsing --no-first-run --window-size="800,800" --kiosk-idle-timeout-minutes=0 --autoplay-policy=no-user-gesture-required', '', @SW_HIDE) Local $iTimer = TimerInit(), $bTimeout = False, $iMaxWait = 5000 Do Sleep(250) $hEdgeHostWin = WinGetHandle("[CLASS:Chrome_WidgetWin_1]", "Chrome Legacy Window") $bTimeout = TimerDiff($iTimer) > $iMaxWait Until (IsHWnd($hEdgeHostWin) Or $bTimeout) If $bTimeout Then Exit MsgBox(0, 'Error', "Problem on starting MsEdge.") WinMove($hEdgeHostWin, '', (@DesktopWidth / 2 - 400), (@DesktopHeight / 2) - 400, 800, 800) $iConnectedSocket = _ConnectToSock() If @error Then Exit _Done() TCPSend($iConnectedSocket, StringToBinary(_GetSource(), 4)) Sleep(5000) TCPCloseSocket($iConnectedSocket) EndFunc ;==>_EdgeBroswerLoadPage Func _ConnectToSock() Local $iConnectedSocket = -1 Local $hTimer = TimerInit() Local $bErrorTimeout = False Local $iMySocket = TCPListen("127.0.0.1", 80) Do Sleep(300) $iConnectedSocket = TCPAccept($iMySocket) If TimerDiff($hTimer) > (1000 * 5) Then $bErrorTimeout = True ConsoleWrite('Error connect sock' & @CRLF) ExitLoop EndIf Until $iConnectedSocket <> -1 If $bErrorTimeout Then TCPShutdown() Return SetError(1, 0, "Error connect sock") EndIf TCPRecv($iConnectedSocket, 1024) ; ConsoleWrite($iConnectedSocket & @CRLF) Return $iConnectedSocket EndFunc ;==>_ConnectToSock Func _GetSource() Local $sPeace = "Peace;Paz;Paix;Frieden;Pace;Paz;Vrede;Fred;Мир;平和;和平;سلام;शांति;평화;Hòa bình;Mír;Barış;שלום;സമാധാനം;صلح;សន្តិភាព;" & _ "Amani;Uxolo;Aman;Rauha;Pokój;Beke;Мир;ප්‍රාථමික;සාමය;Pokój;สันติภาพ;సమాధానం;Aşiti;Rukuhia;Afioun;Rahu;Barış;Paqe;Paqe;Víðir;Rau;" & _ "Mír;Kalinaw;Salaam;Kapayapaan;ප්‍රාථමිකයාගේ;Miers;ཞི་གནས;Barış;Heddwch;मानसिक शांति;Shanti;Paghi;Pokoj;روابط داشتن;השקט;Fred;ཞི་བའི་གནས;" & _ "Mir;Hòu-î;Peac;Aaman;واپسی;Rauhaa;Iřiwa;سكينة;Hapus;Mirë;صلح، امن;Santiphap;Paix;Amani;Ashtari;Pangaduan;Мир;Sülh;שאלווע;శాంతి;" & _ "Udo;Beke;Uhuru;Irimë;ಶಾಂತಿ;Hasiti;Kọọkan;Milgħuba;ເສືອດສະຫວັນ;Kapayapaan;راحت;Peis;Rāmā;Udo;မြောက်ရိုးရာ;ප්‍රාථමික;Laipni;Rahu;ਸ਼ਾਂਤੀ;Paqe;Pax;Paz;Mir;صلح;" $sPeace = StringReplace($sPeace, ";", " ") Local $sSource = "" $sSource &= "<!doctype html>" & @CRLF $sSource &= "<html lang=""en"">" & @CRLF $sSource &= "<head>" & @CRLF $sSource &= "<meta charset=""utf-8"">" & @CRLF $sSource &= "<title>Peace</title>" & @CRLF $sSource &= "<style>" & @CRLF $sSource &= "/* ---- cube---- */" & @CRLF $sSource &= "/* https://3dtransforms.desandro.com/ */" & @CRLF $sSource &= ".cube {" & @CRLF $sSource &= " width: 200px;" & @CRLF $sSource &= " height: 200px;" & @CRLF $sSource &= " position: relative;" & @CRLF $sSource &= " transform-style: preserve-3d;" & @CRLF $sSource &= " transform: translateZ(-100px);" & @CRLF $sSource &= "}" & @CRLF $sSource &= "" & @CRLF $sSource &= ".scene--hero {" & @CRLF $sSource &= " height: 200px;" & @CRLF $sSource &= " margin: 180px;" & @CRLF $sSource &= " perspective: 500px;" & @CRLF $sSource &= " border: none;" & @CRLF $sSource &= "}" & @CRLF $sSource &= "" & @CRLF $sSource &= ".cube--hero {" & @CRLF $sSource &= " margin: 0 auto;" & @CRLF $sSource &= "}" & @CRLF $sSource &= "" & @CRLF $sSource &= ".cube.is-spinning {" & @CRLF $sSource &= " animation: spinCube 8s infinite ease-in-out;" & @CRLF $sSource &= "}" & @CRLF $sSource &= "" & @CRLF $sSource &= "@keyframes spinCube {" & @CRLF $sSource &= " 0% { transform: translateZ(-100px) rotateX( 0deg) rotateY( 0deg); }" & @CRLF $sSource &= " 100% { transform: translateZ(-100px) rotateX(360deg) rotateY(720deg); }" & @CRLF $sSource &= "}" & @CRLF $sSource &= "" & @CRLF $sSource &= ".cube__face {" & @CRLF $sSource &= " position: absolute;" & @CRLF $sSource &= " width: 200px;" & @CRLF $sSource &= " height: 200px;" & @CRLF $sSource &= " border: 2px solid black;" & @CRLF $sSource &= " line-height: 200px;" & @CRLF $sSource &= " font-size: 100px;" & @CRLF $sSource &= " font-weight: bold;" & @CRLF $sSource &= " color: white;" & @CRLF $sSource &= " text-align: center;" & @CRLF $sSource &= " backface-visibility: hidden;" & @CRLF $sSource &= "}" & @CRLF $sSource &= "" & @CRLF $sSource &= "/* Cube faces colors */" & @CRLF $sSource &= ".cube__face--front { background: hsla( 0, 100%, 50%, 0.7); }" & @CRLF $sSource &= ".cube__face--right { background: hsla( 60, 100%, 50%, 0.7); }" & @CRLF $sSource &= ".cube__face--back { background: hsla(120, 100%, 50%, 0.7); }" & @CRLF $sSource &= ".cube__face--left { background: hsla(180, 100%, 50%, 0.7); }" & @CRLF $sSource &= ".cube__face--top { background: hsla(240, 100%, 50%, 0.7); }" & @CRLF $sSource &= ".cube__face--bottom { background: hsla(300, 100%, 50%, 0.7); }" & @CRLF $sSource &= "" & @CRLF $sSource &= ".cube__face--front { transform: rotateY( 0deg) translateZ(100px); }" & @CRLF $sSource &= ".cube__face--right { transform: rotateY( 90deg) translateZ(100px); }" & @CRLF $sSource &= ".cube__face--back { transform: rotateY(180deg) translateZ(100px); }" & @CRLF $sSource &= ".cube__face--left { transform: rotateY(-90deg) translateZ(100px); }" & @CRLF $sSource &= ".cube__face--top { transform: rotateX( 90deg) translateZ(100px); }" & @CRLF $sSource &= ".cube__face--bottom { transform: rotateX(-90deg) translateZ(100px); }" & @CRLF $sSource &= "" & @CRLF $sSource &= "/* --------------------------------------------------------------------------- */" & @CRLF $sSource &= "/* https://beamtic.com/rotating-radial-stripes-css */" & @CRLF $sSource &= "#body_stripes_container .radial_stripes {" & @CRLF $sSource &= " position:absolute; /* absolute; */" & @CRLF $sSource &= " margin:-100px 0 0 25px; /* auto; */" & @CRLF $sSource &= " left:0;" & @CRLF $sSource &= " top:0;" & @CRLF $sSource &= " width:100vw;" & @CRLF $sSource &= " height:100vw;" & @CRLF $sSource &= " opacity:1;" & @CRLF $sSource &= " animation:rotate 60s infinite linear;" & @CRLF $sSource &= "}" & @CRLF $sSource &= ".radial_stripes {background-image: url(""data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 1003.97 1009.5'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill-rule:evenodd;fill:url(%23radial-gradient);%7D%3C/style%3E%3CradialGradient id='radial-gradient' cx='615.23' cy='557.75' r='503.37' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-opacity='0.5'/%3E%3Cstop offset='1' stop-color='%23333' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ctitle%3Eradial-stripes%3C/title%3E%3Cpath class='cls-1' d='M615.23,53V557.75L510.29,64ZM318.54,149.4,615.23,557.75,409.93,96.64Zm-140.44,156L615.23,557.75,240.13,220ZM113.24,505l502,52.76-480-156Zm21.94,208.74,480.05-156-502,52.76Zm105,181.76,375.1-337.74L178.1,810.13Zm169.8,123.37,205.3-461.11L318.54,966.1Zm205.3,43.64V557.75L510.29,1051.47Zm205.3-43.64L615.23,557.75l104.94,493.72Zm169.8-123.37L615.23,557.75,911.91,966.1Zm104.94-181.76-480-156,437.13,252.38ZM1117.21,505l-502,52.76,502,52.76Zm-64.85-199.62L615.23,557.75l480-156Zm-140.45-156L615.23,557.75,990.33,220ZM720.17,64,615.23,557.75,820.53,96.64Z' transform='translate(-113.24 -53)'/%3E%3C/svg%3E"");}" & @CRLF $sSource &= "" & @CRLF $sSource &= "/* Animations */" & @CRLF $sSource &= "@keyframes rotate {" & @CRLF $sSource &= " from {transform:rotate(0deg);}" & @CRLF $sSource &= " to {transform:rotate(360deg);}" & @CRLF $sSource &= "}" & @CRLF $sSource &= "/* --------------------------------------------------------------------------- */" & @CRLF $sSource &= "/* Author: w3schools.in" & @CRLF $sSource &= "URL: https://www.w3schools.in/css/examples/infinite-scrolling-text" & @CRLF $sSource &= "license: Free to use without republishing." & @CRLF $sSource &= "https://www.w3schools.in/page/copyright */" & @CRLF $sSource &= "" & @CRLF $sSource &= " /* Container styles */" & @CRLF $sSource &= " .scrolling-text-container {" & @CRLF $sSource &= " border-radius: 4px;" & @CRLF $sSource &= " overflow: hidden;" & @CRLF $sSource &= " }" & @CRLF $sSource &= "" & @CRLF $sSource &= " /* Inner container styles */" & @CRLF $sSource &= " .scrolling-text-inner {" & @CRLF $sSource &= " display: flex;" & @CRLF $sSource &= " white-space: pre;" & @CRLF $sSource &= " font-size: 32px;" & @CRLF $sSource &= " font-weight: 600;" & @CRLF $sSource &= " padding: 8px 0;" & @CRLF $sSource &= " }" & @CRLF $sSource &= "" & @CRLF $sSource &= " /* Text styles */" & @CRLF $sSource &= " .scrolling-text {" & @CRLF $sSource &= " display: flex;" & @CRLF $sSource &= " }" & @CRLF $sSource &= "" & @CRLF $sSource &= " .scrolling-text-item {" & @CRLF $sSource &= " padding: 0 30px;" & @CRLF $sSource &= " }" & @CRLF $sSource &= "" & @CRLF $sSource &= " /* Apply the animation to the text items */" & @CRLF $sSource &= " .scrolling-text-inner > div {" & @CRLF $sSource &= " animation: var(--direction) var(--marquee-speed) linear infinite;" & @CRLF $sSource &= " }" & @CRLF $sSource &= "" & @CRLF $sSource &= " /* Pause the animation when a user hovers over it */" & @CRLF $sSource &= " .scrolling-text-container:hover .scrolling-text-inner > div {" & @CRLF $sSource &= " animation-play-state: paused;" & @CRLF $sSource &= " }" & @CRLF $sSource &= "" & @CRLF $sSource &= " /* Setting the Animation using Keyframes */" & @CRLF $sSource &= " @keyframes scroll-left {" & @CRLF $sSource &= " 0% {" & @CRLF $sSource &= " transform: translateX(0%);" & @CRLF $sSource &= " }" & @CRLF $sSource &= " 100% {" & @CRLF $sSource &= " transform: translateX(-100%);" & @CRLF $sSource &= " }" & @CRLF $sSource &= " }" & @CRLF $sSource &= "/* color */" & @CRLF $sSource &= "/* https://stackoverflow.com/questions/25507496/css-change-text-color-randomly */" & @CRLF $sSource &= " h1 {" & @CRLF $sSource &= " background-image: -webkit-linear-gradient(92deg,#f35626,#feab3a);" & @CRLF $sSource &= " -webkit-background-clip: text;" & @CRLF $sSource &= " -webkit-text-fill-color: transparent;" & @CRLF $sSource &= " -webkit-animation: hue 6s infinite linear;" & @CRLF $sSource &= " }" & @CRLF $sSource &= "" & @CRLF $sSource &= " @-webkit-keyframes hue {" & @CRLF $sSource &= " from {" & @CRLF $sSource &= " -webkit-filter: hue-rotate(0deg);" & @CRLF $sSource &= " }" & @CRLF $sSource &= " to {" & @CRLF $sSource &= " -webkit-filter: hue-rotate(360deg);" & @CRLF $sSource &= " }" & @CRLF $sSource &= " }" & @CRLF $sSource &= "/* ----- */" & @CRLF $sSource &= "</style>" & @CRLF $sSource &= "</head>" & @CRLF $sSource &= "<body class=""page--intro"">" & @CRLF $sSource &= "<!-- --------------------------------- -->" & @CRLF $sSource &= "<div id=""body_stripes_container"">" & @CRLF $sSource &= "<div class=""radial_stripes""></div>" & @CRLF $sSource &= "</div>" & @CRLF $sSource &= "<!-- --------------------------------- -->" & @CRLF $sSource &= "" & @CRLF $sSource &= "<div class=""scene scene--hero"">" & @CRLF $sSource &= "<div class=""cube cube--hero is-spinning"">" & @CRLF $sSource &= "<div class=""cube__face cube__face--front""><iframe width=""100%"" height=""100%"" src=""https://www.youtube.com/embed/sEMiWoRRixY?autoplay=1&amp;loop=1&amp;modestbranding=1&amp;controls=0&amp;showinfo=0&amp;rel=0&amp;playlist=sEMiWoRRixY"" allow=""autoplay"" frameborder=""0""></iframe></div>" & @CRLF ; &#x2764&#xFE0F</div> <!-- red heart -->" & @CRLF $sSource &= "<!-- <div class=""cube__face cube__face--front""><img src=""https://www.autoitscript.com/forum/cdn/images/logo_autoit_210x72.svg"" alt=""☺""></div> --> <!-- AutoIt logo -->" & @CRLF $sSource &= "<div class=""cube__face cube__face--right"">&#x1F91F</div> <!-- love-you gesture -->" & @CRLF $sSource &= "<div class=""cube__face cube__face--back"">&#x1F54A&#xFE0F</div> <!-- dove of peace -->" & @CRLF $sSource &= "<div class=""cube__face cube__face--left"">&#x1F3F3&#xFE0F&#x200D&#x1F308</div> <!-- peace flag -->" & @CRLF $sSource &= "<div class=""cube__face cube__face--top"">&#x2696&#xFE0F</div> <!-- balance of justice -->" & @CRLF $sSource &= "<div class=""cube__face cube__face--bottom"">&#x262E&#xFE0E</div> <!-- peace sign -->" & @CRLF $sSource &= "<!-- <div class=""cube__face cube__face--bottom""><img src=""https://www.autoitscript.com/forum/uploads/monthly_2022_02/Gianni.jpg.eb7f87bf14dac954de68a882e057e0d5.jpg"" alt=""☺""></div> --> <!-- Gianni -->" & @CRLF $sSource &= "</div>" & @CRLF $sSource &= "</div>" & @CRLF $sSource &= "<!-- --------------------------------- -->" & @CRLF $sSource &= "<!-- Marquee -->" & @CRLF $sSource &= "<div class=""scrolling-text-container"">" & @CRLF $sSource &= " <div class=""scrolling-text-inner"" style=""--marquee-speed: 120s; --direction:scroll-left"" role=""marquee"">" & @CRLF $sSource &= " <div class=""scrolling-text"">" & @CRLF $sSource &= " <div class=""scrolling-text-item""> </div>" & @CRLF $sSource &= " <div class=""scrolling-text-item""><h1>" & $sPeace & "</h1></div>" & @CRLF $sSource &= " </div>" & @CRLF $sSource &= " </div>" & @CRLF $sSource &= "</div>" & @CRLF $sSource &= "<!-- --------------------------------- -->" & @CRLF $sSource &= "</body>" & @CRLF $sSource &= "</html>" & @CRLF Return $sSource EndFunc ;==>_GetSource Func _Done() TCPShutdown() ConsoleWrite(" << Done >>" & @CRLF) EndFunc ;==>TheEnd
    1 point
  3. I've just uploaded a update of SciTE_changes_Dynamic_Includes_LUA.zip: updated the goto UDF process a bit with hopefully a cleaner result. Updated the Switch tabs logic so the FileUDFs are properly loaded one time and cached. Cache is updated on Save. The previous process was such that syntax highlighting wouldn't work anymore after saving another au3 file and then swapping to another AU# file tab. This was bugging me for a while now so hopefully dealt with that bug now. Jos
    1 point
  4. No worries, and the thing to remember is that the LUA scripts currently generate a text that contains the full include path meaning it contains a single backslash, which will result in a "wrong" text in case you enable this.
    1 point
  5. @jugador So if you add the lines below to the script that you posted, you get the data as a string, correct? $tBinaryBuffer = DllStructCreate("char data[" & $iSize & "]", $pData) ConsoleWrite('+ ' & DllStructGetData($tBinaryBuffer, 1) & @crlf) This is the output I get: ==================== ZeroMQ API Test ==================== (DEBUG) ZeroMQ: DLL handle opened. ZeroMQ: Version = 4.3.4 ZeroMQ: New data msg successfuly initialized ZeroMQ: byte: 6 ZeroMQ: pointer: 0x0000000000752F70 + 0x414243444546 + ABCDEF ZeroMQ: New context handle successfuly created = 0x0000000000755D90 ZeroMQ: Context option ZMQ_IO_THREADS successfuly set to 3 ZeroMQ: Context option ZMQ_IO_THREADS successfuly retrieved = 3 ZeroMQ: Context option ZMQ_MAX_MSGSZ successfuly retrieved = 2147483647 (0x7fffffff) ZeroMQ: Context handle successfuly terminated = 0x0000000000755D90 (DEBUG) ZeroMQ: DLL handle closed
    1 point
  6. @TheXman added zmq_msg_size and zmq_msg_data #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #AutoIt3Wrapper_UseX64=Y #cs 0MQ LibZMQ Github: https://github.com/zeromq/libzmq 0MQ LibZMQ Releases: https://github.com/zeromq/libzmq/releases 0MQ API Reference: http://api.zeromq.org/master:_start #ce #include <Constants.au3> ;Global Constant(s) Const $DEBUGGING = True Const $ZEROMG_DLL_FILE = @ScriptDir & "\libzmq-v142-mt-4_3_4.dll" Const $TAG_ZMQ_MSG_T = "byte msg[64];" ;Global Handle(s) Global $ghZeroMQDll = -1 ;Context Options Const $ZMQ_IO_THREADS = 1, _ $ZMQ_MAX_SOCKETS = 2, _ $ZMQ_SOCKET_LIMIT = 3, _ $ZMQ_THREAD_PRIORITY = 3, _ $ZMQ_THREAD_SCHED_POLICY = 4, _ $ZMQ_MAX_MSGSZ = 5, _ $ZMQ_MSG_T_SIZE = 6, _ $ZMQ_THREAD_AFFINITY_CPU_ADD = 7, _ $ZMQ_THREAD_AFFINITY_CPU_REMOVE = 8, _ $ZMQ_THREAD_NAME_PREFIX = 9 zeromq_test() Func zeromq_test() Local $sVersion = "" Local $vData = "" Local $hContext = -1 Local $tMsg = "", $tData = "" Local $pMsg = 0 Local $iOption = 0, $iOptionValue = 0 ConsoleWrite("====================" & @CRLF) ConsoleWrite("ZeroMQ API Test" & @CRLF) ConsoleWrite("====================" & @CRLF) ;Get and display 0MQ version $sVersion = zmq_version() If @error Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "zmq_version ERROR", "DllCall failed with @error = " & @extended) ConsoleWrite("ZeroMQ: Version = " & $sVersion & @CRLF) ;Create a message struct $tMsg = DllStructCreate($TAG_ZMQ_MSG_T) $pMsg = DllStructGetPtr($tMsg) ;Create a msg data struct with data $vData = "ABCDEF" $tData = DllStructCreate(StringFormat("byte data[%i]", BinaryLen($vData))) $tData.data = Binary($vData) ;Initialize a data message zmq_msg_init_data($pMsg, $tData) If @error Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "zmq_msg_init_data ERROR", zmq_strerror(@extended)) ConsoleWrite("ZeroMQ: New data msg successfuly initialized" & @CRLF) ;~ $tData = 0 ;Explicitly free data struct memory (not necessary; local resources will be freed when func ends) ;~~~~~~~~~~ Local $iSize = zmq_msg_size($pMsg) ConsoleWrite("ZeroMQ: byte: " & $iSize & @CRLF) Local $pData = zmq_msg_data($pMsg) ConsoleWrite("ZeroMQ: pointer: " & $pData & @CRLF) Local $tBinaryBuffer = DllStructCreate("byte data[" & $iSize & "]", $pData) ConsoleWrite('+ ' & DllStructGetData($tBinaryBuffer, 1) & @crlf) ;~~~~~~~~~~ ;Get a new 0MQ context handle $hContext = zmq_ctx_new() If @error Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "zmq_ctx_new ERROR", zmq_strerror(@extended)) ConsoleWrite("ZeroMQ: New context handle successfuly created = " & $hContext & @CRLF) ;Set a context option $iOption = $ZMQ_IO_THREADS $iOptionValue = 3 zmq_ctx_set($hContext, $iOption, $iOptionValue) If @error Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "zmq_ctx_set ERROR", zmq_strerror(@extended)) ConsoleWrite("ZeroMQ: Context option ZMQ_IO_THREADS successfuly set to " & $iOptionValue & @CRLF) ;Get a context option $iOptionValue = zmq_ctx_get($hContext, $iOption) If @error Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "zmq_ctx_get ERROR", zmq_strerror(@extended)) ConsoleWrite("ZeroMQ: Context option ZMQ_IO_THREADS successfuly retrieved = " & $iOptionValue & @CRLF) ;Get a context option $iOptionValue = zmq_ctx_get($hContext, $ZMQ_MAX_MSGSZ) If @error Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "zmq_ctx_get ERROR", zmq_strerror(@extended)) ConsoleWrite(StringFormat("ZeroMQ: Context option ZMQ_MAX_MSGSZ successfuly retrieved = %i (0x%x)", $iOptionValue, $iOptionValue) & @CRLF) ;Terminate a 0MQ context handle zmq_ctx_term($hContext) If @error Then Return MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Error terminating new context handle. - errno = " & @extended) ConsoleWrite("ZeroMQ: Context handle successfuly terminated = " & $hContext & @CRLF) EndFunc ;================================== ; Internal/Helper Functions ;================================== Func get_zmq_dll_handle() ;If no dll handle exists yet If $ghZeroMQDll = -1 Then ;Get global handle to dll $ghZeroMQDll = DllOpen($ZEROMG_DLL_FILE) If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "DllOpen failed") ;Register function to close dll handle on exit OnAutoItExitRegister("close_zmq_dll_handle") If $DEBUGGING Then ConsoleWrite("(DEBUG) ZeroMQ: DLL handle opened." & @CRLF) EndIf ;Return global handle to dll Return $ghZeroMQDll EndFunc Func close_zmq_dll_handle() ;Close global handle DllClose($ghZeroMQDll) If $DEBUGGING Then ConsoleWrite("(DEBUG) ZeroMQ: DLL handle closed" & @CRLF) EndFunc ;==================================== ; ZeroMQ API Function Examples ; - zmq_ctx_new() ; - zmq_ctx_set($hContext, $iOption, $iOptionValue) ; - zmq_ctx_get($hContext, $iOption) ; - zmq_ctx_term($hContext) ; - zmq_errno() ; - zmq_msg_init_data($pMsg, $tData) ; - zmq_strerror($iErrNo) ; - zmq_version() ;==================================== Func zmq_ctx_new() Local $aResult ;Call API $aResult = DllCall(get_zmq_dll_handle(), "handle", "zmq_ctx_new") If @error Then Return SetError(1, @error, 0) ;DllCall failed ElseIf $aResult[0] = 0 Then Return SetError(2, zmq_errno(), 0) ;API call failed EndIf ;Return new 0MQ context handle Return $aResult[0] EndFunc Func zmq_ctx_set($hContext, $iOption, $iOptionValue) Local $aResult ;Call API $aResult = DllCall(get_zmq_dll_handle(), "int", "zmq_ctx_set", _ "handle", $hContext, _ "int", $iOption, _ "int", $iOptionValue) If @error Then Return SetError(1, @error, False) ;DllCall failed ElseIf $aResult[0] = -1 Then Return SetError(2, zmq_errno(), False) ;API call failed EndIf ;All is good Return True EndFunc Func zmq_ctx_get($hContext, $iOption) Local $aResult ;Call API $aResult = DllCall(get_zmq_dll_handle(), "int", "zmq_ctx_get", _ "handle", $hContext, _ "int", $iOption) If @error Then Return SetError(1, @error, -1) ;DllCall failed ElseIf $aResult[0] = -1 Then Return SetError(2, zmq_errno(), -1) ;API call failed EndIf ;All is good Return $aResult[0] EndFunc Func zmq_ctx_term($hContext) Local $aResult ;Call API $aResult = DllCall(get_zmq_dll_handle(), "int", "zmq_ctx_term", "handle", $hContext) If @error Then Return SetError(1, @error, False) ;DllCall failed ElseIf $aResult[0] <> 0 Then Return SetError(2, zmq_errno(), False) ;API call failed EndIf ;All is good Return True EndFunc Func zmq_errno() Local $aResult ;Call API $aResult = DllCall(get_zmq_dll_handle(), "int", "zmq_errno") If @error Then Return SetError(1, @error, -1) ;DllCall failed EndIf ;All is good Return $aResult[0] EndFunc Func zmq_msg_init_data($pMsg, $tData) Local $aResult If DllStructGetSize($tData) = 0 Then Return SetError(-1, 0, False) ;No data ;Call API $aResult = DllCall(get_zmq_dll_handle(), "int", "zmq_msg_init_data", _ "ptr", $pMsg, _ ;msg "ptr", DllStructGetPtr($tData), _ ;data "ulong_ptr", DllStructGetSize($tData), _ ;size "ptr", Null, _ ;ffn "ptr", Null) ;hint If @error Then Return SetError(1, @error, False) ;DllCall failed ElseIf $aResult[0] <> 0 Then Return SetError(2, zmq_errno(), False) ;API call failed EndIf ;All is good Return True EndFunc Func zmq_strerror($iErrNo) Local $aResult ;Call API $aResult = DllCall(get_zmq_dll_handle(), "str", "zmq_strerror", _ "int", $iErrNo) If @error Then Return SetError(1, @error, "") ;Return version Return $aResult[0] EndFunc Func zmq_version() Local $aResult ;Call API $aResult = DllCall(get_zmq_dll_handle(), "none", "zmq_version", _ "int*", Null, _ ;Major "int*", Null, _ ;Minor "int*", Null) ;Patch If @error Then Return SetError(1, @error, "?.?.?") ;Return version Return StringFormat("%s.%s.%s", $aResult[1], $aResult[2], $aResult[3]) EndFunc Func zmq_msg_data($pMsg) Local $aResult = DllCall(get_zmq_dll_handle(), "ptr", "zmq_msg_data", "ptr", $pMsg) If @error Then Return SetError(1, @error, -1) ;~ DllCall failed Return $aResult[0] ;~ return a pointer to the message content. EndFunc Func zmq_msg_size($pMsg) Local $aResult = DllCall(get_zmq_dll_handle(), "ulong_ptr", "zmq_msg_size", "ptr", $pMsg) If @error Then Return SetError(1, @error, -1) ;~ DllCall failed Return $aResult[0] ;~ return the size of the message content in bytes. EndFunc
    1 point
  7. @jugador You may be using my previous example as a guide, but my previous example did not include functions to retrieve the message size or pointer. So you are asking for help with code that I have not seen and cannot possibly know if it is working correctly. Therefore, I provided you a theoretical answer to a theoretical problem. If you'd like a more specific answer as to why your code is not producing the expected results, then providing an actual example, that I can run, would be most helpful. I don't need a huge example script. I just need the smallest script that I can run that shows the issue you are having. example() Func example() Local $tData = "", _ $tStruct = "" Local $pData = 0 Local $vData = "" Local $iSize = 0 ;Create a msg data struct with data $vData = "ABCDEF" $tData = DllStructCreate(StringFormat("byte data[%i]", BinaryLen($vData))) $tData.data = Binary($vData) ConsoleWrite('+ ' & DllStructGetData($tData, 1) & @crlf) ;~ 0x414243444546 ;Get pointer to data struct and size of struct $pData = DllStructGetPtr($tData) $iSize = DllStructGetSize($tData) ;Get data as binary $tStruct = DllStructCreate(StringFormat("byte data[%i]", $iSize), $pData) ConsoleWrite('+ $tStruct.data = ' & $tStruct.data & @crlf) ; 0x414243444546 ;Get data as a string $tStruct = DllStructCreate(StringFormat("char data[%i]", $iSize), $pData) ConsoleWrite('+ $tStruct.data = ' & $tStruct.data & @CRLF) ;ABCDEF EndFunc Console output: + 0x414243444546 + $tStruct.data = 0x414243444546 + $tStruct.data = ABCDEF
    1 point
  8. @jugador I would create a struct using DllStructCreate() function and pass it the pointer parameter of $pData. Then reference the struct data as you normally would, using DllstructGetData or with dot-notation. How your reference the data depends on the expected data (binary, string, int, struct, etc). Without more details, it's hard to be more specific. Create struct something like: Reference data as raw binary data $tStruct = DllStructCreate("byte data[" & $iSize & "]", $pData) Reference data as CHAR string: $tStruct = DllStructCreate("char data[" & $iSize & "]", $pData) Reference data as WCHAR string: $tStruct = DllStructCreate("wchar data[" & $iSize & "]", $pData) Reference data as INT: $tStruct = DllStructCreate("int data", $pData) etc... ===================== Reference the "data" of the struct like: DllstructGetData($tStruct, 1) or DllstructGetData($tStruct, "data") or $tStruct.data
    1 point
  9. I also notice one a slightly distracting inconvenience When I try to jump to function: _LOWriter_DocOpen It opens proper file (LibreOfficeWriter_Doc.au3) but in tab I see little missliging name and path: the above example screenshot shows that the path is written in lowercase, while correctly it should look like this: What I mean is that it shows the file name as it was called and not as its actual name in the file system. However, I think this is an internal problem with SciTE by Neil Hodgson
    1 point
  10. Part III #include <array.au3> #include <Excel.au3> Test() Func Test() Local $oExcel, $oWorkbook, $aArray $oExcel = _Excel_Open(False) If Not FileExists(@ScriptDir & "\test3.xlsx") Then Local $aArray = [ _ ["SSW001 FFFB, FFFC, FFFD, FFFE, FFFF, 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0008, 0009, 000A"], _ ["SSW002 FFFB, FFFC, FFFD, FFFE, FFFF, 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0008, 0009, 000A"], _ ["SSW003 FFFB, FFFC, FFFD, FFFE, FFFF, 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0008, 0009, 000A"]] $oWorkbook = _Excel_BookNew($oExcel) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aArray, "A1") _Excel_BookSaveAs($oWorkbook, @ScriptDir & "\test3.xlsx", Default) _Excel_BookClose($oWorkbook, False) Sleep(1000) EndIf $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\test3.xlsx", True, False) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "", "Error opening test1.xlsx") Local $aExcel = _Excel_RangeRead($oWorkbook, 1) _Excel_BookClose($oWorkbook, False) _Excel_Close($oExcel) ;~ _ArrayDisplay($aExcel, "$aExcel") $aArray = StringSplit("SSW001 =0004;SSW002 =0004;SSW003 =0007", ";", 2) _ArrayColInsert($aArray, 1) Local $aVal, $aSplit, $aFirst For $i = 0 To UBound($aArray) - 1 $aVal = StringSplit($aArray[$i][0], "=") If $aVal[0] = 2 Then $aSplit = StringSplit($aExcel[$i], ", ", 1) $aFirst = StringSplit($aSplit[1], " ", 1) $aSplit[1] = $aFirst[2] ConsoleWrite($aFirst[1] & " ") ;*** For $z = 1 To $aSplit[0] If $aVal[2] = $aSplit[$z] Then ConsoleWrite("[" & $aSplit[$z] & "] ") $aArray[$i][1] = $z ContinueLoop EndIf ConsoleWrite(" " & $aSplit[$z] & " ") Next ConsoleWrite("" & @CRLF) EndIf Next _ArrayDisplay($aArray, "$aArray") EndFunc ;==>Test
    1 point
  11. Just noticed that AutoIt function misses one stat (SystemStatusFlag) from the Win32 function (new stat introduced in Win10). Made a new ticket in bug tracker.
    1 point
  12. The sample script works on my Win10 as well (10.0.19045.3803). The array shows "1" for my laptop's charge status since it's at 100%.
    1 point
  13. Works well on my latop Win10...
    1 point
  14. I would think he meant to check if 0004 of SSW001 array is part of the values in Excel row of the same name, 0004 for SSW002, and 0007 in SSW003
    1 point
  15. Jos

    httprequest login - (Locked)

    Can you be any more specific? Which website? What have you tried and isn't working? ps: pls use standard font for standard text.
    0 points
×
×
  • Create New...