repo_name
stringlengths
6
78
path
stringlengths
4
206
copies
stringclasses
281 values
size
stringlengths
4
7
content
stringlengths
625
1.05M
license
stringclasses
15 values
bm01/PokeBotBad
BizHawk-1.11.6/Lua/SNES/Y's III.lua
7
2609
-- Y's III (SNES) Collision box viewer -- Bizhawk -- Author: Pasky local camx local camy function findbit(p) return 2 ^ (p - 1) end function hasbit(x, p) return x % (p + p) >= p end local function hex(val) val = string.format("%X",val) if string.len(val) == 1 then val = "0" .. val end return val end loc...
mit
MinetestForFun/minetest-minetestforfun-server
minetestforfun_game/mods/bucket/init.lua
9
5897
-- Minetest 0.4 mod: bucket -- See README.txt for licensing and other information. minetest.register_alias("bucket", "bucket:bucket_empty") minetest.register_alias("bucket_water", "bucket:bucket_water") minetest.register_alias("bucket_acid", "bucket:bucket_acid") minetest.register_alias("bucket_lava", "bucket:bucket_l...
unlicense
dev-osrose/osIROSE-new
scripts/mobs/ai/hunter_rackie.lua
2
1066
registerNpc(96, { walk_speed = 160, run_speed = 400, scale = 96, r_weapon = 941, l_weapon = 0, level = 26, hp = 20, attack = 121, hit = 102, def = 70, res = 34, avoid ...
apache-2.0
APItools/middleware
middleware/cache-middleware/cache_spec.lua
1
3944
local spec = require 'spec.spec' describe("404 alert", function() local cache before_each(function() cache = spec.middleware('cache-middleware/cache.lua') end) describe("when the method is not GET", function() it("does nothing", function() local request = spec.request({method = 'POST', ...
mit
npge/lua-npge
src/npge/util/init.lua
2
1600
-- lua-npge, Nucleotide PanGenome explorer (Lua module) -- Copyright (C) 2014-2016 Boris Nagaev -- See the LICENSE file for terms of use. return { split = require 'npge.util.split', unpack = require 'npge.util.unpack', loadstring = require 'npge.util.loadstring', arraysEqual = require 'npge.util.arrays...
mit
eskibars/domoticz
dzVents/runtime/device-adapters/temperature_humidity_device.lua
14
1051
local humidityMapping = { ['dry'] = 2, ['normal'] = 0, ['comfortable'] = 1, ['wet'] = 3 } return { baseType = 'device', name = 'Temperature+humidity device adapter', matches = function (device, adapterManager) local res = (device.deviceType == 'Temp + Humidity') if (not res) then adapterManager.addDum...
gpl-3.0
MinetestForFun/minetest-minetestforfun-server
mods/darkage/stairs.lua
5
10390
if stairsplus then stairsplus:register_all("darkage", "basalt", "darkage:basalt", { description = "Basalt", tiles = {"darkage_basalt.png"}, groups = {cracky=3}, sounds = default.node_sound_stone_defaults(), sunlight_propagates = true, }) stairsplus:register_all("darkage", "marble", "darkage:marble", { ...
unlicense
alikingambav/archer3
plugins/lock_tag.lua
13
2903
local function run(msg, matches) if msg.to.type == 'chat' then if is_momod(msg) then return end local data = load_data(_config.moderation.data) if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings'] then if data[tostring(msg.to.id)]['settings']['lock_tag']...
gpl-2.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/TextureData.lua
19
1044
-------------------------------- -- @module TextureData -- @extend Ref -- @parent_module ccs -------------------------------- -- -- @function [parent=#TextureData] getContourData -- @param self -- @param #int index -- @return ContourData#ContourData ret (return value: ccs.ContourData) ---------------------...
mit
syj2010syj/w3x2lni
script/share/protocol.lua
3
1189
local function send(type, args) local content = ('{type=%q,args=%s}\r\n'):format(type, args) io.stdout:write(('Content-Length: %d\r\n%s'):format(#content, content)) end local function execute(s) return assert(load('return (' .. s .. ')', '=(protocol)', 't', {}))() end local function recv(s, bytes) byt...
gpl-3.0
holyscroll/holyscroll
plugins/anti_fosh.lua
1
1456
local function run(msg, matches) if is_owner(msg) then return end local data = load_data(_config.moderation.data) if data[tostring(msg.to.id)] then if data[tostring(msg.to.id)]['settings'] then if data[tostring(msg.to.id)]['settings']['antifosh'] then lock_fos...
gpl-2.0
npge/lua-npge
src/npge/block/goodSubblocks.lua
2
2626
-- lua-npge, Nucleotide PanGenome explorer (Lua module) -- Copyright (C) 2014-2016 Boris Nagaev -- See the LICENSE file for terms of use. local function removeMostDistant(block) local consensus = require 'npge.block.consensus' local identity = require 'npge.alignment.identity' local c = consensus(block) ...
mit
Gotoga/MLP
modules/surface.lua
2
2350
surface = {} surface._DrawColor = Color(255, 255, 255) surface._TextColor = Color(255, 255, 255) surface._TextFont = "pricedown" surface._Texture = nil surface._TextPos = {x = 0, y = 0} surface.CreateFont = dxCreateFont function surface.SetDrawColor(tblColor) surface._DrawColor = tblColor end function surface.S...
gpl-2.0
notcake/gooey
lua/gooey/ui/vpanelcontainer.lua
1
4655
local self = {} Gooey.VPanelContainer = Gooey.MakeConstructor (self) function self:ctor (control) self.Control = control self.Controls = {} self.HoveredControl = nil self.MouseCaptured = false if not control then Gooey.Error ("VPanelContainers must be constructed with a host VGUI panel.") retu...
gpl-3.0
Sxcret/FrenchRP
gamemode/entities/weapons/keys/cl_menu.lua
1
7748
local function AddButtonToFrame(Frame) Frame:SetTall(Frame:GetTall() + 110) local button = vgui.Create("DButton", Frame) button:SetPos(10, Frame:GetTall() - 110) button:SetSize(180, 100) Frame.buttonCount = (Frame.buttonCount or 0) + 1 Frame.lastButton = button return button end FrenchRP....
mit
ToqueWillot/M2DAC
AS/TME6/util/CharLMMinibatchLoader.lua
1
4417
-- loader for character-level language models require 'torch' require 'math' local CharLMMinibatchLoader = {} CharLMMinibatchLoader.__index = CharLMMinibatchLoader function CharLMMinibatchLoader.create(tensor_file, vocab_file, batch_size, seq_length) local self = {} setmetatable(self, CharLMMinibatchLoader) ...
gpl-2.0
potree/PotreeConverter
Converter/libs/brotli/premake5.lua
14
1706
-- A solution contains projects, and defines the available configurations solution "brotli" configurations { "Release", "Debug" } platforms { "x64", "x86" } targetdir "bin" location "buildfiles" flags "RelativeLinks" includedirs { "c/include" } filter "configurations:Release" optimize "Speed" flags { "StaticRuntim...
bsd-2-clause
PurgePJ/VouchBot
deps/discordia/libs/containers/Role.lua
1
4858
local json = require('json') local Snowflake = require('containers/abstract/Snowflake') local Color = require('utils/Color') local Permissions = require('utils/Permissions') local Resolver = require('client/Resolver') local FilteredIterable = require('iterables/FilteredIterable') local format = string.format l...
gpl-3.0
npge/lua-npge
src/npge/io/LoadFromLua.lua
2
2572
-- lua-npge, Nucleotide PanGenome explorer (Lua module) -- Copyright (C) 2014-2016 Boris Nagaev -- See the LICENSE file for terms of use. return function(code, enable_fromRef) local UnsafeBlockSet = require 'npge.model.BlockSet' local BlockSet if enable_fromRef then BlockSet = UnsafeBlockSet el...
mit
WUTiAM/wutLua
Source/LuaJIT-2.0.4/src/jit/bcsave.lua
87
18141
---------------------------------------------------------------------------- -- LuaJIT module to save/list bytecode. -- -- Copyright (C) 2005-2015 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h -------------------------------------------------------------------------...
mit
luzexi/slua-3rd
build/luajit-2.0.4/src/jit/bcsave.lua
87
18141
---------------------------------------------------------------------------- -- LuaJIT module to save/list bytecode. -- -- Copyright (C) 2005-2015 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h -------------------------------------------------------------------------...
mit
r4dikal/Bd
libs/fakeredis.lua
650
40405
local unpack = table.unpack or unpack --- Bit operations local ok,bit if _VERSION == "Lua 5.3" then bit = (load [[ return { band = function(x, y) return x & y end, bor = function(x, y) return x | y end, bxor = function(x, y) return x ~ y end, bnot = function(x) return ~x end, rshift = function(x...
gpl-3.0
4aiman/ethereal
plantpack.lua
1
4454
--= Register Biome Decoration Using Plants Mega Pack Lite --= Desert Biome -- Cactus minetest.register_decoration({ deco_type = "simple", place_on = {"default:desert_sand", "default:sandstone"}, sidelen = 16, fill_ratio = 0.005, biomes = {"desert", "desertstone"}, decoration = {"bakedclay:cactus_echinocereus"...
gpl-3.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/ArmatureAnimation.lua
16
5581
-------------------------------- -- @module ArmatureAnimation -- @extend ProcessBase -- @parent_module ccs -------------------------------- -- -- @function [parent=#ArmatureAnimation] getSpeedScale -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Play anim...
mit
MinetestForFun/minetest-minetestforfun-server
mods/arrow_signs/init.lua
3
7189
-- more_signs by addi -- Code and Textures are under the CC by-sa 3.0 licence -- see: http://creativecommons.org/licenses/by-sa/3.0/ arrow_signs = {} arrow_signs.formspec = "field[text;Sign text:;${text}]"; arrow_signs_on_place = function(itemstack, placer, pointed_thing) local posabove = pointed_thing.above loca...
unlicense
icebreaker/premake-dev
src/base/globals.lua
13
2939
-- -- globals.lua -- Global tables and variables, replacements and extensions to Lua's global functions. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- -- A top-level namespace for support functions premake = { } -- The list of supported platforms; also update list in cmdline.lua premake...
bsd-3-clause
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/Physics3DShape.lua
8
3047
-------------------------------- -- @module Physics3DShape -- @extend Ref -- @parent_module cc -------------------------------- -- -- @function [parent=#Physics3DShape] getbtShape -- @param self -- @return btCollisionShape#btCollisionShape ret (return value: btCollisionShape) ------------------------------...
mit
alikingambav/archer3
plugins/version.lua
5
2375
do function run(msg, matches) return [[TeleManagerPlus Bot Version : 2.2.0 For more Information send /telemanagerplus to chat ]] end return { description = "Shows bot version", usage = "!version: Shows bot version", patterns = { "^[!/]version$", "^[!/]ver$", "^[Vv]ersion$", "^[Vv]er...
gpl-2.0
nimaghorbani/Thor-Bot
libs/JSON.lua
3765
34843
-- -*- coding: utf-8 -*- -- -- Simple JSON encoding and decoding in pure Lua. -- -- Copyright 2010-2014 Jeffrey Friedl -- http://regex.info/blog/ -- -- Latest version: http://regex.info/blog/lua/json -- -- This code is released under a Creative Commons CC-BY "Attribution" License: -- http://creativecommons.org/licenses...
gpl-2.0
vorbi123/zeus2seed
plugins/ingroup.lua
527
44020
do -- Check Member local function check_member_autorealm(cb_extra, success, result) local receiver = cb_extra.receiver local data = cb_extra.data local msg = cb_extra.msg for k,v in pairs(result.members) do local member_id = v.id if member_id ~= our_id then -- Group configuration data[tostr...
gpl-2.0
jak-boy/jak_boy-
libs/redis.lua
566
1214
local Redis = require 'redis' local FakeRedis = require 'fakeredis' local params = { host = os.getenv('REDIS_HOST') or '127.0.0.1', port = tonumber(os.getenv('REDIS_PORT') or 6379) } local database = os.getenv('REDIS_DB') local password = os.getenv('REDIS_PASSWORD') -- Overwrite HGETALL Redis.commands.hgetall = ...
gpl-3.0
shahin20nice/nic
plugins/fun.lua
1
14083
-------------------------------- local function run_bash(str) local cmd = io.popen(str) local result = cmd:read('*all') return result end -------------------------------- local api_key = nil local base_api = "https://maps.googleapis.com/maps/api" -------------------------------- local function get_latlong...
gpl-3.0
jak-boy/jak_boy-
plugins/banhammer.lua
1
14061
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY MOHAMMED HISHAM ▀▄ ▄▀ ▀▄ ▄▀ BY MOHAMMEDHISHAM (@TH3BOSS) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY MOHAMMED HISHA ▀▄ ▄▀ ▀▄ ▄▀ ban hammer : الطرد والحظر ▀▄ ▄▀ ▀▄▀...
gpl-3.0
APItools/middleware
spec/spec.lua
1
1307
require 'spec.assert_contains' require 'spec.assert_difference' local spy = require 'luassert.spy' local env = require 'spec.env.env' local sandbox = require 'spec.sandbox' local http_utils = require 'spec.env.http_utils' local spec = {} ------------------------------ spec.request = function(req)...
mit
MinetestForFun/minetest-minetestforfun-server
minetestforfun_game/mods/beds/beds.lua
8
3178
for _, colour in pairs({"red", "white", "black", "blue", "green"}) do-- fancy shaped bed beds.register_bed("beds:fancy_bed_" .. colour, { description = "Fancy Bed (" .. colour .. ")", inventory_image = "beds_bed_fancy_" .. colour .. ".png", wield_image = "beds_bed_fancy_" .. colour .. ".png", tiles = { b...
unlicense
dev-osrose/osIROSE-new
scripts/mobs/ai/junon's_krawfy.lua
2
1071
registerNpc(405, { walk_speed = 260, run_speed = 720, scale = 340, r_weapon = 0, l_weapon = 0, level = 80, hp = 223, attack = 419, hit = 257, def = 291, res = 171, avoid ...
apache-2.0
syj2010syj/w3x2lni
script/core/optimizer/simplify.lua
1
10982
local confuser = require 'optimizer.confuser' local lang = require 'lang' local ipairs = ipairs local pairs = pairs local jass, state, report, confuse1, confuse2 local current_function, current_line, has_call local executes, executed_any, global_variable_any local mark_exp, mark_lines, mark_function local function g...
gpl-3.0
mattyx14/forgottenserver-1
data/migrations/14.lua
55
1362
function onUpdateDatabase() print("> Updating database to version 15 (moving groups to data/XML/groups.xml)") db.query("ALTER TABLE players DROP FOREIGN KEY players_ibfk_2") db.query("DROP INDEX group_id ON players") db.query("ALTER TABLE accounts DROP FOREIGN KEY accounts_ibfk_1") db.query("DROP INDEX group_id ...
gpl-2.0
dev-osrose/osIROSE-new
scripts/mobs/ai/butterfly.lua
2
14199
registerNpc(8, { walk_speed = 110, run_speed = 150, scale = 130, r_weapon = 0, l_weapon = 0, level = 1, hp = 54, attack = 1, hit = 55, def = 23, res = 10, avoid ...
apache-2.0
ZhuanJia/my-skynet
lualib/snax/hotfix.lua
3
1902
local si = require "snax.interface" local io = io local hotfix = {} local function collect_uv(f , uv) local i = 1 while true do local name, value = debug.getupvalue(f, i) if name == nil then break end local id = debug.upvalueid(f, i) if uv[name] then assert(uv[name].id == id, string.format("ambigui...
mit
kusk356/fucktion
plugins/vote.lua
615
2128
do local _file_votes = './data/votes.lua' function read_file_votes () local f = io.open(_file_votes, "r+") if f == nil then print ('Created voting file '.._file_votes) serialize_to_file({}, _file_votes) else print ('Values loaded: '.._file_votes) f:close() end return loadfile (_file_votes)()...
gpl-2.0
crazyhamedboy/botoliver
plugins/vote.lua
615
2128
do local _file_votes = './data/votes.lua' function read_file_votes () local f = io.open(_file_votes, "r+") if f == nil then print ('Created voting file '.._file_votes) serialize_to_file({}, _file_votes) else print ('Values loaded: '.._file_votes) f:close() end return loadfile (_file_votes)()...
gpl-2.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/ActionMoveFrame.lua
5
1221
-------------------------------- -- @module ActionMoveFrame -- @extend ActionFrame -- @parent_module ccs -------------------------------- -- Changes the move action position.<br> -- param the move action position. -- @function [parent=#ActionMoveFrame] setPosition -- @param self -- @param #vec2_table pos -- @return ...
mit
holyscroll/holyscroll
plugins/invite.lua
1
3999
do local function invite_user(chat_id, user_id, type_id) if is_banned(user_id, chat_id) then return send_large_msg('chat#id'..chat_id, 'Invitation canceled.\n' ..'ID'..user_id..' is (super)banned.') end chat_add_user('chat#id'..chat_id, 'user#id'..user_id, ok_cb, false) end local function resolve_username(extra...
gpl-2.0
ld-test/luarocks
lfw/rocks/luafilesystem/1.5.0-1/tests/test.lua
40
4634
#!/usr/local/bin/lua5.1 local tmp = "/tmp" local sep = "/" local upper = ".." require"lfs" print (lfs._VERSION) function attrdir (path) for file in lfs.dir(path) do if file ~= "." and file ~= ".." then local f = path..sep..file print ("\t=> "..f.." <=") local attr = lfs.attributes (f) assert (type(att...
mit
soolar/hexchat-textreplace
textreplace.lua
1
7451
hexchat.register("Text Replace", 0.1, "Sets up mappings to replace certain text in most events, such as for coloration or nicknaming.") local conffilename = hexchat.get_info("configdir") .. "/" .. "addon_text_replace.conf" -- incredibly oversimplified URL pattern, I'll make it more complex -- if that turns out to be ...
gpl-3.0
GuyCheung/falcon-ngx_metric
lua/ngx_metric/util.lua
1
1576
-- Copyright (C) Guy Cheung -- local log = ngx.log local ERR = ngx.ERR local _M = { _VERSION = '0.0.1' } function _M.dict_get_keys(dict, prefix) local keys = dict:get_keys() local res = {} for _, k in pairs(keys) do if _M.str_startwith(k, prefix) then table.insert(res, k) end ...
apache-2.0
Xuno/mpv
TOOLS/lua/autocrop.lua
27
3973
-- This script uses the lavfi cropdetect filter to automatically -- insert a crop filter with appropriate parameters for the currently -- playing video. -- -- It registers the key-binding "C" (shift+c), which when pressed, -- inserts the filter vf=lavfi=cropdetect. After 1 second, it then -- inserts the filter vf=crop=...
gpl-2.0
vorbi123/zeus2seed
libs/JSON.lua
3765
34843
-- -*- coding: utf-8 -*- -- -- Simple JSON encoding and decoding in pure Lua. -- -- Copyright 2010-2014 Jeffrey Friedl -- http://regex.info/blog/ -- -- Latest version: http://regex.info/blog/lua/json -- -- This code is released under a Creative Commons CC-BY "Attribution" License: -- http://creativecommons.org/licenses...
gpl-2.0
MinetestForFun/minetest-minetestforfun-server
mods/paintings/init.lua
3
1691
-- Licensed under CC0. -- Painting textures from Stunt Rally <https://code.google.com/p/vdrift-ogre/>, licensed under CC0. local paintings = {} paintings.dyes = { {"white", "White"}, {"grey", "Grey"}, {"black", "Black"}, {"red", "Red"}, {"yellow", "Yellow"}, {"green", "Green"}, {...
unlicense
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/Controller.lua
16
2842
-------------------------------- -- @module Controller -- @parent_module cc -------------------------------- -- Activate receives key event from external key. e.g. back,menu.<br> -- Controller receives only standard key which contained within enum Key by default.<br> -- warning The API only work on the android platfo...
mit
motangish/OpenComputers
MGOS/OS/Desktop/IconsEditor.bapp/IconsEditor.lua
1
4385
local bapi = require("BAPI") local image = require("BIMAGE") local gpu = require("BGPU") local buffer = require("BBUFFER") local unicode = require("unicode") local fs = require("filesystem") local xA, yA = bapi.getCenterOfScreen(16, 22) local colorG, textColorG, nilColorG, savePath, gotovo, buffImage = 0, 0xFFFFFF, 0x...
gpl-3.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/PhysicsContact.lua
18
1163
-------------------------------- -- @module PhysicsContact -- @extend EventCustom -- @parent_module cc -------------------------------- -- Get contact data. -- @function [parent=#PhysicsContact] getContactData -- @param self -- @return PhysicsContactData#PhysicsContactData ret (return value: cc.PhysicsContactData)...
mit
ibawt/ev
vendor/lua/pl/types.lua
26
4765
---- Dealing with Detailed Type Information -- Dependencies `pl.utils` -- @module pl.types local utils = require 'pl.utils' local types = {} --- is the object either a function or a callable object?. -- @param obj Object to check. function types.is_callable (obj) return type(obj) == 'function' or getm...
mit
i-z/cocos2d-x-samples
samples/KillBug/src/cocos/cocosbuilder/CCBReaderLoad.lua
61
5574
if nil == cc.CCBReader then return end ccb = ccb or {} function CCBReaderLoad(strFilePath,proxy,owner) if nil == proxy then return nil end local ccbReader = proxy:createCCBReader() local node = ccbReader:load(strFilePath) local rootName = "" --owner set in readCCBFromFile i...
mit
ZACTELEGRAM1/ALIREZA
bot/seedbot.lua
1
9997
package.path = package.path .. ';.luarocks/share/lua/5.2/?.lua' ..';.luarocks/share/lua/5.2/?/init.lua' package.cpath = package.cpath .. ';.luarocks/lib/lua/5.2/?.so' require("./bot/utils") VERSION = '1.0' -- This function is called when tg receive a msg function on_msg_receive (msg) if not started then retu...
gpl-2.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/EaseQuadraticActionInOut.lua
9
1524
-------------------------------- -- @module EaseQuadraticActionInOut -- @extend ActionEase -- @parent_module cc -------------------------------- -- brief Create the action with the inner action.<br> -- param action The pointer of the inner action.<br> -- return A pointer of EaseQuadraticActionInOut action. If creatio...
mit
chartly/portfolio
ditfw-gfx/deps/glsdk/glloadgen/modules/Specs.lua
2
6206
--[[ This module contains all of the spec-specific constructs (except where specs and styles overlap. That is, where styles have to do spec-specific work). This module has a function called GetSpec which is given the spec name and returns a table containing functions/data that can be evaluated to do different jobs. Th...
mit
dev-osrose/osIROSE-new
scripts/npcs/ai/[eucar_judge]_ishtal.lua
2
1065
registerNpc(1171, { walk_speed = 0, run_speed = 0, scale = 140, r_weapon = 0, l_weapon = 0, level = 10, hp = 100, attack = 100, hit = 100, def = 100, res = 100, avoid ...
apache-2.0
opentomb/OpenTomb
scripts/audio/sample_override.lua
2
8969
-- OPENTOMB SAMPLE OVERRIDE SCRIPT -- by noname, June 2014 -------------------------------------------------------------------------------- -- This script allows to override native sound effects from level files or -- MAIN.SFX file with custom samples. Note that you can specify it on a -- per-game basis only, and gene...
lgpl-3.0
aqasaeed/seedan
plugins/banhammer.lua
1085
11557
local function pre_process(msg) -- SERVICE MESSAGE if msg.action and msg.action.type then local action = msg.action.type -- Check if banned user joins chat by link if action == 'chat_add_user_link' then local user_id = msg.from.id print('Checking invited user '..user_id) local banned ...
gpl-2.0
MinetestForFun/minetest-minetestforfun-server
mods/mobs/api.lua
4
60936
-- Mobs Api (4th March 2016) mobs = {} mobs.mod = "redo" -- Load settings local damage_enabled = minetest.setting_getbool("enable_damage") local peaceful_only = minetest.setting_getbool("only_peaceful_mobs") local disable_blood = minetest.setting_getbool("mobs_disable_blood") local creative = minetest.setting_getbool(...
unlicense
tgcloner/how-
plugins/info2.lua
2
1908
do local function action_by_reply(extra, success, result) local user_info = {} local uhash = 'user:'..result.from.id local user = redis:hgetall(uhash) local um_hash = 'msgs:'..result.from.id..':'..result.to.id user_info.msgs = tonumber(redis:get(um_hash) or 0) user_info.name = user_print_name(user)..' ['....
gpl-2.0
drunklurker/wesnoth
data/ai/lua/ai_helper.lua
28
56354
local H = wesnoth.require "lua/helper.lua" local W = H.set_wml_action_metatable {} local LS = wesnoth.require "lua/location_set.lua" -- This is a collection of Lua functions used for custom AI development. -- Note that this is still work in progress with significant changes occurring -- frequently. Backward compatibil...
gpl-2.0
mrbangi/bangii
plugins/steam.lua
645
2117
-- See https://wiki.teamfortress.com/wiki/User:RJackson/StorefrontAPI do local BASE_URL = 'http://store.steampowered.com/api/appdetails/' local DESC_LENTH = 200 local function unescape(str) str = string.gsub( str, '&lt;', '<' ) str = string.gsub( str, '&gt;', '>' ) str = string.gsub( str, '&quot;', '"' ) str...
gpl-2.0
MinetestForFun/minetest-minetestforfun-server
minetestforfun_game/mods/farming/coffee.lua
12
3642
local S = farming.intllib -- coffee minetest.register_craftitem("farming:coffee_beans", { description = S("Coffee Beans"), inventory_image = "farming_coffee_beans.png", on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1") end, }) ...
unlicense
syj2010syj/w3x2lni
script/core/slk/backend_wtg.lua
1
7787
local lang = require 'lang' local w2l local wtg local wts local state local hex local pack_eca local CALL = lang.lml.CALL:match '^(.-)%s*$' local DISABLE = lang.lml.DISABLE:match '^(.-)%s*$' local PRESET = lang.lml.PRESET:match '^(.-)%s*$' local VARIABLE = lang.lml.VARIABLE:match '^(.-)%s*$' local CONSTANT = l...
gpl-3.0
npge/lua-npge
spec/algo/Merge_spec.lua
2
3253
-- lua-npge, Nucleotide PanGenome explorer (Lua module) -- Copyright (C) 2014-2016 Boris Nagaev -- See the LICENSE file for terms of use. describe("npge.algo.Merge", function() it("merges two blocksets", function() local model = require 'npge.model' local s = model.Sequence("s", "ATAT") loc...
mit
storevpsnet/SV
libs/XMLElement.lua
569
4025
-- Copyright 2009 Leo Ponomarev. Distributed under the BSD Licence. -- updated for module-free world of lua 5.3 on April 2 2015 -- Not documented at all, but not interesting enough to warrant documentation anyway. local setmetatable, pairs, ipairs, type, getmetatable, tostring, error = setmetatable, pairs, ipairs, typ...
gpl-3.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/Sprite.lua
2
16261
-------------------------------- -- @module Sprite -- @extend Node,TextureProtocol -- @parent_module cc -------------------------------- -- @overload self, cc.SpriteFrame -- @overload self, string -- @function [parent=#Sprite] setSpriteFrame -- @param self -- @param #string spriteFrameName -- @retur...
mit
luzexi/slua-3rd
build/lsqlite3-master/test.lua
15
3784
require("lsqlite3") local width = 78 local function line(pref, suff) pref = pref or '' suff = suff or '' local len = width - 2 - string.len(pref) - string.len(suff) print(pref .. string.rep('-', len) .. suff) end local db, vm local assert_, assert = assert, function (test) if (not test) then ...
mit
WhatTeam/FantasyLand
SampleCode/lua/actors/Knight.lua
1
9878
require "GlobalVariables" require "MessageDispatchCenter" require "Helper" require "AttackCommand" local file = "model/knight/knight.c3b" Knight = class("Knight", function() return require "Actor".create() end) function Knight:ctor() self._useWeaponId = ReSkin.knight.weapon self._useArmourId = ReSkin.kni...
mit
eskibars/domoticz
dzVents/runtime/device-adapters/p1_smartmeter_device.lua
7
1880
return { baseType = 'device', name = 'P1 smart meter energy device adapter', matches = function (device, adapterManager) local res = (device.deviceType == 'P1 Smart Meter' and device.deviceSubType == 'Energy') if (not res) then adapterManager.addDummyMethod(device, 'updateP1') end return res end, pr...
gpl-3.0
oregamikiller/cocos2dPod
cocos/scripting/lua-bindings/auto/api/ShakyTiles3D.lua
11
2096
-------------------------------- -- @module ShakyTiles3D -- @extend TiledGrid3DAction -- @parent_module cc -------------------------------- -- brief Initializes the action with a range, shake Z vertices, grid size and duration.<br> -- param duration Specify the duration of the ShakyTiles3D action. It's a value in sec...
mit
r4dikal/Bd
libs/JSON.lua
3765
34843
-- -*- coding: utf-8 -*- -- -- Simple JSON encoding and decoding in pure Lua. -- -- Copyright 2010-2014 Jeffrey Friedl -- http://regex.info/blog/ -- -- Latest version: http://regex.info/blog/lua/json -- -- This code is released under a Creative Commons CC-BY "Attribution" License: -- http://creativecommons.org/licenses...
gpl-3.0
syj2010syj/w3x2lni
script/core/slk/backend_cleanobj.lua
1
7456
local pairs = pairs local wtonumber = require 'w3xparser'.tonumber local keydata local is_remove_same local w2l local default local metadata local function sortpairs(t) local sort = {} for k, v in pairs(t) do sort[#sort+1] = {k, v} end table.sort(sort, function (a, b) return a[1] < b[1...
gpl-3.0
ld-test/luarocks
src/luarocks/fs/unix/tools.lua
8
11518
--- fs operations implemented with third-party tools for Unix platform abstractions. --module("luarocks.fs.unix.tools", package.seeall) local tools = {} local fs = require("luarocks.fs") local dir = require("luarocks.dir") local cfg = require("luarocks.cfg") local dir_stack = {} local vars = cfg.variables local fu...
mit
nimaghorbani/Thor-Bot
plugins/helprealm.lua
1
1242
do function run(msg, matches) return 'These commands only works in bots private \n Hammer \n /owners group_id [kick|ban|unban] user_id \n /owners 1234567 kick 1234567 \n \n cleaning \n /owners group_id clean [modlist|rules|about] \n /owners 1234567 clean modlist \n \n setting flood sensitivity \n /owners group_id ...
gpl-2.0
MinetestForFun/minetest-minetestforfun-server
mods/runes/scrolls.lua
8
1181
-- Scrolls for Runes Redo -- runes.scrolls = {} function register_scroll(name, type, data) if not data then return end local def = { inventory_image = (data.texture or "runes_scroll_unknown.png"), groups = {scroll = 1}, description = (data.description or "Mysterious Scroll"), } minetest.register_craftitem...
unlicense
MinetestForFun/minetest-minetestforfun-server
mods/moreblocks/crafting.lua
7
10762
--[[ More Blocks: crafting recipes Copyright (c) 2011-2015 Calinou and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] minetest.register_craft({ output = "default:stick", recipe = {{"default:dry_shrub"},} }) minetest.register_craft({ output = "default:stick", recipe = {{"...
unlicense
abbasgh12345/extreme2
libs/mimetype.lua
3662
2922
-- Thanks to https://github.com/catwell/lua-toolbox/blob/master/mime.types do local mimetype = {} -- TODO: Add more? local types = { ["text/html"] = "html", ["text/css"] = "css", ["text/xml"] = "xml", ["image/gif"] = "gif", ["image/jpeg"] = "jpg", ["application/x-javascript"] = "js", ["application/atom...
gpl-2.0
nimaghorbani/Thor-Bot
libs/mimetype.lua
3662
2922
-- Thanks to https://github.com/catwell/lua-toolbox/blob/master/mime.types do local mimetype = {} -- TODO: Add more? local types = { ["text/html"] = "html", ["text/css"] = "css", ["text/xml"] = "xml", ["image/gif"] = "gif", ["image/jpeg"] = "jpg", ["application/x-javascript"] = "js", ["application/atom...
gpl-2.0
aqasaeed/seedan
libs/mimetype.lua
3662
2922
-- Thanks to https://github.com/catwell/lua-toolbox/blob/master/mime.types do local mimetype = {} -- TODO: Add more? local types = { ["text/html"] = "html", ["text/css"] = "css", ["text/xml"] = "xml", ["image/gif"] = "gif", ["image/jpeg"] = "jpg", ["application/x-javascript"] = "js", ["application/atom...
gpl-2.0
ibawt/ev
lib/wait.lua
1
1624
local _M = {} _M.__index = _M local waiting = {} local signals = {} local time = 0 function _M.wait_for(seconds) local co = coroutine.running() assert(co, 'not a coroutine!') waiting[co] = time + seconds coroutine.yield() end function _M.wait_for_signal(signal) local co = coroutine.running() i...
mit
Amorph/premake-dev
tests/actions/vstudio/vc2010/test_debug_settings.lua
2
2223
-- -- tests/actions/vstudio/vc2010/test_debug_settings.lua -- Validate handling of the working directory for debugging. -- Copyright (c) 2011-2012 Jason Perkins and the Premake project -- T.vstudio_vs2010_debug_settings = { } local suite = T.vstudio_vs2010_debug_settings local vc2010 = premake.vstudio.vc201...
bsd-3-clause
MinetestForFun/minetest-minetestforfun-server
mods/plantlife_modpack/nature_classic/blossom.lua
8
2368
-- Blossoms and such local function spawn_apple_under(pos) local below = { x = pos.x, y = pos.y - 1, z = pos.z, } if minetest.get_node(below).name == "air" then minetest.set_node(below, { name = "default:apple" }) end end minetest.register_node(":"..nature.blossom_node, { description = "Apple...
unlicense
MinetestForFun/minetest-minetestforfun-server
mods/snow/src/sled.lua
9
5998
--[[ --================= --====================================== LazyJ's Fork of Splizard's "Snow" Mod by LazyJ version: Umpteen and 7/5ths something or another. 2014_04_12 --====================================== --================= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE LIST OF CHANGES I'VE MADE ~~~~~~~~~~~~~~~~~~...
unlicense
alikingambav/archer3
plugins/banhammer.lua
7
15711
local function pre_process(msg) -- SERVICE MESSAGE if msg.action and msg.action.type then local action = msg.action.type -- Check if banned user joins chat by link if action == 'chat_add_user_link' then local user_id = msg.from.id print('Checking invited user '..user_id) local banned ...
gpl-2.0
drunklurker/wesnoth
data/campaigns/The_Hammer_of_Thursagan/lua/spawns.lua
27
1324
-- Used for the bandit spawns in scenario 5 local helper = wesnoth.require "lua/helper.lua" local wml_actions = wesnoth.wml_actions local T = helper.set_wml_tag_metatable {} function wml_actions.spawn_units(cfg) local x = cfg.x or helper.wml_error("[spawn_units] missing required x= attribute.") local y = cfg.y or h...
gpl-2.0
dreamseekerkun/SimplifyReader
library_youku/src/main/res/raw/aes.lua
130
3338
---------------------- bit utils bit={data32={}} for i=1,32 do bit.data32[i]=2^(32-i) end function bit.d2b(arg) local tr={} for i=1,32 do if arg >= bit.data32[i] then tr[i]=1 arg=arg-bit.data32[i] else tr[i]=0 end end return tr end --bit:d2b f...
apache-2.0
eunmin/google-diff-match-patch
lua/diff_match_patch_test.lua
264
39109
--[[ * Test Harness for Diff Match and Patch * * Copyright 2006 Google Inc. * http://code.google.com/p/google-diff-match-patch/ * * Based on the JavaScript implementation by Neil Fraser * Ported to Lua by Duncan Cross * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except...
apache-2.0
meiwenhui/google-diff-match-patch
lua/diff_match_patch_test.lua
264
39109
--[[ * Test Harness for Diff Match and Patch * * Copyright 2006 Google Inc. * http://code.google.com/p/google-diff-match-patch/ * * Based on the JavaScript implementation by Neil Fraser * Ported to Lua by Duncan Cross * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except...
apache-2.0
MinetestForFun/minetest-minetestforfun-server
mods/pclasses/nodes.lua
8
4147
minetest.register_entity("pclasses:item", { initial_properties = { hp_max = 1, physical = false, collisionbox = {-0.17,-0.17,-0.17, 0.17,0.17,0.17}, visual = "sprite", visual_size = {x=0.5, y=0.5}, textures = {""}, spritediv = {x=1, y=1}, initial_sprite_basepos = {x=0, y=0}, is_visible = false, }, ...
unlicense
Sxcret/FrenchRP
gamemode/modules/jobs/sh_commands.lua
1
1532
local plyMeta = FindMetaTable("Player") FrenchRP.declareChatCommand{ command = "job", description = "Change your job name", delay = 1.5, condition = fn.Compose{fn.Not, plyMeta.isArrested} } FrenchRP.declareChatCommand{ command = "demote", description = "Demote a player from their job", del...
mit
Sxcret/FrenchRP
gamemode/modules/fadmin/fadmin/playeractions/jail/cl_init.lua
11
2411
FAdmin.StartHooks["Jail"] = function() FAdmin.Access.AddPrivilege("Jail", 2) FAdmin.Commands.AddCommand("Jail", nil, "<Player>", "[Small/Normal/Big]", "[Time]") FAdmin.Commands.AddCommand("UnJail", nil, "<Player>") FAdmin.ScoreBoard.Main.AddPlayerRightClick("Jail/Unjail", function(ply) if ply:F...
mit
henry4k/lua-mock
src/test/mock/ValueMatcher.lua
2
4396
--- @module ValueMatcher local valueMismatchMessage = 'did not match:\n'.. ' was: %s\n'.. 'expected: %s' local valueCountMismatchMessage = 'mismatch:\n'.. ' was: %d\n'.. 'expected: %d' --- A matcher is used to determine if a value statisfies some condition. -- The test function is ca...
unlicense
4aiman/ethereal
water.lua
1
3247
-- Ice Brick minetest.register_node("ethereal:icebrick", { description = "Ice Brick", tiles = {"brick_ice.png"}, paramtype = "light", freezemelt = "default:water_source", groups = {cracky=3, melts=1}, sounds = default.node_sound_glass_defaults(), }) minetest.register_craft({ output = 'ethereal:icebrick 4', rec...
gpl-3.0
pperichon/domoticz
scripts/lua/script_device_demo.lua
54
1870
-- demo device script -- script names have three name components: script_trigger_name.lua -- trigger can be 'time' or 'device', name can be any string -- domoticz will execute all time and device triggers when the relevant trigger occurs -- -- copy this script and change the "name" part, all scripts named "demo" are i...
gpl-3.0
opentomb/OpenTomb
scripts/strings/italian/global_items.lua
7
3026
-- OPENTOMB INVENTORY GLOBAL ITEM NAMES -- by Lwmte, Sep 2014 -------------------------------------------------------------------------------- -- In this file, we list all the global item names used across all games. -- Non-global item names should be eventually listed in level-specific scripts. -- Note that names lis...
lgpl-3.0
eskibars/domoticz
scripts/lua/script_device_demo.lua
54
1870
-- demo device script -- script names have three name components: script_trigger_name.lua -- trigger can be 'time' or 'device', name can be any string -- domoticz will execute all time and device triggers when the relevant trigger occurs -- -- copy this script and change the "name" part, all scripts named "demo" are i...
gpl-3.0