content stringlengths 5 1.05M |
|---|
local EventManager = {}
EventManager.__index = EventManager
function EventManager.new()
local eventManager = setmetatable({
listeners = {},
}, EventManager)
return eventManager
end
function EventManager:emit(name, ...)
local listeners = self.listeners[name]
if listeners then
for i = 1, #l... |
object_tangible_collection_deathtrooper_beta_medical_kit_01 = object_tangible_collection_shared_deathtrooper_beta_medical_kit_01:new {
gameObjectType = 8211,}
ObjectTemplates:addTemplate(object_tangible_collection_deathtrooper_beta_medical_kit_01, "object/tangible/collection/deathtrooper_beta_medical_kit_01.iff") |
return {
tag = 'callbacks',
summary = 'Called when a permission request is answered.',
description = [[
This callback contains a permission response previously requested with
`lovr.system.requestPermission`. The callback contains information on whether permission was
granted or denied.
]],
argume... |
if not modules then modules = { } end modules ['math-dir'] = {
version = 1.001,
comment = "companion to typo-dir.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-- As I'm wrapping up t... |
local method = {}
local function init(name)
method[name] = require('method.' .. name:gsub('/', '.'))
end
init 'exit'
init 'initialize'
init 'initialized'
init 'shutdown'
init 'completionItem/resolve'
init 'textDocument/codeAction'
init 'textDocument/completion'
init 'textDocument/definition'
init 't... |
module("luci.controller.sysuh3c", package.seeall)
function index()
entry({"admin", "network", "sysuh3c"}, cbi("sysuh3c"), _("SYSU H3C Client"), 100).acl_depends = { "luci-app-sysuh3c" }
end
|
--Copyright (C) 2009 <SWGEmu>
--This File is part of Core3.
--This program 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 of the License,
--or (at your option) any later version.
... |
--------------------------------
-- @module MWSystemHelper
-- @parent_module mw
--------------------------------
-- Get the current net status.
-- @function [parent=#MWSystemHelper] checkNetStatus
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
-- Get the current m... |
WoWMap.MapData.Overrides={
[36]={uselanguage="eneu"}, -- world_7_03_enoh_island
[37]={uselanguage="eneu"}, -- world_7_04_vort_island
[38]={uselanguage="eneu"}, -- world_7_05_zacehs_island
[182]={uselanguage="cn"}, -- dgn_frostsaber_upland
[185]={uselanguage="eneu"}, -- dgn_solarmuse_alter
[188]={uselanguage... |
GameEngine = Object:extend()
local sound
local text = {}
local chunks = 27
local leftScore = 0
local rightScore = 0
function GameEngine:new()
self.ball = Ball("left")
self.player1 = Pad("left")
self.player2 = Pad("right")
text.size = 55
text.font = love.graphics.newFont("font/ca.ttf", text.size)
sound =... |
shops = {
{ id = 1,565.40625, -1291.09, 17.2, 0, 0, 30, 0, 0 },
{ id = 1,559.40625, -1291.09, 17.2, 0, 0, 30, 0, 0 },
{ id = 1,553.40625, -1291.09, 17.2, 0, 0, 30, 0, 0 },
{ id = 1,547.40625, -1291.09, 17.2, 0, 0, 30, 0, 0 },
{ id = 1,541.40625, -1291.09, 17.2, 0, 0, 30, 0, 0 },
{ id = 1,535.40625, -1291.09,... |
-------------------------------------------------------------------------------
-- Forwards logging information to the Nginx log
--
-- @author Thijs Schreijer
--
-- @copyright 2004-2021 Kepler Project
--
-------------------------------------------------------------------------------
local logging = require "logging"
l... |
cols = 4
rows = 3
lens_width = cols
lens_height = rows
max_fov = 360
max_vfov = 180
onload = "f_contain"
function col(x)
local nx = x+cols/2
local i,f = math.modf(nx)
if nx < 0 then
return i-1, f+1
end
return i,f
end
function row(y)
local ny = -y+rows/2
local i,f = math.modf(ny)
if ny... |
-- mdotengine - main file
require("Settings")
require("Utilities")
Parser = require("Parser")
Parser:LoadFile("lib/level/env_test.html")
-- local variables
local Setup = require("Setup")
function love.load()
love.filesystem.setIdentity("screenshot_example")
end
function love.draw()
Setup.Draw()
end
function love... |
--[[
Copyright (c) 2015 Netforce Co. Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, d... |
--[[
A library to handle ingame resources, as provided by the Radsources XMLs. It will look for the files in Windower/plugins/resources.
]]
_libs = _libs or {}
_libs.resources = true
_libs.functions = _libs.functions or require('functions')
_libs.tables = _libs.tables or require('tables')
_libs.strings = _libs.strings... |
-- NOTICE --
-- This script does NOT replace Person299's Admin Commands. This plugin is a seperate script!
-- So, leave Person299's Admin Commands alone, and add this script into Workspace. That's all!
-- Made by CrazyBananaMonkey
admins = {"CrazyBananaMonkey", "jjphariss", "Your Friend"} -- Put in whoever you'd l... |
local enumerable = {}
local enumerator_cache = setmetatable({}, {__mode = 'k'})
local add_fn = function(x, y)
return x + y
end
local min_fn = function(x, y)
return x < y and x or y
end
local max_fn = function(x, y)
return x > y and x or y
end
enumerable.enumerate = function(t)
local iterator, table, ... |
local handlers = require('jg.actions.handlers')
local M = {}
local l = {}
-- Options:
-- TODO: natural sort
-- TODO: reverse sort
function M.setup(key, opts)
handlers.map(key, function(str)
local lines = vim.fn.split(str, '\n')
if #lines == 1 then
return l.sort_line(lines[1], opts)
end
retu... |
local two_d = {
pivot = function(tbl)
local r = {}
for x,c in ipairs(tbl) do for y,p in ipairs(c) do
if not r[y] then r[y] = {} end r[y][x] = p end
end
return r
end,
shuffle = function(tbl, times)
local len = #tbl
for i=1,times do
local... |
vim.cmd'autocmd BufEnter *.org ++once packadd org.vim | set filetype=org'
|
function DIALOG()
NODE(0)
SAY("Hi Shorty!")
ANSWER("You`re cool. What you doing here?",1)
NODE(1)
SAY("In my job you have to be cool, Shorty. I do 'contracts' for cash..")
ANSWER("Contracts?.......ah yes 'contracts'. Hehehe.",2)
NODE(2)
... |
function receive(prod)
local status, value = coroutine.resume(prod)
return value
end
function send(x)
coroutine.yield(x)
end
function producer()
return coroutine.create(function ()
while true do
local x = io.read()
send(x)
end
end)
end
function filter(prod)
return coroutine.create(function ()
for l... |
io.write("#define IDS_WSAPI 1\r\n")
io.write("STRINGTABLE\r\nBEGIN\r\n")
io.write("IDS_WSAPI \"")
for line in io.lines((...)) do
if not line:match("^#!") then
line = line:gsub("\\", "\\\\"):gsub('"', '""'):gsub("[\r\n]+", "")
io.write(line .. "\\n\\\r\n")
end
end
io.write("\"\r\nEND\r\n")
|
:Entry
local server_id = rednet.Lookup("CNC", "CNC_SVR")
if server_id then
print("Found Server: " + tostring(server_id))
print("Awaiting Server Reponse...")
sendID, msg, proto = rednet.receive()
print(msg)
goto :MessageHandling
else
print("Failed to connect to the remote host.")
goto :Entry
end
:Mess... |
require 'mock.common.portal.ScenePortalGraph'
require 'mock.common.portal.ScenePortalRegistry'
require 'mock.common.portal.ScenePortalManager'
require 'mock.common.portal.ScenePortal'
|
hook.Add("HUDPaint", "se_draw_hud", function()
if !se_ship then return end
surface.SetDrawColor( 0, 0, 255, 1.5 * (100 - se_ship.oxygen) )
surface.DrawRect( 0, 0, ScrW(), ScrH() )
end)
|
--author by shangyindong
local httputils = {}
local res = require("com.sdw.utils.response")
local response = res.new();
local request_method = ngx.var.request_method
local httpStatus = {}
httpStatus["SC_OK"] = {["code"]=200,["msg"]="success"}
httpStatus["SC_BAD_REQUEST"] = {["code"]=400,["msg"]="Bad Request"}
httpStatu... |
-- urThumper
-- Concept by: Colin Zyskowski
-- Initial Hack by: Georg Essl 11/19/09
local function Shutdown()
dac:RemovePullLink(0, utSinOscA1, 0)
dac:RemovePullLink(0, utSinOscB1, 0)
end
local function ReInit(self)
dac:SetPullLink(0, utSinOscA1, 0)
dac:SetPullLink(0, utSinOscB1, 0)
end
thumperbackdropregion=Reg... |
-- =============================================================
-- Copyright Roaming Gamer, LLC. 2008-2018 (All Rights Reserved)
-- =============================================================
--[[
ssk.ripper.vertical( nil, display.contentCenterX - 200, display.contentCenterY - 150, "images/cave.png",
{ w = 30... |
hs.hotkey.alertDuration = 0
hs.hints.showTitleThresh = 0
hs.window.animationDuration = 0
-- Use the standardized config location, if present
custom_config = hs.fs.pathToAbsolute(os.getenv("HOME") .. '/.config/hammerspoon/private/config.lua')
if custom_config then
print("Loading custom config")
dofile( os.geten... |
require 'torch'
local mytester = torch.Tester()
local jac
local precision = 1e-5
local expprecision = 1e-4
local nntest = {}
local nntestx = {}
function nntest.Add()
local ini = math.random(10,20)
local inj = math.random(10,20)
local ink = math.random(10,20)
local input = torch.Tensor(ini,inj,ink):zero(... |
term.setBackgroundColor(colors.black)
term.setTextColor(colors.white)
term.setCursorBlink(true)
print("System halted")
function _G.os.pullEventRaw()
while true do
coroutine.yield("haltSystem")
end
end
_G.os.pullEvent = os.pullEventRaw
|
--セイヴァー・アブソープション
--scripted by Xylen5967
function c101105207.initial_effect(c)
aux.AddCodeList(c,44508094)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101105207+EFFECT_COUNT_CODE_OATH)
e1:Set... |
padawan_artist_01_conv_handler = conv_handler:new {}
function padawan_artist_01_conv_handler:getInitialScreen(pPlayer, pNpc, pConvTemplate)
local convoTemplate = LuaConversationTemplate(pConvTemplate)
local trialOwnerID = readData(SceneObject(pNpc):getObjectID() .. ":ownerID")
local playerID = SceneObject(pPlayer):... |
print "Inside derp.lua"
function derpLua()
print "DERPLUA YAY!"
end
|
--[[
This file is a general memory stream interface.
Octetstream serves up 8-bit bytes, one at a time
with a readOctet() function. You can also read
multiple octets at once with readBytes().
]]
local ffi = require("ffi")
local bit = require("bit")
local min = math.min
--[[
Standard 'object... |
function Container:PlayerUse(player, entity)
local cur_time = CurTime()
if !player.next_cont_use or player.next_cont_use <= cur_time then
local container_data = Container:all()[entity:GetModel()]
if container_data and entity:GetClass() == 'prop_physics' then
container_data.w = container_data.w or 4
... |
local global_data = {}
function global_data.init()
global_data.build_translations()
global.flags = {
iterating_ltn_data = false,
updating_guis = false
}
global.players = {}
end
function global_data.build_translations()
local translation_data = {
-- train status
{dictionary="gui", internal="d... |
include("shared.lua")
function ENT:Initialize()
end
function ENT:Draw()
self:DrawModel()
local name = self:GetDTName()
local alpha = self:DistanceToAlpha(1)
if alpha > 0 then
local ang = Angle(0, RealTime() * 80, 0)
local pos = self:GetPos() + ang:Up()
ang:RotateAroundAxis( ang:Forward(), 90 )
ang:RotateArou... |
local __DataStorages = {}
local __IDataStorages = {}
local function path(is_mod_path)
local path = is_mod_path == true and creox.mod_path(creox.mod_name()) or creox.world_path()
return is_mod_path == false and path .. "/creox/core/datastore/" or path .. "/datastore/"
end
if IE then
minetest.mkdir(path(fal... |
require "ido"
local api = vim.api
local fn = vim.fn
local directory_name
-- Set the prompt -{{{
local function ido_browser_set_prompt()
-- This is an action used more than once, so I decided to abstract it out into a function.
ido_prompt = string.format("Browse (%s): ",
string.gsub(fn.resolve(directory_name), '... |
-- HintManager.lua
cc.exports.HintManager = class()
function HintManager.getInstance()
if not HintManager.s_instance then
HintManager.s_instance = HintManager.new()
end
return HintManager.s_instance
end
function HintManager.ctor(self)
self.m_queue = {}
self.m_size = 0
self.m_preTime = 0
self.m_... |
local socket = require "socket"
local hash = require "hash"
local cipher = require "cipher"
local json = require "cjson"
local assert = assert
local type = type
local error = error
local floor = math.floor
local spack = string.pack
local sunpack = string.unpack
local schar = string.char
local srep = string.rep
local ... |
local player = {
displayGroup = nil,
shadowGroup = nil,
}
local typesMap = require("playerTypesMap")
local player_mt = {__index=player}
function player.new( type,x,y )
local newPlayer = { -- model of player
type = type,
x = x,
y = y,
vx = 200,
vy = -250,
height = nil,
width = nil,
dir = nil,
spr... |
import "Turbine.UI";
ListItem = class( Turbine.UI.Control );
-- Essa classe existe para registar cada item na lista do main panel do Plugin
function ListItem:Constructor( item )
Turbine.UI.Control.Constructor( self );
self:SetBlendMode( Turbine.UI.BlendMode.Overlay );
self.item = item;
self.item.Started = fun... |
--[[
This file is part of 'Masque', an add-on for World of Warcraft. For license information,
please see the included License.txt file.
* File...: Skins\Blizzard.lua
* Author.: StormFX, Maul, Blizzard Entertainment
]]
local _, Core = ...
-- Improved Blizzard skin. Thanks, Maul!
Core:AddSkin("Blizzar... |
object_building_general_brood_10_cave = object_building_general_shared_brood_10_cave:new {
}
ObjectTemplates:addTemplate(object_building_general_brood_10_cave, "object/building/general/brood_10_cave.iff")
|
-- Copyright (c) 2016 John Schember <john@nachtimwald.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining
-- a copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitation
-- the rights to use, copy, ... |
jumpdrive.preflight_check = function(source, destination, radius, playername)
local has_landing_priv = minetest.check_player_privs(playername, {jumpdrive_land=true})
-- check for height limit, only space travel allowed
if destination.y > -20 and destination.y < 100 and not has_landing_priv then
return { success=f... |
function plugindef()
finaleplugin.Author = "Jari Williamsson then altered by Joseph Weidinger"
finaleplugin.Version = "1.0"
finaleplugin.Date = "May 03, 2015"
finaleplugin.RequireSelection = true
finaleplugin.CategoryTags = "increase measure width"
return "Measure Width - Increase", "Measure Wid... |
local EnableNodeTouch = {}
function EnableNodeTouch.enable(node,began,moved,ended,Swallow)
local function onTouchBegin(location)
local pos = location:getLocation()
return began(pos)
end
local function onTouchMove(location)
local pos = location:getLocation()
moved(pos)
end
local... |
return function(player, coins)
return {
type = script.Name,
player = player,
coins = coins,
replicateTo = player,
}
end |
-- Autogenerated from KST: please remove this line if doing any edits by hand!
local luaunit = require("luaunit")
require("valid_fail_range_float")
TestValidFailRangeFloat = {}
function TestValidFailRangeFloat:test_valid_fail_range_float()
luaunit.assertErrorMsgMatches(".+: ValidationGreaterThanError", ValidFai... |
local BI = BI_Config
--[[---------------------------------------------------------------------------
------------------------------------- Credits ---------------------------------
-------------------------------------------------------------------------------
drs9999 - Treefarm Mod
SpeedDaemon - Greenhouse Mod
... |
-- hcas - hash compare and set
-- hcas [hash, field] [assert_value, set_value]
local res = redis.call('HGET', KEYS[1], KEYS[2])
if res == ARGV[1] then
redis.call('HSET', KEYS[1], KEYS[2], ARGV[2])
return {1, ARGV[2]}
else
return {0, res}
end |
require("curses");
curses.initscr();
curses.start_color();
curses.init_pair(1, curses.COLOR_BLUE, curses.COLOR_YELLOW);
curses.init_pair(2, curses.COLOR_CYAN, curses.COLOR_RED);
for i = 1, 2 do
local r, f, b = curses.pair_content(i);
curses.attrset(curses.COLOR_PAIR(i));
curses.addstr(f .. ", " .. b .. ... |
---
-- @author wesen
-- @copyright 2020 wesen <wesen-ac@web.de>
-- @release 0.1
-- @license MIT
--
local LuaServerApi = require "AC-LuaServer.Core.LuaServerApi"
local Object = require "classic"
local Timer = require "AC-LuaServer.Core.Util.Timer"
---
-- Manages respawning items (pickups) for a single Player.
--
-- @t... |
if type(jit) ~= 'table' or lovr.system.getOS() == 'Android' then return false end -- Added from original
local ffi = require 'ffi'
local C = ffi.os == 'Windows' and ffi.load('glfw3') or ffi.C
ffi.cdef [[
typedef struct GLFWwindow GLFWwindow;
typedef void(*GLFWkeyfun)(GLFWwindow*, int, int, int, int);
typedef vo... |
Target = {
x = 0,
y = 0,
width = 32,
height = 32,
dead = false
}
function Target:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function Target:get_center()
return self.x + self.width / 2, self.y + self.height / 2
end
|
local Types = require(script.Parent.Parent.Types)
type Record<K, V> = Types.Record<K, V>
local function map<K, V>(source: Record<K, V>, func: (V, K, Record<K, V>) -> any): Record<K, any>
local result = table.create(#source)
for key, value in source do
result[key] = func(value, key, source)
end
return result
e... |
-- (c) 2013 Flexiant Ltd
-- Released under the Apache 2.0 Licence - see LICENCE for details
function mailchimp_activation_trigger(p)
if(p == nil) then
return {
ref = "mailchimp_customer_activation_trigger",
name = "MailChimp customer activation trigger",
description = "MailChimp add cutomer to mailing list... |
pacx = pacx or {}
include("pac3/extra/shared/init.lua")
include("contraption.lua")
include("pac2_compat.lua")
include("wire_expression_extension.lua")
pac.AddHook("NetworkEntityCreated", "player_size", function(ply)
if not ply:IsPlayer() then return end
if ply.pac_player_size then
pacx.SetPlayerSize(ply,ply.pac... |
return require('packer').startup(function()
-- Packer can manage itself
use 'wbthomason/packer.nvim'
use 'tpope/vim-fugitive'
-- For luasnip users.
use 'L3MON4D3/LuaSnip'
use 'saadparwaiz1/cmp_luasnip'
-- nvim cmp sources
use 'neovim/nvim-lspconfig'
use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/cmp-buff... |
local t = LoadFallbackB();
t[#t+1] = Def.ActorFrame {
--[[ LoadActor( "more" )..{
InitCommand=cmd(x,SCREEN_CENTER_X-320+580;y,SCREEN_CENTER_Y-240+90);
OnCommand=cmd(addx,SCREEN_WIDTH/2;linear,0.2;addx,-SCREEN_WIDTH/2);
OffCommand=cmd(linear,0.3;zoom,0;addx,SCREEN_WIDTH/2);
};]]
LoadFont("Common", "normal")..... |
-- Copyright 2004-present Facebook. All Rights Reserved.
-- Main function to load and train -- some globals remain.
-- @lint-skip-luachecker
-----------------------------------------------------
-- Arguments:
-- 1) Name of file which contains options.
local optFile = arg[1]
local opt
require('torch')
if optFile ~= nil... |
function onCreate()
--Iterate over all notes
for i = 0, getProperty('unspawnNotes.length')-1 do
if getPropertyFromGroup('unspawnNotes', i, 'noteType') == 'Blood Note' then
setPropertyFromGroup('unspawnNotes', i, 'texture', 'BloodNotes_assets');
setPropertyFromGroup('unspawnNotes', i, 'hitHealth', '0');
... |
-- Definition of the WalkArea class.
local Object = require "lib/classic"
local Vector2D = require "lib/vector2d"
local AStar = require "engine/pathfinding/astar"
local Polygon = require "engine/pathfinding/polygon"
local Graph = require "engine/pathfinding/graph"
local GraphNode = require "engine/pathfinding/graphnod... |
dofile(chinBaseDir.."chin_GlobalFunctions/chin_globalfs_getscriptpath.lua")
dofile(chinBaseDir.."chin_GlobalFunctions/chin_globalfs_filepathtofolder.lua")
dofile(chinBaseDir.."chin_GlobalFunctions/chin_globalfs_filepathtofilename.lua")
dofile(chinBaseDir.."chin_GlobalFunctions/chin_globalfs_getstringpixelwidth.lua")
do... |
local file = require("libraries.file")
local docpath = "./docs/"
gendocs = function(path)
local list = file.ls(path)
list:gsub("[^\n]",function(str)
local newdoc = ""
fstr = path..istr
if file.exists(fstr) then
contents = file.read(fstr)
contents:gsub("[^\n]",fun... |
-- Copyright (c) 2016 dy008
-- https://github.com/dy008/NodeMcuForLEWEI50Test
--
wifi.sta.config("dy-home","miqihome008")
gpio.write(0, gpio.LOW) -- VFD ON
gpio.mode(0, gpio.OUTPUT)
gpio.mode(7, gpio.INT) -- 感应输入
print("Connecteing To wifi...")
enduser_setup.start(
function()
print("Connected to wifi as:"... |
local TableUtils = require('utils.class')
local Vector2 = require('geometry.vector2')
local Seek = require('steering.seek')
--- Implements the pursue behaviour algorithm.
local Pursue = TableUtils.class(Seek)
--- Initialises Pursue class instances.
function Pursue:init(target, max_prediction)
Seek.init(s... |
-- Project: Attack on Pirate
-- SDK: CoronaSDK
--
-- Author: Darren Poon
-- email : dyhpoon@gmail.com
---------------------------------------------------------------------------------
display.setStatusBar( display.HiddenStatusBar )
local storyboard = require "storyboard"
storyboard.purgeOnSceneChange = true
-------... |
local match_hall_detail_select_list_item_layout = require(ViewPath.."hall/matchHall/widget/match_hall_detail_select_list_item_layout");
local GameMatchHallDetailSelectListItem = class(CommonGameLayer, false)
GameMatchHallDetailSelectListItem.s_controls = {
bg = 1,
line = 2,
count = 3,
directio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.