Jump to content

Recommended Posts

Posted

#include <File.au3>

_FileWriteToLine("C:\Program Files\Steam\steamapps\francescaklinger\counter-strike\cstrike\cfgfuck.cfg", 3, "my replacement for line 3", )

i have a file in my cstrike folder calld "cfgfuck.cfg" and i dont understand why that line of code wont work...maybe the file has to be .txt format

Posted

except for the comma at the end i was able to make it work.

(of course i tested a different directory)

#include <File.au3>

_FileWriteToLine("C:\Program Files\Steam\steamapps\francescaklinger\counter-strike\cstrike\cfgfuck.cfg", 3, "my replacement for line 3" )
Posted

except for the comma at the end i was able to make it work.

(of course i tested a different directory)

#include <File.au3>

_FileWriteToLine("C:\Program Files\Steam\steamapps\francescaklinger\counter-strike\cstrike\cfgfuck.cfg", 3, "my replacement for line 3" )

what comma?

Posted

#include <File.au3>

_FileWriteToLine("C:\Program Files\Steam\steamapps\francescaklinger\counter-strike\cstrike\cfgfuck.cfg", 3, "my replacement for line 3",1)

o yah...i ment to post this likne of code

i want to replace line 3

Posted

You could try something like...

#include <File.au3>

$file = 'C:\Program Files\Steam\steamapps\francescaklinger\counter-strike\cstrike\cfgfuck.cfg'
Dim $array

_FileReadToArray($file, $array)

$array[3] = 'my replacement for line 3'

_FileWriteFromArray($file, $array, 1)

(Just add in some error checking.)

Posted (edited)

still dont work...

ok im just going to use fileWrite

now im getting some were

but how do you filewrite this key "

i need to add this line to the cfgfile

amx_nick "2134235" "testname"

but how do you filewrite this key "

------------------example-code---------------------------

$target = InputBox("cfgfuck", "Enter steamID", "", "")

$file = FileOpen("cfgfuck.cfg", 2)

; Check if file opened for writing OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

FileWrite($file, "amx_nick " & $target & " testname" )

FileWrite($file, "")

FileWrite($file, "")

FileClose($file)

Edited by onedayillpay
Posted

so how do you send the key " to a txt file using filewrite

double them up or use single quotes around it. Check the FAQ in the help file, it's explained in there.

Posted (edited)

send("+'") works if you want to send "

but im trying to filewrite that key

FileWrite($file, ' " ')

FileWrite($file, """"""""""""""""""""""""""""""""""""""""""Frustrated)

ok i got it it takes four filewrite(" " " ")

gadamn y was that not in the read me

Edited by onedayillpay

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
×
×
  • Create New...