Jump to content

Recommended Posts

On ‎06‎.‎01‎.‎2017 at 1:10 PM, Jos said:

I took one of the examples posted by trancexx and modified it to the below alternative UDF for SendPhoto:

#include <WinHttp.au3>

;~ ConsoleWrite("Test _SendMsg      -> "  & @TAB & _SendMsg($ChatID,"Test _SendMsg") & @CRLF)
;~ ConsoleWrite("Test _SendPhoto    -> " & @TAB & _SendPhoto($ChatID, "d:\temp\image.jpg", "Test _SendPhoto") & @CRLF)
ConsoleWrite("Test _SendPhoto    -> " & @TAB & _SendPhotoN($ChatID, "d:\temp\image.jpg", "Test _SendPhoto") & @CRLF)


; @SEND MEDIA FUNCTION using WINHTTP ================================================================================
Func _SendPhotoN($ChatID, $Path, $Caption = "")
    Local $Query = $URL & '/sendPhoto'
    $sForm = _
            '<form action="' & $Query & '" method="post" enctype="multipart/form-data">' & _
            ' <input type="text" name="chat_id"/>' & _
            ' <input type="file" name="photo"/>' & _
            ' <input type="text" name="caption"/>' & _
            '</form>'

    ; Initialize and get session handle
    $hOpen = _WinHttpOpen()
    $hConnect = $sForm ; will pass form as string so this is for coding correctness because $hConnect goes in byref
    ; Register callback function
    _WinHttpSimpleFormFill_SetUploadCallback(UploadCallback)
    ; Fill form
    $sHTML = _WinHttpSimpleFormFill($hConnect, $hOpen, _
            Default, _
            "name:chat_id", $ChatID, _
            "name:photo", $Path, _
            "name:caption", $Caption)
    ; Collect error number
    $iErr = @error
    ; Unregister callback function
    _WinHttpSimpleFormFill_SetUploadCallback(0)
    ; Kill progress bar window
    ; Close handles
    _WinHttpCloseHandle($hConnect)
    _WinHttpCloseHandle($hOpen)

    If $iErr Then
        MsgBox(4096, "Error", "Error number = " & $iErr)
        ConsoleWrite("! error:" & $iErr & @CRLF & $sHTML & @CRLF)
    Else
        ConsoleWrite($sHTML & @CRLF)
    EndIf
    Return $iErr

EndFunc   ;==>_SendPhotoN

This is working nicely for me :)

Jos

Hi jos thank you for your modifications for this udf but i'm still having the problem  when I try to send pictures or files ... but now with your udf I've an error 4..do you have a idea?? thank you for your help

mas

Link to post
Share on other sites
  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi! I wrote an UDF that can simplify the way you can control Telegram Bot with AutoIt. If you don't know what is a Telegram Bot, maybe you should read their official website here. All about this UDF i

Added to UDF List on AutoIt WikiPage, here: https://www.autoitscript.com/wiki/User_Defined_Functions#Social_Media_and_other_Website_API  

Perhaps we should give people who post UDFs a short time to get feedback from the community and improve the scripts, before we rush to add them to the Wiki.

Posted Images

1 hour ago, maskat said:

Hi jos thank you for your modifications for this udf but i'm still having the problem  when I try to send pictures or files ... but now with your udf I've an error 4..do you have a idea?? thank you for your help

mas

I've found the problem it came from our proxy... I tried your script with a conneciotn without proxy it' works perfectly thank you

Link to post
Share on other sites
  • 9 months later...

I downloaded telegram UDF files from github.  I ran the sample code and most telegram functions failed.

Only the "send message" working well , the others such as send audio/image/video.... all failed.

I don't know what's wrong. Could some give me suggestion?

note: I used autoit v3.3.14.5

Link to post
Share on other sites
  • 1 month later...
  • Developers

@karson_chan, you have to do better than that for anybody to be able to help you!
If it works on one PC, it should also work on the other given the files are on the exact same place.
So what about you show what you are doing by sharing the script etc?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

@Jos

Actually all 5 pc is in same setting using same WiFi ssid. Firewall is off. Running in windows 10 64 bit. Using Autoit v3.3.14.5. 

Is there need to some setting i forgot?  i feel strange too. why only one pc work for me. It is just a simply script to test.

here are the script i am tesing: 

 

 

#include "../Telegram.au3"
$Token = '1111111:aaaaaaaaaaaaaaaaaaaavsog9RO4' ;owen2
$ChatID = '412777023' ;owen2

_InitBot($Token)

_SendPhoto($ChatID,'image.png',"This is a photo5.")
 

Edited by Jos
Link to post
Share on other sites
  • Developers

I removed part of the token assuming you do not want to share that and have others using your bot! 
Are you getting any errors?
are you sure the file image.png is available in the default directory?

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • Developers

Screen captures do not help much, post the code please and just remove and personal stuff, so we can check.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • 4 weeks later...
  • 2 weeks later...

When adding my bot to any channel - cant recieve any messages :(( 

log gives like this:

MSG#-1001195506482# - testbot: 
MSG#-1001195506482# - testbot: 
MSG#-1001195506482# - testbot: 
MSG#-1001195506482# - testbot: 
MSG#477888592# - Johnnie: test
MSG#477888592# - Johnnie: -301864711Хьюстон
MSG#477888592# - Johnnie: -301864711Хьюстон
MSG#271673891# - Denis: -301864711Хьюстон
MSG#271673891# - Denis: -301864711Хьюстон

 

Bot source look like this:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Cryply.ico
#AutoIt3Wrapper_UseUpx=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "../Telegram.au3"
#include <Inet.au3>
#include <Array.au3>
#include <String.au3>
#include <StringConstants.au3>

HotKeySet("{PAUSE}","_Exit") ;Press 'PAUSE' on your keyboard to force-exit the script

$Token = '558290450:AAFEAM2pfNr7j0IFME-nJTBfCNeiuNNaAmE' ;Insert here your token
_InitBot($Token)


;-------------------------------------- %0A
Global $price = ""
Global $status = ""
Global $lowhigh = ""
Global $altprice = ""
;-------------------------------------- %0A


While 1
    $msgData = _Polling()
   ;;;;; ConsoleWrite("Incoming message from " & $msgData[3] & ": " & $msgData[5] & @CRLF)
   ;TrayTip($msgData[3]," user: " & $msgData[5],0)
    ;_SendMsg($msgData[2],$msgData[5]) <<<< https://youtu.be/30g356XW-nQ

    FileWrite(@ScriptDir&"\Cryply.log","MSG#"& $msgData[2] &"# - " & $msgData[4] & ": " & $msgData[5] & $msgData[6] & $msgData[7] & @CRLF)

if StringInStr($msgData[5],"!test" ) or StringInStr($msgData[5],"!тест") Then ;--------------------------------------
_SendMsg($msgData[2],"Works fine...")
endif

if StringInStr($msgData[5],"!admin") or StringInStr($msgData[5],"!author") or StringInStr($msgData[5],"!about") or StringInStr($msgData[5],"!автор") or StringInStr($msgData[5],"!админ") Then ;--------------------------------------
_SendMsg($msgData[2],"Неофициальный Крипли Бот v1.2 %0AАвтор Johnnie Walker %0AЕ-мейл: xbitnik@gmail.com")
endif

if StringInStr($msgData[5],"!mining") or StringInStr($msgData[5],"!майнинг") Then ;--------------------------------------
_SendMsg($msgData[2],"Обучающее видео по майнингу для новичков:%0A https://youtu.be/30g356XW-nQ")
endif

if StringInStr($msgData[5],"!moon") or StringInStr($msgData[5],"!tothemoon") or StringInStr($msgData[5],"/moon") or StringInStr($msgData[5],"/tothemoon") or StringInStr($msgData[5],"/themoon") Then ;--------------------------------------
_SendMsg($msgData[2],"If you want CRYPLY to the moon, start doing something. Anyone can help and every donat is important to us :) И Я, конечно, ни на что не намекаю... ")
endif

if StringInStr($msgData[5],"!links") or StringInStr($msgData[5],"!gettingstarted") or StringInStr($msgData[5],"!ссылки") or StringInStr($msgData[5],"!urls") Then ;--------------------------------------
_SendMsg($msgData[2],"" & _
"Сайт: https://cryply.io"& _
"%0AФорум: https://bitcointalk.org/index.php?topic=2634468.0;all"& _
"%0AОбменник: https://crex24.com/ru/exchange/CRP-BTC"& _
"%0AСтаты: https://www.coingecko.com/en/price_charts/cryply/usd"& _
"%0A%0AКошельки: https://goo.gl/gfx5Xv"& _
"%0AМайнеры: https://goo.gl/rb2zRb"& _
"%0AПулы: https://cryply.luckypool.org  и  https://p2pool.work%0A%0A")

endif


if StringInStr($msgData[5],"!info" ) or StringInStr($msgData[5],"!инфо") or StringInStr($msgData[5],"/start") Then ;-------------------------------------- ;"%0A!stats / !статы - полезная статистика манетки"& _
_SendMsg($msgData[2],"Список доступнык комманд: " & _
"%0A!info / !инфо - данная справка"& _
"%0A!links / !ccылки - ссылки на полезные ресурсы"& _
"%0A!price / !цена - текущая цена манетки"& _
"%0A!mining / !майнинг - майнинг видео для новичков"& _
"%0A!author / !автор - контактные данные автора")
endif


if StringInStr($msgData[5],"!time") or StringInStr($msgData[5],"!время") Then ;--------------------------------------
_SendMsg($msgData[2],"The time is: "&@HOUR&":"&@MIN&":"&@SEC)
endif


if StringInStr($msgData[5],"!price") or StringInStr($msgData[5],"!цена") Then ;--------------------------------------

$Text = _INetGetSource('https://coinlib.io/coin/CRP/Cryply',true)

$source = _StringBetween($Text, "$&nbsp;"," </span>")
If Not @error Then
    $price = "$ "&$source[0]
Else
$price = "?"
endif

$source = _StringBetween($Text, 'id="coin-price-delta">','</span>')
If Not @error Then
    $status = StringReplace($source[0],@LF,"")
Else
$status = "?"
endif

$source = _StringBetween($Text, 'coin-high-low">',' </div>')
If Not @error Then
    $lowhigh = StringReplace(StringReplace($source[0],"&nbsp;"," "),@LF,"")
Else
$lowhigh = "?"
endif

$source = _StringBetween($Text, 'price text-left pl-2">BTC','</span>')
If Not @error Then
    $altprice = StringReplace($source[0],@LF,"")
Else
$altprice = "?"
endif

;MsgBox(0,"Price",$price)
;MsgBox(0,"Status",$status)
;MsgBox(0,"LowHigh",$lowhigh)
;MsgBox(0,"ALtprice","BTC "&$altprice)
_SendMsg($msgData[2], "" _
&"Цена крипли в USD: "&StringStripWS($price,8) _
&"%0AЦена крипли в BTC: "&StringStripWS($altprice,8) _
&"%0AУровни за сутки: "&StringStripWS($lowhigh,8)&@CRLF _
&"%0AРейтинг: "&StringStripWS($status,8) _
&"%0AЗа 1000 CRP вы получите: "&StringStripWS(StringReplace($price,"$ ",""),8)*1000&" $")

;_SendMsg($msgData[2],"Cryply rate: "&$status)
;_SendMsg($msgData[2]," - - - - - - - - - - - ")
;_SendMsg($msgData[2],"10 Cryply = "&StringReplace($price,"$ ","")*10)
;_SendMsg($msgData[2],"50 Cryply = "&StringReplace($price,"$ ","")*50)
;_SendMsg($msgData[2],"100 Cryply = "&StringReplace($price,"$ ","")*100)
;_SendMsg($msgData[2],"1000 Cryply = "&StringReplace($price,"$ ","")*1000)
;_SendMsg($msgData[2],"1500 Cryply = "&StringReplace($price,"$ ","")*1500)
;_SendMsg($msgData[2],"2000 Cryply = "&StringReplace($price,"$ ","")*2000)
;_SendMsg($msgData[2],"5000 Cryply = "&StringReplace($price,"$ ","")*5000)
;_SendMsg($msgData[2],"10000 Cryply = "&StringReplace($price,"$ ","")*10000)
;_SendMsg($msgData[2]," - - - - - - - - - - - ")
;_SendMsg($msgData[2],"Stats based on coinlib.io/coin/CRP/Cryply")
endif





;--------------------------------------------------------------------------

WEnd

Func _Exit()
    Exit 0
EndFunc

 

 

Please HELP !

Edited by Enforcer
[RU] Zone
Link to post
Share on other sites
  • 3 months later...

Probably you already solved the problem, anyway... you must change the privacy on the botFather, like explained in this quote from stackoverflow:

Quote

Sequence within a BotFather chat:

You: /setprivacy

BotFather: Choose a bot to change group messages settings.

You: @your_name_bot

BotFather: 'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username.

'Disable' - your bot will receive all messages that people send to groups.

Current status is: ENABLED

You: Disable

BotFather: Success! The new status is: DISABLED. /help

 

Link to post
Share on other sites
  • 2 weeks later...

I was trying to edit a previously sent message with a Photo with SendPhoto(), with a new photo with this Func:

Func _editMessageMedia($ChatID, $Message_id, $Path, $Reply_markup = Default )
    Local $Query = $URL & '/editMessageMedia'
    Local $hOpen = _WinHttpOpen()
    Local $Form = '<form action="' & $Query & '" method="post" enctype="multipart/form-data">' & _
                  '<input type="text" name="chat_id"/>' & _
                  '<input type="text" name="message_id"/>' & _
                  '<input type="file" name="photo"/>' & _
                  '<input type="text" name="caption"/>'
    If $Reply_markup <> Default Then $Form &= '<input type="text" name="reply_markup"/>'
    $Form &= '</form>'
    Local $Response = _WinHttpSimpleFormFill($Form,$hOpen,Default, _
                       "name:chat_id", $ChatID, _
                       "name:message_id", $Message_id, _
                       "name:photo"  , $Path,   _
                       "name:caption", "", _
                       "name:reply_markup", $Reply_markup)

    _WinHttpCloseHandle($hOpen)
    Local $Json = Json_Decode($Response)
    ConsoleWrite("RES:" & $Response & " ______ " & $Json &  @CRLF)
    If Not (Json_IsObject($Json)) Then Return SetError(2,0,False) ;Check if json is valid
    Return __GetFileID($Json,'photo')
EndFunc ;==> _editMessageMedia

$Message_id is on the JSON answer of polling with _GetUpdates(). 

I use like this uploading a pic from the pc:

_editMessageMedia($ChatID, $telegramMsgData[7] , $sPath & $nomeFile, $ikeyb )

and I get this error:

{"ok":false,"error_code":400,"description":"Bad Request: can't parse InputMedia: Media is not specified"}
Link to post
Share on other sites
  • 3 weeks later...

thank you for the UDF.

but it seems like im having an issue.

Test file for Telegram UDF by LinkOut. (https://github.com/xLinkOut)
This file need a valid ChatID of a Telegram User to send messages to and a valid bot token given by BotFather.
Insert this data in the source code.

! Initializing bot... True

Who am I? Oh, yeah, my name is Project-X, you can find me at @Ray_ProjectXBot. For developers, my Telegram ID is xxxxxxxx
Let's do some test:
    Sending a simple text message. The function _SendMsg return the Message ID: False
    Now I'll forward the same message to you, with the message id saved before: False
    Awesome. Use the other _Send functions to send photos, videos, documents. Each function return the FileID assigned by Telegram.
!       Sending photo: 0
!       Sending video: 
!       Sending audio: 
!       Sending documents: 
!       Sending voice: 
!       Sending sticker: 
!       Sending video note: 
!       Sending location: False
!       Sending contact: False

You can send a 'Chat Action', that mean the user see 'Bot is typing...' or 'Bot is sending a photo...'.

To use a custom keyboard, there is an useful function that contruct and encode the keyboard itself.
You have to create an array and insert the text of your buttons. To line break, leave a position empty. 
Example, try to pass this array $keyboard[4] = ['TopLeft','TopRight','','SecondRow'] to the _CreateKeyboard function, then send the message.

In encoded format, the $keyboard look like {"keyboard":[["TopLeft","TopRight"],["SecondRow"]]}
I'll send this keyboard to you as this: _SendMsg($ChatID,'Hey! Choose one:',Default,$markup)
_CreateKeyboard function accept two other boolean args, resize and one time keyboard, both false by default.

This is all folks! For all the other methods read the Telegram Documentation and the Telegram.au3 file, it's commented. You can find some examples in the example folder.
Don't forget to ? star this repo on GitHub, this mean a lot for me.+>01:54:58 AutoIt3.exe ended.rc:0

any idea?

Link to post
Share on other sites
  • Developers
9 hours ago, Raywando said:

but it seems like im having an issue.

Great ....  care to share details in case you want assistance with that issue? :) 

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
4 hours ago, Jos said:

Great ....  care to share details in case you want assistance with that issue? :) 

Jos

im not really sure what info you need exactly, but i only modified the test.au3, put my token which i got from @BotFather and added my ChatID which i got from @get_id_bot 

when i try the url below i get 

{"ok":true,"result":[]}

idk if that helps but i thought it might.

https://api.telegram.org/bot<MyBotToken>/getUpdates

if there is anything else i need to share please let me know.

Link to post
Share on other sites

You must create a chat, i.e. a group, get the chat_id and insert into the autoit prog, then insert the bot as a member of that group. Then you can send your messages with the bot or receive the msg from the group.

With getUpdates to see something, you must first send a msg into that group in which there is your bot.

Edited by frank10
Link to post
Share on other sites
On 3/2/2019 at 7:13 PM, frank10 said:

You must create a chat, i.e. a group, get the chat_id and insert into the autoit prog, then insert the bot as a member of that group. Then you can send your messages with the bot or receive the msg from the group.

With getUpdates to see something, you must first send a msg into that group in which there is your bot.

thank you

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By p4sCh
      Hello everyone,
      I've created a UDF for basic communication with SSH servers. I know there is already such a UDF, but I wasn't satisfied with it for my purpose, so I created a new one.
      This UDF also acts as a wrapper for the plink executable. Its essential functions are _SSHConnect, _SSHSend, _SSHRecv and _SSHCloseSocket.
      It does support multiple simultaneous connections and aims to be pretty robust. Feel free to share your opinions
      Two of the included examples use a slightly modified version of Vintage Terminal by @Chimp
      Download
      The download includes ssh.au3 (UDF), plink.exe (necessary), vintage terminal and code examples:
      Version 1.0.1
      - fixed rare _SSHConnect bug where "ssh-host-key prompt" was not answered
      SSH UDF 1.0.1.zip
       
    • By water
      I have started to rewrite the PowerPoint UDF similar to the Word, Excel and Outlook UDF. The new UDF will not be compatible with the existing one.
      I will add examples, documentation, a section in the wiki etc.
      So far the following functions have been coded - more are on the ToDo list.
      _PPT_Open: Open a connection to a running instance of PowerPoint or start a new one _PPT_Close: Close a PowerPoint instance _PPT_CommentAdd: Add a Comment anywhere on a Slide or connected to a Shape (version 1.5.0.0 2021-08-31) _PPT_CommentDelete: Delete a single Comment from a Slide or all Comments from a SlideRange (version 1.5.0.0 2021-08-31) _PPT_CommentList: Get a list of all Comments in a Presentation (version 1.5.0.0 2021-08-31) _PPT_ConvertUnits: Convert units (like centimeters) to other units (like points) (version 1.3.0.0 2021-08-17) _PPT_HeaderFooterList: Returns a list of Headers and Footers for a Presentation (version 1.1.0.0 2021-07-25, removed with version 1.4.0.0 2021-08-25) _PPT_HeaderFooterSet: Sets the Header/Footer for a Slide/Slides or the Slide-/Notes-/Handout-/Title-Master of the Presentation (version 1.2.0.0 2021-08-09) _PPT_PresentationAttach: Attach to an already opened Presentation _PPT_PresentationClose: Close a Presentation _PPT_PresentationExport: Export one/multiple/all Slides as PDF or XPS. _PPT_PresentationExportGraphic: Export one/multiple/all Slides in a graphic format. _PPT_PresentationList: Returns a list of currently open Presentations (version 1.0.0.0 2021-07-20) _PPT_PresentationNew: Create a new Presentation _PPT_PresentationOpen: Open an existing Presentation _PPT_Print: Print one/multiple/all Slides of a Presentation (version 1.0.0.0 2021-07-20) _PPT_PresentationSave: Save a Presentation _PPT_PresentationSaveAs: Save a Presentation to another location or with another type _PPT_ShapeAdd: Add a Shape to a single or multiple Slides (version 1.1.0.0 2021-07-25) _PPT_ShapeAlignDistribute: Aligns and distributes the Shapes in the specified ShapeRange (version 1.6.0.0 - to be released) _PPT_ShapeCopyMove: Copy/move a Shape(s) of a single Slide to a Slide(s) in the same or a different Presentation (version 1.1.0.0 2021-07-25) _PPT_ShapeDelete: Delete a Shape or Shapes from a single or multiple Slides (version 1.1.0.0 2021-07-25) _PPT_SlideAdd: Add slide(s) to a Presentation _PPT_SlideCopyMove: Copy, move, duplicate Slide(s) _PPT_SlideDelete: Delete Slide(s) _PPT_SlideShow: Show a Presentation _PPT_TableGet: Extract data from a PowerPoint Table Shape to an array (version 1.3.0.0 2021-08-17) _PPT_TableSet: Write data to a PowerPoint Table Shape (version 1.3.0.0 2021-08-17) _PPT_TextFindReplace: Find & replace text throughout entire PowerPoint presentation (version 1.0.0.0 2021-07-20) _PPT_TextSet: Sets/modifies the Text of a Shape or Shapes of a single or multiple Slides (version 1.2.0.0 2021-08-09 Which functions do you want me to add to the UDF?
      ToDo list:
      create slide (JLogan3o13) - Done: _PPT_SlideAdd Apply template to slide (JLogan3o13) - Done: _PPT_SlideAdd Apply theme to slide (JLogan3o13) Cut/Copy/Duplicate/Move/Delete slide(s) (JLogan3o13) - Done: _PPT_SlideCopyMove, _PPT_SlideDelete Export slides (JLogan3o13) - Done: _PPT_PresentationExport Cut/Copy/Duplicate/Move/Delete shape(s) (JLogan3o13): Done : _PPT_ShapeCopyMove, _PPT_ShapeDelete (version 1.1.0.0 2021-07-25) ApplyAnimation, Select, SetDefaultProperties, and zOrder for shape(s) (JLogan3o13) Searching and replacing text (pcjunki) - Done: _PPT_TextFindReplace (version 1.0.0.0 2021-07-20) Export slides in a graphic format (JPG, GIF, PNG ...) (UEZ) - Done: _PPT_PresentationExportGraphic The UDF can be downloaded from the download forum.
       
    • By seadoggie01
      This UDF is because I'm tired of trying to use UI Automation and Send to automate Adobe Acrobat. I often need to read the contents of PDFs and Acrobat is not easy to work with as a window.  The functions are based on the API Reference from Adobe located here.
      Acrobat Pro is required for all functions.
      It's very beta right now, but it still seems to work. Currently, the functions are based around page level manipulation of PDF documents: re-arranging, swapping, deleting, and moving pages as this is what I use the most.
      Please feel free to request/suggest features!
       
       
    • By DonChunior
      Introduction 
      In the course of my research for a project involving, among other things, the transfer of large amounts of data, I came across the BITS service and from that the idea for this UDF was born.
      For a brief overview, I'll quote from Microsoft's BITS website (https://docs.microsoft.com/en-us/windows/win32/bits/background-intelligent-transfer-service-portal).
      Availability 🛒
      The BITS UDF can be downloaded from my GitHub repository:
      🔗 https://github.com/DonChunior/BITS-UDF
      Comments 💬
      Currently, only an alpha version of the UDF is available.
      This contains by and large the full functionality of the object interfaces, but still completely lacks error checking and handling.
      I will implement this in the upcoming beta version.
      Therefore I ask you to use the UDF only for testing purposes but not in productive code!
      Acknowledgment 🤝
      Many thanks to @Nine and @Danyfirex.
      You helped me very well in solving some tricky problems.
    • By Hermes
      I have Index.html where it contains a frame with a source "frame1.html". I can select/highlight elements in index.html but unable to select/highlight elements inside the frame with the src "frame1.html", the autoit output is throwing error:
      __WD_Post: URL=HTTP://127.0.0.1:9515/session/2143396006437be4005db3b84acc1496/element/8be1c3c4-5bb1-42b1-8cde-7954765cbc61/element; $sData={"using":"css selector","value":"frameset:nth-of-type(1)"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\... __WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"css selector\",\"selector\":\"frameset:nth-of-type(1)\"}\n (Session info: chrome=90.0.4430.212)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00FCE7D3+124883]\n\tOrdinal0 [0x00FCE7B1+124849]\n\tGetHandleVerifier [0x01218688+193832]\n\tGetHandleVerifier [0x0123C478+340760]\n\tGetHandleVerifier [0x012361F1+315537]\n\tGetHandleVerifier [0x012516BA+427354]\n\tGetHandleVerifier [0x01236176+315414]\n\tGetHandleVerifier [0x0125174A+427498]\n\tGetHandleVerifier [0x0125D6EB+476555]\n\tGetHandleVerifier [0x0125154B+426987]\n\tGetHandleVerifier [0x01234FFD+310941]\n\tGetHandleVerifier [0x01235D8E+314414]\n\tGetHandleVerifier [0x01235D19+314297]\n\tGetHandleVerifier [0x012F31EC+1089676]\n\tGetHandleVerifier [0x012F17C9+1082985]\n\tGetHandleVerifier [0x012F13A3+1081923]\n\tGetHandleVerifier [0x013ED9FD+2115741]\n\tOrdinal0 [0x0111B82E+1488942]\n\tOrdinal0 [0x010B5A7D+1071741]\n\tOrdinal0 [0x010B559B+1070491]\n\tOrdinal0 [0x010B54B1+1070257]\n\tOrdinal0 [0x010EFF53+1310547]\n\tBaseThreadInitThunk [0x770662C4+36]\n\tRtlSubscribeWnfStateChangeNotification [0x776B1B69+1081]\n\tRtlSubscribeWnfStateChangeNotification [0x776B1B34+1028]\n"}} Auto IT Script:
      #Include "wd_core.au3" #Include "wd_helper.au3" Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, 'index.html') _WD_LoadWait($sSession) Local $index = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)") Local $index1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)", $index) Local $index2 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frame:nth-of-type(1)", $index1) Local $index3 = _WD_FindElement($sSession, $_WD_LOCATOR_ByCSSSelector, "frameset:nth-of-type(1)", $index2) _WD_HighlightElement($sSession, $index2, 1) _WD_HighlightElement($sSession, $index3, 1) _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}' EndFunc ;==>SetupChrome  

      frame1.html index.html
×
×
  • Create New...