Jump to content

Newbie


top
 Share

Recommended Posts

my code doesnt work ;(

please help.

thanks in advance

$file = FileOpen("random.txt", 0)
$line = FileReadLine($file)


Run("notepad.exe")
WinWait("Untitled -")
ControlSetText("Untitled -", "", "Edit1", "$line" )

FileClose($file)
Link to comment
Share on other sites

my code doesnt work ;(

please help.

thanks in advance

$file = FileOpen("random.txt", 0)
$line = FileReadLine($file)
Run("notepad.exe")
WinWait("Untitled -")
ControlSetText("Untitled -", "", "Edit1", "$line" )

FileClose($file)
$file = "random.txt"

FileOpen($file)

$line = FileReadLine($file)
Run("notepad.exe")
WinWait("Untitled -")
ControlSetText("Untitled -", "", "Edit1", "$line" )

FileClose($file)

[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Link to comment
Share on other sites

$file = "random.txt"

FileOpen($file, 0)

$line = FileReadLine($file)
Run("notepad.exe")
WinWait("Untitled -")
ControlSetText("Untitled -", "", "Edit1", $line )

FileClose($file)

now works

but how can i make to result a random line

Edited by top
Link to comment
Share on other sites

#include <file.au3>

$file = "random.txt"

FileOpen($file, 0)

$linecount = _FileCountLines($file)
$num = Random(1,$linecount,1)

$line = FileReadLine($file, $num)
Run("notepad.exe")
WinWait("Untitled -")
ControlSetText("Untitled -", "", "Edit1", $line )

FileClose($file)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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