Jump to content

Leaderboard

Popular Content

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

  1. As promised I post the updated UDF when I had the time to finish it. Please don't hesitate to report issues, i have made a few last minute changes that should not interfere but shit usually happens when you don't expect it. I was doubting for a long while; Would I create a new topic or would I add it to the existing topic? Two reasons I have chosen to create a new topic for it: -The programming has been changed so drastically that you cannot incorporate this UDF into your existing projects that are based on the old WINHTTP UDF. -Not just the fact that this UDF is curl based, but the given examples are demonstrating on many levels how you can apply the Curl UDF (including the mime adoption for media/file posting) and something simple but not obvious: how to get the HTTP response code, also when authentication errors like 401/407 occur. Because of the file-size of the libcurl DLL's, I cannot incorporate them into the zip archive so you have to download the libcurl library yourself from the libcurl.se site. As said above, the script also has some optimized (script breaking!) changes regarding the update array that Telegram returned. I know the earlier editions of the older UDF also used the curl executable, this edition uses libcurl instead: I had to test this on hardware and configuration certified environments, some of them are running specific windows environment that do not allow patching or updating/upgrading and won't be for quite a long time. It is there where WINHTTP was really shortcoming without patching. With libcurl, at least you can guarantee your production works out-of-the-box on X86 and X64 editions of windows without letting people to go through all kinds of pain by having to install KB updates or fixes and perhaps not getting any further afterall. New This version is now communicating with the security standards libcurl supports out of the box (no more unsecured plain text https queries) Proxy connections are supported (with or without authentication), i have tested with Synology proxy server, mitm proxy software and a service provider proxy. _getChatmember() has been added _getChatAdministrators() has been added _deleteMessage() has been added/altered to work $TELEGRAM_DEBUG allows enabling two levels of verbosity and logging to an output file to allow you to get debug data _UserPoll() routine support added -> You can build GUI components to process. Don't expect to build 60fps games, but at least you can interact with the GUI decently. (See adapted test.au3 how this works). Changed The _MsgDecode() function now returns a 2D array, rather than a 1D array (script breaking!) -> you need to process $msgData[$Record][$Field] instead of $msgData[$Field] $msgData[$Record][$MESSAGE_ID] is prefixed with a two or three character type indicator: p_, g_, c_, ep_, eg_, ec_ (private, group, channel) (see relaybot.au3 how filtering works) Fixes Binarycall has been altered: OnAutoit3ExitRegister has been removed. (Caused crash if you added your own onAutoitExitRegister callback function) __BinaryCall_DoRelease() is called more often to prevent memory hogging and is added to _Telegram_Close() function The full JSON array is now processed and resulting in this former mentioned 2D array. It saves multiple http queries for the same JSON array buffer if it is large. -> When bot is offline and multiple users were firing all kinds of commands and texts into the chat, group or channel during the bot's absence, Telegram is shoving down the whole history into the bot's throat for processing as soon as it gets online again. The larger the buffered data is, the longer it took to process and redownload before the buffer got released on the telegram server. In some cases I experienced a never-ending loop with the original UDF. I have added the LGPL license text, however: i did *not* have had any answer from Luca regarding the proposed change so it is not effective currently even though I changed a lot of code. telegram-udf-curl-autoit-master.zip
    1 point
  2. If you're using copy to clipboard from Excel then you should use StringStripWS($var, 3) Normally when you copy from a cell in Excel it appends line feed at the end of the string. StringStripWS with flag of 3, will remove any leading white space and any trailing white space. But as @Jfish mentioned, it would be better to use Excel UDF for example: Note the example below is using the default AutoIt Excel1.xls example file #include <Excel.au3> ;~ Open Excel Local $oExcel = _Excel_Open() If @error Then Exit MsgBox(4096, "Excel UDF: _Excel_RangeRead Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ;~ Open Workbook Local $oWorkbook = _Excel_BookOpen($oExcel, "C:\Program Files (x86)\AutoIt3\Examples\Helpfile\Extras\_Excel1.xls") If @error Then MsgBox(4096, "Excel UDF: _Excel_RangeRead Example", "Error opening workbook '" & @ScriptDir & "\Extras\_Excel1.xls'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf ; Read data from a single cell on the active sheet of the specified workbook Local $sResult = _Excel_RangeRead($oWorkbook, Default, "G1") If @error Then Exit MsgBox(4096, "Excel UDF: _Excel_RangeRead Example 1", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ;~ By default the _Excel1.xls G1 equals "This is a long Story" ;~ Case insensitive comparison Local $sCompare = "This is a long story" If $sResult = $sCompare Then MsgBox(4096, "Results", "Case Insensitive Match = True") Else MsgBox(4096, "Results", "Strings do not match") EndIf ;~ Case sensitive comparison ;~ Note the == operator Local $sCompare = "This is a long Story" If $sResult == $sCompare Then MsgBox(4096, "Results", "Case sensitive match = True") Else MsgBox(4096, "Results", "Case-sensitive strings do not match") EndIf
    1 point
  3. I recommend the excel UDF functions to read the value from excel for your compare instead of sending ctrl+c for a generic copy.
    1 point
  4. Global $var sleep(2000) ; send("^c") ClipPut("Test") sleep(2000) $var = ClipGet() Switch $var Case "Test" MsgBox(64,"","Matched !") Case Else MsgBox(64,"","Didn't match..") EndSwitch gives "Matched !" so it seems you are not copying the exact string Test from Excel. Check if you are selecting/copying a space or (double) quot's with the string Test.
    1 point
  5. I've solved this by using this: AutoIT If $CmdLine[0]=1 Then Exit If $CmdLine[0]=0 Then Exit If $CmdLine[1] = "parametername=" Then If $CmdLine[2] <> "" Then $ip = $CmdLine[2] EndIf If $CmdLine[0]=2 Then Exit If $CmdLine[3] = "parametername2=" Then If $CmdLine[4] <> "" Then $name = $CmdLine[4] EndIf So I can use more parameters and correct parameters. By using this, I can choose what parameters I want to use. CMD myscript.exe parametername= hello parametername2= nothello So this is how I do with CMD. If you want to be able to choose your parameters, just to this; AutoIT - Total Full script, with notes. ; If the first parameter exists If $CmdLine[0]=1 Then Exit ; If no parameters has been entered If $CmdLine[0]=0 Then Exit ; Checking parameter1 If $CmdLine[1] = "parametername=" Then ; if the parameter contains anything If $CmdLine[2] <> "" Then msgbox(0, "Parametername1", "You did it! nr1") EndIf ; Checking parameter2 If $CmdLine[1] = "parametername2=" Then ; if the parameter contains anything If $CmdLine[2] <> "" Then msgbox(0, "Parametername2", "You did it! nr2") EndIf ; If a parameter2 has been entered. If $CmdLine[0]=2 Then Exit ; Checking parameter 1 If $CmdLine[3] = "paramentername=" Then ; if the parameter contains anything If $CmdLine[4] <> "" Then msgbox(0, "Parametername1", "You did it! nr1") EndIf ; Checking parameter 2 If $CmdLine[3] = "parametername2=" Then ; if the parameter contains anything If $CmdLine[4] <> "" Then msgbox(0, "Parametername2", "You did it! nr2") EndIf
    1 point
×
×
  • Create New...