content stringlengths 5 1.05M |
|---|
local bounds = require "lib.bounds"
local vector = require "lib.vector"
local entities = {}
function entities.getBounds (entity)
if not ((entity.minimum or entity.position) and entity.size) then
return nil
else
local min = entity.minimum or (entity.position - (entity.origin or vector.zero()))
loc... |
memory = {}
function memory.initRam()
for address = 0, 0x007FF do
memory[address] = 0x0
end
end
function memory.get(address)
local controller1ReadTimes = 0
local controller2ReadTimes = 0
local byte = 0x0
::getaddress::
if address < 0x0800 then
byte = ram[address]
elseif address < 0x1000... |
local forest = {
seed=603020305,
mapcolor = "darkgreen",
minPercent = 10,
maxPercent = 100,
symbol = "f",
neighborBioms= {
"g"
}
}
function forest:createWorld()
end
function forest:getBiomChance(map,point)
local range = 100
biomCount = {}
-- < >
local sidx = point[1]-range/2
for iy = 1, p... |
local Classifier, parent = torch.class('nn.SpatialClassifier', 'nn.Module')
function Classifier:__init(classifier)
parent.__init(self)
-- public:
self.classifier = classifier or nn.Sequential()
self.spatialOutput = true
-- private:
self.inputF = torch.Tensor()
self.inputT = torch.Tensor()
self.... |
-- luacheck: push ignore 211 (unused variable)
--local api = vim.api
-- TODO(elpiloto): make debug level based on sidekick option.
--local log = require('plenary.log').new({ plugin = 'prompts.nvim', level='debug' })
-- luacheck: pop
loader = require('prompts.prompt_loader')
local M = {}
M.DATE_AND_EXTENSION = "date_... |
math.randomseed(os.time())
local x = 1000
local y = 1000
local z = 1000
local k = math.min(3000, x * y * z)
io.output("randinput.txt")
io.write(string.format("%d %d %d %d\n", x, y, z, k))
do
local a = {}
for i = 1, x do
table.insert(a, math.random(10^10-1, 10^10))
end
io.write(table.concat(a, " "), "\n"... |
-- This file is part of the LrMediaWiki project and distributed under the terms
-- of the MIT license (see LICENSE.txt file in the project root directory or
-- [0]). See [1] for more information about LrMediaWiki.
--
-- Copyright (C) 2014 by the LrMediaWiki team (see CREDITS.txt file in the
-- project root direct... |
Content = nil
Type = nil
IsCut = false
Bedrock = nil
LastPaste = 0
function Initialise(self, bedrock)
local new = {} -- the new instance
setmetatable( new, {__index = self} )
new.Bedrock = bedrock
new.Bedrock:RegisterEvent('paste', function(bedrock, event, text)
Log.i('paste event!')
Log.i(text)
new... |
return function()
local liter = require(game:GetService('ReplicatedStorage').liter)
it('should endlessly cycle through the array', function()
local iter = liter.array({ 5, 4, 3 }):cycle()
expect(iter:after()).to.equal(5)
expect(iter:after()).to.equal(4)
expect(iter:after()).to.equal(3)
expect(ite... |
object_mobile_cts_sarlacc_s02 = object_mobile_shared_cts_sarlacc_s02:new {
}
ObjectTemplates:addTemplate(object_mobile_cts_sarlacc_s02, "object/mobile/cts_sarlacc_s02.iff")
|
--[[
Various utility functions for fake updater implementations.
]]
local type = type
local pairs = pairs
module "utils"
-- luacheck: globals map set2arr arr2set merge
--[[
Run a function for each key and value in the table.
The function shall return new key and value (may be
the same and may be modified). A new tabl... |
local mock = require('luassert.mock')
local buffer = require('vgit.buffer')
local it = it
local describe = describe
local after_each = after_each
local before_each = before_each
local eq = assert.are.same
local api = nil
describe('current', function()
before_each(function()
api = mock(vim.api, true)
api.nvi... |
-----------------------------------------
-- Spell: Comet
-- Deals dark damage to an enemy.
-- Successive use enhances spell potency.
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/magic")
-----------------------------------------
function onMagicCastingCheck(caste... |
-----------------------------------------
-- ID: 5258
-- Item: Revive Feather
-- Status Effect: Reraise
-----------------------------------------
require("scripts/globals/status")
require("scripts/globals/msg")
-----------------------------------------
function onItemCheck(target)
return 0
end
function onItemUse(... |
--[[ 1. addon variables ]]
-- namespaces
GuildPanel = {};
GuildPanel.Permissions = {};
GuildPanel.MemberTable = {};
GuildPanel.currentMemberTable = {};
GuildPanel.RankList = {};
GuildPanel.helpers = {};
-- addon detail
GuildPanel.AddonVersion = "0.34";
GuildPanel.AddonAuthor = "Amiya";
GuildPanel.AddonName = "GuildPa... |
class 'RotationHelper'
-- local m_Logger = Logger("RotationHelper", false)
--YPR: yaw, pitch, roll
--LUF: left, up, forward
--LT: LinearTransform
function RotationHelper:GetYawfromForward(forward)
return math.atan(forward.x, forward.z) + math.pi
end
function RotationHelper:GetYPRfromLUF(left, up, forward)
--... |
--[=[
@client
@class PlayerProductManagerClient
]=]
local require = require(script.Parent.loader).load(script)
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local PlayerProductManagerBase = require("PlayerProductManagerBase")
local PlayerProductManagerC... |
dofile(minetest.get_modpath("techtest") .. "/beeswax.lua")
dofile(minetest.get_modpath("techtest") .. "/aluminum.lua")
dofile(minetest.get_modpath("techtest") .. "/pyrite.lua")
dofile(minetest.get_modpath("techtest") .. "/matches.lua")
dofile(minetest.get_modpath("techtest") .. "/gems.lua")
minetest.register_craftitem(... |
local P = require("core.packet")
local L = require("core.link")
local Datagram = require("lib.protocol.datagram")
local Ethernet = require("lib.protocol.ethernet")
local IPV4 = require("lib.protocol.ipv4")
local IPV6 = require("lib.protocol.ipv6")
local GRE = require("lib.protocol.gre")
local TCP = require("lib.protoco... |
function player_Spawn ( )
--outputChatBox ( "called for "..getClientName ( source ) )
skin = getElementModel ( source )
notrolley = getAttachedElements ( source )
for k,v in pairs(notrolley) do
if getElementType ( v ) == "object" then
destroyElement ( v )
end
end
if ( skin ~= 217 ) then
local ... |
-- COMMS by Tammya-MoonGuard --
CommsAddon = LibStub("AceAddon-3.0"):NewAddon( "Comms",
"AceComm-3.0", "AceEvent-3.0", "AceSerializer-3.0",
"AceTimer-3.0" )
local Main = CommsAddon
local L = CommsLocale
--local PUB_CHAT_CHANNEL = "xtensionxtooltip2"
-----------------------------------... |
------------------------
-- PhysicsBody [mixin](https://github.com/kikito/middleclass/wiki/Mixins).
-- Apply to classes to give them physics body, along with relevant positional and rotational functions.
-- @mixin PhysicsBody
-- @usage local MyClass = class("MyClass")
-- MyClass:include( PhysicsBody )
--- @type Physi... |
local curl = require "lcurl.safe"
script_info = {
["title"] = "大力盘",
["description"] = "https://www.dalipan.com/; 搜索框输入:config设置是否过滤失效链接",
["version"] = "0.0.3",
}
function request(url,header)
local r = ""
local c = curl.easy{
url = url,
httpheader = header,
ssl_verifyhost = 0,
ssl_verifypeer = 0,
foll... |
------------------------
-- hash::replace tests
------------------------
hash = box.schema.space.create('tweedledum')
tmp = hash:create_index('primary', { type = 'hash', parts = {1, 'unsigned'}, unique = true })
tmp = hash:create_index('field1', { type = 'hash', parts = {2, 'unsigned'}, unique = true })
tmp = hash:cre... |
BrokerUpgrade = BrokerUpgrade or {}
-- * name
-- * onInstall
-- * id
-- * description
-- * installMessage
-- * price
-- * unique
-- * requiredUpgrade
BrokerUpgrade = {
--- an upgrade that can be bought
--- @param self
--- @param config table
--- @field name string (mandatory)
--- @field onInst... |
local Component = require "component"
local Lock = Component:extend()
Lock.name = "Lock"
function Lock:initialize(actor)
actor.setKey = self.setKey
actor.hasKey = self.hasKey
end
function Lock:setKey(item)
self.key = item
end
function Lock:hasKey(actor)
return self.key and actor.inventory and actor.hasItem(... |
local theme={colors={normal={blue={0.4,0.6,0.8,1},green={0.6,0.8,0.6,1},cyan={0.4,0.8,0.8,1},white={0.82745098039216,0.8156862745098,0.7843137254902,1},red={0.94901960784314,0.46666666666667,0.47843137254902,1},magenta={0.8,0.6,0.8,1},black={0.17647058823529,0.17647058823529,0.17647058823529,1},yellow={1.0,0.8,0.4,1}},... |
local session = {
_VERSION = "",
_DESCRIPTION = "",
_LICENSE = [[]],
}
function session.new()
return {}
end
-------------------------------------------------------------------------------
-- Returning module
-------------------------------------------------------------------------------
return session |
-- This is sorta horrible
AddCSLuaFile()
local keypad_crack_time = CreateConVar("keypad_crack_time", "30", {FCVAR_ARCHIVE}, "Seconds for keypad cracker to crack keypad")
if SERVER then
util.AddNetworkString("KeypadCracker_Hold")
util.AddNetworkString("KeypadCracker_Sparks")
end
if CLIENT then
SWEP.PrintName = "K... |
LinkLuaModifier("modifier_mutation_track_buff_ms", "components/mutation/modifiers/periodic_spellcast/modifier_mutation_track.lua", LUA_MODIFIER_MOTION_NONE )
modifier_mutation_track = class({})
function modifier_mutation_track:IsPurgable() return false end
function modifier_mutation_track:OnCreated()
-- Ability pro... |
local game = {
GAMESTATE = "",
SERVERGAMESTATE = "",
usersMoved = {},
newUserPositions = {},
crashedUsers = {}, -- remembers how many rounds the user has to wait
time = 0,
maxTime = 0,
timerEvent = nil,
time2 = 0,
maxTime2 = 0,
timerEvent2 = nil,
roundTime = 10,
winnerID = nil
}
local tease = {
"Server:... |
slot0 = class("ShipStatus")
slot0.flagList = {
"inChapter",
"inFleet",
"inElite",
"inActivity",
"inPvP",
"inExercise",
"inEvent",
"inClass",
"inTactics",
"inBackyard",
"inAdmiral",
"inWorld",
"isActivityNpc",
"inGuildEvent",
"inGuildBossEvent"
}
slot0.checkShipFlag = function (slot0, slot1, slot2)
if t... |
----------------------------------------
--
-- TabbableVector3Input.lua
--
-- Creates a frame containing a label and a text input control.
-- that can be linked to other TabbableVector3Input Copied mostly from LabeldTextInput
-- but will be replace when we go to Roact
----------------------------------------
local GuiU... |
local Sha1 = require("mod.extlibs.api.Sha1")
local Util = {}
function Util.string_to_integer(str)
local hash_chunks = {Sha1.sha1(str)} -- list of ints
return fun.iter(hash_chunks):foldl(fun.op.add, 0)
end
return Util
|
--[[----------------------------------------------------------------------------
MyMetadataDefinitionFile.lua
MyMetadata.lrplugin
--------------------------------------------------------------------------------
ADOBE SYSTEMS INCORPORATED
Copyright 2008 Adobe Systems Incorporated
All Rights Reserved.
NOTICE: Adobe... |
/*---------------------------------------------------------
Player Transparency
Distance opacity opacity
Thanks to Jetboom for the code (Zombie Survival)
---------------------------------------------------------*/
CVars.PlayerOpacity = CreateClientConVar( "ze_playeropacity", 1, true, false )
CVars.PlayerOpacityDis... |
--
-- xdabbcode - BBCode writer for XDA forums
-- http://forum.xda-developers.com/misc.php?do=bbcode
--
-- Copyright (C) 2015 James Mason < jmason888 ! gmail ! com >
--
-- Invoke with: pandoc -t sample.lua
-- Blocksep is used to separate block elements.
function Blocksep()
return "\n\n"
end
-- This function is ... |
--
-- patches.lua
-- kmeans-kernels
--
-- Created by Andrey Kolishchak on 12/19/15.
--
function get_patches(data, num, width)
max_width = data:size(3) - width + 1
max_heigth = data:size(4) - width + 1
local patches = data.new(num, data:size(2), width*width)
local img_num = torch.randperm(data:size(1))
... |
local _, ns = ...
local Filger = ns.Filger
local Config = ns.Config
local Cooldowns = Config["Cooldowns"]
local BlackList = Config["BlackList"]
local Item = Item
----------------------------------------------------------------
-- Development (write anything here)
--------------------------------------------... |
-- Copyright 2006-2017 Mitchell mitchell.att.foicica.com. See LICENSE.
-- SciTE lexer theme for Scintillua.
local property = require('lexer').property
property['color.red'] = '#F92672'
property['color.yellow'] = '#E6DB74'
property['color.black'] = '#F8F8F2'
property['color.white'] = '#272822'
property['color.green'] ... |
local path = minetest.get_modpath "trinium_machines" .. "/recipes/"
trinium.machines.recipes = {}
dofile(path .. "chemical_reactor.lua")
dofile(path .. "distillation_tower.lua")
dofile(path .. "metal_press.lua")
|
function addResourceMap ( resource, filename, dimension )
if not resource then return false end
dimension = dimension or 0
local currentFiles = getResourceFiles ( resource, "map" )
for k,path in ipairs(currentFiles) do
if path == filename then
return false
end
end
--
local newMap = xmlCreateFile ( ':' .. ... |
local premake = require("premake")
local vstudio = require("vstudio")
local vcxproj = vstudio.vcxproj
local VsVcxIncludeDirTests = test.declare('VsVcxIncludeDirTests', 'vcxproj', 'vstudio')
function VsVcxIncludeDirTests.setup()
vstudio.setTargetVersion(2015)
end
local function _execute(fn)
workspace('MyWorkspac... |
object_tangible_collection_col_ent_fan_06 = object_tangible_collection_shared_col_ent_fan_06:new {
gameObjectType = 8211,}
ObjectTemplates:addTemplate(object_tangible_collection_col_ent_fan_06, "object/tangible/collection/col_ent_fan_06.iff") |
local wrappers = {}
function wrappers.argPassthrough(...)
return ...
end
function wrappers.argArity0(opt)
return {}, opt
end
function wrappers.argArity1(arg1, opt)
return {arg1}, opt
end
function wrappers.argArity2(arg1, arg2, opt)
return {arg1, arg2}, opt
end
function wrappers.argArity3(arg1, arg2... |
local gears = require('gears')
local wibox = require('wibox')
local lunaconf = {
dpi = require('lunaconf.dpi'),
icons = require('lunaconf.icons'),
theme = require('lunaconf.theme'),
dialogs = {
base = require('lunaconf.dialogs.base')
}
}
local bar = {}
local theme = lunaconf.theme.get()
local function recalcu... |
local component = require("component")
local event = require("event")
local fs = require("filesystem")
local shell = require("shell")
local isInitialized, pendingAutoruns = false, {}
local function list()
for k,_ in component.list("filesystem", true) do
local proxy, reason = fs.proxy(k)
if proxy t... |
(getmetatable"" or {}).__index = function(self,k)
if(type(k) == "number") then return self:sub(k,k); end
return string[k];
end
local function print() end
local MEMORY_SIZE = 7; -- bytes of each ram of node
local eax, ecx, edx, ebx, esp, ebp, esi, edi, eflags = 0, 1, 2, 3, 4, 5, 6, 7, 8;
local ax, cx, dx, bx, sp, b... |
-- Copyright 2006-2015 Mitchell mitchell.att.foicica.com. See LICENSE.
-- R LPeg lexer.
local l = require('lexer')
local token, word_match = l.token, l.word_match
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'rstats'}
-- Whitespace.
local ws = token(l.WHITESPACE, l.space^1)
-- Comments.
local comment =... |
pg = pg or {}
pg.guild_data_level = {
{
exp = 1000,
level = 1,
member_num = 20,
assistant_commander = 4
},
{
exp = 3000,
level = 2,
member_num = 22,
assistant_commander = 4
},
{
exp = 5000,
level = 3,
member_num = 24,
assistant_commander = 4
},
{
exp = 8000,
level = 4,
member_num = ... |
--* minimap
local E, C, L, _ = select(2, shCore()):unpack()
local unpack, select = unpack, select
local collectgarbage = collectgarbage
local floor, format = math.floor, string.format
local modf = math.modf
local CreateFrame = CreateFrame
local showLFT = true -- enable disable fps/latency and clock
l... |
local floor = math.floor
local Characters = {
[ 0] = "0";
[ 1] = "1";
[ 2] = "2";
[ 3] = "3";
[ 4] = "4";
[ 5] = "5";
[ 6] = "6";
[ 7] = "7";
[ 8] = "8";
[ 9] = "9";
[10] = "A";
[11] = "B";
[12] = "C";
[13] = "D";
[14] = "E";
[15] = "F";
[16] = "G";
--// add more if needed.
}
return function(Number,... |
--@import see.base.Exception
--@extends see.base.Exception
--[[
Describes an exception which occurs at runtime.
]]
--[[
Constructs a new RuntimeException.
@param string:message The error message.
]]
function RuntimeException:init(message)
self:super(Exception).init(message)
end |
-------------------------------------------------------------------------------
-- Announce Rare (BFA 8.2) By Crackpotx (US, Lightbringer)
-------------------------------------------------------------------------------
local AR = LibStub("AceAddon-3.0"):NewAddon("AnnounceRare", "AceComm-3.0", "AceConsole-3.0", "AceEven... |
function onCreate()
makeLuaSprite('background', 'sonicexe-old-stage-lordX-background', -600, -400);
addLuaSprite('background', false);
setLuaSpriteScrollFactor('background', 1);
scaleObject('background', 0.5, 0.5);
makeLuaSprite('hills1', 'sonicexe-old-stage-lordX-hills1', -600, -500);
addLuaSprite... |
function drawPlayer()
local map_config = loadMapConfig(map_id)
local x = love.graphics.getWidth() / 2 - (map_config.size_tile * (map_config.size_x / 2)) + player.x
local y = love.graphics.getHeight() / 2 - (map_config.size_tile * (map_config.size_y / 2)) + player.y
love.graphics.draw(broken, x, y)
en... |
local gitsigns_status_ok, gitsigns = pcall(require, 'gitsigns')
if not gitsigns_status_ok then
vim.notify('Not able to load in gitsigns', 'error')
return
end
gitsigns.setup {
signs = {
add = {hl = 'GitSignsAdd' , text = '+', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
change = {hl... |
local function copy(value)
if type(value) ~= "table" then
return value
end
local cp = {}
for k,v in pairs(value) do
cp[copy(k)] = copy(v)
end
return setmetatable(cp,value)
end
local function extends(class,...)
local extc_list = {...}
if #extc_list == 0 then return class end
for i,extc in pairs(extc_list) ... |
---------------------------------------------------------------------------------------------------
--
--filename: game.util.LuaMath
--date:2019/9/26 11:23:41
--author:heguang
--desc:
--
---------------------------------------------------------------------------------------------------
local strClassName = 'game.util.... |
local web_devicons = require('nvim-web-devicons')
|
local which_key = require("which-key")
which_key.setup()
|
data:extend(
{
{
type = "tool",
name = "more-science-pack-1",
localised_description = {"item-description.science-pack"},
icon = "__MoreSciencePacks-for1_1__/graphics/icons/more-science-pack-1.png",
icon_size = 32,
subgroup = "science-pack",
order = "z[zmore-science-pack-01]",
stack_siz... |
local tables = {}
tables.highways = osm2pgsql.define_table{
name = 'osm2pgsql_test_highways',
ids = { type = 'way', id_column = 'way_id' },
columns = {
{ column = 'tags', type = 'hstore' },
{ column = 'refs', type = 'text' },
{ column = 'geom', type = 'linestring' },
}
}
ta... |
object_tangible_deed_vehicle_deed_vehicle_deed_sith_speeder = object_tangible_deed_vehicle_deed_shared_vehicle_deed_sith_speeder:new {
}
ObjectTemplates:addTemplate(object_tangible_deed_vehicle_deed_vehicle_deed_sith_speeder, "object/tangible/deed/vehicle_deed/vehicle_deed_sith_speeder.iff")
|
ITEM.name = "Антирад"
ITEM.category = "Медицина"
ITEM.desc = "Препарат радиозащитного действия Мексамин, широко распространенный на территории Зоны. При применении вызывает сужения периферических кровеносных сосудов и кислородное голодание, в данном случае является средством профилактики и лечения лучевой болезни. \n... |
for i=0,#arg do
print(i,arg[i])
end
|
local M = {}
-- Break expression into parts from which we can generate a parser and generator.
--
-- Expression should have form like this:
-- | A | B | C | D | E | F |
-- "{parent}/([%w_/]+)/{namespace}/([%w_]*){name}([%w_%.]*)"
-- With:
-- A = related files have some common parent d... |
local util = require 'util'
--- @class Observer
-- @description Observers are simple objects that receive values from Observables.
local Observer = {}
Observer.__index = Observer
Observer.__tostring = util.constant('Observer')
--- Creates a new Observer.
-- @arg {function=} onNext - Called when the Observable produce... |
--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.
... |
local CT = ControllerTweaks
local Inventory = CT_Plugin:Subclass()
local NONE = GetString(SI_ITEMTYPE0)
local LEFT_STICK = GetString(SI_KEYCODE129)
local RIGHT_STICK = GetString(SI_KEYCODE130)
local QUATERNARY = GetString(SI_BINDING_NAME_UI_SHORTCUT_QUATERNARY)
local JUNK_ICON = "EsoUI/Art/Inventory/inventory_tabIcon... |
function loadGangAccount(gangid)
local self = {}
self.gid = gangid
local processed = false
local query = exports.ghmattimysql:executeSync("SELECT * FROM `bank_accounts` WHERE `gangid` = @gang AND `account_type` = 'Gang'", {['@gang'] = self.gid})
if query[1] ~= nil then
self.accountnumber = ... |
local cutorch = require "cutorch"
local cunn = require "cunn"
local nn = require "nn"
local nngraph = require "nngraph"
local optim = require "optim"
-- set gated network hyperparameters
local opt = {}
opt.embedSize = 300
opt.gateSize = 300
opt.hiddenSize = 900
opt.batchSize = 100
opt.numEpochs = 2000
opt.saveEpochInt... |
TUTORIALS['en'][#TUTORIALS['en'] + 1] = {
name = "Sewers",
contents = {
{type = CONTENT_TYPES.IMAGE, value = "/images/tutorial/sewers.png"},
{type = CONTENT_TYPES.TEXT, value = "One of the best places for beginners in the game are the sewers of the cities. In this type of place you will find Pok... |
-- PUMPKIN SPICE!!!
-- Spice
minetest.register_craftitem("pumpkinspice:pumpkinspice", {
description = "Pumpkin Spice",
inventory_image = "pumpkinspice.png"
})
minetest.register_craft({
type = "shapeless",
output = "pumpkinspice:pumpkinspice 2",
recipe = {"farming:pumpkin_slice"},
})
-- Latte
minetest.register_c... |
-- shared.lua
DEFINE_BASECLASS("base_wire_entity")
ENT.PrintName = "ACF Rack"
ENT.Author = "Bubbus"
ENT.Contact = "splambob@googlemail.com"
ENT.Purpose = "Because launch tubes aren't cool enough."
ENT.Instructions = "Point towards face for removal of face. Point away from face for instant fake tan (then remov... |
require("firecast.lua");
local __o_rrpgObjs = require("rrpgObjs.lua");
require("rrpgGUI.lua");
require("rrpgDialogs.lua");
require("rrpgLFM.lua");
require("ndb.lua");
require("locale.lua");
local __o_Utils = require("utils.lua");
local function constructNew_frmItemEffect()
local obj = GUI.fromHandle(_obj_newObject... |
-- [
local Log = require "log.logger"
local Util = require "util.util"
local Env = require "env"
local rpc_mgr = require "rpc.rpc_mgr"
local server_mgr = require "server.server_mgr"
local ErrorCode = require "global.error_code"
local global_define = require "global.global_define"
local ServerType = global_define.Serve... |
-- definitions for Lua 5.1 basic library
--# -- TODO return generics
--# assume global `assert`:
--# --[[ [assert] ]] function(v: any, message: string?)
--#
--# assume global `collectgarbage`:
--# function(opt: string?, arg: any?) --> any
--#
--# assume global `dofile`:
--# [geval] function(filename: strin... |
-- random
-- by Qige
-- 2017.01.05
seed = {}
function seed.seed()
--return math.randomseed(tostring(os.time()):reverse():sub(1, 6))
return tostring(os.time()):reverse():sub(1, 6)
end
function seed.random(from, to)
math.randomseed(seed.seed())
return math.random(from, to)
end
return seed
|
local Sky = {}
function Sky:init()
self.canvas = lg.newCanvas(scrn.w / scrn.scl, scrn.h / scrn.scl)
self.tcanvas = lg.newCanvas(scrn.w / scrn.scl, scrn.h / scrn.scl)
self.topcolor = {111, 60, 103, 255}
self.botcolor = {250, 190, 120, 255}
self.img = lg.newImage('gfx/skies/sky3.png')
self.imgh = self.img:g... |
{
{ name = "Иссушающий трутень", count = 4, id = 'Forestry:beeDroneGE', dmg = 0, chance = 5, color = 0xF6290C },
{ name = "Яйцо дракона", count = 1, id = 'minecraft:dragon_egg', dmg = 0, chance = 8, color = 0xF6290C },
{ name = "Звезда Ада", count = 1, id = 'minecraft:nether_star', dmg = 0,... |
--
-- piepie - bot framework for Mumble
--
-- Author: Tim Cooper <tim.cooper@layeh.com>
-- License: MIT (see LICENSE)
--
local bit=require'bit'
function piepan.Permissions.new(permissionsMask)
assert(type(permissionsMask) == "number", "permissionsMask must be a number")
local permissions = {}
for permissi... |
--[[-----------------------------------------------------------------------------
Button Widget
Graphical Button.
-------------------------------------------------------------------------------]]
local Type, Version = "InviteButton", 1
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetW... |
--[[
--=====================================================================================================--
Script Name: Server Logger, for SAPP (PC & CE)
Description: An advanced custom logger.
This script will log the following events:
1). Game start & end
2). Script load, re-load & unload
3). Tea... |
local function run()
local Busy = require "Busy"
Busy.start()
app.collectgarbage()
Busy.stop()
end
return {
{
description = "Run garbage collector",
batch = false,
run = run,
suppressReset = true
}
}
|
--settings
local GO = nil
local trans = nil
delay = 0
nextScale = Vector3(0,0,0)
function Constructor()
GO = owner
trans = GO:GetComponent("Transform")
nextScale = trans:GetWorldScale()
delay = 10000
end
function OnUpdate(dt)
if(delay > 0) then
delay = delay - dt
else
trans:SetWorldScale(nextSc... |
-------------------
-- Adonis Server --
-------------------
--[[
If you find bugs, typos, or ways to improve something please message me (Sceleratis/Davey_Bones) with
what you found so the script can be better.
Also just be aware t... |
local analyse = require "analyse"
local M = {}
function M:init()
self.out_cards = 0
self.cards = {}
self.player1_hand_cards = 0
self.player2_hand_cards = 0
self.player1_out_cards = {}
self.player2_out_cards = {}
analyse.init()
end
-- 随机洗牌
function M:shuffle()
local t = {}
for i=1,9 do
table.insert(t... |
minetest.register_entity("yatm_armoury:turret", {
initial_properties = {
--drawtype = "mesh",
visual = "mesh",
mesh = "yatm_turret_machine_gun.obj",
visual_scale = 1/24,
textures = {
"yatm_turret.png"
},
is_turret = true,
}
})
|
-- Room ( Dungeon room of course :v )
require "src/List"
Room = {}
function Room.new( container )
local self = setmetatable( {}, { __index = Room } )
self.x = container.x + love.math.random( 0, container.w / 3 )
self.y = container.y + love.math.random( 0, container.h / 3 )
self.w = container.w - ( self.x - cont... |
-- Base16 {{ scheme-name }} color
-- Author: {{ scheme-author }}
-- to be use in your theme.lua
-- symlink or copy to config folder `local color = require('color')`
local M = {}
M.base00 = "#171e1f" -- ----
M.base01 = "#252c2d" -- ---
M.base02 = "#373c3d" -- --
M.base03 = "#555e5f" -- -
M.base04 = "#818f80" -- +
M.b... |
local PANEL = {}
function PANEL:Init()
self:SetPos(0,0)
self:SetSize(500,500)
self:SetSpaceX(2)
self:SetSpaceY(2)
self:SetBorder(0,0)
end
vgui.Register("ZGrid",PANEL,"DIconLayout");
|
-- Natural Selection 2 Competitive Mod
-- Source located at - https://github.com/xToken/CompMod
-- lua\CompMod\CommAbilities\Rupture\shared.lua
-- - Dragon
function Rupture:OnAbilityOptionalEnd()
end
function Rupture:GetType()
return CommanderAbility.kType.Repeat
end
function Rupture:OnDestroy()
if Clien... |
--This code is based on code from mesecons by Jeija, at:
--https://github.com/Jeija/minetest-mod-mesecons/blob/c2e3d7c4e58b2563e79aead60c6efedf27c786cf/mesecons_wires/init.lua#L12
local wire_getconnect = function (from_pos, self_pos)
local node = minetest.get_node(self_pos)
if minetest.registered_nodes[node.name]
an... |
x = {test = "bar", foo = "no", food = "yes"}
y = require("test2")
for k,v in pairs(x) do
print(k, "=>", v)
end
print("GOT", y, y[10])
|
#include "umf_core.lua"
#include "extension/tool_loader.lua"
UpdateQuickloadPatch()
|
return function(parent, dir)
local math = require 'math'
local lgi = require 'lgi'
local GObject = lgi.GObject
local Gtk = lgi.Gtk
local Gdk = lgi.Gdk
local cairo = lgi.cairo
local GtkDemo = lgi.GtkDemo
local log = lgi.log.domain 'gtk-demo'
GtkDemo:class('MirrorBin', Gtk.Bin)
function GtkDemo.MirrorBin:_init()
s... |
-- Default style
--[[local lantern_nodebox = {
type = "fixed",
fixed = {
-- Default
{-4/16,-8/16,-4/16,4/16,2/16,4/16}, -- Base Body
{-3/16, 2/16,-3/16,3/16,4/16,3/16},
{-2/16, 4/16,-2/16,2/16,7/16,2/16},
}
}]]
-- Fancy style
local fancy_lantern_nodebox = {
type = "fixed",
fixed = {
-- De... |
-- Copyright 2006-2012 Mitchell mitchell.att.foicica.com. See LICENSE.
-- Bibtex LPeg lexer.
local l = lexer
local token, style, color, word_match = l.token, l.style, l.color, l.word_match
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'bibtex'}
-- Whitespace.
local ws = token(l.WHITESPACE, l.space^1)
--... |
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Packages = ReplicatedStorage.Packages
local Chickynoid = require(Packages.Chickynoid.Server)
Chickynoid.Setup()
Players.PlayerAdded:Connect(function(player)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.