content stringlengths 5 1.05M |
|---|
local EventManager = require "utils.EventManager"
local activityid = 0
local function Setactivityid(id)
activityid = id
end
local function Getactivityid()
return activityid
end
local NextMonstergid = 0
local function SetNextMonstergid(gid)
NextMonstergid = gid
end
local function GetNextMonstergid()
return NextMonst... |
local boxes = 0;
local mechanicDisabled = true;
local canMessage = true;
function onCreate()
if string.lower(songName):gsub(' ', '-') == 'warning' then
mechanicDisabled = false;
end
end
function onBeatHit()
if curBeat % 2 == 0 then
if canMessage and not mechanicDisabled then
b... |
-- File: DragonKnight.lua
-- Author: EroicaCpp (https://github.com/Eroica-cpp/dota2scripts)
-- Version: 1.0
-- Release Date: 2017/6/26
local Utility = require("Utility")
local DragonKnight = {}
local optionKillSteal = Menu.AddOption({"Hero Specific", "Dragon Knight"}, "Kill Steal", "Cast breathe fire on enemy to KS"... |
-- permisje
ADMIN_LEVEL_SPT2 = -2
ADMIN_LEVEL_SPT3 = -3
ADMIN_LEVEL_ADM = 1
ADMIN_LEVEL_NONE = 0
-- Serwer
SERVER_VERSION = "LS-RP.net v0.7 \n[ALPHA Preview]"
-- Status debug
DEBUG_MODE = false
function getDebugStatus()
return DEBUG_MODE
end
-- Nazwy rang
rank = {}
rank[0] = "Gracz"
rank[1] = "Administrator"
rank[... |
-- By Tingle
TOOL.Category = "SBEP"
TOOL.Tab = "Spacebuild"
TOOL.Name = "#Part Assembler"
TOOL.Command = nil
TOOL.ConfigName = ""
TOOL.ClientConVar["skin"] = 0
TOOL.ClientConVar["mode"] = 1
TOOL.ClientConVar["nocollide"] = 0
TOOL.SPR = {}
TOOL.SPE = {}
if SERVER then
local function AddMaterials()
local... |
function onCreate()
-- background shit
makeLuaSprite('nightsky', 'nightsky', -700, -200);
setScrollFactor('nightsky', 0.9, 0.9);
makeLuaSprite('final dest', 'final dest', -750, -200);
setScrollFactor('final dest', 1.0, 1.0);
addLuaSprite('nightsky', false);
addLuaSprite('final dest', false);
close(true); --F... |
--[[
Day 25: Turing Tape
]]
print("---------------- Day 25 ----------------")
function Day25(input)
local states = {}
local current_state, max_steps
local val, state, ifval -- Temporaries during reading
local MOVE = {left = -1, right = 1}
-- Read States into states array
for _, line in pairs(input)... |
local guide = require 'parser.guide'
return function (ast, offset, accept)
local len = math.huge
local result
guide.eachSourceContain(ast.ast, offset, function (source)
local start, finish = guide.getStartFinish(source)
if finish - start < len and accept[source.type] then
re... |
ATTRIBUTE.name = "Cooking"
ATTRIBUTE.category = "Proffesions"
ATTRIBUTE.description = "The ability to cook like a chef." |
local _, NeP = ...
-- Locals
local LibStub = LibStub
local strupper = strupper
local CreateFrame = CreateFrame
local DiesalGUI = LibStub("DiesalGUI-1.0")
local DiesalTools = LibStub("DiesalTools-1.0")
local SharedMedia = LibStub("LibSharedMedia-3.0")
function NeP.Interface:Header(element, parent, o... |
---Exercise 30.1: Implement a filter function in C. It should receive a list and a predicate and return a new
---list with all elements from the given list that satisfy the predicate:
--- t = filter({1, 3, 20, -4, 5}, function (x) return x < 5 end) -- t = {1, 3, -4}
---(A predicate is just a function that tests some co... |
local _2afile_2a = "fnl/conjure/extract/searchpair.fnl"
local _2amodule_name_2a = "conjure.extract.searchpair"
local _2amodule_2a
do
package.loaded[_2amodule_name_2a] = {}
_2amodule_2a = package.loaded[_2amodule_name_2a]
end
local _2amodule_locals_2a
do
_2amodule_2a["aniseed/locals"] = {}
_2amodule_locals_2a = ... |
--[[
Goal: evaluate Lua expression.
Start: 2006-02-?? by Shmuel Zeigerman
--]]
local sd = require "far2.simpledialog"
local M = require "lf4ed_message"
local F = far.Flags
local function ErrMsg (msg)
far.Message(msg, M.MError, M.MOk, "w")
end
local function GetNearestWord (pattern)
local line = editor.GetStrin... |
-- This is a part of uJIT's testing suite.
-- Copyright (C) 2020-2021 LuaVela Authors. See Copyright Notice in COPYRIGHT
-- Copyright (C) 2015-2020 IPONWEB Ltd. See Copyright Notice in COPYRIGHT
--
-- LuaJIT: demonstracni priklad cislo 53.
--
-- Test JITu - volani funkce
--
-- deklarace a inicializace lokalnich pro... |
-----------------------------------
-- Area: Open_sea_route_to_Mhaura
-- NPC: Sheadon
-- Notes: Tells ship ETA time
-- !pos 0.340 -12.232 -4.120 47
-----------------------------------
local ID = require("scripts/zones/Open_sea_route_to_Mhaura/IDs");
-----------------------------------
function onTrade(player,npc,trad... |
require('lualine').setup {
options = {
icons_enabled = false,
theme = 'gruvbox_dark',
component_separators = '',
section_separators = '',
},
sections = {
lualine_a = {'mode'},
lualine_b = {},
lualine_c = {
{
'filename',
path = 1,
shorting_target = 0,
... |
------------------------------------------------------------------------
--[[ NarrowDictionary ]]--
-- Adapts a nn.NarrowLookupTable
------------------------------------------------------------------------
local NarrowDictionary, parent = torch.class("dp.NarrowDictionary", "dp.Dictionary")
NarrowDictionary.isNarrowDic... |
object_tangible_food_crafted_beastfood_cooked_fish_substitute = object_tangible_food_crafted_shared_beastfood_cooked_fish_substitute:new {
}
ObjectTemplates:addTemplate(object_tangible_food_crafted_beastfood_cooked_fish_substitute, "object/tangible/food/crafted/beastfood_cooked_fish_substitute.iff")
|
MainMenuBarLeftEndCap:Hide()
MainMenuBarRightEndCap:Hide() |
textutils.pagedPrint([[To customize your fireworks show, StarCaster must be set to Show Type: Fancy
StarCaster randomly generates fireworks based on the parameters you supply and the inventory you've loaded into the fireworks launcher. StarCaster recognizes creative launchers and responds accordingly - no need for an... |
local SharedMedia = LibStub("LibSharedMedia-3.0");
local default = {
displayText = "New",
outline = true,
color = {1, 1, 1, 1},
justify = "LEFT",
selfPoint = "BOTTOM",
anchorPoint = "CENTER",
xOffset = 0,
yOffset = 0,
font = "Friz Quadrata TT",
fontSize = 12,
frameStrat... |
local GetNumGroupMembers = GetNumGroupMembers;
local twipe = table.wipe;
local tonumber = tonumber;
local pairs = pairs;
local ipairs = ipairs;
local _;
VUHDO_GROUP_SIZE = 1;
VUHDO_PROFILES = { };
local VUHDO_DEFAULT_PROFILES = {
{
["NAME"] = VUHDO_I18N_DEF_BIT_O_GRID,
["CONFIG"] = {
["DIRECTION"] = {
["i... |
local default_config = {
cwd = vim.fn.stdpath("data").."/sessions",
force_overwrite = false,
force_delete = false,
bdelete = false,
verbose = true,
}
local config = vim.deepcopy(default_config)
local mt = {}
mt.__index = mt
mt.__newindex = function(self, k, v)
error("Assigning new values is not allowed ... |
local LogService = game:GetService("LogService")
local HttpService = game:GetService("HttpService")
--Create Toolbar
local toolbar = plugin:CreateToolbar("Roblox Package Index")
local button = toolbar:CreateButton("Roblox Package Index", 'Run "rpi help" in the command line to get started.', "rbxassetid://4458901886")... |
return {
summary = 'A fixed distance joint.',
description = [[
A DistanceJoint is a type of `Joint` that tries to keep two colliders a fixed distance apart.
The distance is determined by the initial distance between the anchor points. The joint allows
for rotation on the anchor points.
]],
extends ... |
-----------------------------------------------
-- Sample of SlibJfont.lua for W4.00.03
-- Copyright (c) 2019, Saya
-- All rights reserved.
-- 2019/05/15 rev.0.02
-----------------------------------------------
function chkBreak(n)
sleep(n or 0)
if fa.sharedmemory("read", 0x00, 0x01, "") == "!" then
error("Break!"... |
local thispath = select('1', ...):match(".+%.") or ""
require(thispath.."testSkeletorBasicLoading")
require(thispath.."testSkeletorBone")
require(thispath.."testSkeletorComplexLoading")
require(thispath.."testSkeletorDraw")
require(thispath.."testSkeletorGettersSetters")
require(thispath.."testSkeletorSkeleton")
requi... |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('XTemplate', {
group = "PreGame",
id = "PGTutorialNew",
PlaceObj('XTemplateWindow', nil, {
PlaceObj('XTemplateWindow', {
'__class', "XAspectWindow",
'Fit', "smallest",
}, {
PlaceObj('XTemplateLayer', {
'layer', "PGVideoBackg... |
local W = require 'winapi'
local r,w = W.pipe()
local m = W.mutex()
function lprint(...)
m:lock()
print(...)
m:release()
end
function long(name)
lprint('hello',name)
for i = 1,2 do
m:lock()
w:write(name..i)
m:release()
for i = 1,1e8 do end
end
end
r:read_async(function(s)
lprint(... |
--- 下载dirid目录zip
local http = require("resty.http")
local inheaders = ngx.req.get_headers()
local inmethod = ngx.var.request_method
local fileManager = "http://127.0.0.1:8081/"
-- 读取get请求参数
local local_args = ngx.req.get_uri_args()
-- dirid参数传入所在目录名称
local dirid = local_args["dirid"]
if nil == dirid then
ngx.say("... |
return {
uv_buf_t = require 'uv/ctypes/uv_buf_t',
uv_check_t = require 'uv/ctypes/uv_check_t',
uv_connect_t = require 'uv/ctypes/uv_connect_t',
uv_fs_t = require 'uv/ctypes/uv_fs_t',
uv_getaddrinfo_t = require 'uv/ctypes/uv_getaddrinfo_t',
uv_handle_t = require 'uv/ctypes/uv_handle_t',
uv_idle_t = require... |
return require('maintenance_mode')
|
local FollowGenerator = {}
FollowGenerator.__index = FollowGenerator
function FollowGenerator:new(productions, first)
assert(productions, "Need a productions table to make follow table")
return setmetatable({
productions = productions,
producers = {},
first = first,
follow = {}... |
-----------------------------------------------------------------------------------------------------------------------
-- Third-party applications keys sheet --
--------------------------------------------------------------------------------... |
return { {
code = 1,
rgb = { 0, 0, 0 }
}, {
code = 2,
rgb = { 128, 0, 0 }
}, {
code = 3,
rgb = { 0, 128, 0 }
}, {
code = 4,
rgb = { 128, 128, 0 }
}, {
code = 5,
rgb = { 0, 0, 128 }
}, {
code = 6,
rgb = { 128, 0, 128 }
}, {
code = 7,
rgb = { 0, 128, 128... |
#!/usr/bin/env lua
local fl = require( "fltk4lua" )
local window = fl.Window( 200, 105 )
function window:callback()
local hotspot = fl.message_hotspot()
fl.message_hotspot( false )
local rep = fl.choice( "Are you sure you want to quit?",
"Cancel", "Quit", "Dunno" )
fl.message_hotspot( ... |
--# selene: allow(unused_variable)
---@diagnostic disable: unused-local
-- Simple controls for the MiLight LED WiFi bridge (also known as LimitlessLED and EasyBulb)
---@class hs.milight
local M = {}
hs.milight = M
-- Deletes an `hs.milight` object
--
-- Parameters:
-- * None
--
-- Returns:
-- * None
function M:dele... |
net.Receive("se_event", function(len)
local event = net.ReadString()
local compress = net.ReadBool()
local args = {}
if compress then
local len = net.ReadInt(32)
args = net.ReadData(len)
args = util.JSONToTable( util.Decompress( args ) )
else
args = net.ReadTable()
end
hook.Run("se_even... |
include("plat/build.lua")
headermap = {}
packagemap = {}
local function addheader(h)
headermap[h] = "./"..h
packagemap["$(PLATIND)/cpm/include/"..h] = "./"..h
end
addheader("ack/plat.h")
addheader("ack/file.h")
addheader("sys/types.h")
addheader("cpm.h")
acklibrary {
name = "headers",
hdrs = headermap
}
instal... |
-------------------------------------------------------------------------------
--[[FDOC
@id TppTrapCheckIntrude
@category TppTrap
Intrude用Trap実行可能かどうかの確認のScript
]]
--------------------------------------------------------------------------------
TppTrapCheckIntrude = {
--- 条件関数
-- 入った人にPlayerタグがついていたら実行
Check = f... |
local path = "UserPrefs/" .. THEME:GetThemeDisplayName() .. "/"
-- Hook called during profile load
function LoadProfileCustom(profile, dir, isEdit)
local PrefPath = dir .. path
if isEdit ~= true then
local pn
-- we've been passed a profile object as the variable "profile"
-- see if it matches against anyth... |
--Basic module
local logger = require("utilities.logger")
local telegram = require("telegram")
local localization = require("utilities.localization")
local supportedLanguages = localization.supportedLanguages()
local InlineKeyboardButton = telegram.structures.InlineKeyboardButton
local InlineKeyboardMarkup = telegram... |
require "class"
local G = 6.67408e-11
particle_system = class:new()
function particle_system:init()
self.particles = {}
end
function particle_system:calculate_acceleration(p)
local ax, ay = 0, 0
for i=1, #self.particles do
local pp = self.particles[i]
if pp ~= p then
local dx = p.x - pp.x
... |
local message_pin_map = require("qnFiles/qnPlist/hall/message_pin");
local noticeLayout=
{
name="noticeLayout",type=0,typeName="View",time=0,report=0,x=0,y=0,width=1280,height=720,visible=1,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignTopLeft,
{
name="bg_top",type=1,typeName="Image",time=77358592,report=0,x... |
local awful = require("awful")
local gears = require("gears")
local beautiful = require("beautiful")
local wibox = require("wibox")
-- Get theme variables
local floating_color = beautiful.desktop_mode_color_floating or "#1D8CD2"
local tile_color = beautiful.desktop_mode_color_tile or "#2DD283"
local max_color = beauti... |
-- {"regionName", xCenter, yCenter, shape and size, tier, {"spawnGroup1", ...}, maxSpawnLimit}
-- Shape and size is a table with the following format depending on the shape of the area:
-- - Circle: {1, radius}
-- - Rectangle: {2, width, height}
-- - Ring: {3, inner radius, outer radius}
-- Tier is a bit mask wit... |
SILE.registerCommand("thisframeLTR", function(options, content)
SILE.typesetter.frame.direction = "LTR"
SILE.typesetter:leaveHmode()
SILE.typesetter.frame:newLine()
end)
SILE.registerCommand("thisframedirection", function(options, content)
SILE.typesetter.frame.direction = SU.required(options, "direction", "fr... |
RemoteEvent:FireServer()
RemoteEvent.OnServerEvent:Connect(function(player)
--Statements
end)
RemoteEvent:FireClient(player) --Sends signal to single client
RemoteEvent:FireAllClients() --Sends signal to all clients
--server
wait(5)
RemoteEvent:FireAllClients("Game over!", "Blue team has won!")
... |
local BasePlugin = require "kong.plugins.base_plugin"
local CustomHandler = BasePlugin:extend()
CustomHandler.PRIORITY = 10
function CustomHandler:new()
CustomHandler.super.new(self, "conditional-upstream")
end
function CustomHandler:init_worker(config)
-- Eventually, execute the parent implementation
-- (will... |
local Proxy = module("vrp", "lib/Proxy")
local Tunnel = module("vrp", "lib/Tunnel")
vRP = Proxy.getInterface("vRP")
vRPclient = Tunnel.getInterface("vRP","vrp_stationaryRadars")
RegisterServerEvent('cobrarMulta')
AddEventHandler('cobrarMulta', function()
local user_id = vRP.getUserId({source})
local player = vRP.ge... |
Sprite_TitleCommand = Sprite:extend("Sprite_TitleCommand")
function Sprite_TitleCommand.prototype:constructor(index, image, command)
Sprite.prototype.constructor(self, image)
local w, h = image:getDimensions()
self.index = index
self.command = command
self.position:set((Game_Camera.width - w) / 2, Game_Came... |
--[[
MIT License
Copyright (c) 2019 Michael Wiesendanger
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, mod... |
-- oUF_SimpleConfig: tags
-- zork, 2016
-----------------------------
-- Variables
-----------------------------
local A, L = ...
-----------------------------
-- Tags
-----------------------------
local floor = floor
--tag method: oUF_SimpleConfig:status
L.C.tagMethods["oUF_SimpleConfig:status"] = function(unit,... |
local buf = require('lib.buf')
local M = {}
M.__index = M
-- local config = {
-- relative = 'editor' | 'win' | 'cursor' | '',
-- win = winid,
-- anchor = 'NW' | 'NE' | 'SW' | 'SE',
-- width = 0,
-- height = 0,
-- row = 0,
-- col = 0,
-- focusable = true,
-- zindex = 100,
-- bord... |
slot2 = "CheckSplashCompleteBean"
CheckSplashCompleteBean = class(slot1)
CheckSplashCompleteBean.ctor = function (slot0)
slot4 = AbstractBean
ClassUtil.extends(slot2, slot0)
end
CheckSplashCompleteBean.start = function (slot0)
if ProxyClientSplash then
slot3 = ProxyClientSplash
if not ProxyClientSplash.isCom... |
-- Natural Selection 2 Competitive Mod
-- Source located at - https://github.com/xToken/CompMod
-- lua\CompMod\Structures\Alien\Veil\client.lua
-- - Dragon
local originalVeilOnUpdate
originalVeilOnUpdate = Class_ReplaceMethod("Veil", "OnUpdate",
function(self, deltaTime)
originalVeilOnUpdate(self, deltaTime)
if s... |
--------------------------------------------------------------------------------
---------------------- ## ##### ##### ###### -----------------------
---------------------- ## ## ## ## ## ## ## -----------------------
---------------------- ## ## ## ## ## ###### --------------------... |
package.path = "../?.lua;"..package.path
local ffi = require("ffi")
local bea = require("lj2beaengine.beaengine")
local code = "\x62\x02\x05\x40\x00\x44\x33\x22"
local pDisAsm = ffi.new("DISASM")
pDisAsm.EIP = ffi.cast("UInt64", code);
local res = bea.Disasm(pDisAsm)
print("Result: ", res)
print("OP: ", ffi.strin... |
Object = require "classic"
Hitspark = Object.extend(Object)
local frames = {
love.graphics.newImage("stills/sonicExplosion00.png"),
love.graphics.newImage("stills/sonicExplosion00.png"),
love.graphics.newImage("stills/sonicExplosion01.png"),
love.graphics.newImage("stills/sonicExplosion01.png"),
love.graph... |
local ngx = {}
describe("index construction", function()
package.path = package.path .. ";./lib/resty/gozerian/?.lua"
local index = require('lua-gozerian')
it('init',function()
index.init()
end)
it('body',function()
index.body_filter()
end)
it('header',function()
index.header_filter()
end... |
--------------------------------
-- @module TableView
-- @extend ScrollView,ScrollViewDelegate
-- @parent_module cc
--------------------------------
-- Updates the content of the cell at a given index.<br>
-- param idx index to find a cell
-- @function [parent=#TableView] updateCellAtIndex
-- @param self
-- @param #... |
function _update()
if game_state == 'running' then
for wall in all(walls) do
wall_update(wall)
end
end
end
function wall_update(self)
if not self.enabled then
self.delay -= 1
if self.delay <= 0 then
self.enabled = true
end
return
end
self.x -= 2.5
if self.x <= -16 then
... |
local function xml_esc (s)
s = string.gsub(s, "<", "<")
s = string.gsub(s, ">", ">")
s = string.gsub(s, "&", "&")
return s
end
local function table_keys (t)
local keyset = {}
local n = 0
for k in pairs(t) do
n = n + 1
keyset[n] = k
end
table.sort(keyset)
return keyset
end
--for k... |
meta.name = "Inventory Example"
meta.version = "0.1"
meta.description = "Examples for using player inventory."
meta.author = "jeremyhay"
local names = {}
for i,v in pairs(ENT_TYPE) do
names[v] = i
end
-- display the items and the powerups in the player's inventory
set_callback(function(draw_ctx)
if players and ... |
require "tests/testsuite"
Cmd.InsertStringIntoParagraph("The quick brown fox jumps")
Cmd.SplitCurrentParagraph()
Cmd.ChangeParagraphStyle("RAW")
Cmd.InsertStringIntoParagraph("over the lazy")
Cmd.SplitCurrentParagraph()
Cmd.ChangeParagraphStyle("P")
Cmd.InsertStringIntoParagraph("dog.")
Cmd.GotoBeginningOfDocument()
... |
-- Use of this source code is governed by the Apache 2.0 license; see COPYING.
-- Provide a time stamp counter suitable for measuring time intervals.
module(...,package.seeall)
local lib = require("core.lib")
local C = require("ffi").C
require("core.lib_h")
default_source = 'rdtsc'
local calibration_interval = 5e... |
--=========== Copyright © 2020, Planimeter, All rights reserved. ===========--
--
-- Purpose:
--
--==========================================================================--
--[[
* Copyright (c) 2006-2018 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In ... |
-- Change the preferences of a unit.
--@ module = true
local help = [====[
assign-preferences
==================
A script to change the preferences of a unit.
Preferences are classified into 12 types. The first 9 are:
* like material;
* like creature;
* like food;
* hate creature;
* like item;
* like plant;
* like ... |
local exit_query = {
{
name = "no",
label = "No",
kind = "action",
handler = function() end
},
{
name = "yes",
label = "Yes",
description = "This will close external connections, any unsaved data will be lost",
kind = "action",
dangerous = true,
handler = function() shutdown(); end
},
{
name = "silent",
lab... |
--!strict
--[[
Defers and orders UI data binding updates.
]]
local RunService = game:GetService("RunService")
local Package = script.Parent.Parent
local None = require(Package.Utility.None)
type Set<T> = {[T]: any}
local Scheduler = {}
local willUpdate = false
local propertyChanges: {[Instance]: {[string]: any}}... |
-- DFL - Data Flow Language in final tagless style
--
-- Context is pure event-driven data flow systen design, with
-- simulation in lua + compilation to C with static metadata.
local dfl = {
-- semantics objects
eval = {},
comp = {},
}
-- A choice is made to stick to lua semantics and make all function
-- ... |
local function genCode(handler)
local settings = handler.project:GetSettings("Publish").codeGeneration
local codePkgName = handler:ToFilename(handler.pkg.name); --convert chinese to pinyin, remove special chars etc.
local exportCodePath = handler.exportCodePath..'/'..codePkgName
local namespaceName = co... |
package.cpath = "bin/?.dll"
local iup = require "iuplua"
local bgfx = require "bgfx"
local util = require "util"
local math3d = require "math3d"
local settings = {
speed = 0.37,
middleGray = 0.18,
white = 1.1,
threshold = 1.5,
}
local function slider(name, title, min, max)
local value = assert(settings[name])
... |
CaveBot.Editor.ExampleFunctions = {}
local function addExampleFunction(title, text)
return table.insert(CaveBot.Editor.ExampleFunctions, {title, text:trim()})
end
addExampleFunction("Click to browse example functions", [[
-- available functions/variables:
-- prev - result of previous action (true or false)
-- retri... |
local K = unpack(select(2, ...))
local table_wipe = table.wipe
function K.LoadSkadaProfile()
if SkadaDB then
table_wipe(SkadaDB)
end
SkadaDB = {
["profiles"] = {
["Default"] = {
["showself"] = false,
["autostop"] = true,
["modules"] = {
["notankwarnings"] = true,
},
["windows"] = {... |
-- weapon extension
require "/lib/stardust/weaponutil.lua"
local follow = false
local armAngle = 0
local setArmAngle = activeItem.setArmAngle
function activeItem.setArmAngle(angle, f)
follow = not not f
if follow then angle = angle - mcontroller.rotation() * mcontroller.facingDirection() end
armAngle = angle
r... |
-- general utility functions:
-- exponential table lookup:
-- goes from 0 to 1, 1002 entries. 0 is scaled to be .001 in the real e^-x
--function
-- should be read going from 2 to 1001 (for cubic interpolation)
local exptab = {}
for i=1, 1002 do
exptab[i] = (math.exp((i-1001)*0.00691466994893) - 0.001)/0.999
end
--cl... |
-- Copyright (c) 2021 Kirazy
-- Part of Artisanal Reskins: Bob's Mods
--
-- See LICENSE in the project directory for license information.
-- Requires
local migration = require("__reskins-library__.prototypes.functions.migration")
local function on_configuration_changed(data)
for _, player in pairs(game.connected_... |
#!/usr/local/bin/lua
--
-- This is part of the release script.
--
-- See release.sh for more explanation.
--
deimos = dofile("./deimos.lua")
print(deimos.version)
|
;; [Write]
|
workspace "ace"
configurations { "Debug", "Release" }
platforms { "x64", "x86" }
startproject "example-app"
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
filter { "platforms:x86" }
architecture "x86"
filter { "pla... |
#!/usr/local/bin/lua
io.output("simple-io.out")
msg = [[
我爱中国
黄土高坡
]]
io.write(msg)
|
package.path = './?.lua;./scripts/?.lua;' -- could add .. package.path
package.cpath = './?.dll;./scripts/?.dll;' -- could add .. package.cpath
--io.write( package.path .. '\n\n')
--io.write( package.cpath .. '\n\n')
--require("mobdebug").start()
local defs = require("usb_defs")
local stdRequestMod = req... |
local pretty = require 'pl.pretty'
local utils = require 'pl.utils'
local test = require 'pl.test'
local asserteq, assertmatch = test.asserteq, test.assertmatch
t1 = {
'one','two','three',{1,2,3},
alpha=1,beta=2,gamma=3,['&']=true,[0]=false,
_fred = {true,true},
s = [[
hello dolly
you're so fine
]]
}
... |
local E, L, V, P, G, _ = unpack(select(2, ...)); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
--NamePlate
P['nameplates_v1'] = {
['statusbar'] = 'ElvUI Norm',
['font'] = 'PT Sans Narrow',
['fontSize'] = 11,
['fontOutline'] = 'OUTLINE',
['healthFont'] = 'PT Sans Narrow',
['healthFontSize'] = 11,
['h... |
require 'lib.middleclass'
require 'TextInput'
require "level1"
require "level2"
require "level3"
http = require("socket.http")
function love.load()
time = 0
startingtime = 60
countdown = startingtime
restarttime = 0
score = 0
level = 1
gameOver = false
hasMustache = false
inputActiv... |
MP = {}
MP.Config = {}
MP.Config.Locales = {
['alreadyRobbed'] = "¡Ya me han robado y ~r~no ~w~me queda dinero!",
['cashrecieved'] = 'Has robado:',
['currency'] = '€',
['no_cops'] = '~r~No ~w~hay suficientes ~b~policías',
['cop_msg'] = 'La cámara de seguridad ha tomado una foto del ladrón',
['k... |
local SceneEntityState = require "njli.statemachine.sceneentitystate"
local BoardselectSceneEntityState = {}
BoardselectSceneEntityState.__index = BoardselectSceneEntityState
local json = require('json')
setmetatable(BoardselectSceneEntityState, {
__index = SceneEntityState,
__call = function (cls, ...)
... |
--
-- Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
-- Edition) available.
-- Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
-- Licensed under the MIT License (the "License"); you may not use this file except in compliance with... |
--[[
libFlashTime v0.2
Copyright (c) 2015, GPS_NMEA
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and t... |
-- Script for getting resources from github
local args = {...}
if #args < 3 or #args > 4 then
print("Usage: github <user> <repo> <folder> [branch]")
return
end
local gh_username = args[1]
local gh_repo = args[2]
local gh_folder = args[3]
local gh_branch = nil
if args[4] then gh_branch = args[4] end
-- Const... |
---
-- Premake script-side program entry point.
---
_EMPTY = setmetatable({}, {
__newindex = function ()
error('attempted to modify `_EMPTY`')
end
})
forceRequire('_G')
forceRequire('string')
forceRequire('table')
forceRequire('os')
forceRequire('io')
local main = require('main')
function _premake_main()
main.... |
if wmChat then
if IsValid(wmChat.dFrameHtml) then
wmChat.dFrameHtml:Remove()
end
end
GM = GM or GAMEMODE
local CONFIG = wmChat.config
wmChat.dFrameHtml = vgui.Create("DFrame")
if !IsValid(wmChat.dFrameHtml) then
wmChat.ChatLoaded = false
return
end
wmChat.ChatLoaded = true
wmChat.dFrameHtml... |
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, command = helpers.clear, helpers.command
local eval = helpers.eval
local eq = helpers.eq
local exc_exec = helpers.exc_exec
describe("'fillchars'", function()
local screen
before_each(fun... |
#!/usr/bin/env lua
local sys = require"sys"
local thread = sys.thread
thread.init()
local NFORKS = 5
local NPHILOSOPHERS = NFORKS
local NSPAGHETTI = 3
-- Forks
local forks
do
forks = assert(thread.data_pool())
for i = 1, NFORKS do
forks:put(1)
end
end
-- Philosophers
do
local n = NPHILOSOPHERS
loca... |
-- KEYS[1]: full path of entry
local fullpath = KEYS[1]
-- KEYS[2]: full path of entry
local fullpath_list_key = KEYS[2]
-- KEYS[3]: dir of the entry
local dir_list_key = KEYS[3]
-- ARGV[1]: isSuperLargeDirectory
local isSuperLargeDirectory = ARGV[1] == "1"
-- ARGV[2]: name of the entry
local name = ARGV[2]
redis.cal... |
-- Copyright (c) 2017-present, Facebook, Inc.
-- All rights reserved.
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
local f = io.open(ar... |
local json = config.json
return {
handler = function(context)
pcall(function()
context.input = json.decode(context.request.body)
end)
end,
options = {
predicate = function(context)
if config.default then
return true
end
local content = context.request.headers["conten... |
local disable = function() cancelEvent() end
local pickupsDisabled = false
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()),
function()
for i,player in ipairs(getElementsByType"player") do
spawnPlayer ( player, 2483, -1666, 21, 0, 0, 0, getWorkingDimension() )
end
disablePickups... |
local check = require "../src/check"
describe("The check module", function()
it("has a check directory predefined on the module", function()
local expected = os.getenv("HOME") .. "/.config/check-republic/checks"
local actual = check.directory
assert.are.equal(expected, actual)
end)
end... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.