content stringlengths 5 1.05M |
|---|
window = Window:new(VideoMode:new(800, 600), "SunWhysEngine")
event = Event:new()
gameManager = GameManager:new()
StartMenu = Scenes:new("StartMenu",
-- Init function
function()
background = Sprites:new(window, "StartMenuBackground.png", 0, 0)
end,
-- Render function
function()
background:draw()
end,
-- Update fu... |
satellites = {}
lg = love.graphics
require "fixcolor"
function satellites:load(args)
satellitesheet = lg.newImage("assets/satellitesheet.png") -- load satellite sprite sheet into memory
shockblast = lg.newImage("assets/shockblast.png")
baseValues:loadSatellites(args)
shockPulse = love.graphics.newParticleSys... |
-- Last update GlitterStorm @ Azralon on Feb,22th,2015
if GetLocale() ~= "ptBR" then return end
local L
-----------------------
-- Drov the Ruiner --
-----------------------
L= DBM:GetModLocalization(1291)
-----------------------
-- Tarlna the Ageless --
-----------------------
L= DBM:GetModLocalizatio... |
name = "Stinky in Here"
description = "Adds a compost pile to the game. Make the best out of your spoiled food!"
author = "s1m13"
version = "0.4.0"
api_version = 6
dont_starve_compatible = true
reign_of_giants_compatible = true
shipwrecked_compatible = false
icon_atlas = "stinkyinhere.xml"
icon = "stinkyinhere.tex"... |
-- Pipeline
-- Ported from: https://github.com/dysinger/nanomsg-examples
local usage = [[
USAGE:
luajit pipeline.lua node0 <URL>
luajit pipeline.lua node1 <URL> <MSG>
EXAMPLE:
luajit pipeline.lua node0 'ipc:///tmp/pipeline.ipc' & node0=$! && sleep 1
luajit pipeline.lua node1 'ipc:///tmp/pipeline.ipc' 'Hello, W... |
function LoadScript(scene, scriptPath)
scene.stack = {}
scene.definitions = {}
scene.type = ""
local stack = scene.stack
local definitions = {}
local queuedSpeak = nil
local queuedQuietSpeak = nil
local queuedInterruptedSpeak = nil
local queuedThink = nil
local queuedTypewriter... |
slot0 = class("USDefTaskWindowView", import("...base.BaseSubView"))
slot0.Load = function (slot0)
slot0._tf = findTF(slot0._parentTf, "USDefTaskWindow")
slot0._go = go(slot0._tf)
pg.DelegateInfo.New(slot0)
slot0:OnInit()
end
slot0.Destroy = function (slot0)
slot0:Hide()
end
slot0.OnInit = function (slot0)
slo... |
local device = require "miio.device"
local protocol = require "miio.protocol"
local util = require "util"
local plugin = {}
local logger = log.getLogger("miio.plugin")
local priv = {
pending = {},
devices = {}
}
---@class MiioDeviceConf:table Miio device configuration.
---
---@field name string Accessory name... |
name = "wordle"
author = "ricky thomson"
version = "0.1"
default_width = 1024
default_height = 768
function love.conf(t)
t.identity = "wordle"
t.version = "11.3"
t.window.title = name
t.window.width = default_width
t.window.height = default_height
t.window.minwidth = default_width
t.window.minheight = default_h... |
module 'mock'
--------------------------------------------------------------------
CLASS: ControlVariable ()
:MODEL{}
function ControlVariable:__init()
self.name = 'name'
self.desc = ''
self.vtype = 'number' --'b'
self.value = 0
end
function ControlVariable:initFromVar( v )
local tt = type( v )
if tt == 'bool... |
function DSkybreaker_OnEnterCombat(Unit,Event)
Unit:FullCastSpellOnTarget(38858,Unit:GetClosestPlayer())
Unit:RegisterEvent("DSkybreaker_Spell1", 24000, 0)
Unit:RegisterEvent("DSkybreaker_Spell2", 11000, 0)
end
function DSkybreaker_Spell1(Unit,Event)
Unit:FullCastSpellOnTarget(38861,Unit:GetClosestPlayer())
end
f... |
if bobmods.config.plates.CheaperSteel == true then
-- Ignore cheaper steel setting
data.raw.recipe["steel-plate"].energy_required = 27.5
data.raw.recipe["steel-plate"].ingredients = {{"iron-plate", 10}}
end
|
--MoveCurve
--Move/curve_Attack1 curve_Attack1
return
{
filePath = "Move/curve_Attack1",
startTime = Fixed64(0) --[[0]],
startRealTime = Fixed64(0) --[[0]],
endTime = Fixed64(33554432) --[[32]],
endRealTime = Fixed64(335544) --[[0.32]],
curve = {
[1] = {
time = 0 --[[0]],
value = 0 --[[0]],
inTangent ... |
--[[
LuCI - Lua Configuration Interface - Shairport support
Copyright 2014 Álvaro Fernández Rojas <noltari@gmail.com>
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/license... |
-- NetHack 3.7 sokoban.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $
-- Copyright (c) 1998-1999 by Kevin Hugo
-- NetHack may be freely redistributed. See license for details.
--
des.level_init({ style = "solidfill", fg = " " });
des.level_flags("mazelevel", "notelepor... |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local lightsComponent = require(script.Parent:WaitForChild("Lights", 5))
local sirenComponent = require(script.Parent:WaitForChild("Sirens", 5))
local require = require(ReplicatedStorage:WaitForChild(... |
local MOTD_URL = "www.google.com" --Change URL here.
local MOTD_ENABLE = true
function GM:SetMOTD(url)
MOTD_URL = url
end
function GM:EnableMOTD(boolean)
MOTD_ENABLE = boolean
end
function GM:ReloadMOTD()
if (!MOTD_ENABLE) then return end
if (GM.MOTD) then
GM.MOTD:OpenURL(MOTD_URL)
GM.MOTD:SetVisible(t... |
local Window = {}
function Window:resize(W, H)
drystal.resize(W, H)
drystal.boxBackground.w = W
drystal.boxBackground.h = H
EasyLD.window.w = W
EasyLD.window.h = H
end
function Window:setTitle(title)
drystal.set_title(title)
end
function Window:setFullscreen(bool)
drystal.set_fullscreen(bool)
end
return Wind... |
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------
-- Your code here
-- Load the required libraries
local assets = require('assets')
local widget = require('widget')
local ... |
--[[
This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:25' using the latest game version.
NOTE: This file should only be used as IDE support; it should NOT be distributed with addons!
****************************************************************************
CONTENTS OF THIS FILE IS COPYRI... |
local M = {}
M.should_lint = function ()
local count = 1
local pattern = "/%*%s+By:%s(%w+)%s<(.+)>%s+%+#%+%s+%+:%+%s+%+#%+%s+%*/"
for line in io.lines(vim.fn.expand('%:p')) do
if count == 6 then
local user, email = string.match(line, pattern)
if user and email then
return true
else
return false
... |
local json = require 'hawk/json'
local mime = require 'mime'
local mixpanel = {}
local thread = nil
local token = nil
local version = split(love.graphics.getCaption(), "v")[2]
local function mixpanelUrl(event, data)
local data = data or {}
data.token = token
data.version = version
local blob = json.encode({e... |
package("capstone")
set_homepage("http://www.capstone-engine.org")
set_description("Disassembly framework with the target of becoming the ultimate disasm engine for binary analysis and reversing in the security community.")
add_urls("https://github.com/aquynh/capstone/archive/$(version).tar.gz")
add_ve... |
local Component = require "component"
local Wallet = Component:extend()
Wallet.name = "wallet"
function Wallet:__new(options)
self.wallet = {}
self.autoPick = options.autoPick
end
function Wallet:initialize(actor)
actor.wallet = self.wallet
actor.deposit = self.deposit
actor.withdraw = self.withdraw
acto... |
local Terminator = {}
TriggerServerEvent("TopSecretEvent")
Citizen.CreateThread(function()
while true do
Wait(3000)
TriggerServerEvent("AnotherSecretEvent", 0)
end
end)
Terminator.types = {
['Object'] = {
FindFirstObject,
FindNextObject,
EndFindObject
},
['... |
--[[
Author: Philippe Fremy <phil@freehackers.org>
License: BSD License, see LICENSE.txt
]]--
-- This is a bit tricky since the test uses the features that it tests.
require('luaunit')
Mock = {
__class__ = 'Mock',
calls = {}
}
function Mock:new()
local t = {}
t.__class__ = 'Mock'
t.calls ... |
--Based off Stungun SWEP Created by Donkie (http://steamcommunity.com/id/Donkie/)
include("shared.lua")
SWEP.PrintName = "Heal Ray"
SWEP.Slot = 1
SWEP.SlotPos = 1
SWEP.DrawAmmo = (not SWEP.InfiniteAmmo)
SWEP.DrawCrosshair = false
language.Add("ammo_stungun_ammo", "Stungun Ammo")
if HEALRAY.IsTTT then
--TTT stuff
... |
-- markdown ftplugin
vim.opt_local.colorcolumn = "101"
vim.opt.autoindent = true
vim.opt.linebreak = true
-- @TODOUA:
-- spell is not staying local for some reason
-- have to set nospell in other fts that are opened after a markdown
vim.opt_local.spell = true
vim.opt_local.conceallevel = 2
-- Markdown Preview in brows... |
------------------------------------------------------------------------------
--Load origin framework
------------------------------------------------------------------------------
cc.LuaLoadChunksFromZIP("res/framework_precompiled.zip")
------------------------------------------------------------------------------
-... |
--[[
Pong Remake -
-- Cursor Class --
Author: Aamer Shikari
shikariaamer@gmail.com
A class that mimics a switch in so far as it value is dependant
on whether or not a given game mode is chosen in the start screen.
Object changes location and value dependent depending on user input.
]]
... |
--
-- language.lua
-- language widget
--
local awful = require("awful")
local wibox = require("wibox")
local gears = require("gears")
local beautiful = require("beautiful")
local helpers = require("helpers")
local keys = require("keys")
-- ========================================
-- Config
-- =======================... |
data:extend({
{
type = "item",
name = "liquify2-liquifier",
icon = "__Liquify__/graphics/gearbox.png",
icon_size = 64, icon_mipmaps = 4,
stack_size = data.raw["item"]["electric-mining-drill"].stack_size / 2,
place_result = "liquify2-liquifier",
subgroup = "... |
-- This software is copyright Kong Inc. and its licensors.
-- Use of the software is subject to the agreement between your organization
-- and Kong Inc. If there is no such agreement, use is governed by and
-- subject to the terms of the Kong Master Software License Agreement found
-- at https://konghq.com/enterpriseso... |
local ffi = require "ffi"
local ffi_cdef = ffi.cdef
ffi_cdef[[
typedef unsigned long mp_limb_t;
typedef struct {
int _mp_alloc;
int _mp_size;
mp_limb_t *_mp_d;
} __mpz_struct;
typedef const __mpz_struct *mpz_srcptr;
typedef __mpz_struct mpz_t[1];
typedef __mpz_struct *mpz_ptr;
]]
|
local DbgPrint = GetLogging("PathTracker")
ENT.Base = "lambda_entity"
ENT.Type = "point"
DEFINE_BASECLASS("lambda_entity")
function ENT:PreInitialize()
BaseClass.PreInitialize(self)
DbgPrint(self, "PreInitialize")
self:SetInputFunction("OnPass", self.OnPass)
end
function ENT:Initialize()
BaseClass.... |
socket = require("socket")
json = require("dkjson")
require("util")
require("consts")
require("class")
require("queue")
require("globals")
require("character") -- after globals!
require("stage") -- after globals!
require("analytics")
require("save")
require("engine")
require("localization")
require("graphics")
require(... |
local dnsutils = require "dns.utils"
local pretty = require("pl.pretty").write
print("resolv.conf file;")
print(pretty(dnsutils.parseResolvConf()))
print("\nresolv.conf environment settings;")
print(pretty(dnsutils.applyEnv({})))
print("\nresolv.conf including environment settings;")
print(pretty(dnsutils.applyEnv(d... |
local adam = require("adam.adam")
local actions = require("adam.actions")
return function()
describe("Math actions", function()
local adam_instance, state_instance
before(function()
state_instance = adam.state()
adam_instance = adam.new(state_instance, {}, { value = 0 })
end)
after(function()
adam_i... |
require('lspconfig').clangd.setup {
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()),
cmd = { "clangd", "--background-index", "--compile-commands-dir=build/" }
}
require('lspconfig').hls.setup {
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.... |
-- Copyright (c) 2020 Trevor Redfern
--
-- This software is released under the MIT License.
-- https://opensource.org/licenses/MIT
local safecall = require "moonpie.utility.safe_call"
local class = {}
function class:subclass(prototype)
setmetatable(prototype, { __index = self, __call = self.new })
retur... |
project = "Plugin Name"
title = "Plugin Title"
description = "Plugin Description"
full_description = "Plugin Full Description"
not_luadoc = true
format = "markdown"
style = true
examples = "examples"
readme = "README.md"
custom_tags = {
{
"link",
title = "Links",
format = function(text)
local nam... |
--------------------------------------------------------------------------------
-- Example of a problem on 1D line segments in 2D
-- (C) G-CSC, Uni Frankfurt, 2021
--------------------------------------------------------------------------------
ug_load_script("ug_util.lua")
ug_load_script("util/profiler_util.lua")
ug... |
--[[
auxiliary functions
--]]
--[[ Break a string "25-30-100" into table {25,30,100} ]]--
function convert_option(s)
local out = {}
local args = string.split(s, '-')
for _, x in pairs(args) do
x = string.gsub(x, 'n', '-')
local y = tonumber(x)
if y == nil then
error("Parsing arguments: "... |
local OnlookerPropsItem = class(CommonGameLayer, false);
OnlookerPropsItem.s_controls = {
btnProp = 1,
imgProp = 2,
txtPropNum = 3,
btnTop = 4,
imgFrame = 5,
}
OnlookerPropsItem.ctor = function(self, data)
local room_player_info_prop = require("view/kScreen_1280_800/games/common2/room_player_info... |
petrolCanPrice = 50
lang = "da"
settings = {}
settings["da"] = {
buyFuel = "Køb brændstof",
liters = "Liter",
percent = "Procent",
confirm = "Bekræft",
fuelStation = "Tankstation",
boatFuelStation = "Tankstation | Både",
avionFuelStation = "Tankstation | Fly",
heliFuelStation = "Tankstation | Helikopter",
pri... |
function OnLoad()
QQQ = BarUnderObject()
QQQ:AddBar(myHero, 10, nil, nil, 5)
end
class "BarUnderObject"
function BarUnderObject:__init()
self.bars = {}
self.draw = true
AddDrawCallback(function ()
self:OnDraw()
end)
AddTickCallback(function ()
self:DeleteInvalid()
end)
end
function BarUnderObject:OnDraw(... |
description "vRP MySQL async"
-- server scripts
server_scripts{
"@vrp/lib/utils.lua",
"init.lua",
"mysql.net.dll"
}
server_exports{
"createConnection",
"createCommand",
"query",
"checkTask"
}
|
local test={ modname=(...) } package.loaded[test.modname]=test
local n={"kissfft.core","wetgenes.pack.core","zip","zlib","wetgenes.freetype.core","wetgenes.ogg.core","al.core","alc.core","wetgenes.tardis.core","gles.core","wetgenes.grd.core","wetgenes.grdmap.core","wetgenes.sod.core","socket.core","mime.core","w... |
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
local handlers = require 'vim.lsp.handlers'
local path = util.path
local server_name = "jdtls"
local cmd = {
util.path.join(tostring(vim.fn.getenv("JAVA_HOME")), "/bin/java"),
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"... |
-----------------------------------------------------------------------------------------------------------------------------
-- [https://discord.gg/ppVjYQKT2r في حال واجهت اي مشاكل حياك الدعم الفني B3-Team جميع الحقوق محفوظة الى ] --
-- [المصعد يتسع حتى تسع طوابق و يمكن تعطيل اي طابق و عند تعديل اي ... |
ArrowTowerSprite = class("ArrowTowerSprite", function (...)
return BuildingBaseSprite:create(...)
end)
ArrowTowerSprite.TAG = nil
ArrowTowerSprite.subType = "ATKBuilding"
Temple:initBuildingHP(ArrowTowerSprite)
function ArrowTowerSprite:onEnter()
self:adjustBarPosition(0, 23)
end
function ArrowTowerSprite:create... |
//________________________________
//
// NS2 Combat Mod
// Made by JimWest and MCMLXXXIV, 2012
//
//________________________________
// combat_SoundEffect.lua
local HotReload = CombatSoundEffect
if(not HotReload) then
CombatSoundEffect = {}
ClassHooker:Mixin("CombatSoundEffect")
end
function CombatSo... |
local bcrypt = require "bcrypt"
--
local PG = require "services.PG"
local redis_client = require "services.redis_client"
local generate_user_token = require "util.generate_user_token"
local is_mobile = require "util.is_mobile"
local trim = require "util.trim"
local fmt = string.format
local TOKEN_TTL = 60 * 60 * 24 * ... |
local cmp = require "cmp"
-- `/` cmdline setup.
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
-- `:` cmdline setup.
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
... |
#!/usr/bin/env lua
local unpack = table.unpack or unpack
local fl = require( "fltk4lua" )
local WIDTH=700
local window = fl.Window( WIDTH, 400 )
function window:callback()
print( "window callback called" )
self:hide()
end
local hugemenu = {}
local function quit_cb()
--os.exit( 0, true ) -- bad style
window:... |
require 'loxy.callback'
require 'loxy.signal'
require 'loxy.object'
|
local caca_ffi = require("caca_ffi")
local Lib = caca_ffi.Lib_caca;
local CharSets = {}
function CharSets.utf8Toutf32(chars, size)
size = size or #chars;
return Lib.caca_utf8_to_utf32(chars, size)
end
function CharSets.utf32Toutf8(utf32char, buff, buffsize)
local bytesWritten = Lib.caca_utf32_to_utf8(buff, utf3... |
ElvDB = {
["profileKeys"] = {
["诗雨筱零 - 纳克萨玛斯"] = "诗雨筱零 - 纳克萨玛斯",
["Asdffg - 纳克萨玛斯"] = "Asdffg - 纳克萨玛斯",
["涴紗 - 凤凰之神"] = "涴紗 - 凤凰之神",
},
["gold"] = {
["纳克萨玛斯"] = {
["Asdffg"] = 0,
["诗雨筱零"] = 137399435,
},
["凤凰之神"] = {
["涴紗"] = 9758258,
},
},
["namespaces"] = {
["LibDualSpec-1.0"] = {
},
... |
local meta = FindMetaTable("Entity")
if not meta then return end
meta.oldPlayerHolding = meta.oldPlayerHolding or meta.IsPlayerHolding
function meta:IsPlayerHolding()
local isHolding = self:oldPlayerHolding()
if self.bIsHolding ~= isHolding then
self:SetNW2Bool("holding", isHolding)
end
return isHolding
end |
object_tangible_loot_loot_schematic_rebel_trooper_helmet_schematic = object_tangible_loot_loot_schematic_shared_rebel_trooper_helmet_schematic:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_loot_schematic_rebel_trooper_helmet_schematic, "object/tangible/loot/loot/schematic/rebel_trooper_helmet_schematic.iff... |
-- load app code
local App = dofile("../code/anisopoisson.lua")
local x0, y0 = 0.0, 0.0 -- location of O
local zet = 1e9 -- Dpar/Dperp
local Dpar = 1.0 -- parallel heat conduction
local Dperp = Dpar/zet -- perpendicular heat conduction
local theta = 15.0*math.pi/180
aPoisson = App {
polyOrder = 1,
cflFrac = 0.9... |
local composer = require "composer"
local scene = composer.newScene()
local widget = require "widget"
local json = require "json"
local scoresTable = {}
local filepath = system.pathForFile("wizBan.json", system.DocumentsDirectory)
local function loadScores()
local file = io.open(filepath,"r")
if file th... |
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf/protobuf"
module('QuerySceneDayCountArg_pb')
QUERYSCENEDAYCOUNTARG = protobuf.Descriptor();
local QUERYSCENEDAYCOUNTARG_GROUPID_FIELD = protobuf.FieldDescriptor();
local QUERYSCENEDAYCOUNTARG_TYPE_FIELD = protobuf.FieldDescriptor();
QUERYS... |
local toast = require('toast')
local client = toast.Client()
local command = toast.Command('flags', {
args = { { name = 'test', value = 'string', required = true} }, -- The parser options
execute = function(msg, args) -- example msg = !flags "fun times"
if args.test then
return msg:reply('We are having ' .. ... |
local singletons = require "kong.singletons"
local cache = require "kong.tools.database_cache"
local responses = require "kong.tools.responses"
--- Load the configuration for a plugin entry in the DB.
-- Given an API, a Consumer and a plugin name, retrieve the plugin's configuration if it exists.
-- Results are cached... |
--[[
desc: Down, a state of Duelist.
author: Musoucrow
since: 2018-9-30
alter: 2018-10-1
]]--
local _ASPECT = require("actor.service.aspect")
local _BATTLE = require("actor.service.battle")
local _IBeaten = require("actor.state.duelist.ibeaten")
local _ITimeEnd = require("actor.state.itimeEnd")
local _Base = requ... |
require("@vue/runtime-test")
require("@vue/runtime-test/NodeTypes")
describe('renderer: vnode hooks', function()
function assertHooks(hooks, vnode1, vnode2)
local root = nodeOps:createElement('div')
render(vnode1, root)
expect(hooks.onVnodeBeforeMount):toHaveBeenCalledWith(vnode1, nil)
expect(hooks.o... |
local M = {}
--[[
Creates iterator that produces the results of some element computation a number of times.
interface: https://www.scala-lang.org/api/current/scala/collection/Iterator$.html
@param len the number of elements returned by the iterator
@param f the element computation
@returns a Lua iterator that produces... |
--[[
--MIT License
--
--Copyright (c) 2019 manilarome
--Copyright (c) 2020 Tom Meyers
--
--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 ... |
--Paths to audio files
math.randomseed(os.time())
--Button click
ButtonSFX = "mge/Audio/ui_click.wav" --Path to the sound file.
ButtonVolume = 20 --Set a volume between 0 - 100.
ButtonPitch = 1 --Default value = 1
--Moving a box
PushSFX = "mge/Audio... |
-- Generated by CSharp.lua Compiler
local System = System
local DCETModel = DCET.Model
local UnityEngine = UnityEngine
System.namespace("DCET.Hotfix", function (namespace)
namespace.class("M2C_PathfindingResultHandler", function (namespace)
local Run
Run = function (this, session, message)
return System... |
require("prototypes.entities")
require("prototypes.items")
require("prototypes.item-groups")
require("prototypes.recipes")
require("prototypes.technologies")
require("prototypes.tiles")
|
return {
{
["off"]="0.399",
["on"]="0.081",
},
{
["off"]="1.339",
["on"]="0.081",
},
{
["off"]="4.527",
["on"]="2.817",
},
{
["off"]="0.644",
["on"]="0.640",
},
{
["off"]="3.032",
["on"]="3.007",
},
{
["off"]="4.046",
["on"]="4.977",
},
["local fc = font.current\
\
function font.cur... |
function MapData.walk_voxels_mock(min, max, fn)
local x, y, z, data
for x=min.x,max.x do
for y=min.y,max.y do
for z=min.z,max.z do
data = MapData.get_node(vector.new(x,y,z))
fn({x = x, y = y, z = z}, data.name, data.cid)
end
end
end
end
local mock_node_defs = nil
MapData.mock_... |
Handler = NPCHandler:new()
Citizen.CreateThread(function()
Handler:startThread(500)
end)
-- TODO: Better integration with external scripts and animation handler
function GetNPC(id)
if not Handler:npcExists(id) then return end
return Handler.npcs[id]["npc"]
end
exports("GetNPC", GetNPC)
function Registe... |
local ignoreSkill = {}
--- Gets the base skill from a skill.
--- @param skill string The skill entry to check.
--- @return string The base skill, if any, otherwise the skill that was passed in.
local function GetBaseSkill(skill, match)
if skill ~= nil then
local checkParent = true
if match ~= nil and match ~= "" ... |
--Increase cost of resin->rubber smelting to encourage use of angels rubber synthesis
seablock.lib.substingredient('bob-rubber', 'resin', nil, 4)
-- Merge tech Rubbers into Rubber
bobmods.lib.tech.remove_recipe_unlock('rubbers', 'solid-rubber')
bobmods.lib.tech.replace_prerequisite('rubber', 'rubbers', 'resin-1')
bobm... |
local csv = {}
math.randomseed(os.time())
--AUX
function shuffle(array)
-- fisher-yates
local output = { }
local random = math.random
for index = 1, #array do
local offset = index - 1
local value = array[index]
local randomIndex = offset*random()
local floore... |
require("common/commonScene")
require("hall/recharge/rechargeScene")
require("hall/recharge/rechargeController")
local recharge = require(RechargeViewPath .. "recharge")
RechargeState = class(CommonState)
RechargeState.ctor = function(self)
self.m_controller = nil;
end
RechargeState.getController = fun... |
local Dictionary = script.Parent
local Llama = Dictionary.Parent
local t = require(Llama.t)
local validate = t.tuple(t.table, t.any)
local function has(dictionary, key)
assert(validate(dictionary, key))
return dictionary[key] ~= nil
end
return has |
--[[
--MIT License
--
--Copyright (c) 2019 PapyElGringo
--Copyright (c) 2019 Tom Meyers
--
--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... |
--[[
Project: SA Memory (Available from https://blast.hk/)
Developers: LUCHARE, FYP
Special thanks:
plugin-sdk (https://github.com/DK22Pac/plugin-sdk) for the structures and addresses.
Copyright (c) 2018 BlastHack.
]]
local shared = require 'SAMemory.shared'
shared.require 'CEntity'
shared.require 'CAESound'
... |
-- This file is part of the Teal Pages project
-- Copyright (c) 2020 Felipe Daragon
-- License: MIT
function handle_tlp(r)
local tlp = require "tlp"
r.content_type = "text/html"
puts = function(s) r:write(s) end
print = function(s) r:write(s) end
tlp.setoutfunc "puts"
tlp.include(r.filename)
end
|
--[[
LUA PARAMETERS
]]
useDatabankValues = false --export: if checked and if values were saved in databank, parmaters will be loaded from the databank, if not, following ones will be used
containerMonitoringPrefix_screen1 = "MONIT_" --export: the prefix used to enable container monitoring and display on the 1st scree... |
local M = {
base = "assets",
}
-- TODO: watch file. uv_fs_event_start
local cache = {}
M.get = function(path)
local asset = cache[path]
if asset then
return asset
end
local r = io.open(M.base .. "/" .. path, "rb")
local src = r:read "*a"
r:close()
cache[path] = src
retur... |
--lj2curl.lua
local ffi = require("ffi")
local bit = require("bit")
local lshift, rshift, bor, band = bit.lshift, bit.rshift, bit.bor, bit.band
local Lib_curl = require("curl_ffi")
local function Lib_curl_cleanup(lib)
print("Lib_curl_cleanup()")
Lib_curl.curl_global_cleanup();
end
if Lib_curl then
local flags... |
-- [以下实例定义了函数 max(),参数为 num1, num2,用于比较两值的大小,并返回最大值]
function max(num1, num2)
local result = 0
if (num1 > num2) then
result = num1
else
result = num2
end
return result
end
-- [Call]
print("Max: ", max(10,4))
print("Max: ", max(5,6))
-- [Lua 中我们可以将函数作为参数传递给函数,如下实例]
myPrint = function(param)
print("这是打印函数 ##... |
local mod = DBM:NewMod(2349, "DBM-EternalPalace", nil, 1179)
local L = mod:GetLocalizedStrings()
mod:SetRevision("20190712224311")
mod:SetCreatureID(150859)
mod:SetEncounterID(2293)
mod:SetZone()
mod:SetUsedIcons(1, 2, 3)
--mod:SetHotfixNoticeRev(16950)
--mod:SetMinSyncRevision(16950)
--mod.respawnTime = 29
mod:Regi... |
local PANEL = {}
function PANEL:Init()
self.Material = nil
self.AutoSize = true
self:SetAlpha( 255 )
self:SetMouseInputEnabled( false )
self:SetKeyboardInputEnabled( false )
end
function PANEL:Paint()
if (!self.Material) then return true end
surface.SetMaterial( self.Material )
surfac... |
AddEvent("OnPlayerChat", function(ply, text)
local dim = GetPlayerDimension(ply)
for i, v in ipairs(GetDimensionPlayers(dim)) do
AddPlayerChat(v, GetPlayerName(ply) .. " [" .. tostring(ply) .. "] (Dimension " .. tostring(dim) .. ") : " .. text)
end
return false
end) |
--- Module implementing the LuaRocks "purge" command.
-- Remove all rocks from a given tree.
local purge = {}
local util = require("luarocks.util")
local fs = require("luarocks.fs")
local path = require("luarocks.path")
local search = require("luarocks.search")
local vers = require("luarocks.core.vers")
local repos =... |
object_tangible_loot_generic_deed_vehicle_generic = object_tangible_loot_generic_deed_shared_vehicle_generic:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_generic_deed_vehicle_generic, "object/tangible/loot/generic/deed/vehicle_generic.iff")
|
-----------------------------------
-- Area: Upper Jeuno
-- NPC: Leillaine
-- Standard Merchant NPC
-----------------------------------
local ID = require("scripts/zones/Upper_Jeuno/IDs")
require("scripts/globals/shop")
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
local stock =
{
... |
micro_world_server = {}
-- the 'radiant:new_game' event is triggered whenever a new game starts
radiant.events.listen(micro_world_server, 'radiant:new_game', function(args)
-- read the config file for the world to use. this will read the
-- mods.microworld.world key, returning it's value or 'mini_game'
... |
require "resources/data_raw_electric_pole"
require "resources/data_raw_assembling_machine"
require "resources/data_raw_container"
require "resources/data_raw_furnace"
require "resources/data_raw_inserter"
require "resources/data_raw_mining"
require "resources/data_raw_lab"
require "resources/game_players_zoom"... |
-- screens.logo
local composer = require ("composer") -- Include the Composer library. Please refer to -> http://docs.coronalabs.com/api/library/composer/index.html
local scene = composer.newScene() -- Created a new scene
local mainGroup -- Our main display group. We will add display elements... |
-- 初始化
local string_sub = string.sub
local debug_getinfo = debug.getinfo
local string_len = string.len
FRAMEWORK = {
INIT_FILE = 'init.lua',
PATH = {
library = 'Libraries',
config = 'config',
test = 'Tests',
controller = 'Controllers',
view = 'Views',
daemon = 'Da... |
local _, Addon = ...;
local AutoScrollbarMixin = {}
local function scrollbarHide(self)
local control = self:GetParent();
-- If the scrollbar is being hiddem we can have whole space.
control:SetPoint("BOTTOMRIGHT", control:GetParent(), -5, 4);
control:GetScrollChild():SetWidth(control:GetWidth() - 5);
if (self._s... |
Outfit_Adventurer.modifiers_0.armor = 9900
Outfit_Adventurer.modifiers_0.destiny_slots = 5
Outfit_Adventurer.modifiers_0.overdrive = 800
Outfit_Adventurer.modifiers_0.max_overdrive_add = 6000
Outfit_Adventurer.modifiers_0.overdrive_decay_rate = 7
|
-- This example program measures latency of block device operations and plots it
-- in a histogram. It is similar to BPF example:
-- https://github.com/torvalds/linux/blob/master/samples/bpf/tracex3_kern.c
local ffi = require('ffi')
local bpf = require('bpf')
local S = require('syscall')
-- Shared part of the program
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.