content stringlengths 5 1.05M |
|---|
require("hall/password/type/passwordTypeObject");
require("hall/gameData/txtMgr");
require("hall/userInfo/data/userInfoData");
require("hall/community/data/communityDataInterface");
require("hall/password/jump/jumpInterfaceMatchHall");
local PasswordTypeObjectAddFriends = class(PasswordTypeObject);
----------... |
--
-- network.lua
-- network status notification
--
local naughty = require("naughty")
local beautiful = require("beautiful")
-- ========================================
-- Config
-- ========================================
local icons_path = beautiful.icons_path .. "network/"
-- ==================================... |
-----------------------------------------------------------------------------------------------------------------------------------------
-- INICIAR TREM
-----------------------------------------------------------------------------------------------------------------------------------------
Citizen.CreateThread(functio... |
object_tangible_item_beast_converted_gubbur_decoration = object_tangible_item_beast_shared_converted_gubbur_decoration:new {
}
ObjectTemplates:addTemplate(object_tangible_item_beast_converted_gubbur_decoration, "object/tangible/item/beast/converted_gubbur_decoration.iff")
|
local knife = game.Players:GetChildren()
local people = game.Players:GetChildren()
for i,v in pairs(knife) do
if v.Backpack:FindFirstChild("Knife") then
v.Backpack.Knife:Clone().Parent = game.Players.LocalPlayer.Backpack
v.Backpack.Knife:Clone().Parent = game.Players.LocalPlayer.StarterGear
end
end
local gun = game.Pl... |
--[[CRQ: APPLINK-28163: [GENIVI] SDL must retrieve the value of 'menuIcon' and 'menuTitle' parameters from .ini file]]
--[[Clarifications
-- APPLINK-29383: Should SDL consider parameters menuIcon/MenuTitle as empty if they are missing in INI file
-- APPLINK-29383 => APPLINK-13145
]]
--[[General Precondition: Update s... |
local _, nCore = ...
-- Forked from rVignette by zork - 2014
function nCore:VignetteAlert()
local addon = CreateFrame("Frame")
local function OnEvent(self, event, id)
if not nCoreDB.VignetteAlert then return end
if event == "VIGNETTE_MINIMAP_UPDATED" then
if not id then return e... |
-- Copyright (C) 2018 jerrykuku <jerrykuku@qq.com>
-- Licensed to the public under the GNU General Public License v3.
module("luci.controller.vssr", package.seeall)
function index()
if not nixio.fs.access("/etc/config/vssr") then
return
end
if nixio.fs.access("/usr/bin/ssr-redir") then
entry({"admin"... |
local i;
local rtWidth;
local rtHeight;
-- Positive
FileWriteLineFast("test/output.txt", "Positive test", FM_WRITE);
ScreenInit(640, 480, false, "Font test");
TextureInit(IKDM_SMALL, 32);
TtfInit(IKDM_SMALL, 32);
PrimitiveInit();
TimerInit();
SpriteInit(IKDM_SMALL, 32);
FontInit(IKDM_SMALL, 32);
local ttf = TtfLoad(... |
return {
Janitor = {
URL = "https://raw.githubusercontent.com/RoStrap/Events/master/Janitor.lua";
Documentation = "https://rostrap.github.io/Libraries/Events/Janitor/";
ParentFolderPath = "Events";
};
Signal = {
URL = "https://raw.githubusercontent.com/RoStrap/Events/master/Signal.lua";
Documentation = "h... |
--[[
JpegTran.lua
Represents jpegtran command-line utility.
--]]
local JpegTran, dbg, dbgf = ExternalApp:newClass{ className = 'JpegTran', register = true }
--- Constructor for extending class.
--
function JpegTran:newClass( t )
return ExternalApp.newClass( self, t )
end
--- Constru... |
function fibonacci_search(arr, x, n)
local fib2 = 0
local fib1 = 1
local fibM = fib2 + fib1
while fibM < n do
fib2 = fib1
fib1 = fibM
fibM = fib2 + fib1
end
local offset = -1
while fibM > 1 do
local i = math.min(offset + fib2, n - 1)
if arr[i] < x then
fibM = fib1
fib1 = fib2
fib2 = fibM - ... |
local mod = DBM:NewMod(1783, "DBM-BrokenIsles", nil, 822)
local L = mod:GetLocalizedStrings()
mod:SetRevision(("$Revision: 17077 $"):sub(12, -3))
mod:SetCreatureID(110321)
mod:SetEncounterID(1950)
mod:SetReCombatTime(20)
mod:SetZone()
--mod:SetMinSyncRevision(11969)
mod:RegisterCombat("combat")
mod:Regi... |
local allowCountdown = false
function onStartCountdown()
if not allowCountdown and isStoryMode and not seenCutscene then --Block the first countdown
allowCountdown = true;
return Function_Stop;
end
return Function_Continue;
end
function onCreate()
setPropertyFromClass('GameOverSubstate', 'characterName', 'M... |
remote = require 'net.box'
fiber = require 'fiber'
test_run = require('test_run').new()
LISTEN = require('uri').parse(box.cfg.listen)
space = box.schema.space.create('net_box_test_space')
index = space:create_index('primary', { type = 'tree' })
box.schema.user.grant('guest', 'read,write', 'space', 'net_box_test_space... |
-- Completion for snippets.
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
-- LSP Lua (build from source without telemetry (use grep to find config)
-- https://github.com/sumneko/lua-language-server
-- cd lua-language-ser... |
--
-- IMPORTANT: This script resource may be attached to all Button widgets created by the Widget Creator panel.
-- If modifications are required, then first copy this file to a unique path and fix all necessary
-- script components' resource paths.
--
local thisActor = ...;
scaleform.Actor.set_m... |
require "lunit"
module(..., lunit.testcase, package.seeall)
common = dofile("common.lua")
--assert = common.assert
local EventEmitter = require "luanode.event_emitter"
function test()
local callbacks_called = {}
local e = EventEmitter()
function callback1()
table.insert(callbacks_called, "callback1")
e:addL... |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
-- file: gui_ReclaimInfo.lua
-- brief: Shows the amount of metal/energy when using area reclaim.
-- original author: Janis Lukss
--
-- Cop... |
--------------------------------
-- @module OrbitCamera
-- @extend ActionCamera
-- @parent_module cc
--------------------------------
-- @function [parent=#OrbitCamera] create
-- @param self
-- @param #float float
-- @param #float float
-- @param #float float
-- @param #float float
-- @param #float float
-- @param #... |
function love.load()
love.window.setMode(1000, 768)
anim8 = require 'libraries/anim8/anim8'
sti = require 'libraries/Simple-Tiled-Implementation/sti'
sprites = {}
sprites.playerSheet = love.graphics.newImage('sprites/playerSheet.png')
local grid = anim8.newGrid(614, 564, sprites.playerSheet:g... |
---------------------------------------------------------------------------------------------------
--
--filename: game.entities.data.SkillData
--date:2019/10/11 14:24:48
--author:heguang
--desc:装备的技能
--
---------------------------------------------------------------------------------------------------
local strClassN... |
local function GraphDisplay( pn )
local t = Def.ActorFrame {
Def.GraphDisplay {
InitCommand=cmd(Load,"GraphDisplay";);
OnCommand=cmd(x,-7.5;y,-25;zoomx,1.55);
BeginCommand=function(self)
local ss = SCREENMAN:GetTopScreen():GetStageStats();
self:Set( ss, ss:GetPlayerStageStats(pn) );
self:player(... |
GateActions("Highspeed")
GateActions["highspeed_write"] = {
name = "Highspeed Write",
inputs = { "Clk", "Memory", "Address", "Data" },
inputtypes = { "NORMAL", "WIRELINK", "NORMAL", "NORMAL" },
output = function(gate, Clk, Memory, Address, Data)
if not Memory then return 0 end
if not Memory.WriteCell then retu... |
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local DT = E:GetModule('DataTexts')
--Lua functions
local join = string.join
--WoW API / Variables
local BASE_MOVEMENT_SPEED = BASE_MOVEMENT_SPEED
local GetUnitSpeed = GetUnitSpeed
local IsFalling = IsFalling
local ... |
local rpc = {}
local list = {
ID_CLIENT_JOIN = 1,
ID_UPDATE_DATA = 2,
ID_SERVER_JOIN = 3,
ID_SERVER_QUIT = 4,
ID_STREAMED_OUT = 5,
ID_CLIENT_MESSAGE = 6,
ID_CLIENT_COMMAND = 7,
ID_UPDATE_TIME = 8,
ID_UPDAET_WEATHER = 9,
ID_UPDATE_POSITION = 10,
ID_UPDATE_INTERIOR = 11,
ID_UPDATE_SKIN = 12,
ID... |
--journalmod.lua
local loaded = false
function JOURNALMOD_ON_INIT(addon, frame)
if not loaded then
loaded = true
local function setupHook(newFunction, hookedFunctionStr)
local storeOldFunc = hookedFunctionStr .. "_OLD"
if _G[storeOldFunc] == nil then
_G[storeOldFunc] = _G[hookedFunctionStr]
end
_... |
assert.Equal(255, 0xff)
assert.Equal(-255, -0xff) |
local depth = {}
while true do
local n = io.read '*n'
if n == nil then
break
end
table.insert(depth, n)
end
local prev = 0
local count = -1 -- first one doesn't count
for _, d in ipairs(depth) do
if d - prev > 0 then
count = count + 1
end
prev = d
end
print(count)
|
-- ... init.lua
require("nvim-web-devicons").setup()
|
return {
name = 'truemedian/extensions',
version = '1.0.0',
description = 'A combination of extensions to the Lua standard libraries and other useful utilities for libraries I use.',
tags = {'lua', 'luvit', 'extension', 'stdlib'},
license = 'MIT',
author = {name = 'Nameless'},
homepage = 'https://github.com/true... |
-- Copyright © 2016 Silv3r <silv3r@proshine-bot.com>
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
name = "Leveling: Victory Road (near Indigo Platea... |
local MakePlayerCharacter = require "prefabs/player_common"
local assets = {
Asset( "ANIM", "anim/player_basic.zip" ),
Asset( "ANIM", "anim/player_idles_shiver.zip" ),
Asset( "ANIM", "anim/player_actions.zip" ),
Asset( "ANIM", "anim/player_actions_axe.zip" ),
Asset( "ANIM", "... |
--[[============================================================
--=
--= Global Functions
--=
--=-------------------------------------------------------------
--=
--= MyHappyList - manage your AniDB MyList
--= - Written by Marcus 'ReFreezed' Thunström
--= - MIT License (See main.lua)
--=
--=========================... |
--[[
##########################################################
S V U I By: Failcoder
##########################################################
LOCALIZED LUA FUNCTIONS
##########################################################
]]--
--[[ GLOBALS ]]--
local _G = _G;
local unpack = _G.unpack;
local select = _G.se... |
--Start of Global Scope---------------------------------------------------------
-- Serving an event which is used to trigger the ControlFlow. Must be served to the Engine CROWN.
-- Engine events are always global, no serve in App properties necessary
Script.serveEvent('Engine.OnMyEventIn', 'OnMyEventIn')
--End of G... |
local Server = {}
Server._doc = [[
Lowerlevel of game server, handles all things before game started.
And ServerGameModule handles others.]]
local FSM = require 'Utils.FSM'
setmetatable(Server, { __index = FSM })
local Config = require 'Config'
local _LogT, _LogD, _LogI, _LogW, _LogE = require('unity.Debug').GetLogF... |
function s030_baselab.main()
s030_baselab.PatrolRoutesGeneration()
s030_baselab.PatrolRoutesFinalNodesAssignation()
end
function s030_baselab.SetupDebugGameBlackboard()
Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_CURRENT_SPECIAL_ENERGY", "f", 1000)
Bl... |
local helper = require("piemenu.lib.testlib.helper")
describe("piemenu.lib.list", function()
before_each(helper.before_each)
after_each(helper.after_each)
for _, c in ipairs({
{ items = {}, expected = {} },
{ items = { 1 }, expected = { { 1, 1, 1 } } },
{ items = { 1, 2 }, expected = { { 2, 1, 2 }, ... |
require "CustomSharpeners"
print(nn.MulSoftMax)
gigi = nn.MulSoftMax()
print(gigi:forward(torch.Tensor{0.1, 0.3}))
|
require 'nn'
require 'nngraph'
require 'optim'
require 'cutorch'
require 'cunn'
require 'image'
require 'cudnn'
matio=require 'matio'
cmd = torch.CmdLine()
cmd:text()
cmd:text('Options:')
cmd:option('--modelPath','/home/jchen16/NEW/code/checkpoint/fungus_XX_20_seq_whole/unet_420000.000000.bin','path to the trained mo... |
cooldown = 0
cooldownTimer = nil
localPlayer = getLocalPlayer()
function isLSPD()
return getTeamName(getPlayerTeam(getLocalPlayer())) == "Los Santos Police Department"
end
function switchMode()
if (getPedWeapon(localPlayer)==24) and (getPedTotalAmmo(localPlayer)>0) then -- has an un-empty deagle
local... |
--[[
Scripted By: Xander1998 (X. Cross)
--]]
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
server_script "server.lua"
client_script "client.lua" |
--- Array class.
-- Useful array object specialized for numerical values, although most
-- operations work with arbitrary values as well. Functions taking functions
-- may accept _string lambdas_, which have either a placeholder '_' or two
-- placeholders '_1' or '_2'. As a special case, if the expression has no
-- ide... |
-- **color(s: str, arg1, arg2. ...):str**
local function color(s,...)
local all = {red=31, green=32, yellow=33, purple=34}
print('\27[1m\27['.. all[s] ..'m'..string.format(...)..'\27[0m') end
-- **sfmt(fmt :string, ?arg1 :any, ?arg2 :any, ...)**
-- format a string
local function sfmt(...) return string.format... |
function Netharel_OnEnterCombat(Unit,Event)
Unit:RegisterEvent("Netharel_DebilitatingStrike", 15000, 0)
Unit:RegisterEvent("Netharel_Evasion", 30000, 0)
Unit:RegisterEvent("Netharel_ManaBurn", 7000, 0)
Unit:RegisterEvent("Netharel_Metamorphosis", 1000, 1)
end
function Netharel_DebilitatingStrike(Unit,Event)
Unit:... |
-- Junction size
-- Selection type, per player_data
-- TODO: possibly allow junction size as a setting even though it could potentially require recalculation of data if it exceeds previous maximum
-- TODO: locale for setting and shortcut
data:extend({
--[[{type = "int-setting",
name = "tte-max-junction-size... |
------------------------------------------------------------------------------------------------------------------------
-- Game Type Manager Server
-- Author Morticai (META) - (https://www.coregames.com/user/d1073dbcc404405cbef8ce728e53d380)
-- Date: 2021/3/4
-- Version 0.1.2
------------------------------------------... |
-- FIFO, we push element from left, pop from right,
-- new element is at left, old element is at right
-- because redis has no reversely retrieve method on list
module(..., package.seeall)
local List = require 'lglib.list'
local rdlist = require 'bamboo.db.redis.list'
local db = BAMBOO_DB
function save (key, tbl, le... |
-- Various entities modelling the juju state and the model
require "scriptlets-driver.base"
Model = JujuEntity:new()
-- function Model.load_config
Config = JujuEntity:new()
Application = JujuEntity:new()
Unit = JujuEntity:new()
|
return {
-- Returns the monotonic time the system has been up, in secconds.
monotime = function()
return os.clock()
end,
-- Sleep for n seconds.
sleep = function(n)
os.sleep(n)
end,
-- Returns the current system time, 1970 (UTC), in secconds.
gettime = function()
... |
--Made by Joseph Pace (Thorinori)
--Maybe not needed. Not needed especially until Windows support is the focus.
local sep = package.config:sub(1,1)
--package.cpath = package.cpath .. ";./Modules/lib/lua/5.3/?.so;"
--package.cpath = package.cpath .. ";.\\Modules\\lib\\lua\\5.3\\?.so;"
package.cpath = package.cpat... |
local Snake = class("Snake", function() return cc.Layer:create() end)
local SnakeNode = require "SnakeNode"
require "math"
function Snake:ctor()
self._nodes = {}
end
function Snake:init(len, direction, x, y)
local len = len or 3
local direction = direction or "left"
local x = x or math.floor(G.maxX / 2... |
module('levels', package.seeall)
levels = {
}
currentLevel = nil
function pushEnemies( timer, enemies )
for _, enemy in ipairs(enemies) do
enemy:getWarning()
end
timer.running = false
end
function registerEnemies( timer, enemies)
for _, enemy in ipairs(enemies) do
enemy:register()
end
timer.running = fals... |
local fs = require('be.fs')
local projects = {
all = { }
}
local function project (project_type, name_or_suffix)
local function parse (t)
if type(t) ~= 'table' then
fatal('Expected table!', nil, { t = be.util.sprint_r(t) })
end
return function (configured_group)
local name, ... |
object_ship_nova_orion_boss_ship_tier1 = object_ship_shared_nova_orion_boss_ship_tier1:new {
}
ObjectTemplates:addTemplate(object_ship_nova_orion_boss_ship_tier1, "object/ship/nova_orion_boss_ship_tier1.iff")
|
ITEM.name = "Cleaver"
ITEM.description = "An old, pre-war looking cleaver. "
ITEM.model = "models/weapons/tfa_nmrih/w_me_cleaver.mdl"
ITEM.class = "tfa_nmrih_cleaver"
ITEM.weaponCategory = "melee"
ITEM.flag = "v"
ITEM.width = 2
ITEM.height = 1
ITEM.bDropOnDeath = true
ITEM.iconCam = {
ang = Angle(-0.239557847380... |
-- 大室花子
-- ①:自分フィールド上に「大室櫻子」が表側表示で存在する場合、このカードは手札から特殊召喚することができる。
-- ②:このカードが召喚に成功した時、デッキから「古谷楓」を1枚手札に加えることができる。
-- ③:このカードが相手によって破壊され墓地へ送られた時、自分のデッキから「大室櫻子」を特殊召喚することができる。
function c1070.initial_effect(c)
-- special summon
local e1 = Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1070, 0))
e1:SetType(EFFECT... |
local id = ID("remoteedit.openremotefile")
local lastfile = ""
local editors = {}
local function reportErr(err) return(err:gsub('.-:%d+:%s*','')) end
local mobdebug = require("mobdebug")
local copas = require("copas")
return {
name = "Remote edit",
description = "Allows to edit files remotely while debugging is i... |
return {
source = {
location = 'git@bitbucket.org:bazurbat/ast-rootfs.git',
name = 'rootfs'
},
build = {
type = true,
dir = '$jagen_target_dir'
},
uses = 'hi-sdk'
}
|
-----------------------------------
-- Area: Southern San d'Oria
-- NPC: Atelloune
-- Starts and Finishes Quest: Atelloune's Lament
-- !pos 122 0 82 230
-------------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
local ID = require("scripts/zones/Southern_San_dOria/IDs... |
-- exports a playlist manager "object"
-- handles:
-- iterating over the playlist of files
-- formatting either a regular list or circular buffer depending on how long
-- the list is
-- filtering the list by search
-- does not handle the OSD
local utils = require("mp.utils")
local settings = {
-- number of lin... |
include("Mastergear/MasterGearLua.lua")
target_maneuver_count = {
["light maneuver"] = 1,
["dark maneuver"] = 0,
["earth maneuver"] = 0,
["wind maneuver"] = 1,
["water maneuver"] = 0,
["ice maneuver"] = 0,
["fire maneuver"] = 1,
["thunder maneuver"] = 0,
}
maneuver_cast = {"light maneuver", "wind maneuver", "f... |
local m,s,o
m=Map("overwall",translate("IP Access Control"))
s=m:section(TypedSection,"access_control")
s.anonymous=true
s:tab("wan_ac",translate("WAN IP AC"))
o=s:taboption("wan_ac",DynamicList,"wan_bp_ips",translate("WAN White List IP"))
o.datatype="ip4addr"
o=s:taboption("wan_ac",DynamicList,"wan_fw_ips",transla... |
module:depends("http");
module:depends("pubsub");
local streams = {};
local service = hosts[module.host].modules.pubsub.service;
function client_closed(response)
local node = response._eventsource_node;
module:log("debug", "Destroying client for %q", node);
streams[node][response] = nil;
if next(streams[node]) =... |
-- Gemeinschaft 5 module: dialplan class
-- (c) AMOOMA GmbH 2012-2013
--
module(...,package.seeall)
Dialplan = {}
-- local constants
local DIAL_TIMEOUT = 120;
local MAX_LOOPS = 20;
local DIALPLAN_FUNCTION_PATTERN = '^f[_%-].*';
local CALL_FORWARDING_SERVICES = {
USER_BUSY = 'busy',
CALL_REJECTED = 'busy',
NO_... |
data:extend{
{
type = 'item',
name = 'hand-crank',
icon = '__HandCrank__/graphics/icon/hand-crank.png',
icon_size = 64,
flags = {'goes-to-quickbar'},
subgroup = 'energy',
place_result='hand-crank',
order = 'b[energy]-d[hand-crank]',
stack_size = 10,
}
}
|
--
-- c_switch.lua
--
----------------------------------------------------------------
----------------------------------------------------------------
-- Effect switching on and off
--
-- To switch on:
-- triggerEvent( "switchBloom", root, true )
--
-- To switch off:
-- triggerEvent( "switchBloom", root, false )
... |
local Rollbar = require('love-rollbar')
local config = require('config')
function love.load()
--configure rollbar
Rollbar.access_token = config.rollbar_api_key
Rollbar.environment = 'development'
Rollbar.app_version = '0.0.0'
local foo = {}
x=foo.bar.baz
end
local old_error = love.errhand
function love.e... |
--Load configuration settings which affect the replications
local reps_multiplier = settings.startup['replresearch-item-multiplier'].value
local research_time = settings.startup['replresearch-item-time'].value
local repl_penalty = settings.startup['replication-penalty'].value
local fluid_quantity = settings.startup... |
function GetPlayerLookPos(Player)
local World = Player:GetWorld()
local Start = Player:GetEyePosition()
local End = Start + Player:GetLookVector() * 150
local HitCoords = nil
local Callbacks =
{
OnNextBlock = function(BlockPos, BlockType)
if BlockType ~= E_BLOCK_AIR then
HitCoords = BlockPos
return t... |
--[[
Copyright (C) 2019 Onset Roleplay
Developers:
* Logic
Contributors:
* Blue Mountains GmbH
]]--
local colour = ImportPackage('colours')
AddCommand("refuel", function (playerid)
if GetPlayerState(playerid) ~= PS_DRIVER then
return AddPlayerChat(playerid, "<span color=\""..colour.COLOUR_LIGHTRED().."\">Error:... |
return {'tuf','tuffen','tufkrijt','tufsteen','tuftuf','tuft','tufte','tuften','tuftufs'} |
local call_count
local normalizer = function(key)
call_count = call_count + 1
local num = tonumber(key)
return num, (not num) and "not a valid number"
end
-- create a simple cache, returns the cache, but also it's cache
-- table for test inspection
local function create_cache(weak)
local cache
local r = {
... |
--Script Name : scriptTemplate
--Author : Jean Loup Pecquais
--Description : Simple template
--v1.0.0
local libPath = reaper.GetExtState("Reaper Evolution", "libPath")
if not libPath or libPath == "" then
reaper.MB("Reaper Evolution library is not found. Please refer to user guide", "Library not found", 0)
ret... |
--GamePadMenu
DefineClass.GamepadIGMenu = {
__parents = {"ItemMenu"},
hide_single_category = true,
}
function IsHUDResupplyEnabled()
return (not g_Tutorial or g_Tutorial.EnableResupply) and g_Consts.SupplyMissionsEnabled == 1 and true or false
end
function IsHUDResearchEnabled()
return (not g_Tutorial or g_Tutori... |
-- https://github.com/moody/DethsDBLib
local _, Addon = ...
local metadata = {
name = "DethsDBLib",
version = "2.0.2",
description = "Addon library for managing Saved Variables.",
author = "Dethanyel"
}
local name = ("%s_%s"):format(metadata.name, metadata.version)
local lib = _G[name]
if lib then
lib.__l... |
Citizen.CreateThread(function()
while true do
SetDiscordAppId(628965646415298561)
SetDiscordRichPresenceAsset('redside')
--SetDiscordRichPresenceAssetText("")
SetDiscordRichPresenceAssetSmall('discord')
SetDiscordRichPresenceAssetSmallText('discord.gg/redside')
SetRichPresence(GetPlayerName(PlayerId()) .. ... |
function Auctionator.AH.Initialize()
if Auctionator.AH.Internals ~= nil then
return
end
Auctionator.AH.Internals = {}
Auctionator.AH.Internals.throttling = CreateFrame(
"FRAME",
"AuctionatorAHThrottlingFrame",
AuctionHouseFrame,
"AuctionatorAHThrottlingFrameTemplate"
)
Auctionator.AH.I... |
local box = CompactUnitFrameProfilesGeneralOptionsFrameKeepGroupsTogether
local mode = CompactRaidFrameContainer_SetGroupMode
local function checkBox()
-- in separate party groups, doesn't allow raid frames to glom together or sort
box:SetChecked(true)
mode(CompactRaidFrameContainer, "discrete")
end
local functio... |
-- co
co = coroutine.create(function (a)
local r = coroutine.yield(a+1) -- yield()返回a+1给调用它的resume()函数,即2
print("r=" ..r) -- r的值是第2次resume()传进来的,100
end)
status, r = coroutine.resume(co, 1) -- resume()返回两个值,一个是自身的状态true,一个是yield的返回值2
print(status, r)
coroutine.resume(co, 100)
... |
-- The following code tests the mathematical metamethods that are supplied
-- in Lua.
header = 'Metamethods test: '
-- Test vector metamethods
v1 = math.v4(1.0, 1.0, 1.0, 1.0)
v2 = math.v4(0.0, 1.0, 2.0, 4.0)
a = 10
b = 100
print('Contents of v1.')
print('Using ipairs.')
for i,v in ipairs(v1) do print(i... |
if not metrolib then metrolib = {} end
if not metrolib.constants then metrolib.constants = {} end
metrolib.constans.tick_time = 120
|
-- to work around slow init times due to packagesrv.com being down
premake.downloadModule = function()
return false
end
_G._ROOTPATH = path.getabsolute('.')
xpcall(function()
newoption {
trigger = "with-asan",
value = "libpath",
description = "Use asan for Windows."
}
newoption {
trigger = "builddir"... |
if not modules then modules = { } end modules ['util-sql-imp-ffi'] = {
version = 1.001,
comment = "companion to util-sql.lua",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-- I looked at l... |
-----------------------------------
-- Area: Carpenters' Landing
-- NPC: Lourdaude
-- Type: Standard NPC
-- !pos 215.597 -2.689 -526.021 2
-----------------------------------
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
player:startEvent(26)
end
function onEventUpdate(player, csid, o... |
require('.')
hashed_items = {}
items = "#" .. "foo-bar" .. "#"
for i = 1, #items - 2 do
table.insert(hashed_items, items:sub(i, i + 2))
end
print (hashed_items)
local dir = 'data/Translation/train/'
local input_vocab = dmn.HashVocab(dir .. 'input_vocab.txt', true)
local items = input_vocab:index("cats")
print(items... |
local talents = require 'talents'
describe ("talent definition,", function ( )
it ("should not observe any direct effects from passed structure", function ( )
local structure = { x = 0, }
local talent = talents.talent (structure)
assert.truthy (talents.provid... |
AddCSLuaFile()
ENT.Base = "gballoon_tower_base"
ENT.Type = "anim"
ENT.PrintName = "Mortar Tower"
ENT.Category = "#rotgb.category.tower"
ENT.Author = "Piengineer12"
ENT.Contact = "http://steamcommunity.com/id/Piengineer12/"
ENT.Purpose = "#rotgb.tower.gballoon_tower_11.purpose"
ENT.Instructions = ""
ENT.Spawnable = fal... |
pass = 0
function cpuplayers_updating()
local playerIndex = 0
for playerIndex = 0, Player_Count do
if (Player_IsAlive(playerIndex) == 1) then
if (Player_HasShipWithBuildQueue(playerIndex) == 1) then
if (Player_GetLevelOfDifficulty(playerIndex) > 0) then
--behaviour
if (pass == 0) then
if... |
cfg = module("cfg/client")
local Tunnel = module("vrp", "lib/Tunnel")
local Proxy = module("vrp", "lib/Proxy")
local Tools = module("vrp", "lib/Tools")
tvRP = {}
Tunnel.bindInterface("vRP", tvRP)
vRPserver = Tunnel.getInterface("vRP")
Proxy.addInterface("vRP",tvRP)
function onClientMapStart(...)
if not Ran then Shu... |
local actions = {}
local g = require "global"
function actions.test()
return {
tile = -1,
deco = 80,
onJump = function(self) gooi.alert({text = "activated!"}) end,
onVisible = function(self) g.world.entities["mole"] = require("entities.enemies.mole")((self.x-0.5)*60, (self.y-1)*60)... |
function initLogging()
tmr.alarm(3, 1000 * timings.log, tmr.ALARM_AUTO, function()
require('logSensors')
logSensors()
package.loaded['logSensors'] = nil
logSensors = nil
end)
end
|
addition_table = function()
columns = 6
min = 2;
max = 8;
devide = min + math.random(max-min)
multiple = min + math.random(10 - devide)
q = {}
for i=0,columns-1 do
q[i] = {}
term1 = math.random(6)
term2 = min + math.random(7 - term1)
q[i][1] = devide * term1 * 5
q[i][2] = devide * ... |
AddCSLuaFile("shared.lua")
include('shared.lua')
/*-----------------------------------------------
*** Copyright (c) 2012-2019 by DrVrej, All rights reserved. ***
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
without the prior written consent of the author, unless other... |
-- File content is auto-generated. Do not modify.
local SymbolBase = require('mx._ctypes.symbol').SymbolBase
local _symbol_creator = require('mx._ctypes.symbol')._symbol_creator
local NameManager = require('mx.name').NameManager
local AttrScope = require('mx.attribute').AttrScope
local _Null = require('mx.base')._Null... |
-- -------------------------------------------------------------------------- --
-- Bulk insert tests --
-- -------------------------------------------------------------------------- --
cursize=0
function prepare()
local i
db_connect()
for i = 0,num_... |
-- Copyright (c) 2019 Bart van Strien
-- See LICENSE file for more information
local co2 = {}
local co1 = require "coroutine"
co2.create = co1.create
co2.running = co1.running
co2.status = co1.status
co2.yield = co1.yield
-- Note: rename resume to presume
co2.presume = co1.resume
local function strip_traceback_head... |
local function bind(obj, method)
return function(...)
return method(obj, ...)
end
end
return bind
|
object_tangible_furniture_all_frn_all_chair_kitchen_s2 = object_tangible_furniture_all_shared_frn_all_chair_kitchen_s2:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_all_frn_all_chair_kitchen_s2, "object/tangible/furniture/all/frn_all_chair_kitchen_s2.iff")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.