content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
--[[
Desc: 3D Bound box, composition of 2 rectangles.
Author: SerDing
Since: 2020-04-19
Alter: 2020-04-19
]]
local _Rect = require("engine.graphics.drawable.rect")
---@class Entity.Drawable.Box : Engine.Graphics.Drawable.Base
local _Box = require("core.class")()
function _Box:Ctor(x, y1, y2, w, h1, h2)
... | nilq/small-lua-stack | null |
-- Weather mixed updates the variables live, unlike the Data.
-- This can't be set tho.
StormFox2.Mixer = {}
-- Local function
local function isColor(t)
return t.r and t.g and t.b and true or false
end
local function Blender(nFraction, vFrom, vTo) -- Will it blend?
-- Nils should be false, if one of them is a boole... | nilq/small-lua-stack | null |
local Tunnel = module("vrp","lib/Tunnel")
local Proxy = module("vrp","lib/Proxy")
vRP = Proxy.getInterface("vRP")
--[ VARIÁVEIS ]---------------------------------------------------------------------------------------------------------------
local showcoords = false
--[ CONEXÃO ]--------------------------------------... | nilq/small-lua-stack | null |
local nk = require("nakama")
local id = "金币"
local authoritative = false
local sort = "desc"
local operator = "best"
local reset = "0 0 * * 1"
local metadata = {
placeholder = "nothing"
}
nk.leaderboard_create(id, authoritative, sort, operator, reset, metadata)
| nilq/small-lua-stack | null |
local data = require("core.data")
data.define_prototype("item_chip")
data.add(
"core.item_chip",
{
empty = {
integer_id = 0,
source = {
x = 0,
y = 0,
}
},
projectile_arrow = {
integer_id = 1,
source = {
x = 48,
... | nilq/small-lua-stack | null |
math.randomseed( os.time() )
loader.SetJointIndex(math.random(0, 60)) -- (0, No of Joint Index)
loader.SetXOffset(math.random() + math.random(-1.0, 0.0))
loader.SetYOffset(math.random() + math.random(-1.0, 0.0))
loader.SetZOffset(math.random() + math.random(-1.0, 0.0)) | nilq/small-lua-stack | null |
-- // bekiroj
local kelepceyeri = createColSphere ( 1424.9951171875, -1292.7138671875, 13.556790351868, 3)
function kelepcekir(thePlayer, cmd)
if not isElementWithinColShape(thePlayer, kelepceyeri) then return end
if getElementData(thePlayer, "kelepce") or getElementData(thePlayer, "ipbagli") then
local mikta... | nilq/small-lua-stack | null |
local _=require 'leda'
local function sink(resp)
local f=ltn12.sink.table(resp)
return function(...)
-- leda.nice()
return f(...)
end
end
--Fetch a https url.
--Requires luasec.
local function get_https(url)
local http = require("ssl.https")
local resp = {}
local r, c, h, s=http.request{
url = url,
s... | nilq/small-lua-stack | null |
local vim = vim
local api = vim.api
local M = {}
function M.nvim_create_augroups(definitions)
for group_name, definition in pairs(definitions) do
vim.api.nvim_command('augroup '..group_name)
vim.api.nvim_command('autocmd!')
for _, def in ipairs(definition) do
local command = table.concat(vim.tbl_fl... | nilq/small-lua-stack | null |
local Datasheet = require "Datasheet"
local Peripherial = require "Peripherial"
return Datasheet {
id = "uart",
name = "TinyUART",
brief = "A 16C550 compatible UART component.",
registers = Peripherial.RegisterSet {
Peripherial.Register("RBR", 0, 1, "RO", "(DLAB=0) Receiver buffer"),
Peripherial.Regis... | nilq/small-lua-stack | null |
if not DISABLE_WOODEN_BOW then
throwing_register_bow ('bow_wood', 'Wooden bow', {x=1, y=1, z=0.5}, 11, 1.6, 50, false, {
{'', 'default:stick', ''},
{'farming:string', '', 'default:stick'},
{'', 'default:stick', ''},
})
end
if not DISABLE_LONGBOW then
throwing_register_bow ('longbow', 'Longbow', {x=1, y=2.... | nilq/small-lua-stack | null |
--[[
require "config"
biter_levels = 100
--Not efficient enough, long load times
for name, prototype in pairs(data.raw.unit) do
if not string.find(name, "_pw_") then
for i=1, biter_levels do
log( serpent.block( name, {comment = false, numformat = '%1.8g' } ) )
local biter = util.table.deepcopy(prototype)
... | nilq/small-lua-stack | null |
Main = {
peds = {},
}
--[[ Functions ]]--
function Main:CanInteract()
local player = PlayerId()
local ped = PlayerPedId()
return IsPedArmed(ped, 4) and IsPlayerFreeAiming(player) and IsControlEnabled(0, 51) == 1
end
function Main:Update()
self.coords = GetEntityCoords(PlayerPedId())
local canInteract = self:C... | nilq/small-lua-stack | null |
require"imlua"
require"cdlua"
require"cdluaim"
require"iuplua"
require"iupluacd"
function LoadImage(file_name)
-- load the first image in the file.
-- force the image to be converted to a bitmap
local image, err = im.FileImageLoadBitmap(file_name)
if not image then
error(im.ErrorStr(err))
end
ret... | nilq/small-lua-stack | null |
-- Define sets and vars used by this job file.
function init_gear_sets()
gear.melee = {}
gear.melee.back = { name="Ankou's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}}
gear.melee.feet = { name="Argosy Sollerets +1", augments={'HP+65','"Dbl.Atk."+3','"Store TP... | nilq/small-lua-stack | null |
local fov_max = 70.0
local fov_min = 5.0 -- max zoom level (smaller fov is more zoom)
local zoomspeed = 10.0 -- camera zoom speed
local speed_lr = 8.0 -- speed by which the camera pans left-right
local speed_ud = 8.0 -- speed by which the camera pans up-down
binoculars = false
local fov = (fov_max+fov_min)*0.5
local... | nilq/small-lua-stack | null |
--[[
Useless class.
Feel free to delete this file.
]]
function RunString(str)
return loadstring("return "..str)()
end
return RunString | nilq/small-lua-stack | null |
local mod = foundation.new_module("yatm_refinery", "1.0.0")
mod:require("vapour_registry.lua")
mod:require("distillation_registry.lua")
mod:require("api.lua")
mod:require("fluids.lua")
mod:require("nodes.lua")
mod:require("recipes.lua")
| nilq/small-lua-stack | null |
local Unity = {
UI = {
Button = csharp.checked_import('UnityEngine.UI.Button'),
Image = csharp.checked_import('UnityEngine.UI.Image'),
Text = csharp.checked_import('UnityEngine.UI.Text'),
ScrollRect = csharp.checked_import('UnityEngine.UI.ScrollRect'),
Toggle = csharp.checked_import('UnityEngine.UI.Toggle'... | nilq/small-lua-stack | null |
--# selene: allow(unused_variable)
---@diagnostic disable: unused-local
-- This module allows Hammerspoon to preform Spotlight metadata queries.
--
-- This module will only be able to perform queries on volumes and folders which are not blocked by the Privacy settings in the System Preferences Spotlight panel.
--
-- A... | nilq/small-lua-stack | null |
local radio = require('radio')
local frequency = 162.425e6
local tune_offset = -100e3
local deviation = 5e3
local bandwidth = 16e3
-- Blocks
local source = radio.RtlSdrSource(frequency + tune_offset, 1102500, {rf_gain = 45.0})
local tuner = radio.TunerBlock(tune_offset, 2*(deviation+bandwidth), 50)
local fm_demod = r... | nilq/small-lua-stack | null |
function turnManager(system)
--credit for the pseudo code for this goes to spacecoote on reddit
if turn_state == 0 then -- entity is in the moving stage of the turn.
if current_player ~= 0 then
system.enemies[current_level][current_player]:turn()
end
elseif turn_state ==... | nilq/small-lua-stack | null |
return {
tlldimetrodon = {
acceleration = 0.05,
brakerate = 0.27,
buildcostenergy = 12342,
buildcostmetal = 1282,
builder = false,
buildpic = "tlldimetrodon.dds",
buildtime = 17000,
canattack = true,
canguard = true,
canhover = true,
canmove = true,
canpatrol = true,
canstop = 1... | nilq/small-lua-stack | null |
DEFINE_BASECLASS("ma2_proj_pulselaser_lvl1")
AddCSLuaFile()
ENT.Base = "ma2_proj_pulselaser_lvl1"
ENT.Damage = 17
ENT.ParticleAttach = "gm_MA2_pulselaser_lvl2"
ENT.FireSound = Sound("MA2_Weapon.PulseLaser2")
PrecacheParticleSystem("gm_MA2_pulselaser_lvl2")
| nilq/small-lua-stack | null |
local theLanguageTable = {}
addEventHandler( "onClientResourceStart", getRootElement(), function ()
setElementData(getLocalPlayer(), "localizationData", getLocalization()["name"])
triggerServerEvent ("AURlanguage.getExportTable", resourceRoot, getLocalPlayer())
end)
function updateExportTable(theTable)
theLanguag... | nilq/small-lua-stack | null |
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
local exec_lua = helpers.exec_lua
local pcall_err = helpers.pcall_err
local matches = helpers.matches
local pending_c_parser = helpers.pending_c_parser
before_each(clear)
describe('treesitter API', functi... | nilq/small-lua-stack | null |
--[[
TheNexusAvenger
Tests property errors of the NexusWrappedInstance class.
--]]
local NexusUnitTesting = require("NexusUnitTesting")
local NexusWrappedInstance = require(game:GetService("ReplicatedStorage"):WaitForChild("NexusWrappedInstance"))
local NexusInstance = require(game:GetService("ReplicatedStorage"):Wai... | nilq/small-lua-stack | null |
-----------------------------------
-- Area: The_Boyahda_Tree
-----------------------------------
require("scripts/globals/zone")
-----------------------------------
zones = zones or {}
zones[tpz.zone.THE_BOYAHDA_TREE] =
{
text =
{
ITEM_CANNOT_BE_OBTAINED = 6382, -- You cannot obtain the <item>. Com... | nilq/small-lua-stack | null |
-----------------------------------
-- Ability: Soul Voice
-- Enhances the effects of your songs.
-- Obtained: Bard Level 1
-- Recast Time: 1:00:00
-- Duration: 0:03:00
-----------------------------------
require("scripts/globals/settings")
require("scripts/globals/status")
-----------------------------------
functio... | nilq/small-lua-stack | null |
function GM.ShowGarageView ( )
local W, H = 500, 250;
local DermaPanel = vgui.Create("DFrame")
DermaPanel:SetPos(ScrW() * .5 - W * .5, ScrH() * .5 - H * .5)
DermaPanel:SetSize(W, H)
DermaPanel:SetTitle("Vehicle Garage")
DermaPanel:SetVisible(true)
DermaPanel:SetDraggable(false)
DermaPanel:ShowCloseButton... | nilq/small-lua-stack | null |
class "String"
String.ENCODING_UTF8 = 0
function String:__getvar(name)
if name == "contents" then
local retVal = Polycode.String_get_contents(self.__ptr)
if retVal == nil then return nil end
local __c = _G["string"]("__skip_ptr__")
__c.__ptr = retVal
return __c
elseif name == "w_contents" then
local ret... | nilq/small-lua-stack | null |
local victory = {}
victory.timer = Timer.new()
local g = love.graphics
victory.bg = g.newImage("assets/victory.png")
victory.font = g.newFont(20)
function victory:entering()
g.setFont(self.font)
self.text = "Nightmares survived: " .. level
local temp = MAXLEVEL - level
if temp == 1 then
self.text2 = temp .. "... | nilq/small-lua-stack | null |
require("nvim-gps").setup({})
| nilq/small-lua-stack | null |
-- Editors:
-- AltiV, July 23rd, 2019
LinkLuaModifier("modifier_imba_nian_frenzy_swipes", "components/abilities/heroes/hero_nian", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_imba_nian_frenzy_swipes_suppression", "components/abilities/heroes/hero_nian", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_im... | nilq/small-lua-stack | null |
script.on_event(defines.events.on_robot_built_entity, function (event)
Logistic_container_placed(event.created_entity, game)
end, { { filter = "type", type = "logistic-container" } }) | nilq/small-lua-stack | null |
local solarsail = require('libengine')
local engine = solarsail:create_engine()
assert(engine:init())
assert(engine:automount())
assert(engine:autorun())
assert(engine:shutdown())
assert(engine:deinit())
| nilq/small-lua-stack | null |
return {
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
desc_get = "",
name = "里诺",
init_effect = "",
time = 0,
color = "red",
picture = "",
desc = "",
stack = 1,
id = 13120,
icon = 13120,
last_effect = "",
effect_list = {
{
type = "BattleBuffAddBuff",
trigger = {
"onStartGame"
},
arg_l... | nilq/small-lua-stack | null |
local defineRegistration = require(script.defineRegistration)
return {
Core = require(script.Core),
defineComponent = require(script.defineComponent),
System = require(script.System),
interval = defineRegistration.interval,
event = defineRegistration.event,
BuiltInPlugins = require(script.Built... | nilq/small-lua-stack | null |
--[[
LICENSE: BSD
Author: CandyMi[https://github.com/candymi]
]]
local tcp = require "internal.TCP"
local crypt = require "crypt"
local sha1 = crypt.sha1
local sha2 = crypt.sha256
local xor_str = crypt.xor_str
local randomkey = crypt.randomkey_ex
local rsa_oaep_pkey_encode = crypt.rsa_public_key_oaep_padding_encod... | nilq/small-lua-stack | null |
local S = technic.getter
minetest.register_craft({
output = "technic:mv_centrifuge",
recipe = {
{"basic_materials:motor", "technic:copper_plate", "technic:diamond_drill_head"},
{"technic:copper_plate", "technic:machine_casing", "technic:copper_plate" },
{"pipeworks:one_way_tube", "technic:mv_... | nilq/small-lua-stack | null |
require("telescope").setup {
defaults = {
preview = {
-- NOTE: Disabling this for performance purposes for now
-- See: https://github.com/nvim-telescope/telescope.nvim/issues/1616#issuecomment-999123921
-- Apparently was fixed, let's see.
treesitter = true
}
},
extensions = {
f... | nilq/small-lua-stack | null |
--[=[
MIT License
Copyright (c) 2016 Johannes Westhuis, Alexander Schulz
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... | nilq/small-lua-stack | null |
--[[
Hyperparameter experimentation using the ADAM optimizer for training a network.
Note: run this file from the root dir of the repo.
Example: th tests/test_hyperparameters_adam.lua
]]
require 'paths'
require 'torch'
require 'string'
require 'gnuplot'
------------------------------------------... | nilq/small-lua-stack | null |
WIDTH = 40
leftWidth = 20
while true do
local rightWidth = WIDTH - gapWidth - leftWidth
io.write(string.rep('#', leftWidth))
io.write(string.rep(' ', 10))
io.write(string.rep('#', rightWidth))
io.write('\n')
os.sleep(0.05)
local diceRoll = math.random(1, 6)
if diceRoll == 1 and leftWidth > 1 then
... | nilq/small-lua-stack | null |
return {
author = "Jet",
name = "CLI",
description = "The Jet command line interface.",
version = "1.0.0",
dependencies = {
"Jet/StringUtility@1.0.0"
},
softDependencies = {
"Jet/Updater@1.0.0"
}
}
| nilq/small-lua-stack | null |
BaseNpc_AddItemToPlayer(BaseNpc_GetNpcById({{Tale_Action_SelectedNpc_Value_Id}}), "{{Tale_Action_SelectedItem_Value_ScriptName}}", {{Tale_Action_Quantity}}) | nilq/small-lua-stack | null |
local words = {}
local root = {
Trie = {},
fail = nil,
text = "root"
}
local function insertWord(word, index)
local tmp = root.Trie
local final
for k in string.gmatch(word, utf8.charpattern) do
if tmp[k] == nil then
tmp[k] = {Trie = {}, fail = nil, text = k}
end
... | nilq/small-lua-stack | null |
--[[
/$$$$$$ /$$ /$$
/$$__ $$ |__/ | $$
| $$ \ $$ /$$$$$$$ /$$ /$$$$$$/$$$$ /$$$$$$ /$$$$$$ /$$$$$$
| $$$$$$$$| $$__ $$| $$| $$_ $$_ $$ |____ $$|_ $$_/ /$$__ $$
| $$__ $$| $$ \ $$| $$| $$ \ $$ \ $$ ... | nilq/small-lua-stack | null |
--[[
Name: "sh_voices.lua".
Product: "HL2 RP".
--]]
-- Add a voice to the menu.
function kuroScript.game:AddVoiceToMenu(command, playerClass, targetClass)
local k, v;
-- Loop through each value in a table.
for k, v in pairs(self.voices) do
if (v.class == playerClass and v.command == command) then
if (string.... | nilq/small-lua-stack | null |
--- This program is for the mod "The Veggie Way" which adds flour
-- and dough as an alternative path to bread from wheat which is
-- more efficient. This also works with a similar recipe added by
-- Create with Wheat -> Wheat Dough
--
-- The normal way to get bread is 3 wheat -> 1 bread.
-- The Veggie Way to get... | nilq/small-lua-stack | null |
-- Lua
function gcd(a, b)
if b > 0 then
return gcd(b, a % b);
else
return a;
end
end
print("test");
N = 1000;
A = {};
for i = 1, N do
A[i] = i - 1;
end
ans = 0;
for _, i in ipairs(A) do
for _, j in ipairs(A) do
ans = gcd(i, j) + ans;
end
end
print(ans);
| nilq/small-lua-stack | null |
function on_activate(parent, ability)
local targets = parent:targets():hostile()
local targeter = parent:create_targeter(ability)
targeter:set_selection_radius(ability:range())
targeter:set_free_select(ability:range() * 2)
targeter:set_shape_cone(parent:center_x(), parent:center_y(), 1.0, ability:ran... | nilq/small-lua-stack | null |
--[[ Copyright (c) 2010 Manuel "Roujin" Wolf, Edvin "Lego3" Linge
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,... | nilq/small-lua-stack | null |
require('!/DieRoller')
function onload()
onLoadShared("red")
end
| nilq/small-lua-stack | null |
local Util = require("vlua.util")
local Dep = require("vlua.dep")
local warn = Util.warn
local setmetatable = setmetatable
local type = type
local V_GETTER = 1
local V_SETTER = 2
---@class Computed
---@field value any
---@field get fun():any
---@param set fun(newValue:any):nil
---@param getter fun(self:any):any
---@... | nilq/small-lua-stack | null |
local function TestNegation()
local _ = not true;
assert(not debug.issecurelocal(1, 1), "expected negated value to be tainted");
end
local function TestLength()
local _ = #"Constant";
assert(not debug.issecurelocal(1, 1), "expected length of string to be tainted");
_ = #{ 1, 2, 3 };
assert(not debug.issec... | nilq/small-lua-stack | null |
-- Authors: Polymorphic, berezaa
local module = {}
local player = game.Players.LocalPlayer
local starterPlayer = game:GetService("StarterPlayer")
local DISTANCE_AWAY_THRESHOLD = 50
local MANIFEST_ORIENTATION_ASSIST_TIME_BASE = 0.5
local MANIFEST_ORIENTATION_ASSIST_TIME = MANIFEST_ORIENTATION_ASSIST_TIME_BASE
lo... | nilq/small-lua-stack | null |
local _M = {}
function _M.rgb_to_hsv(red, green, blue)
local hue, saturation, value
local min_value = math.min(red, green, blue)
local max_value = math.max(red, green, blue)
value = max_value
local value_delta = max_value - min_value
-- If the color is not black
if max_value ~= 0 then
saturation = value_de... | nilq/small-lua-stack | null |
#!/usr/bin/env lua
do
do
local _ENV = _ENV
package.preload[ "core_PackageToolkit._test._case" ] = function( ... ) local arg = _G.arg;
local M = { }
local parent = ...
local split
split = function(str, symbol)
if symbol == nil then
symbol = "%s"
end
local _accum_0 = { }
local _len_0 = 1
for x in string.g... | nilq/small-lua-stack | null |
--!The Make-like Build Utility based on Lua
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache L... | nilq/small-lua-stack | null |
--[[-------------------------------------------------------------------]]--[[
Copyright wiltOS Technologies LLC, 2020
Contact: www.wiltostech.com
----------------------------------------]]--
--[[
EXAMPLE BLADE TABLE:
wOS.ALCS.Lig... | nilq/small-lua-stack | null |
local _, private = ...
private.travel = {
-- General
[140493] = true, -- Adept's Guide to Dimensional Rifting
[128353] = true, -- Admiral's Compass
[129276] = true, -- Beginner's Guide to Dimensional Rifting
[118662] = true, -- Bladespire Relic
[140192] = true, -- Dalaran He... | nilq/small-lua-stack | null |
local a = Instance.new("ForceField")
a.Parent = workspace.ic3w0lf589 | nilq/small-lua-stack | null |
UtilUI = {}
local Theme = require("ui/theme")
function UtilUI.Create(CityHack, Style, Observer)
if ImGui.CollapsingHeader("UTILITY") then
local LookedObject = Observer.LookedObject()
ImGui.PushTextWrapPos()
Theme.PushStyleColor(ImGuiCol.Text, Theme.CustomToggleOn)
ImGui.Text("T... | nilq/small-lua-stack | null |
function momoTweak.icon.AngelsNumber()
momoTweak.icon.number = {}
momoTweak.icon.number[1] = {
icon = "__angelsrefining__/graphics/icons/num_1.png",
icon_size = 32,
tint = angelsmods.smelting.number_tint,
scale = 0.32,
shift = {-12, -12}
}
momoTweak.icon.number[2] = {
icon = "__angelsrefining__/graph... | nilq/small-lua-stack | null |
--------------------------------
-- @module TransitionTurnOffTiles
-- @extend TransitionScene,TransitionEaseScene
-- @parent_module cc
--------------------------------
--
-- @function [parent=#TransitionTurnOffTiles] easeActionWithAction
-- @param self
-- @param #cc.ActionInterval action
-- @return Actio... | nilq/small-lua-stack | null |
--[[*]]-- RotatorsLib --[[*]]--
require "ISBaseObject"
rLib = ISBaseObject:derive("rLib")
--
function rLib.nop()
end
-- log --
function rLib.dprint(text, ...)
if getDebug() then
rLib.print(text, ...)
else
rLib.dprint = rLib.nop
end
end
function rLib.print(text, arg, ...)
assert(rLib.arg(text, "string"))
... | nilq/small-lua-stack | null |
modifier_item_shard_attackspeed_stack = class({
IsHidden = function() return true end,
IsPurgable = function() return false end,
IsBuff = function() return true end,
RemoveOnDeath = function() return false end,
GetAttributes = function() return MODIFIER_ATTRIBUTE_PERMANENT end,
GetTexture = func... | nilq/small-lua-stack | null |
local round_type = 0
net.Receive("UpdateRoundType", function(len)
round_type = net.ReadInt(4)
end)
function getRoundStatus()
return round_type
end | nilq/small-lua-stack | null |
#include<stdio.h>
#include<lua.h>
#include<lauxlib.h>
#include<lualib.h>
int main(void)
{
char buff[256];
int error;
lua_State *L = lua_open(); //opens Lua
} | nilq/small-lua-stack | null |
style_blue =
{["off_color"] = "0cf",
["on_color"] = "0cf",
["line_color"] = "0cf",
["line_width"] = "2"};
style_red =
{["off_color"] = "f30",
["on_color"] = "f30",
["line_color"] = "f30",
["line_width"] = "2"};
line_blue =
{["off_color"] = "fff",
["on_col... | nilq/small-lua-stack | null |
---------
-- Location resolver
--
-- Resolves row (line) and column from position in multiline string.
----
local byte = string.byte
local floor = math.floor
local inf = math.huge
local NL = byte('\n')
--- Returns a list with starting positions of lines in the given `text` string.
-- Note: only LF (`\n`) is consid... | nilq/small-lua-stack | null |
if UseItem(169) == true then goto label0 end;
do return end;
::label0::
ModifyEvent(-2, -2, -2, -2, -1, -1, -1, 2608, 2608, 2608, -2, -2, -2);--by fanyu|箱子变空。场景06-编号5
AddItem(28, 2);
do return end;
| nilq/small-lua-stack | null |
-- myfile.lua --
local myfile = {}
function myfile.save(fn, data)
file.open(fn, "w")
file.write(data)
file.close()
end
function myfile.load(fn)
file.open(fn, "r")
local content = file.read()
file.close()
if string.len(content) > 0 then
return content
end
return nil
end
return myfile
| nilq/small-lua-stack | null |
slot0 = class("RollingBallGameView", import("..BaseMiniGameView"))
slot1 = 1
slot2 = 2
slot3 = 1
slot4 = 2
slot5 = 1
slot6 = 2
slot7 = 1
slot8 = 2
slot9 = {
{
3,
5
},
{
2,
3
},
{
1.5,
3
},
{
1,
2.5
},
{
1,
2
},
{
0.8,
1.4
}
}
slot10 = {
30,
80,
120,
160,
180
}
slot11 = {
4,
6
... | nilq/small-lua-stack | null |
local Plugin = script.Parent.Parent.Parent
local Libs = Plugin.Libs
local Roact = require(Libs.Roact)
local NONE = Roact.None
local AUTO = {}
local function specialize(name, component, defaultProps, propMap)
local specialized = Roact.PureComponent:extend(name)
for from, to in next, propMap do
if to == AUTO then
... | nilq/small-lua-stack | null |
require "lmkbuild"
local assert = assert
local append = lmkbuild.append_local
local cp = lmkbuild.cp
local file_newer = lmkbuild.file_newer
local ipairs = ipairs
local is_valid = lmkbuild.is_valid
local mkdir = lmkbuild.mkdir
local print = print
local resolve = lmkbuild.resolve
local rm = lmkbuild.rm
local split = lmk... | nilq/small-lua-stack | null |
class("About").extends(gfx.sprite)
function About:init()
About.super.init(self, gfx.image.new(400, 240))
self:setCenter(0, 0)
self:setZIndex(Z_INDEX_TITLE)
end
function About:enter(context)
self:redraw()
self:add()
self:moveTo(context.isSidebarOpen and SIDEBAR_WIDTH - SEPARATOR_WIDTH or 0, 0)
end
function Abo... | nilq/small-lua-stack | null |
--[[- The core library for our UI framework.
I'm not going to defend any design decisions here - UI is something I find
really hard to think about. The core implementation here is largely class-based,
though without any actual inheritance.
We define our "core" datatype as an object with any of these properties:
- `T:... | nilq/small-lua-stack | null |
EPS = 0.001
EPS_SQUARE = EPS * EPS
function side(x1, y1, x2, y2, x, y)
return (y2 - y1) * (x - x1) + (-x2 + x1) * (y - y1)
end
function naivePointInTriangle(x1, y1, x2, y2, x3, y3, x, y)
local checkSide1 = side(x1, y1, x2, y2, x, y) >= 0
local checkSide2 = side(x2, y2, x3, y3, x, y) >= 0
local checkSi... | nilq/small-lua-stack | null |
local rankManInfo_layout = require(ViewPath.."hall/ranklist/rankManInfo_layout");
require("isolater/widget/layerManagerIsolater");
local RankManInfo = class(CommonGameLayer, false);
RankManInfo.Delegate = {
onHideUserInfo = "onHideUserInfo";
sendDirectMsg = "sendDirectMsg";
};
RankManInfo.s_controls =
... | nilq/small-lua-stack | null |
dofile("common.inc");
function doit()
askForWindow("Parses the game clock and extracts the info.\nInfo updates in realtime while running!\nPress Shift over ATITD to continue.");
while 1 do
checkBreak();
findClockInfo();
while not Time do
checkBreak();
findClockInfo();
sleepWithStatus(1000, "Can not... | nilq/small-lua-stack | null |
//________________________________
//
// NS2 Combat Mod
// Made by JimWest and MCMLXXXIV, 2012
//
//________________________________
// combat_StructureAbility.lua
local HotReload = CombatStructureAbility
if(not HotReload) then
CombatStructureAbility = {}
ClassHooker:Mixin("CombatStructureAbility")
end
f... | nilq/small-lua-stack | null |
local _={}
_[1]={"error","compatible function \"b\" variant not found; at test/tests/function scope wrong.ans:4"}
return {_[1]}
--[[
{ "error", 'compatible function "b" variant not found; at test/tests/function scope wrong.ans:4' }
]]-- | nilq/small-lua-stack | null |
-- scaffolding entry point for openssl
return dofile("openssl.lua")
| nilq/small-lua-stack | null |
-- [ To Do ] --
-- #general
-- #engine
-- #gearbox
-- #gun
--use an input to set reload manually, to remove timer?
-- #ammo
-- #prop armor
--get incident armor ?
--hit calcs ?
--conversions ?
-- #fuel
local checkluatype = SF.CheckLuaType
local checkpermission = SF.Permissions.check
local registerprivilege = SF.... | nilq/small-lua-stack | null |
local enemy_ai = {}
enemy_ai.__index = enemy_ai
local points = {
{ x = 1, y = 2 }, -- top left
{ x = 1, y = 4 }, -- bottom left
{ x = 3, y = 4 }, -- bottom right
{ x = 3, y = 2 } -- top right
}
enemy_ai.points = {}
for i1, point1 in ipairs(points) do
for i2, point2 in ipairs(points) do
table.insert(enemy_ai.p... | nilq/small-lua-stack | null |
local classic = require 'classic'
local Executer = classic.class('Executer')
function Executer:_init(opts)
self.D = opts.D
self.rnnCore = opts.rnnCore
self.stack = opts.stack
--d self.count = 0
end
function Executer:executeStrategy(gradHidden, m, t, s)
local hiddenState = self.stack:peek()
if ... | nilq/small-lua-stack | null |
AddCSLuaFile( )
DEFINE_BASECLASS("base_aperture_ent")
local WireAddon = WireAddon or WIRE_CLIENT_INSTALLED
ENT.PrintName = "Gel Dropper"
ENT.IsAperture = true
ENT.IsConnectable = true
if WireAddon then
ENT.WireDebugName = ENT.PrintName
end
function ENT:SetupDataTables()
self:NetworkVar("Bool", 0, "Enable")
... | nilq/small-lua-stack | null |
server_scripts {
'config.lua',
'sv.lua'
}
client_script 'cl.lua' | nilq/small-lua-stack | null |
buffDivineFavor="Spell_Holy_Heal"
palaHealRange="Holy Light"
palaDispelRange="Purify"
palaDispelAll={Magic=true,Disease=true,Poison=true}
palaDispelMagic={Magic=true}
palaDispelDisease={Disease=true}
palaDispelPoison={Poison=true}
palaDispelNoMagic={Disease=true,Poison=true}
palaDispelNoDisease={Magic=true,Po... | nilq/small-lua-stack | null |
prices = {}
prices["race"] = 1100
prices["rtf"] = 850
prices["ctf"] = 850
prices["nts"] = 1100
prices["shooter"] = 1300
prices["deadline"] = 350
lastWinnerDiscount = 50
isVipMap = false
PRICE = 1000
local main_window
local tab_panel
local tab = {}
local aGamemodeMapTable = {}
function createNextmapWindow(tabPanel... | nilq/small-lua-stack | null |
local session = require("luasnip.session")
local function filetypelist_to_set(list)
vim.validate({ list = { list, "table", true } })
if not list then
return list
end
local out = {}
for _, ft in ipairs(list) do
-- include redirected filetypes.
for _, resolved_ft in ipairs(session.ft_redirect[ft]) do
out[r... | nilq/small-lua-stack | null |
local rg = {}
rg.init = function(_, config)
config = vim.tbl_extend('force',{
cmd = "rg",
args = {
'--color=never',
'--no-heading',
'--with-filename',
'--line-number',
'--column',
},
}, config or {})
return config
end
rg.... | nilq/small-lua-stack | null |
-- Waitsupport (c) by Jonathan Fischer: http://www.jonathanfischer.net/lua-coroutines/
-- This file implements waitSeconds, waitSignal, signal, and their supporting stuff.
-- This table is indexed by coroutine and simply contains the time at which the coroutine
-- should be woken up.
local WAITING_ON_TIME = {}
-- T... | nilq/small-lua-stack | null |
--------------------------------------------------------------------------------
-- Preconditions before ATF start
--------------------------------------------------------------------------------
local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions')
local commonSteps = require('user_m... | nilq/small-lua-stack | null |
local att = {}
att.name = "bg_4inchsw29"
att.displayName = "Short Barrel"
att.displayNameShort = "Short"
att.isBG = true
att.statModifiers = {RecoilMult = 0.1,
AimSpreadMult = -0.22,
DrawSpeedMult = -0.10}
if CLIENT then
att.displayIcon = surface.GetTextureID("atts/bg_4inchsw29")
end
function att:attachFunc()
self... | nilq/small-lua-stack | null |
-- create an editable image
p = sparrowRGBA.new(imageCtx)
-- get image bounds
b = p:bounds()
-- iterate over pixels
for i = 0, b['width'] do
for j = 0, b['height'] do
-- get current pixel color: red, green, blue, alpha
v = p:getPixel(i, j)
-- set current pixel color: red, green, blue, alp... | nilq/small-lua-stack | null |
minetest.register_entity("testmod:bogus_1",
{
collisionbox = { -0.5,-0.5,-0.5,0.5,0.5,0.5 },
visual = "sprite",
textures = { "testmod_num1.png" },
physical = false,
groups = { "immortal" },
}
)
minetest.register_entity("testmod:bogus_2",
{
collisionbox =... | nilq/small-lua-stack | null |
local xmlns_sm = "urn:xmpp:sm:2";
function verse.plugins.smacks(stream)
-- State for outgoing stanzas
local outgoing_queue = {};
local last_ack = 0;
-- State for incoming stanzas
local handled_stanza_count = 0;
-- Catch incoming stanzas
local function incoming_stanza(stanza)
if stanza.attr.xmlns == "jabbe... | nilq/small-lua-stack | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.