You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 14, 2018. It is now read-only.
Hi guys, i'm in trouble.
I'm already starting coding, so i don't know if i do it OK.
The deal is that i wanted a plugin that would let my bot to get the "text" (or links) that me and my friends wrote and save them into a .txt file.
I saw few tutorials on the net about how could be possible to do it, but I'm getting stucked.
I always got the same error
./bot/bot.lua:263: attempt to call a nil value
This is the code i wrote, it's based on hello.lua to get the text and notificate it got its. but i don't know how to add the "file" editing part. Tried io.open and os.execute.
This is the code, thanks for your attention. ^^
``local _textPath = "./home/USER/textfile.txt"
do
local file = io.open( _textpath ,"a+")
file:write( ..matches[1].. \n) ----->Don't know if it would be OK like this
file:close()
end
function run(msg, matches)
return "Nota " .. matches[1] .. " añadida."
end
return {
description = "Add [link] to txt file",
usage = "!note [text/link]",
patterns = {
"^!note (.)$",
"^!note (.)$"
},
run = run
}
end
``
The text was updated successfully, but these errors were encountered:
Hi guys, i'm in trouble.
I'm already starting coding, so i don't know if i do it OK.
The deal is that i wanted a plugin that would let my bot to get the "text" (or links) that me and my friends wrote and save them into a .txt file.
I saw few tutorials on the net about how could be possible to do it, but I'm getting stucked.
I always got the same error
This is the code i wrote, it's based on hello.lua to get the text and notificate it got its. but i don't know how to add the "file" editing part. Tried io.open and os.execute.
This is the code, thanks for your attention. ^^
``local _textPath = "./home/USER/textfile.txt"
do
local file = io.open( _textpath ,"a+")
file:write( ..matches[1].. \n) ----->Don't know if it would be OK like this
file:close()
end
function run(msg, matches)
return "Nota " .. matches[1] .. " añadida."
end
return {
description = "Add [link] to txt file",
usage = "!note [text/link]",
patterns = {
"^!note (.)$",
"^!note (.)$"
},
run = run
}
end
``
The text was updated successfully, but these errors were encountered: