Jump to content

FileWriteLine is sending items to my destktop?


Recommended Posts

Hey guys any ideas why this wouldn't be writing to the file and making files on my desktop. It is so strange because the file on my desktop is 0 and every time you press the 0 key it writes 0 to file named 0 and not to logfile.txt. Any help would be great.

#Include <Misc.au3>
#include <File.au3>

$dll = DllOpen("user32.dll")
$LineReturn = 1
$Logfile = "C:\logfile.txt"
IF Not FileExists($Logfile) Then _FileCreate($Logfile)
FileOpen($Logfile, 2)

While 1
    
    $Line = FileReadLine($Logfile, $LineReturn)
    
    If _IsPressed("0D", $dll) Then $LineReturn = $LineReturn + 1
    If _IsPressed("08", $dll) Then FileWriteLine(StringRight($Line, 1), $LineReturn)
    If _IsPressed("20", $dll) Then FileWriteLine($Line & " ", $LineReturn)
    If _IsPressed("30", $dll) Then FileWriteLine($Line & "0", $LineReturn)
    
    Sleep(1)
    
WEnd

FileClose($Logfile)
DllClose($dll)

[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 post
Share on other sites
  • Moderators

FileWriteLine ( filehandle or "filename", "line" )

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to post
Share on other sites
  • Moderators

#Include <Misc.au3>
#include <File.au3>

$dll = DllOpen("user32.dll")
$LineReturn = 1
$Logfile = "C:\logfile.txt"
IF Not FileExists($Logfile) Then _FileCreate($Logfile)
$FileOpenLog = FileOpen($Logfile, 2)

While 1
    
    $Line = FileReadLine($Logfile, $LineReturn)
    
    If _IsPressed("0D", $dll) Then $LineReturn = $LineReturn + 1
    If _IsPressed("08", $dll) Then FileWriteLine('FileYouWillBeWritingTo', StringRight($Line, 1))
    If _IsPressed("20", $dll) Then FileWriteLine('FileYouWillBeWritingTo', $Line & ' ')
    If _IsPressed("30", $dll) Then FileWriteLine('FileYouWillBeWritingTo', $Line & "0")
    
    Sleep(1)
    
WEnd

FileClose($FileOpenLog)
DllClose($dll)
It was english, straight out of the help file.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to post
Share on other sites

#Include <Misc.au3>
#include <File.au3>

$dll = DllOpen("user32.dll")
$LineReturn = 1
$Logfile = "C:\logfile.txt"
IF Not FileExists($Logfile) Then _FileCreate($Logfile)
$FileOpenLog = FileOpen($Logfile, 2)

While 1
    
    $Line = FileReadLine($Logfile, $LineReturn)
    
    If _IsPressed("0D", $dll) Then $LineReturn = $LineReturn + 1
    If _IsPressed("08", $dll) Then FileWriteLine('FileYouWillBeWritingTo', StringRight($Line, 1))
    If _IsPressed("20", $dll) Then FileWriteLine('FileYouWillBeWritingTo', $Line & ' ')
    If _IsPressed("30", $dll) Then FileWriteLine('FileYouWillBeWritingTo', $Line & "0")
    
    Sleep(1)
    
WEnd

FileClose($FileOpenLog)
DllClose($dll)
It was english, straight out of the help file.
So so sorry. I have given up caffin and I am suffering horably... :o WTF was I thinking. :geek: Sorry about that mate. ;)

[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 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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...