Nyyrazzilyss / NyyLIB

Mudlet client script for Torilmud
http://www.torilmud.com/phpBB3/viewtopic.php?f=4&t=27194
GNU General Public License v2.0
7 stars 4 forks source link

Katumi update #298

Closed Nyyrazzilyss closed 1 year ago

Nyyrazzilyss commented 3 years ago

Download and update katumi database

Alias:

name: @updatedb pattern: ^@updatedb$

cecho("Downloading current Katumi database.\n") downloadFile("toril.db", "http://www.grokh.com/toril.db")


Script:

name: katumiUpdate event: sysDownloadDone

function katumiUpdate(k, v) -- k is function name. v is filename

if v == "toril.db" then cecho("Katumi download completed.\n")

copyFile(v, mainpath(v))

cecho("<green>Connecting to updated database.\n")

sqlOpen()

-- delete the downloaded file
os.remove(v)

end end

Hibbidy commented 2 years ago

cecho("Downloading current Katumi database.\n") local saveto = getMudletHomeDir().."/toril.db" local url = "http://www.grokh.com/toril.db" downloadFile(saveto, url) cecho("Downloading "..url.." to "..saveto.."\n")

Nyyrazzilyss commented 1 year ago

@updatedb

cecho("Downloading current Katumi database.\n") downloadFile( homepath("toril.db"), "http://www.grokh.com/toril.db")

function katumiUpdate(k, v) -- k is function name. v is filename

if string.find(v, "toril.db") then cecho("Katumi download completed.\n")

copyFile(v, mainpath("toril.db"))

cecho("<green>Connecting to updated database.\n")

sqlOpen()

-- delete the downloaded file
os.remove(v)

end end