Post
Topic
Board Gambling
Re: Seuntjies DiceBot -Multi-Site, multi-strategy betting bot for dice. With Charts!
by
seuntjie
on 07/01/2017, 21:40:33 UTC
In Programming Mode :

i want record rolll in file, i use

file=io.open("rec1.txt","a")
io.output(file)
io.write("text test")
io.close(file)


LUAR ERROR!!
[string"chunk"]:4: bad argument #1 to 'close (FILE * expected, got nil)

but the code runs well on console
lua text1.txt

Why do you want to record the roll in the file? All bets are stored in a sqlite DB called dicebot.db. You can view previous bets using the bet history form (view->bet history) or by using like sqlitebrowser to query the file directly

You're probably trying to close the file while it's still writing, or opening the file too many times in too quick succession, or something. Try opening the file once when you start the script and then write to the file without closing it, and only close the file when you stop the bot. (do this manually using the console)