Jump to content
Sign in to follow this  
PcExpert

Script doesn't wprk

Recommended Posts

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 !

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

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

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

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

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  

×
×
  • Create New...