repo_name stringlengths 6 69 | path stringlengths 6 178 | copies stringclasses 278
values | size stringlengths 4 7 | content stringlengths 671 917k | license stringclasses 15
values |
|---|---|---|---|---|---|
thenumbernine/hydro-cl-lua | hydro/int/be-cpu.lua | 1 | 5109 | -- CPU version of the GMRES backward-Euler integrator
local ffi = require 'ffi'
local ig = require 'imgui'
local class = require 'ext.class'
local math = require 'ext.math'
local template = require 'template'
local CLBuffer = require 'cl.obj.buffer'
local Integrator = require 'hydro.int.int'
local BackwardEuler = cla... | mit |
uzlonewolf/proxmark3 | client/scripts/dumptoemul.lua | 10 | 2939 | -- The getopt-functionality is loaded from pm3/getopt.lua
-- Have a look there for further details
getopt = require('getopt')
bin = require('bin')
example = "script run dumptoemul -i dumpdata-foobar.bin"
author = "Martin Holst Swende"
usage = "script run dumptoemul [-i <file>] [-o <file>]"
desc =[[
This script takes a... | gpl-2.0 |
liuxuezhan/skynet | lualib/snax/hotfix.lua | 20 | 2502 | local si = require "snax.interface"
local function envid(f)
local i = 1
while true do
local name, value = debug.getupvalue(f, i)
if name == nil then
return
end
if name == "_ENV" then
return debug.upvalueid(f, i)
end
i = i + 1
end
end
local function collect_uv(f , uv, env)
local i = 1
while true... | mit |
adib1380/fu2 | plugins/time.lua | 1 | 2999 | -- Implement a command !time [area] which uses
-- 2 Google APIs to get the desired result:
-- 1. Geocoding to get from area to a lat/long pair
-- 2. Timezone to get the local time in that lat/long location
-- Globals
-- If you have a google api key for the geocoding/timezone api
api_key = nil
base_api = "https://m... | gpl-2.0 |
akopytov/sysbench | src/lua/select_random_points.lua | 1 | 1955 | #!/usr/bin/env sysbench
-- This test is designed for testing MariaDB's key_cache_segments for MyISAM,
-- and should work with other storage engines as well.
--
-- For details about key_cache_segments please refer to:
-- http://kb.askmonty.org/v/segmented-key-cache
--
require("oltp_common")
-- Add random_points to the... | gpl-2.0 |
uhvhugvhhbbh545hhhyg/rekjx | plugins/music.lua | 2 | 2113 | local function musiclink(msg, musicid)
local value = redis:hget('music:'..msg.to.id, musicid)
if not value then
return
else
value = value..'\n\n@GPMod'
return value
end
end
------------------ Seconds To Minutes alg ------------------
function sectomin (Sec)
if (tonumber(Sec) == nil) or (tonumber(Sec) == 0) t... | gpl-2.0 |
chentao/thrift | test/lua/test_basic_client.lua | 57 | 7626 | -- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file ... | apache-2.0 |
RoyZeng/wax | lib/stdlib/helpers/cache.lua | 19 | 1993 | wax.cache = {}
setmetatable(wax.cache, wax.cache)
-- Returns contents of cache keys
-- key: string # value for cache
-- maxAge: number (optional) # max age of file in seconds
function wax.cache.get(key, maxAge)
local path = wax.cache.pathFor(key)
if not wax.filesystem.isFile(path) then return nil end
if ... | mit |
zackp30/cuberite | MCServer/Plugins/APIDump/Hooks/OnPreCrafting.lua | 8 | 1523 | return
{
HOOK_PRE_CRAFTING =
{
CalledWhen = "Before the built-in recipes are checked.",
DefaultFnName = "OnPreCrafting", -- also used as pagename
Desc = [[
This hook is called when a {{cPlayer|player}} changes contents of their
{{cCraftingGrid|crafting grid}}, before the built-in recipes are searched for... | apache-2.0 |
mms92/wire | lua/entities/info_wiremapinterface/output.lua | 17 | 2147 | -- Copied from the gmod base entity, it's changed to work with wire map interface.
-- It's only changed for this entity.
-- This function is used to store an output.
function ENT:StoreOutput(name, info)
local rawData = string.Explode(",", info)
local Output = {}
Output.entities = rawData[1] or ""
Output.input = r... | apache-2.0 |
psychon/lgi | lgi/namespace.lua | 2 | 6217 | ------------------------------------------------------------------------------
--
-- lgi Support for repository namespace
--
-- Copyright (c) 2010, 2011,2016 Pavel Holejsovsky
-- Licensed under the MIT license:
-- http://www.opensource.org/licenses/mit-license.php
--
------------------------------------------------... | mit |
psychon/lgi | samples/clutterdemo.lua | 6 | 1718 | #! /usr/bin/env lua
--
-- Basic clutter demo.
--
local lgi = require('lgi')
local Clutter = lgi.require('Clutter', '1.0')
local GObject = lgi.require('GObject', '2.0')
local Gio = lgi.require('Gio', '2.0')
local app = Gio.Application { application_id = 'org.lgi.samples.Clutter' }
local stage = Clutter.Stage.get_def... | mit |
zackp30/cuberite | MCServer/Plugins/APIDump/Hooks/OnBlockToPickups.lua | 8 | 2438 | return
{
HOOK_BLOCK_TO_PICKUPS =
{
CalledWhen = "A block is about to be dug ({{cPlayer|player}}, {{cEntity|entity}} or natural reason), plugins may override what pickups that will produce.",
DefaultFnName = "OnBlockToPickups", -- also used as pagename
Desc = [[
This callback gets called whenever a block is ... | apache-2.0 |
Noneatme/mta-lostresources | [gamemodes]/Multistunt/client/neon.lua | 1 | 2920 | local Guivar = 0
local function createNeonGui()
if(Guivar == 1) then return end
Guivar = 1
setGuiState(1)
local Fenster = {}
local Knopf = {}
local Label = {}
local Radio = {}
local X, Y, Width, Height = getMiddleGuiPosition(320,233)
Fenster[1] = guiCreateWindow(X, Y, Width, Height, "Neonmenue",false)
Lab... | gpl-2.0 |
Yonaba/dijkstra-map | grid.lua | 1 | 4972 | -- A grid map handler
-- This handler is devised for 2D weighted grids. Nodes are indexed
-- with a pair of (x, y) coordinates.
-- It features cardinal (4-directions) and octal (8-directions) moves.
-- (see node.lua)
local createNode = require ('node')
-- Direction vectors will be used to retrieve the neighbors of a... | mit |
luadch/luadch | scripts/cmd_upgrade.lua | 1 | 13443 | --[[
cmd_upgrade.lua by blastbeat
- this script adds a command "upgrade" to set or change the level of a user by sid/nick
- usage: [+!#]upgrade sid|nick <SID>|<NICK> <LEVEL>
v0.21: by pulsar
- removed "by CID" (Easy cleanup of codebase milestone)
v0.20: by p... | gpl-3.0 |
jnehl701/ACS | scripts/core/Helpers.lua | 1 | 7152 | -- Constants
skillranks = {unknown = 0, inept = 1, novice = 2, apprentice = 3, capable = 4, adept = 5, skilled = 6, gifted = 7, expert = 8, virtuoso = 9, fabled = 10, mythical = 11, transcendent = 12}
baleq = {"balance", "equilibrium"}
-- Printing helpers.
acsLabel = C.r .. "[" .. C.R .. "ACS" .. C.r .. "]: " .... | gpl-2.0 |
Noneatme/mta-lostresources | [gameplay]/pointer/client/util.colors.lua | 1 | 9448 | -----------------------------------------------------------------------------
-- Provides support for color manipulation in HSL color space.
--
-- http://sputnik.freewisdom.org/lib/colors/
--
-- License: MIT/X
--
-- (c) 2008 Yuri Takhteyev (yuri@freewisdom.org) *
--
-- * rgb_to_hsl() implementation was contributed by ... | gpl-2.0 |
liuxuezhan/skynet | test/testsocket.lua | 20 | 1085 | local skynet = require "skynet"
local socket = require "skynet.socket"
local mode , id = ...
local function echo(id)
socket.start(id)
while true do
local str = socket.read(id)
if str then
socket.write(id, str)
else
socket.close(id)
return
end
end
end
if mode == "agent" then
id = tonumber(id)
... | mit |
mehrpouya81/y | plugins/qr.lua | 637 | 1730 | --[[
* qr plugin uses:
* - http://goqr.me/api/doc/create-qr-code/
* psykomantis
]]
local function get_hex(str)
local colors = {
red = "f00",
blue = "00f",
green = "0f0",
yellow = "ff0",
purple = "f0f",
white = "fff",
black = "000",
gray = "ccc"
}
for color, value in pairs(colors)... | gpl-2.0 |
luadch/luadch | luasec/samples/alpn/server.lua | 3 | 1640 | --
-- Public domain
--
local socket = require("socket")
local ssl = require("ssl")
--
-- Callback that selects one protocol from client's list.
--
local function alpncb01(protocols)
print("--- ALPN protocols from client")
for k, v in ipairs(protocols) do
print(k, v)
end
print("--- Selecting:", pro... | gpl-3.0 |
mms92/wire | lua/weapons/gmod_tool/stools/wire.lua | 6 | 11013 |
-- Load wiremod tools in /lua/wire/stools/
-- Note: If this tool is ever removed, be sure to put this in another stool!
local OLD_TOOL = TOOL
TOOL = nil
include( "wire/tool_loader.lua" )
TOOL = OLD_TOOL
TOOL.Mode = "wire"
TOOL.Category = "Tools"
TOOL.Name = "Wire (Legacy)"
TOOL.Tab = "Wire"
if CLIENT then
la... | apache-2.0 |
badboyam/zc | plugins/bot_on_off.lua | 4 | 1633 | -- Checks if bot was disabled on specific chat
local function is_channel_disabled( receiver )
if not _config.disabled_channels then
return false
end
if _config.disabled_channels[receiver] == nil then
return false
end
return _config.disabled_channels[receiver]
end
local function enable_channel(receiver)
if... | gpl-2.0 |
Habbie/hammerspoon | extensions/console/init.lua | 1 | 6157 | --- === hs.console ===
---
--- Some functions for manipulating the Hammerspoon console.
---
--- These functions allow altering the behavior and display of the Hammerspoon console. They should be considered experimental, but have worked well for me.
-- make sure NSColor conversion tools are installed
require("hs.drawi... | mit |
cogwerkz/DiabolicUI | modules/blizzard/character.lua | 2 | 8408 | local ADDON, Engine = ...
local Module = Engine:NewModule("Blizzard: Character")
local C = Engine:GetDB("Data: Colors")
-- Lua API
local _G = _G
local pairs = pairs
local string_find = string.find
local string_gsub = string.gsub
local string_match = string.match
local tonumber = tonumber
local unpack = unpack
-- WoW ... | mit |
nkcfan/Dotfiles | .config/nvim/lua/telescope_config.lua | 1 | 1229 | local actions = require("telescope.actions")
local find_command = { vim.env.FZF_DEFAULT_COMMAND or vim.fn.expand('~/bin/ripgrep_git.cmd') }
require("telescope").setup {
defaults = {
mappings = {
i = {
["<C-H>"] = "which_key",
["<Esc>"] = actions.close
... | mit |
thenumbernine/hydro-cl-lua | hydro/eqn/wave-fd.lua | 1 | 1586 | -- based on 2014 Oliveira et al - Ergoregion instability- The hydrodynamic vortex
local ffi = require 'ffi'
local class = require 'ext.class'
local table = require 'ext.table'
local Equation = require 'hydro.eqn.eqn'
local WaveFDEqn = class(Equation)
WaveFDEqn.name = 'wave_fd'
WaveFDEqn.consVars = table{
-- typicall... | mit |
nikai3d/codecombat-scripts | desert/sarven-siege.lua | 1 | 2017 | sol = true
function summonMinion()
if sol and self.gold >= self:costOf("soldier") then
self:summon("soldier")
sol = false
elseif self.gold >= self:costOf("archer") then
self:summon("archer")
sol = true
end
end
function distance2(a, b)
local x, y = a.pos.x - b.pos.x, a.pos... | mit |
NPLPackages/TableDB | npl_mod/Raft/RaftMessageSender.lua | 1 | 2181 | --[[
Title:
Author: liuluheng
Date: 2017.03.25
Desc:
------------------------------------------------------------
NPL.load("(gl)npl_mod/Raft/RaftMessageSender.lua");
local RaftMessageSender = commonlib.gettable("Raft.RaftMessageSender");
------------------------------------------------------------
]]--
local Logge... | gpl-2.0 |
mms92/wire | lua/entities/gmod_wire_numpad.lua | 10 | 3176 | AddCSLuaFile()
DEFINE_BASECLASS( "base_wire_entity" )
ENT.PrintName = "Wire Numpad"
ENT.WireDebugName = "Numpad"
if CLIENT then return end -- No more client
local keynames = {"0","1","2","3","4","5","6","7","8","9",".","enter","+","-","*","/"} -- Names as we will display them and for inputs/outputs
local keyenu... | apache-2.0 |
pinkysnowman/homedecor_modpack | homedecor/foyer.lua | 12 | 1879 | local S = homedecor.gettext
homedecor.register("coatrack_wallmount", {
tiles = { homedecor.plain_wood },
inventory_image = "homedecor_coatrack_wallmount_inv.png",
description = "Coatrack (wallmounted)",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
... | lgpl-3.0 |
mpreisler/ember | src/components/ogre/widgets/ActionBarDefaultAction.lua | 5 | 1835 | --[[
Responsible for managing the default action executed when a user clicks on an action bar icon.
]]--
ActionBarDefaultAction = {}
--Executed on entities that can be equipped.
function ActionBarDefaultAction:wieldableCommandObject()
if self.mCommandObject ~= nil then
self.wearFunction = self.mDefaultActionList:g... | gpl-3.0 |
cogwerkz/DiabolicUI | settings/actionbars.lua | 2 | 42505 | local ADDON, Engine = ...
-- ActionButton Sizes
local BUTTON_SIZE_VEHICLE = 64 -- button size with a vehicle UI
local BUTTON_SIZE_SINGLE = 50 -- button size with a single action bar
local BUTTON_SIZE_DOUBLE = 44 -- button size with two action bars
local BUTTON_SIZE_TRIPLE = 36 -- button size with three action ... | mit |
eagle14/hero-suport | bot/utils.lua | 25 | 13459 | URL = require "socket.url"
http = require "socket.http"
https = require "ssl.https"
ltn12 = require "ltn12"
serpent = require "serpent"
feedparser = require "feedparser"
json = (loadfile "./libs/JSON.lua")()
mimetype = (loadfile "./libs/mimetype.lua")()
redis = (loadfile "./libs/redis.lua")()
JSON = (loadfile "./libs/... | gpl-2.0 |
AmirPGA/P.G.A | bot/utils.lua | 25 | 13459 | URL = require "socket.url"
http = require "socket.http"
https = require "ssl.https"
ltn12 = require "ltn12"
serpent = require "serpent"
feedparser = require "feedparser"
json = (loadfile "./libs/JSON.lua")()
mimetype = (loadfile "./libs/mimetype.lua")()
redis = (loadfile "./libs/redis.lua")()
JSON = (loadfile "./libs/... | gpl-2.0 |
thenumbernine/hydro-cl-lua | hydro/eqn/grmhd.lua | 1 | 4705 | -- BIG TODO. I've moved prim_t into cons_t for GRHD ... because it's rare one is bound when the other is not
-- so .. this needs to undergo that as well
--[[
based on 2010 Anton et al
... which looks to be a SRMHD implementation ...
where are varying metrics incorporated in 2010 Anton?
general relativistic ideal MH... | mit |
thenumbernine/hydro-cl-lua | hydro/draw/2d_graph.lua | 1 | 3711 | -- TODO make use of app.display_useCoordMap
local ffi = require 'ffi'
local class = require 'ext.class'
local file = require 'ext.file'
local vec3f = require 'vec-ffi.vec3f'
local gl = require 'ffi.OpenGL'
local vector = require 'ffi.cpp.vector'
local Draw = require 'hydro.draw.draw'
local Draw2DGraph = class(Draw)
... | mit |
mms92/wire | lua/wire/stools/7seg.lua | 9 | 3209 | WireToolSetup.setCategory( "Visuals/Indicators" )
WireToolSetup.open( "7seg", "7 Segment Display", "gmod_wire_indicator", nil, "7 Segment Displays" )
TOOL.GhostAngle = Angle(90, 0, 0)
TOOL.GhostMin = "x"
if CLIENT then
language.Add( "tool.wire_7seg.name", "7-Segment Display Tool" )
language.Add( "tool.wire_7seg.des... | apache-2.0 |
mms92/wire | lua/wire/stools/fx_emitter.lua | 9 | 1457 | WireToolSetup.setCategory( "Visuals" )
WireToolSetup.open( "fx_emitter", "FX Emitter", "gmod_wire_fx_emitter", nil, "FX Emitters" )
if ( CLIENT ) then
language.Add( "Tool.wire_fx_emitter.name", "Wire FX Emitter" )
language.Add( "Tool.wire_fx_emitter.desc", "Wire FX Emitter Emits effects eh?" )
language.Add( "Tool.w... | apache-2.0 |
coronalabs/framework-widget | segmentedControl.lua | 1 | 4054 |
-- Abstract: widget.newSegmentedControl() unit test
-- Code is MIT licensed; see https://www.coronalabs.com/links/code/license
---------------------------------------------------------------------------------------
local widget = require( "widget" )
local composer = require( "composer" )
local scene = composer.newSce... | mit |
MRAHS/SBSS-Pro | plugins/Boobs.lua | 150 | 1613 | do
-- Recursive function
local function getRandomButts(attempt)
attempt = attempt or 0
attempt = attempt + 1
local res,status = http.request("http://api.obutts.ru/noise/1")
if status ~= 200 then return nil end
local data = json:decode(res)[1]
-- The OpenBoobs API sometimes returns an empty array
if no... | gpl-2.0 |
thenumbernine/hydro-cl-lua | hydro/eqn/gr-maxwell.lua | 1 | 3352 | --[[
maxwell but extended to include ADM metric influence
based on 2009 Alcubierre et al charged black holes
--]]
local class = require 'ext.class'
local table = require 'ext.table'
local Equation = require 'hydro.eqn.eqn'
local GRMaxwell = class(Equation)
GRMaxwell.name = 'GRMaxwell'
GRMaxwell.numStates = 10
GRMaxwel... | mit |
Noneatme/mta-lostresources | [gamemodes]/Multistunt/client/spawnveh.lua | 1 | 7029 | local Guivar = 0
addEvent("onMultistunVehicleListRefresh", true)
local Fenster = {}
local Knopf = {}
local Label = {}
local Edit = {}
local Grid = {}
local disallowed = {
[425] = true,
[520] = true,
[447] = true,
[435] = true,
[450] = true,
[584] = true,
[591] = true,
[606] = true,
[607] = true,
[608] = t... | gpl-2.0 |
sami2448/sam | plugins/antifuck2.lua | 4 | 1764 | -- By Mohamed_devt { @MD_IQ19 }
-- only enable one of them
local Kick = true;
local Warn = false;
do
local function run(msg, matches)
if ( kick == true ) then
Warn = false;
elseif ( Warn == true ) then
Kick = false;
end
-- check if the user is owner
if ( is_realm(msg) an... | gpl-2.0 |
Abollfazl2/KingManager | plugins/all.lua | 264 | 4202 | do
data = load_data(_config.moderation.data)
local function get_msgs_user_chat(user_id, chat_id)
local user_info = {}
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info.msgs = tonumber(redis:get(um_hash) or 0)
user_info.name = user_print... | gpl-2.0 |
sigma-random/PrefSDK | formats/pe/datadirectory.lua | 1 | 3823 | local oop = require("oop")
local Address = require("sdk.math.address")
local PeConstants = require("formats.pe.constants")
local PeFunctions = require("formats.pe.functions")
local ExportDirectory = require("formats.pe.datadirectory.exportdirectory")
local ImportDirectory = require("formats.pe.datadirectory.importdirec... | gpl-3.0 |
Tele-Sped/Tele-Sped | plugins/inpm.lua | 1114 | 3008 | do
local function pairsByKeys (t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
... | agpl-3.0 |
rfaday/Kingbot | plugins/inpm.lua | 1114 | 3008 | do
local function pairsByKeys (t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
... | gpl-2.0 |
stevelord/PR30 | feeds/xwrt/webif-iw-lua/files/usr/lib/lua/lua-xwrt/xwrt/page.lua | 8 | 9949 | --------------------------------------------------------------------------------
-- htmlpageClass.lua
--
-- Author(s) [in order of work date]:
-- Fabián Omar Franzotti
--
--------------------------------------------------------------------------------
--
-- usage : page = xwrtpageClass.new(title_of_page)
-- page ... | gpl-2.0 |
torch/optim | de.lua | 1 | 3348 | --[[ An implementation of `DE` (Differential Evolution),
ARGS:
-`opfunc` : a function that takes a single input (X), the point of
evaluation, and returns f(X) and df/dX. Note that df/dX is not used
-`x` : the initial point
-`state.popsize`: population size. If this is left empty, 10*d will be ... | bsd-3-clause |
Sh1ft0/alpha | Demos/Content/Entities/light.lua | 1 | 1383 | -- Copyright 2014-2015 Jason R. Wendlandt
--
-- 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 agree... | apache-2.0 |
Just-D/ejoy2d | examples/asset/birds.lua | 21 | 9809 | return {
{
["type"] = "picture",
[1] = {
["screen"] = {
240, 1280, -240, 1280, -240, -1280, 240, -1280,
},
["tex"] = 1,
["src"] = {
1009, 354, 979, 354, 979, 194, 1009, 194,
},
},
["export"]... | mit |
zackp30/cuberite | MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua | 6 | 1593 | return
{
HOOK_ENTITY_ADD_EFFECT =
{
CalledWhen = "An entity effect is about to get added to an entity.",
DefaultFnName = "OnEntityAddEffect", -- also used as pagename
Desc = [[
This hook is called whenever an entity effect is about to be added to an entity. The plugin may
disallow the addition by returni... | apache-2.0 |
Noneatme/mta-lostresources | [gameplay]/bolt/client/CEBolt.lua | 1 | 3506 | -- #######################################
-- ## Project: Electricity Resource ##
-- ## Name: Electricity_Bold.lua ##
-- ## Author: Noneatme ##
-- ## Version: 1.0 ##
-- ## License: See top Folder ##
-- #######################################
-- FUNCTIONS / METHODS --
local cFunc = {}; -- Local Functi... | gpl-2.0 |
Noneatme/mta-lostresources | [gamemodes]/twd/client/CRenderCursor.lua | 1 | 1373 | -- #######################################
-- ## Project:MTA:The Walking Death ##
-- ## Name: CRenderCursor ##
-- ## Author: Noneatme ##
-- ## Version: 1.0 ##
-- ## License: See top Folder ##
-- #######################################
-- FUNCTIONS / METHODS --
local cFunc = {}; -- Local Functions
loc... | gpl-2.0 |
TeleDALAD/f | plugins/anti_chat.lua | 62 | 1069 |
antichat = {}-- An empty table for solving multiple kicking problem
do
local function run(msg, matches)
if is_momod(msg) then -- Ignore mods,owner,admins
return
end
local data = load_data(_config.moderation.data)
if data[tostring(msg.to.id)]['settings']['lock_chat'] then
if data[tostring(msg.to.id)]['... | gpl-2.0 |
mms92/wire | lua/wire/client/texteditor.lua | 3 | 113435 | --
-- Expression 2 Text Editor for Garry's Mod
-- Andreas "Syranide" Svensson, me@syranide.com
--
local string_Explode = string.Explode
local table_concat = table.concat
local string_sub = string.sub
local table_remove = table.remove
local math_floor = math.floor
local math_Clamp = math.Clamp
local math_ceil = math.ce... | apache-2.0 |
jwise/naim | modules/OSCAR/FLAP.lua | 1 | 1599 | -- _ __ __ _ ___ __ __
-- | '_ \ / _` |_ _| \/ | naim
-- | | | | | | || || |\/| | Copyright 1998-2006 Daniel Reed <n@ml.org>,
-- | | | | |_| || || | | | 2006-2007 Joshua Wise <joshua@joshuawise.com>
-- |_| |_|\__,_|___|_| |_| ncurses-based chat client
--
-- OSCAR/FLAP.lua
-- FLAP dispatch routines for OSCAR PD... | gpl-2.0 |
pkdiego/BolScripts | Rivelina.lua | 2 | 21915 | --[[
Rivelina [Riven] By
_____ _____ __ .__ ____ .____ .__.__ .__ .__ .__
/ \_______ / _ \________/ |_|__| ____ __ __ ____ ____ / _ \ | | |__| | | | ____ _________ | | |__| ____
/ \ /... | gpl-2.0 |
mehrpouya81/y | plugins/plugins.lua | 325 | 6164 | do
-- Returns the key (index) in the config.enabled_plugins table
local function plugin_enabled( name )
for k,v in pairs(_config.enabled_plugins) do
if name == v then
return k
end
end
-- If not found
return false
end
-- Returns true if file exists in plugins folder
local function plugin_exists( ... | gpl-2.0 |
apjanke/mongrel2 | examples/bbs/ui.lua | 96 | 2026 | local coroutine = coroutine
module 'ui'
local SCREENS = {
['welcome'] = [[
__ __ ____ ____ ____ ____
| \/ |___ \| __ )| __ ) ___|
| |\/| | __) | _ \| _ \___ \
| | | |/ __/| |_) | |_) |__) |
|_| |_|_____|____/|____/____/
Welcome to the Mongrel2 BBS.
]],
['name']... | bsd-3-clause |
nikai3d/codecombat-scripts | mountain/think-ahead.lua | 1 | 1593 | -- You need to distract "Big Bertha" until you special squad arrives.
-- The cannon always shoots at the pair of soldiers closest to each other.
-- We can predict which pair of soldiers in danger and protect them.
-- This function should find the pair of units with the minimum distance between them.
local function fin... | mit |
sami2448/sam | plugins/btc.lua | 289 | 1375 | -- See https://bitcoinaverage.com/api
local function getBTCX(amount,currency)
local base_url = 'https://api.bitcoinaverage.com/ticker/global/'
-- Do request on bitcoinaverage, the final / is critical!
local res,code = https.request(base_url..currency.."/")
if code ~= 200 then return nil end
local data = j... | gpl-2.0 |
q-gears/q-gears-reversing-data | reversing/ffvii/ffvii_field/data/script/mds7plr1.lua | 1 | 38789 | -- created by Tori
entity = {
};
tempd = 0; -- we set this if we try to leave during pillar event. number specify direction.
tempe = 0; -- we talk to guardR
entity["tobira"] = {
on_start = function(self)
--BGCLR(0,1)
--BGON(0,1,0)
return 0;
end;
script1 =... | gpl-2.0 |
mms92/wire | lua/wire/gates/comparison.lua | 17 | 2192 | --[[
Comparison Gates
]]
GateActions("Comparison")
GateActions["="] = {
name = "Equal",
inputs = { "A", "B" },
output = function(gate, A, B)
if (math.abs(A-B) < 0.001) then return 1 end
return 0
end,
label = function(Out, A, B)
return A.." == "..B.." = "..Out
end
}
GateActions["!="] = {
name = "Not Eq... | apache-2.0 |
sami2448/sam | plugins/linkpv.lua | 2 | 30273 | do
local function check_member(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[tostring(msg.to.id)] = {
... | gpl-2.0 |
AlexMax/luadoom | src/doom_lua/hud.lua | 1 | 3225 | --
-- Copyright(C) 1993-1996 Id Software, Inc.
-- Copyright(C) 2005-2014 Simon Howard
-- Copyright(C) 2014 Alex Mayfield
--
-- This program 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 version 2
--... | gpl-2.0 |
zhukunqian/slua-1 | 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 |
shkan/telebot7 | plugins/danbooru.lua | 31 | 1751 | do
local URL = "http://danbooru.donmai.us"
local URL_NEW = "/posts.json"
local URL_POP = "/explore/posts/popular.json"
local scale_day = "?scale=day"
local scale_week = "?scale=week"
local scale_month = "?scale=month"
local function get_post(url)
local b, c, h = http.request(url)
if c ~= 200 then return nil end
... | gpl-2.0 |
shkan/telebot3 | plugins/danbooru.lua | 31 | 1751 | do
local URL = "http://danbooru.donmai.us"
local URL_NEW = "/posts.json"
local URL_POP = "/explore/posts/popular.json"
local scale_day = "?scale=day"
local scale_week = "?scale=week"
local scale_month = "?scale=month"
local function get_post(url)
local b, c, h = http.request(url)
if c ~= 200 then return nil end
... | gpl-2.0 |
sigma-random/PrefSDK | formats/pe/datadirectory/exportdirectory.lua | 1 | 2852 | local oop = require("oop")
local Address = require("sdk.math.address")
local Pointer = require("sdk.math.pointer")
local PeConstants = require("formats.pe.constants")
local DataType = pref.datatype
local ExportDirectory = oop.class()
function ExportDirectory:__ctor(formattree, section, directoryoffset)
self.buffer ... | gpl-3.0 |
hafez16/senator | plugins/wiki.lua | 735 | 4364 | -- http://git.io/vUA4M
local socket = require "socket"
local JSON = require "cjson"
local wikiusage = {
"!wiki [text]: Read extract from default Wikipedia (EN)",
"!wiki(lang) [text]: Read extract from 'lang' Wikipedia. Example: !wikies hola",
"!wiki search [text]: Search articles on default Wikipedia (EN)",
"!... | gpl-2.0 |
shkan/telebot7 | plugins/wiki.lua | 735 | 4364 | -- http://git.io/vUA4M
local socket = require "socket"
local JSON = require "cjson"
local wikiusage = {
"!wiki [text]: Read extract from default Wikipedia (EN)",
"!wiki(lang) [text]: Read extract from 'lang' Wikipedia. Example: !wikies hola",
"!wiki search [text]: Search articles on default Wikipedia (EN)",
"!... | gpl-2.0 |
pkulchenko/alecwrap | alecwrap.lua | 1 | 3790 | -- Copyright 2015 Paul Kulchenko, ZeroBrane LLC
-- LuaJIT/FFI wrapper for Arcade Learning Environment (ALE)
local ffi = require 'ffi'
ffi.cdef([[
typedef struct ALEInterface ALEInterface;
ALEInterface *ALE_new();
void ALE_del(ALEInterface *ale);
const char *getString(ALEInterface *ale, const char *key);
i... | mit |
cogwerkz/DiabolicUI | modules/objectives/tracker.lua | 2 | 101799 | local _, Engine = ...
local Module = Engine:NewModule("ObjectiveTracker")
local L = Engine:GetLocale()
local C = Engine:GetDB("Data: Colors")
--local QuestZones = Engine:GetDB("Data: QuestZones") -- not currently in use
-- Dev Switch (you can uncomment it to disable this tracker)
--Module:SetIncompatible("DiabolicUI")... | mit |
mirbot/zdgbbbrblsb-vbv | plugins/media.lua | 297 | 1590 | do
local function run(msg, matches)
local receiver = get_receiver(msg)
local url = matches[1]
local ext = matches[2]
local file = download_to_file(url)
local cb_extra = {file_path=file}
local mime_type = mimetype.get_content_type_no_sub(ext)
if ext == 'gif' then
print('send_file')
send_docum... | gpl-2.0 |
Justinon/LorePlay | code/LPSettings.lua | 1 | 31213 | local Settings = {}
local LAM2
EVENT_INDICATOR_MOVED = "EVENT_INDICATOR_MOVED"
local defaultSettingsTable = {
isIdleEmotesOn = true,
isLoreWearOn = true,
isSmartEmotesIndicatorOn = true,
canPlayInstrumentsInCities = true,
canDanceInCities = true,
canBeDrunkInCities = true,
canExerciseInZone = true,
canWorship... | artistic-2.0 |
MRAHS/SBSS-Pro | plugins/google.lua | 336 | 1323 | do
local function googlethat(query)
local url = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&safe=active&&rsz=5&'
local parameters = 'q='..(URL.escape(query) or '')
-- Do the request
local res, code = https.request(url..parameters)
if code ~=200 then return nil end
loca... | gpl-2.0 |
vasekhodina/siegetris | data/mechanics.lua | 1 | 2892 |
mechanics = {}
mechanics.fallCounter = 0
mechanics.blockGeneration = false
mechanics.tileType = {}
mechanics.tileNames = {"I","O","L","J","S","Z","T"} --7 vals
local t = mechanics.tileType
t["I"]= {{0,0},{0,1},{0,2},{0,3}}
t["O"]= {{0,0},{0,1},{1,0},{1,1}}
t["L"]= {{0,0},{0,1},{0,2},{1,2}}
t["J"]= {{1,0},{1,1},{1,2},{... | gpl-3.0 |
hksonngan/Polycode | Bindings/Contents/LUA/API/Polycode/EventDispatcher.lua | 11 | 2316 |
class "EventDispatcher"
function EventDispatcher:EventDispatcher()
self.listenerEntries = {}
end
function EventDispatcher:addEventListener(listener, callback, eventCode)
if self.listenerEntries == nil then
self.listenerEntries = {}
end
local newEntry = {}
if self.__ptr ~= nil then
newEntry.handler = Polycor... | mit |
AlexarJING/space-war | lib/loveframes/objects/internal/closebutton.lua | 14 | 4418 | --[[------------------------------------------------
-- Love Frames - A GUI library for LOVE --
-- Copyright (c) 2012-2014 Kenny Shields --
--]]------------------------------------------------
-- get the current require path
local path = string.sub(..., 1, string.len(...) - string.len(".objects.internal.closebutton"... | apache-2.0 |
Noneatme/mta-lostresources | [gamemodes]/carsoccer/sync/CBallSync_Server.lua | 1 | 3622 | --[[
##########################################################################
## ##
## Project: 'Carball' - Gamemode for MTA: San Andreas PROJECT X ##
## Developer: Noneatme ##
## ... | gpl-2.0 |
mpreisler/ember | src/components/ogre/widgets/Give.lua | 2 | 2932 | -----------------------------------------
--A widget for giving something from the inventory to someone. Right now just shows a list of stuff that can be given. This will need to be extended to something much nicer. Perhaps even something which interacts with other inventory widgets.
---------------------------------... | gpl-3.0 |
nikai3d/codecombat-scripts | forest/dueling-grounds.lua | 1 | 1521 | -- using "bash", "move"
sol = true
function summonMinion()
if sol and self.gold >= self:costOf("soldier") then
self:summon("soldier")
sol = false
elseif self.gold >= self:costOf("archer") then
self:summon("archer")
sol = true
end
end
function distance2(a, b)
local x, y = ... | mit |
akopytov/sysbench | third_party/luajit/luajit/src/jit/dis_arm64.lua | 2 | 30904 | ----------------------------------------------------------------------------
-- LuaJIT ARM64 disassembler module.
--
-- Copyright (C) 2005-2020 Mike Pall. All rights reserved.
-- Released under the MIT license. See Copyright Notice in luajit.h
--
-- Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
-- S... | gpl-2.0 |
pinkysnowman/homedecor_modpack | lavalamp/init.lua | 3 | 2281 | local lavalamps_list = {
{ "Red Lava Lamp", "red"},
{ "Orange Lava Lamp", "orange"},
{ "Yellow Lava Lamp", "yellow"},
{ "Green Lava Lamp", "green"},
{ "Blue Lava Lamp", "blue"},
{ "Violet Lava Lamp", "violet"},
}
for i in ipairs(lavalamps_list) do
local lavalampdesc = lavalamps_list[i][1]
local colour = laval... | lgpl-3.0 |
zackp30/cuberite | lib/tolua++/src/bin/lua/array.lua | 42 | 6551 | -- tolua: array class
-- Written by Waldemar Celes
-- TeCGraf/PUC-Rio
-- Jul 1999
-- $Id: array.lua,v 1.1 2000/11/06 22:03:57 celes Exp $
-- This code is free software; you can redistribute it and/or modify it.
-- The software provided hereunder is on an "as is" basis, and
-- the author has no obligation to provide ma... | apache-2.0 |
kingmiladee/bot-man | plugins/weather.lua | 1 | 1906 | local BASE_URL = "http://api.openweathermap.org/data/2.5/weather"
local function get_weather(location)
print("Finding weather in ", location)
local url = BASE_URL
url = url..'?q='..location..'&APPID=eedbc05ba060c787ab0614cad1f2e12b'
url = url..'&units=metric'
local b, c, h = http.request(url)
if c ~= 200 ... | gpl-2.0 |
puustina/openjam | src/countdown.lua | 1 | 1194 | local countdown = {
index = 1,
items = { "3", "2", "1", "GO!" },
timerMax = 0.5,
timerCur = 0.5,
count = false
}
function countdown:reset()
self.index = 1
self.timerCur = self.timerMax * (1/Game.speed)
end
function countdown:start()
self.count = true
love.audio.play(Game.sources.timerTick)
end
function coun... | gpl-3.0 |
GSRMOHAMMAD/forcetg | 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 |
adityaramesh/lantern | lt/filesystem.lua | 1 | 2516 | --[[
Defines common filesystem utility functions with built-in error checking.
--]]
local F = lt.F
local os = lt.os
local lfs = lt.lfs
function lt.remove_file(path, logger)
local success, err = os.remove(path)
lt.fail_if(not success, F"Failed to remove file '{path}': {err}", logger)
end
function lt.remove_file_... | bsd-3-clause |
mms92/wire | lua/entities/gmod_wire_hologram.lua | 9 | 9662 | AddCSLuaFile()
DEFINE_BASECLASS("base_anim") -- NOTE: Not base_wire_entity! Simpler than that
ENT.PrintName = "Wire Hologram"
ENT.RenderGroup = RENDERGROUP_OPAQUE
ENT.DisableDuplicator = true
function ENT:SetPlayer(ply)
self:SetVar("Founder", ply)
self:SetVar("FounderIndex", ply:UniqueID())
self:SetNetworkedString... | apache-2.0 |
torch/optim | adagrad.lua | 6 | 1807 | --[[ ADAGRAD implementation for SGD
ARGS:
- `opfunc` : a function that takes a single input (X), the point of
evaluation, and returns f(X) and df/dX
- `x` : the initial point
- `state` : a table describing the state of the optimizer; after each
call the state is modified
- `state.learningRate` : lear... | bsd-3-clause |
luadch/luadch | scripts/cmd_restart.lua | 1 | 8597 | --[[
cmd_restart.lua by blastbeat
- this script adds a command "restart" to restart the hub
- usage: [+!#]restart [<MSG>]
v0.11: by pulsar
- prevent message output if no reason given
v0.10: by blastbeat
- improve shutdown/exit logic
... | gpl-3.0 |
ZotPlus/zotero-better-bibtex | pandoc/locator.lua | 1 | 3279 | local module = {}
local labels = {
book = 'book',
['bk.'] = 'book',
['bks.'] = 'book',
chapter = 'chapter',
['chap.'] = 'chapter',
['chaps.'] = 'chapter',
column = 'column',
['col.'] = 'column',
['cols.'] = 'column',
figure = 'figure',
['fig.'] = 'figure',
['figs.'] = 'figure',
folio = 'folio... | unlicense |
mms92/wire | lua/wire/client/cl_wirelib.lua | 8 | 10040 | local WIRE_SCROLL_SPEED = 0.5
local WIRE_BLINKS_PER_SECOND = 2
local CurPathEnt = {}
local Wire_DisableWireRender = 2 --bug with mode 0 and gmod2007beta
WIRE_CLIENT_INSTALLED = 1
--Msg("loading materials\n")
list.Add( "WireMaterials", "cable/rope_icon" )
list.Add( "WireMaterials", "cable/cable2" )
list.Add( "WireMate... | apache-2.0 |
Teraku/Skill-Overhaul | SkillOverhaul/lua/units/playerdamage.lua | 1 | 1248 | --Apply Overkill Ace damage reduction.
--I will be reworking this ugly hack later on.
local playerdamage_bullet_orig = PlayerDamage.damage_bullet
function PlayerDamage:damage_bullet(attack_data)
attack_data.damage = attack_data.damage * managers.player:temporary_upgrade_value("temporary", "overkill_damage_reducti... | gpl-2.0 |
RuiChen1113/luci | build/luadoc/luadoc/lp.lua | 175 | 4389 | ----------------------------------------------------------------------------
-- Lua Pages Template Preprocessor.
--
-- @release $Id: lp.lua,v 1.7 2007/04/18 14:28:39 tomas Exp $
----------------------------------------------------------------------------
local assert, error, getfenv, loadstring, setfenv = assert, erro... | apache-2.0 |
RuiChen1113/luci | applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua | 69 | 1137 | -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
m = Map("luci_statistics",
translate("Ping Plugin Configuration"),
translate(
"The ping plugin will send icmp echo replies to selected " ..
"hosts and measure the roundtrip time for each... | apache-2.0 |
AlexarJING/space-war | tasks/designer.lua | 1 | 5141 | local designer={}
designer.ui={}
local fileModule=
[[
function ship:initialize(side,x,y,rot)
res.shipClass.base.initialize(self,side,x,y,rot)
self:setParam(param)
self:reset()
self:getCanvas()
end
return ship]]
function designer:createUI()
self.ui.property=loveframes.Create("frame")
:SetPos(w-200,0)
:... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.