content stringlengths 5 1.05M |
|---|
local BaseTranspiler = {}
BaseTranspiler.__index = {}
function BaseTranspiler.new()
return BaseTranspiler.constructor(setmetatable({}, BaseTranspiler))
end
function BaseTranspiler.constructor(self)
self.indent_string = " "
self.indent_count = 0
self.source = ""
return self
end
function BaseTranspiler.__index... |
local glove = require "glove"
function test_setTitle()
glove.window.setTitle("test window.setTitle")
assert_equal("test window.setTitle", glove.window.getTitle("foo"))
end
function test_setCaption()
glove.graphics.setCaption("test graphics.setCaption")
assert_equal("test graphics.setCaption", glove.graphics.g... |
require "ant"
require "collision"
require "map"
require "sprite"
require "faceStage"
require "rockStage"
require "shoeStage"
require "manStage"
-- DEFINES
local NONE = 0
local TILE_X_COUNT = 32
local TILE_Y_COUNT = 16
-- all game data
game = {}
--
function game.init(difficulty)
game.title = "[ Ant v1.1 ]"
--pri... |
--The beginnings of a localization so even everyone can read our menu
local ClickMenu, namespace = ...
local L = setmetatable({
['Achievements'] = ACHIEVEMENTS,
['Calendar'] = 'Calendar', -- no Blizz global string for this
['Character'] = CHARACTER,
['Dungeon Journal'] = ENCOUNTER_JOURNAL,
['Friends'... |
NDefines.NGraphics.COUNTRY_FLAG_TEX_MAX_SIZE = 2048
NDefines.NGraphics.COUNTRY_FLAG_SMALL_TEX_MAX_SIZE = 512
NDefines.NGraphics.COUNTRY_FLAG_STRIPE_TEX_MAX_WIDTH = 10
NDefines.NGraphics.COUNTRY_FLAG_STRIPE_TEX_MAX_HEIGHT = 8196
NDefines.NGraphics.COUNTRY_FLAG_LARGE_STRIPE_MAX_WIDTH = 41
NDefines.NGraphics.COUNTRY_FLAG_... |
function love.conf(t)
t.title = "LuaPong" -- The title of the window the game is in (string)
t.author = "Jacob Shaffer" -- The author of the game (string)
t.version = "0.9.0" -- The LÖVE version this game was made for (string)
t.screen.width = 800 -- The window width (number... |
local skynet = require "skynet"
-- 循环启动定时器
-- skynet中的定时器,其实是通过给定时器线程注册一个超时时间,并占用了一个空闲协程,
-- 空闲协程也是从协程池中获取,超时后会使用空闲协程来处理超时回调函数。
function task()
skynet.error("task", coroutine.running())
skynet.timeout(500, task)
end
-- skynet.start源码分析
-- 其实skynet.start服务启动函数实现中,就已经启动一个timeout为0s的定时器,来
-- 执行通过skynet.start函数传入参得到的初始化... |
--- @classmod Upstream
-- Abstracts how to forward traffic to upstream server.
--- @usage
--- local upstream = Upstream.new('http://example.com')
--- upstream:rewrite_request() -- set Host header to 'example.com'
--- -- store itself in `context` table for later use in balancer phase and call `ngx.exec`.
--- upstream:ca... |
require "_Utils"
local common = require "_ConvCommon"
local types = require "_ConvCommonTypes"
local convert = require "_ConvCommonConvert"
--Splits the string into a sequence of strings, based on an identifier.
--So we verify that the character just before it is not a valid identifier character
--and that th... |
add_column('characters', { 'item_ids', type = 'text', null = true })
|
-- Author Tony Beltramelli www.tonybeltramelli.com - 11/11/2015
-- Adapted from https://github.com/wojciechz/learning_to_execute and https://github.com/karpathy/char-rnn/
local UClone = {}
function UClone.cloneNetOverTime(net, time)
local clones = {}
local params, gradParams
if net.parameters then
p... |
local math2d = require('math2d')
local util = require('util')
local constants = require('constants')
local function handleMagnetRampBuilt(entity)
global.MagnetRamps[entity.unit_number] = {entity = entity, tiles = {}}
script.register_on_entity_destroyed(entity)
entity.rotatable = false
local SUCC = entity.surface.c... |
--------------------------------------
-- IO device identifier
--------------------------------------
IO_PIUMK6_IDENTIFIER = "piumk6"
--------------------------------------
-- Digital input states
--------------------------------------
-- Panels P1 (if any sensor pressed)
IO_PIUMK6_DI_P1_LU = 0
IO_PIUMK6_DI_P1_RU = 5
... |
defns = {
acc = function(arg) return 1, arg end,
nop = function() return 1, 0 end,
jmp = function(arg) return arg, 0 end,
}
function run_program(program)
local executed, ix, acc = {}, 1, 0
while true do
if executed[ix] then
return false, acc -- LOOPED
end
executed[ix] = true
local r ... |
-- https://github.com/nvim-treesitter/nvim-treesitter/
-- https://github.com/JoPro0406/nvim-ts-rainbow (my fork)
require('nvim-treesitter.configs').setup {
ensure_installed = 'maintained',
highlight = { enable = true, use_languagetree = true },
indent = { enable = true },
playground = { enable = true },
rainb... |
local Draw = require("api.Draw")
local Pos = require("api.Pos")
local Gui = require("api.Gui")
local IPaged = require("api.gui.IPaged")
local IUiList = require("api.gui.IUiList")
local UiTheme = require("api.gui.UiTheme")
local IInput = require("api.gui.IInput")
local InputHandler = require("api.gui.InputHandler")
loc... |
humbaba = Creature:new {
objectName = "@mob/creature_names:humbaba",
socialGroup = "humbaba",
faction = "",
level = 17,
chanceHit = 0.32,
damageMin = 160,
damageMax = 170,
baseXp = 1102,
baseHAM = 3500,
baseHAMmax = 4300,
armor = 0,
resists = {5,5,5,5,5,5,5,-1,-1},
meatType = "meat_domesticated",
meatAmou... |
return Def.ActorFrame{
InitCommand=function(self) self:draworder(200) end,
Def.Quad{
InitCommand=function(self) self:diffuse(0,0,0,0):FullScreen():cropbottom(1):fadebottom(0.5) end,
OffCommand=function(self) self:linear(0.3):cropbottom(-0.5):diffusealpha(1) end
},
LoadFont("_roboto condensed Bold 48px... |
--[[---------------------------------------------------------
Panel: windowsAmmoItem
-----------------------------------------------------------]]
local PANEL = {}
--[[---------------------------------------------------------
Function: canPurchase
-----------------------------------------------------------]]
... |
HedgewarsScriptLoad("/Scripts/Locale.lua")
HedgewarsScriptLoad("/Scripts/Utils.lua")
HedgewarsScriptLoad("/Scripts/Params.lua")
local hTag = nil
local hTagHeight = 33000
local tTag = nil
local rTag = nil
local startTime = 0
local MaxHeight = 32640
local RecordHeight = 33000
local RecordHeightHogName = nil
local Fire =... |
local handy = request('!.mechs.processor.handy')
local list = handy.list
local opt = handy.opt
local word = request('^.words.word')
local syntel = request('^.words.syntel')
local name = request('^.words.name')
local colon_name = request('^.wrappers.colon_name')
local function_body = request('function_body')
return
... |
function onSay(cid, words, param, channel)
local house = getHouseFromPos(getCreaturePosition(cid))
if(not house) then
doPlayerSendCancel(cid, "You are not inside a house.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
local owner = getHouseInfo(house).owner
if(owner ~= getP... |
require('plugins') -- lua/plugins.lua
require('settings') -- lua/settings.lua
require('mapping') -- lua/mapping.lua
-- require('plugin-settings') -- lua/plugin-settings.lua
require('augroup') -- lua/augroup.lua
|
---
--序列化lua table
--@module dumpToFile
--@author myc
local M = {};
local tostring = tostring
local type = type
local pairs = pairs
local ipairs = ipairs
local table_format = string.format
local string_len = string.len
local string_rep = string.rep
---数列化table 报错到文件
--@string t 表
--@string tabName 表名
--@string path... |
util.AddNetworkString("YAWD.WeaponSlotUpdate")
local update_cache = {}
hook.Add("WeaponEquip", "YAWDWeaponSelect", function( wep, ply )
if (update_cache[ply] or 0) > CurTime() then return end
if ply:HasWeapon( wep:GetClass() ) then return end
net.Start("YAWD.WeaponSlotUpdate")
net.WriteBool( true )
net.WriteS... |
AddCSLuaFile()
AddCSLuaFile("sh_sounds.lua")
include("sh_sounds.lua")
SWEP.magType = "smgMag"
SWEP.PrintName = "MP5A4"
if CLIENT then
SWEP.DrawCrosshair = false
SWEP.CSMuzzleFlashes = true
SWEP.SuppressedOnEquip = false
SWEP.IconLetter = "w"
killicon.Add( "khr_mp5a4", "icons/killicons/khr_mp5a4", Color(255, ... |
local hsl_debug = nil
if (CLIENT) then
hsl_debug = CreateClientConVar("hsl_debug", "0")
else
hsl_debug = CreateConVar("hsl_debug", "0")
end
HSLog = {}
HSLog.ulxLog = function(text)
if (istable(ulx) and isfunction(ulx.logString)) then
ulx.logString(text)
end
end
HSLog.a = function(text)
-- HSLog.LastMessage =... |
--[[ Copyright 2020 DeepMind Technologies Limited.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... |
--[[
TheNexusAvenger
Prompt for purchasing coins.
--]]
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorageProject = require(ReplicatedStorage:WaitForChild("Project"):WaitForC... |
local jid = require "util.jid";
local it = require "util.iterators";
local json = require "util.json";
local iterators = require "util.iterators";
local array = require"util.array";
local have_async = pcall(require, "util.async");
if not have_async then
module:log("error", "requires a version of Prosody with util.as... |
monitoring.wrap_global({"pipeworks", "create_fake_player"}, "pipeworks_create_fake_player")
monitoring.wrap_global({"pipeworks", "load_position"}, "pipeworks_load_position")
|
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in ... |
local sensorInfo = {
name = "isUnitAlive",
desc = "Returns whether a unit is alive or not.",
author = "Petrroll",
date = "2018-06-29",
license = "notAlicense",
}
local EVAL_PERIOD_DEFAULT = -1 -- actual, no caching
function getInfo()
return {
period = EVAL_PERIOD_DEFAULT
}
end
local SpringValidUnitID = Sp... |
local class = require "com/class"
local CrashScreen = class:derive("CrashScreen")
local Vec2 = require("src/Essentials/Vector2")
function CrashScreen:new(err)
-- error message
self.err = err
-- prepare fonts of various sizes
self.font = love.graphics.newFont()
self.fontMed = love.graphics.newFont(14)
self.fon... |
Script.Load("lua/Server.lua")
Script.Load("lua/AnyTeam/PrecursorTeam.lua")
|
function contents_or_blank(filename)
local contents = ""
local stream = io.open(filename, "rb")
if stream then
contents = stream:read("*a")
stream:close()
end
return contents
end
function shellprompt_os_getpowerinfo()
local charging = nil
local curcharge = nil
local maxcharge = nil
local MAXB... |
--
-- Expression 2 Text Editor for Garry's Mod
-- Andreas "Syranide" Svensson, me@syranide.com
--
local string_Explode = string.Explode
local table_concat = table.concat
local string_sub = string.sub
local table_remove = table.remove
local math_floor = math.floor
local math_Clamp = math.Clamp
local math_ceil = math.ce... |
-- MV Battery box
minetest.register_craft({
output = 'technic:mv_battery_box0',
recipe = {
{'technic:lv_battery_box0', 'technic:lv_battery_box0', 'technic:lv_battery_box0'},
{'technic:lv_battery_box0', 'technic:mv_transformer', 'technic:lv_battery_box0'},
{'', 'technic:mv_cable', ... |
local function make(trig_key, trig_translator)
local flag = false
local function processor(key, env)
local kAccepted = 1
local kNoop = 2
local engine = env.engine
local context = engine.context
if key:repr() == trig_key then
if context:is_composing() then
flag = true
co... |
local solution_dir = _ACTION
local lib_dir = "PathTracer/lib"
local res_dir = "PathTracer/res"
local src_dir = "PathTracer/src"
local third_party_dir = "PathTracer/third_party"
local sample_dir = "sample"
function setupIncludeDirs()
includedirs {
src_dir,
src_dir .. "/math",
src_dir .. "/primitive... |
-- map.lua
-- Map prototype and related functions;
-- A map holds data about a level - terrain data, mostly.
local Terrain = require "lua/terrain"
local Map = {}
Map.__index = Map
-- Map.new - creates a new Map object
-- width: the width of the map
-- height: the height of the map
function Map.new(width, he... |
cowwrap {
ins = { "rt/msdos/cowgol.cos" },
outs = { "$OBJ/rt/msdos/cowgol.coo" }
}
|
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
client_script 'map_blip.lua'
|
--ultra-basic physics system
--has static level geometry and a list of physics bodies which get integrated around
local physics_body = class()
function physics_body:new(args)
self.pos = args.pos or vec2()
self.vel = args.vel or vec2()
self.acc = args.acc or vec2()
self.mass = args.mass or 1
self.radius = args.ra... |
hash = {}
local formathex = '%%%02X'
function string:URLEncode()
return string.gsub( string.gsub( string.gsub( self, '\n', '\r\n' ), '([^%w ] )', function( c )
return string.format( formathex, string.byte( c ) )
end ), ' ', '+' )
end
-- MD5 modified from https://github.com/kikito/md5.lua
do
local... |
function CustomizableWeaponry.InitPostEntity()
local ply = LocalPlayer()
CustomizableWeaponry.initCWVariables(ply)
end
hook.Add("InitPostEntity", "CustomizableWeaponry.InitPostEntity", CustomizableWeaponry.InitPostEntity) |
object.say("Banana!")
|
--Resets library packages in order to make debugging easier. --TODO: Remove this!
package.loaded.helpers = nil
--Requires
local component = require("component")
local tunnel = assert(component.tunnel, "No Linked card detected")
local computer = require("computer")
local event = require("event")
local helpers =... |
--[[
Russian Localization
--]]
local ADDON = ...
local L = LibStub('AceLocale-3.0'):NewLocale(ADDON, 'ruRU')
if not L then return end
-- main
L.AddWaypoint = 'Добавить точку'
L.AskForfeit = 'Новых обновлений нет. Покинуть бой?'
L.AvailableBreeds = 'Доступные Породы'
L.Breed = 'Порода'
L.BreedExplanation = 'Определяе... |
--[[--
ui.form{
record = record, -- optional record to be used
read_only = read_only, -- set to true, if form should be read-only (no submit button)
file_upload = file_upload, -- must be set to true, if form contains file upload element
external = external, -- external URL to be used as... |
local dataLoad = dataLoad or require('../../MyCommon/dataLoad.lua')
local myUtil = myUtil or require('../../MyCommon/util.lua')
local csv = csv or require("csv")
data = {}
CData = torch.class('CData')
do
function data.priGetFilenames(strDir, isNoise, strFoldFilename)
local strFilenameKO = string.format("%s/proc... |
--[[
TheNexusAvenger
Stores information about the torso of a character.
--]]
local NexusVRCharacterModel = require(script.Parent.Parent)
local Limb = NexusVRCharacterModel:GetResource("Character.Limb")
local Settings = NexusVRCharacterModel:GetInstance("State.Settings")
local Torso = Limb:Extend()
Torso:SetClassNam... |
if not landmarks then landmarks = {} end
require "landmarks/helpers"
function landmarks.mod_init()
landmarks.log("Init landmarks mod")
-- initialize the main data structure
if not global.landmarks then
global.landmarks = {}
end
end |
--[[
ModuleName :
Path : agentmgr.lua
Author : jinlei
CreateTime : 2018-11-11 02:13:31
Description :
--]]
local skynet = require "skynet"
local sproto_helper = require "common.utils.sproto_helper"
local skynet_helper = require "common.utils.skynet_helper"
dofile("lualib/common/base/preload.lua")
MAIN = import("lualib/... |
local redis = {}
local resty_redis = require "resty.redis"
local keepalive = 10000 -- 10 seconds
local pool_size = 100
local timeout = 1000 -- 1 second
redis.connect = function()
if ngx.ctx.redis then return ngx.ctx.redis end
local red = resty_redis:new()
red:set_timeout(timeout)
local ok, err = red:conn... |
local cjson = require "cjson"
local _M = {}
--[[
cjsonPFTable 序列化标准的数据集合,即数据父子的主要数据是一致的,存放在一张表中的情形如地区包含地区
temp 数据库返回的集合
idName 主键
fid 外键
]]--
function _M.cjsonPFTable(srcTable,idName,fidName)
local len = table.getn(srcTable);
local tempSet={};
-- 1 生成类hash表结构 id_name 不可以为null 否则连接成字符时会产生异常
for i=1,len,1 do
loc... |
local GSE = GSE
local Statics = GSE.Static
local Sequences = Statics.SampleMacros[3]
------------------
----- Hunter
------------------
-- Beast Mastery 253
-- Survival 255
-- Marksmanship - 254
Sequences['SAM_BMsingle'] = {
SpecID = 253,
Author = "Jimmy Boy Albrecht",
Talents = "3,1,1,1,3,2,3... |
if mods["Aircraft"] then
data:extend({
{
type = "double-setting",
name = "aircraft-takeoff-speed-gunship",
setting_type = "runtime-global",
minimum_value = 0,
default_value = 130,
order="ata"
},
{
type = "dou... |
--[[
@ filename : random.lua
@ author : zhangshiqian1214@163.com
@ modify : 2017-08-23 17:53
@ company : zhangshiqian1214
]]
local skynet = require "skynet"
local mt19937 = require "mt19937"
local random = {}
local random_type = tonumber(skynet.getenv("random_type"))
local __randomseed = os.time() + skynet.... |
function MasterMerchant.InitDealFilterClass()
local AGS = AwesomeGuildStore
local FilterBase = AGS.class.FilterBase
local ValueRangeFilterBase = AGS.class.ValueRangeFilterBase
local FILTER_ID = AGS:GetFilterIds()
local DealFilter = ValueRangeFilterBase:Subclass()
MasterMerchant.DealFilter = DealFilter
funct... |
-- Class and utility functions for C# project files (*.csproj)
-- Copyright 2012,2013 Green Code LLC
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the Lic... |
local g = vim.g
g.auto_save = 1
g.auto_save_silent = 1
g.auto_save_write_all_buffers = 1
g.auto_save_presave_hook = 'lua require("vimrc.plugins.vim-auto-save").abort_files()'
local abort_buf_named = function(bufname)
-- Files named 'PopList #XX' from the https://github.com/RishabhRD/popfix repo
local sep = packa... |
local schemas = require "kong.dao.schemas_validation"
local validate_entity = schemas.validate_entity
local schema = require "kong.plugins.json-threat-protection.schema"
describe("JSON Threat Protection schema", function()
it("should work when no configuration has been set", function()
local config = {}
... |
---@meta
---@class ccs.ActionRotationFrame :ccs.ActionFrame
local ActionRotationFrame={ }
ccs.ActionRotationFrame=ActionRotationFrame
---* Changes rotate action rotation.<br>
---* param rotation rotate action rotation.
---@param rotation float
---@return self
function ActionRotationFrame:setRotation (rotation) end... |
local app = app
local libcore = require "core.libcore"
local Class = require "Base.Class"
local Unit = require "Unit"
local GainBias = require "Unit.ViewControl.GainBias"
local Encoder = require "Encoder"
local Velvet = Class {}
Velvet:include(Unit)
function Velvet:init(args)
args.title = "Velvet Noise"
args.mnem... |
-- Auto-hit notes?
--autoplay = false;
require("x_functions");
x_requires(4);
function pointer(addr)
point = memory.readbyte(addr) + memory.readbyte(addr + 1) * 0x0100;
return point;
end;
channels = {};
channels[0] = {};
channels[1] = {};
channels[2] = {};
channels[3] = {};
oldval = {};
oldval = {};
power... |
-- test7_2.lua
local skynet = require "skynet"
require "skynet.manager"
skynet.start(function ()
local r = skynet.send(".ser","lua" , "这是未打包消息。", "消息内容:一首交货")
skynet.error("发送完毕1" , r)
local packedmsg, sz = skynet.pack("打包消息", "消息内容,一手交钱")
local r = skynet.rawsend(".ser","lua",packedmsg, sz)
skyne... |
-- This software is copyright Kong Inc. and its licensors.
-- Use of the software is subject to the agreement between your organization
-- and Kong Inc. If there is no such agreement, use is governed by and
-- subject to the terms of the Kong Master Software License Agreement found
-- at https://konghq.com/enterpriseso... |
-- Created by Elfansoer
--[[
Ability checklist (erase if done/checked):
- Scepter Upgrade
- Break behavior
- Linken/Reflect behavior
- Spell Immune/Invulnerable/Invisible behavior
- Illusion behavior
- Stolen behavior
]]
--------------------------------------------------------------------------------
leshrac_pulse_nova... |
-- VOIP script by Asser90
-- Manifest
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
-- General
client_script 'cl_voip.lua'
server_script 'sv_voip.lua' |
-- Fichier de config du jeu
function love.conf(t)
t.title = "THE GAME"
t.version = "0.10.2"
t.window.width = 1280
t.window.height = 720
t.vsync = true
end |
NATIVE_KEYS = {
["NEXT_CAMERA"] = 0,
["LOOK_LR"] = 1,
["LOOK_UD"] = 2,
["LOOK_UP_ONLY"] = 3,
["LOOK_DOWN_ONLY"] = 4,
["LOOK_LEFT_ONLY"] ... |
-- import
local Viewport = require 'candy.Viewport'
local RenderTargetModule = require 'candy.RenderTarget'
local RenderTarget = RenderTargetModule.RenderTarget
local TextureRenderTarget = RenderTargetModule.TextureRenderTarget
local RenderManagerModule = require 'candy.RenderManager'
local RenderContextModule = requir... |
local park5 = scene:getObjects("park5_ph")[1]:findPlaceholderComponent();
local tentacle14 = scene:getObjects("tentacle14");
local tentacle14weld = weldTentacleBones(tentacle14, {3, 6, 9}, 2.5, 0.5);
local control1 = scene:getObjects("control1_ph")[1]:findPlaceholderComponent();
local control2 = scene:getObjects("contr... |
-- internal argparse test
test_run = require('test_run').new()
test_run:cmd("push filter ".."'\\.lua.*:[0-9]+: ' to '.lua:<line>\"]: '")
argparse = require('internal.argparse').parse
-- test with empty arguments and options
argparse()
-- test with command name (should be excluded)
argparse({[0] = 'tarantoolctl', 'sta... |
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by 干冲.
--- DateTime: 2018/3/22 16:10
---
--引入全局表定义
require(ModulePath.GlobalDefine)
--引入lua Class
require(ModulePath.DefinitionClass)
--引入UI管理器
require(ModulePath.UIManager)
--引入背景管理器
require(ModulePath.BackGroundManager)
--引入lua APP
require(ModulePat... |
-- This file is subject to copyright - contact swampservers@gmail.com for more information.
-- INSTALL: CINEMA
function GetMapPropTable()
local arcadeanglernd = 3
local arcadexposrnd = 4
local arcadeyposrnd = 4
math.randomseed(1337)
local stuff = {
{
class = "gmt_instrument_pia... |
function onCreate()
--precache
--dad
addCharacterToList('green-guitar', 'dad');
end
|
-----------------------------------
-- Area: Bastok Mines
-- NPC: Phara
-- Starts and Finishes Quest: The doorman (start)
-- Involved in Quest: The Talekeeper's Truth
-- !zone 234
-- !pos 75 0 -80
-----------------------------------
require("scripts/globals/status")
require("scripts/globals/settings")
require("scripts... |
-- Rigid body transform class based on CPML
-- Assumes PL, CPML in namespace
-- IMPORTS ALL ON REQUIRE
namespace "standard"
local plMetatable = {__tostring = function(o) return o:to_string() end}
class.Loc(nil, nil, plMetatable)
function Loc:_init(at, rotate, scale) -- Warning treat contents as const
self.at = at or... |
-- Richards' benchmark
-- Derived from C version
local COUNT = 10000
local QPKTCOUNT = 23246
local HOLDCOUNT = 9297
local MAXINT = 32767
local I_IDLE = 1
local I_WORK = 2
local I_HANDLERA = 3
local I_HANDLERB = 4
local I_DEVA = 5
local I_DEVB = 6
local BUFSIZE = 4
local layout = 0
local tasktab = {}
local tasklist
lo... |
local assert, type = assert, type
local buf_read = require 'buffer'.read
local BaseType = {
None = 0,
UType = 1,
Bool = 2,
Byte = 3,
UByte = 4,
Short = 5,
UShort = 6,
Int = 7,
UInt = 8,
Long = 9,
ULong = 10,
Float = 11,
Double = 12,
String = 13... |
local PRIVATE_SLOTS_COUNT = 1
local serialsList = {}
local function reloadSerials()
serialsList = {}
local file = fileOpen("serials.json")
if not file then
return false
end
local data = file:read(file.size)
file:close()
if not data then
return false
end
serialsList = fromJSON(data)
if type(serialsList) ... |
local L = LibStub("AceLocale-3.0"):NewLocale("CopyAnything", "zhCN")
if not L then return end
--@localization(locale="zhCN", handle-unlocalized="comment")@
|
require "import"
import "glob"
name=...
packinfo = pm.getPackageInfo(name, 64)
function onResume()
if pcall(function ()
--权限
per=pm.getPackageInfo(name,PackageManager.GET_PERMISSIONS).requestedPermissions
perm_adp=LuaAdapter(activity,{},{
TextView,
id="p",
padding="3.5%w",
textSize="16sp",
layout_width="fill",
textCo... |
-- Monkeypatch to support socket activation
--
-- Requires LuaSocket after "agnostic" changes merged
--
-- To enable:
-- RunScript "socket-activation.lua"
local socket = require"socket";
local tcp_serv_mt = debug.getregistry()["tcp{server}"];
local socket_bind = socket.bind;
local SD_LISTEN_FDS_START = 3;
local fds ... |
local t = require( "taptest" )
local collectv = require( "collectv" )
local like = require( "like" )
src = { a="x", b="y", c="z" }
values = collectv( pairs( src ) )
t( like( values, { "x", "y", "z" } ), true )
t()
|
local PlayerData = {}
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
PlayerData = xPlayer
end)
RegisterNetEven... |
object_static_particle_pt_fog_kashyyyk_hracca = object_static_particle_shared_pt_fog_kashyyyk_hracca:new {
}
ObjectTemplates:addTemplate(object_static_particle_pt_fog_kashyyyk_hracca, "object/static/particle/pt_fog_kashyyyk_hracca.iff")
|
local flux = require "libs.flux"
local class = require "libs.middleclass"
local input = require "input"
local r = require "resources"
local w = love.graphics.getWidth()
local h = love.graphics.getHeight()
local height = r.fonts.main:getHeight() * 3
local text = {r.colors.speaker1, "Пауза\n", r.colors.speaker2, "[es... |
require("moonsc").import_tags()
-- in the ECMA data model, test that processor creates correct structure in
-- _event.data when receiving KVPs in an event
return _scxml{ initial="s0", datamodel="lua",
_state{ id="s0",
_onentry{
_send{ event="foo", _param{ name="aParam", expr="1" }},
},
... |
local find_nginx, start_nginx, write_config_for, get_pid
do
local _obj_0 = require("lapis.cmd.nginx")
find_nginx, start_nginx, write_config_for, get_pid = _obj_0.find_nginx, _obj_0.start_nginx, _obj_0.write_config_for, _obj_0.get_pid
end
return {
new = function(self, flags)
local config_path, config_path_etlu... |
require("logic.computer")
table.insert(computer.apis,{
name = "wlan",
description = "The WLAN API provides functions to communicate using wirless network",
entities = nil,
events = {
on_message = function(self, event_name, ...)
local handlers = self._events[event_name]
... |
dofile("uHUD/uhud.lua")
dofile("sidebar.lua")
local os = require("os")
local keyboard = require("keyboard")
local event = require("event")
local math = require("math")
local computer = require("computer")
local component = require("component")
local myHUD = HUD:new("openperipheral_bridge")
local myStats = Sidebar:new... |
ffi = require("ffi");
ffi.cdef[[
/*
* Summary: implementation of XML Schema Datatypes
* Description: module providing the XML Schema Datatypes implementation
* both definition and validity checking
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
typedef enu... |
local Symbol = require(script.Parent.Parent.Parent.Symbol)
local Children = Symbol("Children")
return Children
|
V4nder.TableContainsItem = function (items, table, ignoreCase)
items = items or {}
table = table or {}
ignoreCase = ignoreCase or false
if (string.lower(type(items)) ~= 'table' or
string.lower(type(table)) ~= 'table') then
return false
end
if (#items <= 0 or #table <=... |
--[[============================================================
--=
--= LuaPreprocess example: Selective functionality.
--=
--= Here we decide what code should be included and run in the
--= final program with some flags set in the metaprogram.
--=
--============================================================]]
q... |
return {
router = require('vshard.router'),
storage = require('vshard.storage'),
consts = require('vshard.consts'),
error = require('vshard.error'),
}
|
function update()
if projectile.sourceEntity() and world.entityExists(projectile.sourceEntity()) then
-- projectile.die()
-- sb.logInfo(tostring(project.sourceEntity()))
end
if projectile.collision() then
sb.logInfo("portalblue|update: collided")
projectile.die()
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.