content
stringlengths
5
1.05M
local lanes = require("lanes").configure() local sync_linda = lanes.linda() f = lanes.gen("os", function(n) os.execute("timeout 5"); return n end) a = f(2) b = f(2) print(a[1], b[1]) print(a.status, b.status)
-- Full reset by Kavawuvi ^v^ api_version = "1.10.0.0" tick_counter_address = nil sv_map_reset_tick_address = nil last_sv_map = 0 function OnScriptLoad() local check_timer_sig = sig_scan("8B68??8BC599F7FB") if check_timer_sig == 0 then return end register_callback(cb['EVENT_TICK'],"OnTic...
-- Copyright (c) 2014-present, Facebook, Inc. local upload = require "resty.upload" local function get_filename(header) local filename for _, elem in ipairs(header) do filename = string.match(elem, 'filename="(.*)"') if filename and filename ~= '' then return filename end ...
adb = {} function adb.waitfordevice( callback ) local command = util.generatecall( "adb", "-s product:soho wait-for-device" ) local function adbcallback( code, out ) if code ~= 0 then adb.waitfordevice( callback ) print( "adb process died mysteriously..." ) print( "--------- PROCESS OUTPUT ---------\n")...
--------------------------------------------------------------- -- Copyright 2021 Deviap (https://deviap.com/) -- --------------------------------------------------------------- -- Made available under the MIT License: -- -- https://github.com/deviap/deviap-main/blob/master/LICENSE -- ...
-- For iPads _G.isTall=false _G.isWide=false local os=system.getInfo("platformName") if os=="iPhone OS" then if system.getInfo("model") == "iPad" or system.getInfo("model") == "iPad Simulator" then if system.getInfo( "architectureInfo")=="iPad1,1" then _G.isWide=true _G.isTall=false applicatio...
local class = require("pl.class") local path = require("pl.path") local file = require("pl.file") local pretty = require("pl.pretty") local sfmt = string.format local tconcat = table.concat local FileDataSource = require("core.DataSource.FileDataSource") ---Data so...
local playsession = { {"mewmew", {302016}}, {"DKarma", {152310}}, {"zbirka", {297854}}, {"beranabus", {208986}}, {"Serennie", {142978}}, {"Cristal82", {53418}}, {"raskl", {304633}}, {"Giatros", {313594}}, {"Akhrem", {1189120}}, {"Nikkichu", {67380}}, {"XaLpHa1989", {251076}}, {"Behohs", {136340}}, {"vvicto...
--[[ States: (recieved from CHANGESTATE broadcast) LOBBY_STATE MATCH_STATE CARD_STATE VICTORY_STATE STATS_STATE ]]-- local settings = script:GetCustomProperty("Settings"):WaitForObject() local matchMaxDuration = settings:GetCustomProperty("MatchMaxDuration") local cardMaxDuration = settings:GetCustomProperty...
function convert._from_human_to_number(str) return atom.number:load(str) end
return function() local Style = script.Parent local Core = Style.Parent local UIBlox = Core.Parent local Packages = UIBlox.Parent local Roact = require(Packages.Roact) local AppStyleProvider = require(script.Parent.AppStyleProvider) local Constants = require(script.Parent.Constants) local appStyle = { themeN...
ENT.Type = "anim" ENT.Base = "base_gmodentity" ENT.PrintName = "Money" ENT.Category = "RPGM" ENT.Author = "Tom.bat" ENT.Spawnable = false ENT.AdminOnly = false ENT.IsRPGMMoney = true function ENT:SetupDataTables() self:NetworkVar("Int", 0, "Amount") end
-- We'll preserve order in the results. local results = {} for i=1,#KEYS,2 do local versionKey = KEYS[i] local opLogKey = KEYS[i+1] local from = tonumber(ARGV[(i+1)/2]) local v = tonumber(redis.call('get', versionKey)) if v == nil then -- We're asking for ops that redis doesn't have. Have to get them f...
include("asset://manager.lua") elapsedTime = 0 inputInterval = 120 time = 0 function setup() manager = Manager.new() manager.Setup() local pForm = UI_Form(nil, 7000, 0, 0, "asset://view.json" ) UI_TouchPad("touchPadCallback") TASK_StageOnly(pForm) end function update(deltaTime) if manager.isTimeOver...
return { --- 服务器IP HOST = "127.0.0.1", --- 服务器端口 PORT = 11211, --- 连接超时 TIMEOUT = 10000, --- 连接池大小(高峰请求数/worker数量) POOL_SIZE = 100, }
----------------------------------- -- Area: Temenos -- Mob: Temenos Ghrah ----------------------------------- local ID = require("scripts/zones/Temenos/IDs") function onMobDeath(mob, player, isKiller, noKiller) if isKiller or noKiller then local battlefield = mob:getBattlefield() battlefield:setL...
local Tunnel = module('_core', 'lib/Tunnel') local Proxy = module('_core', 'lib/Proxy') cAPI = Proxy.getInterface('API') API = Tunnel.getInterface('API') ----------------------------------------------------------------------------------------------------------------------------------------- -- VARIAVEIS -------------...
-- -- Requires: Premake 5 (https://premake.github.io/) -- Usage: premake5 --file=premake5.lua [project / makefile format, refer to premake5 --help] --target=[target from below] -- -- projects project "tinyxml2" language "C++" kind "staticlib" files { "tinyxml2.h", "tinyxml2.cpp" } filter "confi...
--[[ © 2015 CloudSixteen.com do not share, re-distribute or modify without permission of its author (kurozael@gmail.com). Clockwork was created by Conna Wiles (also known as kurozael.) http://cloudsixteen.com/license/clockwork.html --]] CW_SPANISH = Clockwork.lang:GetTable("Spanish"); CW_SPANISH["StaticToolAddTex...
--// options for itemlevel //-- local _, ns = ... local L = ns.L local LUI = LolzenUI.L local f = CreateFrame("Frame") f:RegisterEvent("ADDON_LOADED") f:SetScript("OnEvent", function(self, event, addon) if addon == "LolzenUI_Options" and LolzenUIcfg.modules["itemlevel"] == true then local title = ns.createTitle("...
local module = { Name = "Unmute", Description = "Unmutes a player from chatting", Location = "Player", } module.Execute = function(Client: player?, Type: string, Attachment: string?) if Type == "command" then local player = module.API.getPlayerWithName(Attachment) if player then module.API.Players....
--[[ -- methods for testing in lua console function BehaviorPrototype() return { RegisterDelegate = function(self, tb) print("Registering delegate "..tb.classname) end } end function CogRegisterBehaviorPrototype(tb) print("Registering behavior prototype "..tb.classname) end --]] -- create behavior...
require'nvim-treesitter.configs'.setup { matchup = { enable = true -- mandatory, false will disable the whole extension -- disable = {"c", "ruby"} -- optional, list of language that will be disabled } }
--[[ The MIT License Copyright (c) 2018 Jacob McPeak. 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, pu...
return {'skybox','skylab','skyline','sky','skye','skyler','skyboxen','skylabs','skylines','skys','skyes','skylers'}
--Automatically generated by SWGEmu Spawn Tool v0.12 loot editor. theme_park_loot_rebel_big_creature_cage = { description = "", minimumLevel = 0, maximumLevel = 0, lootItems = { {itemTemplate = "big_creature_cage", weight = 10000000} } } addLootGroupTemplate("theme_park_loot_rebel_big_creature_cage", theme_par...
function onCreate() makeLuaSprite('front', 'front', 500, -200); addLuaSprite('front',false) setLuaSpriteScrollFactor('front', 0.9, 0.9); makeLuaSprite('showc', 'showc', -350, -350); addLuaSprite('showc',false) setLuaSpriteScrollFactor('showc', 0.9, 0.9); end
-- @group UI -- @brief Lays out components. local Layout,super = ae.oo.subclass(ui.Container) -- @brief Constructs a Layout object. -- @param self The object. function Layout.construct(self) super.construct(self) end -- @brief Lays out the child components. function Layout:layout() error('Must be impleme...
local M = {} M.STATE_MENU = 1 M.STATE_CONTROLS = 2 M.STATE_SELECT =3 M.STATE_PLAYING = 4 M.STATE_PAUSED = 5 M.STATE_LEVELCLEAR = 6 M.TILE_SIZE = 16 M.state = M.STATE_MENU M.score = 0 M.level = 1 M.ammo = 0 M.fuel = 0 M.hull = 0 M.hover = 0 M.heli = 1 M.overbase = true M.num_hostages = 0 M.onboard = 0 M.rescued = 0 ...
local present, ts_config = pcall(require, "nvim-treesitter.configs") if not present then return end ts_config.setup { -- Ensure parsers are installed for these languages ensure_installed = { "lua", "css", "html" }, -- Don't install the parser for C ignore_install = { "c" }, -- Enable highlighti...
function util.retrieveStateVariables(menuID, variables) for key, value in pairs(variables) do variables[key] = state.GetValue(menuID..key) or value end end function util.saveStateVariables(menuID, variables) for key, value in pairs(variables) do state.SetValue(menuID..key, value) end en...
local skynet = require "skynet" local syslog = require "syslog" local aoi = require "map.aoi" local world local conf local pending_character = {} local online_character = {} local CMD = {} function CMD.init (w, c) world = w conf = c aoi.init (conf.bbox, conf.radius) end function CMD.character_enter (_, agent, ...
local Action = require(script.Parent.Action) --[=[ Constructs an Action from a table of properties. This allows you to setup everything, such as the name, callback, and input types, without having to call any methods. ```lua local action = Action.fromObject({ name = "foo", inputTypes = { Enum.KeyCode.E, ...
-- -- Please see the readme.txt file included with this distribution for -- attribution and copyright information. -- local sets = {}; local options = {}; local callbacks = {}; function isMouseWheelEditEnabled() return isOption("MWHL", "on") or Input.isControlPressed(); end function onInit() registerOption("DCLK...
resource_manifest_version "05cfa83c-a124-4cfa-a768-c24a5811d8f9" description 'ESX Lock System' version '1.0.0' client_scripts { "config/shared.lua", "client/VehicleManager_CL.lua", "client/client.lua" } server_scripts { "config/shared.lua", "server/chatCommand.lua", "server/server.lua" } ui...
local default = { -- 你可以在此处自定义不同语言的执行方式 tasks = { c = "make", -- 可以是字符串,会发送到浮动终端执行 python = "python <file>", -- 尖括号标记预定义变量。见下方变量。 lua = function() -- 也可以执行一个函数 vim.cmd("luafile %") end, }, -- 此处可自定义浮动终端样式 style = { -- 边框,见 `:help nvim_open_win` ...
require("games/common2/mechine/mechineBase"); local OnlookerMatchMechine = class(MechineBase); function OnlookerMatchMechine:ctor(uid) self.m_lastState = MatchMechineConfig.STATUS_ONLOOKER; self.m_curState = MatchMechineConfig.STATUS_ONLOOKER; self.m_uid = uid or UserBaseInfoIsolater.getInstance():getUs...
object_building_kashyyyk_poi_kash_all_treewall_med_s01 = object_building_kashyyyk_shared_poi_kash_all_treewall_med_s01:new { } ObjectTemplates:addTemplate(object_building_kashyyyk_poi_kash_all_treewall_med_s01, "object/building/kashyyyk/poi_kash_all_treewall_med_s01.iff")
local rootPath = "lua/ns2_beta" -- Use powershell's dir -Directory or similair to get the list for now local moduleNames = { "ARC", "Camoflauge", "Fade", "FlameDamage", "Gorge", "Grenades", "GUIChangelog", "Lerk", "MarineCommAbilities", "MG", "Mine", "Onos", "Shared"...
--[[---------------------------------------------------------------------------- --- @file helpers.lua --- @brief Helpers functions and constants for unit tests. ----------------------------------------------------------------------------]]-- --- Test.Helpers module local Helpers = {} --------------------------------...
function bt(A,s,t) local asize=A:size() local m=asize[1] local n=asize[2] if(m%s~=0 or n%t~=0) then print("The dimensions of the first argument do not meet the conditions of block transpose.") return nil end local p=m/s local q=n/t local B=torch.zeros(s*q,t*p) for i=1,p do for j=1,q do B[{{((j-1)*s+1),(j*s)},{((i-1)*...
local util = require("spec.util") describe("records", function() it("can be declared with 'local type'", util.check [[ local type Point = record x: number y: number end local p: Point = {} p.x = 12 p.y = 12 ]]) it("can be declared with 'local record'", util.ch...
local Config = require('opus.config') local Event = require('opus.event') local itemDB = require('core.itemDB') local Milo = require('milo') local multishell = _ENV.multishell local os = _G.os local shell = _ENV.shell local config = Config.load('shop') local shopTab -- You will need t...
-- @namespace foundation.com -- -- The ProcessRunner is a registry and hosting class for coroutine processes. -- -- Please be aware that even though this is built to mimic erlang somewhat -- there is no proper scheduler, and processes are expected to have very, very -- short execution times, otherwise you run into the...
--[[ Copyright (c) 2009 Peter "Corsix" Cawley 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, dis...
--[[ Script to train twitter sentiment classifier using the Twitter Sentiment data loader. -]] require 'paths' require 'optim' require 'rnn' require 'nngraph' require 'cutorch' require 'cunn' local dl = require 'dataload' torch.setdefaulttensortype("torch.FloatTensor") --[[ Command line arguments --]] cmd = to...
Logger = {} Logger.__index = Logger function Logger.init(host,port,proto,format) local sock = require("socket") local json = require("cjson") local lgr = {} -- our new object setmetatable(lgr, Logger) -- make Account handle lookup if proto == "tcp" then lgr.socket = sock.tcp() -- init...
--[[ @module lvgl @summary switch_widget_demo @author Dozingfiretruck @version 1.0 @date 2021.07.12 ]] local sys = require "sys" log.info("sys", "from win32") local ui = {} local function screen_sw2event_handler( obj, event) if event == lvgl.EVENT_VALUE_CHANGED then sw_state = lvgl.switch_ge...
treat = require("treat") -- Given an url, this function returns a table -- with the page screenshoot, it's HTML contents -- and it's title. function page_info(splash, url) local ok, msg = splash:go(url) if not ok then return {ok=false, reason=msg} end local res = { html=splash:html(), ...
---------------------------------------- -- config.lua -- -- desc : device configuration -- -- rev : 2.0 -- -- date : 04/27/2021 -- -- author : tuan nguyen (pdxtigre) -- -- email : info@codesmiths.org -- -- website: https://codesm...
local t = Def.ActorFrame{} t[#t+1] = Def.ActorFrame{ LoadActor( "normal" )..{ OnCommand=function(self) self:zoom(1) if PREFSMAN:GetPreference("MenuTimer") then self:queuecommand("Tick") end; end; TickCommand=cmd(zoom,1.2;linear,0.3;zoom,1;sleep,0.7;queuecommand,"Tick"); OffCom...
local PLUGIN = PLUGIN netstream.Hook("ix_token_distr_request", function(client, paygradeIndex, workerCount, entity) local workerCountNum = tonumber(workerCount) local paygradeIndexNum = tonumber(paygradeIndex) if workerCountNum == nil then return end if paygradeIndexNum == nil then return end if !IsValid(entity...
local addonName, ns = ... local LibEvent = LibStub:GetLibrary("LibEvent.7000") local LibSchedule = LibStub:GetLibrary("LibSchedule.7000") local LibItemInfo = LibStub:GetLibrary("LibItemInfo.7000") local inspectByAddon = false local guids, inspecting = {}, false local members, numMembers = {}, 0 local itemsSlotTable ...
#!/usr/bin/env lua package.path = package.path..";../?.lua" local glfw = require("moonglfw") local gl = require("moongl") local glmath = require("moonglmath") local new_teapot = require("common.teapotpatch") local vec3, vec4 = glmath.vec3, glmath.vec4 local mat3, mat4 = glmath.mat3, glmath.mat4 local pi, rad = math.pi...
local liter = require(game:GetService('ReplicatedStorage').liter) return { ParameterGenerator = function() return 'a❤️❤️bc❤️de❤️❤️fa❤️❤️bc❤️de❤️❤️fa❤️❤️bc❤️de❤️❤️f' end, Functions = { Unicode = function(_, str) for _ in liter.unicode(str) do end end, Ascii = function(_, str) for _ i...
local typedefs = require "kong.db.schema.typedefs" return { name = "the-middleman", fields = { { consumer = typedefs.no_consumer }, { protocols = typedefs.protocols_http }, { config = { type = "record", fields = { { method = { type = "string", default = "POST", one_of = { "POST", "G...
--[[ Span contexts should be immutable ]] local rand_bytes = require "openssl.rand".bytes -- For zipkin compat, use 128 bit trace ids local function generate_trace_id() return rand_bytes(16) end -- For zipkin compat, use 64 bit span ids local function generate_span_id() return rand_bytes(8) end local span_context...
Rain = {width = 1, height = 1, deltaX = 1, deltaY = 1, rainAmount = 1} function Rain:new (o, width, height, deltaX, deltaY, rainAmount) o = o or {} setmetatable(o, self) self.__index = self self.width = width or 1 self.height = height or 1 self.deltaX = deltaX or 1 self.deltaY = deltaY or 1 self.rainAm...
slot0 = 0 function HUT_Var1() slot0 = slot0 + 2 print("x = ", print) end function HUT_Var3() slot0 = slot0 + 10 print("x = ", print) end slot1 = HUT_Var1 function HUT_Func() slot0() end function HUT_FUNC2() print("y = 4") end return
require "config" local utils = require("utils") local m = {} m.key = {} m.map = {} local majorkey = g_system_major_keys or {} m.key = {{}, majorkey[1] or 's', majorkey[2] or "system"} if hs.spoons.isLoaded("Caffeine") then local k = g_system_keymap.caffeine.key or 'space' local name = g_system_keymap.caffeine...
PLUGIN.name = "Equipment" PLUGIN.author = "Zadkiel" PLUGIN.desc = "Equipment" if (SERVER) then util.AddNetworkString("lootBoxOpen") util.AddNetworkString("openExamine") end nut.command.add("info", { adminOnly = false, syntax = "", onRun = function(client, args) net.Start( "openGear" ...
-- -- This is an ActiveRecord schema file. -- Dumped at 2018-10-07 03:02:16 -- local Structure = ActiveRecord.Schema:define(20181007030219) function Structure:create_tables() create_table("ammo", function(t) t:primary_key "id" t:string "type" t:integer "amount" t:integer "character_id" ...
if Server then local function GetClosestCyst(player) local origin = player:GetOrigin() local teamNumber = player:GetTeamNumber() -- get closest cyst inside 5m local targets = GetEntitiesForTeamWithinRange("Cyst", teamNumber, origin, 5) local target, range for _,t in ipairs(targets) do ...
AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) util.PrecacheSound( "apc_engine_start" ) util.PrecacheSound( "apc_engine_stop" ) util.PrecacheSound( "common/warning.wav" ) include('shared.lua') function ENT:Initialize() self.BaseClass.Initialize(self) self.Active = 0 self.damaged = 0 self:CreateEnviro...
-- title: QUEST FOR GLORY -- author: Deck http://deck.itch.io -- desc: roguelike game -- script: lua -- input: gamepad -- constants local CAM_W=240 local CAM_H=136 local MAP_W=1920 local MAP_H=1088 local CELL=8 local tiles={ KEY=176, HEART=177, POTION=178, SPIKES_HARMLESS=192, SPIKES_HARM=193, CLOSED_COFFER...
return function() local Strings = require(script.Parent.Strings) describe( "Strings and UTF8", function() describe( "charToHex", function() it( "encodes correctly", function() assert.equal("3C", Strings.charToHex("<")) end ) it( "encodes utf8 correctly", ...
local awful = require('awful') local updates_command = [[ sh -c ' pacman -Qu | wc -l ' ]] awful.widget.watch(updates_command, 3600, function(_,stdout) awesome.emit_signal("package::updates", tonumber(stdout)) end)
local display = false RegisterCommand("nui", function(source, args) SetDisplay(not display) end) --very important cb RegisterNUICallback("exit", function(data) SetDisplay(false) end) RegisterNUICallback("changeValue", function(data) local pos = GetEntityCoords(PlayerPedId()) local heading = GetEn...
-- infile command syntax: -- P*button* - Press *button* -- R - Reset -- W - Pause (as in "Wait") -- A*number* - Advance *number* frames uninterrupted -- I (or anything else but preferably I because other things could be reassigned in the future) - Ignore inputs and continue --emu.speedmode("maximum") --emu.speedmode("t...
-- Autogenerated from KST: please remove this line if doing any edits by hand! local luaunit = require("luaunit") require("enum_deep_literals") TestEnumDeepLiterals = {} function TestEnumDeepLiterals:test_enum_deep_literals() local r = EnumDeepLiterals:from_file("src/enum_0.bin") luaunit.assertEquals(r.is_...
(function() local exepath = package.cpath:sub(1, package.cpath:find(';')-6) package.path = package.path .. ';' .. exepath .. '..\\..\\?.lua' end)() require 'filesystem' local bignum = require 'rsa.bignum' local _sha1 = require 'rsa.sha1' local rootpath = fs.get(fs.DIR_EXE):parent_path():parent_path():parent_path()...
local utf8 = require 'lua-utf8' local function to_bool(value) return not not value end local function get_list_chars(s) local output = {} for k, c in utf8.codes(s) do table.insert(output, utf8.char(c)) end return output end local str = { __VERSION = '1.4.0', __DESCRIPTION = '', ...
resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9' client_script "@NativeUI/NativeUI.lua" client_script 'client.lua' client_script 'config.lua' client_script 'list.lua' server_script 'server.lua' server_script '@mysql-async/lib/MySQL.lua'
return { card_info = { _500 = "海", _501 = "島", _502 = "森", _503 = "山", _504 = "沼", _505 = "枯地", _506 = "平地", _507 = "雪原", _508 = "伝書鳩", _509 = "帰還" } }
functions = {} function functions.initialiseMap() for row = 1, NUMBER_OF_ROWS do MAP[row] = {} end for col = 1, NUMBER_OF_COLS do for row = 1,NUMBER_OF_ROWS do MAP[row][col] = {} end end end function functions.getXYfromRowCol(row, col) -- determine the drawing x based on column ...
math.randomseed(os.time()) -- Generate random seed hook.Add("PlayerSay","RollDatRPDice",function(ply, text) if string.Explode(" ",text,false)[1] == "!dice" then local tabText = string.Explode(" ",text,false) if !isnumber(tabText[2]) or !isnumber(tabText[4]) then return end local random = math.random(0,tonumber(t...
Config = {} Config.MemberShipPrice = 100 Config.EnableSkills = false Config.NameExportSkill = 'by_skills' Config.TextToGym = " [ ~r~E ~w~] to do " Config.TextToShop = " [ ~r~E ~w~] to open the shop." Config.Text3d = true Config.TimerToRest = 60000 * 1 -- This is 1 minute Config.Items = { { ...
local isVisible = false local lastTooltipX = nil local lastTooltipY = nil Game.Tooltip.RegisterRequestListener("Stat", function(request, ui, uiType, event, id, statOrWidth, ...) local stat = SheetManager:GetEntryByGeneratedID(id, "Stat") if stat then request.Stat = stat.ID end end, "before") Game.Tooltip.Registe...
-- -- Register digtron ejector for tronwrench -- local definition = { name = 'digtron_ejector', nodes = "digtron:inventory_ejector", group = 'digtron ejector', protection_bypass_read = "interact", } function definition:copy(node, pos, player) local meta = minetest.get_meta(pos) return { description = metatool...
minetest.register_on_generated(function(minp) local min_mapblock = blockexchange_mapgen.get_mapblock(minp) local chunk_pos = blockexchange_mapgen.get_chunkpos_from_mapblock(min_mapblock) blockexchange_mapgen.load_chunk(chunk_pos) end)
name="2" template="tool"
local bin = vim.fn.stdpath("data") .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js" local lsp_config = require("lsp") if vim.fn.filereadable(bin) == 0 then require("lspinstall").install_server("html") end local capabilities = vim.lsp.protocol.make_client_capabilities() capa...
repeat for i, X_i in ipairs(X) do for j, X_j in ipairs(X) do status = A[i][j]:next() end end until not status
function run() local o = java.require('java/lang/System') o.out:println('test') local t = java.require('java/lang/Thread') t:sleep(100) end tb={run=run}
local Table = {} -- CHECK IF IN TABLE -- function Table.hasValue (tab, val) for index, value in ipairs (tab) do if value == val then return true end end return false end return Table
require 'funcs' local MarathonA1Game = require 'tetris.modes.marathon_a1' local Piece = require 'tetris.components.piece' local History4RollsRandomizer = require 'tetris.randomizers.history_4rolls' local SurvivalA1Game = MarathonA1Game:extend() SurvivalA1Game.name = "Survival A1" SurvivalA1Game.hash = "SurvivalA1" ...
-- This defines utility functions used to roll random buff drops. local BUFF_GROUPS_DATA = require "buff_effects.buff_groups_data" local deepcopy = require "deepcopy" local GAUNTLET_DEFS = require "defs.gauntlet_defs" local gauntlet_data = require "gauntlet_data" -- Similar to entity groups, we define which buffs can ...
local E, L, V, P, G = unpack(ElvUI) -- import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local EDB = E:GetModule("DataBars") -- ElvUI's DataBars local EPDBC = E:GetModule("EPDBC") -- this AddOn local function UpdateExperience(self) local bar = EDB.StatusBars.Experience local r, g, b, a = bar:GetSta...
--- === plugins.core.streamdeck.manager === --- --- Elgato Stream Deck Manager Plugin. local require = require local log = require "hs.logger".new "streamDeck" local application = require "hs.application" local canvas = require "hs.canvas" local fnutils = require "hs.fnutils"...
--[[ Adds a /exportraid slash command that can export loot tables from the EncounterJournal ]] SLASH_EXPORTRAID1 = "/exportraid" local txt = "" local replace = "" local replace2 = "" local box local function addLine(str) txt = txt .. " ".. str .. "\r\n" end local function addSpacer(count, txt) if not count then ...
setmetatable(_G, { __index = function() return "nope" end }) assert.Equal("nope", a) a = "yup" assert.Equal("yup", a)
local M = {} M.score = 0 -- Set the score to 0 initially function M.init(options) local customOptions = options or {} local opt = {} opt.fontSize = customOptions.fontSize or 24 opt.font = customOptions.font or native.systemFont opt.x = customOptions.x or display.contentCenterX opt.y = custo...
-- example config file, edit this however you'd like -- use a custom config file with luarunner -C config.lua -- if these specific fields aren't present, luarunner -- will fall back to a default config table return { -- the fallback editor to be used -- can be optionally specified with -e editor = "/usr/bin/nano",...
--- Utility functions for use with collection service tags -- @module CollectionServiceUtils local CollectionService = game:GetService("CollectionService") local CollectionServiceUtils = {} function CollectionServiceUtils.findFirstAncestor(tagName, child) assert(type(tagName) == "string") assert(typeof(child) == "...
--- Module for generating float values. -- @lqc.generators.float -- @alias new local Gen = require 'lqc.generator' -- Generates a random float. -- @param numtests Number of times this generator is called in a test; used to -- guide the randomization process. -- @return random float (between - numtes...
local utils = require "utils" local Object = require "object" local Objects = require "objects" local Bar = Object.new() Bar.w = 810 Bar.h = 60 function Bar.image() local function img(id, num) return {id = id, src = 1, x = 0, y = Bar.h * num, w = Bar.w, h = Bar.h} end return { img("bar_song", 0), img...
MissileBehavior = {} MissileBehavior.e = {} ------------------------------------------------------ -- System events ------------------------------------------------------ function MissileBehavior:new() local u = {} setmetatable(u, self) self.__index = self return u end function MissileBehavior:onConnect(opt)...
-- -- Created by IntelliJ IDEA. -- User: v-liujp05 -- Date: 2019/11/26 -- Time: 19:01 -- To change this template use File | Settings | File Templates. -- redis.log(redis.LOG_WARNING,'start'); local function hgetall(hash_key) local flat_map = redis.call('HGETALL', hash_key) local result = {} for i = 1, #flat...
set = {2, 2, 2, 3, 3, 5} dim = 6 enum = {} denom = {} whl = {} enum_p = {} value = {} qq = {} brojilac = {} max = 500 for i = 1,2 do qq = lib.math.random_shuffle(set) ind = 1 + math.random(3) denom[i] = 1 for j = 1,ind do denom[i] = denom[i] * qq[j]; end enum[i] = denom[i] + math.random(max-...
export['cel'] { [[The main module of the Cel libarary.]]; metaceldef['cel'] { source = 'cel'; description = { [[This table is the description of a cel, which is the information required to render the cel. Every cel will contain this information in its description.]]; code[=[ { ...