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 |
|---|---|---|---|---|---|
AmirFieBeR/Amir_FieBeR | plugins/time.lua | 771 | 2865 | -- 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 |
minetest-games/Minetest_TNG | mods/default/lua/mapgen/mapgenv57.lua | 2 | 14170 | -- mods/default/lua/mapgenv57.lua
--
-- Register biomes
--
core.clear_registered_biomes()
-- Permanent ice
core.register_biome({
name = "glacier",
node_dust = "default:snowblock",
node_top = "default:snowblock",
depth_top = 1,
node_filler = "default:snowblock",
depth_filler = 3,
node_stone = "default:ice",
n... | gpl-3.0 |
czfshine/Don-t-Starve | data/scripts/components/teamleader.lua | 1 | 8905 |
local TeamLeader = Class(function(self, inst )
self.inst = inst
self.team_type = "monster"
self.min_team_size = 3
self.max_team_size = 6
self.team = {}
self.threat = nil
self.searchradius = 50
self.theta = 0
self.thetaincrement = 1
self.radius = 5
self.reverse = false
self.timebetweenattacks = 3
self.att... | gpl-2.0 |
Yelen719/Deep2048 | dqn/train_agent.lua | 1 | 9536 | --[[
Copyright (c) 2014 Google Inc.
See LICENSE file for full terms of limited license.
]]
require 'optim'
require 'gnuplot'
logger = optim.Logger('score_2.txt')
gnuplot.setterm("png")
if not dqn then
require "initenv"
end
local cmd = torch.CmdLine()
cmd:text()
cmd:text('Train Agent in Environment:')
cmd:text()
c... | mit |
czfshine/Don-t-Starve | data/scripts/prefabs/devtool.lua | 1 | 3567 | local assets=
{
Asset("ANIM", "anim/axe.zip"),
Asset("ANIM", "anim/goldenaxe.zip"),
Asset("ANIM", "anim/swap_axe.zip"),
Asset("ANIM", "anim/swap_goldenaxe.zip"),
}
local function onfinished(inst)
inst:Remove()
end
local function giveitems(inst, data)
if data.owner.components.inventory and data.recipe then... | gpl-2.0 |
EMCTEAM-IRAN/superflux-bot | plugins/welcome.lua | 1 | 3523 | local add_user_cfg = load_from_file('data/add_user_cfg.lua')
--create by RoyalTeam ID CHANNEL : @RoyalTeamCh
local function template_add_user(base, to_username, from_username, chat_name, chat_id)
base = base or ''
to_username = '@' .. (to_username or '')
from_username = '@' .. (from_username or '')
chat_nam... | gpl-3.0 |
matthewhesketh/mattata | plugins/administration/ban.lua | 2 | 4549 | --[[
Copyright 2020 Matthew Hesketh <matthew@matthewhesketh.com>
This code is licensed under the MIT. See LICENSE for details.
]]
local ban = {}
local mattata = require('mattata')
function ban:init()
ban.commands = mattata.commands(self.info.username):command('ban').table
ban.help = '/ban [u... | mit |
czfshine/Don-t-Starve | data/scripts/components/useableitem.lua | 1 | 1037 | local UseableItem = Class(function(self, inst)
self.inst = inst
self.onusefn = nil
self.onstopusefn = nil
self.inuse = false
self.caninteractfn = nil
self.stopuseevents = nil
end)
function UseableItem:SetCanInteractFn(fn)
self.caninteractfn = fn
end
function UseableItem:SetOnUseFn(fn)
self.onusefn = fn
end
f... | gpl-2.0 |
CrazyEddieTK/Zero-K | units/chicken_shield.lua | 2 | 5686 | unitDef = {
unitname = [[chicken_shield]],
name = [[Blooper]],
description = [[Shield/Anti-Air]],
acceleration = 0.36,
activateWhenBuilt = true,
brakeRate = 0.205,
buildCostEnergy = 0,
buildCostMetal = 0,
builder = false,
buil... | gpl-2.0 |
TimSimpson/Macaroni | Main/Generators/Cpp/UnitFileGenerator.lua | 1 | 14255 | require "Cpp/Common";
require "Plugin";
require "Cpp/ClassCppFileGenerator";
require "Cpp/ClassHFileGenerator";
local EnumFileGenerator = require "Cpp/EnumFileGenerator";
local FunctionGenerator = require "Cpp/FunctionFileGenerator";
require "Cpp/TypedefFileGenerator";
require "Cpp/UnitBlockGenerator";
local Access = ... | apache-2.0 |
andywingo/snabbswitch | lib/ljsyscall/syscall/osx/c.lua | 18 | 1783 | -- This sets up the table of C functions
-- For OSX we hope we do not need many overrides
local require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string =
require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,... | apache-2.0 |
victorperin/tibia-server | data/npc/scripts/Dalbrect.lua | 2 | 3189 | local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)... | apache-2.0 |
andywingo/snabbswitch | src/program/snabbnfv/traffic/traffic.lua | 6 | 5208 | module(..., package.seeall)
local lib = require("core.lib")
local nfvconfig = require("program.snabbnfv.nfvconfig")
local usage = require("program.snabbnfv.traffic.README_inc")
local ffi = require("ffi")
local C = ffi.C
local timer = require("core.timer")
local pci = require("lib.hardware.pci")
local counter = require... | apache-2.0 |
cloudwu/skynet | lualib/skynet/db/mysql.lua | 5 | 29544 | -- Copyright (C) 2012 Yichun Zhang (agentzh)
-- Copyright (C) 2014 Chang Feng
-- This file is modified version from https://github.com/openresty/lua-resty-mysql
-- The license is under the BSD license.
-- Modified by Cloud Wu (remove bit32 for lua 5.3)
-- protocol detail: https://mariadb.com/kb/en/clientserver-protoco... | mit |
nvoron23/tarantool | test/big/tree_pk.test.lua | 1 | 4618 | dofile('utils.lua')
s0 = box.schema.space.create('tweedledum')
i0 = s0:create_index('primary', { type = 'tree', parts = {1, 'num'}, unique = true })
-- integer keys
s0:insert{1, 'tuple'}
box.snapshot()
s0:insert{2, 'tuple 2'}
box.snapshot()
s0:insert{3, 'tuple 3'}
s0.index['primary']:get{1}
s0.index['primary']:get{2... | bsd-2-clause |
imfoollink/NPLRuntime | Server/trunk/LuaJIT-2.1/src/jit/v.lua | 54 | 5783 | ----------------------------------------------------------------------------
-- Verbose mode of the LuaJIT compiler.
--
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
-- Released under the MIT license. See Copyright Notice in luajit.h
-------------------------------------------------------------------------... | gpl-2.0 |
czfshine/Don-t-Starve | data/scripts/fx.lua | 1 | 5742 | local FX =
{
{
name = "sanity_raise",
bank = "blocker_sanity_fx",
build = "blocker_sanity_fx",
anim = "raise",
sound = nil,
sounddelay = nil,
tint = nil,
tintalpha = 0.5,
},
{
name = "sanity_lower",
bank = "blocker_sanity_fx",
build = "blocker_san... | gpl-2.0 |
TimSimpson/Macaroni | Next/Release/cavatappi.lua | 2 | 2888 | dependency {group=upper.Group, name="Macaroni.Tests.Bugs", version=upper.Version}
dependency {group="Macaroni.Examples", name="Hello", version="1.0.0.0"}
sources = { "source/scripts", "source/www" }
output = "target"
local manifestDir = Path.New(manifestDirectory)
function newPath(suffix)
return manifest... | apache-2.0 |
Drudoo/Factionizer | Locales/esES.lua | 2 | 19753 | -- Español (Spanish)
-------------------- --------------------
if (GetLocale() =="esES" or GetLocale() =="esMX") then
-- Binding names
BINDING_HEADER_FACTIONIZER = "Factionizer"
BINDING_NAME_SHOWCONFIG = "Las opciones de Mostrar ventana"
BINDING_NAME_SHOWDETAILS = "Mostrar ventana reputación detalle"
FIZ_TXT = ... | gpl-3.0 |
czfshine/Don-t-Starve | data/scripts/map/tasks/ruins.lua | 1 | 5428 |
------------------------------------------------------------
-- Caves Ruins Level
------------------------------------------------------------
-- AddTask("CityInRuins", {
-- locks={LOCKS.RUINS},
-- keys_given=KEYS.RUINS,
-- entrance_room="RuinedCityEntrance",
-- room_choices={
-- ["BGMaze"] = 10+math.random... | gpl-2.0 |
victorperin/tibia-server | data/actions/scripts/in service of yalahar quest/inServiceOfYalaharQuestMechanism.lua | 2 | 1728 | local mechanisms = {
[3091] = {pos = {x = 32744, y = 31161, z = 5}, value = 21}, -- Alchemist
[3092] = {pos = {x = 32744, y = 31164, z = 5}, value = 21},
[3093] = {pos = {x = 32833, y = 31269, z = 5}, value = 24}, -- Trade
[3094] = {pos = {x = 32833, y = 31266, z = 5}, value = 24},
[3095] = {pos = {x = 32729, y = ... | apache-2.0 |
mohammadrezajijitg/maikel | plugins/msg-checks.lua | 1 | 21461 | --Begin msg_checks.lua By @SoLiD
local TIME_CHECK = 2
local function pre_process(msg)
local data = load_data(_config.moderation.data)
local chat = msg.to.id
local user = msg.from.id
local is_channel = msg.to.type == "channel"
local is_chat = msg.to.type == "chat"
local auto_leave = 'auto_leave_bot'
local hash = "gp_lan... | gpl-3.0 |
AntonioModer/skeletor | main.lua | 1 | 3940 | -- uncomment to run unit tests
-- require 'skeletor.unittests.run'
-- load the skeletor module with property adjustments
local Skeletor = require('skeletor.skeletor')
skeletor = Skeletor({
boundariesCalculate = true,
boundariesShow = true,
shapeShow = true
})
opts = {
x = 400,
y = 200,
angle = 0,
speed = 100,
... | mit |
CrazyEddieTK/Zero-K | LuaUI/Widgets/gui_chili_display_keys.lua | 4 | 9831 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "Display Keys 2",
desc = "Displays the current key combination.",
author = "GoogleFrog",
date... | gpl-2.0 |
wincent/command-t | lua/wincent/commandt/init.lua | 1 | 16335 | -- SPDX-FileCopyrightText: Copyright 2010-present Greg Hurrell and contributors.
-- SPDX-License-Identifier: BSD-2-Clause
local concat = require('wincent.commandt.private.concat')
local contains = require('wincent.commandt.private.contains')
local copy = require('wincent.commandt.private.copy')
local is_integer = requ... | bsd-2-clause |
andywingo/snabbswitch | src/dasm_x86.lua | 11 | 74171 | ------------------------------------------------------------------------------
-- DynASM x86/x64 module.
--
-- Copyright (C) 2005-2015 Mike Pall. All rights reserved.
-- See dynasm.lua for full copyright notice.
------------------------------------------------------------------------------
local x64 = rawget(_G, "x64"... | apache-2.0 |
minetest-games/Minetest_TNG | mods/default/lua/mapgen/aliases.lua | 2 | 1967 | -- This file is part of Minetest TNG
-- =================================
-- mods/default/lua/mapgen/aliases.lua
--
-- Aliases for map generator outputs
--
core.register_alias("mapgen_air", "air")
core.register_alias("mapgen_stone", "default:stone")
core.register_alias("mapgen_dirt", "default:dirt")
core.register_alia... | gpl-3.0 |
ranisalt/forgottenserver | data/spells/scripts/custom/polymorph.lua | 10 | 1084 | local condition = Condition(CONDITION_OUTFIT)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
condition:setOutfit(0, 230, 0, 0, 0, 0)
condition:setOutfit(0, 231, 0, 0, 0, 0)
condition:setOutfit(0, 232, 0, 0, 0, 0)
condition:setOutfit(0, 233, 0, 0, 0, 0)
condition:setOutfit(0, 234, 0, 0, 0, 0)
condition:setOutfit(0... | gpl-2.0 |
czfshine/Don-t-Starve | data/scripts/scenarios/statue_enemywave.lua | 1 | 2304 | enemytypes = {"knight", "bishop", "rook"}
local function OnEnemyKilled(inst, enemy, scenariorunner)
if enemy.scene_deathfn then
inst:RemoveEventCallback("death", enemy.scene_deathfn, enemy)
enemy.scene_deathfn = nil
end
inst.wave[enemy] = nil
if not next(inst.wave) then
GetPlayer().compon... | gpl-2.0 |
timroes/awesome | tests/test-miss-handlers.lua | 8 | 1668 | -- Test set_{,new}index_miss_handler
local mouse = mouse
local class = tag
local obj = class({})
local handler = require("gears.object.properties")
local wibox = require("wibox")
awesome.connect_signal("debug::index::miss", error)
awesome.connect_signal("debug::newindex::miss", error)
class.set_index_miss_handler(fu... | gpl-2.0 |
czfshine/Don-t-Starve | data/scripts/prefabs/lightbulb.lua | 1 | 1674 | local assets =
{
Asset("ANIM", "anim/bulb.zip"),
}
local function fn(Sim)
local inst = CreateEntity()
inst.entity:AddTransform()
inst.entity:AddAnimState()
MakeInventoryPhysics(inst)
inst.AnimState:SetBank("bulb")
inst.AnimState:SetBuild("bulb")
inst.AnimState:PlayAnimation("idle")
i... | gpl-2.0 |
czfshine/Don-t-Starve | data/scripts/prefabs/spiderden.lua | 1 | 12873 | local prefabs =
{
"spider",
"spider_warrior",
"silk",
"spidereggsack",
"spiderqueen",
}
local assets =
{
Asset("ANIM", "anim/spider_cocoon.zip"),
Asset("SOUND", "sound/spider.fsb"),
}
local function SetStage(inst, stage)
if stage <= 3 then
inst.SoundEmitter:PlaySound("dontstarve/creatures/sp... | gpl-2.0 |
czfshine/Don-t-Starve | data/scripts/cooking.lua | 1 | 5697 | require "tuning"
local cookerrecipes = {}
function AddCookerRecipe(cooker, recipe)
if not cookerrecipes[cooker] then
cookerrecipes[cooker] = {}
end
cookerrecipes[cooker][recipe.name] = recipe
end
local ingredients = {}
function AddIngredientValues(names, tags, cancook, candry)
for _,name in pairs(names) do
in... | gpl-2.0 |
shkan/telebot1 | plugins/time.lua | 120 | 2804 | -- 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 |
kevdoran/nifi-minifi-cpp | thirdparty/civetweb-1.10/test/page3.lua | 10 | 1626 | -- This test checks if a query string has been given.
-- It sends the file identified by the query string.
-- Do not use it in a real server in this way!
if not mg.request_info.query_string then
mg.write("HTTP/1.0 200 OK\r\n")
mg.write("Connection: close\r\n")
mg.write("Content-Type: text/html; char... | apache-2.0 |
timroes/awesome | tests/examples/wibox/layout/grid/min_size.lua | 4 | 1465 | local generic_widget = ... --DOC_HIDE_ALL
local wibox = require("wibox") --DOC_HIDE
local beautiful = require("beautiful") --DOC_HIDE
local w = wibox.widget {
{
{
markup = "<b>min_cols_size</b> = <i>0</i>",
widget = wibox.widget.textbox
},
{
{
... | gpl-2.0 |
luvit/lit | commands/serve.lua | 2 | 3311 | local args = {...}
return function ()
local uv = require 'uv'
local log = require('log').log
local makeRemote = require('codec').makeRemote
local core = require('core')()
local cachedDb = require('db-cached')
local handlers = require('handlers')(core)
-- use cached db
local db = cachedDb(core.db)
lo... | apache-2.0 |
czfshine/Don-t-Starve | data/scripts/prefabs/tentacle_arm.lua | 1 | 4417 | require "stategraphs/SGtentacle_arm"
-- TODO
-- change gotoState to eventpush
-- move newcombat event handling to stategraph
-- unset persistant flag
local assets=
{
Asset("ANIM", "anim/tentacle_arm.zip"),
Asset("ANIM", "anim/tentacle_arm_build.zip"),
Asset("SOUND", "sound/tentacle.fsb"),
}
l... | gpl-2.0 |
blueyed/awesome | tests/test-awful-widget-calendar_popup.lua | 10 | 2181 | --- Test for awful.widget.calendar
local runner = require("_runner")
local awful = require("awful")
local calendar = require("awful.widget.calendar_popup")
local wa = awful.screen.focused().workarea
local cmonth = calendar.month()
local cyear = calendar.year()
local current_date = os.date("*t")
local day, month, ye... | gpl-2.0 |
TimSimpson/Macaroni | Main/Generators/Cpp/UnitNodeGenerator.lua | 2 | 4055 | require "Cpp/Common";
local Access = Macaroni.Model.Cpp.Access;
local Context = Macaroni.Model.Context;
local Node = Macaroni.Model.Node;
local TypeNames = Macaroni.Model.TypeNames;
UnitNodeFileGenerator = {
iterateNodes = function (self, nodeChildren, writer)
for i = 1, #(nodeChildren) do
n =... | apache-2.0 |
ioiasff/creawq | bot/utils.lua | 646 | 23489 | 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 |
czfshine/Don-t-Starve | data/DLC0001/scripts/components/burnable.lua | 1 | 13553 | local function OnKilled(inst)
if inst.components.burnable and inst.components.burnable:IsBurning() then
inst.AnimState:SetMultColour(.2,.2,.2,1)
end
end
local function DoneBurning(inst)
local burnable = inst.components.burnable
if burnable then
inst:RemoveTag("wildfirestarter")
... | gpl-2.0 |
fabiopichler/FPM-Player | themes/omicron-media-player/RecorderWindow.lua | 1 | 8728 | --[[ *******************************************************************************
Omicron Media Player
Author: Fábio Pichler
Website: http://fabiopichler.net
License: BSD 3-Clause License
Copyright (c) 2015-2019, Fábio Pichler
All rights reserved.
Redistribution and use in source and binary forms, ... | bsd-3-clause |
StoneDot/luasocket | test/smtptest.lua | 44 | 5376 | local sent = {}
local from = "diego@localhost"
local server = "localhost"
local rcpt = "luasocket@localhost"
local files = {
"/var/spool/mail/luasocket",
"/var/spool/mail/luasock1",
"/var/spool/mail/luasock2",
"/var/spool/mail/luasock3",
}
local t = socket.time()
local err
dofile("mbox.lua")
local p... | mit |
matthewhesketh/mattata | plugins/meme.lua | 2 | 12424 | --[[
Copyright 2020 Matthew Hesketh <matthew@matthewhesketh.com>
This code is licensed under the MIT. See LICENSE for details.
]]
local meme = {}
local mattata = require('mattata')
function meme:init()
meme.commands = mattata.commands(self.info.username)
:command('meme')
:command('memegen').table
... | mit |
ranisalt/forgottenserver | data/scripts/actions/others/doors.lua | 5 | 9218 | local openOddDoors = {
[12695] = { locked = 13237, closed = 12692 },
[12703] = { locked = 13236, closed = 12701 },
[14635] = { locked = 14634, closed = 14633 },
[17435] = { locked = 14641, closed = 14640 },
[26533] = { locked = 26530, closed = 26529 },
[26534] = { locked = 26532, closed = 26531 },
[31176] = { lo... | gpl-2.0 |
CrazyEddieTK/Zero-K | effects/gundam_artillery_explosion.lua | 25 | 3488 | -- artillery_explosion
return {
["artillery_explosion"] = {
dirt = {
count = 4,
ground = true,
properties = {
alphafalloff = 2,
alwaysvisible = true,
color = [[0.2, 0.1, 0.05]],
pos = [[r-25 r25, 0, ... | gpl-2.0 |
starkos/premake-core | src/base/container.lua | 23 | 8189 | ---
-- container.lua
-- Implementation of configuration containers.
-- Copyright (c) 2014 Jason Perkins and the Premake project
---
local p = premake
p.container = {}
local container = p.container
---
-- Keep a master dictionary of container class, so they can be easily looked
-- up by name (technically you cou... | bsd-3-clause |
imfoollink/NPLRuntime | Client/trunk/externals/bullet3/btgui/GwenOpenGLTest/premake4.lua | 6 | 1439 |
project "Test_Gwen_OpenGL"
kind "ConsoleApp"
flags {"Unicode"}
defines { "GWEN_COMPILE_STATIC" , "_HAS_EXCEPTIONS=0", "_STATIC_CPPLIB" }
defines { "DONT_USE_GLUT"}
targetdir "../../bin"
includedirs
{
"..",
".",
}
initOpenGL()
initGlew()
links {
"gwen",
}
files {
"../OpenGLWin... | gpl-2.0 |
tcprescott/DBM-VictorySound | localization.es.lua | 2 | 1455 | DBM_VictorySound_Translations = {}
local L = DBM_VictorySound_Translations
L.MainTab = "DBM-VictorySound - "
--L.FileOptionsSubtab = "File Options" -- to be deleted
L.StartOptionsSubtab = "Start Options"
L.VictoryOptionsSubtab = "Victory Options"
L.DefeatOptionsSubtab = "Defeat Options"
L.VictorySound_Options = "Vi... | apache-2.0 |
rgieseke/textadept | modules/ansi_c/init.lua | 1 | 4247 | -- Copyright 2007-2022 Mitchell. See LICENSE.
local M = {}
--[[ This comment is for LuaDoc.
---
-- The ansi_c module.
-- It provides utilities for editing C code.
-- @field autocomplete_snippets (boolean)
-- Whether or not to include snippets in autocompletion lists.
-- The default value is `true`.
module('_M.ans... | mit |
vrld/shine | sketch.lua | 2 | 2214 | --[[
The MIT License (MIT)
Copyright (c) 2015 Martin Felis
Copyright (c) 2017 Matthias Richter
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 th... | mit |
CrazyEddieTK/Zero-K | LuaRules/Utilities/glVolumes.lua | 6 | 10355 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Exported Functions:
-- gl.Utilities.DrawMyBox(minX,minY,minZ, maxX,maxY,maxZ)
-- gl.Utilities.DrawMyCylinder(x,y,z, height,radius,divs)
-- gl.Utilities.... | gpl-2.0 |
CrazyEddieTK/Zero-K | LuaUI/Widgets/unit_default_commands.lua | 5 | 1639 | function widget:GetInfo() return {
name = "Misc default command replacements",
license = "Public Domain",
layer = 0,
enabled = Script.IsEngineMinVersion(104, 0, 53), -- 53 on maintenance branch, 211 on develob
} end
VFS.Include("LuaRules/Configs/customcmds.h.lua") -- for CMD_RAW_MOVE
options_path = 'Settings/Unit... | gpl-2.0 |
SecUSo/openwrt-traffic-analyzer | package-dev/luci-trafficanalyzer/dist/www/cgi-bin/warningpage_content.lua | 2 | 3762 | require("luci.sys")
local warningpage_content = {};
function warningpage_content.html(backend)
print("Status: 200 OK")
print("Content-Type: text/html\n")
print('<?xml version="1.0" encoding="utf-8"?>')
print('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">... | apache-2.0 |
starkos/premake-core | modules/vstudio/tests/vc2010/test_manifest.lua | 14 | 1667 | --
-- tests/actions/vstudio/vc2010/test_manifest.lua
-- Validate generation of Manifest block in Visual Studio 201x C/C++ projects.
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
--
local p = premake
local suite = test.declare("vs2010_manifest")
local vc2010 = p.vstudio.vc2010
local project = p.p... | bsd-3-clause |
czfshine/Don-t-Starve | data/scripts/prefabs/books.lua | 1 | 5669 | local assets =
{
Asset("ANIM", "anim/books.zip"),
--Asset("SOUND", "sound/common.fsb"),
}
local prefabs =
{
"tentacle",
"splash_ocean",
"book_fx"
}
function tentaclesfn(inst, reader)
local pt = Vector3(reader.Transform:GetWorldPosition())
local numtentacles = 3
reader.components.sanit... | gpl-2.0 |
CrazyEddieTK/Zero-K | LuaRules/Gadgets/unit_starlight_satellite_capture.lua | 5 | 1259 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
if not gadgetHandler:IsSyncedCode() then
return
end
--------------------------------------------------------------------------------
------------------------... | gpl-2.0 |
czfshine/Don-t-Starve | data/scripts/components/nis.lua | 1 | 1979 | local NIS = Class(function(self, inst)
self.inst = inst
self.playing = false
self.skippable = false
self.data = {}
self.name = ""
self.inputhandlers = {}
table.insert(self.inputhandlers, TheInput:AddControlHandler(CONTROL_PRIMARY, function() self:OnClick() end))
table.insert(self.inp... | gpl-2.0 |
lephong/iornn-depparse | source/eval_depparser_rerank.lua | 1 | 1238 | require 'depparser_rerank'
require 'utils'
require 'dict'
require 'xlua'
require 'dpiornn_gen'
require 'dp_spec'
torch.setnumthreads(1)
if #arg >= 3 then
treebank_path = arg[2]
kbesttreebank_path = arg[3]
output = arg[4]
print('load net')
local net = IORNN:load(arg[1])
-- print(net.Wh:size())
print('create pa... | apache-2.0 |
matthewhesketh/mattata | plugins/xkcd.lua | 2 | 2793 | --[[
Based on a plugin by topkecleon. Licensed under GNU AGPLv3
https://github.com/topkecleon/otouto/blob/master/LICENSE.
Copyright 2020 Matthew Hesketh <matthew@matthewhesketh.com>
This code is licensed under the MIT. See LICENSE for details.
]]
local xkcd = {}
local mattata = require('mattata')
loca... | mit |
rzh/mongocraft | world/Plugins/APIDump/Classes/Projectiles.lua | 27 | 6665 | return
{
cArrowEntity =
{
Desc = [[
Represents the arrow when it is shot from the bow. A subclass of the {{cProjectileEntity}}.
]],
Functions =
{
CanPickup = { Params = "{{cPlayer|Player}}", Return = "bool", Notes = "Returns true if the specified player can pick the arrow when it's on the ground" }... | apache-2.0 |
devlua/TEAM_PRO.get | plugins/invite.lua | 43 | 1335 | do
local function callbackres(extra, success, result)
--vardump(result)
local user = 'user#id'..result.peer_id
local chat = 'chat#id'..extra.chatid
local channel = 'channel#id'..extra.chatid
if is_banned(result.id, extra.chatid) then
send_large_msg(chat, 'User is banned.')
send_large_msg(c... | gpl-2.0 |
starkos/premake-core | src/_premake_init.lua | 1 | 31795 | --
-- _premake_init.lua
--
-- Prepares the runtime environment for the add-ons and user project scripts.
--
-- Copyright (c) 2012-2015 Jason Perkins and the Premake project
--
local p = premake
local api = p.api
local DOC_URL = "See https://github.com/premake/premake-core/wiki/"
---------------------------------... | bsd-3-clause |
timroes/awesome | tests/examples/shims/awesome.lua | 3 | 1322 | local gears_obj = require("gears.object")
-- Emulate the C API classes. They differ from C API objects as connect_signal
-- doesn't take an object as first argument and they support fallback properties
-- handlers.
local function _shim_fake_class()
local obj = gears_obj()
obj.data = {}
local meta = {
... | gpl-2.0 |
omidtarh/fire | plugins/stats.lua | 24 | 3698 | do
local NUM_MSG_MAX = 1
local TIME_CHECK = 1 -- seconds
local function user_print_name(user)
if user.print_name then
return user.print_name
end
local text = ''
if user.first_name then
text = user.last_name..' '
end
if user.lastname then
text = text..user.last_name
end
return text
end
-- Returns a table with `... | gpl-2.0 |
TimSimpson/Macaroni | Main/Generators/Cpp/HFileGenerator.lua | 2 | 2569 | require "Cpp/Common";
require "Cpp/ClassHFileGenerator";
require "Cpp/LibraryConfigGenerator";
require "Cpp/NamespaceHFileGenerator";
require "Cpp/NodeFileGenerator";
require "Cpp/TypedefFileGenerator";
require "Macaroni.Model.FileName";
require "Macaroni.Model.Reason";
require "Macaroni.Model.Source";
loc... | apache-2.0 |
botzedspam/blackplus | plugins/inSuper.lua | 1 | 75011 | --Begin supergrpup.lua
--Check members #Add supergroup
local function check_member_super(cb_extra, success, result)
local receiver = cb_extra.receiver
local data = cb_extra.data
local msg = cb_extra.msg
if success == 0 then
send_large_msg(receiver, "Promote me to admin first!")
end
for k,v in pairs(result... | gpl-2.0 |
blueyed/awesome | lib/awful/keygrabber.lua | 4 | 2973 | ---------------------------------------------------------------------------
--- Keygrabber Stack
--
-- @author dodo
-- @copyright 2012 dodo
-- @module awful.keygrabber
---------------------------------------------------------------------------
local ipairs = ipairs
local table = table
local capi = {
keygrabber = k... | gpl-2.0 |
CrazyEddieTK/Zero-K | LuaRules/Gadgets/dbg_animator.lua | 5 | 6266 | ------------------------
function gadget:GetInfo()
return {
name = "Animator",
desc = "v0.002 Moves and turns pieces.",
author = "CarRepairer & knorke",
date = "2010-03-05",
license = "raubkopierer sind verbrecher",
layer = 0,
enabled = false,
}
end
local fu... | gpl-2.0 |
starkos/premake-core | modules/xcode/tests/test_xcode_project.lua | 1 | 121504 | --
-- tests/actions/xcode/test_xcode_project.lua
-- Automated test suite for Xcode project generation.
-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
--
local suite = test.declare("xcode_project")
local p = premake
local xcode = p.modules.xcode
---------------------------------------------------... | bsd-3-clause |
czfshine/Don-t-Starve | data/scripts/screens/modsscreen.lua | 1 | 31972 | local Screen = require "widgets/screen"
local AnimButton = require "widgets/animbutton"
local Spinner = require "widgets/spinner"
local ImageButton = require "widgets/imagebutton"
local TextButton = require "widgets/textbutton"
local Text = require "widgets/text"
local Image = require "widgets/image"
local NumericSpinn... | gpl-2.0 |
CrazyEddieTK/Zero-K | gamedata/explosions_post.lua | 17 | 1247 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
-- Load CA's effects from ./effects and not ./gamedata/explosions
--
local luaFiles = VFS.DirList('effects', '*.lua', '*.tdf')
--couldn't be arsed to con... | gpl-2.0 |
Evengard/UniMod | Libs/luasocket/samples/cddb.lua | 56 | 1415 | local socket = require("socket")
local http = require("socket.http")
if not arg or not arg[1] or not arg[2] then
print("luasocket cddb.lua <category> <disc-id> [<server>]")
os.exit(1)
end
local server = arg[3] or "http://freedb.freedb.org/~cddb/cddb.cgi"
function parse(body)
local lines = string.gfind(bo... | lgpl-3.0 |
ranisalt/forgottenserver | data/actions/scripts/other/bed_modification_kits.lua | 13 | 1647 | local beds = {
[7904] = {{7811, 7812}, {7813, 7814}}, -- green kit
[7905] = {{7819, 7820}, {7821, 7822}}, -- yellow kit
[7906] = {{7815, 7816}, {7817, 7818}}, -- red kit
[7907] = {{1754, 1755}, {1760, 1761}}, -- removal kit
[20252] = {{20197, 20198}, {20199, 20200}} -- canopy kit
}
local function internalBedTrans... | gpl-2.0 |
timroes/awesome | lib/awful/spawn.lua | 3 | 17311 | --luacheck: no max line length
---------------------------------------------------------------------------
--- Spawning of programs.
--
-- This module provides methods to start programs and supports startup
-- notifications, which allows for callbacks and applying properties to the
-- program after it has been launche... | gpl-2.0 |
czfshine/Don-t-Starve | data/scripts/prefabs/minotaur.lua | 1 | 7717 | require "brains/minotaurbrain"
require "stategraphs/SGminotaur"
local assets=
{
Asset("ANIM", "anim/rook.zip"),
Asset("ANIM", "anim/rook_build.zip"),
Asset("ANIM", "anim/rook_rhino.zip"),
Asset("SOUND", "sound/chess.fsb"),
}
local prefabs =
{
"meat",
"minotaurhorn"
}
local loot =
{
"meat",
"meat",
"m... | gpl-2.0 |
sigma-random/wireshark | test/lua/gregex.lua | 29 | 8743 |
-- Tests for GLib Regex functions
-- written by Hadriel Kaplan, based on Lrexlib's test suite
-- This is a test script for tshark/wireshark.
-- This script runs inside tshark/wireshark, so to run it do:
-- tshark -r empty.cap -X lua_script:<path_to_testdir>/lua/gregex.lua -X lua_script1:glib
--
-- if you have to give ... | gpl-2.0 |
CrazyEddieTK/Zero-K | scripts/spiderassault.lua | 9 | 5237 | include "constants.lua"
local base = piece 'base'
local torso = piece 'torso'
local turret = piece 'turret'
local lbarrel = piece 'lbarrel'
local lflare = piece 'lflare'
local rbarrel = piece 'rbarrel'
local rflare = piece 'rflare'
local larm = piece 'larm'
local rarm = piece 'rarm'
local lfrontleg = piece '... | gpl-2.0 |
blueyed/awesome | lib/wibox/widget/init.lua | 2 | 3025 | ---------------------------------------------------------------------------
-- @author Uli Schlachter
-- @copyright 2010 Uli Schlachter
-- @classmod wibox.widget
---------------------------------------------------------------------------
local cairo = require("lgi").cairo
local hierarchy = require("wibox.hierarchy")
... | gpl-2.0 |
Jordach/Vox | mods/screwdriver/init.lua | 1 | 2334 | local function nextrange(x, max)
x = x + 1
if x > max then
x = 0
end
return x
end
local ROTATE_FACE = 1
local ROTATE_AXIS = 2
local USES = 200
-- Handles rotation
local function screwdriver_handler(itemstack, user, pointed_thing, mode)
if pointed_thing.type ~= "node" then
return
end
local pos = pointed_th... | lgpl-2.1 |
AllAboutEE/nodemcu-firmware | app/cjson/lua/cjson/util.lua | 170 | 6837 | local json = require "cjson"
-- Various common routines used by the Lua CJSON package
--
-- Mark Pulford <mark@kyne.com.au>
-- Determine with a Lua table can be treated as an array.
-- Explicitly returns "not an array" for very sparse arrays.
-- Returns:
-- -1 Not an array
-- 0 Empty table
-- >0 Highest index ... | mit |
CrazyEddieTK/Zero-K | gamedata/modularcomms/weapons/aamissile.lua | 5 | 1426 | local name = "commweapon_aamissile"
local weaponDef = {
name = [[AA Missile]],
areaOfEffect = 48,
canattackground = false,
cegTag = [[missiletrailblue]],
craterBoost = 1,
craterMult = 2,
cylinderTargeting = 1,
customParams ... | gpl-2.0 |
ranisalt/forgottenserver | data/npc/lib/npcsystem/npchandler.lua | 6 | 21885 | -- Advanced NPC System by Jiddo
if not NpcHandler then
-- Constant talkdelay behaviors.
TALKDELAY_NONE = 0 -- No talkdelay. Npc will reply immedeatly.
TALKDELAY_ONTHINK = 1 -- Talkdelay handled through the onThink callback function. (Default)
TALKDELAY_EVENT = 2 -- Not yet implemented
-- Currently applied talkde... | gpl-2.0 |
gaoch023/OpenRA | lua/stacktraceplus.lua | 59 | 12006 | -- tables
local _G = _G
local string, io, debug, coroutine = string, io, debug, coroutine
-- functions
local tostring, print, require = tostring, print, require
local next, assert = next, assert
local pcall, type, pairs, ipairs = pcall, type, pairs, ipairs
local error = error
assert(debug, "debug table must be availa... | gpl-3.0 |
unusualcrow/redead_reloaded | entities/entities/sent_fire/cl_init.lua | 1 | 2490 | include("shared.lua")
function ENT:Initialize()
self.Emitter = ParticleEmitter(self:GetPos())
self.SmokeTime = 0
self.LightTime = 0
self:DoTraces()
end
function ENT:DoTraces()
if self:GetPos() == Vector(0, 0, 0) then return end
self.PosTbl = {}
for i = -30, 30 do
for j = -30, 30 do
local trace = {}
tr... | mit |
CrazyEddieTK/Zero-K | LuaRules/Configs/explosion_spawn_defs.lua | 4 | 1725 | -- $Id: explosion_spawn_defs.lua 4050 2009-03-09 02:56:38Z midknight $
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--Lists post-processing weapon names and the units to spawn when they go off
local spa... | gpl-2.0 |
czfshine/Don-t-Starve | data/scripts/components/locomotor.lua | 1 | 21282 | Dest = Class(function(self, inst, world_offset)
self.inst = inst
self.world_offset = world_offset
end)
local PATHFIND_PERIOD = 1
local PATHFIND_MAX_RANGE = 40
local STATUS_CALCULATING = 0
local STATUS_FOUNDPATH = 1
local STATUS_NOPATH = 2
local NO_ISLAND = 127
local ARRIVE_STEP = .15
function Dest:IsValid(... | gpl-2.0 |
omidtarh/fire | plugins/face.lua | 641 | 3073 | local https = require("ssl.https")
local ltn12 = require "ltn12"
-- Edit data/mashape.lua with your Mashape API key
-- http://docs.mashape.com/api-keys
local mashape = load_from_file('data/mashape.lua', {
api_key = ''
})
local function request(imageUrl)
local api_key = mashape.api_key
if api_key:isempt... | gpl-2.0 |
ranisalt/forgottenserver | data/scripts/actions/others/surprise_cube.lua | 7 | 2266 | local config = {
{chanceFrom = 0, chanceTo = 1450, itemId = 2152, count = 5}, -- platinum coin
{chanceFrom = 1451, chanceTo = 2850, itemId = 18421}, -- green crystal fragment
{chanceFrom = 2851, chanceTo = 3950, itemId = 18419}, -- cyan crystal fragment
{chanceFrom = 3951, chanceTo = 5050, itemId = 18420}, -- red c... | gpl-2.0 |
CrazyEddieTK/Zero-K | LuaRules/Gadgets/unit_target_priority.lua | 3 | 14767 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
if not gadgetHandler:IsSyncedCode() then
return
end
--------------------------------------------------------------------------------
------------------------... | gpl-2.0 |
alexgrist/NutScript | plugins/saveitems.lua | 1 | 3091 |
PLUGIN.name = "Save Items"
PLUGIN.author = "Chessnut"
PLUGIN.description = "Saves items that were dropped."
--[[
function PLUGIN:OnSavedItemLoaded(items)
for k, v in ipairs(items) do
-- do something
end
end
function PLUGIN:ShouldDeleteSavedItems()
return true
end
]]--
-- as title says.
function PLUGIN... | mit |
cloudwu/skynet | service/service_provider.lua | 3 | 2423 | local skynet = require "skynet"
local provider = {}
local function new_service(svr, name)
local s = {}
svr[name] = s
s.queue = {}
return s
end
local svr = setmetatable({}, { __index = new_service })
function provider.query(name)
local s = svr[name]
if s.queue then
table.insert(s.queue, skynet.response())
... | mit |
alinfrat/robot | plugins/stats.lua | 236 | 3989 | do
-- Returns a table with `name` and `msgs`
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_prin... | gpl-2.0 |
andywingo/snabbswitch | lib/ljsyscall/syscall/linux/ffi.lua | 18 | 19305 | -- ffi definitions of Linux types
local require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string =
require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string
local abi = require "syscal... | apache-2.0 |
borq79/Cary-Area-Public-Library-Classes | courses/diy_weather_nodemcu/source/nodemcu/weather.lua | 1 | 3505 | -- ====================================================================================================================
-- ====================================================================================================================
-- Copyright (c) 2017 Ryan Brock. All rights reserved.
-- Licensed under the MIT... | mit |
tgroshon/canvas-lms | lib/canvas/request_throttle/increment_bucket.lua | 43 | 1169 | local cache_key = KEYS[1]
local amount = tonumber(ARGV[1])
local current_time = tonumber(ARGV[2])
local outflow = tonumber(ARGV[3])
local maximum = tonumber(ARGV[4])
-- Our modified leaky bucket algorithm is explained in lib/canvas/request_throttle.rb
local leak = function(count, last_touched, current_time, outflow)
... | agpl-3.0 |
UristMcEngineer/Michels-Medieval-Mod | mmm/mods/boats/init.lua | 1 | 5588 | --
-- Helper functions
--
local function is_water(pos)
local nn = minetest.get_node(pos).name
return minetest.get_item_group(nn, "water") ~= 0
end
local function get_sign(i)
if i == 0 then
return 0
else
return i / math.abs(i)
end
end
local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v
lo... | gpl-3.0 |
andywingo/snabbswitch | lib/ljsyscall/syscall/linux/nl.lua | 18 | 36273 | -- modularize netlink code as it is large and standalone
local require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string =
require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string
loca... | apache-2.0 |
unusualcrow/redead_reloaded | entities/weapons/rad_itemplacer/shared.lua | 1 | 5283 | if SERVER then
AddCSLuaFile("shared.lua")
SWEP.Weight = 1
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
end
if CLIENT then
ClientItemPlacerTbl = {}
ClientItemPlacerTbl["teh"] = {}
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = true
SWEP.CSMuzzleFlashes = true
SWEP.ViewModelFOV = 74
SWEP.ViewModelFlip = f... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.