Sign in to follow this  
Followers 0
PcExpert

Script doesn't wprk

12 posts in this topic

#1 ·  Posted (edited)

Hi all,

Why doesn't this script work?

CODE

$1 = InputBox("test", "question 1")

$2 = InputBox("test", "question 2")

$3 = InputBox("test", "question 3")

InetGet("ftp://user:pass@IPADRESS/questions.txt", @TempDir)

FileWriteLine(@TempDir & "questions.txt", "answere 1: " & $1)

FileWriteLine(@TempDir & "questions.txt", "answere 2: " & $2)

FileWriteLine(@TempDir & "questions.txt", "answere 3: " & $3)

FileWriteLine(@TempDir & "questions.txt", "--------------------------------------------")

FileCopy(@TempDir & "questions.txt", "ftp://user:pass@IPADRESS/questions.txt")

FileDelete(@TempDir & "questions.txt")

I can't find out why.

Edited by PcExpert

Share this post


Link to post
Share on other sites



Hi all,

Why doesn't this script work?

CODE

$1 = InputBox("test", "question 1")

$2 = InputBox("test", "question 2")

$3 = InputBox("test", "question 3")

InetGet("ftp://user:pass@IPADRESS/questions.txt", @TempDir)

FileWriteLine(@TempDir & "questions.txt", "answere 1: " & $1)

FileWriteLine(@TempDir & "questions.txt", "answere 2: " & $2)

FileWriteLine(@TempDir & "questions.txt", "answere 3: " & $3)

FileWriteLine(@TempDir & "questions.txt", "--------------------------------------------")

FileCopy(@TempDir & "questions.txt", "ftp://user:pass@IPADRESS/questions.txt")

FileDelete(@TempDir & "questions.txt")

I can't find out why.

@TempDir contains a directory name ... not a file name !

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Can you show me what you mean?

Share this post


Link to post
Share on other sites

Hi,

maybe:

$1 = InputBox("test", "question 1")
$2 = InputBox("test", "question 2")
$3 = InputBox("test", "question 3")
InetGet("ftp://user:pass@IPADRESS/questions.txt", @TempDir & "\somethinghere.extension")
FileWriteLine(@TempDir & "\questions.txt", "answere 1: " & $1)
FileWriteLine(@TempDir & "\questions.txt", "answere 2: " & $2)
FileWriteLine(@TempDir & "\questions.txt", "answere 3: " & $3)
FileWriteLine(@TempDir & "\questions.txt", "--------------------------------------------")
FileCopy(@TempDir & "\questions.txt", "ftp://user:pass@IPADRESS/questions.txt")
FileDelete(@TempDir & "\questions.txt")

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

If I open the questions.txt file from the ftp server it is empty..

Maybe it isn't possible what I want to do?

Share this post


Link to post
Share on other sites

Hi,

how far do you get? Which step doesnt work?

So long,

Mega

$1 = InputBox("test", "question 1")
$2 = InputBox("test", "question 2")
$3 = InputBox("test", "question 3")
InetGet("ftp://user:pass@IPADRESS/questions.txt", @TempDir & "\questions.txt")
FileWriteLine(@TempDir & "\questions.txt", "answere 1: " & $1)
FileWriteLine(@TempDir & "\questions.txt", "answere 2: " & $2)
FileWriteLine(@TempDir & "\questions.txt", "answere 3: " & $3)
FileWriteLine(@TempDir & "\questions.txt", "--------------------------------------------")
FileCopy(@TempDir & "\questions.txt", "ftp://user:pass@IPADRESS/questions.txt")
FileDelete(@TempDir & "\questions.txt")

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I think it goes wrong when the 4th line is excuted. Because otherwise the filecopy line woul'd work.

Share this post


Link to post
Share on other sites

Hi,

what about testing it step by step.

$1 = InputBox("test", "question 1")
$2 = InputBox("test", "question 2")
$3 = InputBox("test", "question 3")
If InetGet("ftp://user:pass@IPADRESS/questions.txt", @TempDir & "\questions.txt", 1) = 0 Then
    MsgBox(16, "Error", "Download")
    Exit (0)
EndIf
ConsoleWrite(1 & @LF)
FileWriteLine(@TempDir & "\questions.txt", "answere 1: " & $1)
FileWriteLine(@TempDir & "\questions.txt", "answere 2: " & $2)
FileWriteLine(@TempDir & "\questions.txt", "answere 3: " & $3)
FileWriteLine(@TempDir & "\questions.txt", "--------------------------------------------")
ConsoleWrite(2 & @LF)
If FileCopy(@TempDir & "\questions.txt", "ftp://user:pass@IPADRESS/questions.txt") = 0 Then
    MsgBox(16, "Error", "FileCopy")
    Exit (0)
EndIf
FileDelete(@TempDir & "\questions.txt")

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

1 error occured: DOWNLOAD

Share this post


Link to post
Share on other sites

Hi,

so know you know where to start. :P

So long,

Mega

I cannot test it, cause I have no ftp here. :">


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

OK, thanks for your help anyway

Share this post


Link to post
Share on other sites

I just detected an interesting line in the ftp server logfile:

Dec 28 14:17:10 FTP server: user anonymous quit by session timeout

What could have made the timeout to occure

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