content stringlengths 5 1.05M |
|---|
local ECS = require "ECS"
local skill_cfg = require "game.config.scene.config_skill"
local FightHelper = {}
local EntityMgr = nil
function FightHelper.Init( )
EntityMgr = ECS.World.Active.EntityManager
end
--获取可攻击的坐标
function FightHelper.GetAssailablePos( curPos, targetPos, minDistance, maxDistance )
local random... |
object_mobile_space_comm_wke_pirate_01 = object_mobile_shared_space_comm_wke_pirate_01:new {
}
ObjectTemplates:addTemplate(object_mobile_space_comm_wke_pirate_01, "object/mobile/space_comm_wke_pirate_01.iff")
|
--[[
-------------------------------------------------------------------------------
Menori
LÖVE library for simple 3D and 2D rendering based on scene graph.
@author rozenmad
2021
-------------------------------------------------------------------------------
--]]
----
-- @module menori
local modules = (...) and (... |
mingken_companion = {
on_healed = function(mob, healer)
mob_ai_cotw.on_healed(mob, healer)
end,
on_attacked = function(mob, attacker)
mob_ai_cotw.on_attacked(mob, attacker)
end,
move = function(mob, target)
mob_ai_cotw.move(mob, target)
end,
attack = function(mob, target)
mob_ai_cotw.attack(mob, target)
... |
appname="带logo二维码生成"
appver="1.0"
appcode="1"
appsdk="15"
path_pattern=""
packagename="com.aikesi.demy"
theme="Theme_Material_Light_DarkActionBar"
app_key=""
app_channel=""
developer=""
description=""
debugmode=true
user_permission={
"INTERNET",
"WRITE_EXTERNAL_STORAGE"
}
|
local Players = game:GetService("Players")
local clickDetector = workspace.ClickablePart.ClickDetector
function newPlayer(player)
local leaderstats = Instance.new("Model")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local clicks = Instance.new("IntValue")
clicks.Name = "Click... |
nut.chat = nut.chat or {}
nut.chat.classes = nut.char.classes or {}
local DUMMY_COMMAND = {syntax = "<string text>", onRun = function() end}
if (!nut.command) then
include("sh_command.lua")
end
-- Registers a new chat type with the information provided.
function nut.chat.register(chatType, data)
if (!data.onCanHea... |
local entityMeta = FindMetaTable("Entity")
-- Checks if an entity is a door by comparing its class.
function entityMeta:isDoor()
return self:GetClass():find("door")
end
-- Returns the door's slave entity.
function entityMeta:getDoorPartner()
local owner = self:GetOwner() or self.nutDoorOwner
if (IsValid(owner) an... |
object_tangible_loot_creature_loot_collections_space_reactor_mark_03_freitek = object_tangible_loot_creature_loot_collections_space_shared_reactor_mark_03_freitek:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_space_reactor_mark_03_freitek, "object/tangible/loot/creature/loot/colle... |
require("gameData/gameData");
require("core/dict");
--比赛统计数据
local MatchRecordDataStatistics = class(GameData);
MatchRecordDataStatistics.Delegate = {
onGetMatchRecordStatistics = "onGetMatchRecordStatistics";
};
MatchRecordDataStatistics.ctor = function(self)
end
MatchRecordDataStatistics.dtor ... |
----------------------------------------------------------------
--
-- This module is used to initialize an app. It also keeps
-- track of some fundamental data used by most apps.
--
-- Written in 2012 by Brendan A R Sechter <bsechter@sennue.com>
--
-- To the extent possible under law, the author(s) have
-- dedic... |
tabs = require('hs-tabs/tabs')
tabs.enableForApp('Anmol')
tabs.enableForApp('Emacs')
tabs.enableForApp('Sublime Text')
|
#!/usr/bin/env lua
local lfs = require("lfs")
local utils = require("utils")
local M = {}
function M.rmdir(dir, args)
assert(dir, "dir cannot be nil")
assert(utils.isdir(dir), "dir is not a directory")
local force = args and args["force"]
if not force then
return lfs.rmdir(dir)
end
if dir:su... |
#!/usr/bin/env lua
package.path = package.path..";../?.lua"
local gl = require("moongl")
local glfw = require("moonglfw")
local glmath = require("moonglmath")
local new_camera = require("common.camera")
-- A few shortcuts:
local vec3 = glmath.vec3
local rad = math.rad
local SCR_WIDTH, SCR_HEIGHT = 800, 600
-- camera:... |
--CONSTANTS--
--REQUIRES--
local utils = require("lib/atr_utils")
--Holds items that are exported
local exports = {}
function exports.setup()
utils.draw_text_large("Welcome to ATR!", -20, -6)
end
return exports
|
util = {}
do
local serialize_any, serialize_table
serialize_table = function(val, bck)
if bck[val] then return "nil" end
bck[val] = true
local entries = {}
for k, v in pairs(val) do
entries[#entries+1] = string.format("[%s] = %s", serialize_any(k, bck), serialize_any(v, bck))
end
return string.forma... |
--[[
Copyright (C) 2013 Lex Robinson
This code is freely available under the MIT License. See the LICENSE file for more information.
--]]
AddCSLuaFile();
ENT.Type = "anim";
ENT.Base = "base_anim";
ENT.PrintName = "Shooting Range";
ENT.Author = "Lex Robinson";
ENT.Contact = "lexi@lexi.org.uk";
ENT.Purpos... |
--
-- User: hybridtupel
-- Date: 31.05.16
-- Time: 13:34
--
function isPrime(number)
local max = math.sqrt(number)
for i = 2, max do
if number % i == 0 then
return false
end
end
return true
end
function nThPrime(n)
local primes = 1
local i = 3
while primes < n d... |
--[[
Based on Holo Awesome WM theme 3.0
github.com/lcpz
--]]
local theme = {}
theme.icon_dir = conf_dir .. "/icons"
theme.titlebar_dir = conf_dir .. "/titlebar"
if config.dpi_scaling > 1.1 then
theme.font ... |
local match_hall_record_view_history_layout = require(ViewPath .. "hall/matchHall/widget/match_hall_record_view_history_layout");
local NVerticalListView = require("ui2/NVerticalListView");
local RecordMatchItem = require("hall/matchHall/gameMatchHall/gameMatchHallRecord/history/gameMatchHallRecordMatchItem");
-- ... |
local Arson = {}
local custom_types = {}
local encode_custom = function(t)
assert(type(t) == "table", "Passed argument must be of type 'table'")
local custom = custom_types[t.type]
if custom then
return true, custom.on_encode, t.type
else
return false
end
end
local decode_custom = function(t)
assert(type(t... |
object_building_general_ord_guild_combat = object_building_general_shared_ord_guild_combat:new {
}
ObjectTemplates:addTemplate(object_building_general_ord_guild_combat, "object/building/general/ord_guild_combat.iff")
|
----------------------------------------------------------
-- Load RayUI Environment
----------------------------------------------------------
RayUI:LoadEnv("Misc")
local M = _Misc
local mod = M:NewModule("Exprepbar", "AceEvent-3.0")
local libAD = LibStub("LibArtifactData-1.0")
local function AddPerks()... |
local M = {}
function M.listToTable(list, filterFn)
local t = {}
for item in list:gmatch("[^\r\n]+") do
if (not filterFn or not filterFn(item)) then
table.insert(t, item);
else
end
end
return t
end
function M.readCmd(cmd)
local handle = io.popen(cmd);
local result = handle:read('*a')
h... |
local kohlaudiovisualizer = Instance.new("Part", workspace)
local pointlight = Instance.new("PointLight", kohlaudiovisualizer)
local sound = Instance.new("Sound", kohlaudiovisualizer)
local particleemitter = Instance.new("ParticleEmitter", kohlaudiovisualizer)
local parts = Instance.new("Folder", kohlaudiovisualizer)... |
object_tangible_quest_corellia_coronet_government_work_courier = object_tangible_quest_shared_corellia_coronet_government_work_courier:new {
}
ObjectTemplates:addTemplate(object_tangible_quest_corellia_coronet_government_work_courier, "object/tangible/quest/corellia_coronet_government_work_courier.iff")
|
--!strict
type CommandLineArguments = { [number]: string }
--[[ Entry Point ]]--
return function(c_args: CommandLineArguments)
print("[Hula] Initializing Core!")
print(string.format("Number of Command Line Arguments: %d\n", #c_args))
end
|
-- initialize global tables
comp3190 = comp3190 or {}
comp3190.goals = comp3190.goals or {}
comp3190.bot_states = {
IDLE = 1,
MOVE = 2,
POST_MOVE = 3
}
-- create namespaced function
function comp3190.DeleteGoalPost(entity)
-- search our global table and remove it
for k, goal in pairs(comp3190.goals) d... |
-- component list. comment out things to disable them
require('components/filters/index')
require('components/zonecontrol/index')
-- require('components/courier/index')
-- require('components/music/index')
require('components/settings/index')
|
-- Formatting
local formatters = require "lvim.lsp.null-ls.formatters"
formatters.setup {}
-- Linting
local linters = require "lvim.lsp.null-ls.linters"
linters.setup {}
-- Lsp config
vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "rust_analyzer" })
local status_ok, rust_tools = pcall(require, "... |
-- import.lua: tests for import module without base path set
-- This file is a part of lua-nucleo library
-- Copyright (c) lua-nucleo authors (see file `COPYRIGHT` for the license)
-- Intentionally not using test suite to avoid circular dependency questions.
dofile('lua-nucleo/strict.lua') -- Import module requires s... |
-----------------------------------
-- Area: Nashmau
-- NPC: Leleroon
-- Corsair AF2 and AF3 quests
-- !pos -14.687 0.000 25.114 53
-----------------------------------
local ID = require("scripts/zones/Nashmau/IDs");
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/quest... |
---------------------------------
--! @file SdoService.lua
--! @brief SDOサービスプロファイル定義
---------------------------------
--[[
Copyright (c) 2017 Nobuhiko Miyamoto
]]
local SdoService= {}
--_G["openrtm.SdoService"] = SdoService
SdoService.new = function()
local obj = {}
return obj
end
return SdoService
|
local M = {}
function M.list_find(haystack, needle)
for _, val in ipairs(haystack) do
if val == needle then
return true
end
end
return false
end
function M.set(table)
local ret = {}
for _, key in ipairs(table) do
ret[key] = true
end
return ret
end
return M
|
function allwords (f)
-- repeat for each line in the file
for l in io.lines() do
-- repeat for each word in the line
for w in string.gfind(l, "%w+") do
-- call the function
f(w)
end
end
end
--打印单词
allwords(print)
--匿名函数作为参数
--打印hello出现的次数
local count = 0
allwords(
function (w)
if w == "hello"... |
-----------------------------------
--
-- tpz.effect.WARCRY
--
-----------------------------------
-- Notes:
-- Savagery TP bonus not cut in half like ffxclopedia says.
-- http://www.bluegartr.com/threads/108199-Random-Facts-Thread-Other?p=5367464&viewfull=1#post5367464
-----------------------------------
require("... |
function start (song)
print("Mod Chart script loaded :)")
end
function update (elapsed) -- example https://twitter.com/KadeDeveloper/status/1382178179184422918
local currentBeat = (songPos / 1000)*(bpm/60)
end
function beatHit (beat)
setCamZoom(1)
end
function keyPressed (key)
local currentBeat = (songPos ... |
local m = {}
local function interpolate(val_min, val_max, time_min, time_max, time_curr)
local fraction = (time_curr - time_min) / (time_max - time_min)
return val_min + (val_max - val_min) * fraction
end
-- Create a task to animate between 2 values over an interval
function m.tween(initial, final, duration, foreac... |
-- Treeman
mobs:register_mob("dmobs:treeman", {
type = "monster",
reach = 3,
damage = 2,
attack_type = "dogfight",
hp_min = 62,
hp_max = 72,
armor = 130,
collisionbox = {-0.4, 0, -0.4, 0.4, 3, 0.4},
visual = "mesh",
mesh = "treeman.b3d",
textures = {
{"dmobs_treeman.png"},
{"dmobs_treeman2.png"},
},
b... |
-- FlyToBagAnimation.lua
-- Author:Demon
-- Date:2016/3/22
-- Last modification:
-- Description:
-- Note:
local newObjectCaseForAnimation = require(ViewPath.."hall/newObjectCase/newObjectCaseForAnimation");
local _index = 0;
local function getIndex()
_index = _index + 1;
return _index;
end
local hall... |
LinkLuaModifier("modifier_old_silencer_infernal_permanent_immolation", "heroes/old_silencer/old_silencer_modifiers.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_old_silencer_infernal_permanent_immolation_aura", "heroes/old_silencer/old_silencer_modifiers.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modi... |
object_tangible_loot_creature_loot_collections_dooku_datadisk_02 = object_tangible_loot_creature_loot_collections_shared_dooku_datadisk_02:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_dooku_datadisk_02, "object/tangible/loot/creature/loot/collections/dooku_datadisk_02.iff")
|
local cv = require 'cv._env'
local ffi = require 'ffi'
require 'cv.Classes'
ffi.cdef[[
struct RectPlusBool detail_overlapRoi(
struct PointWrapper tl1, struct PointWrapper tl2,
struct SizeWrapper sz1, struct SizeWrapper sz2);
struct RectWrapper detail_resultRoi(
struct PointArray corners,
struct SizeArray sizes);
... |
local GCC
local PY
if _OPTIONS["generate-platform-code"] then
if os.ishost("windows") then
GCC = _OPTIONS["gccpath"] or os.getenv("GCC_PATH")
if not GCC then
print "GCC path could not be found in environment variables. Please provide the path to gcc using --gccpath=PATH or set the envi... |
local ngx_now = ngx.now
local req_get_method = ngx.req.get_method
local req_start_time = ngx.req.start_time
local cjson = require "cjson"
local cjson_safe = require "cjson.safe"
local random = math.random
local client_ip = require("plugins.moesif.client_ip")
local zzlib = require("plugins.moesif.zzlib")
local base64 = ... |
options = { noremap = true, silent = true }
-- Change require into import
vim.api.nvim_set_keymap('n', '<Leader>qf', "<cmd>_ciwimportf=dwdwifrom lx$hxj", options)
-- tex
vim.api.nvim_set_keymap('n', '<Leader>lp', ":!pdflatex %<cr>", options)
-- _ciwimportf=dwdwifrom lx$hxj
vim.api.nvim_set_keymap('n', '<Leader>r... |
---[[---------------------------------------------------------------------]]---
-- __ __ _ --
-- ____ ____ / /_ ______ ___ ____ _________ / /_ (_)____ --
-- / __ \/ __ \/ / / / / __ `__ \/ __ \/ ___/ __ \/ __ \/ / ___/ --
... |
local ok, dap = pcall(require, "dap")
if not ok then
return
end
dap.defaults.csharp.exception_breakpoints = { "user-unhandled" }
dap.adapters = {
coreclr = {
type = 'executable',
command = '/usr/bin/netcoredbg',
args = { '--interpreter=vscode' }
},
}
dap.configurations = {
cs = {
{
type = "coreclr",
... |
#!/usr/bin/env luajit
--
-- Do not break the laws of physics.
--
local bw_thread -- Our threads
local http_thread
local netcode_thread
-- Global variables
class = require("lib.30log.30log")
tiny = require("lib.tiny-ecs.tiny")
-- slightly modified to play nice with 30log
gamestate = require("lib.hump.gamestate")
loc... |
---
-- ETCD Tree
local Tree = {}
Tree.__index = Tree
local fun = require 'fun'
local fio = require 'fio'
function Tree:new(opts)
local tree = assert(opts.tree, "Tree: .tree is required")
local etcd = assert(opts.etcd, "Tree: .etcd is required")
local path = assert(opts.path, "Tree: .path is required")
assert(tre... |
if mono.menu.timer then
mono.menu.timer.destroy()
mono.menu.timer = nil
end
function mono.menu:init()
--if self.menuSearch or self.timer then return end
self.timer = createTimer()
self.timer.Interval = 1000
self.timer.OnTimer = function(timer)
-- wait for normal mono script to create mono menu, check e... |
#!/usr/bin/env texlua
-- Build script for "biblatex-trad" files
-- Identify the bundle and module
module = "biblatex-trad"
unpackfiles = { }
-- Install biblatex style files and use these as the sources
installfiles = {"*.cbx", "*.bbx"}
sourcefiles = installfiles
typesetfiles = {"biblatex-trad.tex"}
typesetruns =... |
-----------------------------------
-- Area: Upper Jeuno
-- NPC: Areebah
-- Standard Merchant NPC
-----------------------------------
local ID = require("scripts/zones/Upper_Jeuno/IDs")
require("scripts/globals/shop")
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
local stock =
{
... |
local ok, lib
ok, lib = pcall(require,'luasodium.ffi')
if ok then
return lib
end
ok, lib = pcall(require,'luasodium.core')
if ok then
return lib
end
return require'luasodium.pureffi'
|
--------------------------------
-- Lade Funktionen fuer Ampeln
--------------------------------
-- Planer
local AkAmpelModell = require("ak.strasse.AkAmpelModell")
local AkAmpel = require("ak.strasse.AkAmpel")
local AkRichtung = require("ak.strasse.AkRichtung")
local AkKreuzung = require("ak.strasse.AkKreuzung")
local... |
local kMaxFibonacciTermValue = 4000000
local function getNextFibTerm( pA, pB)
end
local function getSumOfEvenFibTerm( pMax )
local sum = 0
local a = 0
local b = 1
while ( b < pMax ) do
local c = b
b = a + b
a = c
if ( b % 2 == 0 ) then
sum = sum + b
... |
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["5"] = 1,["6"] = 1,["7"] = 1,["8"] = 3,["9"] = 4,["10"] = 3,["11"] = 4,["12"] = 5,["13"] = 6,["14"] = 7,["16"] = 5,["17"] = 10,["18"] = 11,["19"] = 10,["20"] = 13,["... |
require("lspconfig").diagnosticls.setup {
filetypes = {"javascript", "typescript"},
init_options = {
linters = {
eslint = {
command = "./node_modules/.bin/eslint",
rootPatterns = {".eslintrc.js", ".eslintrc", ".git"},
debounce = 100,
args = {
"--stdin",
... |
-- tolua: enumerate class
-- Written by Waldemar Celes
-- TeCGraf/PUC-Rio
-- Jul 1998
-- $Id: enumerate.lua,v 1.3 2000/01/24 20:41:15 celes Exp $
-- This code is free software; you can redistribute it and/or modify it.
-- The software provided hereunder is on an "as is" basis, and
-- the author has no obligation to pr... |
local _local_1_ = require("paperplanes.util.providers")
local set_field = _local_1_["set-field"]
local function post_file(filename, meta, maybe_cleanup)
local args
do
local _2_ = {}
set_field(_2_, "file", ("@" .. filename))
table.insert(_2_, "http://0x0.st")
args = _2_
end
local function after(r... |
local nvim_lsp = require'lspconfig'
local lsp_configs = require'lspconfig.configs'
-- nvim-cmp capabilities
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- Use an on_attach function to only map the following keys
-- after the... |
return {
hand_left = {
{ {-1,41},{8,35},{5,38},{-3,37},{0,0},{-1,41},{-1,41},{10,40},{7,38},{7,34},{1,41},{-7,38}, },
{ {3,39},{9,37},{6,39},{-8,38},{0,0},{3,39},{3,39},{-6,38},{-9,38},{-9,33},{0,41},{-4,38}, },
{ {10,30},{0,0},{0,0},{11,38},{11,38},{-19,46},{10,30},{12,43},{4,38},{4,38},{4,38},{4,38}, },... |
local Service = require 'models.service'
local Pipeline = require 'models.pipeline'
local Config = require 'models.config'
local analytics = require 'analytics'
local cjson = require 'cjson'
local json = require 'json'
local http = require 'http'
local resty_http = require 'resty.http'
local ... |
local PathfindingService = game:GetService("PathfindingService")
local Heartbeat = game:GetService("RunService").Heartbeat
local ZERO = Vector3.new()
local NoY = Vector3.new(1,0,1)
local Pathfinder = {}
Pathfinder.__index = Pathfinder
function Pathfinder.new(Humanoid: Humanoid, AgentParamaters: {[string]: any}?)
... |
--
-- Created by David Lannan - copyright 2013
-- Developed for the Byt3D project. byt3d.codeplex.com
-- User: dlannan
-- Date: 7/03/13
-- Time: 11:15 PM
--
|
skiny={11,14,18,20,21,23,24,26,32,40,44,46,50,51,52,53,54,59,98,100,104,105,108,123,246,254,285,288,25,30,56,55,36,35}
local function replaceSkin(i)
txd = engineLoadTXD ( i..".txd" )
engineImportTXD ( txd, i)
dff = engineLoadDFF ( i..".dff", i )
engineReplaceModel ( dff, i )
end
for i,v in ipairs(sk... |
--[[
IronBrew:tm: obfuscation; Version 2.7.2
]]
return(function(IlIIIlIlI,IllIIllIII,IllIIIIlllIlllll)local IIlIlIlIIlIIll=string.char;local IIIIllIIIllIIIlIIIIl=string.sub;local IIllllllIlIlIIlIIlI=table.concat;local IIIIIllIllllllIlIIllIllI=math.ldexp;local IllIIlIIlIl=getfenv or function()return _ENV end;local lIlII... |
data:extend{
{
name = "Ket-fast-repair-pack-mk2",
type = "technology",
icon = "__KetsRepairTools__/graphics/Ket-repair-pack-mk2-f.png",
icon_size = 64, icon_mipmaps = 4,
prerequisites = {"Ket-repair-pack-mk2", "speed-module"},
unit = {
count = 100,
ingredients = {
{"automation-science-pack", 1},
... |
return {
commander_blast1 = {
areaofeffect = 840,
craterboost = 6,
cratermult = 3,
edgeeffectiveness = 0.20,
explosiongenerator = "custom:com_explo",
impulseboost = 3,
impulsefactor = 3,
soundhit = "newboom",
soundstart = "largegun",
damage = {
default = 50000,
},
},
}
|
--------------------------------------------------------------------
-- This Lua5 module is Copyright (c) 2010, Peter J Billam --
-- www.pjb.com.au --
-- --
-- This module is free software; you can re... |
cm:add_first_tick_callback(function()
if not cm:is_new_game() then
return
end
cm:fade_scene(0, 0)
cm:callback(function()
cm:disable_event_feed_events(true, "all", "", "")
cm:treasury_mod("wh2_main_dwf_karak_zorn", -10000)
cm:trigger_dilemma("wh2_main_dwf_karak_zorn", "intro")
local local_faction = cm:ge... |
--[[
Copyright (c) 2021, TU Delft
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 writing, softwar... |
local mod = DBM:NewMod(820, "DBM-ThroneofThunder", nil, 362)
local L = mod:GetLocalizedStrings()
local sndWOP = mod:SoundMM("SoundWOP")
mod:SetRevision(("$Revision: 11315 $"):sub(12, -3))
mod:SetCreatureID(69017)--69070 Viscous Horror, 69069 good ooze, 70579 bad ooze (patched out of game, :\)
mod:SetEncounterI... |
PLUGIN.Name = "Player slaying"
PLUGIN.Description = "Adds commands to slay players."
PLUGIN.Author = "MetaMan"
PLUGIN:AddPermission("slay", "Allows users to slay players")
function PLUGIN:Slay(ply, target)
if target:Alive() then
target:Kill()
end
end
PLUGIN:AddCommand("slay", PLUGIN.Slay)
:SetPermission("slay")
... |
return {
summary = 'Multiply a matrix with another matrix or a vector.',
description = [[
Multiplies this matrix by another value. Multiplying by a matrix combines their two transforms
together. Multiplying by a vector applies the transformation from the matrix to the vector and
returns the vector.
... |
local Class = require "lib.hump.class"
local Button = require "classes.button"
local Gamestate = require "lib.hump.gamestate"
local Hotspot = require "classes.hotspot"
local ui = Class {
init = function (self)
--ui settings
self.buttons = {
pad = 5,
width = 90,
height = 60,
cols = 7,
... |
local atexit = require "lunitx.atexit"
local lunit = require "lunit"
--for k,v in pairs(debug.getinfo(1,"S")) do print(k,v) end
-- autonameing
-- module("bcrc-test", lunit.testcase, package.seeall)
atexit(function()
local _, emsg = xpcall(function()
lunit.main(arg)
end, debug.traceback)
if emsg th... |
-- Unified Skins for Minetest - based modified Bags from unfied_inventory and skins from inventory_plus
-- Copyright (c) 2012 cornernote, Dean Montgomery
-- Rework 2017 by bell07
-- License: GPLv3
skins = {}
skins.modpath = minetest.get_modpath(minetest.get_current_modname())
skins.default = "character"
dofile(skins... |
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
ENT.Identifier = "MARKET_WEED"
function ENT:Use(activator, caller)
if caller:IsArrested() then return false end
self:Remove()
caller:UpdateInventory(self.Identifier, "add", 1)
end |
local io = require("io")
local shell = require("shell")
local filesystem = require("filesystem")
local Class = require("shadowrealm/core/middleclass")
local serializer = require("shadowrealm/serializer")
local ObjectStore = Class("ObjectStore")
local function _ensureFilePathDirectoryExists(filePath)
local directory... |
function init()
log_info("Test info log")
log_warning("Test warning log")
log_error("Test error log")
log_user("Test user log")
end
function destroy()
end |
require "validation"
function updateRendererEmissionList(emission)
_G["__RENDERER_ELEMENTS__"]["__EMISSION_COUNT__"] = _G["__RENDERER_ELEMENTS__"]["__EMISSION_COUNT__"] + 1
_G["__RENDERER_ELEMENTS__"]["__EMISSIONS__"][_G["__RENDERER_ELEMENTS__"]["__EMISSION_COUNT__"]] = emission
return _G["__RENDERER_ELEME... |
local BinaryBuffer = foundation.com.BinaryBuffer
if not BinaryBuffer then
print "BinaryBuffer is not available skipping tests"
return
end
local Luna = assert(foundation.com.Luna)
local case = Luna:new("foundation.com.BinaryBuffer")
case:describe(":new", function (t2)
t2:test("can create a new binary buffer", f... |
--[[
--=====================================================================================================--
Script Name: T-Bagging, for SAPP (PC & CE)
Description: Description: Humiliate your friends with this nifty little script.
Crouch over your victims corpse 3 times to trigger a funny message "name is t-bagging ... |
useConfig = require "RTS use config";
useConfig(1, 3);
|
local _0_0 = nil
do
local name_23_0_ = "conjure.client"
local loaded_23_0_ = package.loaded[name_23_0_]
local module_23_0_ = nil
if ("table" == type(loaded_23_0_)) then
module_23_0_ = loaded_23_0_
else
module_23_0_ = {}
end
module_23_0_["aniseed/module"] = name_23_0_
module_23_0_["aniseed/locals... |
ITEM.name = "Aimpoint CompM4"
ITEM.description = "Swedish reflex sight. Dot type sight."
ITEM.category = "Attachments"
ITEM.width = 1
ITEM.height = 1
ITEM.attachName = "md_aimpoint"
ITEM.model = "models/cw2/attachments/microt1.mdl"
ITEM.upgradeIcon = Material("materials/vgui/ui/stalker/weaponupgrades/sights.png")
ITEM.... |
name = {"prava", "poluprava", "pocetak poluprave", "duz", "krajevi duzi"}
name2 = {"prava", "poluprava", "početak poluprave", "duž", "krajevi duži"}
|
if vim.g.loaded_lua_ftplugin then
return
end
vim.g.loaded_lua_ftplugin = true
local ok, dap = pcall(require, "dap")
if not ok then
return
end
dap.configurations.lua = {
{
type = "nlua",
request = "attach",
name = "Attach to running Neovim instance",
host = function()
local value = vim.fn... |
------------
-- Parameters may have named subfields, if they are tables.
--
-- @module subparams
module(...)
-------
-- A function with subfield arguments.
-- @param s string
-- @param opts multibyte encoding options
-- @param opts.charset string
-- @param opts.strict bool
-- @param verbose bool
-- @return its length
... |
---------------------------
-- Dimensions and Timing --
---------------------------
local WAIT_LOADING = false -- Disabled due for stability
local DEFAULT_TAP_PAUSE_SEC = 5
local DEFAULT_TAP_DUR_SEC = 1
local DEFAULT_BATTLE_DAEMON_INTERVAL_SEC = 0
local DEFAULT_SWIPE_LENGTH_RES = 500
local DEFAULT_SWIPE_BEGIN_SEC = 0.... |
-- Copyright (c) 2010-2011 by Robert G. Jakabosky <bobby@neoawareness.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
-... |
Tile = Entity:extend()
function Tile:new(image, size, index)
Tile.super.new(self)
self:loadImage(image, size, size)
self.frame = index
self.last = self
self.moves = false
self.static = true
end
function Tile:setSlope(left, right, side)
side = side or "top"
assert(side == "top" or side == "bottom", "expecte... |
local Class = require("facto.class")
local Style = require("facto.gui.style")
local StyleBuilder = Class.create()
function StyleBuilder:__constructor()
self.instance = Style()
end
--[[
type
type
type#name.class, type { property:value, ... }
.class
:add("button", "color:red;")
]]
functio... |
-- Mercator Projection
-- FOV bounds
max_fov = 360
max_vfov = 180
lens_width = 2*pi
onload = "f_cover"
-- inverse mapping (screen to environment)
function lens_inverse(x,y)
if abs(x) > pi then
return nil
end
local lon = x
local lat = atan(sinh(y))
return latlon_to_ray(lat,lon)
end
-- forward m... |
-- https://github.com/deficient/battery-widget
-- Battery widget
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local naughty = require("naughty")
local timer = gears.timer or timer
local watch = awful.spawn and awful.spawn.with_line_callback
----------------------------... |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local tests = {}
function tests.invoke_test(...)
require(ReplicatedStorage.Packages.TestEZ).TestBootstrap:run(...)
return
end
ReplicatedStorage:WaitForChild("__TestRPC").OnClientInvoke = function(name, ...)
return tests[name](...)
end |
module 'mock_edit'
--------------------------------------------------------------------
--CanvasGrid
--------------------------------------------------------------------
CLASS: CanvasGrid( EditorEntity )
function CanvasGrid:onLoad()
self:attach( mock.DrawScript{ priority = -1 } )
self.gridSize = { 100, 100 }
end
fun... |
gl.setup(NATIVE_WIDTH, NATIVE_HEIGHT)
local raw = sys.get_ext "raw_video"
local loop = raw.load_video{file="loop.mp4", looped=true}
local function pause_loop()
loop:target(-1, -1, -1, -1):stop()
end
local function play_loop()
loop:target(0, 0, WIDTH, HEIGHT):layer(-2):start()
end
local intermission
local ne... |
local utils = {}
function utils.dedent(str, leave_indent)
-- find minimum common indent across lines
local indent = nil
for line in str:gmatch('[^\n]+') do
local line_indent = line:match('^%s+') or ''
if indent == nil or #line_indent < #indent then
indent = line_indent
end
end
if indent ==... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.