Hello Guest

Can't append external File

  • 2 Replies
  • 164 Views
*

Saaho2019

  • *
  • 2
  • +0/-0
    • View Profile
Can't append external File
« on: November 20, 2019, 02:47:42 pm »
Hey i was trying to implement this
Code: [Select]
chance  = 98
nextbet = 0.00015
bethigh = true

local rollsData = {}
function dobet()
    local betIdString     = tostring(lastBet.Id)
    local betIdNonce     = tostring(lastBet.nonce)
    local betIdRoll     = tostring(lastBet.Roll)

    print(betIdNonce .. betIdString)
    local f = assert(io.open("quicksave.txt", "w"))
    io.output(f)
    f:write(betIdString, "\t")
    f:write(betIdNonce, "\t")
    f:write(betIdRoll, "\n")
    f:close()

end

Where i want to save few bet properties to an external text file.
but i can't perform append operation as i am getting this error.
[string "chunk"]:10: quicksave.txt: error #-1

*

Seuntjie

  • *****
  • 366
  • +12/-2
    • View Profile
Re: Can't append external File
« Reply #1 on: November 20, 2019, 02:58:10 pm »
Before addressing the append issue, why do you want to save it to a file?

Are you aware that all of your bets are stored in a sqlite database called dicebot.db? You can browse and query the database using a program like sqlitebrowser.

*

Saaho2019

  • *
  • 2
  • +0/-0
    • View Profile
Re: Can't append external File
« Reply #2 on: November 20, 2019, 03:07:37 pm »
didn't knew that all bets are stored inside sql database dicebot.db.

Will check that out thank you :)