Sign in to follow this  
Followers 0
doter

Autohotkey → Autoit Please help me.

7 posts in this topic

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
       }
}

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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.

 

Share this post


Link to post
Share on other sites

I not make a program of this degree ...

I seems to be a fool...

Error occurs in Inetget.

I'm not sure.

Hope you help please.

Share this post


Link to post
Share on other sites

Post the code you have so far.

Share this post


Link to post
Share on other sites

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.


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
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

Share this post


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
Sign in to follow this  
Followers 0