Sign in to follow this  
Followers 0
flaxcrack

FileWriteLine is sending items to my destktop?

9 posts in this topic

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()

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

this is your open the file for writing

FileOpen($Logfile, 2)

then the next line you are reading with

$Line = FileReadLine($Logfile, $LineReturn)

that could create errors

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

that could create errors

8)

What does that mean?


[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()

Share this post


Link to post
Share on other sites

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

Speak in english not code please. :o


[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()

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Simply... you are opening the file to write to it with the #2... then you try to "Read" from that file... that is incorrect..

SmOke has showed you filewrite line to correct the error

8)

Edited by Valuater

NEWHeader1.png

Share this post


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.


[center]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.[/center]

Share this post


Link to post
Share on other sites

Speak in english not code please. :o

he was quoting the helpfile. you're calling FileWriteLine() without passing a filename to tell it where to write. so instead of writing to the file you want, it's interpretting your line to be the file name.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


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()

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