code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
@dofile "samples/def_defmacro.lua"
@defmacro rt do
local t = {'print(10)'}
return t
end
@rt
--> error | gberger/malu | samples/demo_return_table.lua | Lua | mit | 111 |
local Sticker = Layout:with{
anAdd = Layout.newAnimation(),
bgrC = 0x000000, bgrA = 1.0,
relX = 0.0, relY = 0.0,
move = true,
text = "",
init = function(self)
local a, b, c = self.text:match"(.+\n)(.+\n)(.+)"
self:addChild(Layout.new{sprS = 0.9,
relH = 1/3, relY = 0/3, TextField.new(font, a, "|")})
self:... | Nlcke/layout | examples/sizing.lua | Lua | mit | 1,193 |
/**
* Excessive trauma causes an explosion.
*/
ExplosiveTraumaMixin = CreateMixin( ExplosiveTraumaMixin )
ExplosiveTraumaMixin.type = "ExplosiveTrauma"
ExplosiveTraumaMixin.networkVars =
{
}
function ExplosiveTraumaMixin:__initmixin()
self.primed = false
end
if Server then
function ExplosiveTraum... | DaanVanYperen/ns2-skulks-with-shotguns | output/lua/SkulksWithShotguns/sws_ExplosiveTraumaMixin.lua | Lua | mit | 721 |
local lume = require 'lume'
local class = require 'middleclass'
-- the container for all
FrameData = {}
-- the boxes
function newBox()
return {
x = lume.round(lume.random(-100,100));
y = lume.round(lume.random(-100,100));
w = lume.round(lume.random(30,120));
h = lume.round(lume.random(30,120));
... | BakaBBQ/siki.lua | framedata.lua | Lua | mit | 558 |
if item_spawn_footman == nil then
item_spawn_footman = class({})
end
function SpawnFootman ( keys )
local barracks = keys.caster
local barracks_position = barracks:GetAbsOrigin()
-- Setting the waypoints
local human_waypoint_1 = Entities:FindByName(nil, "human_waypoint_undead_side")
local human_waypoint_2 = ... | PetarTilevRusev/EndlessWar | game/scripts/vscripts/items/spawn_footman.lua | Lua | mit | 1,083 |
local balls = require "balls"
local platform = require "platform"
local bricks = require "bricks"
local bonuses = require "bonuses"
local walls = require "walls"
local lives_display = require "lives_display"
local collisions = require "collisions"
local levels = require "levels"
local game = {}
function game.load( pr... | noooway/love2d_arkanoid_tutorial | 3-07_AddNewBallBonus/game.lua | Lua | mit | 2,887 |
kBoneShieldDamageReduction = 0.25 --75% frontal damage reduction
kBoneShieldMoveFraction = 0.0 --0% of max speed aka no movement
kBoneShieldInnateCombatRegenRate = 1 --don't affect innate regen in combat
kBoneshieldPreventInnateRegen = false
kAutoBuildRate = 0.3
kOnosCost = 55
kLerkCost = 20
kFadeCost = 35
kAlienIni... | keatsandyeats/NSL-CompMod | NSLCompMod/source/lua/DPR/Post/Balance.lua | Lua | mit | 1,114 |
self:moveRight()
self:moveUp()
self:moveRight()
self:moveDown()
self:moveRight()
| nikai3d/codecombat-scripts | dungeon/shadow-guard.lua | Lua | mit | 81 |
--[[
/////// //////////////////
/////// PROJECT: MTA iLife - German Fun Reallife Gamemode
/////// VERSION: 1.7.2
/////// DEVELOPERS: See DEVELOPERS.md in the top folder
/////// LICENSE: See LICENSE.md in the top folder
/////// /////////////////
]]
-- #######################################
-- ## Project: HUD ... | Noneatme/iLife-SA | client/Classes/Hud/Handy/Apps/cHandyApp_Reddit.lua | Lua | mit | 2,791 |
--[[
Automated tree felling.
Written by Daniel Keep.
Copyright 2013.
Released under the MIT license.
]]
--[[
Usage: auto-fell
Chest with bone meal or sulphur goo should be behind the turtle,
a chest with saplings to the right, and the chest for logs to the left.
The dirt block on w... | DanielKeep/CC | auto-fell.lua | Lua | mit | 4,242 |
M = require "asm"
-- Return a value in rage [0x00, 0xff] if x is to use zeropage addressing mode. Defaults to range [0x0000-0x00ff].
M.zeropage = function(x) if x >= -128 and x <= 0xff then return M.byte_normalize(x) end end
local op_eval_byte = function(late, early, nozp)
local v = op_eval(late, early)
local... | g012/l65 | 6502.lua | Lua | mit | 16,336 |
--- Text container for `ixTooltip`.
-- Rows are the main way of interacting with `ixTooltip`s. These derive from
-- [DLabel](https://wiki.garrysmod.com/page/Category:DLabel) panels, which means that making use of this panel
-- will be largely the same as any DLabel panel.
-- @panel ixTooltipRow
local animationTime = ... | alexgrist/NutScript | gamemode/core/derma/cl_tooltip.lua | Lua | mit | 16,319 |
-- Manifest
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
description "Crowley's RP weapons module" -- Resource Descrption
client_scripts {
'client/weapons.lua',
'client/weapon_inventory_syncer.lua',
'client/client_gunshops.lua',
'client/ui.lua'
}
server_scripts {
'server/weapon_prices.l... | zaully/cr0w13y_rp | crgunshops/__resource.lua | Lua | mit | 492 |
-- ホムンクルスタイプ取得
-- ホム選択時の単純な判定用で、細かい判定はHomunculus内へ
function GetHomunculusType(id)
return GetV(V_HOMUNTYPE, id)
end
-- typeやその他の条件を加味して、適切なAIを選択
function CreateHomunculus(id)
local type = GetHomunculusType(id)
local homu = Homunculus
-- ここにホム選択ロジック
if type == FILIR or type == FILIR2 or type == FILIR_H or typ... | parrot-studio/ro-homu-ai | src/USER_AI/Main.lua | Lua | mit | 776 |
function table.contains(table, element)
for key, value in pairs(table) do
if key == element then
return true
end
end
return false
end
function split(p,d)
local t, ll
t={}
ll=0
if(#p == 1) then return {p} end
while true do
l=string.find(p,d,ll,true)
if l~=nil then
tabl... | gear4s/robottie | helpers.lua | Lua | mit | 810 |
Events:Subscribe("ModuleLoad" , function() deathmatch = DeathmatchManager() end) | patawic/Jc2mp-DeathMatch | server/Module.lua | Lua | mit | 80 |
Button = class("Button")
---
-- Button:initialize
-- A button item in a menu.
--
function Button:initialize()
self.label = "Do nothing"
self.submenu = nil
self.x = 0
self.width = ui.width
self.height = 70
self.disabled = false
self.hovering = false
self.hoverBump = 0
self.callba... | Darkwater/lazors-in-space | menus/items/button.lua | Lua | mit | 2,025 |
local Item = require("Item")
local Sprite = require("Sprite")
local PowerUp = {}
PowerUp.new = function(options)
local sprites = {"Power-ups/Things/1", "Power-ups/Things/2", "Power-ups/Things/3"}
local level = 1
if options and options.level then
if options.level < 1 then
level = 1
... | keviner2004/shoot-em-up | items/PowerUp.lua | Lua | mit | 738 |
-- scraper for youtube
local json = require("json")
local http = require("ssl.https")
local api_key = "AIzaSyDO72B4_jgFVBVMGIgGoB_aikR4g3BUnzs"
local api_base_url = "https://www.googleapis.com/youtube/v3/"
local function table_to_string(t)
local out = ""
for k,v in pairs(t) do
out = out .. k .. ": " .. (type(... | jwthomson/dailyprogrammer | 0192 [Hard] Scrape/challenge.lua | Lua | mit | 1,589 |
camera = {}
camera.x = 0
camera.y = 0
camera.scaleX = 1
camera.scaleY = 1
camera.rotation = 0
| NsccTruroIT/GameJam2880 | Shared Resources/Team 3/basic_with_asset_mgr/camera.lua | Lua | cc0-1.0 | 96 |
--- Utility functions ---
local function capture(cmd, raw)
local f = assert(io.popen(cmd, "r"))
local s = assert(f:read("*a"))
f:close()
if raw then return s end
s = s
:gsub("^%s+", "")
:gsub("%s+$", "")
:gsub("[\n\r]+", " ")
return s
end
--- ==== ---
--- Local functions ---
local function get()
retur... | legospacy/awesomerc | lib/self/hostname.lua | Lua | cc0-1.0 | 410 |
-- The Computer Language Benchmarks Game
-- http://benchmarksgame.alioth.debian.org/
-- contributed by Mike Pall
-- requires LGMP "A GMP package for Lua 5.1"
local g = {}; require "c-gmp"(g, {})
local add, mul, submul = g.mpz_add, g.mpz_mul_si, g.mpz_submul_ui
local mul2x, div, cmp = g.mpz_mul_2exp, g.mpz_fdiv_qr, g.m... | kroepke/luna | luna-tests/src/test/resources/benchmarksgame/pidigits.lua-3.lua | Lua | apache-2.0 | 1,052 |
local key = KEYS[1]
local capacity = tonumber(ARGV[1])
local timestamp = tonumber(ARGV[2])
local id = ARGV[3]
local count = redis.call("zcard", key)
local allowed = count < capacity
local allowed_num = 0
if allowed then
redis.call("zadd", key, timestamp, id)
allowed_num = 1
end
return { allowed_num, count } | TFrise/kitty | juice-ratelimiter/src/main/resources/META-INF/scripts/concurrent_requests_limiter.lua | Lua | apache-2.0 | 316 |
#!/usr/bin/env lua
--
-- Wrapper module for common system functions in Lua.
--
-- Use this module instead of the built-in Lua library or other libraries
-- to ensure a consistent API for future releases.
--
-- Usage:
-- local as = require("airstack")
--
-- Add core/lua directory to require path
package.path = package.... | airstack/core | core/lua/airstack.lua | Lua | apache-2.0 | 2,006 |
if (SERVER) then
AddCSLuaFile()
end
if (CLIENT) then
SWEP.PrintName = "KSwep Rangefinder"
SWEP.Author = "vurtual"
SWEP.Slot = 3
SWEP.SlotPos = 0
end
SWEP.Base="weapon_kbinoc_base"
SWEP.Category = "KSwep Equipment"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Magnification=3
SWEP.Overlay="effects/combine_b... | VurtualRuler98/kswep2 | lua/weapons/weapon_kbinoc_rf.lua | Lua | apache-2.0 | 933 |
-- Copyright (C) Mashape, Inc.
local BasePlugin = require "kong.plugins.base_plugin"
local access = require "kong.plugins.basic-auth.access"
local BasicAuthHandler = BasePlugin:extend()
function BasicAuthHandler:new()
BasicAuthHandler.super.new(self, "basic-auth")
end
function BasicAuthHandler:access(conf)
Basi... | shiprabehera/kong | kong/plugins/basic-auth/handler.lua | Lua | apache-2.0 | 438 |
-- Automatically generated file: Synth Ranks
return {
[0] = {id=0,en="Amateur"},
[1] = {id=1,en="Recruit"},
[2] = {id=2,en="Initiate"},
[3] = {id=3,en="Novice"},
[4] = {id=4,en="Apprentice"},
[5] = {id=5,en="Journeyman"},
[6] = {id=6,en="Craftsman"},
[7] = {id=7,en="Artisan"},... | Windower/Resources | resources_data/synth_ranks.lua | Lua | bsd-3-clause | 1,906 |
--
-- Create an android namespace to isolate the additions
--
local p = premake
if not p.modules.android then
p.modules.android = {}
if _ACTION < "vs2015" then
configuration { "Android" }
system "android"
toolset "gcc"
end
-- TODO: configure Android debug environment...
include("vsandroid_vcxproj.lua"... | TurkeyMan/premake-android | android.lua | Lua | bsd-3-clause | 458 |
env.info("KTZ_PIT: chargement du module \"logging\"")
k.log_file = nil -- fichier log
k.make_log_file = function()
-- création, si nécessaire, di fichier de log
if not k.log_file then
-- création du fichier log si nécessaire
local p = k.dir.logs.."/KTZ-SIOC5010_ComLog-"..os.date("%Y%m%d-%H%M")..".csv"
... | 3rd-KaTZe/Export_DCS_V2 | logging.lua | Lua | mit | 1,762 |
cc.c4fFromc4b = function (c4b)
return cc.c4f(c4b.r/255.0, c4b.g/255.0, c4b.b/255.0, c4b.a/255.0)
end
-- SpriteBatchNode
cc.Node.reorderChild = function(self, sp, zorder)
sp:setLocalZOrder(zorder)
end
utils = {}
if cc.NVGDrawNode then
utils.useNVGDrawNode = true
end
function utils.drawCircle(radius, params)
if... | tianxiawuzhei/cocos-quick-lua | quick/samples/towerdefense/src/utils.lua | Lua | mit | 1,847 |
----
-- Tests for the xlsxwriter.lua worksheet class.
--
-- Copyright 2014, John McNamara, jmcnamara@cpan.org
--
require "Test.More"
plan(1)
----
-- Tests setup.
--
local expected
local got
local caption
local Worksheet = require "xlsxwriter.worksheet"
local worksheet
----
-- Test the _write_worksheet() method.
--
... | LuaDist2/xlsxwriter | test/unit/worksheet/test_write_worksheet.lua | Lua | mit | 688 |
--[[
cargBags: An inventory framework addon for World of Warcraft
Copyright (C) 2010 Constantin "Cargor" Schomburg <xconstruct@gmail.com>
cargBags is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either ver... | fgprodigal/RayUI | Interface/AddOns/RayUI/libs/cargBags/mixins-add/sorts.lua | Lua | mit | 1,342 |
--- === hs.timer ===
---
--- Execute functions with various timing rules
---
--- This module is based primarily on code from the previous incarnation of Mjolnir by [Steven Degutis](https://github.com/sdegutis/).
local module = require("hs.timer.internal")
-- private variables and methods -----------------------------... | tmandry/hammerspoon | extensions/timer/init.lua | Lua | mit | 1,478 |
--[[
Copyright 2012 Rackspace
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, software
dis... | christopherjwang/rackspace-monitoring-agent | check/null.lua | Lua | apache-2.0 | 844 |
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')
function ENT:Initialize()
self.BaseClass.Initialize(self)
self.Active = 0
self.damaged = 0
self.gtemp = 0
if not (WireAddon == nil) then
self.WireDebugName = self.PrintName
self.Inputs = Wire_CreateInputs(... | spacebuild/spacebuild | lua/entities/base_temperature_exchanger/init.lua | Lua | apache-2.0 | 6,068 |
--
-- tests/actions/xcode/test_xcode_dependencies.lua
-- Automated test suite for Xcode project dependencies.
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
--
local suite = test.declare("xcode_deps")
local p = premake
local xcode = p.modules.xcode
-----------------------------------------------... | soundsrc/premake-core | modules/xcode/tests/test_xcode_dependencies.lua | Lua | bsd-3-clause | 9,771 |
require("config")
require("framework.init")
-- define global module
game = {}
function game.startup()
cc.FileUtils:getInstance():addSearchPath("res/")
display.addSpriteFrames(GAME_TEXTURE_DATA_FILENAME, GAME_TEXTURE_IMAGE_FILENAME)
game.benchmark()
end
function game.exit()
os.exit()
end
function g... | cuit-zhaxin/quick-ng | quick/samples/benchmark/src/game.lua | Lua | mit | 447 |
--------------------------------
-- @module PhysicsShape
-- @extend Ref
-- @parent_module cc
--------------------------------
-- Get this shape's friction.<br>
-- return A float number.
-- @function [parent=#PhysicsShape] getFriction
-- @param self
-- @return float#float ret (return value: float)
----------... | tianxiawuzhei/cocos-quick-cpp | publibs/cocos2dx/cocos/scripting/lua-bindings/auto/api/PhysicsShape.lua | Lua | mit | 10,093 |
local gmod = gmod
local pairs = pairs
local isfunction = isfunction
local isstring = isstring
local IsValid = IsValid
module( "hook" )
local Hooks = {}
--[[---------------------------------------------------------
Name: GetTable
... | OctoEnigma/shiny-octo-system | lua/includes/modules/hook.lua | Lua | mit | 3,021 |
CAbstractInputOutput = class(CBaseObject,
function (self, procHandle , hwnd)
self.procHandle = procHandle;
self.hwnd = hwnd;
end
);
function CAbstractInputOutput:read(Handle, type, Address )
local result = nil;
local counter = 1;
local limit = 5;
repeat
result = process.read(Handle, type, Address)
coun... | BlubBlab/Micromacro-2-Bot-Framework | classes/abstract.inputoutput.class.lua | Lua | mit | 15,965 |
--[[
Original Source: https://github.com/karpathy/char-rnn/model
]]--
local GRU = {}
--[[
Creates one timestep of one GRU
Paper reference: http://arxiv.org/pdf/1412.3555v1.pdf
]]--
function GRU.gru(input_size, rnn_size, n, dropout)
dropout = dropout or 0
-- there are n+1 inputs (hiddens on each layer and x)
... | ganeshjawahar/dl4nlp-made-easy | char_rnn/model/GRU.lua | Lua | mit | 2,131 |
--[[ @cond ___LICENSE___
-- Copyright (c) 2017 Zefiros Software.
--
-- 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, ... | Zefiros-Software/ZPM | src/install.lua | Lua | mit | 11,428 |
#!/usr/bin/env lua
---------------------------------------------------------------------------
-- Lua Dependency Check
--
-- This will verify the necessay Lua dependencies are loaded
-- an warn the user for missing files/components. This ensures
-- the correct modules are available for the tests to run.
--------------... | xs-embedded-llc/l2dbus | test/utils/dependsCheck.lua | Lua | mit | 1,656 |
require "classes.constants.screen"
require "classes.Key"
WhiteKey={}
function WhiteKey:new(impl)
local this = Key:new()
local public = this
local private = {}
this.impl = impl
function private.WhiteKey()
end
function public.drawKey()
this.impl.setColor("white")
this.impl... | sebastianlis/DesignPatterns-in-Lua-Using-CoronaSDK | Bridge/PianoKeys/classes/WhiteKey.lua | Lua | mit | 722 |
RealUI_InitDB = {
["stripeOpacity"] = 0.5,
["uiModScale"] = 1,
}
| jyggen/lua-parser | tests/Fixtures/a3/87/6d/1eae165f28b08d494c9eecc26a13b7c66039376fa4db6bc2a9fb82136a.lua | Lua | mit | 73 |
--[[
##########################################################
S V U I By: Munglunch
##########################################################
LOCALIZED LUA FUNCTIONS
##########################################################
]]--
--[[ GLOBALS ]]--
local _G = _G;
local unpack = _G.unpack;
local select = _G.select... | joev/SVUI-Temp | SVUI_Inventory/components/organization.lua | Lua | mit | 9,700 |
-- Callbacks for your inventory
--[[
Callbacks.Quantity("all", "Embersilk Cloth", printf, "You now have %d cloth!");
--]]
--
-- See Also:
-- Containers.SumItem
if nil ~= require then
require "fritomod/Lists";
require "fritomod/Events";
require "fritomod/Containers";
end;
Callbacks=Callbacks or {};
-- Fires on i... | Thonik/FritoMod | fritomod/Callbacks-Inventory.lua | Lua | mit | 1,056 |
--partClasses.lua
Image = Class{__includes = Part,
init = function(self, parent, name, filepath, offx, offy, qw, qh)
Part.init(self, parent, name)
self.image = love.graphics.newImage(filepath)
self.r = 0
self.sx = 1
self.sy = 1
local imgw, imgh = self.image:getDimensions()
self.qw = qw or img... | RokaRoka/MistyWitches | partClasses.lua | Lua | mit | 3,882 |
require "test"
print(test.add(2))
| elloop/lua_in_cpp | src/test_so/hello.lua | Lua | mit | 35 |
-- Natural Selection 2 Competitive Mod
-- Source located at - https://github.com/xToken/CompMod
-- lua\CompMod\SpawnAngleFix\shared.lua
-- - Dragon
-- This shouldnt really be done this way, but its an effective test. With a network message it may not arrive at the same time as the rest of the respawn,
-- causing som... | xToken/CompMod | lua/CompMod/SpawnAngleFix/shared.lua | Lua | mit | 6,905 |
local core = require "sprite_core"
local sprite_frame = require "seal.sprite_frame"
local sprite = {
get_frame_from_cache = core.get_frame_from_cache,
load_sprite_frame = core.load_sprite_frame,
unload_sprite_frame = core.unload_sprite_frame,
set_frame_texture_id = core.set_frame_texture_id,
set_te... | lyzardiar/seal2d | luasrc/seal/sprite.lua | Lua | mit | 3,771 |
local skynet = require "skynet"
local cluster = require "cluster"
skynet.start(function()
print(cluster.call("db", "SIMPLEDB", "GET", "a"))
end)
| tanxunrong/mruby-toy | examples/cluster2.lua | Lua | mit | 147 |
local initialize_rules = require 'validation.rules.initialize_rules'
local next, setmetatable = next, setmetatable
local function validate(self, model, errors, translations)
local ok = true
for name, rules in next, self.mapping do
local value = model[name]
for _, r in next, rules do
... | akornatskyy/lucid | src/validation/validator.lua | Lua | mit | 1,492 |
local interpreterLib = {};
local interpreterMetatable = {__index = interpreterLib};
local registerIndex = {
[0] = "ar";
[1] = "br";
[2] = "sp";
[3] = "ip";
};
function interpreterLib.new()
local registers = {ar = 0, br = 0, sp = 0, ip = 0};
local memory = {};
for address = 0, 255 do
memory[address] = 0;
end... | cntkillme/MattyDavy | Lua/interpreter.lua | Lua | mit | 3,209 |
function init()
if storage.state == nil then
storage.state = config.getParameter("defaultTvState", 0)
end
self.interactive = config.getParameter("interactive", true)
object.setInteractive(self.interactive)
if config.getParameter("inputNodes") then
processWireInput()
end
setTvState(storage.state... | sb-artichoke/starbound-sextillian | Sextillian-Objects/objects/wired/tv/tv.lua | Lua | mit | 1,834 |
-- function FIFO_PushPlainText (fifo,s) fifo:PushFilledString(s,string.len(s)+1) end
kIRC_DefaultPort = 6667
-- irc connection prototype (class)
gIRCConnectionPrototype = {}
-- current connection state
gIRCConnectionPrototype.IsConnected = function(self)
return self.con and self.con:IsConnected()
end
-- joins a cha... | ghoulsblade/vegaogre | lugre/lua/lib.irc.lua | Lua | mit | 5,369 |
local GUI = {
-- GUI Survival
{type = 'header', text = 'Survival', align = 'center'},
{type = 'checkbox', text = 'Enable Astral Shift', key = 'S_ASE', default = true},
{type = 'spinner', text = '', key = 'S_AS', default = 40},
{type = 'checkbox', text = 'Enable Healing Surge', key = 'S_HSGE', default = true},
{ty... | damuY/NerdPack-Yumad | rotations/shaman/enhancement.lua | Lua | mit | 11,694 |
FadingImage = class()
function FadingImage:init()
self.imgs = {}
end
function FadingImage:draw()
for i,v in ipairs(self.imgs) do
pushStyle()
local sameCount = 0
for ni,nv in ipairs(self.imgs) do
if nv.x == v.x and ni > i then
sameCount = sameCount + 1
... | NathanFlurry/StackIt | StackIt.codea/FadingImage.lua | Lua | mit | 900 |
local ffi = require 'Q/UTILS/lua/q_ffi'
local cmem = require 'libcmem'
local get_ptr = require 'Q/UTILS/lua/get_ptr'
local function mem_initialize(subs)
local hdr = [[
typedef struct _rand_B1_rec_type {
uint64_t seed;
double probability;
} RAND_B1_REC_TYPE;
]]
pcall(ffi.cdef, hdr)
-- Set ... | NerdWalletOSS/Q | OPERATORS/S_TO_F/lua/rand_mem_initialize_B1.lua | Lua | mit | 695 |
-- Lua workhorse behind the WeakAura synchronization.
local requireRel
if arg then package.path=arg[0]:match("(.-)[^\\/]+$").."?.lua;"..package.path;requireRel=require
elseif...then local d=(...):match("(.-)[^%.]+$")function requireRel(m)return require(d..m)end end
local Transmission = requireRel("Transmission")
loca... | jcai1/WowCoding | sync-lua/main.lua | Lua | mit | 7,185 |
local coins = 0
loop
zx, zy = self.pos.x, self.pos.y
self:moveXY(zx + 9, zy + 20)
self:attack(self:findNearest(self:findEnemies()))
self:moveXY(zx + 20, zy + 49)
local i = self:findNearest(self:findItems())
self:moveXY(i.pos.x, i.pos.y)
coins = coins + 1
self:moveXY(zx + 34, zy + 24)
... | nikai3d/codecombat-scripts | dungeon/kithgard-mastery.lua | Lua | mit | 439 |
local uboss = require "uboss"
local sprotoloader = require "sprotoloader"
-- 最大64个客户连接
local max_client = 64
uboss.start(function()
uboss.error("Server start")
-- 启动唯一的服务:加载协议 ./examples/gate/protoloader.lua
uboss.uniqueservice("protoloader")
-- 启动新服务:控制台 ./service/console.lua
local console = uboss.newservice(... | dalistudio/uboss | examples/gate/main.lua | Lua | mit | 965 |
readlevel = function(file) --Function that reads a file and returns the info of a level
local file = io.open(file, "r")
if file == nil then return {} end
local table = {} --File lines to table
for line in file:lines() do
table[#table+1] = line
end
for key,value in pairs(table) do --Separate each line b... | jdev6/gdclone | editor/readlevel.lua | Lua | mit | 696 |
-- Saga is Licensed under Creative Commons Attribution-NonCommerial-ShareAlike 3.0 License
-- http://creativecommons.org/licenses/by-nc-sa/3.0/
-- Generated By Quest Extractor on 2/8/2008 3:46:15 PM
local QuestID = 180;
local ReqClv = 12;
local ReqJlv = 0;
local NextQuest = 181;
local RewZeny = 212;
local RewCxp = 900... | Darkin47/SagaRevised | Quests/180.lua | Lua | cc0-1.0 | 2,942 |
if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
end
if ( CLIENT ) then
SWEP.PrintName = "DC-15A Comic Book"
SWEP.Author = "TFA"
SWEP.ViewModelFOV = 50
SWEP.Slot = 2
SWEP.SlotPos = 3
SWEP.WepSelectIcon = surface.GetTextureID("HUD/killicons/DC15A")
killicon.Add( "weapon_752_dc15a", "HUD... | Servius/tfa-sw-weapons-repository | Live Addons/servius_uploader_legacy/tfa_swrp_expanded_weapons_pack/lua/weapons/tfa_swch_dc15a_comicbook_fray/shared.lua | Lua | apache-2.0 | 2,823 |
local os = require("os")
local function a(t,...)
local arg = {...}
for i=1,#arg do
table.insert(t, arg[i])
end
end
local function f(file,...)
file:write(...)
end
local function serializeToFileRec(file, obj, indent, asArray)
indent = indent or ''
if asArray then
for _,v in ipairs(obj) do
loc... | InfinitiesLoop/oclib | serializer.lua | Lua | apache-2.0 | 6,305 |
-- This file is part of the Watchfaces project.
-- Read the file README.md for copyright and other information
function about()
local result = {}
result.author = "DSH Electronics"
result.name = "LedClock"
return result
end
function init()
local atlas = face:loadAtlas('all.atlas')
lowerRing =... | kurthuwig/faces | Watchfaces/dsh_electronics/led_clock/face.lua | Lua | apache-2.0 | 3,136 |
--[[
File: gameobject.lua
Author: Daniel "lytedev" Flanagan
Website: http://dmf.me
The base gameobject class.
]]--
require("conf")
| lytedev/quick-td | gameobject/gameobject.lua | Lua | apache-2.0 | 139 |
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if math.random(50) == 1 then
player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
player:say("You get the Prize!", TALKTYPE_MONSTER_SAY)
Item(item.uid):transform(5958)
else
player:getPosition():sendMagicEffect(CONST_M... | victorperin/tibia-server | data/actions/scripts/other/lotteryticket.lua | Lua | apache-2.0 | 431 |
local ls = { }
for z=1,10 do
for y=1,10 do
for x=1,10 do
if x^2 + y^2 == z^2 then
ls[#ls+1] = function() return x, y, z end
goto zcontinue
end
end end ::zcontinue:: end
for i = 1, #ls do
print('found a Pythagorean triple', ls[i]())
end
| gaoxiaojun/symphony | ref/luajit-lang-toolkit/tests/goto-closure-1.lua | Lua | bsd-3-clause | 254 |
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0190-resumption-data-error-handling.md
--
-- Description:
-- Check data resumption is failed in case if HMI responds with <erroneous> re... | smartdevicelink/sdl_atf_test_scripts | test_scripts/Resumption/Handling_errors_from_HMI/006_resume_all_data_with_one_error_rpc_ign_off.lua | Lua | bsd-3-clause | 2,843 |
-- Copyright (c) Facebook, Inc. and its affiliates.
-- This source code is licensed under the MIT license found in the
-- LICENSE file in the root directory of this source tree.
-- Note: This test case was originally contributed by
-- Javier <nanoterrain@yahoo.com> in git commit c6cf0b6fa31
-- and licensed under the f... | facebook/CParser | tests/spec/cparser_spec.lua | Lua | bsd-3-clause | 1,149 |
local script = io.open("AutoResponder.lua", "r"):read("*a")
local threadPat = io.open("thread.txt", "r"):read("*a")
local file = io.open("threadFinal.txt", "w+")
if file ~= nil then
file:write(string.format(threadPat, script))
file:flush()
file:close()
end
| Tibia-WindBot/windbotscripts | persistents/157-auto responder/build.lua | Lua | mit | 262 |
require('tests.bootstrap')(assert)
describe('listener', function()
local listener
before_each(function()
package.loaded['nginx-metrix.listener'] = nil
listener = require 'nginx-metrix.listener'
end)
after_each(function()
package.loaded['nginx-metrix.listener'] = nil
_... | LuaDist2/nginx-metrix | tests/listener_spec.lua | Lua | mit | 2,307 |
local _, Engine = ...
local Module = Engine:NewModule("Blizzard: GhostFrame")
Module.OnInit = function(self)
local content = GhostFrame
if (not content) then
return
end
local config = self:GetDB("Blizzard").ghostframe
local holder = Engine:CreateFrame("Frame", nil, "UICenter")
holder:Place(unpack(config.posi... | cogwerkz/DiabolicUI | modules/blizzard/ghostframe.lua | Lua | mit | 729 |
local string = string
local tonumber = tonumber
local setmetatable = setmetatable
local error = error
local ipairs = ipairs
local io = io
local table = table
local math = math
local assert = assert
local tostring = tostring
local type = type
local insert_tab = table.insert
local function meta(name, t)
t = t or {}
... | sloong/sloongnet | src/modules/middleLayer/lua/scripts/librarys/protoc.lua | Lua | mit | 33,420 |
local gunshop = {
names = {
}
}
return gunshop | ENDrain/vRP-plusplus | vrp/cfg/lang/ru/gunshop.lua | Lua | mit | 54 |
--[[
_
( )
_| | __ _ __ ___ ___ _ _
/'_` | /'__`\( '__)/' _ ` _ `\ /'_` )
( (_| |( ___/| | | ( ) ( ) |( (_| |
`\__,_)`\____)(_) (_) (_) (_)`\__,_)
DColorMixer
--]]
local PANEL = {}
AccessorFunc( PANEL, "m_Color", "Color" )
function PANEL:Init()
self:SetSize( 256, 256 )
self:BuildControls(... | Capster/Metro | lua/metro/ui/dcolorcombo.lua | Lua | apache-2.0 | 1,539 |
local spec_helper = require "spec.spec_helpers"
local env = spec_helper.get_env()
local dao_factory = env.dao_factory
dao_factory:load_plugins({"keyauth", "basicauth", "oauth2"})
describe("Cassandra cascade delete", function()
setup(function()
spec_helper.prepare_db()
end)
describe("API -> plugins", func... | vzaramel/kong | spec/integration/dao/cassandra/cascade_spec.lua | Lua | apache-2.0 | 7,669 |
-- authors: Luxinia Dev (Eike Decker & Christoph Kubisch)
---------------------------------------------------------
-- function helpers
local function fn (description)
local description2,returns,args = description:match("(.+)%-%s*(%b())%s*(%b())")
if not description2 then
return {type="function",description=desc... | LuaExtend/LuaExtend | tools/ZeroBraneStudio/api/glsl/std.lua | Lua | apache-2.0 | 23,596 |
local Dta = select(2, ...)
Dta.expimp_ui = {}
local ExpImpWindowSettings = {
WIDTH = 325,
HEIGHT = 290,
CLOSABLE = true,
MOVABLE = true,
POS_X = "ExpImpwindowPosX",
POS_Y = "ExpImpwindowPosY"
}
function Dta.expimp_ui.buildExpImpWindow()
local x = Dta.settings.get("ExpImpwindowPosX")
local y = Dta.settings.ge... | Lynx3d/dimension_tools | UI/ExpImp_UI.lua | Lua | bsd-3-clause | 5,031 |
function setup()
background(0,0,0);
end
function draw()
fill(math.random(255),math.random(255),math.random(255),math.random())
triangle(math.random(WIDTH),math.random(HEIGHT),
math.random(WIDTH),math.random(HEIGHT),
math.random(WIDTH),math.random(HEIGHT))
end
| saisai/load81 | examples/triangles.lua | Lua | bsd-2-clause | 299 |
--
-- tests/actions/vstudio/vc2010/test_filters.lua
-- Validate generation of file filter blocks in Visual Studio 2010 C/C++ projects.
-- Copyright (c) 2011-2014 Jason Perkins and the Premake project
--
local suite = test.declare("vs2010_filters")
local vc2010 = premake.vstudio.vc2010
--
-- Setup/teardo... | Meoo/premake-core | tests/actions/vstudio/vc2010/test_filters.lua | Lua | bsd-3-clause | 3,546 |
local Linear, parent = torch.class('nn.Linear', 'nn.Module')
function Linear:__init(inputSize, outputSize, bias)
parent.__init(self)
local bias = ((bias == nil) and true) or bias
self.weight = torch.Tensor(outputSize, inputSize)
self.gradWeight = torch.Tensor(outputSize, inputSize)
if bias then
se... | EliHar/Pattern_recognition | torch1/install/share/lua/5.1/nn/Linear.lua | Lua | mit | 3,624 |
-- Use Include 'prosody-posix-ldap.cfg.lua' from prosody.cfg.lua to include this file
authentication = 'ldap2' -- Indicate that we want to use LDAP for authentication
storage = 'ldap' -- Indicate that we want to use LDAP for roster/vcard storage
ldap = {
hostname = 'localhost', -- L... | guilhem/prosody-modules | mod_lib_ldap/dev/prosody-posix-ldap.cfg.lua | Lua | mit | 2,476 |
-- Effects that get applied to Units or Towers
Effect = {
timeDistort = 0.7,
duration = 1.0,
}
function Effect:New(o)
o = o or {}
setmetatable(o, self)
self.__index = self
o.timeLeft = self.duration
return o
end
function Effect:update(dt)
self.timeLeft = self.timeLeft - dt
end
func... | adam000/Procellarum | engine/Effect.lua | Lua | mit | 441 |
function AsteroidImg()
local img = image(32, 32)
img:set(1,13,255,255,255,255)
img:set(1,14,255,255,255,255)
img:set(1,15,255,255,255,255)
img:set(1,16,255,255,255,255)
img:set(1,17,255,255,255,255)
img:set(2,10,255,255,255,255)
img:set(2,11,255,255,255,255)
img:set(2,12,255,255,255,255)
img:set(2,13,255,255,255,255)
i... | effelsberg/loveCodea | forum/TinyWorld/AsteroidImg.lua | Lua | mit | 19,033 |
local Vector = require('./vector')
local Mover = {}
Mover.__index = Mover
function Mover.new(location, mass)
local t = {}
setmetatable(t, Mover)
t.location = location
t.mass = mass
t.velocity = Vector.new(0, 0)
t.acceleration = Vector.new(0, 0)
t.width = mass * 5
t.height = mass
t.color = {200, 200... | BrooksPatton/natureofcode | chapter_3/example_3.3/mover-class.lua | Lua | mit | 1,511 |
local M = { }
function M.parse(arg)
local cmd = torch.CmdLine()
cmd:text()
cmd:text('Torch-7 - Training script')
cmd:text()
cmd:text('Options:')
------------ General options --------------------
cmd:option('-data', '', 'Path to dataset')
cmd:option('-dataset', 'v... | durandtibo/wsl.resnet.torch | opts.lua | Lua | mit | 5,417 |
AddCSLuaFile();
--
-- sh_
--
ENT.Type = "anim";
DEFINE_BASECLASS("base_hl2pickup");
ENT.PrintName = "Health Kit";
ENT.Author = "Pugsworth";
ENT.Contact = "191292";
ENT.Category = "HL2 Pickups";
ENT.Purpose = "Heal";
ENT.Instructions = "Walk over to gain health";
... | Pugsworth/GarrysMod-Code | Puggles Various Scripts/lua/entities/sent_healthkit.lua | Lua | mit | 1,733 |
-- lsp
local nvim_lsp = require('lspconfig')
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
-- Mappings.
local opts = ... | iamruinous/dotfiles | config/nvim/lua/iamruinous/lsp.lua | Lua | mit | 3,291 |
local NeP = NeP
NeP.Buttons = {
buttons = {}
}
local nBars = {
"ActionButton",
"MultiBarBottomRightButton",
"MultiBarBottomLeftButton",
"MultiBarRightButton",
"MultiBarLeftButton"
}
-- this seems to be missing now....
-- added this from old dumps and seems to work...
local function ActionButton_CalculateAction... | MrTheSoulz/NerdPack | system/buttons.lua | Lua | mit | 1,675 |
---
-- Implementation of ND Arrays in Lua.
-- @classmod Array
-- A generic implementation of ND arrays in pure Lua.
-- This module tries to be as similar to the Python numpy package
-- as possible.
--
-- Due to everything being in Lua there are not _views_ of arrays which
-- means that many functions creates unnecessar... | siesta-project/flos | flos/num/array.lua | Lua | mit | 33,654 |
settings = { -- Set default display units here
["distance"] = 1,
["speed"] = 2,
["angle"] = 1
}
units = {
["distance"] = { -- Do not change these
{" m", 1}, -- 1
{" ft", 3.281} -- 2
},
["speed"] = { -- Do not change these
{" m/s", 0.278}, -- 1
{" km/h", 1}, -- 2
{" mi/h", 0.621}, -- 3
{" ft/s", 0.911... | mkwia/jc2atc | scripts/autopilot/client/_init.lua | Lua | mit | 12,360 |
--HELP: \b6Usage: \b16cd \b7<\b16dir\b7> \n
-- \b6Description: \b7Changes directory to \b16dir
local args = ({...})[1]
local mask = tonumber("11111111", 2)
local function er(t)
if shell then
print(t, 8)
else
error(t, 2)
end
end
if #args > 0 then
local val = fs.getAttr(args)
if va... | incinirate/Riko4 | scripts/usr/bin/cd.lua | Lua | mit | 518 |
-- demlo script
help([=[
Get disc numberfrom the single digit of the parent folder.
If there is none, remove disc number.
Set track number to first number in input file name:
demlo -pre 'o.track=input.path:match([[.*\/\D*(\d*)\D*]])' audio.file
]=])
local parent = input.path:match("(.*)/")
local dirname = parent and... | Ambrevar/Demlo | scripts/15-tag-disc_from_path.lua | Lua | mit | 490 |
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Tip Jar"
ENT.Author = "FPtje"
ENT.Spawnable = false
function ENT:initVars()
self.model = "models/props_lab/jar01a.mdl"
self.damage = 100
self.callOnRemoveId = "tipjar_activedonation_" .. self:EntIndex() .. "_"
self.activeDonations = {}
... | PichotM/DarkRP | entities/entities/darkrp_tip_jar/shared.lua | Lua | mit | 2,019 |
-- Prosody IM
-- Copyright (C) 2008-2010 Matthew Wild
-- Copyright (C) 2008-2010 Waqas Hussain
-- Copyright (C) 2014 Daurnimator
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
local function get_language(room)
return room._data.language;
end
loca... | bjc/prosody | plugins/muc/language.lib.lua | Lua | mit | 1,351 |
/*---------------------------------------------------------------------------
Functions
---------------------------------------------------------------------------*/
local meta = FindMetaTable("Player")
function meta:changeTeam(t, force, suppressNotification)
local prevTeam = self:Team()
local notify = suppress... | Sxcret/FrenchRP | gamemode/modules/jobs/sv_jobs.lua | Lua | mit | 16,540 |
solution "GraphLib"
configurations { "Debug", "Release" }
startproject "GraphLib-unittest"
location "build"
project "GraphLib-core"
kind "StaticLib"
language "C++"
targetdir "build/bin/%{cfg.buildcfg}"
files { "src/core/**.h",
"src/core/**.cpp" }
removefiles { "... | szekizoli/graphlib | premake5.lua | Lua | mit | 1,954 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.