-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.ttslua
26 lines (24 loc) · 868 Bytes
/
global.ttslua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include ../stattracker/stats
function onLoad(save_state)
STAT_URL = "https://script.google.com/macros/s/AKfycbzjnXhgrqrh-ZQMKbNwiUTfreUu-lRocv9zYVTRKyemT8Ntb70/exec"
loadStats(600, 120, false)
local KEEPER = find_object_by_name("The keeper of information")
log("Trying to retreive latest saved data")
function callback(wr)
if wr.response_code == 200 then
log("Data received.")
KEEPER.setLuaScript(wr.text)
KEEPER = KEEPER.reload()
else
log("Something went wrong retreiving newest save")
log(wr.error)
end
end
WebRequest.get("http://eldinds.synology.me/script/villainsv7.ttslua", callback)
end
function find_object_by_name(name)
for _, obj in ipairs(getAllObjects()) do
if obj.getName() == name then return obj end
end
return nil
end