Sign in to follow this  
Followers 0
top

Need Help.. Again ;(

4 posts in this topic

wrong code? :think:

#include <file.au3>

$file = "random.txt"

FileOpen($file, 0)

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

$line = FileReadLine($file, $num)

opt("WinTitleMatchMode", 4)

HotKeySet("{ENTER}", "ff")

Run("notepad.exe")

While 1
sleep(300)
WEnd

Func ff()
HotKeySet("{ENTER}")
$bb=WinGetHandle("classname=Notepad")
ControlSetText("Untitled -", "", "Edit1", $line )
send("{ENTER}")
HotKeySet("{ENTER}", "ff")
EndFunc


FileClose($file)

Share this post


Link to post
Share on other sites



?

#include <file.au3>

$file = "random.txt"

FileOpen($file, 0)

$linecount = _FileCountLines($file)

Opt("WinTitleMatchMode", 4)

HotKeySet("{ENTER}", "ff")
HotKeySet("{ESC}","_Terminate")

Run("notepad.exe")

While 1
    Sleep(300)
WEnd

FileClose($file)

Func _Terminate()
    Exit
EndFunc

Func ff()
    HotKeySet("{ENTER}")
    $bb = WinGetHandle("classname=Notepad")
    $num = Random(1, $linecount, 1)

    $line = FileReadLine($file, $num)
    ControlSetText("Untitled -", "", "Edit1", $line)
    Send("{ENTER}")
    HotKeySet("{ENTER}", "ff")
EndFunc  ;==>ff

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

maybe

#include <file.au3>

opt("WinTitleMatchMode", 4)

HotKeySet("{ENTER}", "ff")

Run("notepad.exe")

While 1
sleep(300)
WEnd

Func ff()
HotKeySet("{ENTER}")

$file = "lang.lng"
FileOpen($file, 0)
$linecount = _FileCountLines($file)
$num = Random(1,$linecount,1)
$line = FileReadLine($file, $num)
FileClose($file)

$bb=WinGetHandle("classname=Notepad")
ControlSend("Untitled -", "", "Edit1", $line )
send("{ENTER}")
HotKeySet("{ENTER}", "ff")
EndFunc

8)

phone rang...

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

notice i used

ControlSend("Untitled -", "", "Edit1", $line )

to "add" the text to the notepad

8)


NEWHeader1.png

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