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 |
|---|---|---|---|---|---|
wesnoth/wesnoth | data/campaigns/World_Conquest/lua/map/utility.lua | 7 | 1038 |
globals = {}
setmetatable(globals, {
["__index"] = function(t, k)
return rawget(_G, k)
end,
["__newindex"] = function(t, k, v)
_G[k] = v
end,
})
function wct_enemy(side, com, item, train, sup, l2, l3)
return {
commander=com,
have_item=item,
trained=train,
supply=sup,
recall_level2 = l2,
recall_le... | gpl-2.0 |
Mutos/StarsOfCall-NAEV | dat/factions/equip/independent.lua | 1 | 2273 | -- ================================================================================================================================
--
-- Define functions to equip a generic ship from the SoC TC
-- - Faction : independent
--
-- =====================================================================================... | gpl-3.0 |
fegimanam/LNT | 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 |
ivendrov/nn | SpatialDivisiveNormalization.lua | 39 | 5171 | local SpatialDivisiveNormalization, parent = torch.class('nn.SpatialDivisiveNormalization','nn.Module')
function SpatialDivisiveNormalization:__init(nInputPlane, kernel, threshold, thresval)
parent.__init(self)
-- get args
self.nInputPlane = nInputPlane or 1
self.kernel = kernel or torch.Tensor(9,9):fill(... | bsd-3-clause |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/armaser.lua | 1 | 2861 | return {
armaser = {
acceleration = 0.11999999731779,
activatewhenbuilt = true,
brakerate = 0.15000000596046,
buildcostenergy = 1326,
buildcostmetal = 73,
buildpic = "ARMASER.DDS",
buildtime = 4937,
canattack = false,
canmove = true,
category = "KBOT MOBILE ALL NOTSUB NOWEAPON NOTSHIP NOTAIR NOTHOV... | gpl-2.0 |
LightenPan/skynet-yule | lualib/http/httpc.lua | 42 | 2906 | local socket = require "http.sockethelper"
local url = require "http.url"
local internal = require "http.internal"
local string = string
local table = table
local httpc = {}
local function request(fd, method, host, url, recvheader, header, content)
local read = socket.readfunc(fd)
local write = socket.writefunc(fd)... | mit |
Anarchid/Zero-K | units/planelightscout.lua | 4 | 1981 | return { planelightscout = {
unitname = [[planelightscout]],
name = [[Sparrow]],
description = [[Light Scout Plane]],
brakerate = 0.4,
buildCostMetal = 235,
builder = false,
buildPic = [[planelightscout.png]],
canFly = ... | gpl-2.0 |
wesnoth/wesnoth | data/lua/functional.lua | 4 | 6671 | -- This file implements equivalents of various higher-order WFL functions
local functional = {}
---Filter an array for elements matching a certain condition
---@generic T
---@param input T[]
---@param condition fun(val:T):boolean
---@return T[]
function functional.filter(input, condition)
local filtered_table = {... | gpl-2.0 |
bugobliterator/ardupilot | libraries/AP_Scripting/examples/param_get_set_test.lua | 15 | 2308 | -- This script is a test of param set and get
local count = 0
-- for fast param acess it is better to get a param object,
-- this saves the code searching for the param by name every time
local VM_I_Count = Parameter()
if not VM_I_Count:init('SCR_VM_I_COUNT') then
gcs:send_text(6, 'get SCR_VM_I_COUNT failed')
end
-... | gpl-3.0 |
Mutos/SoC-Test-001 | dat/missions/shadow/darkshadow.lua | 11 | 28246 | --[[
-- This is the third mission in the "shadow" series, featuring the return of SHITMAN.
--]]
include ("proximity.lua")
-- localization stuff, translators would work here
lang = naev.lang()
if lang == "es" then
else -- default english
title = {}
text = {}
Jorscene = {}
title[1] = "An urgent invita... | gpl-3.0 |
Whit3Tig3R/bestspammbot2 | plugins/rae.lua | 616 | 1312 | do
function getDulcinea( text )
-- Powered by https://github.com/javierhonduco/dulcinea
local api = "http://dulcinea.herokuapp.com/api/?query="
local query_url = api..text
local b, code = http.request(query_url)
if code ~= 200 then
return "Error: HTTP Connection"
end
dulcinea = json:decode(b)
... | gpl-2.0 |
PichotM/DarkRP | entities/entities/drug/cl_init.lua | 12 | 1493 | include("shared.lua")
function ENT:Initialize()
end
function ENT:Draw()
self:DrawModel()
local Pos = self:GetPos()
local Ang = self:GetAngles()
local owner = self:Getowning_ent()
owner = (IsValid(owner) and owner:Nick()) or DarkRP.getPhrase("unknown")
surface.SetFont("HUDNumber5")
local... | mit |
Anarchid/Zero-K | units/napalmmissile.lua | 4 | 3419 | return { napalmmissile = {
unitname = [[napalmmissile]],
name = [[Inferno]],
description = [[Napalm Missile]],
buildCostMetal = 500,
builder = false,
buildingGroundDecalDecaySpeed = 30,
buildingGroundDecal... | gpl-2.0 |
fegimanam/ma | plugins/stats.lua | 866 | 4001 | 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 |
erfan1292/1234 | plugins/fantasty_writter.lua | 3 | 28777 | local function run(msg, matches)
if #matches < 2 then
return "بعد از این دستور، با قید یک فاصله کلمه یا جمله ی مورد نظر را جهت زیبا نویسی وارد کنید"
end
if string.len(matches[2]) > 20 then
return "حداکثر حروف مجاز 20 کاراکتر انگلیسی و عدد است"
end
local font_base = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,... | gpl-2.0 |
wesnoth/wesnoth | data/campaigns/World_Conquest/lua/map/generator/utilities.lua | 6 | 6320 |
function flatten1(list)
local res = {}
assert(type(list) == "table")
for i1, v1 in ipairs(list) do
assert(type(v1) == "table")
for i2, v2 in ipairs(v1) do
res[#res + 1] = v2
end
end
return res
end
function dr_height(height, terrain)
return {
height = height,
terrain = terrain,
}
end
-- dr_convert... | gpl-2.0 |
Sannis/tarantool | test/app/csv.test.lua | 6 | 3607 | #!/usr/bin/env tarantool
local function table2str(t)
local res = ""
for k, line in pairs(t) do
local s = ""
for k2, field in pairs(line) do
s = s .. '|' .. field .. '|\t'
end
res = res .. s .. '\n'
end
return res
end
local function myread(self, bytes)
s... | bsd-2-clause |
helingping/Urho3D | bin/Data/LuaScripts/03_Sprites.lua | 24 | 3509 | -- Moving sprites example.
-- This sample demonstrates:
-- - Adding Sprite elements to the UI
-- - Storing custom data (sprite velocity) inside UI elements
-- - Handling frame update events in which the sprites are moved
require "LuaScripts/Utilities/Sample"
local numSprites = 100
local sprites =... | mit |
Bew78LesellB/awesome | spec/wibox/test_utils.lua | 6 | 4137 | ---------------------------------------------------------------------------
-- @author Uli Schlachter
-- @copyright 2014 Uli Schlachter
---------------------------------------------------------------------------
local object = require("gears.object")
local matrix_equals = require("gears.matrix").equals
local base = re... | gpl-2.0 |
helingping/Urho3D | Source/ThirdParty/toluapp/src/bin/lua/custom.lua | 25 | 1388 |
function extract_code(fn,s)
local code = ""
if fn then
code = '\n$#include "'..fn..'"\n'
end
s= "\n" .. s .. "\n" -- add blank lines as sentinels
local _,e,c,t = strfind(s, "\n([^\n]-)SCRIPT_([%w_]*)[^\n]*\n")
while e do
t = strlower(t)
if t == "bind_begin" then
_,e,c = strfind(s,"(.-)\n[^\n]... | mit |
CyberSecurityBot/Cyber-Security-pro | plugins/onservice.lua | 2 | 1704 | --[[
|------------------------------------------------- |--------- ______-----------------_______---|
| ______ __ ______ _____ _____ __ | _____ | ____| __ __ / _____/ |
| |__ __| | | |__ __| / \ | \ | | | |__ | | |____ | | | | / /____ |
| | | | | |... | agpl-3.0 |
iamgreaser/iceball | pkg/iceball/lib/font.lua | 4 | 2269 | --[[
Copyright (c) 2014 Team Sparkle
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, ... | gpl-3.0 |
Anarchid/Zero-K | LuaUI/Widgets/dbg_ceg_spawner.lua | 8 | 3055 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "CEG Spawner",
desc = "v0.031 Spawn CEGs",
author = "CarRepairer",
date = "2010... | gpl-2.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/corsd.lua | 1 | 2404 | return {
corsd = {
activatewhenbuilt = true,
buildangle = 4096,
buildcostenergy = 6363,
buildcostmetal = 698,
buildinggrounddecaldecayspeed = 30,
buildinggrounddecalsizex = 6,
buildinggrounddecalsizey = 6,
buildinggrounddecaltype = "corsd_aoplane.dds",
buildpic = "CORSD.DDS",
buildtime = 11955,
c... | gpl-2.0 |
LightenPan/skynet-yule | lualib/snax.lua | 59 | 3683 | local skynet = require "skynet"
local snax_interface = require "snax.interface"
local snax = {}
local typeclass = {}
local interface_g = skynet.getenv("snax_interface_g")
local G = interface_g and require (interface_g) or { require = function() end }
interface_g = nil
skynet.register_protocol {
name = "snax",
id =... | mit |
ivendrov/nn | Euclidean.lua | 24 | 5711 | local Euclidean, parent = torch.class('nn.Euclidean', 'nn.Module')
function Euclidean:__init(inputSize,outputSize)
parent.__init(self)
self.weight = torch.Tensor(inputSize,outputSize)
self.gradWeight = torch.Tensor(inputSize,outputSize)
-- state
self.gradInput:resize(inputSize)
self.output:resize(o... | bsd-3-clause |
Whit3Tig3R/bestspammbot2 | plugins/id.lua | 226 | 4260 | 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
local function returnids(cb_extra, success, result)
local re... | gpl-2.0 |
amircheshme/megatron | plugins/id.lua | 226 | 4260 | 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
local function returnids(cb_extra, success, result)
local re... | gpl-2.0 |
jerizm/kong | kong/templates/nginx_kong.lua | 1 | 3760 | return [[
resolver ${{DNS_RESOLVER}} ipv6=off;
charset UTF-8;
error_log logs/error.log ${{LOG_LEVEL}};
access_log logs/access.log;
> if anonymous_reports then
${{SYSLOG_REPORTS}}
> end
> if nginx_optimizations then
>-- send_timeout 60s; # default value
>-- keepalive_timeout 75s; # default value
>-- clie... | apache-2.0 |
mnemnion/grym | lib/pl/seq.lua | 1 | 14544 | --- Manipulating iterators as sequences.
-- See @{07-functional.md.Sequences|The Guide}
--
-- Dependencies: `pl.utils`, `pl.types`, `debug`
-- @module pl.seq
local next,assert,pairs,tonumber,type,setmetatable = next,assert,pairs,tonumber,type,setmetatable
local strfind,format = string.find,string.format
local mrandom ... | mit |
gberger/PES-3 | src/models/conference.lua | 1 | 2011 | --[[
Módulo responsável representar o conferência (model) do padrão de design MVC
]]
local utils = require "utils"
local path = require "pl.path"
local ATTRIBUTES = {"id", "abbreviation", "name", "location", "month", "year", "editors", "creation_date"}
--[[
Responsabilidade: Retorna dados da conferência baseado numa... | mit |
Whit3Tig3R/bestspammbot2 | plugins/minecraft.lua | 624 | 2605 | local usage = {
"!mine [ip]: Searches Minecraft server on specified ip and sends info. Default port: 25565",
"!mine [ip] [port]: Searches Minecraft server on specified ip and port and sends info.",
}
local ltn12 = require "ltn12"
local function mineSearch(ip, port, receiver) --25565
local responseText = ""
l... | gpl-2.0 |
flavorzyb/cocos2d-x | samples/Lua/TestLua/Resources/luaScript/RenderTextureTest/RenderTextureTest.lua | 7 | 18244 | -- Test #1 by Jason Booth (slipster216)
-- Test #3 by David Deaco (ddeaco)
--/**
-- * Impelmentation of RenderTextureSave
--*/
local function RenderTextureSave()
local ret = createTestLayer("Touch the screen",
"Press 'Save Image' to create an snapshot of the render texture")
... | gpl-2.0 |
UB12/lion | plugins/cpu.lua | 244 | 1893 | function run_sh(msg)
name = get_name(msg)
text = ''
-- if config.sh_enabled == false then
-- text = '!sh command is disabled'
-- else
-- if is_sudo(msg) then
-- bash = msg.text:sub(4,-1)
-- text = run_bash(bash)
-- else
-- text = name .. ' you... | gpl-2.0 |
wesnoth/wesnoth | utils/emmylua/config.lua | 5 | 1620 | ---@meta
-- This file contains settings for the Lua add-on in Visual Studio Code
-- It's supposed to allow the add-on to automatically detect the correct settings,
-- but I'm not quite sure how to make that work.
name = 'Wesnoth'
words = {'wesnoth', 'wml'}
configs = {
{
key = 'Lua.runtime.version',
... | gpl-2.0 |
SametSisartenep/dotfiles | .config/vis/lexers/pico8.lua | 1 | 1181 | -- Copyright 2017 Alejandro Baez (https://keybase.io/baez). See LICENSE.
-- PICO-8 Lexer.
-- http://www.lexaloffle.com/pico-8.php
local l = require('lexer')
local token, word_match = l.token, l.word_match
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'pico8'}
-- Whitespace
local ws = token(l.WHITESPACE, ... | isc |
flavorzyb/cocos2d-x | samples/Lua/TestLua/Resources/luaScript/DrawPrimitivesTest/DrawPrimitivesTest.lua | 8 | 3911 |
local SceneIdx = -1
local MAX_LAYER = 2
local background = nil
local labelAtlas = nil
local baseLayer_entry = nil
local s = CCDirector:sharedDirector():getWinSize()
local function getBaseLayer()
local layer = CCLayer:create()
local item1 = CCMenuItemImage:create(s_pPathB1, s_pPathB2)
local item2 = CCMen... | gpl-2.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/armsfig.lua | 1 | 2158 | return {
armsfig = {
acceleration = 0.47999998927116,
airsightdistance = 700,
brakerate = 10,
buildcostenergy = 4274,
buildcostmetal = 72,
buildpic = "ARMSFIG.DDS",
buildtime = 7279,
canfly = true,
canmove = true,
cansubmerge = true,
category = "ALL NOTLAND MOBILE WEAPON ANTIGATOR NOTSUB ANTIFLAM... | gpl-2.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/corpun.lua | 1 | 4029 | return {
corpun = {
acceleration = 0,
brakerate = 0,
buildangle = 8192,
buildcostenergy = 12585,
buildcostmetal = 1468,
buildinggrounddecaldecayspeed = 30,
buildinggrounddecalsizex = 6,
buildinggrounddecalsizey = 6,
buildinggrounddecaltype = "corpun_aoplane.dds",
buildpic = "CORPUN.DDS",
buildtim... | gpl-2.0 |
Bew78LesellB/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 |
wesnoth/wesnoth | data/ai/micro_ais/mai-defs/fast.lua | 4 | 4306 | function wesnoth.micro_ais.fast_ai(cfg)
local optional_keys = { attack_hidden_enemies = 'boolean', avoid = 'tag', dungeon_mode = 'boolean',
filter = 'tag', filter_second = 'tag', include_occupied_attack_hexes = 'boolean',
leader_additional_threat = 'float', leader_attack_max_units = 'integer', leader_weight = 'flo... | gpl-2.0 |
Sasu98/Nerd-Gaming-Public | resources/NGHospitals/respawn_c.lua | 2 | 3018 | local data = nil
local dead = false
local sx, sy = guiGetScreenSize ( )
local hospitals = { }
addEvent ( 'NGHospitals:onClientWasted', true )
addEventHandler ( 'NGHospitals:onClientWasted', root, function ( d )
dead = true
data = d
l_tick = getTickCount ( )
ind = 0
rec_y = sy
moveMode = true
drawRec = false
a... | mit |
wesnoth/wesnoth | data/campaigns/World_Conquest/lua/game_mechanics/effects.lua | 4 | 5588 | local _ = wesnoth.textdomain 'wesnoth-wc'
local T = wml.tag
local terrain_map = { fungus = "Tt", cave = "Ut", sand = "Dt",
reef = "Wrt", hills = "Ht", swamp_water = "St", shallow_water = "Wst", castle = "Ct",
mountains = "Mt", deep_water = "Wdt", flat = "Gt", forest = "Ft", frozen = "At",
village = "Vt", impassable... | gpl-2.0 |
PichotM/DarkRP | gamemode/modules/doorsystem/sv_dooradministration.lua | 4 | 6629 | local function ccDoorUnOwn(ply, args)
if ply:EntIndex() == 0 then
print(DarkRP.getPhrase("cmd_cant_be_run_server_console"))
return
end
local trace = ply:GetEyeTrace()
if not IsValid(trace.Entity) or not trace.Entity:isKeysOwnable() or not trace.Entity:getDoorOwner() or ply:EyePos():Dis... | mit |
Mutos/StarsOfCall-NAEV | dat/events/npc/factions/arythem.lua | 1 | 1169 | --[[
-- Include file for npc.lua
-- Defines the general portraits and lore messages
--]]
if lang == 'es' then --not translated atm
else --default english
msg_lore["Arythem Clan"] = {
"Of course I know the K'Rinns are not Na'imsh. But I can never see one without remembering what my elders tald me of their su... | gpl-3.0 |
jerizm/kong | kong/plugins/oauth2/migrations/cassandra.lua | 3 | 3535 | return {
{
name = "2015-08-03-132400_init_oauth2",
up = [[
CREATE TABLE IF NOT EXISTS oauth2_credentials(
id uuid,
name text,
consumer_id uuid,
client_id text,
client_secret text,
redirect_uri text,
created_at timestamp,
PRIMARY KEY (id)
... | apache-2.0 |
PichotM/DarkRP | gamemode/modules/fadmin/fadmin/restrict/sv_restrict.lua | 11 | 2667 | sql.Query("CREATE TABLE IF NOT EXISTS FADMIN_RESTRICTEDENTS('TYPE' TEXT NOT NULL, 'ENTITY' TEXT NOT NULL, 'ADMIN_GROUP' TEXT NOT NULL, PRIMARY KEY(TYPE, ENTITY));")
local Restricted = {}
Restricted.Weapons = {}
local function RetrieveRestricted()
local Query = sql.Query("SELECT * FROM FADMIN_RESTRICTEDENTS") or {... | mit |
flavorzyb/cocos2d-x | samples/Lua/TestLua/Resources/luaScript/RotateWorldTest/RotateWorldTest.lua | 8 | 3356 |
local size = CCDirector:sharedDirector():getWinSize()
local function CreateSpriteLayer()
local layer = CCLayer:create()
local x, y
x = size.width
y = size.height
local sprite = CCSprite:create(s_pPathGrossini)
local spriteSister1 = CCSprite:create(s_pPathSister1)
local spriteSister2 = CCSprite... | gpl-2.0 |
Anarchid/Zero-K | LuaRules/Configs/StartBoxes/Deserted Third v4.lua | 8 | 4723 | return {
[0] = {
boxes = {
{
{1758, 395},
{1748, 391},
{1737, 392},
{1727, 394},
{1716, 396},
{1688, 401},
{1637, 409},
{1614, 412},
{1590, 412},
{1554, 408},
{1527, 407},
{1499, 413},
{1454, 424},
{1415, 439},
{1350, 468},
{1321, 486},
{1305, 50... | gpl-2.0 |
SametSisartenep/dotfiles | .config/vis/lexers/csharp.lua | 5 | 2761 | -- Copyright 2006-2017 Mitchell mitchell.att.foicica.com. See LICENSE.
-- C# LPeg lexer.
local l = require('lexer')
local token, word_match = l.token, l.word_match
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'csharp'}
-- Whitespace.
local ws = token(l.WHITESPACE, l.space^1)
-- Comments.
local line_com... | isc |
LanceJenkinZA/prosody-modules | mod_roster_command/mod_roster_command.lua | 31 | 5484 | -----------------------------------------------------------
-- mod_roster_command: Manage rosters through prosodyctl
-- version 0.02
-----------------------------------------------------------
-- Copyright (C) 2011 Matthew Wild
-- Copyright (C) 2011 Adam Nielsen
--
-- This project is MIT/X11 licensed. Please see the
--... | mit |
rollasoul/HaikuDenseCap | densecap/modules/PosSlicer.lua | 4 | 1939 | local layer, parent = torch.class('nn.PosSlicer', 'nn.Module')
--[[
A PosSlicer receives two inputs:
- features: Tensor of shape (N, d1, ..., dk)
- gt_features: Tensor of shape (P, e1, ..., en) or an empty Tensor
If gt_features is not empty, then return the first P rows of features
(along the first dimension). If gt... | mit |
LightenPan/skynet-yule | yule/minesweeper/profile.lua | 1 | 1107 | local skynet = require "skynet"
local snax = require "snax"
local protobuf = require "protobuf"
local cmd2name = {
["s101_1"] = {reqname = "profilesvr_protos.GetUserInfoReq", rspname = "profilesvr_protos.GetUserInfoRsp"}
}
local command = {}
local PBCMD = {}
function PBCMD.s101_1(req)
oUserInfo = {user_id = "test"... | mit |
fegimanam/crd | 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 |
punisherbot/ma | 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 |
UB12/lion | 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 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/armveil.lua | 1 | 2451 | return {
armveil = {
acceleration = 0,
activatewhenbuilt = true,
brakerate = 0,
buildangle = 8192,
buildcostenergy = 17501,
buildcostmetal = 119,
buildinggrounddecaldecayspeed = 30,
buildinggrounddecalsizex = 4,
buildinggrounddecalsizey = 4,
buildinggrounddecaltype = "armveil_aoplane.dds",
buildp... | gpl-2.0 |
wesnoth/wesnoth | data/ai/micro_ais/cas/ca_big_animals.lua | 6 | 4084 | local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "location_set"
local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua"
local function get_big_animals(cfg)
local big_animals = AH.get_units_with_moves {
side = wesnoth.current.side,
{ "and" , wml.get_child... | gpl-2.0 |
imashkan/ABCYAGOP | plugins/twitter_send.lua | 627 | 1555 | do
local OAuth = require "OAuth"
local consumer_key = ""
local consumer_secret = ""
local access_token = ""
local access_token_secret = ""
local client = OAuth.new(consumer_key, consumer_secret, {
RequestToken = "https://api.twitter.com/oauth/request_token",
AuthorizeUser = {"https://api.twitter.com/oauth/autho... | gpl-2.0 |
flavorzyb/cocos2d-x | scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua | 73 | 11943 | ----------------------------------------------------------------------------
-- Lua script to generate a customized, minified version of Lua.
-- The resulting 'minilua' is used for the build process of LuaJIT.
----------------------------------------------------------------------------
-- Copyright (C) 2005-2013 Mike P... | gpl-2.0 |
MinaciousGrace/Til-Death | Scripts/TabManager.lua | 1 | 2082 |
-- Tabs are 0 indexed
local tabIndex = 0
local tabSize = 5
local availTabSize = 2
local availableTabs1P = {true,false,true,false,false,false}
local availableTabs2P = {true,false,false,false,true}
--0 indexed tabs... yet 1 indexed lua tables mfw. Will probably go into infinite loop if everything is false.
-- Recursi... | mit |
gbox3d/nodemcu-firmware | examples/telnet.lua | 5 | 1067 | print("====Wicon, a LUA console over wifi.==========")
print("Author: openthings@163.com. copyright&GPL V2.")
print("Last modified 2014-11-19. V0.2")
print("Wicon Server starting ......")
function startServer()
print("Wifi AP connected. Wicon IP:")
print(wifi.sta.getip())
sv=net.createServer(net.TCP, 180)
... | mit |
LanceJenkinZA/prosody-modules | mod_mam/mamprefsxml.lib.lua | 36 | 1467 | -- XEP-0313: Message Archive Management for Prosody
-- Copyright (C) 2011-2013 Kim Alvefur
--
-- This file is MIT/X11 licensed.
local st = require"util.stanza";
local xmlns_mam = "urn:xmpp:mam:0";
local global_default_policy = module:get_option("default_archive_policy", false);
local default_attrs = {
always = true... | mit |
ivendrov/nn | JoinTable.lua | 25 | 1958 | local JoinTable, parent = torch.class('nn.JoinTable', 'nn.Module')
function JoinTable:__init(dimension, nInputDims)
parent.__init(self)
self.size = torch.LongStorage()
self.dimension = dimension
self.gradInput = {}
self.nInputDims = nInputDims
end
function JoinTable:updateOutput(input)
local dimensi... | bsd-3-clause |
Dahkelor/theorycraft | dep/recastnavigation/RecastDemo/premake4.lua | 82 | 3551 | --
-- premake4 file to build RecastDemo
-- http://industriousone.com/premake
--
local action = _ACTION or ""
local todir = "Build/" .. action
solution "recastnavigation"
configurations {
"Debug",
"Release"
}
location (todir)
-- extra warnings, no exceptions or rtti
flags {
"ExtraWarnings",
"FloatFast"... | gpl-2.0 |
wesnoth/wesnoth | data/ai/micro_ais/cas/ca_healer_move.lua | 6 | 5392 | local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local M = wesnoth.map
local ca_healer_move, best_healer, best_hex = {}, nil, nil
function ca_healer_move:evaluation(cfg, data)
-- Should happen with higher priority than attacks, except at beginning of turn,
... | gpl-2.0 |
TheMarex/delightful | delightful/widgets/cpu.lua | 1 | 5770 | -------------------------------------------------------------------------------
--
-- CPU widget for Awesome 3.4
-- Copyright (C) 2011 Tuomas Jormola <tj@solitudo.net>
--
-- Licensed under the terms of GNU General Public License Version 2.0.
--
-- Description:
--
-- Displays horizontal usage trend graph of all the CPUs... | gpl-2.0 |
helingping/Urho3D | bin/Data/LuaScripts/15_Navigation.lua | 5 | 19734 | -- Navigation example.
-- This sample demonstrates:
-- - Generating a navigation mesh into the scene
-- - Performing path queries to the navigation mesh
-- - Rebuilding the navigation mesh partially when adding or removing objects
-- - Visualizing custom debug geometry
-- - Raycasting drawable... | mit |
Anarchid/Zero-K | LuaRules/Gadgets/unit_boolean_disable.lua | 6 | 10720 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function gadget:GetInfo()
return {
name = "Boolean Disable",
desc = "Handles disables which act in a boolean way (similar to engine defau... | gpl-2.0 |
Anarchid/Zero-K | LuaRules/Gadgets/CAI/UnitClusterHandler.lua | 8 | 5498 | --[[ Determines the cluster structure of a list of units.
== CreateUnitList(losCheckAllyTeamID, clusterRadius)
losCheckAllyTeamID is for the underlying UnitList.
clusterRadius is how close two units need to be to be within the
same cluster. Close units may be in different clusters depending
on how the boundari... | gpl-2.0 |
LuaDist2/luacv | samples/drawing.lua | 3 | 3856 | #!/usr/bin/env lua
cv=require('luacv')
local NUMBER=100
local DELAY=5
local wndname="Drawing Demo"
function random_color(rng)
return cv.CV_RGB(cv.RandInt(rng)%255,cv.RandInt(rng)%255,cv.RandInt(rng)%255);
end
local line_type = cv.CV_AA
local angle;
local width=1000
local height=700
local width3 = width*3
local hei... | lgpl-3.0 |
Whit3Tig3R/bestspammbot2 | plugins/anti-flood.lua | 281 | 2422 | local NUM_MSG_MAX = 5 -- Max number of messages per TIME_CHECK seconds
local TIME_CHECK = 5
local function kick_user(user_id, chat_id)
local chat = 'chat#id'..chat_id
local user = 'user#id'..user_id
chat_del_user(chat, user, function (data, success, result)
if success ~= 1 then
local text = 'I can\'t k... | gpl-2.0 |
hacklex/OpenRA | mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua | 13 | 2708 | Civs = { civ1, civ2, civ3, civ4 }
Village = { civ1, civ3, civ4, village1, village3 }
Guards = { Guard1, Guard2, Guard3 }
SovietMCV = { "mcv" }
InfantryReinfGreece = { "e1", "e1", "e1", "e1", "e1" }
Avengers = { "jeep", "1tnk", "2tnk", "2tnk", "1tnk" }
Patrol1Group = { "jeep", "jeep", "2tnk", "2tnk" }
Patrol2Group = { "... | gpl-3.0 |
mohammad4569/matrix | plugins/danbooru.lua | 616 | 1750 | 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 |
Anarchid/Zero-K | LuaRules/Configs/StartBoxes/Lonely Oasis v1.lua | 19 | 5097 | local boxes = {
[0] = {
boxes = {
{
{5486, 2151},
{5537, 2426},
{5583, 2551},
{5648, 2630},
{5748, 2676},
{5924, 2680},
{6078, 2669},
{6165, 2687},
{6272, 2746},
{6420, 2777},
{6541, 2769},
{6668, 2694},
{6734, 2594},
{6765, 2447},
{6757, 2289},
{671... | gpl-2.0 |
haste/oUF | elements/raidtargetindicator.lua | 10 | 2510 | --[[
# Element: Raid Target Indicator
Handles the visibility and updating of an indicator based on the unit's raid target assignment.
## Widget
RaidTargetIndicator - A `Texture` used to display the raid target icon.
## Notes
A default texture will be applied if the widget is a Texture and doesn't have a texture se... | mit |
jerizm/kong | spec/03-plugins/001-tcp-log/01-tcp-log_spec.lua | 3 | 2437 | local cjson = require "cjson"
local helpers = require "spec.helpers"
local TCP_PORT = 35000
local HTTP_DELAY_PORT = 35003
describe("Plugin: tcp-log (log)", function()
local client
setup(function()
assert(helpers.start_kong())
client = helpers.proxy_client()
local api1 = assert(helpers.dao.apis:inser... | apache-2.0 |
chukong/sdkbox-facebook-sample-v2 | tools/tolua++/basic.lua | 5 | 8706 | -- usage: (use instead of ant)
-- tolua++ "-L" "basic.lua" "-o" "../../scripting/lua/cocos2dx_support/LuaCocos2d.cpp" "Cocos2d.pkg"
_is_functions = _is_functions or {}
_to_functions = _to_functions or {}
_push_functions = _push_functions or {}
local CCObjectTypes = {
"CCObject",
"CCAction",
"CCImage",
... | mit |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/corroach.lua | 1 | 2374 | return {
corroach = {
acceleration = 0.11999999731779,
activatewhenbuilt = true,
brakerate = 0.15000000596046,
buildcostenergy = 5471,
buildcostmetal = 65,
buildpic = "CORROACH.DDS",
buildtime = 7899,
canmove = true,
category = "KBOT MOBILE WEAPON ALL NOTSUB NOTSHIP NOTAIR NOTHOVER SURFACE",
descri... | gpl-2.0 |
halolpd/vlc | share/lua/modules/simplexml.lua | 103 | 3732 | --[==========================================================================[
simplexml.lua: Lua simple xml parser wrapper
--[==========================================================================[
Copyright (C) 2010 Antoine Cellerier
$Id$
Authors: Antoine Cellerier <dionoea at videolan dot org>
This progra... | gpl-2.0 |
ivendrov/nn | SpatialFullConvolution.lua | 42 | 1589 | local SpatialFullConvolution, parent = torch.class('nn.SpatialFullConvolution','nn.Module')
function SpatialFullConvolution:__init(nInputPlane, nOutputPlane, kW, kH, dW, dH)
parent.__init(self)
dW = dW or 1
dH = dH or 1
self.nInputPlane = nInputPlane
self.nOutputPlane = nOutputPlane
self.kW = kW
... | bsd-3-clause |
ggcrunchy/Old-Love2D-Demo | Scripts/Game/Game.lua | 1 | 3400 | -- Standard library imports --
local wrap = coroutine.wrap
-- Imports --
local ApplyScissorState = graphics.ApplyScissorState
local GetEventStream = section.GetEventStream
local KeyPressed = keylogic.KeyPressed
local KeyReleased = keylogic.KeyReleased
local SectionGroup = windows.SectionGroup
local WithBoundGroups = w... | mit |
TabindaAshraf/google-diff-match-patch | lua/diff_match_patch.lua | 265 | 73869 | --[[
* 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 in compliance ... | apache-2.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/armuwadvms.lua | 1 | 2260 | return {
armuwadvms = {
buildangle = 5049,
buildcostenergy = 10493,
buildcostmetal = 705,
buildinggrounddecaldecayspeed = 30,
buildinggrounddecalsizex = 6,
buildinggrounddecalsizey = 6,
buildinggrounddecaltype = "armuwadvms_aoplane.dds",
buildpic = "ARMUWADVMS.DDS",
buildtime = 20391,
category = "A... | gpl-2.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/armfmkr.lua | 1 | 1101 | return {
armfmkr = {
acceleration = 0,
activatewhenbuilt = true,
brakerate = 0,
buildangle = 8192,
buildcostenergy = 2480,
buildcostmetal = 1,
buildpic = "ARMFMKR.DDS",
buildtime = 2958,
category = "ALL NOTLAND NOTSUB NOWEAPON NOTSHIP NOTAIR NOTHOVER SURFACE",
description = "Converts up to 60 energ... | gpl-2.0 |
electric-cloud/metakit | lua/util.lua | 1 | 7380 | -- utility code, included in other scripts
-- 01/02/2001 jcw@equi4.com
-- dump data, adapted from lua/test/save.lua
function savevar (n,v)
if v == nil then return end
if type(v)=="userdata" or type(v)=="function" then return end
-- if type(v)=="userdata" or type(v)=="function" then write("\t-- ") end
write(n,"=")
... | mit |
MinaciousGrace/Til-Death | BGAnimations/ScreenSelectMusic decorations/simfile.lua | 2 | 12140 | local update = false
local t = Def.ActorFrame{
BeginCommand=cmd(queuecommand,"Set";visible,false);
OffCommand=cmd(bouncebegin,0.2;xy,-500,0;diffusealpha,0;); -- visible(false) doesn't seem to work with sleep
OnCommand=cmd(bouncebegin,0.2;xy,0,0;diffusealpha,1;);
SetCommand=function(self)
self:finishtweening()
i... | mit |
jerizm/kong | kong/plugins/basic-auth/api.lua | 4 | 1897 | local crud = require "kong.api.crud_helpers"
local utils = require "kong.tools.utils"
return {
["/consumers/:username_or_id/basic-auth/"] = {
before = function(self, dao_factory, helpers)
crud.find_consumer_by_username_or_id(self, dao_factory, helpers)
self.params.consumer_id = self.consumer.id
e... | apache-2.0 |
Sannis/tarantool | test/app/msgpackffi.test.lua | 8 | 2398 | #!/usr/bin/env tarantool
package.path = "lua/?.lua;"..package.path
local tap = require('tap')
local common = require('serializer_test')
local function is_map(s)
local b = string.byte(string.sub(s, 1, 1))
return b >= 0x80 and b <= 0x8f or b == 0xde or b == 0xdf
end
local function is_array(s)
local b = st... | bsd-2-clause |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/luarules/gadgets/lups_shockwaves.lua | 1 | 2323 |
function gadget:GetInfo()
return {
name = "Shockwaves",
desc = "",
author = "jK",
date = "Jan. 2008",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = true
}
end
if (gadgetHandler:IsSyncedCode()) then
local SHOCK_WEAPONS = {
["armcom_arm_disinteg... | gpl-2.0 |
PichotM/DarkRP | gamemode/modules/f4menu/cl_categories.lua | 5 | 3378 | --[[---------------------------------------------------------------------------
Category header
---------------------------------------------------------------------------]]
local PANEL = {}
function PANEL:Init()
self:SetContentAlignment(4)
self:SetTextInset(5, 0)
self:SetFont("DarkRPHUD2")
end
function P... | mit |
ggcrunchy/Old-Love2D-Demo | Scripts/Class/UI/Widget/ArrayView/Listbox.lua | 1 | 4453 | -- See TacoShell Copyright Notice in main folder of distribution
-- Standard library imports --
local assert = assert
local ipairs = ipairs
local max = math.max
local min = math.min
-- Imports --
local DrawString = widgetops.DrawString
local Find = table_ex.Find
local New = class.New
local PointInBox = numericops.Poi... | mit |
Anarchid/Zero-K | LuaUI/Widgets/dbg_widget_profiler_new.lua | 6 | 14208 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "Widget Profiler New",
desc = "Profiles widgets' performance cost",
author = "jK, Bluestone",
vers... | gpl-2.0 |
LightenPan/skynet-yule | lualib/sharemap.lua | 78 | 1496 | local stm = require "stm"
local sprotoloader = require "sprotoloader"
local sproto = require "sproto"
local setmetatable = setmetatable
local sharemap = {}
function sharemap.register(protofile)
-- use global slot 0 for type define
sprotoloader.register(protofile, 0)
end
local sprotoobj
local function loadsp()
if ... | mit |
lxl1140989/dmsdk | feeds/luci/modules/base/luasrc/ccache.lua | 82 | 1863 | --[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
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
ht... | gpl-2.0 |
TheBuzzSaw/Nullocity | project/Lua/main.lua | 1 | 6898 | local gr = Nullocity.GetRandom
entitiesByHandle = {}
cameraEntity = nil
function FixPosition(entity)
local px, py = entity.GetPosition()
local vx, vy = entity.GetVelocity()
local radius = entity.GetRadius()
local changed = false
local n = 16
local high = px + radius
... | unlicense |
Anarchid/Zero-K | effects/gundam_330rlexplode.lua | 6 | 5722 | -- 330rlexplode
-- 165rlexplode
local baseExplode = {
dirt = {
count = 4,
ground = true,
properties = {
alphafalloff = 2,
color = [[0.2, 0.1, 0.05]],
pos = [[r-10 r10, 0, r-10 r10]],
size = 22,
speed ... | gpl-2.0 |
bugobliterator/ardupilot | libraries/AP_Scripting/examples/plane-wind-failsafe.lua | 26 | 1195 | -- warn the user if wind speed exceeds a threshold, failsafe if a second threshold is exceeded
-- note that this script is only intended to be run on ArduPlane
-- tuning parameters
local warn_speed = 10 -- metres/second
local failsafe_speed = 15 -- metres/second
local warning_interval_ms = uint32_t(15000) -- send use... | gpl-3.0 |
Anarchid/Zero-K | units/gunshipassault.lua | 5 | 3945 | return { gunshipassault = {
unitname = [[gunshipassault]],
name = [[Revenant]],
description = [[Heavy Raider/Assault Gunship]],
acceleration = 0.15,
brakeRate = 0.13,
buildCostMetal = 850,
builder = false,
buildPic = [[gunshi... | gpl-2.0 |
Bew78LesellB/awesome | tests/examples/wibox/container/arcchart/bg.lua | 6 | 1046 | --DOC_HIDE_ALL
local parent = ...
local wibox = require( "wibox" )
local beautiful = require( "beautiful" )
local l = wibox.layout.fixed.horizontal()
l.spacing = 10
parent:add(l)
for _, v in ipairs {"", "#00ff00", "#0000ff"} do
l:add(wibox.widget {
{
text = v~="" and v or "nil... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.