Would this work?

[lua]function timer1()
timer.Simple( 3, timer2() )
random1 = math.random(10,99990)
file.Write(“pdebugp/”… random1 …"/props.txt", #ents.FindByClass(“prop_physics*”))
file.Write(“pdebugp/”… random1 …"/players.txt", #player.GetAll())
file.Write(“pdebugp/”… random1 …"/fps.txt", RealFrameTime() 60)
end
function timer2()
timer.Simple( 3, timer1() )
random2 = math.random(10,99990)
file.Write(“pdebugp/”… random2 …"/props.txt", #ents.FindByClass("prop_physics
"))
file.Write(“pdebugp/”… random2 …"/players.txt", #player.GetAll())
file.Write(“pdebugp/”… random2 …"/fps.txt", RealFrameTime() *60)
end
timer1()[/lua]

I also can’t find where it writes to…

First your immediate problem is that you’re calling the timer function instead of passing the reference
[lua]timer.Simple( 3, timer2() )
timer.Simple( 3, timer1() )
– the above should be the below
timer.Simple( 3, timer2 )
timer.Simple( 3, timer1 )[/lua]
Apart from that it should work fine. However since the functions are nearly identical you could do it with just one.
[lua]
local function writeGarbage()
timer.Simple( 3, writeGarbage )
local rand = math.random(10,99990)
file.Write(“pdebugp/”… rand …"/props.txt", #ents.FindByClass(“prop_physics*”))
file.Write(“pdebugp/”… rand …"/players.txt", #player.GetAll())
file.Write(“pdebugp/”… rand …"/fps.txt", RealFrameTime() *60)
end
writeGarbage()
[/lua]
This should do the same but I’ve localized the functions so there should be less side-effects.

[editline]10:59PM[/editline]

Also it writes to your garrysmod/data folder, so when it works you should find a whole load of random numbered directories in garrysmod/data/pdebugp

Thanks! but would that keep doing the function every 6 seconds or something?

No, it will do it every 3 seconds, like your code does. If you want it to be 6 seconds change the number in the timer.Simple call.

SO it will keep running for ever?

[editline]04:57PM[/editline]

Oha nd i still can’t find where ot wrires too, the folder just isn’t there!

Pretty much, you might want to put in some code to make it possible to stop it, but that’s up to you.

If you don’t have a garrysmod/data/pdebugp/ folder then chances are it’s not writing the files. I’d say it’s more likely that the code isn’t happening than it’s failing to write. You might want to put some ErrorNoHalt("THIS CODE SHOULD BE PRINTING
") into the code so it’ll tell you every 3 seconds that it’s actually working.

Put that in and nothing prints so i am guessing there is a problem?

It sounds like nothing is calling this code then. In what file did you put this code?
For it to be run on start it needs to go in a file in lua/autorun.

Oh sorry about my previous spelling.

I put this into a gamemode and since gamemodes appear to not have autorun that I could dind i just put this code into counting.lua:
[lua]local function writeGarbage()
timer.Simple( 3, writeGarbage )
local rand = math.random(10,99990)
file.Write(“pdebugp/”… rand …"/props.txt", #ents.FindByClass(“prop_physics*”))
file.Write(“pdebugp/”… rand …"/players.txt", #player.GetAll())
file.Write(“pdebugp/”… rand …"/fps.txt", RealFrameTime() *60)
ErrorNoHalt("THIS CODE SHOULD BE PRINTING
")
end
writeGarbage()[/lua]

I also put addcslua and include in init.lua in my gamemode folder this has worked before for an autorun file…

OH SHI- Saw a possible mistake…

[editline]04:16PM[/editline]

Seems to work now, all except the frame time bit which i will probably disable now anyway…