Jump to content
Sign in to follow this  
jamesstp20

[Solved]Unknow Problem

Recommended Posts

jamesstp20

Hello, I have a big problem but I can't find why :unsure:

I have a FTP which have a txt file: jamesst20.megabyet.net/Commande.txt

I am trying to make something that look what is the text and if the text = Update then the script update, if it = Exit then it Exit....

My problem is that when I change the text, the script is supose to know that the text has changed but it doesn't :> Ok I will explain better:

On My script

While 1
$FileName = "Commande.txt"
InetGet("http://jamesst20.megabyet.net/Commande.txt", @TempDir &"/Commande.txt")
    $FileOpened = FileOpen(@TempDir &"/" &$FileName, 0)
    $FileContent = FileRead($FileOpened)
    FileClose($FileOpened)
    Sleep(20)
    MsgBox(0,"", $FileContent)
Wend

Everything works but if WHILE the script is running I change the text from my FTP, the MsgBox doesn't change ;) and If I exit the script and reopen it, the Msgbox has changed....

Why ?

I tried with _FTP_Connect and same thing --'

Thanks you

Edited by jamesstp20

Share this post


Link to post
Share on other sites
JohnOne

$str = InetRead("http://jamesst20.megabyet.net/Commande.txt", 1)
Switch BinaryToString($str)
    Case "mmmmmmmmmmmmmmmmmmmllllllllllllllllllllll"
        MsgBox(0, "Do", "Something")
    Case Else
        MsgBox(0, "Do", "Something else")
EndSwitch


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
smartee

hi jamesstp20,

Try calling InetGet function like this:

InetGet($url,$filename,1)
The 1 in the third parameter indicates that the function should force a reload from the remote site.

-smartee

Share this post


Link to post
Share on other sites
jamesstp20

Thanls you it work !!!!! 2h 30 for only a number XD I can't believe it :unsure:

Thanks you !

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.