Jump to content
Sign in to follow this  
Flodder450

KIX->Writing into logfile

Recommended Posts

Hi,

im trying to create an entry into c:/temp/log.txt, regardless of computer (it needs to work on every computer you use it on)

When im trying to execute it, i get an parameter missing error, but i cant for the life of me find where i should put one/how i should put it in, can anyone help?

 

heres the script:

 
Function schrijflog("filenaam")

IF EXIST(c:/temp/)
ELSE MD(c:/temp/)
ENDIF

IF EXIST(c:/temp/log.txt)
ELSE MD(c:/temp/log.txt)
ENDIF

OPEN c:/temp/log.txt
WRITELINE "Hall0n!"
CLOSE c:/temp/log.txt
endfunction

schrijflog("log.txt")


2nv5bvl.png
99 Firemaking 30-5-2010 | 99 Fletching 13-7-2014
TET-AU member:6-10-2010 - 21-10-2011

Share this post


Link to post
Share on other sites

Maybe try something like this

 

Function schrijflog(filenaam)

IF NOT EXIST("c:/temp/" + $filenaam)
MD("c:/temp/" + $filenaam)
ENDIF

OPEN "c:/temp/" + $filenaam
WRITELINE "Hall0n!"
CLOSE "c:/temp/" + $filenaam
endfunction

schrijflog("log.txt")

 

I'm not familiar with the language, so there might be some syntax errors, but I think that I solved your problem.

Share this post


Link to post
Share on other sites

Managed to fix it, just need to get it to write a parameter :)

Function log
IF EXIST("c:/temp/")
ELSE
MD("c:/temp/")
ENDIF
IF
OPEN (1,"c:/temp/log.txt",1)
SLEEP 2
ELSE
OPEN (1,"c:/temp/log.txt",4)
ENDIF
If OPEN (,"c:/temp/log.txt", )
endfunction
? call log


2nv5bvl.png
99 Firemaking 30-5-2010 | 99 Fletching 13-7-2014
TET-AU member:6-10-2010 - 21-10-2011

Share this post


Link to post
Share on other sites

SOLVED!

Function log ($tekst)
IF EXIST("c:/temp/")
ELSE
MD("c:/temp/")
ENDIF

OPEN (2,"c:/temp/log.txt",5)
Writeline (2,$tekst)
CLOSE (2)

endfunction
log("Dit log is gemaakt met Kixscript :)!!!!!!!!!")


2nv5bvl.png
99 Firemaking 30-5-2010 | 99 Fletching 13-7-2014
TET-AU member:6-10-2010 - 21-10-2011

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  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.