Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/15/2017 in all areas

  1. Without any context, how is anyone supposed to help? Why do you feel you need to limit the number of characters? And if you're going to limit the number of characters, why put in the max, as that simply defeats the purpose? Please explain more about what you're trying to do.
    1 point
  2. Yes it is. It should be: ;.... $sAddress = "http://" & "@IP:8081/DirectoryPath/MyFile.Tar" ;... ; Fill form $sHTML = _WinHttpSimpleFormFill($hConnect, $hOpen, Default, "name:uploadedfile", $sFileToUpload, "[CRED:" & $Username & ":" & $Password & "]") ...For POST. But --upload-file is PUT action.
    1 point
  3. sakamoto

    Telegram Bot UDF

    LinkOut, thanks for the answer. I figured out the buttons, but get an error when receiving callback_data. Other methods "url" "switch_inline_query" work out well. #include "Telegram UDF.au3" $ikeyb = '{"inline_keyboard":[[{"text":"Button 1","callback_data":"data 1"}]]}' _InitBot("xxxIDxxx","xxxTOKENxxx") While 1 $msgData = _Polling() If $msgData <> '' Then ConsoleWrite($msgData[0]&'|'&$msgData[1]&'|'&$msgData[2]&'|'&$msgData[3]&@LF) Switch $msgData[3] Case '777' _SendMsg($msgData[2], 'Message', Default, $ikeyb) EndSwitch WEnd Telegram UDF.au3" (481) $dataArray[2] = $tmpChatID[3] $dataArray[2] = ^ ERROR
    1 point
  4. LinkOut

    Telegram Bot UDF

    Thank you for using it! To use inline_keyboard first you have to create an array of array of button (sound bad, I know) and then add this (encoded in json format) to the query. I'm working on it but only in php for the moment. If this can help you: $keyboard = array("inline_keyboard" => array(array(array("text" => "ButtonText", "callback_data" => "CallbackText"),array("text" => "ButtonText2", "callback_data" => "CallbackText2")))); $keyboard = json_encode($keyboard, true); And after send it as: http://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=12345678&text=test&reply_markup=$keyboard
    1 point
  5. sakamoto

    Telegram Bot UDF

    Thanks a lot for UDF. Someone else can give an example of inline_keyboard?
    1 point
  6. You just use the File WriteLine: #include <String.au3> #include <Array.au3> Global $listing, $timer $directory = FileSelectFolder("Browse for Folder.", "") $timer = TimerInit() list($directory, 0) time() Func list($path = "", $counter = 0) $counter = 0 $path &= '\' Local $list_files = '', $file, $demand_file = FileFindFirstFile($path & '*') If $demand_file = -1 Then Return '' While 1 $file = FileFindNextFile($demand_file) If @error Then ExitLoop If @extended Then If $counter >= 10 Then ContinueLoop list($path & $file, $counter + 1) Else $listing &= $path & $file & "|" FileWriteLine(@ScriptDir & "\listing.ini", $path & $file); Use this to list full path ;FileWriteLine(@ScriptDir & "\listing.ini", $file); Use this to list only the name EndIf WEnd FileClose($demand_file) EndFunc ;==>list Func time() Local $total_time = TimerDiff($timer) Local $minutes = Int(Mod($total_time, 3600000) / 60000) Local $seconds = Int(Mod(Mod($total_time, 3600000), 60000) / 1000) Local $min_seg = StringFormat("%02d:%02d", $minutes, $seconds) MsgBox(4096, 'Total time', $min_seg) $listing = StringTrimRight($listing, 1) $listing = _StringExplode($listing, "|", 0) _ArraySort($listing) _ArrayDisplay($listing, "files found") EndFunc ;==>time
    1 point
  7. Negative1, I do not believe that AutoIt will allow you to do what you want. After my abortive attempts to do it, I went for a good trawl through the forums and found this snippet from PSaltyDS: "I think what he wants to do would be equivalent to: $sVar = "ABC" Assign ($sVar & [3], '["Zero", "One", "Two"]')And have that give the same result as: Dim $ABC[3] = ["Zero", "One", "Two"]But the syntax is invalid for AutoIt, and I don't know a way to declare an array with the contents of a string variable for the name." That looks very much like what I believe you are trying to do - and if PSaltyDS says it cannot be done, I am inclined to believe him. :-( However, is it so important that the arrays have the same names as the files? You could save the various arrays as elements within a larger array and put the file name as an element of the array. Here is a rough script which shows what I mean (you will have to adjust the paths of course): #include <file.au3> #include <array.au3> $filelist = _FileListToArray(@scriptdir, "*.au3") If @Error=1 Then MsgBox (0, "", "No Files\Folders Found.") Exit EndIf Global $file_arrays[$filelist[0] + 1] For $i = 1 To $filelist[0] $array_name = StringTrimRight($filelist[$i], 4) _FileReadToArray(@ScriptDir & "\" & $filelist[$i], $file_arrays[$i]) _ArrayInsert($file_arrays[$i], 0, $array_name) _ArrayDisplay($file_arrays[$i]) NextThis way you can identify the array by the name stored within it - would that be good enough? Sorry I cannot be of any more help. M23
    1 point
×
×
  • Create New...