Jump to content

Autohotkey → Autoit Please help me.


Recommended Posts

This is a source of AutoHotkey.

This source or can be converted to the AutoIt?

 

Please help me.

myPath=%A_Dir%\AllowChk.txt
UrlDownloadToFile, http://www.myserver.com/ExecAllowChk.txt, %myPath%
Sleep, 1000
FileRead, Contents, %myPath%
if not ErrorLevel
{
       Sort, Contents
       if Contents != Allow
       {
              filedelete AllowChk.txt
              MsgBox %Contents%
              Exit
       }
}
Link to comment
Share on other sites

think it can, opet autoit help file and read about next references

 

InetGet

Sleep

FileRead

If...ElseIf...Else...EndIf

MsgBox

FileDelete

examples for them are on bottom

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

  • Moderators

doter, as is being pointed out by several members, this is not a forum where you put in a request and we barf up code for you. You must show some effort if you expect help. You have been directed to the relevant sections of the help file, now let's see what you have tried on your own.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I don't know autohotkey but looking at ur code maybe something like this?

Local $myPath = @DesktopDir & "\AllowChk.zip"
Local $UrlDownloadToFile = "http://download.thinkbroadband.com/10MB.zip"
Local $hDownload = InetGet($UrlDownloadToFile, $myPath, 1, 1)
; Wait for the download to complete by monitoring when the 2nd index value of InetGetInfo returns True.
; It is better than Sleep(1000)
$hTimer = TimerInit()
Do
 Sleep(250)
Until InetGetInfo($hDownload, 0) Or TimerDiff($hTimer) > 10000 ; avoid infinity loop in case of corrupted file.
Local $Open = FileOpen($myPath)
Local $Read = FileRead($Open)
If Not @error Then
 $hTimer = TimerInit()
 While FileExists($myPath)
  If TimerDiff($hTimer) > 10000 Then ExitLoop ;avoid infinity loop in case of error
  FileDelete($myPath)
  Sleep(500)
 WEnd
 MsgBox(0, "", $Read)
 ;Exit
EndIf
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...