PrintUrlToFile function

From StealthBot Wiki
Jump to: navigation, search

The PrintUrlToFile function is provided by the Script Support Class to StealthBot to expose the UrlDownloadToFile() API function to scripting.


The PrintUrlToFile function was added in version 2.6 as suggested by FiftyToo.


'// Mirror function for the Windows API URLDownloadToFile() function
'// Currently you are restricted to placing files in the StealthBot install directory only
Public Sub PrintURLToFile(ByVal sFileName As String, ByVal sURL As String)

    sFileName = StringFormat("{0}\{1}", CurDir$(), sFileName)

    URLDownloadToFile 0, sURL, sFileName, 0, 0

End Sub


This function calls the API function URLDownloadToFile in order to download the file from the URL to the specified file name. Use this to download a file to the location specified by the BotPath function.


PrintUrlToFile FileName, URL


  • sFileName is the name of the file to be downloaded to.
  • sURL is the URL to remove cached entries for.


  • Download some file to your bot folder wihtout caching.
  • sUrl = ""
    DeleteUrlCache CStr(sUrl)
    PrintUrlToFile "bnls_servers.txt", CStr(sUrl)

See also