Last active
March 6, 2017 10:48
-
-
Save Oreolek/ab09b7f3ec7052a56cd660b2149da648 to your computer and use it in GitHub Desktop.
Transcript module for INSTEAD 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local std = stead | |
local filename = "game.log" | |
function writelog(s) | |
local f = io.open(filename, "a") | |
f:seek("end", 0) | |
f:write("\n", s, "\n") | |
return f:flush() | |
end | |
game.onwalk = function(f, inwalk) | |
local dsc = std.call(inwalk, 'dsc') | |
if dsc then | |
writelog(dsc) | |
end | |
local decor = std.call(inwalk, 'decor') | |
if decor then | |
writelog(decor) | |
end | |
return true | |
end | |
game.afteract = function(this, that) | |
local nam1 = this.decor | |
local nam2 = that.decor | |
if that:type('phr') then | |
nam2 = std.call(that, 'dsc') | |
else | |
nam2 = that.nam | |
end | |
if nam2 then | |
writelog("> "..nam2) | |
end | |
end | |
std.mod_start(function() writelog("--- НАЧАЛО ИГРЫ ---") end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment