This file contains hidden or 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
{ | |
"slots":{ | |
"0":{ | |
"name":"screen", | |
"type":{ | |
"methods":[], | |
"events":[] | |
}, | |
"_elementType":"screen" | |
}, |
This file contains hidden or 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
-- Define a global script object with event handlers | |
script = {} | |
function script.onStart () | |
-- Display some text | |
screen.setCenteredText("script started") | |
-- Create some timers to show that the script is working | |
unit.setTimer("a", 2) -- timer id "a", ticks every 2 seconds | |
unit.setTimer("b", 3) -- timer id "b", ticks every 3 seconds |
This file contains hidden or 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
-------------------------------------------------------------------------------- | |
-- wrap.lua bundle begins | |
-- version: 2020-09-04 6bd9a87 | |
-- content sha256: 3f459084f0 | |
-------------------------------------------------------------------------------- | |
__lbs__version = "2020-09-04 6bd9a87" | |
do | |
do | |
local _ENV = _ENV |
This file contains hidden or 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
-- Extracts values from a JSON string with pattern matching | |
-- This is faster than using dkjson when only a few fields are needed | |
-- Use this only with trusted data sources! Limitations: | |
-- * Character escapes are not supported | |
-- * Field nesting is ignored | |
local find, gsub = string.find, string.gsub | |
---@param json string |
This file contains hidden or 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
# Extracts dump.lua output from *.xml log files | |
# Works with Python 2.7 and 3.6 | |
# Dumped global variable members are internally represented by a unidirectional graph, which can contain cycles | |
import argparse | |
import errno | |
import os | |
import re | |
from collections import deque |
This file contains hidden or 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 max = math.max | |
local concat, insert = table.concat, table.insert | |
local byte, gsub, format, match, rep = string.byte, string.gsub, string.format, string.match, string.rep | |
local buffer = { "Lua globals dump: \r\n\r\n" } | |
local should_get_function_params = true | |
local should_dump_functions = false | |
local table_visited = {} |
This file contains hidden or 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
#include <assert.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <lua.h> | |
#include <lauxlib.h> | |
#include <lualib.h> | |
// from https://www.lua.org/pil/24.2.3.html | |
static void stackDump(lua_State *L) { | |
int i; |