content stringlengths 5 1.05M |
|---|
--[[
The last enhancement to our toolbox requires a change in how we declare event handlers.
The problem today is that we can only define one handler for each event type. This is because we use the event type as a key in the EVENT table that holds our handlers - and a Lua table must have unique keys in a key-value tabl... |
local tokenizer = {}
local unicode = require('tools.utils.unicode')
local case = require ('tools.utils.case')
local separators = require('tools.utils.separators')
local alphabet = require('tools.utils.alphabets')
local alphabet_list = {}
for k,_ in pairs(alphabet.ranges) do
table.insert(alphabet_list, k)
end
local... |
function Spawn( entityKeyValues )
dragonsunstrike = thisEntity:FindAbilityByName("dragon_sun_strike")
dragonfireball = thisEntity:FindAbilityByName("frostivus_fireball")
thisEntity:SetContextThink( "DragonThink", DragonThink , 0.1)
print("Starting AI for "..thisEntity:GetUnitName().." "..thisEntity:GetEntit... |
local t = am.current_time()
local
function time(msg)
local t0 = t
t = am.current_time()
print(string.format("%0.3fs [%0.3fs]: %s", t - t0, t, msg))
end
local m = 100
local n = 1000000
local tn = {}
local tn2 = {}
local tn3 = {}
local tn4 = {}
local tv2 = {}
local tv3 = {}
local tv4 = {}
for i = 1, n do
... |
--[[
Copyright (c) 2012 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 the rights
to use, copy, modify, merge, publish, distribu... |
return {'yvette','yves','yvet','yves','yvets','yvettes'} |
local RD = {}
local status = false
--[[
The Constructor for this Custom Addon Class
]]
function RD.__Construct()
status = true
return true, "No Implementation yet"
end
--[[
The Destructor for this Custom Addon Class
]]
function RD.__Destruct()
return false, "Can't disable"
end
--[[
Get the required Addons fo... |
--
-- External Clipboard Manager (CLIPBOARD segment as primary)
-- artificially restricted to one active clipboard manager.
--
local cm = nil;
local function clipboard_event(ctx, msg, source)
if (not cm or source == cm) then
return;
end
if (msg and string.len(msg) > 0 and
valid_vid(cm, TYPE_FRAMESERVER)) then
... |
require('jonz94')
|
return {
{
desc = "先锋部队与敌方相撞时,敌方受到伤害提高50.0%,我方受到伤害降低20.0%",
addition = {
"50.0%(+5.5%)",
"20.0%(+1.1%)"
}
},
{
desc = "先锋部队与敌方相撞时,敌方受到伤害提高55.5%,我方受到伤害降低21.1%",
addition = {
"55.5%(+5.5%)",
"21.1%(+1.1%)"
}
},
{
desc = "先锋部队与敌方相撞时,敌方受到伤害提高61.0%,我方受到伤害降低22.2%",
addition = {
"61.0%(+5.5... |
--------------------------------------------------------------------------
-- This class is responsible for taking column data and produce left or
-- right justified columns. The interface is:
--
-- local bt = BeautifulTbl:new{tbl = a,
-- column = TermWidth() - 1,
-- ... |
return {
talon_fort = {
buildangle = 0,
buildcostenergy = 750,
buildcostmetal = 45,
builder = false,
buildinggrounddecaldecayspeed = 30,
buildinggrounddecalsizex = 4,
buildinggrounddecalsizey = 4,
buildinggrounddecaltype = "armfort_aoplane.dds",
buildpic = "talon_fort.dds",
buildtime = 1... |
--- TLinkedList; double linked
local TLinkedList = {}
function TLinkedList.create()
--the head and tail will be always present and don't store data obj
local head =
{ refList = nil,
prevNode = nil,
nextNode = nil,
obj = nil }
local tail = ... |
--ガーディアン・バオウ
function c735448660.initial_effect(c)
--sum limit
--local e1=Effect.CreateEffect(c)
--e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
--e1:SetType(EFFECT_TYPE_SINGLE)
--e1:SetCode(EFFECT_CANNOT_SUMMON)
--e1:SetCondition(c735448660.sumlimit)
--c:RegisterEffect(e1)
--local e2=e1:Clo... |
local HAS_RUNNER = not not lunit
local lunit = require "lunit"
local TEST_CASE = assert(lunit.TEST_CASE)
local skip = lunit.skip or function() end
local zmq = require "lzmq"
local ztimer = require "lzmq.timer"
local zmonitor = require "lzmq.monitor"
local _ENV = TEST_CASE "lzmq.monitor" do
l... |
local mkstr = ZO_CreateStringId
local SI = FishMe.SI
-- Bait Type
mkstr(SI.GUTS, "Boyaux")
mkstr(SI.INSECTS, "Morceaux D'insectes")
mkstr(SI.WORMS, "Vers")
mkstr(SI.MINNOW, "Méné")
mkstr(SI.FISHROE, "Oeufs de Poisson")
mkstr(SI.CHUB, ... |
if (SERVER) then
AddCSLuaFile("shared.lua")
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true
SWEP.IconLetter = "I"
end
if (CLIENT) then
SWEP.DrawAmmo = true
SWEP.ViewModelFOV = 80
SWEP.ViewModelFlip = true
SWEP.CSMuzzleFlashes = false
SWEP.PrintName = "Hand-cuffs"
SWEP.Author = "Noobulater"... |
--- Assorted utilities for managing tables, plus a scheduler for rollback functions.
-- Does not requires modules directly (only as locals
-- inside specific functions) to avoid interdependencies,
-- as this is used in the bootstrapping stage of luarocks.core.cfg.
local util = {}
local core = require("luarocks.core.... |
function XLoot:ApplySkinTweaks()
XLoot:RegisterMasqueTweak('simpleSquare', { size = 12, row_spacing = 4 })
XLoot:RegisterMasqueTweak('Caith', { size = 12, row_spacing = 4 })
XLoot:RegisterMasqueTweak('Svelte Shadow', { size = 14 })
XLoot:RegisterMasqueTweak('Square Shadow', { size = 16 })
XLoot:RegisterMasqueTweak... |
ITEM.name = "Crude Heavy Pistol Ammunition"
ITEM.model = "models/kek1ch/ammo.mdl"
ITEM.ammo = "tfa_ammo_pistol"-- type of the ammo
ITEM.ammoAmount = 20 -- amount of the ammo
ITEM.description = "A Box that contains %s of Crude Pistol Ammo"
ITEM.chance = 37 |
PLUGIN.name = "Dexterity"
PLUGIN.author = "Zadkiel"
PLUGIN.desc = "Increases jump height, and reflexes"
if (SERVER) then
function PLUGIN:EntityTakeDamage(client, dmg)
if (client:IsPlayer()) then
if (dmg:IsDamageType(DMG_FALL)) then return end
local uniqueID = client:SteamID()
local value = (client:getCha... |
function Main()
local t = {}
A(t,0)
end
function A(t,n)
if n == 51 then return end
if t[n] or n > 15 then
B(t[n])
end
A(t,n+1)
end
function B(j)
j.x = 50
j.y = 50
end
Main() |
describe("Reducing", function()
local fun = require 'ltrie.fun'
local T = {}
local function reset()
T = {}
end
local function p(...)
T[#T+1] = {...}
end
local function check(t)
assert.are.same(T, t)
end
it("foldl", function()
assert.is.equal(15, fun.foldl(function(acc, x)
return acc + x
end, 0, ... |
data:extend(
{
{
type = "recipe",
name = "underground-station",
enabled = false,
ingredients =
{
{"iron-plate", 2}
},
result = "underground-station"
},
{
type = "recipe",
name = "underground-gateway",
enabled = false... |
print("HoboDoor v1 loaded.")
local oldConCommandAdd = concommand.Add
function concommand.Add(name,callback,autoComplete,helpText,flags)
print(name.." "..callback)
return oldConCommandAdd(name,callback,autoComplete,helpText,flags)
end
local oldConCommandRun = concommand.Run
function concommand.Run(Player,cmd,arg... |
object_tangible_loot_beast_dna_container = object_tangible_loot_beast_shared_dna_container:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_beast_dna_container, "object/tangible/loot/beast/dna_container.iff")
|
local modn = minetest.get_current_modname()
local sl = 69 -- Sea-surface-level
mapgen_params = {water_level = sl}
minetest.set_mapgen_params(mapgen_params)
--minetest.set_mapgen_setting("littoral_mapgen_limit", 300, true)
------------------------------------------
-- MAPGEN LAYER DEFAULTS
------------------------------... |
return {'tip','tipgeefster','tipgeld','tipgever','tipi','tiplijn','tipmuts','tipparade','tippel','tippelaar','tippelaarster','tippelcircuit','tippelen','tippelplaats','tippelplaatsen','tippelprostitutie','tippelverbod','tippelzone','tippen','tips','tipsy','tiptoets','tiptop','tippe','tipker','tipgevers','tipis','tipmut... |
require('key.mapping')
|
class("FetchCommanderTalentCommand", pm.SimpleCommand).execute = function (slot0, slot1)
if not getProxy(CommanderProxy):getCommanderById(slot1:getBody().id) then
return
end
pg.ConnectionMgr.GetInstance():Send(25010, {
commanderid = slot3
}, 25011, function (slot0)
if slot0.result == 0 then
slot1 = {}
... |
-- =======================
-- BUBBLY.NVIM PATH BUBBLE
-- =======================
-- Created by: datwaft [github.com/datwaft]
local bubble_factory = require'bubbly.factories.bubble'
return function(inactive)
return bubble_factory{
inactive or {
data = vim.bo.ro and vim.g.bubbly_symbols.path.readonly,... |
-- ... init.lua
require("bufferline").setup({
options = {
show_buffer_close_icons = false,
show_close_icon = false,
enforce_regular_tabs = true,
-- prefix used when a buffer is deduplicated
-- max_prefix_length = 30,
tab_size = 25,
},
})
|
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
configs.erlangls = {
default_config = {
cmd = { 'erlang_ls' },
filetypes = { 'erlang' },
root_dir = util.root_pattern('rebar.config', 'erlang.mk', '.git'),
single_file_support = true,
},
docs = {
description = [... |
local groups = {NvimTreeWindowPicker = {bg = "#121212", fg = "#959595", bold = true}}
local function init()
return (require("sopa")).hi_groups(groups)
end
return {groups = groups, init = init}
|
local name, sm = ...;
local debug = false;
--------------------------------------------------
--- Addon Specific Options
--------------------------------------------------
local normal, riding = "normal", "riding";
local function PerformItemChanges(input)
local count = 0;
local items;
local gloves = { nil, 10 ... |
--***********************************************************
--** ROBERT JOHNSON **
--***********************************************************
require "TimedActions/ISBaseTimedAction"
ISBarricadeActionNEW = ISBaseTimedAction:derive("ISBarricadeActionNEW");
function ISBarric... |
-- half of screen
hs.hotkey.bind({'alt', 'cmd'}, 'left', function() hs.window.focusedWindow():moveToUnit({0, 0, 0.5, 1}) end)
hs.hotkey.bind({'alt', 'cmd'}, 'right', function() hs.window.focusedWindow():moveToUnit({0.5, 0, 0.5, 1}) end)
hs.hotkey.bind({'alt', 'cmd'}, 'up', function() hs.window.focusedWindow():moveToUni... |
function onCreate()
-- background shit
makeLuaSprite('vickystage', 'vickystage', -600, -300);
setScrollFactor('vickystage', 0.9, 0.9);
makeAnimatedLuaSprite('sexualintercourse', 'sprites/pibby', 920, 285);
scaleObject('sexualintercourse', 0.9, 0.9);
addAnimationByPrefix('sexualintercourse', 'first', 'pibby', 1... |
#!/usr/bin/env lua
-- -*- lua -*-
-- Copyright 2012 Appwill Inc.
-- Author : KDr2
--
--
-- 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
-... |
local function build_target(tgt, cfg)
return {"target", tgt, cfg}
end
local function tgt_helper(state, intgt)
return list_targets()
end
local function cfg_helper(state, incfg)
-- interesting, need to populate eval_scope with tgt_helper
-- in order for this one to list_configurations
return {}
end
return function(... |
local strings = require "plenary.strings"
local Border = {}
Border.__index = Border
Border._default_thickness = {
top = 1,
right = 1,
bot = 1,
left = 1,
}
local calc_left_start = function(title_pos, title_len, total_width)
if string.find(title_pos, "W") then
return 0
elseif string.find(title_pos, "E... |
--
--------------------------------------------------------------------------------
-- FILE: type_checkers.lua
-- DESCRIPTION: protoc-gen-lua
-- Google's Protocol Buffers project, ported to lua.
-- https://code.google.com/p/protoc-gen-lua/
--
-- Copyright (c) 2010 , 林卓毅 (Zhuoyi Lin) netsnail@gmail.co... |
-- Basic Wi-Fi settings for Nodemcu
print("Starting Wi-Fi configuration")
--connect to Access Point (DO NOT save config to flash)
station_cfg={}
station_cfg.ssid=system.wifi.ssid
station_cfg.pwd=system.wifi.pwd
station_cfg.save=false
wifi.sta.config(station_cfg)
--compact version
wifi.setcountry({country="DK", start... |
describe("add", function()
local icu_date = require "icu-date-ffi"
local fields = icu_date.fields
local date = icu_date.new()
local format = icu_date.formats.iso8601()
before_each(function()
date:set_millis(1507836727123)
assert.equal("2017-10-12T19:32:07.123Z", date:format(format))
end)
it("add... |
--------------------------------
-- @module ProtocolShare
-- @extend PluginProtocol
-- @parent_module plugin
--------------------------------
-- brief share result callback
-- @function [parent=#ProtocolShare] onShareResult
-- @param self
-- @param #int ret
-- @param #char msg
------------------------------... |
Module = classes.class()
local id = 0
local function isEmpty(value)
return value == nil or #value == 0
end
local function isNotType(aParam, aType)
return type(aParam) ~= aType
end
local function checkParam(aParam, aType)
if isEmpty(aParam) then
error("Required parameter is nil or does not exist!... |
local mark = require'marks.mark'
local bookmark = require'marks.bookmark'
local utils = require'marks.utils'
local M = {}
function M.set()
local err, input = pcall(function()
return string.char(vim.fn.getchar())
end)
if not err then
return
end
if utils.is_valid_mark(input) then
M.mark_state:plac... |
local r = require "resources"
local class = require "libs.middleclass"
local flux = require "libs.flux"
local lg = love.graphics
local w = lg.getWidth()
local h = lg.getHeight()
local Achievements = class("Achievements")
function Achievements:initialize(height)
self.height = height or h
self.y = -self.heigh... |
--[[
Copyright (c) 2018, Vsevolod Stakhov <vsevolod@highsecure.ru>
Copyright (c) 2018, Carsten Rosenberg <c.rosenberg@heinlein-support.de>
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:/... |
RegisterServerEvent("blips:takeBlip")
AddEventHandler(
"blips:takeBlip",
function(x, y, z)
print(string.format("[Blips Resource]: updated coords to (x=%s, y=%s, z=%s)", x, y, z))
TriggerClientEvent("blips:setBlip", -1, x, y, z)
-- This will allow us to give the updated coords of the blip... |
local widget = require( "widget" )
local composer = require( "composer" )
local json = require ("json")
local myData = require ("mydata")
local upgrades = require("upgradeName")
local loginScene = composer.newScene()
local openssl = require("plugin.openssl")
local loadsave = require( "loadsave" )
local gpgs = require( ... |
local Count = {}
Count.__index = Count
function Count.new()
return setmetatable({
passed = 0,
failed = 0,
skipped = 0,
errored = 0,
}, Count)
end
function Count.For(list)
return Count.new():Increase(list)
end
function Count:Increase(list)
for _, obj in ipairs(list) do
obj:UpdateCount(self)
end
return se... |
--[[-------------------------------------------------------------------]]--[[
Copyright wiltOS Technologies LLC, 2020
Contact: www.wiltostech.com
----------------------------------------]]--
wOS = wOS or {}
wOS.ALCS = wOS.ALCS or {}
wOS.ALCS.Config = wOS.ALCS.Config or {}
wOS.ALCS.Config.Crafting = wOS.A... |
comments = {}
local function generateCommentItem(c_menu, line, i, line_index)
local time, ip, steam, usgn, id, team, name, comment = string.match(line, "(%d+%-%d+%-%d+ %d+:%d+ [AP]M) %- %[IP: ([%d%.]+)%] %[STEAM: (%d+)%] %[USGN: (%d+)%] %[ID: (%d+)%] %[Team: (%d+)%] %[Name: (.+)%]: ([%w%p ]+)")
local ban... |
local modname = "planter_box"
local modpath = minetest.get_modpath(modname)
planter_box = {}
minetest.register_node(modname..":planter_box", {
description = "Planter Box",
drawtype = "nodebox",
node_box = {
type = "connected",
fixed = {{-3/8, -1/2, -3/8, 3/8, 1/2, 3/8}},
-- connect_bottom =
connect_front... |
local go = GameObject.__new("hello world")
go.transform.position = Vector3.__new(100, 200, 300)
print(go.transform.position) |
--[[
- SKYNET SIMPLE ( https://github.com/viticm/skynet-simple )
- $Id handler.lua
- @link https://github.com/viticm/skynet-simple for the canonical source repository
- @copyright Copyright (c) 2020 viticm( viticm.ti@gmail.com )
- @license
- @user viticm( viticm.ti@gmail.com )
- @date 2020/09/17 17:33
- @uses T... |
local Tunnel = module("_core", "lib/Tunnel")
local Proxy = module("_core", "lib/Proxy")
API = Proxy.getInterface("API")
cAPI = Tunnel.getInterface("API")
dbAPI = Proxy.getInterface("API_DB")
local Orgs = {}
function Orgs.Create(org_name)
local org_id
local rows = dbAPI.query("orgs:insert", {name = name, typ... |
--
-- misc/table.lua
--
-- Utility functions for working with tables.
--
-- TODO: random functions need optional generator argument.
-- TODO: luafun might be a better option for a lot of these.
--
function table.keys( tbl )
local result = {}
for k, _ in pairs(tbl) do
result[#result+1] = k
end
return result
end... |
local export = { }
local metatable = { }
metatable.weakness = { }
metatable.weakness.key = { __mode = 'k' }
metatable.weakness.value = { __mode = 'v' }
metatable.weakness.pair = { __mode = 'kv' }
export.weak = { }
function export.weak.key (struct)
struct = struct or { }
return setmetatable (struct, meta... |
exports = {}
local inventory = {}
local isDisposed = false
function getInventoryContents()
local r = {}
for i = 1, 16 do
r[i] = turtle.getItemDetail(i)
end
return r
end
function listener()
while not isDisposed do
os.pullEvent("turtle_inventory")
inventory = ge... |
include "fs.lua"
include "options.lua"
include "system.lua"
|
local d = require "sl-defines"
local a = require "audio.sl-audio"
require "util" -- for table.deepcopy, util.empty_sprite(animation_length)
-- Be sure to declare functions and vars as 'local' in prototype / data*.lua files,
-- because other mods may have inadvertent access to functions at this step.
-- If another fi... |
list.Set( "clothing_system", "combine_nova_prospekt_vest", {
Name = "Combine nova prospekt vest",
Category = "Vest",
WireModel = "models/combine_vests/prisonvest.mdl",
FoldedModel = "models/combine_vests/prisonvest.mdl",
PlayerBase = "hl2_player",
EquipSound = "clothing_system/cs_equip.wav", -- ... |
local Config = require(script.Parent.Parent.Parent.Config)
local Error = require(script.Parent.Parent.Parent.Error)
local function retry(callback)
local ok, value
for _ = 1, Config.get("retryAttempts") do
ok, value = pcall(callback)
if ok then
return true, value
end
if Config.get("showRetryWarnings") t... |
---------------------------------------------------------------------------------------------------
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/3174
--
-- Description: SDL should stop video streaming and notify HMI if an App is Force Closed
--
-- Pre-conditions:
-- 1. Start SDL, HMI, connect Mobile dev... |
object_tangible_wearables_cape_cape_imperial_01 = object_tangible_wearables_cape_shared_cape_imperial_01:new {
}
ObjectTemplates:addTemplate(object_tangible_wearables_cape_cape_imperial_01, "object/tangible/wearables/cape/cape_imperial_01.iff") |
-- Code created by Kwik - Copyright: kwiksher.com {{year}}
-- Version: {{vers}}
-- Project: {{ProjName}}
--
local _M = {}
local _K = require "Application"
function _M:playRandom(id, actions, playRand, params)
local trigger
-- print("randomAction")
if actions and #actions > 0 then
if playRand then
... |
local xtype, p = prelude.xtype, prelude.p
local __debug__ = _ENV.__debug__
local Data = {}
local RESERVED_FIELDS = {
"id",
"fqid",
"proto_id",
"index",
}
local PROTOTYPES = {}
local INSTANCES = {}
local BY_INTEGER_ID = {}
local BY_INDEX = {}
local function is_namespaced_id(id)
return id:match("^[A-Za... |
Script.Load("lua/LazarusMod/Modules/Alien/Gorge/Tunnels/New/TunnelExit.lua")
local techHandler = LazarusMod:GetModule('techhandler')
techHandler:AddTechData({
[kTechDataId] = kTechId.GorgeTunnelEntrance,
[kTechDataCategory] = kTechId.Gorge,
[kTechDataMaxExtents] = Vector(1.2, 1.2, 1.2),
[kTechDataToolt... |
local lsr = {}
lsr.__index = lsr
function lsr.new(x,y)
local newlsr = {}
setmetatable(newlsr, lsr)
if x then
newlsr.m, newlsr.b, newlsr.mErr, newlsr.bErr = lsr:train(x,y)
end
return newlsr
end
function lsr:train(x,y)
--computes y = mx + b given array X and array Y of equal lengths and returns tupel m, b, mErr... |
object_draft_schematic_food_beastfood_tender_meat_substitute = object_draft_schematic_food_shared_beastfood_tender_meat_substitute:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_food_beastfood_tender_meat_substitute, "object/draft_schematic/food/beastfood_tender_meat_substitute.iff")
|
local Screen = require "widgets/screen"
local Button = require "widgets/button"
local AnimButton = require "widgets/animbutton"
local Menu = require "widgets/menu"
local Text = require "widgets/text"
local Image = require "widgets/image"
local UIAnim = require "widgets/uianim"
local Widget = require "widgets/widget"
lo... |
return (function(self)
return u(self).left + u(self).width
end)(...)
|
--[[
The operation of the dictionary stack is complex enough that
a standalone object is warranted to deal with it.
The dictionary stack deals with things like
Finding a key value in stack order
Adding dictionaries to the stack
removing dictionaries from the stack
Setting a value somewhere... |
return function()
-- Fix global tracker keys to go from player_index to -player_index!
-- We now use positive ints for regular entities and negative ints for players.
for playerIndex, tracker in pairs(global.trackers) do
if playerIndex >= 0 then
log('Migrating tracker from ' .. tost... |
vector = require "hump/vector"
return {
['w'] = function(c, dt) c.acc = c.acc + vector(0, -1 * c.speed * dt) end,
['a'] = function(c, dt) c.acc = c.acc + vector(-1 * c.speed * dt, 0) end,
['s'] = function(c, dt) c.acc = c.acc + vector(0, 1 * c.speed * dt) end,
['d'] = function(c, dt) c.acc = c.acc + vector(1 * c.s... |
-- Copyright (c) 2020-2021 hoob3rt
-- MIT license, see LICENSE for more details.
local Encoding = require('lualine.component'):new()
Encoding.update_status = function() return [[%{strlen(&fenc)?&fenc:&enc}]] end
return Encoding
|
LinkLuaModifier("modifier_avatar_of_vengeance_phase", "heroes/avatar_of_vengeance/avatar_of_vengeance_modifiers.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_avatar_of_vengeance_reality", "heroes/avatar_of_vengeance/avatar_of_vengeance_modifiers.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_avat... |
if not modules then modules = { } end modules ['util-sql'] = {
version = 1.001,
comment = "companion to m-sql.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-- todo: templates as tabl... |
num_enemies = 5
boss_fight = false
experience=330
gold=200
function start()
addEnemy("Husk", 29, 70);
addEnemy("Husk", 29, 90);
addEnemy("Husk", 58, 74);
addEnemy("Husk", 58, 94);
addEnemy("Husk", 87, 84);
end
function get_speech()
return nil
end
function get_item()
local n = getRandomNumbe... |
local util = require("util")
local libnav = require("libnav")
local config_file = "places.cfg"
local libplace = {
}
function libplace.get_cost(name)
local place = util.config_get(config_file, name)
if not place then return nil end
libnav.return_to(place)
return libnav.estimate_and_discard()
end
function lib... |
-- made by Nicko21
local Gamestate = require 'vendor/gamestate'
local Prompt = require 'prompt'
local fonts = require 'fonts'
local sound = require 'vendor/TEsound'
local Cauldron = {}
Cauldron.__index = Cauldron
function Cauldron.new(node, collider)
local cauldron = {}
setmetatable(cauldron, Cauldron)
cauldron... |
--[[
author by soniceryd
Date:2017/02/26
Desc:classic object
]]--
local object = {}
object.__index = object
function object:new()
print("start...")
for k,v in ipairs(self) do
print(k,v)
end
print("end...")
end
return object |
local block = {}
local blocks = game.blocks
block.type =
{
["stone"] =
{
name = "Stone",
id = 1,
image = { 0, 0 }
},
["log"] =
{
name = "Log",
id = 2,
image = { 1, 0 }
},
["planks"] =
{
name = "Wooden Planks",
id = 3,
image = { 0, 1 }
},
["leaves"] =
{
nam... |
ffi = require("ffi");
local xmlua = require("xmlua")
if (#arg < 1) then
error("Usage: xsd <xsd_file_name>");
return nil;
end
local xsd_name = arg[1];
if (#arg > 1) then
error("Usage: xsd <xsd_file_name> <element_name>");
return nil;
end
local xsd = xmlua.XSD.new();
--local schema = xsd:parse("UBL-BusinessCard... |
local class = require("class")
CustomFxNoArgs = class.class()
function CustomFxNoArgs:_init(foo)
end
function CustomFxNoArgs:decode(data)
return "_" .. data .. "_"
end
|
--[[ Copyright (c) 2009 Manuel König
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, ... |
require "scripts/luaclass/state.lua"
require "State"
require "Vector2f"
require "Rectf"
require "Math"
require "Camera"
require "Image"
require "Window"
require "Input"
--Main menu is a class inheriting from the State base class
mainmenu = class(State)
function mainmenu:Init()
print "\n--------Main Menu Init--------... |
print "UNIT_TESTS"
print(package.path)
require "test_quaternion"
require "test_vector"
require "test_customAttribute"
require "test_abstractComponent"
require "test_collisionComponent"
require "test_physicsComponent"
require "test_graphicsComponent"
|
it("Basic test", function()
assert.are_not.equals("hello", "world")
end)
describe("Another group", function()
it("Child test", function()
assert.are_not.is_not.has_not.equals("hello", "world")
end)
end)
pending("Pending test", function()
error("This should not be called")
end)
it("Spy", function()
... |
data:extend(
{
{
type = "fluid",
name = "hydrogen",
default_temperature = 25,
heat_capacity = "1KJ",
base_color = {r=0.7, g=0.7, b=0.7},
flow_color = {r=0.5, g=0.5, b=0.5},
max_temperature = 100,
icon = "__Engineersvsenvironmentalist__/graphics/icons/chemicals/hydrogen.png",
-- pres... |
--author Himanshu Sharma
local Profile ={}
local firstName= ""
local lastName= ""
local sex= ""
local mobile = ""
local line1= ""
local line2= ""
local city= ""
local state= ""
local country= ""
local pincode= ""
local homeLandLine= ""
local officeLandLine= ""
local dateOfBirth = ""
function Profile:new()
o = {}
s... |
local QuestID = 44
local Quest = Quests[QuestID]
Quest.Texts = {
["Accepted"] = "Finde das Bike!",
["Finished"] = "Kehre zum Biker zur\\ueck!"
}
addEventHandler("onClientCallsServerQuestScript", getRootElement(),
function(ID, Status, Data)
if (ID == QuestID) then
if (Status == "Bike_Clicked") then
Quest... |
-----------------------------------
-- Area: Fort Ghelsba
-- Mob: Orcish Fodder
-- Note: PH for Hundredscar Hajwaj
-----------------------------------
local ID = require("scripts/zones/Fort_Ghelsba/IDs")
require("scripts/globals/mobs")
-----------------------------------
function onMobDeath(mob, player, isKiller)
end... |
local AddonName, AddonTable = ...
AddonTable.deadmines = {
1951,
-- Glubtok
2169,
5444,
5195,
-- Helix Gearbreaker
5200,
5191,
5443,
151062,
151063,
132556,
5199,
-- Foe Reaper 5000
5201,
5187,
1937,
151066,
151064,
151065,
-- Admiral R... |
--[[
Copyright (c) 2014-2018 Kaarle Ritvanen
Copyright (c) 2015-2017 Timo Teräs
See LICENSE file for license details
]]--
local asn1 = require('asn1')
local rfc3779 = require('asn1.rfc3779')
local base = '1.3.6.1.4.1.31536.1.'
local M = {OID_IS_HUB=base..'1', OID_HUB_HOSTS=base..'2'}
local decoders={
['sbgp-autono... |
function onResourceStart( resourcename )
if ( resourcename == getThisResource () ) then
createPickup ( 2514.5061035156, 6305.181640625, 5.0202980041504, 2, 34, 120000, 15 )
createPickup ( 2491.2346191406, 6230.4038085938, 11.139559745789, 2, 29, 60000, 60 )
createPickup ( 2405.9069824219, 6250.0205078125, 20... |
KG_TO_N=9.81
H_MASS_TO_VOL=11.988
DRAG_COEFFICENT=0.26
FRONT_DRAG_AREA=28
BOTTOM_DRAG_AREA=64
GRAVITY=9.8
SEA_LEVEL_AIR_DENSITY=1.225
HYDROGEN_DENSITY=0.08988
WING_LIFT=128
HYDROGEN_LIFT_ADJ=5.95
ENT_DWN_ACC=.1
ENT_DWN_TRM_V=2
ENT_DRG=.3
SHIP_STRT_SPD=80
SHIP_MAX_SPD=300
SHIP_MAX_VSI=2
SHIP_MAX_ALT=10000
SHIP_DRY_WEIG... |
--[[
Revolute Joint
转动关节
相连的两个物体会绕着锚点旋转
概念:
limit 可以限制 joint 的转动角度,lower limit 和 uppper limit 之间必须包含 0
motor torque 电机扭矩,一般来说功率恒定情况下,扭矩越大,转速越小。定义了扭矩和速度,就相当于定义了功率。
motor speed
给 joint 施加一个微小的扭矩和速度 0 ,可以模拟 joint 的摩擦力。
使用的角度单位为弧度
方法:
get/setLimits
has/setLimitsEnabled
is/setMotorEnabled
get/setLowerLimit
get/setUpperL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.