content
stringlengths 5
1.05M
|
|---|
pg = pg or {}
pg.enemy_data_statistics_373 = {
[209102] = {
cannon = 7,
reload = 150,
speed_growth = 0,
cannon_growth = 576,
base = 248,
air = 0,
durability_growth = 60000,
dodge = 26,
antiaircraft = 25,
speed = 33,
luck = 0,
reload_growth = 0,
dodge_growth = 320,
battle_unit_type = 50,
antisub = 0,
hit = 15,
antisub_growth = 0,
air_growth = 0,
antiaircraft_growth = 2016,
torpedo = 58,
durability = 150,
armor_growth = 0,
torpedo_growth = 4608,
luck_growth = 0,
hit_growth = 228,
armor = 0,
id = 209102,
world_enhancement = {
2.5,
7.3,
1.7,
0.8,
1.2,
1.2,
0
},
appear_fx = {},
equipment_list = {
1000710,
1000715,
1000720,
1000725,
1000730,
1000735
}
},
[209103] = {
cannon = 7,
reload = 150,
hit_growth = 228,
cannon_growth = 576,
speed_growth = 0,
air = 0,
base = 273,
dodge = 26,
durability_growth = 60000,
antiaircraft = 25,
speed = 33,
reload_growth = 0,
dodge_growth = 320,
luck = 0,
battle_unit_type = 50,
hit = 15,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 60,
durability = 150,
armor_growth = 0,
torpedo_growth = 4836,
luck_growth = 0,
antiaircraft_growth = 2016,
armor = 0,
id = 209103,
world_enhancement = {
2.5,
7.3,
1.7,
0.8,
1.2,
1.2,
0
},
appear_fx = {}
},
[209201] = {
cannon = 7,
reload = 150,
speed_growth = 0,
cannon_growth = 720,
base = 124,
air = 0,
durability_growth = 18000,
dodge = 0,
antiaircraft = 19,
speed = 15,
luck = 0,
reload_growth = 0,
dodge_growth = 0,
battle_unit_type = 20,
antisub = 0,
hit = 9,
antisub_growth = 0,
air_growth = 0,
antiaircraft_growth = 1920,
torpedo = 14,
durability = 113,
armor_growth = 0,
torpedo_growth = 1440,
luck_growth = 0,
hit_growth = 129,
armor = 0,
id = 209201,
world_enhancement = {
3,
2.6,
1.5,
1.4,
2.6,
1.5,
0
},
appear_fx = {},
equipment_list = {
1000605,
1000610
}
},
[209202] = {
cannon = 12,
reload = 150,
speed_growth = 0,
cannon_growth = 1200,
pilot_ai_template_id = 20005,
air = 0,
base = 125,
dodge = 0,
durability_growth = 30000,
antiaircraft = 12,
speed = 15,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
battle_unit_type = 20,
hit = 9,
antisub_growth = 0,
air_growth = 0,
antiaircraft_growth = 1200,
torpedo = 10,
durability = 188,
armor_growth = 0,
torpedo_growth = 960,
luck_growth = 0,
hit_growth = 129,
armor = 0,
id = 209202,
antisub = 0,
world_enhancement = {
3,
1.5,
1.5,
1.4,
2.6,
1.5,
0
},
appear_fx = {},
equipment_list = {
1000615,
1000620,
1000625
}
},
[209203] = {
cannon = 14,
reload = 150,
hit_growth = 228,
cannon_growth = 1152,
pilot_ai_template_id = 10001,
air = 0,
speed_growth = 0,
dodge = 19,
base = 247,
durability_growth = 75000,
antiaircraft = 58,
reload_growth = 0,
dodge_growth = 240,
speed = 24,
luck = 0,
hit = 15,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 43,
durability = 188,
armor_growth = 0,
torpedo_growth = 3456,
luck_growth = 0,
antiaircraft_growth = 4608,
armor = 0,
id = 209203,
world_enhancement = {
2.5,
6.3,
1.5,
0,
1.2,
1.2,
0
}
},
[209204] = {
cannon = 14,
reload = 150,
speed_growth = 0,
cannon_growth = 1152,
base = 249,
air = 0,
durability_growth = 75000,
dodge = 19,
antiaircraft = 58,
speed = 24,
luck = 0,
reload_growth = 0,
dodge_growth = 240,
battle_unit_type = 55,
antisub = 0,
hit = 15,
antisub_growth = 0,
air_growth = 0,
antiaircraft_growth = 4608,
torpedo = 43,
durability = 188,
armor_growth = 0,
torpedo_growth = 3456,
luck_growth = 0,
hit_growth = 228,
armor = 0,
id = 209204,
world_enhancement = {
2.5,
6.3,
1.5,
0,
1.2,
1.2,
0
},
appear_fx = {},
equipment_list = {
1000680,
1000685,
1000690,
1000695,
1000700,
1000705
}
},
[209205] = {
cannon = 25,
reload = 150,
speed_growth = 0,
cannon_growth = 2016,
base = 250,
air = 0,
durability_growth = 105000,
dodge = 20,
antiaircraft = 36,
speed = 18,
luck = 0,
reload_growth = 0,
dodge_growth = 120,
battle_unit_type = 55,
antisub = 0,
hit = 15,
antisub_growth = 0,
air_growth = 0,
antiaircraft_growth = 2880,
torpedo = 29,
durability = 263,
armor_growth = 0,
torpedo_growth = 2304,
luck_growth = 0,
hit_growth = 228,
armor = 0,
id = 209205,
world_enhancement = {
2.5,
3.5,
2.3,
0.5,
1.2,
1.2,
1.1
},
appear_fx = {},
equipment_list = {
1000740,
1000745,
1000750,
1000755,
1000760,
1000765,
1000770
}
},
[209206] = {
cannon = 15,
reload = 150,
hit_growth = 228,
cannon_growth = 1176,
speed_growth = 0,
air = 0,
base = 274,
dodge = 19,
durability_growth = 75000,
antiaircraft = 59,
speed = 24,
reload_growth = 0,
dodge_growth = 240,
luck = 0,
battle_unit_type = 55,
hit = 15,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 44,
durability = 188,
armor_growth = 0,
torpedo_growth = 3528,
luck_growth = 0,
antiaircraft_growth = 4704,
armor = 0,
id = 209206,
world_enhancement = {
2.5,
6.3,
1.5,
0,
1.2,
1.2,
0
},
appear_fx = {}
},
[209207] = {
cannon = 26,
reload = 150,
hit_growth = 228,
cannon_growth = 2112,
speed_growth = 0,
air = 0,
base = 275,
dodge = 20,
durability_growth = 110260,
antiaircraft = 36,
speed = 18,
reload_growth = 0,
dodge_growth = 120,
luck = 0,
battle_unit_type = 55,
hit = 15,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 29,
durability = 276,
armor_growth = 0,
torpedo_growth = 2304,
luck_growth = 0,
antiaircraft_growth = 2880,
armor = 0,
id = 209207,
world_enhancement = {
2.5,
3.5,
2.3,
0.5,
1.2,
1.2,
1.1
},
appear_fx = {}
},
[209301] = {
cannon = 22,
reload = 150,
speed_growth = 0,
cannon_growth = 2160,
pilot_ai_template_id = 20005,
air = 0,
base = 126,
dodge = 0,
durability_growth = 54000,
antiaircraft = 12,
speed = 15,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
battle_unit_type = 20,
hit = 5,
antisub_growth = 0,
air_growth = 0,
antiaircraft_growth = 1200,
torpedo = 0,
durability = 338,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 72,
armor = 0,
id = 209301,
antisub = 0,
world_enhancement = {
3,
1.5,
1.5,
2.1,
2.6,
1.5,
0
},
appear_fx = {},
equipment_list = {
1000630,
1000635,
1000640
}
},
[209302] = {
cannon = 43,
reload = 150,
speed_growth = 0,
cannon_growth = 3456,
base = 251,
air = 0,
durability_growth = 165000,
dodge = 24,
antiaircraft = 36,
speed = 14,
luck = 0,
reload_growth = 0,
dodge_growth = 40,
battle_unit_type = 65,
antisub = 0,
hit = 8,
antisub_growth = 0,
air_growth = 0,
antiaircraft_growth = 2880,
torpedo = 0,
durability = 413,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 126,
armor = 0,
id = 209302,
world_enhancement = {
2.5,
0.9,
2.3,
0.9,
1.2,
2.7,
3
},
appear_fx = {},
equipment_list = {
1000775,
1000780,
1000785,
1000790,
1000795
}
},
[209303] = {
cannon = 43,
reload = 150,
hit_growth = 126,
cannon_growth = 3456,
speed_growth = 0,
air = 0,
base = 261,
dodge = 24,
durability_growth = 165000,
antiaircraft = 36,
speed = 14,
reload_growth = 0,
dodge_growth = 40,
luck = 0,
antisub = 0,
hit = 8,
antisub_growth = 0,
air_growth = 0,
torpedo = 0,
durability = 413,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
antiaircraft_growth = 2880,
armor = 0,
id = 209303,
world_enhancement = {
2.5,
0.9,
2.3,
0.9,
1.2,
2.7,
3
},
appear_fx = {}
},
[209304] = {
cannon = 45,
reload = 150,
hit_growth = 126,
cannon_growth = 3624,
speed_growth = 0,
air = 0,
base = 276,
dodge = 24,
durability_growth = 173260,
antiaircraft = 38,
speed = 14,
reload_growth = 0,
dodge_growth = 40,
luck = 0,
battle_unit_type = 65,
hit = 8,
antisub_growth = 0,
air_growth = 0,
antisub = 0,
torpedo = 0,
durability = 433,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
antiaircraft_growth = 3024,
armor = 0,
id = 209304,
world_enhancement = {
2.5,
0.9,
2.3,
0.9,
1.2,
2.7,
3
},
appear_fx = {}
},
[209401] = {
cannon = 0,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
pilot_ai_template_id = 20005,
air = 14,
base = 127,
dodge = 0,
durability_growth = 42000,
antiaircraft = 16,
speed = 15,
reload_growth = 0,
dodge_growth = 0,
luck = 0,
battle_unit_type = 20,
hit = 5,
antisub_growth = 0,
air_growth = 1440,
antiaircraft_growth = 1560,
torpedo = 0,
durability = 263,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 72,
armor = 0,
id = 209401,
antisub = 0,
world_enhancement = {
3,
3.5,
1.5,
2.1,
2.6,
1.5,
0
},
appear_fx = {},
equipment_list = {
1000645,
1000650,
1000655,
1000660
}
},
[209402] = {
cannon = 0,
reload = 150,
speed_growth = 0,
cannon_growth = 0,
base = 252,
air = 50,
durability_growth = 135000,
dodge = 6,
antiaircraft = 47,
speed = 18,
luck = 0,
reload_growth = 0,
dodge_growth = 80,
battle_unit_type = 60,
antisub = 0,
hit = 8,
antisub_growth = 0,
air_growth = 4032,
antiaircraft_growth = 3744,
torpedo = 0,
durability = 338,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
hit_growth = 126,
armor = 0,
id = 209402,
world_enhancement = {
2.5,
2.6,
2.3,
0.9,
0.2,
2.7,
0.2
},
appear_fx = {},
equipment_list = {
1000800,
1000805,
1000810,
1000815,
1000820
}
},
[209403] = {
cannon = 0,
reload = 150,
hit_growth = 126,
cannon_growth = 0,
speed_growth = 0,
air = 53,
base = 277,
dodge = 6,
durability_growth = 141760,
antiaircraft = 47,
speed = 18,
reload_growth = 0,
dodge_growth = 80,
luck = 0,
battle_unit_type = 60,
hit = 8,
antisub_growth = 0,
air_growth = 4228,
antisub = 0,
torpedo = 0,
durability = 354,
armor_growth = 0,
torpedo_growth = 0,
luck_growth = 0,
antiaircraft_growth = 3744,
armor = 0,
id = 209403,
world_enhancement = {
2.5,
2.6,
2.3,
0.9,
0.2,
2.7,
0.2
},
appear_fx = {}
}
}
return
|
local mockagne = require 'mockagne'
local when = mockagne.when
local any = mockagne.any
local verify = mockagne.verify
describe('server - main', function()
setup(function()
_G.unpack = table.unpack
_G.Config = {Formulas = {moneyPerLevel = function(level) return 5 * level end}}
_G.Wrapper = mockagne.getMock()
_G.source = 'source'
require('../../src/lib/stream')
require('../../src/server/main')
end)
it('verify esx event triggered', function()
verify(_G.Wrapper.TriggerEvent('esx:getSharedObject', any()))
end)
it('verify finish level events registered', function()
verify(_G.Wrapper.RegisterNetEvent('blargleambulance:finishLevel'))
verify(_G.Wrapper.AddEventHandler('blargleambulance:finishLevel', any()))
end)
it('finishLevel called -- finds player based on source and awards level-appropriate amount of money', function()
local esxMock = mockagne.getMock()
local playerMock = mockagne.getMock()
getFunctionFromNativeCall('TriggerEvent', 'esx:getSharedObject')(esxMock)
when(esxMock.GetPlayerFromId('source')).thenAnswer(playerMock)
getFunctionFromNativeCall('AddEventHandler', 'blargleambulance:finishLevel')(5)
verify(playerMock.addMoney(25))
end)
function getFunctionFromNativeCall(nativeName, eventName)
return Stream.of(_G.Wrapper.stored_calls)
.filter(function(wrapperCall) return wrapperCall.key == nativeName end)
.filter(function(wrapperCall) return wrapperCall.args[1] == eventName end)
.map(function(wrapperCall) return wrapperCall.args[2] end)
.collect()[1]
end
end)
|
-- "full" for full path like collapses home directory
local pathTypeFull = "full"
-- "folder" for folder name only like System32
local pathTypeFolder = "folder"
local function pathReplace(path, leader, replace)
local gsub = string.gsub
-- anchor to the start and escape any special pattern chars
leader = "^" .. gsub(leader, "[%%%]%^%-$().[*+?]", "%%%1")
-- ensure replace is escaped properly
replace = gsub(replace, "%%", "%%%%")
return gsub(path, leader, replace)
end
local function contextContent(cwd, options, context)
if not options then return nil end
context = context[options.context]
if not context then return nil end
local dir = nil
if options.dir then
dir = context[options.dir]
else
dir = context
end
if not dir then return nil end
local text = options.text and context[options.text]
if not text then
if options.placeholder then
text = options.placeholder
else
text = ""
end
end
if options.before then text = options.before .. text end
if options.after then text = text .. options.after end
return pathReplace(cwd, dir, text)
end
local function content(options, context)
-- fullpath
local cwd = context.cwd
-- show just current folder
if options.type == pathTypeFolder then
return FILE_basename(cwd)
else
local contexts = options.contexts
local contextOptions = options.contextOptions
for i, name in pairs(contexts) do
local text = contextContent(cwd, contextOptions[name], context)
if text then return text end
end
end
return cwd
end
local section = {
name = "path",
content = content,
options = {
leader = " in ",
type = pathTypeFull,
-- contexts applied in the order given, first one wins
contexts = {"npm", "git", "home"},
contextOptions = {
home = {context = "home", placeholder = "~"},
npm = {
context = "npm_package",
dir = "root",
text = "name",
placeholder = "npm",
before = UTF8char(0xf8d6) .. " ",
after = ""
},
git = {
context = "git_dir_info",
dir = "root",
text = "name",
placeholder = "git",
before = UTF8char(0xf1d2) .. " ",
after = ""
}
}
}
}
SECTION_register(section)
|
object_tangible_loot_creature_loot_collections_shattered_shard_unknown_06 = object_tangible_loot_creature_loot_collections_shared_shattered_shard_unknown_06:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_shattered_shard_unknown_06, "object/tangible/loot/creature/loot/collections/shattered_shard_unknown_06.iff")
|
--[[-----------------------------------------------------------------------------
* Infected Wars, an open source Garry's Mod game-mode.
*
* Infected Wars is the work of multiple authors,
* a full list can be found in CONTRIBUTORS.md.
* For more information, visit https://github.com/JarnoVgr/InfectedWars
*
* Infected Wars is free software: you can redistribute it and/or modify
* it under the terms of the MIT License.
*
* A full copy of the MIT License can be found in LICENSE.txt.
-----------------------------------------------------------------------------]]
if SERVER then
AddCSLuaFile("shared.lua")
end
SWEP.HoldType = "smg"
if CLIENT then
SWEP.PrintName = "Swarm Blaster"
SWEP.Author = "ClavusElite"
SWEP.Slot = 2
SWEP.SlotPos = 1
SWEP.ViewModelFlip = false
SWEP.ShowViewModel = false
SWEP.ShowWorldModel = false
SWEP.IgnoreBonemerge = false
SWEP.UseHL2Bonemerge = true
SWEP.ScaleDownLeftHand = true
SWEP.IconLetter = "/"
SWEP.SelectFont = "HL2MPTypeDeath"
killicon.AddFont("iw_und_swarmblaster", "HL2MPTypeDeath", SWEP.IconLetter, Color(255, 80, 0, 255 ))
end
function SWEP:InitializeClientsideModels()
self.VElements = {}
self.WElements = {
["swarmblaster"] = { type = "Model", model = "models/Weapons/w_smg1.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(9.5, 0.287, -4.557), angle = Angle(-10.87, 1.83, 180), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = "models/flesh", skin = 0, bodygroup = {} }
}
end
SWEP.Base = "iw_base"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/weapons/v_smg1.mdl"
SWEP.WorldModel = "models/weapons/w_smg1.mdl"
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Sound = Sound("SWARMBLASTER.Single2")//Sound("infectedwars/swarmblaster.wav")
SWEP.Primary.Recoil = 2
SWEP.Primary.Unrecoil = 7
SWEP.Primary.Damage = 5
SWEP.Primary.NumShots = 1
SWEP.Primary.ClipSize = 50
SWEP.Primary.Delay = 0.12
SWEP.Primary.DefaultClip = SWEP.Primary.ClipSize * 6
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "SMG1"
SWEP.Primary.Cone = 0.05
SWEP.Primary.ConeMoving = 0.13
SWEP.Primary.ConeCrouching = 0.03
SWEP.MuzzleEffect = "rg_muzzle_pistol"
SWEP.ShellEffect = "none"
--SWEP.IronSightsPos = Vector(-5.6, -6, 3.6)
--SWEP.IronSightsAng = Vector(0, 0, 0)
SWEP.Tracer = "black_tracer"
function SWEP:AdditionalCallback(attacker, tr, dmginfo)
local ent = tr.Entity
if ent:IsValid() and ent:IsPlayer() then
if ent:Team() ~= attacker:Team() then
local multiplier = 1
if attacker:HasBought("leech") then multiplier = 1.25 end
attacker:SetHealth( math.min(attacker:Health()+dmginfo:GetDamage()*multiplier,attacker:GetMaximumHealth()) )
end
end
end
function SWEP:ShootBullets1(dmg, numbul, cone)
local bullet = {}
bullet.Num = numbul
bullet.Src = self.Owner:GetShootPos()
bullet.Dir = self.Owner:GetAimVector()
bullet.Spread = Vector(cone, cone, 0)
bullet.Tracer = 1
bullet.Force = dmg * 0.5
bullet.Damage = dmg
bullet.TracerName = "black_tracer"
-- Leech HP
bullet.Callback = function ( attacker, tr, dmginfo )
local ent = tr.Entity
if ent:IsValid() and ent:IsPlayer() then
if ent:Team() ~= attacker:Team() then
local multiplier = 1
if attacker:HasBought("leech") then multiplier = 1.25 end
attacker:SetHealth( math.min(attacker:Health()+dmginfo:GetDamage()*multiplier,attacker:GetMaximumHealth()) )
end
end
end
self.Owner:FireBullets(bullet)
self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self.Owner:MuzzleFlash()
self.Owner:SetAnimation(PLAYER_ATTACK1)
end
|
if not vim.g.loaded_telescope then
return
end
local opts = { noremap = true, silent = false }
local actions = require('telescope.actions')
vim.api.nvim_set_keymap('n', '<leader><space>', '<cmd>Telescope find_files<cr>', opts)
vim.api.nvim_set_keymap('n', '<leader>b', '<cmd>Telescope buffers<cr>', opts)
-- close telescope after first esc
require('telescope').setup{
defaults = {
file_ignore_patterns = {"node_modules"},
mappings = {
i = {
["<esc>"] = actions.close,
["<del>"] = actions.delete_buffer
},
},
}
}
|
--------------------------------------------------------------------------
-- Lmod License
--------------------------------------------------------------------------
--
-- Lmod is licensed under the terms of the MIT license reproduced below.
-- This means that Lmod is free software and can be used for both academic
-- and commercial purposes at absolutely no cost.
--
-- ----------------------------------------------------------------------
--
-- Copyright (C) 2008-2018 Robert McLay
--
-- 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, sublicense, and/or sell copies of the Software, and to
-- permit persons to whom the Software is furnished to do so, subject
-- to the following conditions:
--
-- The above copyright notice and this permission notice shall be
-- included in all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
--
--------------------------------------------------------------------------
require("strict")
local M = {}
-- The table t can have the following forms:
-- t = { value = "..." }
-- t = { sn = "...", version = "..." }
function M.new(self, t)
local o = {}
setmetatable(o,self)
self.__index = self
if (t.value ~= nil) then
o.__kind = "value"
o.__value = t.value
end
if (t.sn) then
o.__kind = "module"
o.__sn = t.sn
o.__version = t.version
end
return o
end
function M.value(self)
if (self.__kind == "value") then
return { kind = "value", value = self.__value}
elseif (self.__kind == "module") then
return { kind = "module", sn = self.__sn, version = self.__version}
end
return {}
end
function M.display(self, de_slash)
if (self.__kind == "value") then
return self.__value or ''
elseif (self.__kind == "module") then
local v = self.__sn .. "/" .. self.__version
if (de_slash) then
return v:gsub("/","-")
else
return v
end
end
return "should not happen!!!"
end
return M
|
local DateUtil = require "dateutil"
DateUtil:__test_entry(true)
|
require("plugins.bufferline.setting")
require("plugins.bufferline.keymap")
|
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('XTemplate', {
__is_kind_of = "XLayer",
group = "Layers",
id = "PGVideoBackground",
PlaceObj('XTemplateWindow', {
'__class', "XLayer",
'ZOrder', -1,
'Background', RGBA(0, 0, 0, 255),
}, {
PlaceObj('XTemplateWindow', {
'__class', "XAspectWindow",
'Fit', "smallest",
}, {
PlaceObj('XTemplateWindow', {
'comment', "MM Video player",
'__class', "XVideo",
'FileName', "Movies/Main Menu",
'Looping', true,
'AutoPlay', true,
}),
}),
}),
})
|
local M = {}
M.config = function()
require("zen-mode").setup {
window = {
backdrop = 1,
height = .85, -- height of the Zen window
options = {
signcolumn = "no", -- disable signcolumn
number = false, -- disable number column
relativenumber = false -- disable relative numbers
-- cursorline = false, -- disable cursorline
-- cursorcolumn = false, -- disable cursor column
-- foldcolumn = "0", -- disable fold column
-- list = false, -- disable whitespace characters
}
},
plugins = {
gitsigns = {enabled = false} -- disables git signs
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
}
end
return M
|
---Extensions to the Lua standard math library.
---@module extensions.math
---@alias ext_math
local floor, min, max = math.floor, math.min, math.max
local ext_math = {}
for k, v in pairs(math) do
ext_math[k] = v
end
---A value that is never equal to itself.
---@see isnan
ext_math.nan = 0 / 0
---Returns `num` clamped to [minValue, maxValue].
---@param num number
---@param minValue number
---@param maxValue number
---@return number
function ext_math.clamp(num, minValue, maxValue)
return min(max(num, minValue), maxValue)
end
---Returns `num` rounded normally to `precision` decimals of precision.
---@param num number
---@param[opt] precision number
---@return number
function ext_math.round(num, precision)
local m = 10 ^ (precision or 0)
return floor(num * m + 0.5) / m
end
---Returns -1 for a negative number, 1 for a positive number and 0 for 0.
---@param n number
---@return number
function ext_math.sign(n)
return n > 0 and 1 or n == 0 and 0 or -1
end
---Returns the cube root of `n`.
---@param n number
---@return number
function ext_math.cbrt(n)
return n ^ (1 / 3)
end
---Returns the `base`th root of `n`.
---@param n number
---@param base number
---@return number
function ext_math.root(n, base)
if base < 1 or n % 2 == 0 and n < 0 then
return ext_math.nan
end
return n ^ (1 / base)
end
---Returns true if `n` is nan.
---@param n number
---@return boolean
function ext_math.isnan(n)
return n ~= n
end
return ext_math
|
local oop = require 'minioop'
local style = oop.class()
local function hex_to_rgb(hex)
hex = hex:gsub("#", "")
return tonumber(hex:sub(1,2), 16),
tonumber(hex:sub(3,4), 16),
tonumber(hex:sub(5,6), 16),
#hex > 7 and tonumber(hex:sub(7,8) or 255) or 255
end
function style:new()
local obj = {}
obj.back_color = '#FF00FF'
obj.borders_color = '#000000'
obj.text_color = '#000000'
return oop.object(self, obj)
end
function style:set_option(option, value)
self[option] = value
end
function style:set_back_color(hex_color)
self.back_color = hex_color
end
function style:set_borders_color(hex_color)
self.colors.borders = hex_color
end
function style:set_text_color(hex_color)
self.colors.text = hex_color
end
function style:draw_back(ox, oy, width, height)
love.graphics.setColor(hex_to_rgb(self.back_color))
love.graphics.rectangle('fill', ox, oy, width, height)
end
function style:draw_text(ox, oy, text)
end
function style:draw_borders(ox, oy, width, height)
end
return style
|
--[[
/////// //////////////////
/////// PROJECT: MTA iLife - German Fun Reallife Gamemode
/////// VERSION: 1.7.2
/////// DEVELOPERS: See DEVELOPERS.md in the top folder
/////// LICENSE: See LICENSE.md in the top folder
/////// /////////////////
]]
InventorySelectedItem = nil
InventoryData = {}
local currentUservehicle = false;
addEvent("onClientInventoryRecieve", true)
addEventHandler("onClientInventoryRecieve", getRootElement(),
function(JSONInventory, itemss)
InventoryData = fromJSON(JSONInventory)
refreshInventory()
if(itemss) then
Items = itemss;
end
end
)
Inventory = {
["Window"] = false,
["Image"] = {},
["Button"] = {},
["Label"] = {},
["Edit"] = {},
["List"] = {}
}
Inventory_CurrentSelectedCategory = 1
function showInventoryGui(iFaction, sType, iID)
if (not clientBusy) then
hideInventoryGui()
local sBenutzenString = "Benutzen";
if(iFaction == 1) then
sBenutzenString = "Lagern";
elseif(iFaction == 2) then
sBenutzenString = "Herausholen";
end
if(sType == "uservehicle") then
currentUservehicle = iID;
elseif(sType == "corporationstore") then
currentUservehicle = iID;
end
Inventory["Window"] = new(CDxWindow, "Inventar", 502, 427, true, true, "Center|Middle", 0, 0, {tocolor(125, 125, 155, 255), "res/images/dxGui/misc/icons/inventory.png", "Inventar"}, "Hier kannst du deine Items begutachten.")
Inventory["Window"]:setHideFunction(function()
Inventory["Window"] = nil
if(sType == "uservehicle") then
triggerServerEvent("onPlayerKofferaumFinished", localPlayer, currentUservehicle)
currentUservehicle = false;
end
end)
Inventory["Image"][2] = new(CDxImage, 16, 0, 75, 60, "/res/images/iBag.png",tocolor(255,255,255,255), Inventory["Window"])
Inventory["Image"][3] = new(CDxImage, 184, 24, 30, 30, "/res/images/left.png",tocolor(255,255,255,255), Inventory["Window"])
Inventory["Image"][4] = new(CDxImage, 467, 24, 30, 30, "/res/images/right.png",tocolor(255,255,255,255), Inventory["Window"])
Inventory["Image"][5] = new(CDxImage, 60, 70, 64, 64, "/res/images/none.png",tocolor(255,255,255,255), Inventory["Window"])
Inventory["Label"][1] = new(CDxLabel, ItemCategories[Inventory_CurrentSelectedCategory]["Name"],202, 18, 285, 56, tocolor(255,255,255,255), 1.0, "pricedown", "center", "top", Inventory["Window"])
Inventory["Label"][2] = new(CDxLabel, "", 9, 140, 175, 80, tocolor(255,255,255,255), 1, "clear", "center", "top", Inventory["Window"])
Inventory["Label"][3] = new(CDxLabel, "Anzahl:", 9, 275, 175, 30, tocolor(255,255,255,255), 1, "default", "left", "top", Inventory["Window"])
Inventory["List"][1] = new(CDxList, 196, 57, 293, 328, tocolor(125,125,125,200), Inventory["Window"])
Inventory["Button"][1] = new(CDxButton, sBenutzenString, 9, 226, 175, 42, tocolor(255,255,255,255), Inventory["Window"])
Inventory["Button"][2] = new(CDxButton, "Wegwerfen", 9, 342, 175, 42, tocolor(255,255,255,255), Inventory["Window"])
Inventory["Edit"][1] = new(CDxEdit, "1", 9, 299, 175, 42, "Number", tocolor(0,0,0,255), Inventory["Window"])
Inventory["List"][1]:addColumn("Name")
Inventory["List"][1]:addColumn("Anzahl")
for k,v in pairs(Items) do
if ( (InventoryData["Items"][tostring(v["ID"])]) and (v["Category"]["ID"] == Inventory_CurrentSelectedCategory) ) then
Inventory["List"][1]:addRow(v["Name"].."|"..InventoryData["Items"][tostring(v["ID"])])
end
end
Inventory["Button"][1]:addClickFunction(
function ()
if (Inventory["List"][1]:getRowData(1) == "nil") then
showInfoBox("error", "Du musst ein Item auswählen.")
return false
end
if (InventoryData["Items"][tostring(ItemNames[Inventory["List"][1]:getRowData(1)])] >1) then
InventorySelectedItem = Inventory["List"][1]:getSelectedRow()
end
if(sType == "uservehicle") then
if(iFaction == 1) then
triggerServerEvent("onPlayerKofferaumDepositItem", getLocalPlayer(), iID, ItemNames[Inventory["List"][1]:getRowData(1)], tonumber(Inventory["Edit"][1]:getText()))
elseif(iFaction == 2) then
triggerServerEvent("onPlayerKofferaumWithdrawItem", getLocalPlayer(), iID, ItemNames[Inventory["List"][1]:getRowData(1)], tonumber(Inventory["Edit"][1]:getText()))
end
elseif(sType == "corporationstore") then
if(iFaction == 1) then
triggerServerEvent("onPlayerCorporationLagerEinlager", getLocalPlayer(), iID, ItemNames[Inventory["List"][1]:getRowData(1)], tonumber(Inventory["Edit"][1]:getText()))
elseif(iFaction == 2) then
triggerServerEvent("onPlayerCorporationLagerAuslager", getLocalPlayer(), iID, ItemNames[Inventory["List"][1]:getRowData(1)], tonumber(Inventory["Edit"][1]:getText()))
end
else
if(iFaction == 1) then
triggerServerEvent("onPlayerFactionDepositItem", getLocalPlayer(), ItemNames[Inventory["List"][1]:getRowData(1)], tonumber(Inventory["Edit"][1]:getText()))
elseif(iFaction == 2) then
triggerServerEvent("onPlayerFactionWithdrawItem", getLocalPlayer(), ItemNames[Inventory["List"][1]:getRowData(1)], tonumber(Inventory["Edit"][1]:getText()))
else
triggerServerEvent("onPlayerUseItem", getLocalPlayer(), ItemNames[Inventory["List"][1]:getRowData(1)])
end
end
loadingSprite:setEnabled(true);
end
)
Inventory["Button"][2]:addClickFunction(
function ()
if (Inventory["List"][1]:getRowData(1) == "nil") then
showInfoBox("error", "Du musst ein Item auswählen.")
return false
end
if (tonumber(Inventory["Edit"][1]:getText()) >= 1 ) then
triggerServerEvent("onPlayerDeleteItem", getLocalPlayer(), ItemNames[Inventory["List"][1]:getRowData(1)], tonumber(Inventory["Edit"][1]:getText()))
loadingSprite:setEnabled(true);
else
showInfoBox("error", "Du musst eine Zahl > 0 eingeben.")
end
end
)
if(iFaction ~= nil) then
Inventory["Button"][2]:setDisabled(true);
end
Inventory["List"][1]:addClickFunction(
function()
if (Inventory["List"][1]:getRowData(1) ~= "nil") then
local ItemID = ItemNames[Inventory["List"][1]:getRowData(1)]
if(Items[ItemID]) and (Items[ItemID]["Description"]) then
Inventory["Label"][2]:setText(Items[ItemID]["Description"])
end
if (fileExists("res/images/items/"..ItemID..".png")) then
Inventory["Image"][5]:setImage("res/images/items/"..ItemID..".png")
else
Inventory["Image"][5]:setImage("res/images/none.png")
end
end
end
)
Inventory["Image"][3]:addClickFunction(
function()
if (Inventory_CurrentSelectedCategory ~= 1) then
Inventory_CurrentSelectedCategory = Inventory_CurrentSelectedCategory-1
else
Inventory_CurrentSelectedCategory = #ItemCategories
end
refreshInventory()
if ((Inventory["List"][1]:getRowCount() == 0) and (Inventory_CurrentSelectedCategory ~= 0)) then
Inventory["Image"][3]:onClick("left", "down")
end
end
)
Inventory["Image"][4]:addClickFunction(
function()
if (Inventory_CurrentSelectedCategory ~= #ItemCategories) then
Inventory_CurrentSelectedCategory = Inventory_CurrentSelectedCategory+1
else
Inventory_CurrentSelectedCategory = 1
end
refreshInventory()
if ((Inventory["List"][1]:getRowCount() == 0) and (Inventory_CurrentSelectedCategory ~= 0)) then
Inventory["Image"][4]:onClick("left", "down")
end
end
)
Inventory["Window"]:add(Inventory["Image"][2])
Inventory["Window"]:add(Inventory["Image"][3])
Inventory["Window"]:add(Inventory["Image"][4])
Inventory["Window"]:add(Inventory["Image"][5])
Inventory["Window"]:add(Inventory["Label"][1])
Inventory["Window"]:add(Inventory["Label"][2])
Inventory["Window"]:add(Inventory["Label"][3])
Inventory["Window"]:add(Inventory["List"][1])
Inventory["Window"]:add(Inventory["Button"][1])
Inventory["Window"]:add(Inventory["Button"][2])
Inventory["Window"]:add(Inventory["Edit"][1])
Inventory["Window"]:show()
end
end
function refreshInventory()
if (Inventory["Window"]) then
Inventory["List"][1]:clearRows()
Inventory["Label"][2]:setText("")
Inventory["Image"][5]:setImage("/res/images/none.png")
Inventory["Label"][1]:setText(ItemCategories[Inventory_CurrentSelectedCategory]["Name"])
for k,v in pairs(Items) do
if ( (InventoryData["Items"][tostring(v["ID"])]) and (v["Category"]["ID"] == Inventory_CurrentSelectedCategory) ) then
Inventory["List"][1]:addRow(v["Name"].."|"..InventoryData["Items"][tostring(v["ID"])])
end
end
if (InventorySelectedItem) then
Inventory["List"][1]:setSelectedRow(InventorySelectedItem)
InventorySelectedItem = nil
if (Inventory["List"][1]:getRowData(1) ~= "nil") then
local ItemID = ItemNames[Inventory["List"][1]:getRowData(1)]
Inventory["Label"][2]:setText(Items[ItemID]["Description"])
if (fileExists("res/images/items/"..ItemID..".png")) then
Inventory["Image"][5]:setImage("res/images/items/"..ItemID..".png")
else
Inventory["Image"][5]:setImage("res/images/none.png")
end
end
end
end
end
addEvent("toggleInventoryGui", true)
addEventHandler("toggleInventoryGui", getRootElement(),
function(id, ...)
if not(getElementData(localPlayer, "inlobby")) or (getElementData(localPlayer, "zuschauer")) then
if(Inventory["Window"]) then
hideInventoryGui()
else
showInventoryGui(id, ...)
if not(id) then
triggerServerEvent("onPlayerRefreshInventory", localPlayer);
end
end
end
end
)
function hideInventoryGui()
if (Inventory["Window"]) then
Inventory["Window"]:hide()
Inventory["Window"] = nil
end
end
addEvent("hideInventoryGui", true)
addEventHandler("hideInventoryGui", getRootElement(), hideInventoryGui)
|
local _, CLM = ...
CLM.LOG = { verbose = true }
local Logger = CLM.LOG
local function print(...) _G.print("|cffebb434CLM:|r", ...) end
local SEVERITY =
{
DEBUG = "DEBUG",
INFO = "INFO",
WARNING = "WARNING",
ERROR = "ERROR",
FATAL = "FATAL"
}
local LogEntry = { severity = nil, message = nil, timestamp = nil }
function LogEntry:new(severity, message)
local o = {}
setmetatable(o, self)
self.__index = self
o.severity = severity or SEVERITY.INFO
o.message = message or ""
o.timestamp = time()
return o
end
function Logger:format(entry)
return string.format("[%s]: %s", entry.severity, entry.message)
end
function Logger:log(entry)
if self.verbose == true then
print(self:format(entry))
end
table.insert(CLM_Logs, entry)
end
function Logger:Message(message)
print(message)
end
function Logger:Debug(message)
local entry = LogEntry:new(SEVERITY.DEBUG, message)
self:log(entry)
end
function Logger:Info(message)
self:log(LogEntry:new(SEVERITY.INFO, message))
end
function Logger:Warning(message)
self:log(LogEntry:new(SEVERITY.WARNING, message))
end
function Logger:Error(message)
self:log(LogEntry:new(SEVERITY.ERROR, message))
end
function Logger:Fatal(message)
self:log(LogEntry:new(SEVERITY.FATAL, message))
end
function Logger:Display(info, count)
local countSanitzied = type(count) == 'number' and tonumber(count) or 10
local numEntries = #CLM_Logs
print(numEntries)
if numEntries >= countSanitzied then
for i = numEntries - countSanitzied, numEntries - 1 do
print(self:format(CLM_Logs[i]))
end
else
for _, v in ipairs(CLM_Logs) do
print(self:format(v))
end
end
end
-- Module part
function Logger:Initialize()
CLM.LOG:Info("Logger initializing")
local options = {
logs = {
name = "CLM Logs",
desc = "Displays last CLM logs",
type = "execute",
handler = self,
func = "Display"
},
verbose = {
name = "Verbose",
desc = "Enables / disables verbose data printing during logging",
type = "toggle",
set = function(i, v) CLM.LOG.verbose = v end,
get = function(i) return CLM.LOG.verbose end
},
}
CLM.Interconnect.ConfigManager.Register(options)
end
CLM.Interconnect.Logger.Initialize = function() Logger:Initialize() end
|
require('telescope').load_extension('dap')
-- nvim-dap-ui
require("dapui").setup()
require("nvim-dap-virtual-text").setup()
require('dbg.python')
require('dbg.javascript')
vim.api.nvim_set_keymap('n', '<leader>dct', '<cmd>lua require"dap".continue()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dsv', '<cmd>lua require"dap".step_over()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dsi', '<cmd>lua require"dap".step_into()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dso', '<cmd>lua require"dap".step_out()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dtb', '<cmd>lua require"dap".toggle_breakpoint()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dsc', '<cmd>lua require"dap.ui.variables".scopes()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dhh', '<cmd>lua require"dap.ui.variables".hover()<CR>', {})
vim.api.nvim_set_keymap('v', '<leader>dhv', '<cmd>lua require"dap.ui.variables".visual_hover()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>duh', '<cmd>lua require"dap.ui.widgets".hover()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>duf',
"<cmd>lua local widgets=require'dap.ui.widgets';widgets.centered_float(widgets.scopes)<CR>", {})
vim.api.nvim_set_keymap('n', '<leader>dsbr',
'<cmd>lua require"dap".set_breakpoint(vim.fn.input("Breakpoint condition: "))<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dsbm',
'<cmd>lua require"dap".set_breakpoint(nil, nil, vim.fn.input("Log point message: "))<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dro', '<cmd>lua require"dap".repl.open()<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>drl', '<cmd>lua require"dap".repl.run_last()<CR>', {})
-- telescope-dap
vim.api.nvim_set_keymap('n', '<leader>dcc',
'<cmd>lua require"telescope".extensions.dap.commands{}<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dco',
'<cmd>lua require"telescope".extensions.dap.configurations{}<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dlb',
'<cmd>lua require"telescope".extensions.dap.list_breakpoints{}<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>dv',
'<cmd>lua require"telescope".extensions.dap.variables{}<CR>', {})
vim.api.nvim_set_keymap('n', '<leader>df',
'<cmd>lua require"telescope".extensions.dap.frames{}<CR>', {})
-- nvim-dap-virtual-text. Show virtual text for current frame
-- vim.g.dap_virtual_text = true
-- nvim-dap-ui
vim.api.nvim_set_keymap('n', '<leader>dui', '<cmd>lua require"dapui".toggle()<CR>', {})
|
local ADDON_NAME, Private = ...
do
local name = "Nerien's Ovale Scripts"
local ovale = LibStub and LibStub:GetLibrary("ovale")
local scripts = ovale and ovale.ioc and ovale.ioc.scripts
if scripts then
-- Export
Private.name = name
Private.scripts = scripts
Private.initialized = true
do
-- backwards compatibility for Ovale<=9.0.43
if not scripts.registerScript then
scripts.registerScript = scripts.RegisterScript
end
end
end
end
|
-----------------------------------
--
-- Zone: East_Ronfaure_[S] (81)
--
-----------------------------------
local ID = require("scripts/zones/East_Ronfaure_[S]/IDs")
require("scripts/globals/missions")
require("scripts/globals/helm")
require("scripts/globals/zone")
-----------------------------------
function onInitialize(zone)
UpdateNMSpawnPoint(ID.mob.MYRADROSH)
GetMobByID(ID.mob.MYRADROSH):setRespawnTime(math.random(5400, 7200))
tpz.helm.initZone(zone, tpz.helm.type.LOGGING)
end
function onZoneIn(player, prevZone)
local cs = -1
if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then
player:setPos(86.131, -65.817, 273.861, 25)
end
if (prevZone == tpz.zone.SOUTHERN_SAN_DORIA_S) then
if (player:getCurrentMission(WOTG) == tpz.mission.id.wotg.WHILE_THE_CAT_IS_AWAY) then
cs = 7
end
end
return cs
end
function onRegionEnter(player, region)
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
if (csid == 7) then
player:completeMission(WOTG, tpz.mission.id.wotg.WHILE_THE_CAT_IS_AWAY)
player:addMission(WOTG, tpz.mission.id.wotg.A_TIMESWEPT_BUTTERFLY)
end
end
|
--[[
© 2020 TERRANOVA do not share, re-distribute or modify
without permission of its author.
--]]
local character = ix.meta.character
function character:HasTrait(uniqueid)
local traits = self:GetData("traits", {})
for k, v in pairs(traits) do
if(v == uniqueid) then return true end;
end
return false;
end
|
ITEM.name = "IO7a"
ITEM.model ="models/kek1ch/merc_outfit.mdl"
ITEM.newModel ="models/stalkerisaac/playermodel/male_01_io7a.mdl"
ITEM.description= "An IO7a."
ITEM.longdesc = "One of the more common uniforms, seen around the zone. The IO7a is a popular use by many factions, thanks to it's great ability to deflect and or stop most calibers on it's armour. The IO7a itself is a uniform adapted from outside the zone, a tactical force uniform, sadly the tactical force itself is unknown, due to the secretive, and covered up operations. \n\nThe suit is popular with mercenaries, who very often engage in firefights to maintain their quality. It's also a popular choice with bandits, as the cheap price allows the common bandit to supply their rather cheap setup. The suit is the best low-class for good ballistic protection."
ITEM.width = 2
ITEM.height = 3
ITEM.price = 15000
ITEM.busflag = "suits1_1"
ITEM.br = 0.2
ITEM.fbr = 8
ITEM.ar = 0.05
ITEM.far = 1.5
ITEM.repairCost = ITEM.price/100*1
ITEM.ballisticlevels = {"0","ll","ll","l","l"}
ITEM.img = ix.util.GetMaterial("vgui/hud/io7a.png")
ITEM.weight = 8.200
ITEM.miscslots = 1
ITEM.newSkin = 0
ITEM.bodygroup = {0}
ITEM.bodygroupsub = {0}
ITEM.skincustom[1] = {
name = "Skin 0",
skingroup = 0,
}
ITEM.skincustom[2] = {
name = "Skin 1",
skingroup = 1,
}
ITEM.skincustom[3] = {
name = "Skin 2",
skingroup = 2,
}
ITEM.skincustom[4] = {
name = "Skin 3",
skingroup = 3,
}
ITEM.skincustom[5] = {
name = "Skin 4",
skingroup = 4,
}
ITEM.skincustom[6] = {
name = "Skin 5",
skingroup = 5,
}
ITEM.skincustom[7] = {
name = "Skin 6",
skingroup = 6,
}
ITEM.skincustom[8] = {
name = "Skin 7",
skingroup = 7,
}
ITEM.skincustom[9] = {
name = "Skin 8",
skingroup = 8,
}
ITEM.skincustom[10] = {
name = "Skin 9",
skingroup = 9,
}
ITEM.skincustom[11] = {
name = "Skin 10",
skingroup = 10,
}
ITEM.skincustom[12] = {
name = "Skin 11",
skingroup = 11,
}
ITEM.skincustom[13] = {
name = "Skin 12",
skingroup = 12,
}
ITEM.skincustom[14] = {
name = "Skin 13",
skingroup = 13,
}
ITEM.skincustom[15] = {
name = "Skin 14",
skingroup = 14,
}
ITEM.skincustom[16] = {
name = "Skin 15",
skingroup = 15,
}
ITEM.skincustom[17] = {
name = "Skin 16",
skingroup = 16,
}
ITEM.skincustom[18] = {
name = "Skin 17",
skingroup = 17,
}
ITEM.skincustom[19] = {
name = "Skin 18",
skingroup = 18,
}
ITEM.skincustom[20] = {
name = "Skin 19",
skingroup = 19,
}
ITEM.skincustom[21] = {
name = "Skin 20",
skingroup = 20,
}
ITEM.skincustom[22] = {
name = "Skin 21",
skingroup = 21,
}
ITEM.skincustom[23] = {
name = "Skin 22",
skingroup = 22,
}
ITEM.skincustom[24] = {
name = "Skin 23",
skingroup = 23,
}
ITEM.skincustom[25] = {
name = "Skin 24",
skingroup = 24,
}
ITEM.skincustom[26] = {
name = "Skin 25",
skingroup = 25,
}
ITEM.skincustom[27] = {
name = "Skin 26",
skingroup = 26,
}
ITEM.skincustom[28] = {
name = "Skin 27",
skingroup = 27,
}
ITEM.skincustom[29] = {
name = "Skin 28",
skingroup = 28,
}
ITEM.skincustom[30] = {
name = "Skin 29",
skingroup = 29,
}
ITEM.skincustom[31] = {
name = "Skin 30",
skingroup = 30,
}
ITEM.skincustom[32] = {
name = "Skin 31",
skingroup = 31,
}
ITEM.skincustom[33] = {
name = "Skin 32",
skingroup = 32,
}
ITEM.skincustom[34] = {
name = "Skin 33",
skingroup = 33,
}
|
--[[
This file is part of 'Masque', an add-on for World of Warcraft. For license information,
please see the included License.txt file.
* File...: Skins\Skins.lua
* Author.: StormFX
]]
local _, Core = ...
local error, setmetatable, type = error, setmetatable, type
-- Skin Data
local Skins = {}
Core.Skins = Skins
-- Skin List
local SkinList = {}
Core.SkinList = SkinList
-- Layers
local Layers = {
"Backdrop",
"Icon",
"Flash",
"Cooldown",
"Pushed",
"Normal",
"Disabled",
"Checked",
"Border",
"Gloss",
"AutoCastable",
"Highlight",
"Name",
"Count",
"HotKey",
"Duration",
"Shine",
}
-- Hidden Layer
local Hidden = {
Hide = true,
}
-- Adds data to the skin tables, bypassing the skin validation.
function Core:AddSkin(SkinID, SkinData)
for i = 1, #Layers do
local Layer = Layers[i]
if type(SkinData[Layer]) ~= "table" then
if Layer == "Shine" and type(SkinData.AutoCast) == "table" then
SkinData[Layer] = SkinData.AutoCast
else
SkinData[Layer] = Hidden
end
end
end
Skins[SkinID] = SkinData
SkinList[SkinID] = SkinID
end
-- API method for validating and adding skins.
function Core.API:AddSkin(SkinID, SkinData, Replace)
local debug = Core.db and Core.db.profile.Debug or false --by eui.cc
if type(SkinID) ~= "string" then
if debug then
error("Bad argument to method 'AddSkin'. 'SkinID' must be a string.", 2)
end
return
end
if Skins[SkinID] and not Replace then
return
end
if type(SkinData) ~= "table" then
if debug then
error("Bad argument to method 'AddSkin'. 'SkinData' must be a table.", 2)
end
return
end
local Template = SkinData.Template
if Template then
if Skins[Template] then
setmetatable(SkinData, {__index=Skins[Template]})
else
if debug then
error(("Invalid template reference by skin '%s'. Skin '%s' does not exist."):format(SkinID, Template), 2)
end
return
end
end
Core:AddSkin(SkinID, SkinData)
end
-- API method for returning the skins table.
function Core.API:GetSkins()
return Skins
end
-- API method returning a specific skin.
function Core.API:GetSkin(SkinID)
return SkinID and Skins[SkinID]
end
|
result = math.random(99)
ind = math.random(6) - 1
number2 = 10^ind
number1 = result * number2
|
local playsession = {
{"ausmister", {575805}},
{"mewmew", {570468}},
{"Menander", {225573}},
{"Altheraz", {564179}},
{"corbin9228", {54467}},
{"taroxyz", {552623}},
{"Evonix", {47756}},
{"HYPPS", {541548}},
{"rbas333", {63684}},
{"cipps", {513272}},
{"MontrealCrook", {512744}},
{"jan1412", {147985}},
{"hemuichi", {16095}},
{"NoSleepPanda", {49662}},
{"Nikkichu", {296445}},
{"Asteroz", {489717}},
{"Hiero", {484192}},
{"Xeter", {5182}},
{"Elrael", {445982}},
{"DuckBoy", {12831}},
{"T0eknee", {2564}},
{"0rabbit8", {15482}},
{"zeruelrojo", {336973}},
{"MuddledBox", {336761}},
{"ristvaken", {42334}},
{"ipozgaj", {2562}},
{"ksb4145", {226261}},
{"huashengmaodou", {9661}},
{"hazizzle", {37232}},
{"FlyingMonk3y", {30744}},
{"LockeCorp", {207799}},
{"Xoxlohunter", {2251}},
{"Loki_03", {59699}},
{"Biker", {406}},
{"grun2000", {15651}},
{"50fffff", {102513}},
{"Iownyoujk", {98616}},
{"dpoba", {97628}},
{"greattohave", {79327}},
{"banakeg", {72835}},
{"Sirnumnum", {42101}},
{"bogg19", {37962}}
}
return playsession
|
-- ========
-- Settings
-- ========
vim.o.title = true -- show the file name as title
vim.wo.number = true -- show line numbers.
vim.o.mouse = "a" -- enable mouse.
vim.o.history = 1000 -- increase history size.
vim.wo.wrap = false -- do not divide the line if it is long.
vim.wo.cursorline = true -- show the current line.
vim.o.synmaxcol = 160 -- show syntax highlight until column number.
-- default identation
vim.o.tabstop = 2 -- tabs with 2 spaces.
vim.o.shiftwidth = 2 --
vim.o.softtabstop = 2 --
vim.o.shiftround = true --
vim.o.expandtab = true -- inserts spaces indest <Tab>s.
-- vim.o.smartindent = true
--vim.cmd('set noexpandtab')
vim.o.hidden = true -- allow buffer switching without saving.
vim.o.ignorecase = true -- case insensitive for searchs.
vim.o.autoread = true
vim.o.spelllang = "en,es" -- spell check (english and spanish)
vim.o.encoding = "UTF-8" -- encodig utf-8
vim.o.backspace = "indent,eol,start" -- backspaceever work on insert mode
--vim.cmd([[set listchars=tab:\ \ ,trail:-,extends:>,precedes:<,nbsp:+]])
--vim.wo.list = true
--vim.o.lcs = [[tab: ,trail:-,extends:>,precedes:<,nbsp:+]]
vim.cmd("set shortmess+=c")
vim.o.clipboard = "unnamedplus"
vim.cmd('let NERDTreeQuitOnOpen=1')
vim.g.webdevicons_enable_nerdtree = 0
vim.g.completion_enable_auto_popup = 1
|
send
gpio.mode(1, gpio.INPUT)
flag = gpio.read(1)
tmr.delay(5000)
if gpio.read(1) == 0 and flag == 0 then
file.remove("connected")
end
if file.open("connected","r") == nil then
dofile("connect.lua")
else
dofile("connected.lua")
end
|
--
-- Example of stream decompress
--
-- Initialize:
local bzlib = require 'ffi_bzlib.decompress'
--[[
local bz = bzlib:new(
reducemem -- Optional. Default is 0.
-- In fact, this parameters is 'small'
-- of the function 'BZ2_bzDecompressInit'
)
]]--
local bz = bzlib:new()
local name = ...
if not name then
print("usage: luajit stream_decompress.lua FILENAME.bz2")
os.exit(0)
end
local fd1 = io.open(name, 'rb')
local fd2 = io.open(name .. '.txt', 'wb')
-- Append data:
while true do
local bin = fd1:read(4096)
if not bin then break end
--[[
local text, finish, err = bz:append(bin)
-- Append part of data to this method.
-- In case of success, 'finish' tells you wheather
-- the compressed stream comes to an end. That means
-- you can finish decompress when 'finish' is true.
-- In case of failed, it will return
-- nil and a string contains error message.
]]--
local text, finish, err = bz:append(bin)
if not text then
print('append no return')
break
end
--[[
The returned string may be '' because libbz2.so may buffer some data.
In this case, there is no need to write the file.
]]--
if #text > 0 then
fd2:write(text)
end
if finish then
print('stream end')
break
end
end
fd1:close()
fd2:close()
|
local qconsts = require 'Q/UTILS/lua/q_consts'
local is_in = require 'Q/UTILS/lua/is_in'
local in_qtypes = { 'I1', 'I2', 'I4', 'I8' }
return function (
a,
nb,
optargs
)
local subs = {};
assert(type(a) == "lVector")
assert(not a:has_nulls())
local in_qtype = a:qtype()
assert(is_in(in_qtype, in_qtypes))
--========================================
if ( type(nb) == "Scalar") then nb = nb:to_num() end
assert(type(nb) == "number")
assert( ( nb > 1) and ( nb < 1024) )
subs.nb = nb
--========================================
-- Keeping default is_safe value as true
-- This will not allow C code to write values at incorrect locations
local is_safe = true
if optargs then
assert(type(optargs) == "table")
if ( optargs["is_safe"] == false ) then
is_safe = optargs["is_safe"]
assert(type(is_safe) == "boolean")
end
end
subs.is_safe = is_safe
--========================================
subs.in_qtype = in_qtype
subs.in_ctype = assert(qconsts.qtypes[subs.in_qtype].ctype)
subs.cst_in_as = subs.in_ctype .. " *"
subs.out_qtype = "I8"
subs.out_ctype = assert(qconsts.qtypes[subs.out_qtype].ctype)
subs.cst_out_as = subs.out_ctype .. " *"
subs.fn = "numby_" .. in_qtype
subs.checking_code = " /* No checks made on value */ "
subs.bye = " "
if ( is_safe ) then
subs.fn = "numby_safe_" .. in_qtype
subs.checking_code =
" if ( ( x < 0 ) || ( (uint32_t)x >= nZ ) ) { go_BYE(-1); } "
subs.bye = "BYE: "
end
subs.tmpl = "OPERATORS/GROUPBY/lua/numby.tmpl"
subs.srcdir = "OPERATORS/GROUPBY/gen_src/"
subs.incdir = "OPERATORS/GROUPBY/gen_inc/"
subs.incs = { "OPERATORS/GROUPBY/gen_inc/", "UTILS/inc/" }
return subs
end
|
CodexDB["zones"]["deDE"]={
[1]="Dun Morogh",
[2]="Longshore",
[3]="Ödland",
[4]="Verwüstete Lande",
[7]="Schwarzmeerbucht",
[8]="Sümpfe des Elends",
[9]="Nordhaintal",
[10]="Dämmerwald",
[11]="Sumpfland",
[12]="Wald von Elwynn",
[13]="Der Weltbaum",
[14]="Durotar",
[15]="Marschen von Dustwallow",
[16]="Azshara",
[17]="Brachland",
[18]="Kristallsee",
[19]="Zul\'Gurub",
[20]="Moonbrook",
[21]="Kul Tiras",
[22]="Programmierer-Insel",
[23]="Der Nordhain",
[24]="Abtei von Nordhain",
[25]="Der Blackrock",
[26]="Leuchtturm",
[28]="Westliche Pestländer",
[30]="Nine",
[32]="Der Friedhof",
[33]="Schlingendorntal",
[34]="Echokammmine",
[35]="Booty Bay",
[36]="Alteracgebirge",
[37]="Der Nazferitisee",
[38]="Loch Modan",
[40]="Westfall",
[41]="Gebirgspass der Totenwinde",
[42]="Dunkelhain",
[43]="Die wilden Ufer",
[44]="Rotkammgebirge",
[45]="Arathihochland",
[46]="Brennende Steppe",
[47]="Hinterland",
[49]="Dead Man\'s Hole",
[51]="Sengende Schlucht",
[53]="Diebeslager",
[54]="Jaspismine",
[55]="Valley of Heroes UNUSED",
[56]="Heldenwache",
[57]="Tiefenschachtmine",
[59]="Weinberge von Nordhain",
[60]="Der Waldrand",
[61]="Donnerfälle",
[62]="Brackwells Kürbisbeet",
[63]="Hof der Stonefields",
[64]="Weinberge der Maclures",
[65]="***Dungeon auf Karte***",
[66]="***Dungeon auf Karte***",
[67]="***Dungeon auf Karte***",
[68]="Der Immerruhsee",
[69]="Seenhain",
[70]="Steinwacht",
[71]="Steinwachtfälle",
[72]="Das Dunkle Portal",
[73]="Die faulende Narbe",
[74]="Tränenteich",
[75]="Stonard",
[76]="Das Fallow Heiligtum",
[77]="Anvilmar",
[80]="Berge von Stormwind",
[81]="Jeff NO-Quadrant geändert",
[82]="Jeff NW-Quadrant",
[83]="Jeff SO-Quadrant",
[84]="Jeff SW-Quadrant",
[85]="Tirisfal",
[86]="Der Steinhügelsee",
[87]="Goldhain",
[88]="Holzfällerlager des Osttals",
[89]="Obsthain am Spiegelsee",
[91]="Turm von Azora",
[92]="Spiegelsee",
[93]="Ogerhort Vul\'Gol",
[94]="Rabenflucht",
[95]="Rotkammschlucht",
[96]="Der Turm von Ilgalar",
[97]="Althers Mühle",
[98]="Rethbanhöhlen",
[99]="Rebellenlager",
[100]="Nesingwarys Expedition",
[101]="Kurzens Truppenlager",
[102]="Ruinen von Zul\'Kunda",
[103]="Ruinen von Zul\'Mamwe",
[104]="Das finstere Riff",
[105]="Ogerhügel der Mosh\'Ogg",
[106]="Das Vorratslager",
[107]="Saldeans Farm",
[108]="Späherkuppe",
[109]="Furlbrows Kürbishof",
[111]="Der Jangoschacht",
[113]="Der Goldküstensteinbruch",
[115]="Der Leuchtturm von Westfall",
[116]="Das neblige Tal",
[117]="Das Basislager von Grom\'gol",
[118]="Whelgars Ausgrabungsstätte",
[120]="Weststromgarnison",
[121]="Der Friedhof \"Stille Gärten\"",
[122]="Ruinen von Zuuldaia",
[123]="Ruinen von Bal\'lal",
[125]="Ruinen von Kal\'ai",
[126]="Ruinen von Tkashi",
[127]="Ruinen von Balia\'mah",
[128]="Ruinen von Ziata\'jai",
[129]="Ruinen von Mizjah",
[130]="Silberwald",
[131]="Kharanos",
[132]="Das Coldridgetal",
[133]="Gnomeregan",
[134]="Der Gol\'bolar Steinbruch",
[135]="Höhle der Frostmane",
[136]="Der Graufelsbau",
[137]="Brewnall",
[138]="Nebelfichtenzuflucht",
[139]="Östliche Pestländer",
[141]="Teldrassil",
[142]="Ironbands Ausgrabungsstätte",
[143]="Festung Mo\'grosh",
[144]="Thelsamar",
[145]="Algaz-Tor",
[146]="Der Stonewroughtdamm",
[147]="Die Weitschreiter-Lodge",
[148]="Dunkelküste",
[149]="Silberbachmine",
[150]="Der Hafen von Menethil",
[151]="Designer-Insel",
[152]="Das Bollwerk",
[153]="Ruinen von Lordaeron",
[154]="Deathknell",
[155]="Nachtwebergrund",
[156]="Sollidens Bauernhof",
[157]="Agamands Mühlen",
[158]="Gruft der Familie Agamand",
[159]="Brill",
[160]="Flüstergärten",
[161]="Terrasse der Erholung",
[162]="Blendwassersee",
[163]="Gunthers Zufluchtsort",
[164]="Garrens Schlupfwinkel",
[165]="Balnirs Bauernhof",
[166]="Coldhearth-Anwesen",
[167]="Außenposten der Kreuzzügler",
[168]="Die Nordküste",
[169]="Die stille Küste",
[170]="Der Lordameresee",
[172]="Insel Fenris",
[173]="Faols Ruheplatz",
[186]="Dolanaar",
[187]="Darnassus UNUSED",
[188]="Shadowglen",
[189]="Steelgrills Depot",
[190]="Hearthglen",
[192]="Holzlager Northridge",
[193]="Die Ruinen von Andorhal",
[195]="Schule der Totenbeschwörung",
[196]="Uthers Grabmal",
[197]="Trauerhügel",
[198]="Die weinende Höhle",
[199]="Teufelssteinfeld",
[200]="Dalsons Tränenfeld",
[201]="Gahrrons Trauerfeld",
[202]="Das trostlose Feld",
[203]="Burg Mardenholde",
[204]="Pyrewood",
[205]="Dun Modr",
[206]="Westfall",
[207]="Das große Meer",
[208]="Ungenutzt - Ironcladbucht",
[209]="Burg Shadowfang",
[210]="***Dungeon auf Karte***",
[211]="Iceflowsee",
[212]="Helmsbedsee",
[213]="Tiefenfelsmine",
[214]="Das große Meer",
[215]="Mulgore",
[219]="Alexstons Bauernhof",
[220]="Red Cloud Mesa",
[221]="Camp Narache",
[222]="Bloodhoof",
[223]="Stonebullsee",
[224]="Überfallene Karawane",
[225]="Teufelsfelsen",
[226]="Das Huschdunkel",
[227]="Valgans Feld",
[228]="Das Grabmal",
[229]="Olsen\'s Farthing",
[230]="Der Graumarnwall",
[231]="Beren\'s Peril",
[232]="Die Morgeninseln",
[233]="Ambermill",
[235]="Burg Fenris",
[236]="Burg Shadowfang",
[237]="Die verfallene Fähre",
[238]="Maldens Obsthain",
[239]="Das Ivar-Feld",
[240]="Das Todesfeld",
[241]="Der verlassene Obstgarten",
[242]="Schattenhain",
[243]="Das verlassene Gut",
[244]="Der Whipple-Besitz",
[245]="Yorgens Bauernhof",
[246]="Der Kessel",
[247]="Grimesilt-Grabungsstätte",
[249]="Schreckensfels",
[250]="Die Ruinen von Thaurissan",
[251]="Flammenkamm",
[252]="Festung der Blackrock",
[253]="Die Aschensäule",
[254]="Der Blackrock",
[255]="Altar der Stürme",
[256]="Aldrassil",
[257]="Schattenweberhöhle",
[258]="Teufelsfels",
[259]="Al\'Amethsee",
[260]="Starbreeze",
[261]="Höhle der Knarzklauen",
[262]="Grabhügel von Ban\'ethil",
[263]="Die Kluft",
[264]="Die Lichtung des Orakels",
[265]="Der Wellspring",
[266]="Wellspringsee",
[267]="Vorgebirge von Hillsbrad",
[268]="Azshara-Krater",
[269]="Dun Algaz",
[271]="Southshore",
[272]="Tarrens Mühle",
[275]="Burg Durnholde",
[276]="UNUSED Stonewrought Pass",
[277]="Die Vorgebirgshöhlen",
[278]="Lordamere-Internierungslager",
[279]="Dalaran",
[280]="Strahnbrad",
[281]="Die Ruinen von Alterac",
[282]="Crushridgehöhle",
[283]="Schlächtergrotte",
[284]="Das Oberland",
[285]="Südwacht",
[286]="Die Felder von Hillsbrad",
[287]="Hillsbrad",
[288]="Der Azurschacht",
[289]="Nethander-Siedlung",
[290]="Dun Garok",
[293]="Thoradinswall",
[294]="Oststrand",
[295]="Weststrand",
[296]="South Seas UNUSED",
[297]="Die Insel Jaguero",
[298]="Baradinbucht",
[299]="Bucht von Menethil",
[300]="Nebelschilfstrand",
[301]="Die ungezähmte Küste",
[302]="Das Kristallufer",
[303]="Muschelschalenstrand",
[305]="North Tide\'s Run",
[306]="South Tide\'s Run",
[307]="Die Aussichtsklippen",
[308]="Das verbotene Meer",
[309]="Ironbeards Grabmal",
[310]="Kristalladermine",
[311]="Ruinen von Aboraz",
[312]="Janeirospitze",
[313]="Nordhof",
[314]="Go\'Sheks Hof",
[315]="Bauernhof der Dabyries",
[316]="Halle der Felsfäuste",
[317]="Witherbark",
[318]="Schlucht der Trockenstoppel",
[320]="Die Zuflucht",
[321]="Hammerfall",
[322]="Schiffswracks der Schwarzmeerräuber",
[323]="O\'Breens Lager",
[324]="Burg Stromgarde",
[325]="Der Turm von Arathor",
[326]="Das Sanktum",
[327]="Die Faldirbucht",
[328]="Das versunkene Riff",
[330]="Thandol-Übergang",
[331]="Ashenvale",
[332]="Das große Meer",
[333]="Kreis der östlichen Bindung",
[334]="Kreis der westlichen Bindung",
[335]="Kreis der inneren Bindung",
[336]="Kreis der äußeren Bindung",
[337]="Apocryphans Ruheplatz",
[338]="Festung Angor",
[339]="Die Lethlorklamm",
[340]="Kargath",
[341]="Camp Kosh",
[342]="Camp Boff",
[343]="Camp Wurg",
[344]="Camp Cagg",
[345]="Agmondkuppe",
[346]="Hammertoes Grabungsstätte",
[347]="Die Staubspeiergrotte",
[348]="Aerie Peak",
[349]="Burg Wildhammer",
[350]="Die Quel\'Danil-Hütte",
[351]="Skulk Rock",
[352]="Zun\'watha",
[353]="Shadra\'Alor",
[354]="Jintha\'Alor",
[355]="Der Altar von Zul",
[356]="Seradane",
[357]="Feralas",
[358]="Dornrankenklamm",
[359]="Bael Modan",
[360]="Die Mine der Venture Co.",
[361]="Teufelswald",
[362]="Klingenhügel",
[363]="Das Tal der Prüfungen",
[364]="Der Höhlenbau",
[365]="Koven der Brennenden Klinge",
[366]="Kolkarklippe",
[367]="Sen\'jin",
[368]="Die Echoinseln",
[369]="Donnergrat",
[370]="Staubwindklamm",
[371]="Staubwindhöhle",
[372]="Burg Tiragarde",
[373]="Schipperküste",
[374]="Messerbucht",
[375]="Killrogs Küste",
[377]="Der Südstrom",
[378]="Camp Taurajo",
[379]="Farwatch-Posten",
[380]="Crossroads",
[381]="Felsadermine",
[382]="Das Schlickermoor",
[383]="Die trockenen Hügel",
[384]="Glutnebelgipfel",
[385]="Die Feste Northwatch",
[386]="Die vergessenen Teiche",
[387]="Die blühende Oase",
[388]="Die brackige Oase",
[390]="Feld der Riesen",
[391]="Die Händlerküste",
[392]="Ratchet",
[393]="Strand der Darkspear",
[394]="Darrowmere Lake UNUSED",
[395]="Caer Darrow UNUSED",
[396]="Wasserbrunnen von Winterhoof",
[397]="Wasserbrunnen von Thunderhorn",
[398]="Wasserbrunnen von Wildmane",
[399]="Skylineridge",
[400]="Tausend Nadeln",
[401]="Die Tidusstaffel",
[403]="Gasthaus Zur süßen Ruh",
[404]="Grabungsstätte von Bael\'dun",
[405]="Desolace",
[406]="Steinkrallengebirge",
[407]="Orgrimmar UNUSED",
[408]="Gillijims Insel",
[409]="Insel des Doktor Lapidis",
[410]="Klingenschlucht",
[411]="Bathrans Schlupfwinkel",
[412]="Die Ruinen von Ordil\'Aran",
[413]="Maestras Posten",
[414]="Der Zoramstrand",
[415]="Astranaar",
[416]="Der Schrein von Aessina",
[417]="Schrein des sengenden Feuers",
[418]="Die Sternenstaubruinen",
[419]="Das heulende Tal",
[420]="Silberwindzuflucht",
[421]="Mystralsee",
[422]="Himmelssturzsee",
[424]="Irissee",
[425]="Mondbrunnen",
[426]="Raynewood",
[427]="Der Schattenwinkel",
[428]="Nachtflucht",
[429]="Xavian",
[430]="Satyrnaar",
[431]="Splintertreeposten",
[432]="Der Dor\'danil-Grabhügel",
[433]="Der Falfarren",
[434]="Felfire Hill",
[435]="Dämonensturz",
[436]="Dämonenstieg",
[437]="Das Holzfällerlager der Warsong",
[438]="Schattengrün",
[439]="Die schimmernde Ebene",
[440]="Tanaris",
[441]="Falathimsee",
[442]="Auberdine",
[443]="Die Ruinen von Mathystra",
[444]="Turm von Althalaxx",
[445]="Cliffspring Falls",
[446]="Bashal\'Aran",
[447]="Ameth\'Aran",
[448]="Der Hain der Uralten",
[449]="Die Meistergleve",
[450]="Remtravels Ausgrabung",
[452]="Nebelrand",
[453]="Der lange Strand",
[454]="Wildschnellen",
[455]="Bau der Schwarzfelle",
[456]="Cliffspring",
[457]="Das verhüllte Meer",
[458]="Goldstraße",
[459]="Scharlachroter Wachposten",
[460]="Sonnenfels",
[461]="Die Scherwindklippe",
[463]="Felskesselsee",
[464]="Mirkfallonsee",
[465]="Das verbrannte Tal",
[466]="Tal der Blutfurien",
[467]="Der Steinkrallengipfel",
[468]="Der Krallenbau",
[469]="Hochwipfeltal",
[470]="Thunder Bluff UNUSED",
[471]="Brave Wind Mesa",
[472]="Fire Stone Mesa",
[473]="Mantle Rock",
[474]="Hunter Rise UNUSED",
[475]="Spirit RiseUNUSED",
[476]="Elder RiseUNUSED",
[477]="Ruinen von Jubuwal",
[478]="Teiche von Arlithrien",
[479]="Die Rustmaul-Grabungsstätte",
[480]="Camp E\'thok",
[481]="Spalthufklippe",
[482]="Der Steilhang",
[483]="Der kreischende Canyon",
[484]="Freiwindposten",
[485]="Der große Aufzug",
[486]="Galakhöhle",
[487]="Bau der Wildfedern",
[488]="Der Wetterwinkel",
[489]="Thalanaar",
[490]="Un\'Goro-Krater",
[491]="Der Kral von Razorfen",
[492]="Friedhof von Rabenflucht",
[493]="Moonglade",
[495]="DELETE ME",
[496]="Brackenwall",
[497]="Swamplight-Anwesen",
[498]="Blutsumpfbau",
[499]="Graunebelhöhlen",
[500]="Moggle-Spitze",
[501]="Beezils Wrack",
[502]="Hexenhügel",
[503]="Späherwacht",
[504]="Nordwacht",
[505]="Westwacht",
[506]="Die verlassene Wacht",
[507]="Blaumoor",
[508]="Die Stonemaul Ruinen",
[509]="Der Flammenbau",
[510]="Das Drachendüster",
[511]="Der Drachensumpf",
[512]="Onyxia\'s Lair UNUSED",
[513]="Die Insel Theramore",
[514]="Foothold-Zitadelle",
[515]="Ironclad-Gefängnis",
[516]="Dustwallow Bay",
[517]="Tidefury-Bucht",
[518]="Dreadmurk Shore",
[536]="Addles Siedlung",
[537]="Der Feuerfedergrat",
[538]="Teergruben von Lakkari",
[539]="Terrorflucht",
[540]="Die wuchernde Narbe",
[541]="Marshals Zuflucht",
[542]="Fungusfels",
[543]="Die heißen Quellen von Golakka",
[556]="Der Loch",
[576]="Bettlerschlupfwinkel",
[596]="Der Kodofriedhof",
[597]="Geistwandlerposten",
[598]="Sar\'theris-Strand",
[599]="Festung Thunder Axe",
[600]="Bolgans Loch",
[602]="Mannorocs Koven",
[603]="Sargeron",
[604]="Magram",
[606]="Gelkis",
[607]="Das Tal der Speere",
[608]="Die Nijelspitze",
[609]="Kolkar",
[616]="Hyjal",
[618]="Winterspring",
[636]="Schwarzwolfschnellen",
[637]="Kodofels",
[638]="Verborgener Pfad",
[639]="Geisterfelsen",
[640]="Schrein der schlafenden Flamme",
[656]="Der Elune\'ara See",
[657]="Der sichere Hafen",
[676]="Scherbenwelt",
[696]="Craftsmen\'s Terrace UNUSED",
[697]="Tradesmen\'s Terrace UNUSED",
[698]="The Temple Gardens UNUSED",
[699]="Temple of Elune UNUSED",
[700]="Cenarion Enclave UNUSED",
[701]="Warrior\'s Terrace UNUSED",
[702]="Rut\'theran",
[716]="Ironbands Truppenlager",
[717]="Das Verlies",
[718]="Die Höhlen des Wehklagens",
[719]="Blackfathom-Tiefe",
[720]="Prügel-Eiland",
[721]="Gnomeregan",
[722]="Die Hügel von Razorfen",
[736]="Ban\'ethil Hollow",
[796]="Das scharlachrote Kloster",
[797]="Jerods Anlegestelle",
[798]="Kammwacht",
[799]="Das dunkle Ufer",
[800]="Coldridgepass",
[801]="Chillbreezetal",
[802]="Schimmergrat",
[803]="Amberstill-Ranch",
[804]="Die Tundrid-Hügel",
[805]="Südtorpass",
[806]="Südtoraußenposten",
[807]="Nordtorpass",
[808]="Nordtoraußenposten",
[809]="Tore von Ironforge",
[810]="Stillwassertümpel",
[811]="Alptraumtal",
[812]="Giftwebertal",
[813]="Das Bollwerk",
[814]="Der Südstrom",
[815]="Der Südstrom",
[816]="Revier der Grimmhauer",
[817]="Die Knochenhöhle",
[818]="Bleichmähnenfels",
[819]="Windfurienkamm",
[820]="Die goldenen Ebenen",
[821]="Die wogenden Ebenen",
[836]="Dun Algaz",
[837]="Dun Algaz",
[838]="Nordtorpass",
[839]="Südtorpass",
[856]="Der Zwielichtshain",
[876]="GM-Insel",
[877]="Delete ME",
[878]="Der Südstrom",
[879]="Der Südstrom",
[880]="Thandol-Übergang",
[881]="Thandol-Übergang",
[896]="Fegefeuer-Insel",
[916]="Jansens Siedlung",
[917]="Der Todesacker",
[918]="Molsens Hof",
[919]="Stendels Tümpel",
[920]="Die Dolchhügel",
[921]="Demonts Heim",
[922]="Die Staubebenen",
[923]="Splittersteintal",
[924]="Tal der Könige",
[925]="Station Algaz",
[926]="Bucklebree-Hof",
[927]="Der leuchtende Strand",
[928]="North Tide\'s Hollow",
[936]="Grautatzengrat",
[956]="Die saftgrünen Felder",
[976]="Gadgetzan",
[977]="Steamwheedle",
[978]="Zul\'Farrak",
[979]="Sandsorrow-Wache",
[980]="Disteltal",
[981]="Die klaffende Schlucht",
[982]="Der giftige Unterschlupf",
[983]="Truppenlager der Dünenbrecher",
[984]="Ostmondruinen",
[985]="Waterspring-Feld",
[986]="Zalashjis Bau",
[987]="Landendestrand",
[988]="Wellenschreiterstrand",
[989]="Uldum",
[990]="Tal der Behüter",
[991]="Gunstans Posten",
[992]="Südmondruinen",
[996]="Renders Lager",
[997]="Renders Tal",
[998]="Renders Fels",
[999]="Turm der Steinwacht",
[1000]="Galardelltal",
[1001]="Uferpfad",
[1002]="Drei Ecken",
[1016]="Direforge Hill",
[1017]="Raptorgrat",
[1018]="Schwarzkanalmarschen",
[1019]="Der grüne Gürtel",
[1020]="Moosfellmoor",
[1021]="Thelgenfelsen",
[1022]="Blaukiemenmarschen",
[1023]="Salzgischtschlucht",
[1024]="Sonnenwendmarschen",
[1025]="Der grüne Gürtel",
[1036]="Angerfang-Lager",
[1037]="Grim Batol",
[1038]="Tore der Dragonmaw",
[1039]="Die verlorene Flotte",
[1056]="Darrow Hill",
[1057]="Thoradinswall",
[1076]="Weberpass",
[1097]="Das stille Ufer",
[1098]="Anwesen der Mistmantles",
[1099]="Camp Mojache",
[1100]="Truppenlager der Grimmtotem",
[1101]="Die verwundene Tiefe",
[1102]="Wildwindsee",
[1103]="Außenposten der Gordunni",
[1104]="Mok\'Gordun",
[1105]="Wildschrammtal",
[1106]="Fransenfederhochland",
[1107]="Idlewindsee",
[1108]="Die vergessene Küste",
[1109]="Ostsäule",
[1110]="Westsäule",
[1111]="Traum-Geäst",
[1112]="Jademirsee",
[1113]="Oneiros",
[1114]="Ruinen von Rabenwind",
[1115]="Wutschrammfeste",
[1116]="Festung Feathermoon",
[1117]="Ruinen von Solarsal",
[1118]="Lower Wilds UNUSED",
[1119]="Die Zwillingskolosse",
[1120]="Insel Sardor",
[1121]="Die Insel des Schreckens",
[1136]="Die obere Wildnis",
[1137]="Die untere Wildnis",
[1156]="Südliches Brachland",
[1157]="Südliche Goldstraße",
[1176]="Zul\'Farrak",
[1196]="UNUSEDAlcaz Island",
[1216]="Holzschlundfeste",
[1217]="Vanndir-Lager",
[1218]="TESTAzshara",
[1219]="Lager der Legashi",
[1220]="Thalassischer Stützpunkt",
[1221]="Die Ruinen von Eldarath",
[1222]="Hetaeras Gelege",
[1223]="Tempel von Zin-Malor",
[1224]="Bärenkopf",
[1225]="Ursolan",
[1226]="Der Tempel von Arkkoran",
[1227]="Die Bucht der Stürme",
[1228]="Der zertrümmerte Strand",
[1229]="Turm von Eldara",
[1230]="Gezacktes Riff",
[1231]="Southridge-Strand",
[1232]="Ravencrest-Monument",
[1233]="Der einsame Grat",
[1234]="Mennarsee",
[1235]="Shadowsong-Schrein",
[1236]="Lager der Haldarr",
[1237]="Valormok",
[1256]="Die verfallenen Gegenden",
[1276]="Der Steinkrallenpfad",
[1277]="Der Steinkrallenpfad",
[1296]="Felshauerhof",
[1297]="Scheckeneberhof",
[1316]="Die Hügel von Razorfen",
[1336]="Lost-Rigger-Bucht",
[1337]="Uldaman",
[1338]="Der Lordameresee",
[1339]="Der Lordameresee",
[1357]="Galgeneck",
[1377]="Silithus",
[1397]="Smaragdwald",
[1417]="Versunkener Tempel",
[1437]="Feste Schreckensfels",
[1438]="Burg Nethergarde",
[1439]="Schreckensfelsposten",
[1440]="Schlangenschlinge",
[1441]="Altar der Stürme",
[1442]="Firewatchgrat",
[1443]="Die Schlackengrube",
[1444]="Das Meer der Asche",
[1445]="Der Blackrock",
[1446]="Thoriumspitze",
[1457]="Garnison-Waffenkammer",
[1477]="Der Tempel von Atal\'Hakkar",
[1497]="Undercity",
[1517]="Uldaman",
[1518]="Nicht benutzt - Todesminen",
[1519]="Stormwind",
[1537]="Ironforge",
[1557]="Spalthufhöhle",
[1577]="Kap des Schlingendorntals",
[1578]="Südliche ungezähmte Küste",
[1579]="Unused The Deadmines 002",
[1580]="Unused Ironclad Cove 003",
[1581]="Die Todesminen",
[1582]="Ironcladbucht",
[1583]="Blackrockspitze",
[1584]="Blackrocktiefen",
[1597]="Raptor Grounds UNUSED",
[1598]="Grol\'dom Hof UNUSED",
[1599]="Mor\'shan-Stützpunkt",
[1600]="Honor\'s Stand UNUSED",
[1601]="Blackthorn Ridge UNUSED",
[1602]="Bramblescar UNUSED",
[1603]="Agama\'gor UNUSED",
[1617]="Das Tal der Helden",
[1637]="Orgrimmar",
[1638]="Thunder Bluff",
[1639]="Die Anhöhe der Ältesten",
[1640]="Die Anhöhe der Geister",
[1641]="Die Anhöhe der Jäger",
[1657]="Darnassus",
[1658]="Die Enklave des Cenarius",
[1659]="Die Terrasse der Handwerker",
[1660]="Die Terrasse der Krieger",
[1661]="Die Tempelgärten",
[1662]="Die Terrasse der Händler",
[1677]="Gavins Landspitze",
[1678]="Soferas Landspitze",
[1679]="Corrahns Dolch",
[1680]="Die Landzunge",
[1681]="Nebelufer",
[1682]="Dandreds Senke",
[1683]="Growlesshöhle",
[1684]="Chillwindspitze",
[1697]="Raptorgründe",
[1698]="Dornennarbe",
[1699]="Dornenhügel",
[1700]="Agama\'gor",
[1701]="Schwarzdorngrat",
[1702]="Ehrenmal",
[1703]="Der Mor\'shan-Schutzwall",
[1704]="Grol\'doms Hof",
[1717]="Der Kral von Razorfen",
[1718]="Der große Aufzug",
[1737]="Nebeltal",
[1738]="Nek\'maniquellbrunnen",
[1739]="Truppenlager der Blutsegelbukaniere",
[1740]="Stützpunkt der Venture Co.",
[1741]="Die Arena der Gurubashi",
[1742]="Geisterhöhlenbau",
[1757]="Die CRIMSON VEIL",
[1758]="Die RIPTIDE",
[1759]="Die DAMSEL\'S LUCK",
[1760]="Arbeitszentrale der Venture Co.",
[1761]="Lager der Totenwaldfelle",
[1762]="Revier der Teufelspfoten",
[1763]="Jaedenar",
[1764]="Blutgiftbach",
[1765]="Die Blutgiftfälle",
[1766]="Narbengrund",
[1767]="Der Eisenwald",
[1768]="Eisenstammhöhle",
[1769]="Holzschlundfeste",
[1770]="Schattenfeste",
[1771]="Schrein des Betrügers",
[1777]="Itharius\' Höhle",
[1778]="Sorgendunkel",
[1779]="Draenil\'dur",
[1780]="Splitterspeerkreuzung",
[1797]="Stagalsumpf",
[1798]="Der Wabersumpf",
[1817]="Stagalsumpfhöhle",
[1837]="Witherbarkhöhlen",
[1857]="Thoradinswall",
[1858]="Fels\'gor",
[1877]="Fangzahntal",
[1878]="Die Staubschüssel",
[1879]="Illusionenebene",
[1880]="Federbarts Hütte",
[1881]="Shindiggers Lager",
[1882]="Seuchennebelklamm",
[1883]="Ehrenwindsee",
[1884]="Agol\'watha",
[1885]="Hiri\'watha",
[1886]="Die Gruselruinen",
[1887]="Bogens Kante",
[1897]="Terrasse des Schöpfers",
[1898]="Staubwindschlucht",
[1917]="Shaol\'watha",
[1937]="Tagschattenruinen",
[1938]="Zerbrochene Säule",
[1939]="Die ewigen Sande",
[1940]="Südbrandung",
[1941]="Die Höhlen der Zeit",
[1942]="Die Marschen",
[1943]="Eisensteinplateau",
[1957]="Blackcharhöhle",
[1958]="Tanners Lager",
[1959]="Staubfeuertal",
[1977]="Zul\'Gurub",
[1978]="Nebelschilfposten",
[1997]="Blutgiftposten",
[1998]="Nachtlaublichtung",
[2017]="Stratholme",
[2037]="UNUSEDShadowfang Keep 003",
[2057]="Scholomance",
[2077]="Das Zwielichttal",
[2078]="Zwielichtufer",
[2079]="Insel Alcaz",
[2097]="Düsterwolkengipfel",
[2098]="Katakomben des Morgenwaldes",
[2099]="Burg Steinwacht",
[2100]="Maraudon",
[2101]="Gasthof Zum Starkbier-Lager",
[2102]="Brauerei Donnerbräu",
[2103]="Burg Menethil",
[2104]="Deepwater Taverne",
[2117]="Schattengrab",
[2118]="Rathaus von Brill",
[2119]="Taverne Zur Galgenschlinge",
[2137]="The Pools of VisionUNUSED",
[2138]="Glutnebelbau",
[2157]="Burg Bael\'dun",
[2158]="Aschenschwingens Bau",
[2159]="Onyxias Hort",
[2160]="Scherwindmine",
[2161]="Rolands Verdammnis",
[2177]="Kampfring",
[2197]="Die Teiche der Visionen",
[2198]="Shadowbreakklamm",
[2217]="Bruchspeeringen",
[2237]="Weißgipfelposten",
[2238]="Gornia",
[2239]="Zanes-Auge-Krater",
[2240]="Illusionenrennbahn",
[2241]="Frostsäblerfelsen",
[2242]="Der versteckte Hain",
[2243]="Holzschlundposten",
[2244]="Lager der Winterfelle",
[2245]="Mazthoril",
[2246]="Die Frostfeuerquellen",
[2247]="Eisdistelberge",
[2248]="Dun Mandarr",
[2249]="Frostwhisperschlucht",
[2250]="Eulenflügeldickicht",
[2251]="Kel\'Therilsee",
[2252]="Die Ruinen von Kel\'Theril",
[2253]="Starfall",
[2254]="Grabhügel von Ban\'Thallow",
[2255]="Everlook",
[2256]="Die flüsternde Schlucht",
[2257]="Die Tiefenbahn",
[2258]="Das Fungustal",
[2259]="UNUSEDThe Marris Stead",
[2260]="Marris\' Siedlung",
[2261]="Das Tiefgewölbe",
[2262]="Darrowshire",
[2263]="Turm der Kronenwache",
[2264]="Corins Kreuzung",
[2265]="Scharlachroter Stützpunkt",
[2266]="Tyrs Hand",
[2267]="Die scharlachrote Basilika",
[2268]="Kapelle des hoffnungsvollen Lichts",
[2269]="Braumanns Mühle",
[2270]="Das giftige Tal",
[2271]="Ostwallturm",
[2272]="Nordtal",
[2273]="Zul\'Mashar",
[2274]="Mazra\'Alor",
[2275]="Nordpassturm",
[2276]="Quel\'Lithien-Lodge",
[2277]="Der Pestwald",
[2278]="Geißelfeste",
[2279]="Stratholme",
[2280]="UNUSED Stratholme",
[2297]="Darrowmeresee",
[2298]="Caer Darrow",
[2299]="Darrowmeresee",
[2300]="Die Höhlen der Zeit",
[2301]="Lager der Distelfelle",
[2302]="Der Morast",
[2303]="Schlucht der heulenden Winde",
[2317]="Die südlichen Meere",
[2318]="Das große Meer",
[2319]="Das große Meer",
[2320]="Das große Meer",
[2321]="Das große Meer",
[2322]="Das verhüllte Meer",
[2323]="Das verhüllte Meer",
[2324]="Das verhüllte Meer",
[2325]="Das verhüllte Meer",
[2326]="Das verhüllte Meer",
[2337]="Kaserne von Klingenhügel",
[2338]="Die südlichen Meere",
[2339]="Das große Meer",
[2357]="Blutreißers Lager",
[2358]="Forest Song",
[2359]="Laubtatzenlichtung",
[2360]="Außenposten der Silverwing",
[2361]="Nighthaven",
[2362]="Der Schrein von Remulos",
[2363]="Die Stormrage Grabhügel",
[2364]="Das große Meer",
[2365]="Das große Meer",
[2366]="Das schwarze Fenn",
[2367]="Die alten Vorgebirge von Hillsbrad",
[2368]="Tarrens Mühle",
[2369]="Southshore",
[2370]="Burg Durnholde",
[2371]="Dun Garok",
[2372]="Die Felder von Hillsbrad",
[2373]="Oststrand",
[2374]="Nethander-Siedlung",
[2375]="Darrow Hill",
[2376]="Südwacht",
[2377]="Thoradinswall",
[2378]="Weststrand",
[2379]="Der Azurschacht",
[2397]="Das große Meer",
[2398]="Das große Meer",
[2399]="Das große Meer",
[2400]="Das verbotene Meer",
[2401]="Das verbotene Meer",
[2402]="Das verbotene Meer",
[2403]="Das verbotene Meer",
[2404]="Tethris Aran",
[2405]="Ethel Rethor",
[2406]="Die Insel Ranazjar",
[2407]="Kormeks Hütte",
[2408]="Shadowprey",
[2417]="Blackrockpass",
[2418]="Morgans Wacht",
[2419]="Schlitterfels",
[2420]="Schreckenspfad",
[2421]="Draco\'dar",
[2437]="Ragefireabgrund",
[2457]="Nightsongwälder",
[2477]="Das verhüllte Meer",
[2478]="Morlos\'Aran",
[2479]="Das Smaragdrefugium",
[2480]="Jadefeuertal",
[2481]="Ruinen von Constellas",
[2497]="Bittere Landzunge",
[2517]="Anhöhe des Entweihers",
[2518]="Lariss\' Pavillon",
[2519]="Waldpfotenhügel",
[2520]="Waldpfotenbau",
[2521]="Verdantis",
[2522]="Ruinen von Isildien",
[2537]="Posten der Grimmtotem",
[2538]="Camp Aparaje",
[2539]="Malaka\'jin",
[2540]="Steinschlagklamm",
[2541]="Sishircanyon",
[2557]="Düsterbruch",
[2558]="Schlucht der Totenwinde",
[2559]="Diamondhead",
[2560]="Aridens Lager",
[2561]="Das Laster",
[2562]="Karazhan",
[2563]="Morgan\'s Plot",
[2577]="Düsterbruch",
[2597]="Alteractal",
[2617]="Scrabblescrews Lager",
[2618]="Jadefeuerbach",
[2619]="Thondroril",
[2620]="Thondroril",
[2621]="Mereldarsee",
[2622]="Pestilenznarbe",
[2623]="Die Infektnarbe",
[2624]="Blackwoodsee",
[2625]="Ostwalltor",
[2626]="Terrorweb-Tunnel",
[2627]="Schreckenstal",
[2637]="Burg Kargathia",
[2657]="Tal der Knochen",
[2677]="Pechschwingenhort",
[2697]="Totmannsfurt",
[2717]="Geschmolzener Kern",
[2737]="Der Skarabäuswall",
[2738]="Südwindposten",
[2739]="Basislager der Twilight",
[2740]="Das Kristalltal",
[2741]="Die Skarabäushöhe",
[2742]="Bau des Ashischwarms",
[2743]="Bau des Zoraschwarms",
[2744]="Bau des Regalschwarms",
[2757]="Schrein des gefallenen Kriegers",
[2777]="UNUSED Alterac Valley",
[2797]="Blackfathom-Tiefe",
[2817]="***Dungeon auf Karte***",
[2837]="Der Keller des Meisters",
[2838]="Stonewroughtpass",
[2839]="Alteractal",
[2857]="Der Rumblekäfig",
[2877]="Brocken-Test",
[2897]="Zoram\'gar-Außenposten",
[2917]="Halle der Legenden",
[2918]="Halle der Champions",
[2937]="Das Grosh\'gok Lager",
[2938]="Die schlummernde Schlucht",
[2957]="Irondeep-Mine",
[2958]="Stonehearth-Außenposten",
[2959]="Dun Baldar",
[2960]="Icewingpass",
[2961]="Frostwolf",
[2962]="Turmstellung",
[2963]="Coldtooth-Mine",
[2964]="Feste der Winterax",
[2977]="Iceblood-Garnison",
[2978]="Burg Frostwolf",
[2979]="Tor\'krens Hof",
[3017]="Frostdagger-Pass",
[3037]="Eisensteinlager",
[3038]="Weazels Krater",
[3039]="Ruinen von Tahonda",
[3057]="Feld des Kampfes",
[3058]="Icewinghöhle",
[3077]="Heldenwacht",
[3097]="Die Schwarmsäule",
[3098]="Twilight-Posten",
[3099]="Twilight-Außenposten",
[3100]="Verwüsteter Twilight-Stützpunkt",
[3117]="Shalzarus Unterschlupf",
[3137]="Talrendisspitze",
[3138]="Rethress Sanktum",
[3139]="Mondschreckensbau",
[3140]="Schuppenbarts Höhle",
[3157]="Steinschlaghöhle",
[3177]="Lager der Warsongarbeiter",
[3197]="Chillwind-Lager",
[3217]="Die Schlägergrube",
[3237]="Die Schlägergrube",
[3257]="Knochen von Grakkarond",
[3277]="Warsongschlucht",
[3297]="Friedhof der Frostwolf",
[3298]="Frostwolfpass",
[3299]="Pass von Dun Baldar",
[3300]="Iceblood-Friedhof",
[3301]="Snowfall-Friedhof",
[3302]="Stonehearth-Friedhof",
[3303]="Stormpike-Friedhof",
[3304]="Icewing-Bunker",
[3305]="Stonehearth-Bunker",
[3306]="Wildpfotengrat",
[3317]="Revantusk",
[3318]="Fels von Durotan",
[3319]="Hain der Silverwing",
[3320]="Sägewerk der Warsong",
[3321]="Feste Silverwing",
[3337]="Höhle der Wildpfoten",
[3338]="Die verhüllte Kluft",
[3357]="Die Insel Yojamba",
[3358]="Arathibecken",
[3377]="Die Windung",
[3378]="Altar von Hir\'eek",
[3379]="Shadra\'zaar",
[3380]="Hakkarigründe",
[3381]="Landspitze Shirvallahs",
[3382]="Tempel von Bethekk",
[3383]="Die Blutfeuergrube",
[3384]="Altar des Blutgottes",
[3397]="Zanzas Anhöhe",
[3398]="Rand des Wahnsinns",
[3417]="Trollbanes Halle",
[3418]="Die entweihte Feste",
[3419]="Pagles Spitze",
[3420]="Hof",
[3421]="Schmiede",
[3422]="Sägewerk",
[3423]="Goldmine",
[3424]="Ställe",
[3425]="Burg Cenarius",
[3426]="Staghelms Stätte",
[3427]="Bronzebeards Lager",
[3428]="Ahn\'Qiraj",
[3429]="Ruinen von Ahn\'Qiraj",
[3446]="Kavernen der Twilight",
[3447]="Ortells Unterschlupf",
[3448]="Skarabäusterrasse",
[3449]="Terrasse des Generals",
[3450]="Das Reservoir",
[3451]="Die Brutstätte",
[3452]="Die Wabenkammer",
[3453]="Terrasse der Wächter",
[3454]="Ruinen von Ahn\'Qiraj",
[3456]="Naxxramas",
[3459]="Hauptstädte",
[3478]="Tore von Ahn\'Qiraj",
[3486]="Ravenholdt-Anwesen",
}
|
oo = {}
function oo.newClass(constructor)
local class = {}
local class_mt = {
__index = class,
__tostring = function(self)
if self.tostring then
return self:tostring()
else
return "Object"
end
end
}
class.constructor = constructor
-- Create a new instance of A just by calling 'a = A{ ... }'
local mt = {
__call = function(self, ...)
local obj = {}
setmetatable(obj, class_mt)
self.constructor(obj, ...)
return obj
end,
__tostring = function(self) return "Class" end
}
setmetatable(class, mt)
return class
end
function oo.inherits(baseClass, constructor)
local newclass = {}
local class_mt = {__index = newclass}
newclass.constructor = constructor
--function newclass.create()
-- local inst = {}
-- setmetatable(inst, class_mt)
-- return inst
--end
local mt = {
__call = function(self, ...)
local obj = {}
setmetatable(obj, class_mt)
self.constructor(obj, ...)
return obj
end,
__tostring = function() return "Class" end
}
if baseClass then
mt.__index = baseClass
end
setmetatable(newclass, mt)
return newclass
end
|
require("Prop/candleBase.lua")
--this = SceneNode()
function create()
initCandle(this,Vec3(0.0,0.265,-0.01))
return false
end
|
local magic = {} -- table which is returned when module is required
function magic:new(name) -- function 'new' which will be in the returned table to be called
name = not name or type(name)~="string" and "object" or name -- if the name is invalid then call it "object", if it is, then leave it as it is
local new = newproxy(true) -- newproxy returns a userdata, and, if given the arg true, with a blank metadata.
local mt = getmetatable(new) -- gets the metatable of the userdata
local data = {} -- this is where data will be stored for the object
mt.__index = function(t,k) -- index metamethod is when you try and get a property (e.g. object.name). t is the metatable ( i believe ) and k is what was indexed (e.g. "name")
return rawget(data,k) -- attempts to get 'k' from the data table, if k doesn't exist in data it returns nil. rawget basically indexes data with k without calling the index metamethod
end
mt.__newindex = function(t,k,v) -- newindex metamethod is when you try and set a property (e.g. object.name = "Hi"). v is the value that k is being set with (e.g. "Hi")
rawset(data,k,v) -- attempts to set data[k]=v, basically meaning that k in the data table is now what v is. (e.g. object.name = "hi" will set "name" in data to "hi")
end
mt.__tostring = function() return name end -- when being outputted, instead of being a bunch of hex stuff (since its a userdata), it'll just output the given name.
-- tostring metamethod is when the object is trying to be turned into string, e.g tostring(object) will call this metamethod.
mt.__metatable = "metatable not available" -- if someone tries to get the objects metatable it'll return this string instead of the actual metatable
-- this is used to prevent people who are venturing to tamper with the code.
return new
end
return magic
|
local utils = require('bqf.utils')
local Win = {}
function Win.new(winid)
local obj = {}
setmetatable(obj, Win)
Win.__index = Win
obj.winid = winid
obj.bwrow = nil
obj.bheight = nil
obj.aheight = nil
obj.fraction = nil
obj.wv = nil
return obj
end
function Win:set(o)
self.bwrow = o.bwrow
self.bheight = o.bheight
self.aheight = o.aheight
self.fraction = o.fraction
self.wv = o.wv
end
local MagicWinSession = {pool = {}}
function MagicWinSession.get(qbufnr)
if not MagicWinSession.pool[qbufnr] then
MagicWinSession.pool[qbufnr] = setmetatable({}, {
__index = function(tbl, winid)
rawset(tbl, winid, Win.new(winid))
return tbl[winid]
end
})
end
return MagicWinSession.pool[qbufnr]
end
function MagicWinSession.adjacent_win(qbufnr, winid)
return MagicWinSession.get(qbufnr)[winid]
end
function MagicWinSession.clean(qbufnr)
for bufnr in pairs(MagicWinSession.pool) do
if not utils.is_buf_loaded(bufnr) then
MagicWinSession.pool[bufnr] = nil
end
end
if qbufnr then
MagicWinSession.pool[qbufnr] = nil
end
end
return MagicWinSession
|
local log = require("tmux.log")
local logging = require("tmux.configuration.logging")
local options = require("tmux.configuration.options")
local validate = require("tmux.configuration.validate")
local tmux = require("tmux.wrapper.tmux")
local M = {
options = options,
logging = logging,
}
function M.setup(opts, logs)
M.logging.set(vim.tbl_deep_extend("force", {}, M.logging, logs or {}))
log.debug("configuration injected: ", opts)
M.options.set(vim.tbl_deep_extend("force", {}, M.logging, opts or {}))
if tmux.is_tmux then
validate.options(tmux.version, M.options)
end
end
return M
|
--[[
/* - SQLITE_CONFIG_SINGLETHREAD (only one DB connection, usable by only one thread)
* There are no arguments to this option. This option sets the threading mode to Single-thread. In other words, it disables all mutexing and puts SQLite into a mode where it can only be used by a single thread. If SQLite is compiled with the SQLITE_THREADSAFE=0 compile-time option then it is not possible to change the threading mode from its default value of Single-thread and so sqlite3_config() will return SQLITE_ERROR if called with the SQLITE_CONFIG_SINGLETHREAD configuration option.
*
* - SQLITE_CONFIG_MULTITHREAD (multiple DB connection, each usable by only one thread)
* There are no arguments to this option. This option sets the threading mode to Multi-thread. In other words, it disables mutexing on database connection and prepared statement objects. The application is responsible for serializing access to database connections and prepared statements. But other mutexes are enabled so that SQLite will be safe to use in a multi-threaded environment as long as no two threads attempt to use the same database connection at the same time. If SQLite is compiled with the SQLITE_THREADSAFE=0 compile-time option then it is not possible to set the Multi-thread threading mode and sqlite3_config() will return SQLITE_ERROR if called with the SQLITE_CONFIG_MULTITHREAD configuration option.
* - SQLITE_CONFIG_SERIALIZED (multiple DB connection, each usable by multiple thread) - default
* There are no arguments to this option. This option sets the threading mode to Serialized. In other words, this option enables all mutexes including the recursive mutexes on database connection and prepared statement objects. In this mode (which is the default when SQLite is compiled with SQLITE_THREADSAFE=1) the SQLite library will itself serialize access to database connections and prepared statements so that the application is free to use the same database connection or the same prepared statement in different threads at the same time. If SQLite is compiled with the SQLITE_THREADSAFE=0 compile-time option then it is not possible to set the Serialized threading mode and sqlite3_config() will return SQLITE_ERROR if called with the SQLITE_CONFIG_SERIALIZED configuration option.
*
*
* - PRAGMA read_uncommitted = boolean;
* Query, set, or clear READ UNCOMMITTED isolation. The default isolation level for SQLite is SERIALIZABLE. Any process or thread can select READ UNCOMMITTED isolation, but SERIALIZABLE will still be used except between connections that share a common page and schema cache. Cache sharing is enabled using the sqlite3_enable_shared_cache() API. Cache sharing is disabled by default.
* A database connection in read-uncommitted mode does not attempt to obtain read-locks before reading from database tables as described above. This can lead to inconsistent query results if another database connection modifies a table while it is being read, but it also means that a read-transaction opened by a connection in read-uncommitted mode can neither block nor be blocked by any other connection.
* Read-uncommitted mode has no effect on the locks required to write to database tables (i.e. read-uncommitted connections must still obtain write-locks and hence database writes may still block or be blocked). Also, read-uncommitted mode has no effect on the sqlite_master locks required by the rules enumerated below (see section "Schema (sqlite_master) Level Locking").
*
* - PRAGMA cell_size_check = boolean;
* The cell_size_check pragma enables or disables additional sanity checking on database b-tree pages as they are initially read from disk. With cell size checking enabled, database corruption is detected earlier and is less likely to "spread". However, there is a small performance hit for doing the extra checks and so cell size checking is turned off by default.
*/
--]]
sqlite.config("multithread")
--[[
// Applications that wish to avoid leaving forensic traces after content is deleted or updated should enable the secure_delete pragma prior to performing the delete or update, or else run VACUUM after the delete or update. - https://www.sqlite.org/pragma.html#pragma_secure_delete
// This routine enables or disables the sharing of the database cache and schema data structures between connections to the same database. Sharing is enabled if the argument is true and disabled if the argument is false. - https://www.sqlite.org/c3ref/enable_shared_cache.html
--]]
|
-- RxLua v0.0.2
-- https://github.com/bjornbytes/rxlua
--[[
Copyright (c) 2015 Bjorn Swenson
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, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
--]]
local util = {}
util.pack = table.pack or function(...) return { n = select('#', ...), ... } end
util.unpack = table.unpack or unpack
util.eq = function(x, y) return x == y end
util.noop = function() end
util.identity = function(x) return x end
util.constant = function(x) return function() return x end end
util.isa = function(object, class)
return type(object) == 'table' and getmetatable(object).__index == class
end
util.tryWithObserver = function(observer, fn, ...)
local success, result = pcall(fn, ...)
if not success then
observer:onError(result)
end
return success, result
end
--- @class Subscription
-- @description A handle representing the link between an Observer and an Observable, as well as any
-- work required to clean up after the Observable completes or the Observer unsubscribes.
local Subscription = {}
Subscription.__index = Subscription
Subscription.__tostring = util.constant('Subscription')
--- Creates a new Subscription.
-- @arg {function=} action - The action to run when the subscription is unsubscribed. It will only
-- be run once.
-- @returns {Subscription}
function Subscription.create(action)
local self = {
action = action or util.noop,
unsubscribed = false
}
return setmetatable(self, Subscription)
end
--- Unsubscribes the subscription, performing any necessary cleanup work.
function Subscription:unsubscribe()
if self.unsubscribed then return end
self.action(self)
self.unsubscribed = true
end
--- @class Observer
-- @description Observers are simple objects that receive values from Observables.
local Observer = {}
Observer.__index = Observer
Observer.__tostring = util.constant('Observer')
--- Creates a new Observer.
-- @arg {function=} onNext - Called when the Observable produces a value.
-- @arg {function=} onError - Called when the Observable terminates due to an error.
-- @arg {function=} onCompleted - Called when the Observable completes normally.
-- @returns {Observer}
function Observer.create(onNext, onError, onCompleted)
local self = {
_onNext = onNext or util.noop,
_onError = onError or error,
_onCompleted = onCompleted or util.noop,
stopped = false
}
return setmetatable(self, Observer)
end
--- Pushes zero or more values to the Observer.
-- @arg {*...} values
function Observer:onNext(...)
if not self.stopped then
self._onNext(...)
end
end
--- Notify the Observer that an error has occurred.
-- @arg {string=} message - A string describing what went wrong.
function Observer:onError(message)
if not self.stopped then
self.stopped = true
self._onError(message)
end
end
--- Notify the Observer that the sequence has completed and will produce no more values.
function Observer:onCompleted()
if not self.stopped then
self.stopped = true
self._onCompleted()
end
end
--- @class Observable
-- @description Observables push values to Observers.
local Observable = {}
Observable.__index = Observable
Observable.__tostring = util.constant('Observable')
--- Creates a new Observable.
-- @arg {function} subscribe - The subscription function that produces values.
-- @returns {Observable}
function Observable.create(subscribe)
local self = {
_subscribe = subscribe
}
return setmetatable(self, Observable)
end
--- Shorthand for creating an Observer and passing it to this Observable's subscription function.
-- @arg {function} onNext - Called when the Observable produces a value.
-- @arg {function} onError - Called when the Observable terminates due to an error.
-- @arg {function} onCompleted - Called when the Observable completes normally.
function Observable:subscribe(onNext, onError, onCompleted)
if type(onNext) == 'table' then
return self._subscribe(onNext)
else
return self._subscribe(Observer.create(onNext, onError, onCompleted))
end
end
--- Returns an Observable that immediately completes without producing a value.
function Observable.empty()
return Observable.create(function(observer)
observer:onCompleted()
end)
end
--- Returns an Observable that never produces values and never completes.
function Observable.never()
return Observable.create(function(observer) end)
end
--- Returns an Observable that immediately produces an error.
function Observable.throw(message)
return Observable.create(function(observer)
observer:onError(message)
end)
end
--- Creates an Observable that produces a set of values.
-- @arg {*...} values
-- @returns {Observable}
function Observable.of(...)
local args = {...}
local argCount = select('#', ...)
return Observable.create(function(observer)
for i = 1, argCount do
observer:onNext(args[i])
end
observer:onCompleted()
end)
end
--- Creates an Observable that produces a range of values in a manner similar to a Lua for loop.
-- @arg {number} initial - The first value of the range, or the upper limit if no other arguments
-- are specified.
-- @arg {number=} limit - The second value of the range.
-- @arg {number=1} step - An amount to increment the value by each iteration.
-- @returns {Observable}
function Observable.fromRange(initial, limit, step)
if not limit and not step then
initial, limit = 1, initial
end
step = step or 1
return Observable.create(function(observer)
for i = initial, limit, step do
observer:onNext(i)
end
observer:onCompleted()
end)
end
--- Creates an Observable that produces values from a table.
-- @arg {table} table - The table used to create the Observable.
-- @arg {function=pairs} iterator - An iterator used to iterate the table, e.g. pairs or ipairs.
-- @arg {boolean} keys - Whether or not to also emit the keys of the table.
-- @returns {Observable}
function Observable.fromTable(t, iterator, keys)
iterator = iterator or pairs
return Observable.create(function(observer)
for key, value in iterator(t) do
observer:onNext(value, keys and key or nil)
end
observer:onCompleted()
end)
end
--- Creates an Observable that produces values when the specified coroutine yields.
-- @arg {thread} coroutine
-- @returns {Observable}
function Observable.fromCoroutine(thread, scheduler)
thread = type(thread) == 'function' and coroutine.create(thread) or thread
return Observable.create(function(observer)
return scheduler:schedule(function()
while not observer.stopped do
local success, value = coroutine.resume(thread)
if success then
observer:onNext(value)
else
return observer:onError(value)
end
if coroutine.status(thread) == 'dead' then
return observer:onCompleted()
end
coroutine.yield()
end
end)
end)
end
--- Creates an Observable that creates a new Observable for each observer using a factory function.
-- @arg {function} factory - A function that returns an Observable.
-- @returns {Observable}
function Observable.defer(fn)
return setmetatable({
subscribe = function(_, ...)
local observable = fn()
return observable:subscribe(...)
end
}, Observable)
end
--- Returns an Observable that repeats a value a specified number of times.
-- @arg {*} value - The value to repeat.
-- @arg {number=} count - The number of times to repeat the value. If left unspecified, the value
-- is repeated an infinite number of times.
-- @returns {Observable}
function Observable.replicate(value, count)
return Observable.create(function(observer)
while count == nil or count > 0 do
observer:onNext(value)
if count then
count = count - 1
end
end
observer:onCompleted()
end)
end
--- Subscribes to this Observable and prints values it produces.
-- @arg {string=} name - Prefixes the printed messages with a name.
-- @arg {function=tostring} formatter - A function that formats one or more values to be printed.
function Observable:dump(name, formatter)
name = name and (name .. ' ') or ''
formatter = formatter or tostring
local onNext = function(...) print(name .. 'onNext: ' .. formatter(...)) end
local onError = function(e) print(name .. 'onError: ' .. e) end
local onCompleted = function() print(name .. 'onCompleted') end
return self:subscribe(onNext, onError, onCompleted)
end
--- Creates an Observable that produces values from a file, line by line.
-- @arg {string} filename - The name of the file used to create the Observable
-- @returns {Observable}
function Observable.fromFileByLine(filename)
return Observable.create(function(observer)
local f = io.open(filename, 'r')
if f
then
f:close()
for line in io.lines(filename) do
observer:onNext(line)
end
return observer:onCompleted()
else
return observer:onError(filename)
end
end)
end
--- Determine whether all items emitted by an Observable meet some criteria.
-- @arg {function=identity} predicate - The predicate used to evaluate objects.
function Observable:all(predicate)
predicate = predicate or util.identity
return Observable.create(function(observer)
local function onNext(...)
util.tryWithObserver(observer, function(...)
if not predicate(...) then
observer:onNext(false)
observer:onCompleted()
end
end, ...)
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
observer:onNext(true)
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Given a set of Observables, produces values from only the first one to produce a value.
-- @arg {Observable...} observables
-- @returns {Observable}
function Observable.amb(a, b, ...)
if not a or not b then return a end
return Observable.create(function(observer)
local subscriptionA, subscriptionB
local function onNextA(...)
if subscriptionB then subscriptionB:unsubscribe() end
observer:onNext(...)
end
local function onErrorA(e)
if subscriptionB then subscriptionB:unsubscribe() end
observer:onError(e)
end
local function onCompletedA()
if subscriptionB then subscriptionB:unsubscribe() end
observer:onCompleted()
end
local function onNextB(...)
if subscriptionA then subscriptionA:unsubscribe() end
observer:onNext(...)
end
local function onErrorB(e)
if subscriptionA then subscriptionA:unsubscribe() end
observer:onError(e)
end
local function onCompletedB()
if subscriptionA then subscriptionA:unsubscribe() end
observer:onCompleted()
end
subscriptionA = a:subscribe(onNextA, onErrorA, onCompletedA)
subscriptionB = b:subscribe(onNextB, onErrorB, onCompletedB)
return Subscription.create(function()
subscriptionA:unsubscribe()
subscriptionB:unsubscribe()
end)
end):amb(...)
end
--- Returns an Observable that produces the average of all values produced by the original.
-- @returns {Observable}
function Observable:average()
return Observable.create(function(observer)
local sum, count = 0, 0
local function onNext(value)
sum = sum + value
count = count + 1
end
local function onError(e)
observer:onError(e)
end
local function onCompleted()
if count > 0 then
observer:onNext(sum / count)
end
observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that buffers values from the original and produces them as multiple
-- values.
-- @arg {number} size - The size of the buffer.
function Observable:buffer(size)
return Observable.create(function(observer)
local buffer = {}
local function emit()
if #buffer > 0 then
observer:onNext(util.unpack(buffer))
buffer = {}
end
end
local function onNext(...)
local values = {...}
for i = 1, #values do
table.insert(buffer, values[i])
if #buffer >= size then
emit()
end
end
end
local function onError(message)
emit()
return observer:onError(message)
end
local function onCompleted()
emit()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that intercepts any errors from the previous and replace them with values
-- produced by a new Observable.
-- @arg {function|Observable} handler - An Observable or a function that returns an Observable to
-- replace the source Observable in the event of an error.
-- @returns {Observable}
function Observable:catch(handler)
handler = handler and (type(handler) == 'function' and handler or util.constant(handler))
return Observable.create(function(observer)
local subscription
local function onNext(...)
return observer:onNext(...)
end
local function onError(e)
if not handler then
return observer:onCompleted()
end
local success, continue = pcall(handler, e)
if success and continue then
if subscription then subscription:unsubscribe() end
continue:subscribe(observer)
else
observer:onError(success and e or continue)
end
end
local function onCompleted()
observer:onCompleted()
end
subscription = self:subscribe(onNext, onError, onCompleted)
return subscription
end)
end
--- Returns a new Observable that runs a combinator function on the most recent values from a set
-- of Observables whenever any of them produce a new value. The results of the combinator function
-- are produced by the new Observable.
-- @arg {Observable...} observables - One or more Observables to combine.
-- @arg {function} combinator - A function that combines the latest result from each Observable and
-- returns a single value.
-- @returns {Observable}
function Observable:combineLatest(...)
local sources = {...}
local combinator = table.remove(sources)
if type(combinator) ~= 'function' then
table.insert(sources, combinator)
combinator = function(...) return ... end
end
table.insert(sources, 1, self)
return Observable.create(function(observer)
local latest = {}
local pending = {util.unpack(sources)}
local completed = {}
local function onNext(i)
return function(value)
latest[i] = value
pending[i] = nil
if not next(pending) then
util.tryWithObserver(observer, function()
observer:onNext(combinator(util.unpack(latest)))
end)
end
end
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted(i)
return function()
table.insert(completed, i)
if #completed == #sources then
observer:onCompleted()
end
end
end
for i = 1, #sources do
sources[i]:subscribe(onNext(i), onError, onCompleted(i))
end
end)
end
--- Returns a new Observable that produces the values of the first with falsy values removed.
-- @returns {Observable}
function Observable:compact()
return self:filter(util.identity)
end
--- Returns a new Observable that produces the values produced by all the specified Observables in
-- the order they are specified.
-- @arg {Observable...} sources - The Observables to concatenate.
-- @returns {Observable}
function Observable:concat(other, ...)
if not other then return self end
local others = {...}
return Observable.create(function(observer)
local function onNext(...)
return observer:onNext(...)
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
local function chain()
return other:concat(util.unpack(others)):subscribe(onNext, onError, onCompleted)
end
return self:subscribe(onNext, onError, chain)
end)
end
--- Returns a new Observable that produces a single boolean value representing whether or not the
-- specified value was produced by the original.
-- @arg {*} value - The value to search for. == is used for equality testing.
-- @returns {Observable}
function Observable:contains(value)
return Observable.create(function(observer)
local subscription
local function onNext(...)
local args = util.pack(...)
if #args == 0 and value == nil then
observer:onNext(true)
if subscription then subscription:unsubscribe() end
return observer:onCompleted()
end
for i = 1, #args do
if args[i] == value then
observer:onNext(true)
if subscription then subscription:unsubscribe() end
return observer:onCompleted()
end
end
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
observer:onNext(false)
return observer:onCompleted()
end
subscription = self:subscribe(onNext, onError, onCompleted)
return subscription
end)
end
--- Returns an Observable that produces a single value representing the number of values produced
-- by the source value that satisfy an optional predicate.
-- @arg {function=} predicate - The predicate used to match values.
function Observable:count(predicate)
predicate = predicate or util.constant(true)
return Observable.create(function(observer)
local count = 0
local function onNext(...)
util.tryWithObserver(observer, function(...)
if predicate(...) then
count = count + 1
end
end, ...)
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
observer:onNext(count)
observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
function Observable:debounce(time, scheduler)
time = time or 0
return Observable.create(function(observer)
local debounced = {}
local function wrap(key)
return function(...)
local value = util.pack(...)
if debounced[key] then
debounced[key]:unsubscribe()
end
local values = util.pack(...)
debounced[key] = scheduler:schedule(function()
return observer[key](observer, util.unpack(values))
end, time)
end
end
local subscription = self:subscribe(wrap('onNext'), wrap('onError'), wrap('onCompleted'))
return Subscription.create(function()
if subscription then subscription:unsubscribe() end
for _, timeout in pairs(debounced) do
timeout:unsubscribe()
end
end)
end)
end
--- Returns a new Observable that produces a default set of items if the source Observable produces
-- no values.
-- @arg {*...} values - Zero or more values to produce if the source completes without emitting
-- anything.
-- @returns {Observable}
function Observable:defaultIfEmpty(...)
local defaults = util.pack(...)
return Observable.create(function(observer)
local hasValue = false
local function onNext(...)
hasValue = true
observer:onNext(...)
end
local function onError(e)
observer:onError(e)
end
local function onCompleted()
if not hasValue then
observer:onNext(util.unpack(defaults))
end
observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that produces the values of the original delayed by a time period.
-- @arg {number|function} time - An amount in milliseconds to delay by, or a function which returns
-- this value.
-- @arg {Scheduler} scheduler - The scheduler to run the Observable on.
-- @returns {Observable}
function Observable:delay(time, scheduler)
time = type(time) ~= 'function' and util.constant(time) or time
return Observable.create(function(observer)
local actions = {}
local function delay(key)
return function(...)
local arg = util.pack(...)
local handle = scheduler:schedule(function()
observer[key](observer, util.unpack(arg))
end, time())
table.insert(actions, handle)
end
end
local subscription = self:subscribe(delay('onNext'), delay('onError'), delay('onCompleted'))
return Subscription.create(function()
if subscription then subscription:unsubscribe() end
for i = 1, #actions do
actions[i]:unsubscribe()
end
end)
end)
end
--- Returns a new Observable that produces the values from the original with duplicates removed.
-- @returns {Observable}
function Observable:distinct()
return Observable.create(function(observer)
local values = {}
local function onNext(x)
if not values[x] then
observer:onNext(x)
end
values[x] = true
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that only produces values from the original if they are different from
-- the previous value.
-- @arg {function} comparator - A function used to compare 2 values. If unspecified, == is used.
-- @returns {Observable}
function Observable:distinctUntilChanged(comparator)
comparator = comparator or util.eq
return Observable.create(function(observer)
local first = true
local currentValue = nil
local function onNext(value, ...)
local values = util.pack(...)
util.tryWithObserver(observer, function()
if first or not comparator(value, currentValue) then
observer:onNext(value, util.unpack(values))
currentValue = value
first = false
end
end)
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that produces the nth element produced by the source Observable.
-- @arg {number} index - The index of the item, with an index of 1 representing the first.
-- @returns {Observable}
function Observable:elementAt(index)
return Observable.create(function(observer)
local subscription
local i = 1
local function onNext(...)
if i == index then
observer:onNext(...)
observer:onCompleted()
if subscription then
subscription:unsubscribe()
end
else
i = i + 1
end
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
subscription = self:subscribe(onNext, onError, onCompleted)
return subscription
end)
end
--- Returns a new Observable that only produces values of the first that satisfy a predicate.
-- @arg {function} predicate - The predicate used to filter values.
-- @returns {Observable}
function Observable:filter(predicate)
predicate = predicate or util.identity
return Observable.create(function(observer)
local function onNext(...)
util.tryWithObserver(observer, function(...)
if predicate(...) then
return observer:onNext(...)
end
end, ...)
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that produces the first value of the original that satisfies a
-- predicate.
-- @arg {function} predicate - The predicate used to find a value.
function Observable:find(predicate)
predicate = predicate or util.identity
return Observable.create(function(observer)
local function onNext(...)
util.tryWithObserver(observer, function(...)
if predicate(...) then
observer:onNext(...)
return observer:onCompleted()
end
end, ...)
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that only produces the first result of the original.
-- @returns {Observable}
function Observable:first()
return self:take(1)
end
--- Returns a new Observable that transform the items emitted by an Observable into Observables,
-- then flatten the emissions from those into a single Observable
-- @arg {function} callback - The function to transform values from the original Observable.
-- @returns {Observable}
function Observable:flatMap(callback)
callback = callback or util.identity
return self:map(callback):flatten()
end
--- Returns a new Observable that uses a callback to create Observables from the values produced by
-- the source, then produces values from the most recent of these Observables.
-- @arg {function=identity} callback - The function used to convert values to Observables.
-- @returns {Observable}
function Observable:flatMapLatest(callback)
callback = callback or util.identity
return Observable.create(function(observer)
local innerSubscription
local function onNext(...)
observer:onNext(...)
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
local function subscribeInner(...)
if innerSubscription then
innerSubscription:unsubscribe()
end
return util.tryWithObserver(observer, function(...)
innerSubscription = callback(...):subscribe(onNext, onError)
end, ...)
end
local subscription = self:subscribe(subscribeInner, onError, onCompleted)
return Subscription.create(function()
if innerSubscription then
innerSubscription:unsubscribe()
end
if subscription then
subscription:unsubscribe()
end
end)
end)
end
--- Returns a new Observable that subscribes to the Observables produced by the original and
-- produces their values.
-- @returns {Observable}
function Observable:flatten()
return Observable.create(function(observer)
local function onError(message)
return observer:onError(message)
end
local function onNext(observable)
local function innerOnNext(...)
observer:onNext(...)
end
observable:subscribe(innerOnNext, onError, util.noop)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that terminates when the source terminates but does not produce any
-- elements.
-- @returns {Observable}
function Observable:ignoreElements()
return Observable.create(function(observer)
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(nil, onError, onCompleted)
end)
end
--- Returns a new Observable that only produces the last result of the original.
-- @returns {Observable}
function Observable:last()
return Observable.create(function(observer)
local value
local empty = true
local function onNext(...)
value = {...}
empty = false
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
if not empty then
observer:onNext(util.unpack(value or {}))
end
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that produces the values of the original transformed by a function.
-- @arg {function} callback - The function to transform values from the original Observable.
-- @returns {Observable}
function Observable:map(callback)
return Observable.create(function(observer)
callback = callback or util.identity
local function onNext(...)
return util.tryWithObserver(observer, function(...)
return observer:onNext(callback(...))
end, ...)
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that produces the maximum value produced by the original.
-- @returns {Observable}
function Observable:max()
return self:reduce(math.max)
end
--- Returns a new Observable that produces the values produced by all the specified Observables in
-- the order they are produced.
-- @arg {Observable...} sources - One or more Observables to merge.
-- @returns {Observable}
function Observable:merge(...)
local sources = {...}
table.insert(sources, 1, self)
return Observable.create(function(observer)
local function onNext(...)
return observer:onNext(...)
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted(i)
return function()
sources[i] = nil
if not next(sources) then
observer:onCompleted()
end
end
end
for i = 1, #sources do
sources[i]:subscribe(onNext, onError, onCompleted(i))
end
end)
end
--- Returns a new Observable that produces the minimum value produced by the original.
-- @returns {Observable}
function Observable:min()
return self:reduce(math.min)
end
--- Returns an Observable that produces the values of the original inside tables.
-- @returns {Observable}
function Observable:pack()
return self:map(util.pack)
end
--- Returns two Observables: one that produces values for which the predicate returns truthy for,
-- and another that produces values for which the predicate returns falsy.
-- @arg {function} predicate - The predicate used to partition the values.
-- @returns {Observable}
-- @returns {Observable}
function Observable:partition(predicate)
return self:filter(predicate), self:reject(predicate)
end
--- Returns a new Observable that produces values computed by extracting the given keys from the
-- tables produced by the original.
-- @arg {string...} keys - The key to extract from the table. Multiple keys can be specified to
-- recursively pluck values from nested tables.
-- @returns {Observable}
function Observable:pluck(key, ...)
if not key then return self end
if type(key) ~= 'string' and type(key) ~= 'number' then
return Observable.throw('pluck key must be a string')
end
return Observable.create(function(observer)
local function onNext(t)
return observer:onNext(t[key])
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end):pluck(...)
end
--- Returns a new Observable that produces a single value computed by accumulating the results of
-- running a function on each value produced by the original Observable.
-- @arg {function} accumulator - Accumulates the values of the original Observable. Will be passed
-- the return value of the last call as the first argument and the
-- current values as the rest of the arguments.
-- @arg {*} seed - A value to pass to the accumulator the first time it is run.
-- @returns {Observable}
function Observable:reduce(accumulator, seed)
return Observable.create(function(observer)
local result = seed
local first = true
local function onNext(...)
if first and seed == nil then
result = ...
first = false
else
return util.tryWithObserver(observer, function(...)
result = accumulator(result, ...)
end, ...)
end
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
observer:onNext(result)
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that produces values from the original which do not satisfy a
-- predicate.
-- @arg {function} predicate - The predicate used to reject values.
-- @returns {Observable}
function Observable:reject(predicate)
predicate = predicate or util.identity
return Observable.create(function(observer)
local function onNext(...)
util.tryWithObserver(observer, function(...)
if not predicate(...) then
return observer:onNext(...)
end
end, ...)
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that restarts in the event of an error.
-- @arg {number=} count - The maximum number of times to retry. If left unspecified, an infinite
-- number of retries will be attempted.
-- @returns {Observable}
function Observable:retry(count)
return Observable.create(function(observer)
local subscription
local retries = 0
local function onNext(...)
return observer:onNext(...)
end
local function onCompleted()
return observer:onCompleted()
end
local function onError(message)
if subscription then
subscription:unsubscribe()
end
retries = retries + 1
if count and retries > count then
return observer:onError(message)
end
subscription = self:subscribe(onNext, onError, onCompleted)
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that produces its most recent value every time the specified observable
-- produces a value.
-- @arg {Observable} sampler - The Observable that is used to sample values from this Observable.
-- @returns {Observable}
function Observable:sample(sampler)
if not sampler then error('Expected an Observable') end
return Observable.create(function(observer)
local latest = {}
local function setLatest(...)
latest = util.pack(...)
end
local function onNext()
return observer:onNext(util.unpack(latest))
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
local sourceSubscription = self:subscribe(setLatest, onError)
local sampleSubscription = sampler:subscribe(onNext, onError, onCompleted)
return Subscription.create(function()
if sourceSubscription then sourceSubscription:unsubscribe() end
if sampleSubscription then sampleSubscription:unsubscribe() end
end)
end)
end
--- Returns a new Observable that produces values computed by accumulating the results of running a
-- function on each value produced by the original Observable.
-- @arg {function} accumulator - Accumulates the values of the original Observable. Will be passed
-- the return value of the last call as the first argument and the
-- current values as the rest of the arguments. Each value returned
-- from this function will be emitted by the Observable.
-- @arg {*} seed - A value to pass to the accumulator the first time it is run.
-- @returns {Observable}
function Observable:scan(accumulator, seed)
return Observable.create(function(observer)
local result = seed
local first = true
local function onNext(...)
if first and seed == nil then
result = ...
first = false
else
return util.tryWithObserver(observer, function(...)
result = accumulator(result, ...)
observer:onNext(result)
end, ...)
end
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that skips over a specified number of values produced by the original
-- and produces the rest.
-- @arg {number=1} n - The number of values to ignore.
-- @returns {Observable}
function Observable:skip(n)
n = n or 1
return Observable.create(function(observer)
local i = 1
local function onNext(...)
if i > n then
observer:onNext(...)
else
i = i + 1
end
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that omits a specified number of values from the end of the original
-- Observable.
-- @arg {number} count - The number of items to omit from the end.
-- @returns {Observable}
function Observable:skipLast(count)
local buffer = {}
return Observable.create(function(observer)
local function emit()
if #buffer > count and buffer[1] then
local values = table.remove(buffer, 1)
observer:onNext(util.unpack(values))
end
end
local function onNext(...)
emit()
table.insert(buffer, util.pack(...))
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
emit()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that skips over values produced by the original until the specified
-- Observable produces a value.
-- @arg {Observable} other - The Observable that triggers the production of values.
-- @returns {Observable}
function Observable:skipUntil(other)
return Observable.create(function(observer)
local triggered = false
local function trigger()
triggered = true
end
other:subscribe(trigger, trigger, trigger)
local function onNext(...)
if triggered then
observer:onNext(...)
end
end
local function onError()
if triggered then
observer:onError()
end
end
local function onCompleted()
if triggered then
observer:onCompleted()
end
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that skips elements until the predicate returns falsy for one of them.
-- @arg {function} predicate - The predicate used to continue skipping values.
-- @returns {Observable}
function Observable:skipWhile(predicate)
predicate = predicate or util.identity
return Observable.create(function(observer)
local skipping = true
local function onNext(...)
if skipping then
util.tryWithObserver(observer, function(...)
skipping = predicate(...)
end, ...)
end
if not skipping then
return observer:onNext(...)
end
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that produces the specified values followed by all elements produced by
-- the source Observable.
-- @arg {*...} values - The values to produce before the Observable begins producing values
-- normally.
-- @returns {Observable}
function Observable:startWith(...)
local values = util.pack(...)
return Observable.create(function(observer)
observer:onNext(util.unpack(values))
return self:subscribe(observer)
end)
end
--- Returns an Observable that produces a single value representing the sum of the values produced
-- by the original.
-- @returns {Observable}
function Observable:sum()
return self:reduce(function(x, y) return x + y end, 0)
end
--- Given an Observable that produces Observables, returns an Observable that produces the values
-- produced by the most recently produced Observable.
-- @returns {Observable}
function Observable:switch()
return Observable.create(function(observer)
local subscription
local function onNext(...)
return observer:onNext(...)
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
local function switch(source)
if subscription then
subscription:unsubscribe()
end
subscription = source:subscribe(onNext, onError, nil)
end
return self:subscribe(switch, onError, onCompleted)
end)
end
--- Returns a new Observable that only produces the first n results of the original.
-- @arg {number=1} n - The number of elements to produce before completing.
-- @returns {Observable}
function Observable:take(n)
n = n or 1
return Observable.create(function(observer)
if n <= 0 then
observer:onCompleted()
return
end
local i = 1
local function onNext(...)
observer:onNext(...)
i = i + 1
if i > n then
observer:onCompleted()
end
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that produces a specified number of elements from the end of a source
-- Observable.
-- @arg {number} count - The number of elements to produce.
-- @returns {Observable}
function Observable:takeLast(count)
return Observable.create(function(observer)
local buffer = {}
local function onNext(...)
table.insert(buffer, util.pack(...))
if #buffer > count then
table.remove(buffer, 1)
end
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
for i = 1, #buffer do
observer:onNext(util.unpack(buffer[i]))
end
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that completes when the specified Observable fires.
-- @arg {Observable} other - The Observable that triggers completion of the original.
-- @returns {Observable}
function Observable:takeUntil(other)
return Observable.create(function(observer)
local function onNext(...)
return observer:onNext(...)
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
other:subscribe(onCompleted, onCompleted, onCompleted)
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns a new Observable that produces elements until the predicate returns falsy.
-- @arg {function} predicate - The predicate used to continue production of values.
-- @returns {Observable}
function Observable:takeWhile(predicate)
predicate = predicate or util.identity
return Observable.create(function(observer)
local taking = true
local function onNext(...)
if taking then
util.tryWithObserver(observer, function(...)
taking = predicate(...)
end, ...)
if taking then
return observer:onNext(...)
else
return observer:onCompleted()
end
end
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Runs a function each time this Observable has activity. Similar to subscribe but does not
-- create a subscription.
-- @arg {function=} onNext - Run when the Observable produces values.
-- @arg {function=} onError - Run when the Observable encounters a problem.
-- @arg {function=} onCompleted - Run when the Observable completes.
-- @returns {Observable}
function Observable:tap(_onNext, _onError, _onCompleted)
_onNext = _onNext or util.noop
_onError = _onError or util.noop
_onCompleted = _onCompleted or util.noop
return Observable.create(function(observer)
local function onNext(...)
util.tryWithObserver(observer, function(...)
_onNext(...)
end, ...)
return observer:onNext(...)
end
local function onError(message)
util.tryWithObserver(observer, function()
_onError(message)
end)
return observer:onError(message)
end
local function onCompleted()
util.tryWithObserver(observer, function()
_onCompleted()
end)
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that unpacks the tables produced by the original.
-- @returns {Observable}
function Observable:unpack()
return self:map(util.unpack)
end
--- Returns an Observable that takes any values produced by the original that consist of multiple
-- return values and produces each value individually.
-- @returns {Observable}
function Observable:unwrap()
return Observable.create(function(observer)
local function onNext(...)
local values = {...}
for i = 1, #values do
observer:onNext(values[i])
end
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that produces a sliding window of the values produced by the original.
-- @arg {number} size - The size of the window. The returned observable will produce this number
-- of the most recent values as multiple arguments to onNext.
-- @returns {Observable}
function Observable:window(size)
return Observable.create(function(observer)
local window = {}
local function onNext(value)
table.insert(window, value)
if #window >= size then
observer:onNext(util.unpack(window))
table.remove(window, 1)
end
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted()
return observer:onCompleted()
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that produces values from the original along with the most recently
-- produced value from all other specified Observables. Note that only the first argument from each
-- source Observable is used.
-- @arg {Observable...} sources - The Observables to include the most recent values from.
-- @returns {Observable}
function Observable:with(...)
local sources = {...}
return Observable.create(function(observer)
local latest = setmetatable({}, {__len = util.constant(#sources)})
local function setLatest(i)
return function(value)
latest[i] = value
end
end
local function onNext(value)
return observer:onNext(value, util.unpack(latest))
end
local function onError(e)
return observer:onError(e)
end
local function onCompleted()
return observer:onCompleted()
end
for i = 1, #sources do
sources[i]:subscribe(setLatest(i), util.noop, util.noop)
end
return self:subscribe(onNext, onError, onCompleted)
end)
end
--- Returns an Observable that merges the values produced by the source Observables by grouping them
-- by their index. The first onNext event contains the first value of all of the sources, the
-- second onNext event contains the second value of all of the sources, and so on. onNext is called
-- a number of times equal to the number of values produced by the Observable that produces the
-- fewest number of values.
-- @arg {Observable...} sources - The Observables to zip.
-- @returns {Observable}
function Observable.zip(...)
local sources = util.pack(...)
local count = #sources
return Observable.create(function(observer)
local values = {}
local active = {}
for i = 1, count do
values[i] = {n = 0}
active[i] = true
end
local function onNext(i)
return function(value)
table.insert(values[i], value)
values[i].n = values[i].n + 1
local ready = true
for i = 1, count do
if values[i].n == 0 then
ready = false
break
end
end
if ready then
local payload = {}
for i = 1, count do
payload[i] = table.remove(values[i], 1)
values[i].n = values[i].n - 1
end
observer:onNext(util.unpack(payload))
end
end
end
local function onError(message)
return observer:onError(message)
end
local function onCompleted(i)
return function()
active[i] = nil
if not next(active) or values[i].n == 0 then
return observer:onCompleted()
end
end
end
for i = 1, count do
sources[i]:subscribe(onNext(i), onError, onCompleted(i))
end
end)
end
--- @class ImmediateScheduler
-- @description Schedules Observables by running all operations immediately.
local ImmediateScheduler = {}
ImmediateScheduler.__index = ImmediateScheduler
ImmediateScheduler.__tostring = util.constant('ImmediateScheduler')
--- Creates a new ImmediateScheduler.
-- @returns {ImmediateScheduler}
function ImmediateScheduler.create()
return setmetatable({}, ImmediateScheduler)
end
--- Schedules a function to be run on the scheduler. It is executed immediately.
-- @arg {function} action - The function to execute.
function ImmediateScheduler:schedule(action)
action()
end
--- @class CooperativeScheduler
-- @description Manages Observables using coroutines and a virtual clock that must be updated
-- manually.
local CooperativeScheduler = {}
CooperativeScheduler.__index = CooperativeScheduler
CooperativeScheduler.__tostring = util.constant('CooperativeScheduler')
--- Creates a new CooperativeScheduler.
-- @arg {number=0} currentTime - A time to start the scheduler at.
-- @returns {CooperativeScheduler}
function CooperativeScheduler.create(currentTime)
local self = {
tasks = {},
currentTime = currentTime or 0
}
return setmetatable(self, CooperativeScheduler)
end
--- Schedules a function to be run after an optional delay. Returns a subscription that will stop
-- the action from running.
-- @arg {function} action - The function to execute. Will be converted into a coroutine. The
-- coroutine may yield execution back to the scheduler with an optional
-- number, which will put it to sleep for a time period.
-- @arg {number=0} delay - Delay execution of the action by a virtual time period.
-- @returns {Subscription}
function CooperativeScheduler:schedule(action, delay)
local task = {
thread = coroutine.create(action),
due = self.currentTime + (delay or 0)
}
table.insert(self.tasks, task)
return Subscription.create(function()
return self:unschedule(task)
end)
end
function CooperativeScheduler:unschedule(task)
for i = 1, #self.tasks do
if self.tasks[i] == task then
table.remove(self.tasks, i)
end
end
end
--- Triggers an update of the CooperativeScheduler. The clock will be advanced and the scheduler
-- will run any coroutines that are due to be run.
-- @arg {number=0} delta - An amount of time to advance the clock by. It is common to pass in the
-- time in seconds or milliseconds elapsed since this function was last
-- called.
function CooperativeScheduler:update(delta)
self.currentTime = self.currentTime + (delta or 0)
for i = #self.tasks, 1, -1 do
local task = self.tasks[i]
if self.currentTime >= task.due then
local success, delay = coroutine.resume(task.thread)
if success then
task.due = math.max(task.due + (delay or 0), self.currentTime)
else
error(delay)
end
if coroutine.status(task.thread) == 'dead' then
table.remove(self.tasks, i)
end
end
end
end
--- Returns whether or not the CooperativeScheduler's queue is empty.
function CooperativeScheduler:isEmpty()
return not next(self.tasks)
end
--- @class TimeoutScheduler
-- @description A scheduler that uses luvit's timer library to schedule events on an event loop.
local TimeoutScheduler = {}
TimeoutScheduler.__index = TimeoutScheduler
TimeoutScheduler.__tostring = util.constant('TimeoutScheduler')
--- Creates a new TimeoutScheduler.
-- @returns {TimeoutScheduler}
function TimeoutScheduler.create()
return setmetatable({}, TimeoutScheduler)
end
--- Schedules an action to run at a future point in time.
-- @arg {function} action - The action to run.
-- @arg {number=0} delay - The delay, in milliseconds.
-- @returns {Subscription}
function TimeoutScheduler:schedule(action, delay, ...)
local timer = require 'timer'
local subscription
local handle = timer.setTimeout(delay, action, ...)
return Subscription.create(function()
timer.clearTimeout(handle)
end)
end
--- @class Subject
-- @description Subjects function both as an Observer and as an Observable. Subjects inherit all
-- Observable functions, including subscribe. Values can also be pushed to the Subject, which will
-- be broadcasted to any subscribed Observers.
local Subject = setmetatable({}, Observable)
Subject.__index = Subject
Subject.__tostring = util.constant('Subject')
--- Creates a new Subject.
-- @returns {Subject}
function Subject.create()
local self = {
observers = {},
stopped = false
}
return setmetatable(self, Subject)
end
--- Creates a new Observer and attaches it to the Subject.
-- @arg {function|table} onNext|observer - A function called when the Subject produces a value or
-- an existing Observer to attach to the Subject.
-- @arg {function} onError - Called when the Subject terminates due to an error.
-- @arg {function} onCompleted - Called when the Subject completes normally.
function Subject:subscribe(onNext, onError, onCompleted)
local observer
if util.isa(onNext, Observer) then
observer = onNext
else
observer = Observer.create(onNext, onError, onCompleted)
end
table.insert(self.observers, observer)
return Subscription.create(function()
for i = 1, #self.observers do
if self.observers[i] == observer then
table.remove(self.observers, i)
return
end
end
end)
end
--- Pushes zero or more values to the Subject. They will be broadcasted to all Observers.
-- @arg {*...} values
function Subject:onNext(...)
if not self.stopped then
for i = 1, #self.observers do
self.observers[i]:onNext(...)
end
end
end
--- Signal to all Observers that an error has occurred.
-- @arg {string=} message - A string describing what went wrong.
function Subject:onError(message)
if not self.stopped then
for i = 1, #self.observers do
self.observers[i]:onError(message)
end
self.stopped = true
end
end
--- Signal to all Observers that the Subject will not produce any more values.
function Subject:onCompleted()
if not self.stopped then
for i = 1, #self.observers do
self.observers[i]:onCompleted()
end
self.stopped = true
end
end
Subject.__call = Subject.onNext
--- @class AsyncSubject
-- @description AsyncSubjects are subjects that produce either no values or a single value. If
-- multiple values are produced via onNext, only the last one is used. If onError is called, then
-- no value is produced and onError is called on any subscribed Observers. If an Observer
-- subscribes and the AsyncSubject has already terminated, the Observer will immediately receive the
-- value or the error.
local AsyncSubject = setmetatable({}, Observable)
AsyncSubject.__index = AsyncSubject
AsyncSubject.__tostring = util.constant('AsyncSubject')
--- Creates a new AsyncSubject.
-- @returns {AsyncSubject}
function AsyncSubject.create()
local self = {
observers = {},
stopped = false,
value = nil,
errorMessage = nil
}
return setmetatable(self, AsyncSubject)
end
--- Creates a new Observer and attaches it to the AsyncSubject.
-- @arg {function|table} onNext|observer - A function called when the AsyncSubject produces a value
-- or an existing Observer to attach to the AsyncSubject.
-- @arg {function} onError - Called when the AsyncSubject terminates due to an error.
-- @arg {function} onCompleted - Called when the AsyncSubject completes normally.
function AsyncSubject:subscribe(onNext, onError, onCompleted)
local observer
if util.isa(onNext, Observer) then
observer = onNext
else
observer = Observer.create(onNext, onError, onCompleted)
end
if self.value then
observer:onNext(util.unpack(self.value))
observer:onCompleted()
return
elseif self.errorMessage then
observer:onError(self.errorMessage)
return
end
table.insert(self.observers, observer)
return Subscription.create(function()
for i = 1, #self.observers do
if self.observers[i] == observer then
table.remove(self.observers, i)
return
end
end
end)
end
--- Pushes zero or more values to the AsyncSubject.
-- @arg {*...} values
function AsyncSubject:onNext(...)
if not self.stopped then
self.value = util.pack(...)
end
end
--- Signal to all Observers that an error has occurred.
-- @arg {string=} message - A string describing what went wrong.
function AsyncSubject:onError(message)
if not self.stopped then
self.errorMessage = message
for i = 1, #self.observers do
self.observers[i]:onError(self.errorMessage)
end
self.stopped = true
end
end
--- Signal to all Observers that the AsyncSubject will not produce any more values.
function AsyncSubject:onCompleted()
if not self.stopped then
for i = 1, #self.observers do
if self.value then
self.observers[i]:onNext(util.unpack(self.value))
end
self.observers[i]:onCompleted()
end
self.stopped = true
end
end
AsyncSubject.__call = AsyncSubject.onNext
--- @class BehaviorSubject
-- @description A Subject that tracks its current value. Provides an accessor to retrieve the most
-- recent pushed value, and all subscribers immediately receive the latest value.
local BehaviorSubject = setmetatable({}, Subject)
BehaviorSubject.__index = BehaviorSubject
BehaviorSubject.__tostring = util.constant('BehaviorSubject')
--- Creates a new BehaviorSubject.
-- @arg {*...} value - The initial values.
-- @returns {BehaviorSubject}
function BehaviorSubject.create(...)
local self = {
observers = {},
stopped = false
}
if select('#', ...) > 0 then
self.value = util.pack(...)
end
return setmetatable(self, BehaviorSubject)
end
--- Creates a new Observer and attaches it to the BehaviorSubject. Immediately broadcasts the most
-- recent value to the Observer.
-- @arg {function} onNext - Called when the BehaviorSubject produces a value.
-- @arg {function} onError - Called when the BehaviorSubject terminates due to an error.
-- @arg {function} onCompleted - Called when the BehaviorSubject completes normally.
function BehaviorSubject:subscribe(onNext, onError, onCompleted)
local observer
if util.isa(onNext, Observer) then
observer = onNext
else
observer = Observer.create(onNext, onError, onCompleted)
end
local subscription = Subject.subscribe(self, observer)
if self.value then
observer:onNext(util.unpack(self.value))
end
return subscription
end
--- Pushes zero or more values to the BehaviorSubject. They will be broadcasted to all Observers.
-- @arg {*...} values
function BehaviorSubject:onNext(...)
self.value = util.pack(...)
return Subject.onNext(self, ...)
end
--- Returns the last value emitted by the BehaviorSubject, or the initial value passed to the
-- constructor if nothing has been emitted yet.
-- @returns {*...}
function BehaviorSubject:getValue()
if self.value ~= nil then
return util.unpack(self.value)
end
end
BehaviorSubject.__call = BehaviorSubject.onNext
--- @class ReplaySubject
-- @description A Subject that provides new Subscribers with some or all of the most recently
-- produced values upon subscription.
local ReplaySubject = setmetatable({}, Subject)
ReplaySubject.__index = ReplaySubject
ReplaySubject.__tostring = util.constant('ReplaySubject')
--- Creates a new ReplaySubject.
-- @arg {number=} bufferSize - The number of values to send to new subscribers. If nil, an infinite
-- buffer is used (note that this could lead to memory issues).
-- @returns {ReplaySubject}
function ReplaySubject.create(n)
local self = {
observers = {},
stopped = false,
buffer = {},
bufferSize = n
}
return setmetatable(self, ReplaySubject)
end
--- Creates a new Observer and attaches it to the ReplaySubject. Immediately broadcasts the most
-- contents of the buffer to the Observer.
-- @arg {function} onNext - Called when the ReplaySubject produces a value.
-- @arg {function} onError - Called when the ReplaySubject terminates due to an error.
-- @arg {function} onCompleted - Called when the ReplaySubject completes normally.
function ReplaySubject:subscribe(onNext, onError, onCompleted)
local observer
if util.isa(onNext, Observer) then
observer = onNext
else
observer = Observer.create(onNext, onError, onCompleted)
end
local subscription = Subject.subscribe(self, observer)
for i = 1, #self.buffer do
observer:onNext(util.unpack(self.buffer[i]))
end
return subscription
end
--- Pushes zero or more values to the ReplaySubject. They will be broadcasted to all Observers.
-- @arg {*...} values
function ReplaySubject:onNext(...)
table.insert(self.buffer, util.pack(...))
if self.bufferSize and #self.buffer > self.bufferSize then
table.remove(self.buffer, 1)
end
return Subject.onNext(self, ...)
end
ReplaySubject.__call = ReplaySubject.onNext
Observable.wrap = Observable.buffer
Observable['repeat'] = Observable.replicate
return {
util = util,
Subscription = Subscription,
Observer = Observer,
Observable = Observable,
ImmediateScheduler = ImmediateScheduler,
CooperativeScheduler = CooperativeScheduler,
TimeoutScheduler = TimeoutScheduler,
Subject = Subject,
AsyncSubject = AsyncSubject,
BehaviorSubject = BehaviorSubject,
ReplaySubject = ReplaySubject
}
|
--cornercode
-- 0x1 = topleft
-- 0x2 = topright
-- 0x4 = botleft
-- 0x8 = botright
--combine, e.g.
-- 0x3 = top
-- 0xd = l-shape
-- 0xf = all
--dividecode
-- same as cornercode, but no
-- high bit. e.g.
-- 0x1 = topleft
-- 0x2 = topright
-- 0x3 = top/bottom
-- 0x4 = botleft
-- 0x5 = left/right
-- 0x6 = crisscross (bad)
-- 0x7 = botright
big_divs=64
thin_divs=80
wall_divs=96
box_masks=112
zig_masks=128
plt_addr=0x5000 -- to 0x50ff
sha_addr=0x5100 -- to 0x51ff
sha2_addr=0x5200 -- to 0x520f
tex_stone=4
tex_grass=6
tex_tangle=8
tex_rock=10
tex_dirt=12
all_tex={4,6,8,10,12,14,20,22}
function rnd_tex()
return all_tex[rn(#all_tex)+1]
end
function ccode(tl,tr,bl,br)
-- corder code
return
(tl and 1 or 0) +
(tr and 2 or 0) +
(bl and 4 or 0) +
(br and 8 or 0)
end
function abcl(a,b,v)
-- a/b classify
if (v==a) return 1
if (v==b) return 2
return 0
end
function ccodemap4(a,b,mx,my)
-- read map to calculate corner code
local
tlc,trc,blc,brc
tlc=abcl(a,b,mget(mx,my))
trc=abcl(a,b,mget(mx+1,my))
blc=abcl(a,b,mget(mx,my+1))
brc=abcl(a,b,mget(mx+1,my+1))
return ccode(
tlc==0,trc==0,blc==0,brc==0),
max(max(max(tlc,trc),
blc),
brc)
end
function sprofs(s, y)
-- calculate address of sprite #s row y
y=y or 0
return
(s%16)*4 +
(flr(s/16)*512) +
y*64
end
function gfxofs(x, y)
-- calculate address of screen
-- x,y. when x is odd, round
-- down to the byte
return
0x6000 +
flr(x/2) +
y*64
end
function maskcpy(
src1,src2,mask,dest,bytes)
-- copy pixel bytes with a
-- mask, which should have
-- 0x0 nibbles for clear and
-- 0x7 nibbles for opaque
-- applies a palette
-- transform to src1 only
for i=1,bytes do
s1=peek(
bor(plt_addr,peek(src1)))
m=peek(mask)
s2=peek(src2)
v=band(s1,m)+band(s2,bnot(m))
poke(dest,v)
src1+=1
src2+=1
dest+=1
mask+=1
end
end
function nomaskcpy(
src1,src2,mask,dest,bytes)
for i=1,bytes do
s1=peek(
bor(plt_addr,peek(src1)))
poke(dest,s1)
src1+=1
dest+=1
end
end
function memspr(spr,go)
maskspr2(spr,nil,nil,go)
end
function maskspr2(
spr1,spr2,mask,go)
so1=sprofs(spr1)
local mcpy=maskcpy
local mo=0
if mask==nil then
mcpy = nomaskcpy
else
mo=mask
end
if spr2==nil then
so2 = go
else
so2 = sprofs(spr2)
end
--sprofs(mask)
for h=0,7 do
mcpy(
so1,so2,
mo,go,4)
so1+=64
so2+=64
mo+=64
go+=64
end
end
function build_plt(addr)
-- build lookup table for
-- palette to use in maskspr
local ca,cb
for a=0,15 do
ca=shl(
band(15,peek(0x5f00+a)),4)
for b=0,15 do
cb=band(15,peek(0x5f00+b))
poke(
addr+bor(shl(a,4),b),
bor(ca,cb))
end
end
end
function pal_switch(n)
setpal(n)
build_plt(plt_addr)
end
wall=2
floor=1
tex_wall=tex_rock
tex_floor=tex_tangle
function setpal(idx)
for i=0,3 do
pal(i,sget(idx,i+8))
end
end
function getunusedcol(pal1,pal2,pal3)
local c=15
repeat
local ok=true
for i=0,3 do
for p in all({pal1,pal2,pal3}) do
if sget(p,i+8)==c then
c-=1
ok=false
end
end
end
until ok
return c
end
function prerender(
tex_a, tex_b,
pal_a, pal_b,
ptr_dest)
pal_switch(pal_a)
for i=0,15 do
maskspr2(tex_a,nil,nil,
ptr_dest+i*4)
end
pal_switch(pal_b)
for i=0,15 do
maskspr2(
tex_b,nil,
sprofs(zig_masks+i),
ptr_dest+i*4)
end
end
function rn(n)
return flr(rnd(n))
end
function mkbiome(b)
b.w={t=b.walt,p=b.walp}
b.f={t=b.flot,p=b.flop}
b.b={t=b.bort,p=b.borp}
return b
end
function rndbiome()
return mkbiome {
walt=rnd_tex(),
flot=rnd_tex(),
bort=big_divs + 16*rn(3),
walp=rn(24),
flop=rn(24),
borp=rn(24),
wallstyle=rn(3)
}
end
biomes={}
function genbiomes(seed)
if (seed!=nil) srand(seed)
for i=0,63 do
biomes[i]=rndbiome()
end
end
ice_biome={
walt=tex_rock,
flot=tex_dirt,
bort=wall_divs,
walp=8,
flop=10,
borp=9
}
dark_biome={
walt=tex_dirt,
flot=tex_dirt,
bort=big_divs,
walp=11,
flop=0,
--borp=6
borp=rn(24)
}
forest_biome={
walt=tex_tangle,
flot=tex_grass,
bort=thin_divs,
walp=4,
flop=12,
borp=13
}
darker_biome={
walt=tex_rock,
flot=tex_dirt,
bort=thin_divs,
walp=0,
flop=1,
borp=14
}
main_bordert=15
ex1_bordert=15
ex2_bordert=15
function counter(c,d)
return function()
local r=c
c+=d
return r
end
end
function setup_room(
biome_main,
biome_ex1,
biome_ex2)
palt()
palt(0,false)
prerender(
biome_main.walt,
biome_ex1.walt,
biome_main.walp,
biome_ex1.walp,
0x1800)
prerender(
biome_main.walt,
biome_ex2.walt,
biome_main.walp,
biome_ex2.walp,
0x1a00)
prerender(
biome_main.flot,
biome_ex1.flot,
biome_main.flop,
biome_ex1.flop,
0x1c00)
prerender(
biome_main.flot,
biome_ex2.flot,
biome_main.flop,
biome_ex2.flop,
0x1e00)
--rectfill(0,0,127,7,0)
memset(0x1600,0,0x200)
ptr_spr=counter(sprofs(main_wavt),4)
function do_variant(pt)
pal_switch(pt.p)
memspr(pt.t+1,ptr_spr())
end
do_variant(biome_main.w)
do_variant(biome_main.f)
do_variant(biome_ex1.w)
do_variant(biome_ex1.f)
do_variant(biome_ex2.w)
do_variant(biome_ex2.f)
pal_switch(biome_main.borp)
main_bordert=
getunusedcol(
biome_main.borp,
biome_ex1.borp,
biome_ex2.borp)
pal(3,main_bordert)
build_plt(plt_addr)
ptr_spr=counter(sprofs(main_bort),4)
for i=0,7 do
memspr(biome_main.bort+i,ptr_spr())
end
ptr_spr=counter(sprofs(ex1_bort),4)
memset(0x1400,0,0x200)
setpal(biome_ex1.borp)
pal(3,main_bordert)
build_plt(plt_addr)
for i=0,7 do
memspr(biome_ex1.bort+i,ptr_spr())
end
setpal(biome_ex2.borp)
pal(3,main_bordert)
build_plt(plt_addr)
for i=0,7 do
memspr(biome_ex2.bort+i,ptr_spr())
end
--Uncomment to dump sprites
--back to screen
--memcpy(0x6000,0x1400,0xc00)
bake_map()
clear_borders()
bake_borders(1, main_bort)
bake_borders(2, ex1_bort)
bake_borders(3, ex2_bort)
end
-- We use sprites 0xb8..0xff
-- for pre-baking the map tiles
-- for room.
-- wavt: wall/variant/tex
-- flvt: floor/variant/tex
main_wavt=0xb8
main_flvt=0xb9
ex1_wavt=0xba
ex1_flvt=0xbb
ex2_wavt=0xbc
ex2_flvt=0xbd
main_bort=0xb0
ex1_bort=0xa0
ex2_bort=0xa8
wall_ex1=0xc0
wall_ex2=0xd0
floor_ex1=0xe0
floor_ex2=0xf0
variants={
[wall_ex1]=main_wavt,
[wall_ex2]=main_wavt,
[floor_ex1]=main_flvt,
[floor_ex2]=main_flvt,
[wall_ex1+0xf]=ex1_wavt,
[wall_ex2+0xf]=ex2_wavt,
[floor_ex1+0xf]=ex1_flvt,
[floor_ex2+0xf]=ex2_flvt
}
function vspr(idx, x, y)
local v=variants[idx] or idx
if (flr(shr(x,3))+flr(shr(y,3)))%2==0 then
idx=v
end
spr(idx,x,y)
end
function pickv(idx, x, y)
if (x+y)%2==0 then
return variants[idx] or idx
end
return idx
end
function clear_borders()
mrect(54,0,54+16,16,0)
end
function bake_borders(code, texbase)
local q
for x=0,15 do
for y=0,15 do
q=ccodemap4(2,3,x,y)
if band(q,8)==8 then
q=bxor(q,0xf)
end
ex=mget(x+19,y+1)
if ex==code and q>0 then
mset(54+x,y,texbase+q)
end
end
end
end
shadow_tiles={
[4]=4,
[6]=4,
[8]=7,
[9]=7,
[12]=3,
[13]=2,
[14]=1
}
function draw_shadows()
local q
pal()
palt(0,false)
for x=0,15 do
for y=0,15 do
q=ccodemap4(2,3,x,y)
if q>0 then
q=peek(sha2_addr+q)
if q>0 then
fast_shadow(72+q,x*8,y*8)
end
end
end
end
end
function slow_shadow(sidx,x,y)
-- Works anywhere
local sx=8*(sidx%16)
local sy=8*flr(sidx/16)
for yy=0,7 do
for xx=0,7 do
local c=sget(xx+sx,yy+sy)
local d=pget(x+xx,y+yy)
c=peek(sha_addr+bor(d,shl(c,4)))
pset(x+xx,y+yy,c)
end
end
end
function fast_shadow(sidx,x,y)
-- Does not range check - not
-- safe to use if it might
-- fall outside the screen.
-- Only for even x.
local saddr=sprofs(sidx)
local paddr=gfxofs(x,y)
-- The most outrageous hack of
-- all here is that we start
-- yy from 3 since none of our
-- shadow textures have content
-- in the top three rows.
for yy=3,7 do
local ofs=yy*64
for xx=0,3 do
local cs=peek(saddr+ofs)
local ds=peek(paddr+ofs)
local clo=shl(band(cs,0x3),4)
local dlo=band(ds,0xf)
dlo=peek(bor(clo,dlo)+sha_addr)
local chi=band(cs,0xf0)
local dhi=shr(band(ds,0xf0),4)
dhi=peek(bor(chi,dhi)+sha_addr)
cs=bor(dlo,shl(dhi,4))
poke(paddr+ofs,cs)
ofs+=1
end
end
end
function init_fast_shadow(addr)
-- build lookup table for
-- palette to use fast_shadow
for c=0,3 do
for d=0,15 do
local result=sget(c,d+16)
poke(sha_addr+d+c*16,result)
end
end
memset(sha2_addr,16,0)
for idx,v in pairs(shadow_tiles) do
poke(sha2_addr+idx,v)
end
end
function dice(lo,hi)
if (lo>=hi) return lo
return rn(hi-lo+1)+lo
end
function mrect(x1,y1,x2,y2,v)
for y=y1,y2 do
for x=x1,x2 do
mset(x,y,v)
end
end
end
seed_xlinks=77
seed_ylinks=78
seed_walls=79
clockwise={
{0,-1},
{1,-1},
{1,0},
{1,1},
{0,1},
{-1,1},
{-1,0},
{-1,-1}
}
cardinal={
{0,-1},
{1,0},
{0,1},
{-1,0}
}
function cavernify(x,y,p)
-- toggle map cell iff it
-- won't affect topology
-- assumes all map values
-- are 1 or 2
function getneib(dir)
return mget(
x+dir[1],
y+dir[2])
end
local acc=0
local prev=getneib(
clockwise[
#clockwise])
for dir in all(clockwise) do
local v=getneib(dir)
if v!=prev then
acc+=1
end
prev=v
end
if (acc!=2) return
acc=0
local cell=mget(x,y)
for dir in all(cardinal) do
if getneib(dir)!=cell then
acc+=1
end
end
if (acc==0) return
if (acc==1 and dice(1,p)>1) return
--printh('x'..x..' y'..y..' := '..(3-cell))
mset(x,y,3-cell)
end
function pickitempos()
local x,y
while true do
x=dice(2,14)
y=dice(2,14)
if mget(x,y)==1 then
x=mid(3,x,13)
y=mid(3,y,13)
mrect(x-1,y-1,x+1,y+1,1)
return {x,y}
end
end
end
ctrl=800
function random_walls(maze,gx,gy,walls)
local topx=flr(prng(9,seed_xlinks,gx,gy))+4
local topw=1
local botx=flr(prng(9,seed_xlinks,gx,gy+1))+4
local botw=1
local lefty=flr(prng(9,seed_ylinks,gx,gy))+4
local lefth=1
local righty=flr(prng(9,seed_ylinks,gx+1,gy))+4
local righth=1
local minx=min(topx-topw,botx-botw)
local maxx=max(topx+topw,botx+botw)
local miny=min(lefty-lefth,righty-righth)
local maxy=max(lefty+lefth,righty+righth)
minx=dice(2,minx)
maxx=dice(maxx,14)
miny=dice(2,miny)
maxy=dice(maxy,14)
local vert=((gx+gy)%2)==0
mrect(0,0,16,16,2)
mrect(18,0,18+17,17,1)
mrect(minx,miny,maxx,maxy,1)
prng(-1,seed_walls,gx,gy)
--for i=0,7 do
-- local x=flr(rnd(maxx-minx+1))+minx
-- local y=flr(rnd(maxy-miny+1))+miny
-- mset(x,y,2)
--end
if maze.has(gx,gy-1,1) then
mrect(topx-topw,0,topx+topw,miny,1)
if vert then
mrect(18+topx-topw-1,0,18+topx+topw+2,3,2)
mrect(18+topx-topw,4,18+topx+topw+1,4,2)
end
end
if maze.has(gx,gy,1) then
mrect(botx-botw,maxy,botx+botw,16,1)
if vert then
mrect(18+botx-botw-1,14,18+botx+botw+2,17,3)
mrect(18+botx-botw,13,18+botx+botw+1,13,3)
end
end
if maze.has(gx-1,gy,0) then
mrect(0,lefty-lefth,minx,lefty+lefth,1)
if not vert then
mrect(18,lefty-lefth-1,18+3,lefty+lefth+2,2)
mrect(18+4,lefty-lefth,18+4,lefty+lefth+1,2)
end
end
if maze.has(gx,gy,0) then
mrect(maxx,righty-righth,16,righty+righth,1)
if not vert then
mrect(18+14,righty-righth-1,18+17,righty+righth+2,3)
mrect(18+13,righty-righth,18+13,righty+righth+1,3)
end
end
if walls>0 then
for i=0,((walls==2) and 800 or 100) do
cavernify(dice(2,14),dice(2,14),(walls==2) and 32 or 1)
end
end
local itempos=pickitempos()
gix=itempos[1]
giy=itempos[2]
end
function bake_map()
local v,q,ex
for x=0,16 do
for y=0,16 do
v=mget(x,y)
if v==wall then
q,ex=ccodemap4(2,3,x+18,y)
q=bxor(0xf,q)
if ex==0 then
-- solid main wall
mset(x+36,y,pickv(wall_ex1,x,y))
else
mset(x+36,y,pickv(wall_ex1+q+16*(ex-1),x,y))
end
else
q,ex=ccodemap4(2,3,x+18,y)
q=bxor(0xf,q)
if ex==0 then
-- solid main floor
mset(x+36,y,pickv(floor_ex1,x,y))
else
mset(x+36,y,pickv(floor_ex1+q+16*(ex-1),x,y))
end
end
end
end
end
function draw_bg()
pal()
palt()
palt(0,false)
map(36,0,-4,-4,17,17)
draw_shadows()
end
function draw_fg()
pal()
palt()
palt(0,false)
palt(main_bordert,true)
map(54,0,0,0,16,16)
end
|
local Players = game:GetService("Players")
local Modules = Players.LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local StatusCodes = require(Modules.Http.StatusCodes)
local NO_CONNECTION_ERROR_STRING = "Feature.Toast.NetworkingError.UnableToConnect"
local TIME_OUT_STRING = "Feature.Toast.NetworkingError.Timeout"
local DEFAULT_STRING = "Feature.Toast.NetworkingError.SomethingIsWrong"
local STATUS_CODE_TO_STRING = {
[StatusCodes.BAD_REQUEST] = "Feature.Toast.NetworkingError.SomethingIsWrong",
[StatusCodes.UNAUTHORIZED] = "Feature.Toast.NetworkingError.Unauthorized",
[StatusCodes.FORBIDDEN] = "Feature.Toast.NetworkingError.Forbidden",
[StatusCodes.NOT_FOUND] = "Feature.Toast.NetworkingError.NotFound",
[StatusCodes.REQUEST_TIMEOUT] = "Feature.Toast.NetworkingError.Timeout",
[StatusCodes.TOO_MANY_REQUESTS] = "Feature.Toast.NetworkingError.TooManyRequests",
[StatusCodes.INTERNAL_SERVER_ERROR] = "Feature.Toast.NetworkingError.SomethingIsWrong",
[StatusCodes.NOT_IMPLEMENTED] = "Feature.Toast.NetworkingError.SomethingIsWrong",
[StatusCodes.BAD_GATEWAY] = "Feature.Toast.NetworkingError.SomethingIsWrong",
[StatusCodes.SERVICE_UNAVAILABLE] = "Feature.Toast.NetworkingError.ServiceUnavailable",
[StatusCodes.GATEWAY_TIMEOUT] = "Feature.Toast.NetworkingError.Timeout",
}
--[[
returns a localization key that gets displayed to the user when a network
request has failed.
Inputs:
httpError -- user data type. (Enum.HttpError.*)
statusCode -- number.
]]
local function getLocalizedToastStringFromHttpError(httpError, statusCode)
if httpError == nil or type(httpError) ~= "userdata" then
print(httpError)
error("getLocalizedToastStringFromHttpError: Must have a valid httpError!")
end
if statusCode ~= nil and type(statusCode) ~= "number" then
error("getLocalizedToastStringFromHttpError: statusCode must be a number!")
end
if httpError == Enum.HttpError.DnsResolve or httpError == Enum.HttpError.ConnectFail or
httpError == Enum.HttpError.NetFail or httpError == Enum.HttpError.SslConnectFail then
return NO_CONNECTION_ERROR_STRING
elseif httpError == Enum.HttpError.TimedOut then
return TIME_OUT_STRING
-- We shouldn't report any errors if the network request is canceled.
elseif httpError == Enum.HttpError.Aborted then
return nil
elseif httpError == Enum.HttpError.OK and statusCode ~= nil and STATUS_CODE_TO_STRING[statusCode] ~= nil then
return STATUS_CODE_TO_STRING[statusCode]
end
return DEFAULT_STRING
end
return getLocalizedToastStringFromHttpError
|
serialization_version = 1.0
return {
PLAYER={
id="PLAYER",
name="Player",
aipath="assets/ai/player_ai.lua",
animpath="assets/animations/anim_player.lua",
col_width = 32,
col_height = 32,
health = 10,
friction = 1.0,
eye_height = 26,
},
PICKUPS={
id="PICKUPS",
name="Pickup",
aipath="assets/ai/pickup_ai.lua",
animpath="assets/animations/anim_pickups.lua",
col_width = 32,
col_height = 32,
health = 10,
friction = 1.0,
eye_height = 26,
anti_projectile = true,
},
STUMP={
id="STUMP",
name="Tree Stump",
aipath="assets/ai/tiles/ai_tile.lua",
animpath="assets/animations/anim_stump.lua",
col_width = 60,
col_height = 64,
health = 20,
friction = 1.0,
eye_height = 32,
max_anims = 3,
tile = true,
anti_projectile = true,
},
TREE_WALL={
id="TREE_WALL",
name="Tree",
aipath="assets/ai/tiles/ai_empty.lua",
animpath="assets/animations/anim_tree_wall.lua",
col_width = 64,
col_height = 300,
health = 20,
friction = 1.0,
eye_height = 150,
max_anims = 3,
tile = true,
wall = true,
anti_projectile = true,
},
FOREST_BAT={
id="FOREST_BAT",
name="Forest Bat",
aipath="assets/ai/enemies/forest_bat_ai.lua",
animpath="assets/animations/enemies/anim_forest_bat.lua",
col_width = 32,
col_height = 32,
health = 3,
friction = 1.0,
eye_height = 26,
drops_chance = 0.1
},
BULLET={
id="BULLET",
name="Bullet",
aipath="assets/ai/bullet_ai.lua",
animpath="assets/animations/anim_bullet.lua",
col_width = 16,
col_height = 16,
health = 1,
friction = 1.0,
eye_height = 8,
projectile=true,
handlesownmovement=true
},
SPIDER={
id="SPIDER",
name="Spider",
aipath="assets/ai/enemies/spider_ai.lua",
animpath="assets/animations/enemies/anim_spider.lua",
col_width = 32,
col_height = 32,
health = 7.5,
friction = 1.0,
eye_height = 14,
drops_chance = 0.4
},
SPIDER_BOSS={
id="SPIDER_BOSS",
name="Colospider",
aipath="assets/ai/enemies/boss_spider_ai.lua",
animpath="assets/animations/enemies/anim_boss_spider.lua",
col_width = 64,
col_height = 64,
health = 30,
friction = 1.0,
eye_height = 14,
drops_chance = 1.0,
is_boss = true,
},
TURTLE={
id="TURTLE",
name="Turtle",
aipath="assets/ai/enemies/turtle_ai.lua",
animpath="assets/animations/enemies/anim_turtle.lua",
col_width = 32,
col_height = 32,
health = 10,
friction = 1.0,
eye_height = 14,
drops_chance = 0.5
},
}
|
-- =============================================================
-- Copyright Roaming Gamer, LLC. 2008-2018 (All Rights Reserved)
-- =============================================================
local logger = {}
local print
local function round(val, n)
if (n) then
return math.floor( (val * 10^n) + 0.5) / (10^n)
else
return math.floor(val+0.5)
end
end
local w = display.contentWidth
local h = display.contentHeight
local centerX = display.contentCenterX
local centerY = display.contentCenterY
local fullw = display.actualContentWidth
local fullh = display.actualContentHeight
local unusedWidth = fullw - w
local unusedHeight = fullh - h
local deviceWidth = math.floor((fullw/display.contentScaleX) + 0.5)
local deviceHeight = math.floor((fullh/display.contentScaleY) + 0.5)
local left = 0 - unusedWidth/2
local top = 0 - unusedHeight/2
local right = w + unusedWidth/2
local bottom = h + unusedHeight/2
w = round(w)
h = round(h)
left = round(left)
top = round(top)
right = round(right)
bottom = round(bottom)
fullw = round(fullw)
fullh = round(fullh)
left = (left>=0) and math.abs(left) or left
top = (top>=0) and math.abs(top) or top
local orientation = ( w > h ) and "landscape" or "portrait"
local isLandscape = ( w > h )
local isPortrait = ( h > w )
--------------------------------------------------------------------------------
-- CONVERT TABLE TO STRING
-- From Jason Schroeder's Twitter Demo
-- http://www.jasonschroeder.com/
--------------------------------------------------------------------------------
function table.toString ( t, flat )
local output = {}
local print_r_cache={}
local function sub_print_r(t,indent)
local function assemble(string)
output[#output + 1] = string
end
if (print_r_cache[tostring(t)]) then
assemble(indent.."*"..tostring(t))
else
print_r_cache[tostring(t)]=true
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
if( flat ) then
assemble(indent..tostring(t).." {")
else
assemble(indent.."["..pos.."] => "..tostring(t).." {")
end
sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
assemble(indent..string.rep(" ",string.len(pos)+6).."}")
elseif (type(val)=="string") then
if( flat ) then
assemble(indent .. val)
else
assemble(indent.."["..pos..'] => "'..val..'"')
end
else
if( flat ) then
assemble(indent .. tostring(val))
else
assemble(indent.."["..pos.."] => "..tostring(val))
end
end
end
else
assemble(indent..tostring(t))
end
end
end
sub_print_r(t," ")
local tmp = output
output = ""
for i = 1, #tmp do
output = output .. tmp[i]
end
return output
end
function table.toString_old( t, flat )
local output = {}
local print_r_cache={}
local function sub_print_r(t,indent)
local function assemble(string)
output[#output + 1] = string
end
if (print_r_cache[tostring(t)]) then
assemble(indent.."*"..tostring(t))
else
print_r_cache[tostring(t)]=true
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
if( flat ) then
assemble(indent..tostring(t).." {")
else
assemble(indent.."["..pos.."] => "..tostring(t).." {")
end
sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
assemble(indent..string.rep(" ",string.len(pos)+6).."}")
elseif (type(val)=="string") then
if( flat ) then
assemble(indent .. val)
else
assemble(indent.."["..pos..'] => "'..val..'"')
end
else
if( flat ) then
assemble(indent .. tostring(val))
else
assemble(indent.."["..pos.."] => "..tostring(val))
end
end
end
else
assemble(indent..tostring(t))
end
end
end
sub_print_r(t," ")
return output
end
-- ==
-- string:rpad( len, char ) - Places padding on right side of a string, such that the new string is at least len characters long.
-- ==
function string_rpad( theStr, len, char)
if char == nil then char = ' ' end
return theStr .. string.rep(char, len - #theStr)
end
function logger.dump(theTable, padding, marker ) -- Sorted
marker = marker or ""
theTable = theTable or {}
local function compare(a,b)
return tostring(a) < tostring(b)
end
local tmp = {}
for n in pairs(theTable) do table.insert(tmp, n) end
table.sort(tmp,compare)
padding = padding or 30
print("\Table Dump:")
print("-----")
if(#tmp > 0) then
for i,n in ipairs(tmp) do
local key = tmp[i]
local value = tostring(theTable[key])
local keyType = type(key)
local valueType = type(value)
local keyString = tostring(key) .. " (" .. keyType .. ")"
local valueString = tostring(value) .. " (" .. valueType .. ")"
keyString = string_rpad(keyString ,padding)
valueString = string_rpad(valueString, padding)
print( keyString .. " == " .. valueString )
end
else
print("empty")
end
print( marker .. "-----\n")
end
-- ==
-- table.print_r( theTable ) - Dumps indexes and values inside multi-level table (for debug)
-- ==
function logger.print_r( t )
--local depth = depth or math.huge
local print_r_cache={}
local function sub_print_r(t,indent)
if (print_r_cache[tostring(t)]) then
print(indent.."*"..tostring(t))
else
print_r_cache[tostring(t)]=true
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
print(indent.."["..pos.."] => "..tostring(t).." {")
sub_print_r(val,indent..string.rep(" ",string.len(pos)+1))
print(indent..string.rep(" ",string.len(pos)+1).."}")
elseif (type(val)=="string") then
print(indent.."["..pos..'] => "'..val..'"')
else
print(indent.."["..pos.."] => "..tostring(val))
end
end
else
print(indent..tostring(t))
end
end
end
if (type(t)=="table") then
print(tostring(t).." {")
sub_print_r(t," ")
print("}")
else
sub_print_r(t," ")
end
end
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
------------------------------------------------------------
local json = require "json"
local _print = _G.print
local logFont
local systemFonts = native.getFontNames()
table.sort(systemFonts)
-- Display each font in the Terminal/console
for i, fontName in ipairs( systemFonts ) do
local tmp = fontName
tmp = fontName:gsub( "% ", "" )
tmp = tmp:gsub( "%-", "" )
--print( i, fontName, tmp)
if( tmp:lower() == "courier" ) then
logFont = fontName
elseif( tmp:lower() == "couriernew" ) then
logFont = fontName
end
end
--logger._print = _print
logger.data = {}
logger.print= function( ... )
--_G.print = function( ... )
local inString = ""
for i = 1, #arg do
local dataToShow = arg[i]
local resultType = type(dataToShow)
--_print( "ARG", i, resultType )
if resultType == "table" then
--_print(i, "In Table convert")
dataToShow = table.toString(dataToShow,true)
--elseif( resultType == "boolean" ) then
--dataToShow = tostring( dataToShow )
--elseif( resultType == "number" ) then
--dataToShow = tostring( dataToShow )
elseif( resultType ~= "string" ) then
dataToShow = tostring( dataToShow )
else
local jsonDecoded = json.decode(dataToShow)
if jsonDecoded ~= nil then
--_print(i, "In Other convert")
dataToShow = table.toString(dataToShow,true)
else
--_print(i, "In String no-convert")
end
end
--_print(i, type(dataToShow), resultType )
if( inString:len() > 0 ) then
inString = inString .. " " .. dataToShow
else
inString = string.format( "%6.6d : %s" , system.getTimer(), dataToShow )
end
end
--_print("BOB" , inString )
logger.data[#logger.data + 1] = inString
if( #logger.data > 200 ) then
table.remove(logger.data,1)
end
--[[
local inString = ""
for i = 1, #arg do
--_print("BOB" , i, arg[i] )
end
--]]
_print( unpack(arg) )
end
function logger.purge()
logger.data = {}
end
-- Doesn't work if called too soon
function logger.hide()
_print("logger.hide()", logger.doHide)
if( logger.doHide ) then
logger.doHide()
end
end
--------------------------------------------------------------------------------
-- CONVERT TABLE TO STRING
-- From Jason Schroeder's Twitter Demo
-- http://www.jasonschroeder.com/
--------------------------------------------------------------------------------
local frontGroup = display.newGroup()
function frontGroup.enterFrame( self )
if( not frontGroup ) then return end
if( frontGroup.removeSelf == nil ) then
Runtime:removeEventListener("enterFrame", frontGroup)
return true
end
frontGroup:toFront()
end
Runtime:addEventListener("enterFrame", frontGroup)
function logger.showCurrentLogs( dataToShow )
display.remove(frontGroup)
frontGroup = display.newGroup()
local resultType = type(dataToShow)
local json = require "json"
local widget = require("widget")
local accumHeight = 0
if resultType == "table" then
dataToShow = table.toString_old(dataToShow,true)
else
local jsonDecoded = json.decode(dataToShow)
if jsonDecoded ~= nil then
dataToShow = table.toString_old(dataToShow,true)
else
local text = dataToShow
dataToShow = {text}
end
end
local scrollView = widget.newScrollView({
width = fullw - 100,
height = fullh - 100,
topPadding = 15,
bottomPadding = 15,
leftPadding = 15,
rightPadding = 15,
x = centerX,
y = bottom + fullh,
horizontalScrollDisabled = true,
})
scrollView:addEventListener("tap", function() return true end)
frontGroup:insert(1, scrollView)
local textObjects = {}
for i = 1, #dataToShow do
local text = display.newText({
text = dataToShow[i],
width = scrollView.contentWidth - 60,
font = logFont,
fontSize = 14,
})
text.anchorX, text.anchorY = 0, 0
text.x = 30
if textObjects[i-1] then
text.y = textObjects[i-1].y + textObjects[i-1].height
else
text.y = 0
end
scrollView:insert(text)
text:setFillColor(0)
textObjects[i] = text
accumHeight = accumHeight + text.contentHeight
end
if( accumHeight > scrollView.contentHeight ) then
scrollView:scrollTo( "bottom", { time = 1500 } )
end
local blackout = display.newRect(frontGroup, centerX, centerY, fullw, fullh)
blackout:setFillColor(0, 0, 0, .6)
blackout.alpha = 0
blackout.isHitTestable = true
function logger.doHide()
local function remove()
display.remove(blackout)
display.remove(scrollView)
end
local function part4()
scrollView:toBack()
transition.to(scrollView, {y = bottom + fullh, time = 800, transition = easing.inOutSine, onComplete = remove})
end
local function part3()
transition.to(blackout, { alpha = 0, time = 300, transition = easing.inOutSine})
transition.to(scrollView, {y = top + fullh*.25, time = 300, transition = easing.inOutSine, onComplete = part4})
end
if blackout.alpha == 1 then
blackout.tap = function() return true end
part3()
end
--logger.doHide = nil
logger.isOpen = false
return true
end
blackout.tap = logger.doHide
blackout:addEventListener("tap")
blackout:addEventListener("touch", function() return true end)
local function part2()
scrollView:toFront()
transition.to(scrollView, {y = centerY, time = 300, transition = easing.inOutSine, onComplete = part3})
transition.to(blackout, {alpha = 1})
end
transition.to(scrollView, {y = top + fullh*.25, time = 800, transition = easing.inOutSine, onComplete = part2})
end
logger.isOpen = false
logger.ignoringOpenHide = false
function logger.show()
-- Prevent open-close spamming
--
if( logger.ignoringOpenHide ) then
return
end
logger.ignoringOpenHide = true
timer.performWithDelay( 2000,
function()
logger.ignoringOpenHide = false
end )
-- Already open? Close it
if( logger.isOpen ) then
logger.hide()
return
end
-- Open it.
logger.isOpen = true
logger.showCurrentLogs( logger.data )
end
local unhandledErrorListener = function( event )
print("unhandledError:\n", event.errorMessage)
--table.print_r( event )
end
Runtime:addEventListener( "unhandledError", unhandledErrorListener )
print = logger.print
--print("============================================")
--print("Selected logFont == ", logFont )
--print("============================================\n")
return logger
|
object_tangible_loot_mustafar_cube_loot_cube_loot_1o = object_tangible_loot_mustafar_cube_loot_shared_cube_loot_1o:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_mustafar_cube_loot_cube_loot_1o, "object/tangible/loot/mustafar/cube/loot/cube_loot_1o.iff")
|
print("what the fuck")
html = [[
<html>
<head></head>
<body>
<a href="http://www.runoob.com/">菜鸟教程</a>
</body>
</html>
]]
print(html)
print([[ come on ]])
-- 单行注释
--[[
多行注释
多行注释
多行注释
多行注释
--]]
print("2" + 6)
print("2" + "6")
print("2 + 6")
print("-2e2" * "6")
-- print("error" + 1) -- error
print("a" .. 'b')
print(157 .. 428)
|
-- cbind - A library for generating bindings.
-- Written in 2014 by Jesper Oskarsson jesosk@gmail.com
--
-- To the extent possible under law, the author(s) have dedicated all copyright
-- and related and neighboring rights to this software to the public domain worldwide.
-- This software is distributed without any warranty.
--
-- You should have received a copy of the CC0 Public Domain Dedication along with this software.
-- If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
require "common"
local type_to_string_tbl = {
ptr = "System.IntPtr",
}
local function type_to_s( type )
if type.basic_type then
local translated = type_to_string_tbl[type.basic_type]
if translated then return translated end
return type.basic_type
else
return type.namespace .. "." .. type.class
end
end
local function filter_method_name( name )
return std_to_camel( name:gsub( "(.+)%?$", "is_%1" ):gsub( "%!$", "" ) )
end
local function arguments(arguments, func)
return "(" .. list_as_string( arguments, func, ", " ) .. ")"
end
call_arguments = arguments
local function transform_operator( op )
if op == "Plus" then return "+" end
if op == "Minus" then return "-" end
if op == "Equal" then return "==" end
if op == "NotEqual" then return "!=" end
if op == "LessThan" then return "<" end
if op == "GreaterThan" then return ">" end
if op == "LessThanEqual" then return "<=" end
if op == "GreaterThanEqual" then return ">=" end
if op == "Is" then return "==" end
end
local function transform_expression( symbol )
if symbol.is_literal then
return symbol.token.value
end
if symbol.is_identifier then
return symbol.token.value
end
if symbol.is_infix_op then
return "(" .. transform_expression( symbol.left ) .. " " .. transform_operator( symbol.op ) .. " " .. transform_expression( symbol.right ) .. ")"
end
if symbol.is_enum then
return std_to_camel( symbol.namespace.token.value ) .. ".Imported." .. camel_to_std( filter_enum( symbol.identifier.token.value ) ):upper()
end
if symbol.is_member then
return symbol.object.token.value .. "." .. symbol.name.token.value
end
if symbol.is_constant then
return std_to_camel( symbol.namespace.token.value ) .. ".Imported." .. camel_to_std( filter_enum( symbol.name.token.value ) ):upper()
end
if symbol.is_method_call then
return symbol.object.token.value .. "." .. filter_method_name( symbol.name.token.value ) .. call_arguments( symbol.arguments, transform_expression )
end
if symbol.is_call then
return std_to_camel( symbol.namespace.token.value ) .. ".Imported." .. symbol.name.token.value .. call_arguments( symbol.arguments, transform_expression )
end
if symbol.is_new then
return "new " .. symbol.type.namespace .. "." .. symbol.type.class .. call_arguments( symbol.arguments, transform_expression )
end
assert( false, "Unknown expression" )
end
local function transform_identifier_type_pair( pair )
return type_to_s( pair.type ) .. " " .. pair.name.token.value
end
local function transform_statement( symbol )
if symbol.is_return then
return line( "return " .. transform_expression( symbol.expression ) .. ";" )
end
if symbol.is_if then
return line( "if (" .. transform_expression( symbol.expression ) .. ")" )
.. line( "{", 1 )
.. list_as_string( symbol.statements, transform_statement )
.. line( nil, -1 )
.. line( "}" )
end
if symbol.is_while then
return line( "while (" .. transform_expression( symbol.expression ) .. ")" )
.. line( "{", 1 )
.. list_as_string( symbol.statements, transform_statement )
.. line( nil, -1 )
.. line( "}" )
end
if symbol.is_local_declaration then
local str = ""
for i, item in ipairs( symbol.identifier_type_pairs ) do
str = str .. line( transform_identifier_type_pair( item ) .. ";" )
end
return str
end
if symbol.is_assign_member then
return line( symbol.object.token.value .. "." .. symbol.name.token.value .. " = " .. transform_expression( symbol.expression ) .. ";" )
end
if symbol.is_method_call then
return line( symbol.object.token.value .. "." .. filter_method_name( symbol.name.token.value ) .. call_arguments( symbol.arguments, transform_expression ) .. ";" )
end
if symbol.is_call then
return line( std_to_camel( symbol.namespace.token.value ) .. ".Imported." .. symbol.name.token.value .. call_arguments( symbol.arguments, transform_expression ) .. ";" )
end
if symbol.is_assign_local then
return line( symbol.name.token.value .. " = " .. transform_expression( symbol.expression ) .. ";" )
end
if symbol.is_signal_call then
return line( "if (" .. std_to_camel( symbol.name.token.value ) .. " != null) " .. std_to_camel( symbol.name.token.value ) .. "(this" .. list_as_string( symbol.arguments, transform_expression, ", ", true ) .. ");" )
end
if symbol.is_delete then
if symbol.member then
return line( symbol.object.token.value .. "." .. symbol.member.token.value .. " = null;" )
else
return line( symbol.object.token.value .. " = null;" )
end
end
end
local function transform_class_statement( symbol, class_name )
if symbol.is_method_definition then
local args = arguments( symbol.arguments, transform_identifier_type_pair )
local str
if symbol.name.token.value == "construct" then
str = line( "public " .. class_name .. args )
else
str = line( "public " .. type_to_s( symbol.return_type ) .. " " .. filter_method_name( symbol.name.token.value ) .. args )
end
return str
.. line( "{", 1 )
.. list_as_string( symbol.statements, transform_statement )
.. line( nil, -1 )
.. line( "}" )
end
if symbol.is_define_member then
local str = ""
for _, pair in ipairs( symbol.identifier_type_pairs ) do
str = str .. line( transform_identifier_type_pair( pair ) .. ";" )
end
return str
end
if symbol.is_property then
local str =
line( "public " .. type_to_s( symbol.type ) .. " " .. std_to_camel( symbol.name.token.value ) )
.. line( "{", 1 )
if symbol.get_statements then
str = str
.. line( "get" )
.. line( "{", 1 )
.. list_as_string( symbol.get_statements, transform_statement )
.. line( nil, -1 )
.. line( "}" )
end
if symbol.set_statements then
str = str
.. line( "set" )
.. line( "{", 1 )
.. list_as_string( symbol.set_statements, transform_statement )
.. line( nil, -1 )
.. line( "}" )
end
return str
.. line( nil, -1 )
.. line( "}" )
end
end
local function transform_interface_statement( symbol )
if symbol.is_method_declaration then
return line( type_to_s( symbol.return_type ) .. " " .. filter_method_name( symbol.name.token.value ) .. arguments( symbol.arguments, transform_identifier_type_pair ) .. ";" )
end
end
local function transform_module( symbol )
if symbol.is_class then
local interface = ""
if symbol.interface then
interface = ", " .. symbol.interface.namespace.token.value .. "." .. symbol.interface.name.token.value
end
local signals = list_signals( symbol.statements )
local str =
line( "namespace " .. symbol.namespace.token.value )
.. line( "{", 1 )
str = str
.. line( "public class " .. symbol.name.token.value .. " : System.IDisposable" .. interface )
.. line( "{", 1 )
for _, signal in ipairs( signals ) do
str = str
.. line( "public delegate void " .. std_to_camel( signal.name.token.value ) .. "Delegate(" .. symbol.name.token.value .. " sender" .. list_as_string( signal.arguments, transform_identifier_type_pair, ", ", true ) .. ");" )
end
for _, signal in ipairs( signals ) do
str = str
.. line( "public event " .. std_to_camel( signal.name.token.value ) .. "Delegate " .. std_to_camel( signal.name.token.value ) .. ";" )
end
str = str
.. list_as_string( symbol.statements, transform_class_statement, "\n", false, symbol.name.token.value )
.. line( "" )
.. line( "public void Dispose()" )
.. line( "{", 1 )
.. line( "Destruct();" )
.. line( nil, -1 )
.. line( "}", -1 )
.. line( "}", -1 )
.. line( "}" )
.. line( "" )
return str
end
if symbol.is_interface then
return line( "namespace " .. symbol.namespace.token.value )
.. line( "{", 1 )
.. line( "public interface " .. symbol.name.token.value )
.. line( "{", 1 )
.. list_as_string( symbol.statements, transform_interface_statement )
.. line( nil, -1 )
.. line( "}", -1 )
.. line( "}" )
.. line( "" )
end
assert( false, "Unknown module statement" )
end
function generate_class_csharp( class, classes )
return transform_module( class )
end
|
local function Reply(msg)
local text = msg.content_.text_
if ChatType == 'sp' or ChatType == 'gp' then
if not DevAbs:get(muslim..'Abs:Lock:Reply'..msg.chat_id_) then
if text == "اسكت" or text == "سكت" or text == "اسكتي" or text == "سكتي" or text == "اسكتو" or text == "سكتو" then
if SudoId(msg.sender_user_id_) then
rd = 'مطوريي اغلط شكد متريد نورتنه ، ♥️💪🏿'
elseif SudoBot(msg.sender_user_id_) then
rd = 'احترم نفسكك لا عبالكك رافعيك مطور ، 🖕🏿♥️'
elseif ManagerAll(msg.sender_user_id_) then
rd = 'حبيبي راح اسامحكك لان مدير وع راسي ، 🖐🏿♥️'
elseif AdminAll(msg.sender_user_id_) then
rd = 'راح اسامحكك هلمره لانك ادمن ، ☝🏿♥️'
elseif VipAll(msg.sender_user_id_) then
rd = 'راح احترمكك تره بس هلمره لانك مميز عندي ، ☝🏿♥️'
elseif AbsConstructor(msg.sender_user_id_, msg.chat_id_) then
rd = 'تاج راسيي غير انت منشئ المجموعه ،🖐🏿♥️'
elseif Constructor(msg.sender_user_id_, msg.chat_id_) then
rd = 'تاج راسيي انت المنشئ الاساسي ،🖐🏿♥️'
elseif BasicConstructor(msg.sender_user_id_, msg.chat_id_) then
rd = 'حبيبي المنشئ استقبلها منكك ،👍🏿♥️'
elseif Manager(msg.sender_user_id_, msg.chat_id_) then
rd = 'حبيبي راح اسامحكك لان مدير وع راسي ، 🖐🏿♥️'
elseif Admin(msg.sender_user_id_, msg.chat_id_) then
rd = 'راح اسامحكك هلمره لانك ادمن ، ☝🏿♥️'
elseif VipMem(msg.sender_user_id_, msg.chat_id_) then
rd = 'راح احترمكك تره بس هلمره لانك مميز عندي ، ☝🏿♥️'
else
rd = 'لكك هوه انت عضو وجاي تغلط ؟، 🖕🏿♥️'
end
Dev_Abs(msg.chat_id_, msg.id_, 1,rd, 1, 'html')
end
if text == 'دي' or text == 'ديي' or text == 'دي بابه' then
dev yousef = "آخلُِآقٌڪڪ لُِڪڪ 𖠙 😒🔪"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'السلام عليكم' or text == 'سلام عليكم' then
dev yousef = "ياھَہّلْاا ۅﻋ̝̚لْيڪْم الْﺳ̭͠ لْام 𖠙 🤤♥️"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == '😭💔' or text == '😭😭' or text == '😭😭😭' or text == '😿💔' or text == '😭😭😭' or text == '😭😭😭😭' then
dev yousef = "مآآعٍآشُ آلُِي يزعٍلُِڪڪ 𖠙 😏♥️"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == '🌚💔' or text == '💔🌚' or text == '🚶♂💔' or text == '💔' or text == '😔💔' or text == '🚶♀💔' or text == '😭' then
dev yousef = "سلامة قلبك 𖠙 😿💔"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'باي' or text == 'بااي' or text == 'اروح' or text == 'اروح احسن' or text == 'اولي احسن' or text == 'راح اروح' or text == 'باي انام' then
dev yousef = "أُرٌجُعُ عٍيدِهآآ مٍوو تنِْسةه 𖠙 🤤♥️"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'هلو' or text == 'هلاو' or text == 'هلا' or text == 'هلاوو' or text == 'هيلاو' or text == 'هيلاوو' or text == 'هلاا' then
local dev yousef = {"اࠗط็لق֯ق֯ هٞللاࠗ୨و 𖠙 🤤♥️" ,"هۂَلاا نۨہٰورتت ياعمۘري 𖠙 🤤♥️" }
DevAbs2 = math.random(#dev yousef)
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef[DevAbs2] , 1, 'md')
return false
end
if text == 'شونك' or text == 'شونج' or text == 'شلونك' or text == 'شلونج' or text == 'شونكم' or text == 'شلونكم' or text == 'شلخبار' or text == 'شلون الاخبار' or text == 'شخبارك' then
local dev yousef = {"ماﺷ͠ يةھَہّ يﻋ̝̚مريي ۅاﻧﺗ̲ت 𖠙 🤤♥️" ,"الحۡمۘدللهۂَ ٰوانۨہتت 𖠙 🤤♥️","تمۘامۘ عمۘري ٰوانۨہتت 𖠙 🤤♥️"}
DevAbs2 = math.random(#dev yousef)
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef[DevAbs2] , 1, 'md')
return false
end
if text == 'وينك' or text == 'وينج' then
dev yousef = "مْوٌجہوٌدِ يہمْگُ يحلوُ 𖠙 😉♥️"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'بوت عواي' or text == 'بوت زربه' or text == 'البوت عاوي'or text == 'البوت' or text == 'البوت زربه' then
dev yousef = "لا تقول البوت لا أطردك ؟ ، 😕🔪"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'نايمين' or text == 'ميتين' then
dev yousef = "طُآمسين ووعٍيوونڪ 𖠙 😪🖤ۦ"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'هلوباي' or text == 'هلو باي' then
dev yousef = "شحۡسۜيت مۘنۨہ هيجۚ ּكتبت ؟ 🌝♥️"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'اكلك' or text == 'اكلج' or text == 'اكلكم' then
dev yousef = "قـوولُِ مآقـوولُِ لُِآحٍدِ 𖠙 😉♥️"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'فرخ' then
dev yousef = "ٰوينۨہهۂَ خۡل احۡصرهۂَ 𖠙 😹♥️"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
if text == 'سورس عبس' or text == 'سورس راقي' or text == 'سورس ديف راقي' or text == 'سورس زربه' or text == 'السورس زربه' or text == 'سورس عاوي' or text == 'السورس عاوي' then
dev yousef = "لُِآ سوورس خآلُِتڪ دِي لُِڪ 𖠙 😒🔪"
Dev_Abs(msg.chat_id_, msg.id_, 1, dev yousef, 1, 'md')
return false
end
end
if Manager(msg) then
if text == 'تفعيل ردود البوت' or text == 'تفعيل الردود' then
if not DevAbs:get(muslim..'Abs:Lock:Reply'..msg.chat_id_) then
Dev_Abs(msg.chat_id_, msg.id_, 1, '⌁︙ردود البوت بالتاكيد مفعله ', 1, 'md')
else
Dev_Abs(msg.chat_id_, msg.id_, 1, '⌁︙تم تفعيل ردود البوت', 1, 'md')
DevAbs:del(muslim..'Abs:Lock:Reply'..msg.chat_id_)
end end
if text == 'تعطيل ردود البوت' or text == 'تعطيل الردود' then
if DevAbs:get(muslim..'Abs:Lock:Reply'..msg.chat_id_) then
Dev_Abs(msg.chat_id_, msg.id_, 1, '⌁︙ردود البوت بالتاكيد معطله ', 1, 'md')
else
DevAbs:set(muslim..'Abs:Lock:Reply'..msg.chat_id_,true)
Dev_Abs(msg.chat_id_, msg.id_, 1, '⌁︙تم تعطيل ردود البوت', 1, 'md')
end end
end
end
end
return {
muslim = Reply
}
|
RMenu.Add('Super', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Super', 'Principal'):DisplayGlare(false);
RMenu:Get('Super', 'Principal').Closable = false;
RMenu.Add('Sportive', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Sportive', 'Principal'):DisplayGlare(false);
RMenu:Get('Sportive', 'Principal').Closable = false;
RMenu.Add('Muscle', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Muscle', 'Principal'):DisplayGlare(false);
RMenu:Get('Muscle', 'Principal').Closable = false;
RMenu.Add('OffRoad', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('OffRoad', 'Principal'):DisplayGlare(false);
RMenu:Get('OffRoad', 'Principal').Closable = false;
RMenu.Add('Suv', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Suv', 'Principal'):DisplayGlare(false);
RMenu:Get('Suv', 'Principal').Closable = false;
RMenu.Add('Compact', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Compact', 'Principal'):DisplayGlare(false);
RMenu:Get('Compact', 'Principal').Closable = false;
RMenu.Add('Moto', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Moto', 'Principal'):DisplayGlare(false);
RMenu:Get('Moto', 'Principal').Closable = false;
RMenu.Add('Velo', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Velo', 'Principal'):DisplayGlare(false);
RMenu:Get('Velo', 'Principal').Closable = false;
RMenu.Add('Garage', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Garage', 'Principal'):DisplayGlare(false);
RMenu:Get('Garage', 'Principal').Closable = false;
RMenu.Add('Fourriere', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Fourriere', 'Principal'):DisplayGlare(false);
RMenu:Get('Fourriere', 'Principal').Closable = false;
RMenu.Add('Rental', 'Principal', RageUI.CreateMenu("", Storage.MenuDesc, nil, nil, "root_cause", "Banner"), true)
RMenu:Get('Rental', 'Principal'):DisplayGlare(false);
RMenu:Get('Rental', 'Principal').Closable = false;
function ShowMenu(Type)
if Type ~= "Garage" and Type ~= "Fourriere" then
RageUI.Visible(RMenu:Get(Type, 'Principal'), not RageUI.Visible(RMenu:Get(Type, 'Principal')))
else
ESX.TriggerServerCallback('GetPlyVehicles', function(PlyCars)
Storage.PlayerCars = PlyCars
RageUI.Visible(RMenu:Get(Type, 'Principal'), not RageUI.Visible(RMenu:Get(Type, 'Principal')))
end)
end
FreezeEntityPosition(PlayerPedId(), true)
Storage.InMenu = true
while Storage.InMenu do
Citizen.Wait(0)
RageUI.IsVisible(RMenu:Get('Rental', 'Principal'), function()
for _,v in pairs (Storage.RentalCars) do
RageUI.Item.Button(v.Label, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
Choose = {Token = json.encode(TokenGen), Vhc = v}
TriggerServerEvent('RentCar', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Fourriere', 'Principal'), function()
for _,v in pairs (Storage.PlayerCars) do
if not v.Stored then
RageUI.Item.Button(v.Label.." "..v.Plate, nil, {RightLabel = "→→→"}, true, {
onSelected = function()
Choose = {Token = json.encode(TokenGen), Vhc = v}
TriggerServerEvent('OutFourriere', json.encode(Choose))
end,
})
end
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
Position.Timing = 2000
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Garage', 'Principal'), function()
for _,v in pairs (Storage.PlayerCars) do
if v.Stored then
RageUI.Item.Button(v.Label.." "..v.Plate, nil, {RightLabel = "→→→"}, true, {
onSelected = function()
SpawnCoords = vector3(Storage.CarOut.x, Storage.CarOut.y, Storage.CarOut.z)
ESX.Game.SpawnVehicle(v.Hash, SpawnCoords, Storage.CarOut.h, function(Vehicle)
ESX.Game.SetVehicleProperties(Vehicle, v.Props)
SetVehRadioStation(Vehicle, "OFF")
SetVehicleEngineOn(Vehicle, true, true)
SetEntityHealth(Vehicle, tonumber(v.Health))
SetVehicleNumberPlateText(Vehicle, v.Plate)
local carplate = GetVehicleNumberPlateText(Vehicle)
TaskWarpPedIntoVehicle(PlayerPedId(), Vehicle, -1)
SetEntityAsMissionEntity(Vehicle, true, true)
Choose = {Token = json.encode(TokenGen), Id = v.Id}
TriggerServerEvent('OutVehicle', json.encode(Choose))
end)
Position.Timing = 2000
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
Position.Timing = 2000
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Super', 'Principal'), function()
RageUI.Item.Separator("↓↓ SuperCar ↓↓")
for _,v in pairs (Storage.CarChoosen.Super) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Super", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Separator("↓↓ CarClassique ↓↓")
for _,v in pairs (Storage.CarChoosen.Classique) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Classique", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Sportive', 'Principal'), function()
RageUI.Item.Separator("↓↓ Sportives ↓↓")
for _,v in pairs (Storage.CarChoosen.Sport) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Sport", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Separator("↓↓ Sedans ↓↓")
for _,v in pairs (Storage.CarChoosen.Sedans) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Sedans", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Muscle', 'Principal'), function()
RageUI.Item.Separator("↓↓ Muscle ↓↓")
for _,v in pairs (Storage.CarChoosen.Muscle) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Muscle", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Separator("↓↓ Vans ↓↓")
for _,v in pairs (Storage.CarChoosen.Vans) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Vans", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('OffRoad', 'Principal'), function()
RageUI.Item.Separator("↓↓ OffRoad ↓↓")
for _,v in pairs (Storage.CarChoosen.OffRoad) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "OffRoad", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Suv', 'Principal'), function()
RageUI.Item.Separator("↓↓ Suv ↓↓")
for _,v in pairs (Storage.CarChoosen.Suv) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Suv", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Compact', 'Principal'), function()
RageUI.Item.Separator("↓↓ Compacts ↓↓")
for _,v in pairs (Storage.CarChoosen.Compacts) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Compacts", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Moto', 'Principal'), function()
RageUI.Item.Separator("↓↓ Moto ↓↓")
for _,v in pairs (Storage.CarChoosen.Moto) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth, Table = "Moto", TableNbr = tonumber(_)}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
RageUI.IsVisible(RMenu:Get('Velo', 'Principal'), function()
RageUI.Item.Separator("↓↓ Vélo ↓↓")
for _,v in pairs (VehicleList.Velo) do
RageUI.Item.Button(v.Name, nil, {RightLabel = "~g~"..v.Price.." $"}, true, {
onActive = function()
SpawnCar(v.Value)
end,
onSelected = function()
CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false)
VhcProps = ESX.Game.GetVehicleProperties(CrtVhc)
VhcPlate = GetVehicleNumberPlateText(CrtVhc)
VhcHealth = GetEntityHealth(CrtVhc)
Choose = {Token = json.encode(TokenGen), Label = v.Name, Hash = v.Value, Price = v.Price, Plate = VhcPlate, Props = VhcProps, Health = VhcHealth}
TriggerServerEvent('BuyVehicle', json.encode(Choose))
end,
})
end
RageUI.Item.Button("Retour", nil, {}, true, {
onSelected = function()
for _,v in pairs (Storage.LastVhc) do
DeleteEntity(v)
end
Position.Timing = 2000
SetEntityCoords(PlayerPedId(), Storage.ShopsOut.x, Storage.ShopsOut.y, Storage.ShopsOut.z)
SetEntityHeading(PlayerPedId(), Storage.ShopsOut.h)
SetEntityVisible(PlayerPedId(), true)
FreezeEntityPosition(PlayerPedId(), false)
RageUI.CloseAll()
Citizen.Wait(Position.Timing)
Storage.InMenu = false
end,
})
end)
end
end
|
local seenDaEnd = false
function onCreate()
addLuaScript('dialogue')
end
function onNextDialogue(count)
-- triggered when the next dialogue line starts, 'line' starts with 1
speak(count+1)
end
function onSkipDialogue(count)
stopSound('sound')
stopSound('sound1')
stopSound('sound2')
stopSound('sound3')
stopSound('sound4')
end
function speak(shit)
stopSound('sound')
stopSound('sound1')
stopSound('sound2')
stopSound('sound3')
stopSound('sound4')
playSound('tankman/' ..shit,1,'sound')
playSound('tankman/' .. shit,1,'sound1')
playSound('tankman/' .. shit,1,'sound2')
playSound('tankman/' .. shit,1,'sound4')
playSound('tankman/' .. shit,1,'sound3')--just to make this shit loud i don't feel like audio editing
end
function onEvent(n,v1,v2)
if n == 'startDia' then
speak(1)
end
end
function onEndSong()
if isStoryMode and not seenDaEnd then
makeLuaSprite('bg','',0,0)
makeGraphic('bg',1280,720,'000000')
addLuaSprite('bg',true)
setObjectCamera('bg','camHUD')
setProperty('camGame.visible',false)
setProperty('camHUD.visible',false)
seenDaEnd = true
else
return Function_Continue;
end
end
|
local command = require("command")
local variables = require("variables_base")
-- This is used later as the default terminal and editor to run.
variables.terminal = command.get_available_command({
{command="kitty"},
{command="gnome-terminal"},
{command="x-terminal-emulator"},
{command="terminator"},
{command="konsole"},
{command="xterm"},
})
variables.browser = command.get_available_command({
{command="firefox"},
{command="firefox-bin"},
{command="chromium"},
{command="google-chrome"},
})
variables.clipboard_manager = command.get_available_command({
{command="clipit"},
{command="klipper"},
{command="qlipper", test="which qlipper"},
})
variables.screenshot_tool = command.get_available_command({
{command="gnome-screenshot", args="--interactive"},
{command="spectacle"},
})
variables.password_manager = command.get_available_command({
{command="keepassxc"},
{command="keepass2", test="which keepass2"},
{command="keepass", test="which keepass"},
})
variables.bluetooth_manager = command.get_available_command({
{command="blueman-applet"},
})
variables.sound_player = command.get_available_command({
{command="mplayer", args="--really-quiet", test="mplayer"},
})
variables.nvidia_settings = command.get_available_command({
{command="nvidia-settings"},
})
variables.editor_cmd = variables.terminal .. " -e " .. variables.editor
variables.is_minimal = os.getenv('AWESOME_MINIMAL')
return variables
|
return {
source = {
location = 'git@bitbucket.org:bazurbat/sigma-utils.git',
name = 'sigma-utils',
},
build = { type = 'cmake' }
}
|
-- Copyright 2017 The Minimal Configuration Manager Authors
--
-- 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
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
quoteTests = {
{input="", output="''"},
{input="abc", output="abc"},
{input="abc def", output="'abc def'"},
{input="abc/def", output="abc/def"},
{input="abc.def", output="abc.def"},
{input="\"abc\"", output="'\"abc\"'"},
{input="'abc'", output="''\\''abc'\\'''"},
{input="abc\\", output="'abc\\'"},
}
local shlib = require("shlib")
local os = require("os")
local string = require("string")
local ok = true
for _, t in ipairs(quoteTests) do
local out = shlib.quote(t.input)
if out ~= t.output then
print(string.format("shlib.quote(%q) = %q; want %q", t.input, out, t.output))
ok = false
end
end
if not ok then
os.exit(false)
end
|
Citizen.CreateThread(function()
Citizen.Wait(1)
exports["Library"]:AddHook(GetCurrentResourceName(), function(library)
RPX = library
if RPX.IsLoaded then
PlayerLoaded()
end
end)
end)
RegisterNetEvent("rpx:playerLoaded")
AddEventHandler("rpx:playerLoaded", function()
PlayerLoaded()
end)
local Office = {
[1] = {["x"] = -139.53143310547, ["y"] = -631.86102294922, ["z"] = 168.82040405273, ["heading"] = 191.21754455566}
}
function PlayerLoaded()
RPX.Markers.Add("corporations_create", Office[1], "Tryck ~INPUT_CONTEXT~ för att starta ett företag", function()
CreateCorporation()
end)
end
function CreateCorporation()
end
|
meshes={{vertexes={{1.4284,0.4798,0.1744},{1.4284,0.4798,-0.1744},{1.2699,0.8147,-0.1744},{1.2699,0.8147,0.1744},{1.1961,0.3777,-0.1744},{1.1961,0.3777,0.1744},{1.0698,0.6581,0.1744},{1.0698,0.6581,-0.1744},{1.8749,0.6986,0.1744},{1.8749,0.6986,-0.1744},{1.6752,0.9202,-0.1744},{1.6752,0.9202,0.1744},{1.1298,0.5361,0.1744},{1.1298,0.5361,-0.1744},{1.8085,0.7695,-0.1744},{1.8085,0.7695,0.1744},{1.2811,0.8995,-0.1744},{1.2811,0.8995,0.1744},{1.6653,1.0689,-0.1744},{1.6653,1.0689,0.1744},{1.3485,1.0744,-0.1744},{1.3485,1.0744,0.1744},{1.5452,1.1541,-0.1744},{1.5452,1.1541,0.1744},{1.5901,0.437,0.1744},{1.5901,0.437,-0.1744},{1.8795,0.5296,0.1744},{1.8795,0.5296,-0.1744},{1.0966,0.6154,0.1744},{1.7084,0.8203,0.1744},{1.0966,0.6154,-0.1744},{1.7084,0.8203,-0.1744},{1.4383,1.1443,0.1744},{1.4383,1.1443,-0.1744},{1.7734,0.433,-0.1744},{1.7734,0.433,0.1744},{-1.4284,0.4798,0.1744},{-1.4284,0.4798,-0.1744},{-1.2699,0.8147,-0.1744},{-1.2699,0.8147,0.1744},{-1.1961,0.3777,-0.1744},{-1.1961,0.3777,0.1744},{-1.0698,0.6581,0.1744},{-1.0698,0.6581,-0.1744},{-1.8749,0.6986,0.1744},{-1.8749,0.6986,-0.1744},{-1.6752,0.9202,-0.1744},{-1.6752,0.9202,0.1744},{-1.1298,0.5361,0.1744},{-1.1298,0.5361,-0.1744},{-1.8085,0.7695,-0.1744},{-1.8085,0.7695,0.1744},{-1.2811,0.8995,-0.1744},{-1.2811,0.8995,0.1744},{-1.6653,1.0689,-0.1744},{-1.6653,1.0689,0.1744},{-1.3485,1.0744,-0.1744},{-1.3485,1.0744,0.1744},{-1.5452,1.1541,-0.1744},{-1.5452,1.1541,0.1744},{-1.5901,0.437,0.1744},{-1.5901,0.437,-0.1744},{-1.8795,0.5296,0.1744},{-1.8795,0.5296,-0.1744},{-1.0966,0.6154,0.1744},{-1.7084,0.8203,0.1744},{-1.0966,0.6154,-0.1744},{-1.7084,0.8203,-0.1744},{-1.4383,1.1443,0.1744},{-1.4383,1.1443,-0.1744},{-1.7734,0.433,-0.1744},{-1.7734,0.433,0.1744},{1.4284,-0.4798,0.1744},{1.4284,-0.4798,-0.1744},{1.2699,-0.8147,-0.1744},{1.2699,-0.8147,0.1744},{1.1961,-0.3777,-0.1744},{1.1961,-0.3777,0.1744},{1.0698,-0.6581,0.1744},{1.0698,-0.6581,-0.1744},{1.8749,-0.6986,0.1744},{1.8749,-0.6986,-0.1744},{1.6752,-0.9202,-0.1744},{1.6752,-0.9202,0.1744},{1.1298,-0.5361,0.1744},{1.1298,-0.5361,-0.1744},{1.8085,-0.7695,-0.1744},{1.8085,-0.7695,0.1744},{1.2811,-0.8995,-0.1744},{1.2811,-0.8995,0.1744},{1.6653,-1.0689,-0.1744},{1.6653,-1.0689,0.1744},{1.3485,-1.0744,-0.1744},{1.3485,-1.0744,0.1744},{1.5452,-1.1541,-0.1744},{1.5452,-1.1541,0.1744},{1.5901,-0.437,0.1744},{1.5901,-0.437,-0.1744},{1.8795,-0.5296,0.1744},{1.8795,-0.5296,-0.1744},{1.0966,-0.6154,0.1744},{1.7084,-0.8203,0.1744},{1.0966,-0.6154,-0.1744},{1.7084,-0.8203,-0.1744},{1.4383,-1.1443,0.1744},{1.4383,-1.1443,-0.1744},{1.7734,-0.433,-0.1744},{1.7734,-0.433,0.1744},{-1.4284,-0.4798,0.1744},{-1.4284,-0.4798,-0.1744},{-1.2699,-0.8147,-0.1744},{-1.2699,-0.8147,0.1744},{-1.1961,-0.3777,-0.1744},{-1.1961,-0.3777,0.1744},{-1.0698,-0.6581,0.1744},{-1.0698,-0.6581,-0.1744},{-1.8749,-0.6986,0.1744},{-1.8749,-0.6986,-0.1744},{-1.6752,-0.9202,-0.1744},{-1.6752,-0.9202,0.1744},{-1.1298,-0.5361,0.1744},{-1.1298,-0.5361,-0.1744},{-1.8085,-0.7695,-0.1744},{-1.8085,-0.7695,0.1744},{-1.2811,-0.8995,-0.1744},{-1.2811,-0.8995,0.1744},{-1.6653,-1.0689,-0.1744},{-1.6653,-1.0689,0.1744},{-1.3485,-1.0744,-0.1744},{-1.3485,-1.0744,0.1744},{-1.5452,-1.1541,-0.1744},{-1.5452,-1.1541,0.1744},{-1.5901,-0.437,0.1744},{-1.5901,-0.437,-0.1744},{-1.8795,-0.5296,0.1744},{-1.8795,-0.5296,-0.1744},{-1.0966,-0.6154,0.1744},{-1.7084,-0.8203,0.1744},{-1.0966,-0.6154,-0.1744},{-1.7084,-0.8203,-0.1744},{-1.4383,-1.1443,0.1744},{-1.4383,-1.1443,-0.1744},{-1.7734,-0.433,-0.1744},{-1.7734,-0.433,0.1744}},segments={{1,0},{2,3},{1,4},{0,5},{3,6},{2,7},{28,6},{4,5},{13,4},{14,9},{9,8},{29,11},{10,11},{5,12},{30,13},{31,14},{8,15},{14,15},{16,17},{18,19},{3,17},{16,2},{10,18},{19,11},{20,21},{22,23},{32,23},{33,20},{19,23},{21,17},{20,16},{22,18},{25,24},{27,26},{34,27},{35,24},{1,25},{24,0},{8,26},{27,9},{12,28},{15,29},{7,30},{10,31},{31,29},{21,32},{22,33},{25,34},{26,35},{34,35},{32,33},{37,36},{38,39},{37,40},{36,41},{39,42},{38,43},{64,42},{40,41},{49,40},{50,45},{45,44},{65,47},{46,47},{41,48},{66,49},{67,50},{44,51},{50,51},{52,53},{54,55},{39,53},{52,38},{46,54},{55,47},{56,57},{58,59},{68,59},{69,56},{55,59},{57,53},{56,52},{58,54},{61,60},{63,62},{70,63},{71,60},{37,61},{60,36},{44,62},{63,45},{48,64},{51,65},{43,66},{46,67},{67,65},{57,68},{58,69},{61,70},{62,71},{70,71},{68,69},{73,72},{74,75},{73,76},{72,77},{75,78},{74,79},{100,78},{76,77},{85,76},{86,81},{81,80},{101,83},{82,83},{77,84},{102,85},{103,86},{80,87},{86,87},{88,89},{90,91},{75,89},{88,74},{82,90},{91,83},{92,93},{94,95},{104,95},{105,92},{91,95},{93,89},{92,88},{94,90},{97,96},{99,98},{106,99},{107,96},{73,97},{96,72},{80,98},{99,81},{84,100},{87,101},{79,102},{82,103},{103,101},{93,104},{94,105},{97,106},{98,107},{106,107},{104,105},{109,108},{110,111},{109,112},{108,113},{111,114},{110,115},{136,114},{112,113},{121,112},{122,117},{117,116},{137,119},{118,119},{113,120},{138,121},{139,122},{116,123},{122,123},{124,125},{126,127},{111,125},{124,110},{118,126},{127,119},{128,129},{130,131},{140,131},{141,128},{127,131},{129,125},{128,124},{130,126},{133,132},{135,134},{142,135},{143,132},{109,133},{132,108},{116,134},{135,117},{120,136},{123,137},{115,138},{118,139},{139,137},{129,140},{130,141},{133,142},{134,143},{142,143},{140,141}}}}
|
-- condenser.lua
data:extend(
{
-----------------
-- CONDENSER 1 --
-----------------
{
type = "assembling-machine",
name = "liquid-air-condenser",
icons = { {icon = "__base__/graphics/icons/oil-refinery.png", tint = {r=0.7, g=0.7, b=1, a=1}} },
icon_size = 64, icon_mipmaps = 4,
flags = {"placeable-neutral","placeable-player", "player-creation"},
minable = {mining_time = 1, result = "liquid-air-condenser"},
max_health = 500,
corpse = "oil-refinery-remnants",
dying_explosion = "oil-refinery-explosion",
resistances =
{
{type = "physical", percent = 50},
{type = "fire", percent = 50},
{type = "impact", percent = 50}
},
fluid_boxes =
{
{
production_type = "output",
pipe_covers = pipecoverspictures(),
base_level = 1,
pipe_connections = {{ position = {0, -3} }}
},
},
animation = make_4way_animation_from_spritesheet(
{
layers =
{
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery.png",
tint = {r=0.7, g=0.7, b=1, a=1},
width = 337,
height = 255,
frame_count = 1,
shift = {2.515625, 0.484375},
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery.png",
tint = {r=0.7, g=0.7, b=1, a=1},
width = 386,
height = 430,
frame_count = 1,
shift = util.by_pixel(0, -7.5),
scale = 0.5
}
},
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-shadow.png",
width = 337,
height = 213,
frame_count = 1,
shift = util.by_pixel(82.5, 26.5),
draw_as_shadow = true,
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery-shadow.png",
width = 674,
height = 426,
frame_count = 1,
shift = util.by_pixel(82.5, 26.5),
draw_as_shadow = true,
force_hr_shadow = true,
scale = 0.5
}
}
}
}),
working_visualisations =
{
{
north_position = util.by_pixel(34, -65),
east_position = util.by_pixel(-52, -61),
south_position = util.by_pixel(-59, -82),
west_position = util.by_pixel(57, -58),
animation =
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-fire.png",
tint = {r=0.7, g=0.7, b=1, a=1},
line_length = 10,
width = 20,
height = 40,
frame_count = 60,
animation_speed = 0.75,
shift = util.by_pixel(0, -14),
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery-fire.png",
tint = {r=0.7, g=0.7, b=1, a=1},
line_length = 10,
width = 40,
height = 81,
frame_count = 60,
animation_speed = 0.75,
scale = 0.5,
shift = util.by_pixel(0, -14.25)
}
},
light = {intensity = 0.4, size = 6, color = {r = 1.0, g = 1.0, b = 1.0}}
}
},
collision_box = {{-2.3, -2.3}, {2.3, 2.3}},
selection_box = {{-2.5, -2.5}, {2.5, 2.5}},
-- damaged_trigger_effect = hit_effects.entity(),
-- fast_replaceable_group = "assembling-machine",
fast_replaceable_group = "liquid-air-condenser",
next_upgrade = "liquid-air-condenser-2",
crafting_categories = {"air-liquifier"},
scale_entity_info_icon = true,
-- vehicle_impact_sound = sounds.generic_impact,
crafting_speed = 1.0,
-- energy produced is fuel value * amount = 100kJ * 25 = 2.5MW
-- 50% efficiency is 2.5 / .5 = 5MW
energy_usage = "5MW",
energy_source = {
type = "electric",
usage_priority = "tertiary",
render_no_power_icon = true,
},
water_reflection =
{
pictures =
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-reflection.png",
priority = "extra-high",
width = 40,
height = 48,
shift = util.by_pixel(5, 95),
variation_count = 4,
scale = 5,
},
rotate = false,
orientation_to_variation = true
},
ingredient_count = 1,
-- module_specification = { module_slots = 2, module_info_icon_shift = {0, 1.2}, module_info_icon_scale = 1 },
-- allowed_effects = {"speed"},
},
{
type = "item",
name = "liquid-air-condenser",
icons = { {icon = "__base__/graphics/icons/oil-refinery.png", tint = {r=0.7, g=0.7, b=1, a=1} }},
icon_size = 64, icon_mipmaps = 4,
subgroup = "energy",
-- order = "d[refinery]",
order = "e[accumulator]-b[accumulator]",
place_result = "liquid-air-condenser",
stack_size = 10
},
{
type = "recipe",
name = "liquid-air-condenser",
-- energy_required = 8,
energy_required = 2,
ingredients = {{"pipe", "40"}, {"stone-brick", 40}, {"steel-plate", 20}, {"electronic-circuit", 20}, },
result = "liquid-air-condenser",
enabled = false,
},
-----------------
-- CONDENSER 2 --
-----------------
{
type = "assembling-machine",
name = "liquid-air-condenser-2",
icons = { {icon = "__base__/graphics/icons/oil-refinery.png", tint = {r=0.9, g=0.7, b=0.7, a=1}} },
icon_size = 64, icon_mipmaps = 4,
flags = {"placeable-neutral","placeable-player", "player-creation"},
minable = {mining_time = 1, result = "liquid-air-condenser-2"},
max_health = 500,
corpse = "oil-refinery-remnants",
dying_explosion = "oil-refinery-explosion",
resistances =
{
{type = "physical", percent = 50},
{type = "fire", percent = 50},
{type = "impact", percent = 50}
},
fluid_boxes =
{
{
production_type = "output",
pipe_covers = pipecoverspictures(),
base_level = 1,
pipe_connections = {{ position = {0, -3} }}
},
},
animation = make_4way_animation_from_spritesheet(
{
layers =
{
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery.png",
tint = {r=0.9, g=0.7, b=0.7, a=1},
width = 337,
height = 255,
frame_count = 1,
shift = {2.515625, 0.484375},
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery.png",
tint = {r=0.9, g=0.7, b=0.7, a=1},
width = 386,
height = 430,
frame_count = 1,
shift = util.by_pixel(0, -7.5),
scale = 0.5
}
},
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-shadow.png",
width = 337,
height = 213,
frame_count = 1,
shift = util.by_pixel(82.5, 26.5),
draw_as_shadow = true,
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery-shadow.png",
width = 674,
height = 426,
frame_count = 1,
shift = util.by_pixel(82.5, 26.5),
draw_as_shadow = true,
force_hr_shadow = true,
scale = 0.5
}
}
}
}),
working_visualisations =
{
{
north_position = util.by_pixel(34, -65),
east_position = util.by_pixel(-52, -61),
south_position = util.by_pixel(-59, -82),
west_position = util.by_pixel(57, -58),
animation =
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-fire.png",
tint = {r=0.9, g=0.7, b=0.7, a=1},
line_length = 10,
width = 20,
height = 40,
frame_count = 60,
animation_speed = 0.75,
shift = util.by_pixel(0, -14),
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery-fire.png",
tint = {r=0.9, g=0.7, b=0.7, a=1},
line_length = 10,
width = 40,
height = 81,
frame_count = 60,
animation_speed = 0.75,
scale = 0.5,
shift = util.by_pixel(0, -14.25)
}
},
light = {intensity = 0.4, size = 6, color = {r = 1.0, g = 1.0, b = 1.0}}
}
},
collision_box = {{-2.3, -2.3}, {2.3, 2.3}},
selection_box = {{-2.5, -2.5}, {2.5, 2.5}},
-- damaged_trigger_effect = hit_effects.entity(),
fast_replaceable_group = "liquid-air-condenser",
next_upgrade = "liquid-air-condenser-3",
crafting_categories = {"air-liquifier"},
scale_entity_info_icon = true,
-- vehicle_impact_sound = sounds.generic_impact,
crafting_speed = 1.0,
-- energy produced is fuel value * amount = 100kJ * 25 = 2.5MW
-- 70% efficiency is 2.5 / .7 = 3.57MW rounded to 3.5MW
energy_usage = "3.5MW",
energy_source = {
type = "electric",
usage_priority = "tertiary",
render_no_power_icon = true,
},
water_reflection =
{
pictures =
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-reflection.png",
priority = "extra-high",
width = 40,
height = 48,
shift = util.by_pixel(5, 95),
variation_count = 4,
scale = 5,
},
rotate = false,
orientation_to_variation = true
},
ingredient_count = 1,
-- module_specification = { module_slots = 2, module_info_icon_shift = {0, 1.2}, module_info_icon_scale = 1 },
-- allowed_effects = {"speed"},
},
{
type = "item",
name = "liquid-air-condenser-2",
icons = { {icon = "__base__/graphics/icons/oil-refinery.png", tint = {r=0.9, g=0.7, b=0.7, a=1} }},
icon_size = 64, icon_mipmaps = 4,
subgroup = "energy",
-- order = "d[refinery]",
order = "e[accumulator]-b[accumulator]",
place_result = "liquid-air-condenser-2",
stack_size = 10
},
{
type = "recipe",
name = "liquid-air-condenser-2",
-- energy_required = 8,
energy_required = 4,
ingredients = {{"liquid-air-condenser", "1"}, {"advanced-circuit", 50}, {"concrete", 50}, {"steel-plate", 50}, },
result = "liquid-air-condenser-2",
enabled = false,
},
-----------------
-- CONDENSER 3 --
-----------------
{
type = "assembling-machine",
name = "liquid-air-condenser-3",
icons = { {icon = "__base__/graphics/icons/oil-refinery.png", tint = {r=0.6, g=0.9, b=1, a=1}} },
icon_size = 64, icon_mipmaps = 4,
flags = {"placeable-neutral","placeable-player", "player-creation"},
minable = {mining_time = 1, result = "liquid-air-condenser-3"},
max_health = 500,
corpse = "oil-refinery-remnants",
dying_explosion = "oil-refinery-explosion",
resistances =
{
{type = "physical", percent = 50},
{type = "fire", percent = 50},
{type = "impact", percent = 50}
},
fluid_boxes =
{
{
production_type = "output",
pipe_covers = pipecoverspictures(),
base_level = 1,
pipe_connections = {{ position = {0, -3} }}
},
},
animation = make_4way_animation_from_spritesheet(
{
layers =
{
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery.png",
tint = {r=0.6, g=0.9, b=1, a=1},
width = 337,
height = 255,
frame_count = 1,
shift = {2.515625, 0.484375},
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery.png",
tint = {r=0.6, g=0.9, b=1, a=1},
width = 386,
height = 430,
frame_count = 1,
shift = util.by_pixel(0, -7.5),
scale = 0.5
}
},
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-shadow.png",
width = 337,
height = 213,
frame_count = 1,
shift = util.by_pixel(82.5, 26.5),
draw_as_shadow = true,
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery-shadow.png",
width = 674,
height = 426,
frame_count = 1,
shift = util.by_pixel(82.5, 26.5),
draw_as_shadow = true,
force_hr_shadow = true,
scale = 0.5
}
}
}
}),
working_visualisations =
{
{
north_position = util.by_pixel(34, -65),
east_position = util.by_pixel(-52, -61),
south_position = util.by_pixel(-59, -82),
west_position = util.by_pixel(57, -58),
animation =
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-fire.png",
tint = {r=0.6, g=0.9, b=1, a=1},
line_length = 10,
width = 20,
height = 40,
frame_count = 60,
animation_speed = 0.75,
shift = util.by_pixel(0, -14),
hr_version =
{
filename = "__base__/graphics/entity/oil-refinery/hr-oil-refinery-fire.png",
tint = {r=0.6, g=0.9, b=1, a=1},
line_length = 10,
width = 40,
height = 81,
frame_count = 60,
animation_speed = 0.75,
scale = 0.5,
shift = util.by_pixel(0, -14.25)
}
},
light = {intensity = 0.4, size = 6, color = {r = 1.0, g = 1.0, b = 1.0}}
}
},
collision_box = {{-2.3, -2.3}, {2.3, 2.3}},
selection_box = {{-2.5, -2.5}, {2.5, 2.5}},
-- damaged_trigger_effect = hit_effects.entity(),
fast_replaceable_group = "liquid-air-condenser",
-- next_upgrade = "liquid-air-condenser-2",
crafting_categories = {"air-liquifier"},
scale_entity_info_icon = true,
-- vehicle_impact_sound = sounds.generic_impact,
crafting_speed = 1.0,
-- energy produced is fuel value * amount = 100kJ * 25 = 2.5MW
-- 85% efficiency is 2.5 / .85 = 2.94MW rounded to 3.5MW
energy_usage = "2.94MW",
energy_source = {
type = "electric",
usage_priority = "tertiary",
render_no_power_icon = true,
},
water_reflection =
{
pictures =
{
filename = "__base__/graphics/entity/oil-refinery/oil-refinery-reflection.png",
priority = "extra-high",
width = 40,
height = 48,
shift = util.by_pixel(5, 95),
variation_count = 4,
scale = 5,
},
rotate = false,
orientation_to_variation = true
},
ingredient_count = 1,
-- module_specification = { module_slots = 2, module_info_icon_shift = {0, 1.2}, module_info_icon_scale = 1 },
-- allowed_effects = {"speed"},
},
{
type = "item",
name = "liquid-air-condenser-3",
icons = { {icon = "__base__/graphics/icons/oil-refinery.png", tint = {r=0.6, g=0.9, b=1, a=1} }},
icon_size = 64, icon_mipmaps = 4,
subgroup = "energy",
-- order = "d[refinery]",
order = "e[accumulator]-b[accumulator]",
place_result = "liquid-air-condenser-3",
stack_size = 10
},
{
type = "recipe",
name = "liquid-air-condenser-3",
-- energy_required = 8,
energy_required = 4,
ingredients = {{"liquid-air-condenser-2", "1"}, {"processing-unit", 20}, {"low-density-structure", 20}, },
result = "liquid-air-condenser-3",
enabled = false,
},
})
|
if ( SERVER ) then
AddCSLuaFile( "shared.lua" )
end
if ( CLIENT ) then
SWEP.PrintName = "ELG-3A"
SWEP.Author = "Syntax_Error752"
SWEP.ViewModelFOV = 70
SWEP.Slot = 1
SWEP.SlotPos = 5
SWEP.WepSelectIcon = surface.GetTextureID("HUD/killicons/ELG3A")
killicon.Add( "weapon_752_elg3a", "HUD/killicons/ELG3A", Color( 255, 80, 0, 255 ) )
end
SWEP.HoldType = "pistol"
SWEP.Base = "tfa_swsft_base"
SWEP.Category = "TFA Star Wars"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/weapons/v_ELG3A.mdl"
SWEP.WorldModel = "models/weapons/w_ELG3A.mdl"
SWEP.Primary.Sound = Sound ("weapons/ELG3A_fire.wav");
SWEP.Primary.ReloadSound = Sound ("weapons/ELG3A_reload.wav");
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Recoil = 0.5
SWEP.Primary.PenetrationMultiplier = 0 --Change the amount of something this gun can penetrate through
SWEP.Primary.Damage = 50
SWEP.Primary.NumShots = 1
SWEP.Primary.Spread = 0.0125
SWEP.Primary.ClipSize = 25
SWEP.Primary.RPM = 60/0.2
SWEP.Primary.DefaultClip = 75
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "ar2"
SWEP.TracerName = "effect_sw_laser_green"
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.IronSightsPos = Vector (-3.6, -4, 2.5)
SWEP.IronSightsAng = Vector(0.8,0.1,0)
SWEP.DoProceduralReload = true
SWEP.ProceduralReloadTime = 2
|
--[[
Usage:
local loader = require "loader"
local body = loader(world, [filepath], body, x, y)
--]]
local obj = {}
obj.init = function()
local physics = {{% for body in bodies %}{% if not forloop.first %}, {% endif %}
["{{body.name}}"] = {
static = {{body.static}},
fixed = {{body.fixed_rotation}},
ld = {{body.linear_damping}},
ad = {{body.angular_damping}},
fixtures = {{% for fixture in body.fixtures %}{% if not forloop.first %}, {% endif %} {% if fixture.isCircle %}
{
sensor = {{fixture.sensor}},
density = {{fixture.density}},
friction = {{fixture.friction}},
restitution = {{fixture.restitution}},
type = "circle",
filter = {group = {{fixture.filter_group}}, category = {{fixture.filter_category}}, mask = {{fixture.filter_mask}}},
shape = {radius = {{fixture.radius}}, cx = {{fixture.center.x}}, cy = {{fixture.center.y}}}
}{% else %}{% for polygon in fixture.polygons %}{% if not forloop.first %}, {% endif %}
{
sensor = {{fixture.sensor}},
density = {{fixture.density}},
friction = {{fixture.friction}},
restitution = {{fixture.restitution}},
type = "polygon",
filter = {group = {{fixture.filter_group}}, category = {{fixture.filter_category}}, mask = {{fixture.filter_mask}}},
shape = {{% for point in polygon %}{% if not forloop.first %}, {% endif %}{{point.x}}, {{point.y}}{% endfor %}}
}{% endfor %}{% endif %}{% endfor %}
}
}{% endfor %}
}
return physics
end
return obj
|
smooth.nyu = {}
smooth.nyu.L1 = 3 -- cost window size
smooth.nyu.tau1 = 0.03 -- pixel intensity
-- smooth.nyu.cbca_i1 = 2
-- smooth.nyu.cbca_i2 = 4
smooth.nyu.sgm_i = 1 -- sgm iter??
smooth.nyu.pi1 = 15 -- sgm p1
smooth.nyu.pi2 = 50 -- sgm p2
smooth.nyu.tau_so = 0.08 -- pixel intensity threshold for changing pi1/pi2
smooth.nyu.alpha1 = 0.5 -- blur threshold
smooth.nyu.sgm_q1 = 0.2 -- factor 1 used for changing pi1/pi2
smooth.nyu.sgm_q2 = 0.1 -- factor 2 used for changing pi1/pi2
-- post
smooth.nyu.occlusion = 1
smooth.nyu.subpixel = 0
smooth.nyu.median = 1
smooth.nyu.bilateral = 1
smooth.nyu.blur_sigma = 3
smooth.nyu.blur_t = 3
function smooth.nyu.cross_agg( l_img, r_img, left_vol, right_vol, iter)
-- left_vol: 1 x disp_range x h x w
-- l_img: 1 x 3 x h x w
local img_h, img_w = left_vol:size(3), left_vol:size(4)
local disp_range = left_vol:size(2)
-- cross computation
local x0c, x1c
x0c = torch.CudaTensor(1, 4, img_h, img_w)
x1c = torch.CudaTensor(1, 4, img_h, img_w)
adcensus.cross(l_img, x0c, smooth.nyu.L1, smooth.nyu.tau1)
adcensus.cross(r_img, x1c, smooth.nyu.L1, smooth.nyu.tau1)
local tmp_cbca = torch.CudaTensor(1, disp_range, img_h, img_w)
for i = 1,iter do
adcensus.cbca(x0c, x1c, left_vol:cuda(), tmp_cbca, -1)
left_vol:copy(tmp_cbca)
adcensus.cbca(x0c, x1c, right_vol:cuda(), tmp_cbca, 1)
right_vol:copy(tmp_cbca)
end
tmp_cbca = nil
collectgarbage()
return left_vol, right_vol
end
function smooth.nyu.sgm( l_img, r_img, vol, direction)
-- direction: -1 for left, 1 for right
-- l_img: 3 x h x w
-- vol: 1 x disp x h x w
local img_h, img_w = l_img:size(2), l_img:size(3)
local vol = vol:permute(1,3,4,2):clone():cuda()
local max_disp = vol:size(4)
local out = torch.CudaTensor(1, img_h, img_w, max_disp)
local tmp = torch.CudaTensor(img_w, max_disp)
for _ = 1,smooth.nyu.sgm_i do
out:zero()
adcensus.sgm2(l_img, r_img, vol, out, tmp, smooth.nyu.pi1, smooth.nyu.pi2, smooth.nyu.tau_so,
smooth.nyu.alpha1, smooth.nyu.sgm_q1, smooth.nyu.sgm_q2, direction)
vol:copy(out):div(4)
end
vol:resize(1, max_disp, img_h, img_w)
vol:copy(out:permute(1,4,2,3)):div(4) -- vol: 1 x max_disp x h x w
-- local out = torch.CudaTensor(4, vol:size(2), vol:size(3), vol:size(4))
-- out:zero()
-- adcensus.sgm3(x_batch[1], x_batch[2], vol, out, smooth.nyu.pi1, smooth.nyu.pi2, smooth.nyu.tau_so,
-- smooth.nyu.alpha1, smooth.nyu.sgm_q1, smooth.nyu.sgm_q2, direction)
-- vol:mean(out, 1)
-- vol = vol:transpose(3, 4):transpose(2, 3):clone()
collectgarbage()
return vol
end
local function gaussian(sigma)
local kr = math.ceil(sigma * 3)
local ks = kr * 2 + 1
local k = torch.Tensor(ks, ks)
for i = 1, ks do
for j = 1, ks do
local y = (i - 1) - kr
local x = (j - 1) - kr
k[{i,j}] = math.exp(-(x * x + y * y) / (2 * sigma * sigma))
end
end
return k
end
function smooth.nyu.post( disp, left_vol)
-- disp[1]: left prediction, disp: 0 .. max-1
local max_disp = left_vol:size(2)
print("Max disparity: " .. max_disp)
local outlier = torch.CudaTensor():resizeAs(disp[1]):zero()
adcensus.outlier_detection(disp[1], disp[2], outlier, max_disp)
if smooth.nyu.occlusion == 1 then
disp[1] = adcensus.interpolate_occlusion(disp[1], outlier)
disp[1] = adcensus.interpolate_mismatch(disp[1], outlier)
end
if smooth.nyu.subpixel == 1 then
disp[1] = adcensus.subpixel_enchancement(disp[1], left_vol, max_disp)
end
if smooth.nyu.median == 1 then
disp[1] = adcensus.median2d(disp[1], 3)
end
if smooth.nyu.bilateral == 1 then
disp[1] = adcensus.mean2d(disp[1], gaussian(smooth.nyu.blur_sigma):cuda(), smooth.nyu.blur_t)
end
return disp[1], outlier
end
|
local rootmodulo = {1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 14, 17, 18, 19, 22, 23, 25, 26, 27, 29, 31, 34, 37, 38, 41, 43, 46, 47, 49, 50, 53, 54, 58, 59, 61, 62, 67, 71, 73, 74, 79, 81, 82, 83, 86, 89, 94, 97, 98, 101, 103, 106, 107, 109, 113, 118, 121, 122, 125, 127, 131, 134, 137, 139, 142, 146, 149}
return function()
return rootmodulo[math.random(#rootmodulo)]
end
|
return {'muesli','muezzin','muezzins'}
|
require 'p4'
p4 = P4.P4()
pcall(function()
p4:connect()
p4.exception_level = 2 -- File(s) up-to-date warning
files = p4:run_sync()
end)
for _, w in ipairs(p4.warnings) do
print(w)
end
p4:disconnect()
|
local ASL = LibStub("AceLocale-3.0"):NewLocale("AddOnSkins", "zhTW")
if not ASL then return end
ASL["About/Help"] = "相關資訊/協助"
ASL["AddOn Skins"] = "插件美化"
ASL["Attach CoolLine to action bar"] = "CoolLine 依附至快捷列"
ASL["Attach SexyCD to action bar"] = "SexyCD 依附至快捷列"
ASL["Auction House"] = "拍賣場"
ASL["Available Skins / Skin Requests"] = "可美化面板清單/提出美化需求"
ASL["BigWigs Half-Bar"] = "BigWigs 計時條美化"
ASL["Blizzard Skins"] = "Blizzard 面板美化"
ASL["Changelog Link"] = "更新記錄連結"
ASL["Credits"] = "特別感謝"
ASL["Credits:"] = "特別感謝:"
ASL["DBM Transparent Radar"] = "DBM Transparent Radar"
ASL["DBM Half-Bar Skin Spacing looks wrong. How can I fix it?"] = "DBM 美化計時條的間距看起來怪怪的.我要如何修正?"
ASL["DBM Font Flag"] = "DBM 字型描邊"
ASL["DBM Font Size"] = "DBM 字體大小"
ASL["DBM Font"] = "DBM 字型"
ASL["DBM Half-bar Skin"] = "DBM 計時條美化"
ASL["Details Backdrop"] = true
ASL["Download Link"] = "下載連結"
ASL["Embed Below Top Tab"] = "嵌入至上側分頁列下"
ASL["Embed for One Window"] = "Embed for Main Window"
ASL["Embed Frame Level"] = true
ASL["Embed Frame Strata"] = true
ASL["Embed into Right Chat Panel"] = "嵌入右側對話框"
ASL["Embed OoC Delay"] = "嵌入脫戰延遲時間"
ASL["Embed Settings"] = "插件內嵌設定"
ASL["Embed System Message"] = true
ASL["Embed Transparancy"] = "內嵌插件透明度"
ASL["Enable Skin Debugging"] = "啟用美化功能除錯系統"
ASL["FAQ's"] = "問與答"
ASL["GitLab Link / Report Errors"] = "GitLab 連結/回報錯誤"
ASL["Hide Chat Frame"] = "隱藏對話框"
ASL["Left Click to Show"] = "點選左鍵:顯示"
ASL["Left Click:"] = "點選左鍵:"
ASL["Links"] = "Links"
ASL["Login Message"] = true
ASL["|cffff7d0aMerathilisUI|r Styling"] = true
ASL["MONOCHROME"] = "單線"
ASL["MONOCHROMEOUTLINE"] = "單線邊"
ASL["None"] = "無"
ASL["Omen Backdrop"] = "Omen 背景"
ASL["One Window Embed System"] = "One Window Embed System"
ASL["Out of Combat (Hide)"] = "脫戰隱藏"
ASL["OUTLINE"] = "描邊"
ASL["Parchment"] = "羊皮紙"
ASL["Recount Backdrop"] = "Recount 背景"
ASL["Right Click to Hide"] = "點選右鍵:隱藏"
ASL["Right Click:"] = "點選右鍵:"
ASL["Settings to control Embedded AddOns:\n\nAvailable Embeds: Details | Omen | Skada | Recount | TinyDPS"] = "「嵌入插件」的控制選項:\n\n可用於嵌入:詳細內容 | Omen | Skada | Recount | TinyDPS"
ASL["Skada Backdrop"] = "Skada 背景"
ASL["Skin Template"] = "面板美化樣板"
ASL["THICKOUTLINE"] = "粗邊"
ASL["To use the DBM Half-Bar skin. You must change the DBM Options. Offset Y needs to be at least 15."] = "若使用 DBM 美化計時條.請務必將 DBM 選項中的 Y軸位移值 變更為 15 以上."
ASL["Two Window Embed System"] = "Two Window Embed System"
ASL["Version"] = "版本"
ASL["WeakAura AuraBar"] = "WeakAura 光環列"
ASL["WeakAura Cooldowns"] = "WeakAura 冷卻時間"
ASL["Window One Embed"] = "Window One Embed"
ASL["Window One Width"] = "Window One Width"
ASL["Window Two Embed"] = "Window Two Embed"
ASL['Enable/Disable this embed.'] = '啟用/停用此插件內嵌,'
ASL['Enable/Disable this option.'] = '啟用/停用此選項,'
ASL['Enable/Disable this skin.\nThis requires a reload to take effect.'] = '啟用/停用此美化面板.\n需重新啟動,變動方才生效。'
ASL['Reset Settings'] = "重置設定"
ASL['This option will toggle the corresponding ElvUI option.'] = true
ASL['Toggle Embedded AddOn'] = '顯示/隱藏內嵌插件'
ASL['Toggle Left Chat Panel'] = '顯示/隱藏左側對話框'
ASL['Toggle Options'] = '顯示/隱藏更多美化面板/選項'
ASL['Toggle Right Chat Panel'] = '顯示/隱藏右側對話框'
|
local redis = require("resty.redis")
local cjson = require("cjson")
local cjson_encode = cjson.encode
local ngx_log = ngx.log
local ngx_ERR = ngx.ERR
local ngx_exit = ngx.exit
local ngx_print = ngx.print
local ngx_re_match = ngx.re.match
local ngx_var = ngx.var
local function close_redis( red )
-- body
if not red then
return
end
--释放连接(连接池实现)
local pool_max_idle_time = 10000 --ms
local pool_size = 100 --
local ok,err = red:set_keepalive(pool_max_idle_time,pool_size)
if not ok then
ngx_log(ngx_ERR,"set redis keepalive error :",err)
end
end
local function read_redis( id )
-- body
local red = redis:new()
red:set_timeout(1000)
local ip = "127.0.0.1"
local port = 1111
local ok,err = red:connect(ip,port)
ngx_log(ngx_ERR,"ok get redis ok : ", ok)
if not ok then
ngx_log(ngx_ERR,"connect to redis error :" , err)
return close_redis(red)
end
local resp,err = red:get(id)
ngx_log(ngx_ERR,"resp get redis resp : ", resp)
if not resp then
ngx_log(ngx_ERR,"get redis content error : ",err)
return close_redis(red)
end
if resp == ngx.null then
resp = nil
end
close_redis(red)
return resp
end
local function read_http( id )
-- body
local resp = ngx.location.capture("/backend/ad",{
method = ngx.HTTP_GET,
args = {id = id}
})
if not resp then
ngx_log(ngx_ERR,"request error:",err)
return
end
if resp.status ~= 200 then
ngx_log(ngx_ERR,"request error,status:",resp.status)
return
end
return resp.body
end
--id
local id = ngx_var.id
ngx_log(ngx_ERR," id : ",id)
--read redis
local content = read_redis(id)
if not content then
ngx_log(ngx_ERR,"redis not found id :",id)
content = 'read http'
end
if not content then
ngx_log(ngx_ERR,"http not found id :",id)
return ngx_exit(404)
end
--content
ngx.print("show_ad(")
ngx.print(cjson_encode({content = content}))
ngx.print(")")
|
LIBRARY.Name = "Variables"
LIBRARY.Author = "IZED"
local utils = import("libs/utils")
local is = utils.Is
local rpc = import("libs/rpc")
local event = import("libs/event")
local sql = import("libs/sql")
local variables = keeper:get("variables", {})
local counter = 0
local data = sql.Default("zpp_data")
local pdata = sql.Default("zpp_pdata")
local VARIABLE = {}
function LIBRARY.Create(name, value, options)
if not is(name):str() then
return nil
end
counter = counter + 1
local this = {
id = counter,
name = name,
value = nil,
player = is(options):with("player") and options.player or nil,
private = is(options):with("private") and options.private or false,
store = is(options):with("store") and options.store or false
}
setmetatable(this, VARIABLE)
this:set(value)
return this
end
function VARIABLE:set(value)
end
function VARIABLE:remove()
end
function VARIABLE:load(cb)
if not self.store then
return self.value
end
if is(self.player):ply() then
data.getData(self.player:SteamID()..";"..tostring(self.name), function(result)
cb(result)
end)
else
data.getData(self.name, function(result)
cb(result)
end)
end
return self.value
end
function VARIABLE:get(storeCb)
if is(storeCb):fn() and self.store then
self:load(storeCb)
end
return self.value
end
LIBRARY.Create = function(name, value, ply)
counter = counter + 1
local this = {
id = counter,
name = name,
value = nil,
ply = ply,
set = function(self, newValue)
self.value = utils.SanitizeTable(newValue)
if ply and ply:IsValid() then
ply:CallRPC("SetNetworkedVariable", self.name, self.value)
else
rpc.Call("SetNetworkedVariable", self.name, self.value)
end
event.Call("SetNetworkedVariable", self.name, self.value)
variables[self.id] = self
end,
remove = function(self)
if ply and ply:IsValid() then
ply:callRPC("RemoveNetworkedVariable", self.name)
else
rpc.Call("RemoveNetworkedVariable", self.name)
end
event.Call("RemoveNetworkedVariable", self.name)
variables[self.id] = nil
self = nil
end,
get = function(self)
return self.value
end
}
this:set(value)
return this
end
event.Observe("PlayerInitialSpawn"):subscribe(function(ply)
for k,v in pairs(variables) do
ply:callRPC("SetNetworkedVariable", v.name, v.value)
end
end)
|
local A = vim.api
local U = {}
---Range of the selection that needs to be commented
---@class CRange
---@field srow number Starting row
---@field scol number Starting column
---@field erow number Ending row
---@field ecol number Ending column
---@alias CLines string[] List of lines inside the start and end index
---Comment modes - Can be manual or computed in operator-pending phase
---@class CMode
---@field toggle number Toggle action
---@field comment number Comment action
---@field uncomment number Uncomment action
U.cmode = {
toggle = 0,
comment = 1,
uncomment = 2,
}
---Comment string types
---@class CType
---@field line number Use linewise commentstring
---@field block number Use blockwise commentstring
U.ctype = {
line = 1,
block = 2,
}
---Comment motion types
---@class CMotion
---@field _ number Compute from vim mode (@see VMode)
---@field line number Line motion (ie. `gc2j`)
---@field char number Character/left-right motion (ie. `gc2j`)
---@field block number Visual operator-pending motion
---@field v number Visual motion
---@field V number Visual-line motion
U.cmotion = {
_ = 0,
line = 1,
char = 2,
block = 3,
v = 4,
V = 5,
}
---Print a msg on stderr
---@param msg string
function U.eprint(msg)
vim.notify('Comment :: ' .. msg, vim.log.levels.ERROR)
end
---Check whether the line is empty
---@param ln string
---@return boolean
function U.is_empty(ln)
return #ln == 0
end
---Takes out the leading indent from lines
---@param s string
---@return string string Indent chars
---@return number string Length of the indent chars
function U.grab_indent(s)
local _, len, indent = s:find('^(%s*)')
return indent, len
end
---Helper to get padding (I was tired to check this everywhere)
---NOTE: We can also use function to calculate padding if someone wants more spacing
---@param flag boolean
---@return string string Padding chars
---@return string string Padding pattern
function U.get_padding(flag)
if not flag then
return '', ''
end
return ' ', '%s?'
end
-- FIXME This prints `a` in i_CTRL-o
---Moves the cursor and enters INSERT mode
---@param row number Starting row
---@param col number Ending column
function U.move_n_insert(row, col)
A.nvim_win_set_cursor(0, { row, col })
A.nvim_feedkeys('a', 'ni', true)
end
---Convert the string to a escaped string, if given
---@param str string
---@return string|boolean
function U.escape(str)
return str and vim.pesc(str)
end
---Call a function if exists
---@param fn function Hook function
---@return boolean|string
function U.is_fn(fn, ...)
return type(fn) == 'function' and fn(...)
end
---Helper to compute the ignore pattern
---@param ig string|function
---@return boolean|string
function U.get_pattern(ig)
return ig and (type(ig) == 'string' and ig or U.is_fn(ig))
end
---Check if the given line is ignored or not with the given pattern
---@param ln string Line to be ignored
---@param pat string Lua regex
---@return boolean
function U.ignore(ln, pat)
return pat and ln:find(pat) ~= nil
end
---Get region for line movement or visual selection
---NOTE: Returns the current line, if `vmode` is not given.
---@param vmode? VMode
---@return CRange
function U.get_region(vmode)
if not vmode then
local row, col = unpack(A.nvim_win_get_cursor(0))
return { srow = row, scol = col, erow = row, ecol = col }
end
local m = A.nvim_buf_get_mark
local buf = 0
local sln, eln
if vmode:match('[vV]') then
sln, eln = m(buf, '<'), m(buf, '>')
else
sln, eln = m(buf, '['), m(buf, ']')
end
return { srow = sln[1], scol = sln[2], erow = eln[1], ecol = eln[2] }
end
---Get lines from the current position to the given count
---@param count number
---@return CLines
---@return CRange
function U.get_count_lines(count)
local pos = A.nvim_win_get_cursor(0)
local srow = pos[1]
local erow = (srow + count) - 1
local lines = A.nvim_buf_get_lines(0, srow - 1, erow, false)
return lines, { srow = srow, scol = 0, erow = erow, ecol = 0 }
end
---Get lines from a NORMAL/VISUAL mode
---@param range CRange
---@return CLines
function U.get_lines(range)
-- If start and end is same, then just return the current line
if range.srow == range.erow then
return { A.nvim_get_current_line() }
end
return A.nvim_buf_get_lines(0, range.srow - 1, range.erow, false)
end
---Validates and unwraps the given commentstring
---@param cstr string
---@return string|boolean
---@return string|boolean
function U.unwrap_cstr(cstr)
local lcs, rcs = cstr:match('(.*)%%s(.*)')
if not (lcs or rcs) then
return U.eprint(("Invalid commentstring: %q. Run ':h commentstring' for help."):format(cstr))
end
-- Return false if a part is empty, otherwise trim it
-- Bcz it is better to deal with boolean rather than checking empty string length everywhere
return not U.is_empty(lcs) and vim.trim(lcs), not U.is_empty(rcs) and vim.trim(rcs)
end
---Unwraps the commentstring by taking it from the following places in the respective order.
---1. pre_hook (optionally a string can be returned)
---2. ft_table (extra commentstring table in the plugin)
---3. commentstring (already set or added in pre_hook)
---@param cfg Config
---@param ctx Ctx
---@return string string Left side of the commentstring
---@return string string Right side of the commentstring
function U.parse_cstr(cfg, ctx)
-- 1. We ask `pre_hook` for a commentstring
local cstr = U.is_fn(cfg.pre_hook, ctx)
-- 2. Calculate w/ the help of treesitter
or require('Comment.ft').calculate(ctx)
-- 3. Last resort to use native commentstring
or vim.bo.commentstring
return U.unwrap_cstr(cstr)
end
---Converts the given string into a commented string
---@param ln string String that needs to be commented
---@param lcs string Left side of the commentstring
---@param rcs string Right side of the commentstring
---@param padding string Padding chars b/w comment and line
---@param min_indent string|nil Pre-determine indentation (useful) when dealing w/ multiple lines
---@return string string Commented string
function U.comment_str(ln, lcs, rcs, padding, min_indent)
if U.is_empty(ln) then
return (min_indent or '') .. ((lcs or '') .. (rcs or ''))
end
local indent, chars = ln:match('^(%s*)(.*)')
local lcs_new = lcs and lcs .. padding or ''
local rcs_new = rcs and padding .. rcs or ''
local pos = #(min_indent or indent)
local l_indent = indent:sub(0, pos) .. lcs_new .. indent:sub(pos + 1)
return l_indent .. chars .. rcs_new
end
---Converts the given string into a uncommented string
---@param ln string Line that needs to be uncommented
---@param lcs_esc string (Escaped) Left side of the commentstring
---@param rcs_esc string (Escaped) Right side of the commentstring
---@param pp string Padding pattern (@see U.get_padding)
---@return string string Uncommented string
function U.uncomment_str(ln, lcs_esc, rcs_esc, pp)
local ll = lcs_esc and lcs_esc .. pp or ''
local rr = rcs_esc and rcs_esc .. '$?' or ''
local indent, chars = ln:match('(%s*)' .. ll .. '(.*)' .. rr)
-- If the line (after cstring) is empty then just return ''
-- bcz when uncommenting multiline this also doesn't preserve leading whitespace as the line was previously empty
if U.is_empty(chars) then
return ''
end
-- When padding is enabled then trim one trailing space char
return indent .. chars:gsub(pp .. '$', '')
end
---Check if the given string is commented or not
---@param lcs_esc string (Escaped) Left side of the commentstring
---@param rcs_esc string (Escaped) Right side of the commentstring
---@param pp string Padding pattern (@see U.get_padding)
---@return fun(line: string):boolean
function U.is_commented(lcs_esc, rcs_esc, pp)
local ll = lcs_esc and '^%s*' .. lcs_esc .. pp or ''
local rr = rcs_esc and pp .. rcs_esc .. '$' or ''
return function(line)
return line:find(ll .. '(.-)' .. rr)
end
end
return U
|
-- This is a crafter type machine base.
-- It accepts a recipe type registered beforehand.
-- Specialized formspec for crafters
function ele.formspec.get_crafter_formspec(craft_type, power, percent, pos, state)
local craftstats = elepm.craft.types[craft_type]
local input_size = craftstats.inputs
local gui_name = "gui_furnace_arrow"
if craftstats.gui_name then
gui_name = craftstats.gui_name
end
local bar = "image[4,1.5;1,1;"..gui_name.."_bg.png^[transformR270]"
if percent ~= nil then
bar = "image[4,1.5;1,1;"..gui_name.."_bg.png^[lowpart:"..
(percent)..":"..gui_name.."_fg.png^[transformR270]"
end
local in_width = input_size
local in_height = 1
for n = 2, 4 do
if input_size % n == 0 and input_size ~= n then
in_width = input_size / n
in_height = input_size / n
end
end
local y = 1.5
local x = 1.5
if in_height == 2 then
y = 1
elseif in_height >= 3 then
y = 0.5
end
if in_width >= 2 then
x = 1
end
return "size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
ele.formspec.power_meter(power)..
ele.formspec.state_switcher(7, 0, state)..
"list[context;src;"..x..","..y..";"..in_width..","..in_height..";]"..
bar..
"list[context;dst;5,1;2,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_player;main]"..
"listring[context;src]"..
"listring[current_player;main]"..
"listring[context;dst]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25)
end
-- Don't duplicate function for every single crafter node
function crafter_timer (pos, elapsed)
local refresh = false
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
-- Specialized for universal crafter node
local machine_node = minetest.get_node(pos).name
local machine_def = minetest.registered_nodes[machine_node]
-- If this is an active node, get the inactive version
if machine_def.groups['ele_active'] == 1 then
machine_node = machine_def.drop -- Reliable
machine_def = minetest.registered_nodes[machine_node]
end
local capacity = ele.helpers.get_node_property(meta, pos, "capacity")
local usage = ele.helpers.get_node_property(meta, pos, "usage")
local storage = ele.helpers.get_node_property(meta, pos, "storage")
local speed = ele.helpers.get_node_property(meta, pos, "craft_speed")
local time = meta:get_int("src_time")
local state = meta:get_int("state")
local status = "Idle"
local is_enabled = ele.helpers.state_enabled(meta, pos, state)
local res_time = 0
local get_formspec = machine_def.get_formspec or ele.formspec.get_crafter_formspec
local pow_buffer = {capacity = capacity, storage = storage, usage = 0}
-- Default craft speed is 1
if speed == 0 then speed = 1 end
while true do
if not is_enabled then
time = 0
status = "Off"
break
end
local result = elepm.get_recipe(machine_def.craft_type, inv:get_list("src"))
local power_operation = false
-- Determine if there is enough power for this action
res_time = result.time
if result.time ~= 0 and pow_buffer.storage >= usage then
power_operation = true
pow_buffer.usage = usage
end
if result.time == 0 or not power_operation then
ele.helpers.swap_node(pos, machine_node)
if result.time == 0 then
time = 0
status = "Idle"
else
status = "Out of Power!"
end
break
end
refresh = true
status = "Active"
-- One step
pow_buffer.storage = pow_buffer.storage - usage
time = time + ele.helpers.round(speed * 10)
if machine_def.ele_active_node then
local active_node = machine_node.."_active"
if machine_def.ele_active_node ~= true then
active_node = machine_def.ele_active_node
end
ele.helpers.swap_node(pos, active_node)
end
if time <= ele.helpers.round(result.time * 10) then
break
end
local output = result.output
if type(output) ~= "table" then output = { output } end
local output_stacks = {}
for _, o in ipairs(output) do
table.insert(output_stacks, ItemStack(o))
end
local room_for_output = true
inv:set_size("dst_tmp", inv:get_size("dst"))
inv:set_list("dst_tmp", inv:get_list("dst"))
for _, o in ipairs(output_stacks) do
if not inv:room_for_item("dst_tmp", o) then
room_for_output = false
break
end
inv:add_item("dst_tmp", o)
end
if not room_for_output then
ele.helpers.swap_node(pos, machine_node)
time = ele.helpers.round(res_time*10)
status = "Output Full!"
break
end
time = 0
inv:set_list("src", result.new_input)
inv:set_list("dst", inv:get_list("dst_tmp"))
break
end
local pct = 0
if res_time > 0 and time > 0 then
pct = math.floor((time / ele.helpers.round(res_time * 10)) * 100)
end
meta:set_string("formspec", get_formspec(machine_def.craft_type, pow_buffer, pct, pos, state))
meta:set_string("infotext", ("%s %s"):format(machine_def.description, status) ..
"\n" .. ele.capacity_text(capacity, storage))
meta:set_int("src_time", time)
meta:set_int("storage", pow_buffer.storage)
return refresh
end
function elepm.register_crafter(nodename, nodedef)
local craft_type = nodedef.craft_type
if not craft_type or not elepm.craft.types[craft_type] then
return nil
end
if not nodedef.groups then
nodedef.groups = {}
end
nodedef.groups["ele_machine"] = 1
nodedef.groups["ele_user"] = 1
nodedef.groups["tubedevice"] = 1
nodedef.groups["tubedevice_receiver"] = 1
nodedef.on_timer = crafter_timer
-- Allow for custom formspec
local get_formspec = ele.formspec.get_crafter_formspec
if nodedef.get_formspec then
get_formspec = nodedef.get_formspec
end
local sizes = elepm.craft.types[craft_type]
nodedef.on_construct = function (pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("src", sizes.inputs)
inv:set_size("dst", 4)
local storage = ele.helpers.get_node_property(meta, pos, "storage")
local capacity = ele.helpers.get_node_property(meta, pos, "capacity")
local pow_buffer = {capacity = capacity, storage = storage, usage = 0}
meta:set_string("formspec", get_formspec(craft_type, pow_buffer, nil, pos))
end
-- Upgradable
nodedef.ele_upgrades = {
machine_chip = {"craft_speed", "usage", "inrush"},
capacitor = {"capacity"},
}
ele.register_machine(nodename, nodedef)
end
|
-- FIXME: Show invalid permissions as a comma-separated list in grant/revoke instead of sending a new line for each
this = "PermissionsPlugin" -- must match table name below
PermissionsPlugin = {}
PermissionsPlugin.name = "permissions" -- should match folder name!
PermissionsPlugin.permissionTable = {}
PermissionsPlugin.permissionList = {}
PermissionsPlugin.init = function()
Server.AddCommand("grant", "", PermissionsPlugin.GrantCommand, "grant <player> <permission> - grants player permission", 2, 0)
Server.AddCommand("revoke", "", PermissionsPlugin.RevokeCommand, "revoke <player> <permission> - revokes player permission", 2, 0)
Server.AddCommand("permissions", "p perm perms", PermissionsPlugin.PermissionsCommand, "permissions [player] - shows player permissions", 0, 0)
PermissionsPlugin.LoadPermissions()
PermissionsPlugin.RequirePermission("permissions")
end
PermissionsPlugin.GrantCommand = function(client, args, override)
if (not PermissionsPlugin.CheckPermissionNotify(client, "permissions") and override ~= true) then
return
end
local perms = table.concat(args, ", ", 2)
local targetName = args[1]
local target = Server.GetClientByName(targetName, false)
if (target ~= nil) then
targetName = target.name
elseif (PermissionsPlugin.permissionTable[string.lower(targetName)] == nil) then
Server.SendMessage(client, PLAYER_NOT_FOUND(targetName))
return
end
if (not PermissionsPlugin.PermissionsExistsNotify(client, perms)) then
return
end
for k, targetPerm in pairs(args) do
if (k ~= 1) then -- skip name
if (not PermissionsPlugin.HasPermission(targetName, targetPerm)) then
PermissionsPlugin.GrantPermission(targetName, targetPerm)
end
end
end
PermissionsPlugin.SavePermissions()
Server.SendMessage(client, "&eGranted player " .. targetName ..": &9" .. perms)
if (target ~= nil) then
Server.SendMessage(target, "&e" .. client.name .. " granted you: &9" .. perms)
end
end
PermissionsPlugin.RevokeCommand = function(client, args, override)
if (not PermissionsPlugin.CheckPermissionNotify(client, "permissions") and override == nil) then
return
end
local perms = table.concat(args, ", ", 2)
local targetName = args[1]
local target = Server.GetClientByName(targetName, false)
if (target ~= nil) then
targetName = target.name
elseif (PermissionsPlugin.permissionTable[string.lower(targetName)] == nil) then
Server.SendMessage(client, PLAYER_NOT_FOUND(targetName))
return
end
if (not PermissionsPlugin.PermissionsExistsNotify(client, perms)) then
return
end
for k, targetPerm in pairs(args) do
if (k ~= 1) then -- skip name
if (PermissionsPlugin.HasPermission(targetName, targetPerm)) then
PermissionsPlugin.RevokePermission(targetName, targetPerm)
end
end
end
PermissionsPlugin.SavePermissions()
Server.SendMessage(client, "&eRevoked player " .. targetName .. ": &9" .. perms)
if (target ~= nil) then
Server.SendMessage(target, "&e" .. client.name .. " revoked you: &9" .. perms)
end
end
PermissionsPlugin.PermissionsCommand = function(client, args)
local targetName = args[1]
local target
if (targetName == nil) then
targetName = client.name
else
target = Server.GetClientByName(targetName, false)
if (target ~= nil) then
targetName = target.name
end
end
local perms = PermissionsPlugin.permissionTable[string.lower(targetName)]
local permissions = ""
if (perms ~= nil) then
permissions = "&9" .. table.concat(perms, "&e, &9")
elseif (target == nil and args[1] ~= nil) then
Server.SendMessage(client, PLAYER_NOT_FOUND(targetName))
return
end
Server.SendMessage(client, "&ePermissions of " .. targetName .. ": " .. permissions)
end
-- Doesn't check if permission exists
PermissionsPlugin.GrantPermission = function(name, perm)
local name = string.lower(name)
local permsTable = PermissionsPlugin.permissionTable
if (permsTable[name] == nil) then
permsTable[name]= {}
end
table.insert(permsTable[name], perm)
end
-- Doesn't check if permission exists
PermissionsPlugin.RevokePermission = function(name, perm)
local name = string.lower(name)
local perms = PermissionsPlugin.permissionTable[name]
if (#perms - 1 <= 0) then
PermissionsPlugin.permissionTable[name] = nil
return
end
for k, v in pairs(perms) do
if (v == perm) then
table.remove(perms, k)
break
end
end
end
PermissionsPlugin.LoadPermissions = function()
local f = io.open("permissions.txt", "r")
if f then
local lines = {}
for line in io.lines("permissions.txt") do
local tokens = split(line, ":")
if (tokens == nil or tokens[1] == nil or tokens[2] == nil) then
print("Permissions Plugin failed to load entry in permissions.txt")
break
end
local perms = split(tokens[2], ", ")
PermissionsPlugin.permissionTable[tokens[1]] = perms
end
f:close()
end
end
PermissionsPlugin.SavePermissions = function()
local f = io.open("permissions.txt", "w")
if f then
for name in pairs(PermissionsPlugin.permissionTable) do
f:write(name .. ":")
for k, perm in pairs(PermissionsPlugin.permissionTable[name]) do
f:write(perm .. ", ")
end
f:write("\n")
end
f:close()
end
end
PermissionsPlugin.RequirePermission = function(permission)
table.insert(PermissionsPlugin.permissionList, permission)
Server.LogDebug("PermissionsPlugin new permission: " .. permission)
end
PermissionsPlugin.PermissionExists = function(permission)
for k, perm in pairs(PermissionsPlugin.permissionList) do
if (perm == permission) then
return true
end
end
return false
end
PermissionsPlugin.PermissionExistsNotify = function(client, permission)
if (not PermissionsPlugin.PermissionExists(permission)) then
PermissionsPlugin.SendInvalidPermissionMessage(client, permission)
return false
end
return true
end
-- Checks comma-separated list of permissions and returns false on first invalid permission
PermissionsPlugin.PermissionsExistsNotify = function(client, permissions)
local result = true
local perms = split(permissions, ", ")
for _,perm in pairs(perms) do
if (not PermissionsPlugin.PermissionExistsNotify(client, perm)) then
result = false
end
end
return result
end
-- Doesn't check if permission exists
-- Ops bypass permissions, use this when checking permission for a command
PermissionsPlugin.CheckPermission = function(name, permission)
name = string.lower(name)
-- Operators bypass permissions
local client = Server.GetClientByName(name)
if (client ~= nil and client:GetUserType() >= 0x64) then -- operator or higher
return true
end
return PermissionsPlugin.HasPermission(name, permission)
end
-- Doesn't check if permission exists
PermissionsPlugin.HasPermission = function(name, permission)
name = string.lower(name)
local perms = PermissionsPlugin.permissionTable[name];
if (perms ~= nil) then
for k, v in pairs(perms) do
if (v == permission) then
return true
end
end
end
return false
end
PermissionsPlugin.CheckPermissionIfExists = function(name, permission)
if (not PermissionsPlugin.PermissionExists(permission)) then
print("Permission plugin: invalid permission " .. permission .. " check in CheckPermissionIfExists")
return false
end
return PermissionsPlugin.CheckPermission(name, permission)
end
PermissionsPlugin.CheckPermissionNotify = function(client, permission)
if (not PermissionsPlugin.PermissionsExistsNotify(client, permission)) then
return false
end
local result = PermissionsPlugin.CheckPermission(client.name, permission)
if (not result) then
PermissionsPlugin.SendNoPermissionMessage(client, permission)
end
return result
end
PermissionsPlugin.SendInvalidPermissionMessage = function(client, permission)
Server.SendMessage(client, "&cInvalid permission: &9" .. permission)
end
PermissionsPlugin.SendNoPermissionMessage = function(client, permission)
Server.SendMessage(client, "&cMissing permissions: &9" .. permission)
end
|
data:extend(
{
{
type = "recipe",
name = "plutonium-fuel-recipe",
icon = graphics .. "plutonium-fuel.png",
icon_size = 64,
mipmap_count = 4,
category = "advanced-crafting",
energy_required = 20,
enabled = false,
order = "b",
subgroup = "fuel",
ingredients =
{
{"plutonium", 1},
{"rocket-fuel", 1}
},
always_show_made_in = true,
results = {
{"plutonium-fuel", 1}
},
}
})
|
local utils = {}
function utils:bind_options(opts)
for key, val in pairs(opts) do
vim.o[key] = val
end
end
function utils:bind_keymaps(maps)
for _, map in pairs(maps) do
vim.api.nvim_set_keymap(map.mode, map.key, map.cmd, map.options)
end
end
function utils:file_exists(path)
local file = io.open(path, "rb")
if file then file:close() end
return file ~= nil
end
function utils:dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. utils:dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
function utils:file_read(path)
local file = io.open(path,"r")
local data = file:read("*a");
file:close()
return data
end
function utils:startswith(text, prefix)
return text:find(prefix, 1, true) == 1
end
return utils
|
return {'dra','draad','draadachtig','draadbekleding','draadbericht','draadbeugel','draadbreuk','draadeind','draadjesvlees','draadloos','draadmand','draadnagel','draadomroep','draadplastiek','draadrol','draadrollen','draadschaar','draadspoel','draadstripper','draadtrekken','draadverbinding','draadversperring','draadvormig','draadworm','draadzaag','draagaltaar','draagas','draagbaar','draagbaarheid','draagbalk','draagband','draagberrie','draagcomfort','draagconstructie','draagdoek','draaghemel','draagkarton','draagkoets','draagkoord','draagkorf','draagkracht','draagkrachtbeginsel','draagkrachtig','draagkrachtverhoudingen','draagkussen','draaglast','draaglijk','draagmoeder','draagmoederschap','draagplicht','draagraket','draagriem','draagspeld','draagsteen','draagster','draagstoel','draagstok','draagtas','draagtijd','draagverband','draagvermogen','draagvlak','draagvleugelboot','draagwijdte','draagzak','draagzeel','draai','draaibaar','draaibank','draaibeitel','draaibeweging','draaiboek','draaiboom','draaibord','draaibrug','draaicirkel','draaidag','draaideur','draaideurcrimineel','draaideureffect','draaidol','draaien','draaier','draaierig','draaierigheid','draaierij','draaigewricht','draaihals','draaihek','draaiing','draaikap','draaikever','draaiknop','draaikolk','draaikont','draaikonterij','draaikooi','draaikruis','draaikruk','draailicht','draailier','draaimolen','draaiorgel','draaiplateau','draaipoot','draaipoten','draaipunt','draairaam','draairamen','draairichting','draaischijf','draaischijftelefoon','draaischijftoestel','draaisnelheid','draaispil','draaispit','draaistel','draaister','draaistoel','draaistroom','draaitafel','draaitoestel','draaitol','draaitoneel','draaitopstofzuiger','draaitrap','draaiuren','draaiwerk','draaiziekte','draak','draakachtig','drab','drabbig','drabbigheid','drachme','dracht','drachtig','drachttijd','draconisch','draden','draderig','dradig','draf','drafsport','dragee','dragees','dragelijk','dragen','drager','dragermateriaal','dragerschap','dragline','dragoman','dragon','dragonder','dragoniet','dragonnade','dragonsaus','dragqueen','drain','drainage','drainagesysteem','draineerbuis','draineren','drainering','drainwater','drakenbloed','drakenbloedboom','drakenkop','drakenkruid','drakenmuil','drakentong','drakerig','dralen','draler','dram','drama','dramaproductie','dramareeks','dramaschrijver','dramaserie','dramatherapie','dramaticus','dramatiek','dramatisch','dramatiseren','dramatisering','dramatoloog','dramaturg','dramaturge','dramaturgie','dramaturgisch','drammen','drammer','drammerig','drammerigheid','drang','dranger','dranghek','drangwater','drank','drankaccijns','drankbestrijder','drankbestrijding','drankduivel','drankenconcern','drankendivisie','drankenfabrikant','drankengigant','drankengroep','drankengroothandel','drankenhandel','drankenindustrie','drankenkaart','drankenmarkt','drankenproducent','drankenrek','drankensector','drankfabrikant','drankfles','drankgebruik','drankgelegenheid','drankhandel','drankhandelaar','drankje','dranklucht','drankmisbruik','drankorgel','drankprobleem','drankreclame','drankverbod','drankverbruik','drankvergunning','drankverkoop','drankwet','drankwinkel','drankzucht','drankzuchtig','drankzuchtige','draperen','draperie','drapering','dras','drasland','drassig','drassigheid','drastisch','draven','draver','draverij','dravik','draw','drankkast','dragonazijn','draagmier','drakenvlieger','draagarm','draaggolf','draagvloer','draadglas','draagmuur','draagstructuur','draaimoment','drankverslaving','drankvoorraad','draadboom','draadeinde','draadstang','draagbeugel','draagsysteem','draaibeurt','draaidop','draaiduizeligheid','draaiorgelmuziek','draaiperiode','draaipoging','draaischakelaar','draaisysteem','draaitijd','draaiwiel','drafbaan','dramadocent','dramafilm','dramales','drankautomaat','drankconsumptie','drankgelag','drankketen','drankomzet','drankpauze','drankpost','dranktent','draagvlakversterking','draaitabel','dranklokaal','dragergas','dramademocratie','dramastuk','drachtigheid','draaiveld','dramatherapeut','draadwerk','draaimachine','draaischema','draaddikte','drankoffer','dradenkruis','draagkabel','draaistelframe','draadtang','drachtigheidsonderzoek','drachten','drachtens','drachter','drachtster','dracula','dragomanpas','drakensbergen','dranouter','draw','dragan','draaijer','draaisma','dragt','draijer','drabbe','draak','drabbels','draisma','dragstra','drake','draadachtige','draadbeugels','draadeinden','draadje','draadjes','draadloze','draadmanden','draadnagels','draadscharen','draadverbindingen','draadversperringen','draadvormige','draadwormen','draaf','draafde','draafden','draaft','draag','draagbalken','draagbanden','draagbare','draagbaren','draagberries','draagconstructies','draagkoetsen','draagkorven','draagkrachten','draagkrachtige','draagkrachtigen','draagkussens','draaglijke','draaglijker','draaglijkere','draaglijkst','draagmoeders','draagriemen','draagstenen','draagsters','draagstoelen','draagstokken','draagt','draagtasje','draagtasjes','draagtassen','draagvlakken','draagzelen','draaibanken','draaibare','draaibeitels','draaibewegingen','draaiboeken','draaibomen','draaiborden','draaibruggen','draaide','draaiden','draaideureffecten','draaideuren','draaiend','draaiende','draaierige','draaieriger','draaierijen','draaiers','draaigewrichten','draaihekken','draaiingen','draaikolken','draaikruisen','draaikrukken','draaimolens','draaiorgels','draaipunten','draairichtingen','draaischijftelefoons','draaischijftoestellen','draaischijven','draaispillen','draaispitten','draaistoelen','draaistromen','draait','draaitje','draaitjes','draaitollen','draakachtige','draal','draalde','draalden','draalt','drabbige','drabbiger','drabbigste','drachmen','drachten','drachtige','draconische','draconischer','draderige','draderiger','dradige','dradiger','drafje','drageetje','dragelijke','dragend','dragende','dragers','dragomans','dragonders','dragonnades','dragons','dragqueens','drainagebuizen','draineer','draineerbuizen','draineerde','draineerden','draineert','draken','drakenbloedbomen','drakenkoppen','drakenmuilen','drakentongen','drakerige','drakerigste','dralend','dralende','dramas','dramaatje','dramaatjes','dramatische','dramatischer','dramatiseer','dramatiseerde','dramatiseerden','dramatiseert','dramaturgen','dramaturgische','dramde','drammerige','drammers','dramt','drangers','dranghekken','drankbestrijders','drankblikjes','dranken','drankflesje','drankflesjes','drankflessen','drankgebruikers','drankgelagen','drankgelegenheden','drankjes','drankkartons','dranklokalen','drankwetten','drankwinkels','drankzuchtiger','drankzuchtigste','drapeer','drapeerde','drapeerden','drapeert','draperieen','draslanden','drasse','drasser','drassige','drassiger','drassigste','drast','drastische','drastischer','draverijen','dravers','draws','dramatici','draadbreuken','draadspoelen','draadstrippers','draagassen','draagkartons','draaglasten','draagraketten','draagspelden','draagverbanden','draagvleugelboten','draagzakken','draaidagen','draaideurcriminelen','draaihalzen','draaikonten','draailichten','draaistellen','draaitafels','draaitrappen','draakje','draakjes','dragelijker','dragermaterialen','draglines','drainerende','drains','dramaproducties','dramaschrijvers','dramaseries','drankvergunningen','dravende','draaicirkels','draagdoeken','drankorgels','draadplastieken','draagmieren','draaitopstofzuigers','dragelijkst','drakenvliegers','dramatologen','dragans','draaiknoppen','drankautomaten','draaibeurten','draaihekje','draaitabellen','dramastukje','drankposten','drankproblemen','draagmuren','draaggolven','draaiknopje','dramalessen','draaimolentje','draaiorgeltje','drankengroothandels','draagvloeren','draaitafeltje','draaimachines','draagstructuren','dramafilms','draaihekjes','dranktenten','drankfabrikanten','draaimomenten','draaibankje','draaiwieltje','draaischijfje','draaideurcrimineeltjes','dramadocenten','dramareeksen','draaistelframes','drankoffers','draaiorgeltjes','draailieren','drankreclames','draagbandjes','draagkabels','draagsystemen','draagvermogens','draaischakelaars','draaidoppen','draaitrapje','draagzakje','draadmandje','draagkoordje','draaipootjes','drankengroepen','drankhandelaars','drankenproducenten','draaiwielen'}
|
local function get_dir_name(path)
local slash_index = path:reverse():find("\\")
return path:sub(-slash_index + 1):gsub("\\", "")
end
local function get_prompt_dir(cwd)
if config.use_root_symbol and cwd == "C:\\" then
return symbols.root
elseif config.use_home_symbol and cwd == clink.get_env("HOME") then
return symbols.home
elseif config.use_short_paths then
return get_dir_name(cwd)
elseif config.use_posix_paths then
return cwd:gsub("\\", "/")
end
return cwd
end
local function add_prompt_segment()
local cwd = clink.get_cwd()
local arrow_color = last_command_failed() and colors.red or colors.green
add_to_prompt(format_fg_color(symbols.arrow, arrow_color))
add_to_prompt(format_fg_color(get_prompt_dir(cwd), colors.cyan))
end
clink.prompt.register_filter(add_prompt_segment, 55)
|
-- Toolbar.lua
-- ArsonistD
-- Started : 12/25/2021
-- Last Edit : 12/25/2021
local framework = require(script.Parent.Parent.ArsonsPluginFramework)
local Toolbar = framework.CreateModule("Toolbar")
Toolbar.toolbar = framework.plugin:CreateToolbar("Arson's Viewmodel Plugin")
Toolbar.generateButton = Toolbar.toolbar:CreateButton("1", "Create and edit viewmodels", "rbxassetid://7588761139", "Create / Edit")
return Toolbar
|
--[[----------------------------------------------------------------------------
RaidData IDs for FightRecorder
Should containt every raid encounter and most of the npcId's of the bosses
and adds. Misses some of the Mythic difficulty npcId's because I don't have
access to all the fights when they are relevant and it is hard to catch
them all alone later.
2014-2021
Sanex @ EU-Arathor / ahak @ Curseforge
----------------------------------------------------------------------------]]--
local _, ns = ... -- Private namespace
for _, v in pairs({ "RaidEncounterIDs", "BossAdds", "RaidBosses" }) do -- Create tables in private namespace, btw. this is a BAD way of doing this, but I was lazy
ns[v] = ns[v] or {}
end
--[[----------------------------------------------------------------------------
difficultyIDs to record
[difficultyID] = boolean
Set boolean true to record difficultyID, false to skip recording.
Use '/frec list' ingame to generate this list.
----------------------------------------------------------------------------]]--
local recordThis = {
-- https://www.townlong-yak.com/framexml/live/DifficultyUtil.lua
[1] = false, -- Normal Dungeon
[2] = false, -- Heroic Dungeon
[3] = true, -- Normal Raid10
[4] = true, -- Normal Raid25
[5] = true, -- Heroic Raid10
[6] = true, -- Heroic Raid25
[7] = false, -- LFR Raid
[8] = false, -- Challenge Dungeon
[9] = true, -- Raid40
[14] = true, -- Normal PrimaryRaid
[15] = true, -- Heroic PrimaryRaid
[16] = true, -- Mythic PrimaryRaid
[17] = false, -- LFR PrimaryRaid
[23] = false, -- Mythic Dungeon
[24] = false, -- Timewalker Dungeon
[33] = true, -- Timewalker Raid
--[[
[1] = false, -- Normal , party
[2] = false, -- Heroic , party
[3] = true, -- 10 Player , raid
[4] = true, -- 25 Player , raid
[5] = true, -- 10 Player (Heroic) , raid
[6] = true, -- 25 Player (Heroic) , raid
[7] = false, -- Looking For Raid , raid
[8] = false, -- Mythic Keystone , party
[9] = true, -- 40 Player , raid
--[10] = false, -- nil , nil
[11] = false, -- Heroic Scenario , scenario
[12] = false, -- Normal Scenario , scenario
--[13] = false, -- nil , nil
[14] = true, -- Normal , raid
[15] = true, -- Heroic , raid
[16] = true, -- Mythic , raid
[17] = false, -- Looking For Raid , raid
[18] = true, -- Event , raid
[19] = false, -- Event , party
[20] = false, -- Event Scenario , scenario
--[21] = false, -- nil , nil
--[22] = false, -- nil , nil
[23] = false, -- Mythic , party
[24] = false, -- Timewalking , party
[25] = false, -- World PvP Scenario , scenario
--[26] = false, -- nil , nil
--[27] = false, -- nil , nil
--[28] = false, -- nil , nil
[29] = false, -- PvEvP Scenario , pvp
[30] = false, -- Event , scenario
--[31] = false, -- nil , nil
[32] = false, -- World PvP Scenario , scenario
[33] = true, -- Timewalking , raid
[34] = false, -- PvP , pvp
--[35] = false, -- nil , nil
--[36] = false, -- nil , nil
--[37] = false, -- nil , nil
[38] = false, -- Normal , scenario
[39] = false, -- Heroic , scenario
[40] = false, -- Mythic , scenario
--[41] = false, -- nil , nil
--[42] = false, -- nil , nil
--[43] = false, -- nil , nil
--[44] = false, -- nil , nil
[45] = false, -- PvP , scenario
--[46] = false, -- nil , nil
--[47] = false, -- nil , nil
--[48] = false, -- nil , nil
--[49] = false, -- nil , nil
--[50] = false, -- nil , nil
]]
}
ns.recordThis = recordThis
--[[
Constants.lua:
-- Instance Difficulty
DIFFICULTY_DUNGEON_NORMAL = 1;
DIFFICULTY_DUNGEON_HEROIC = 2;
DIFFICULTY_RAID10_NORMAL = 3;
DIFFICULTY_RAID25_NORMAL = 4;
DIFFICULTY_RAID10_HEROIC = 5;
DIFFICULTY_RAID25_HEROIC = 6;
DIFFICULTY_RAID_LFR = 7;
DIFFICULTY_DUNGEON_CHALLENGE = 8;
DIFFICULTY_RAID40 = 9;
DIFFICULTY_PRIMARYRAID_NORMAL = 14;
DIFFICULTY_PRIMARYRAID_HEROIC = 15;
DIFFICULTY_PRIMARYRAID_MYTHIC = 16;
DIFFICULTY_PRIMARYRAID_LFR = 17;
]]--
--[[
Encounter IDs
-- The Obsidian Sanctum
[1091] = "Shadron",
[1092] = "Tenebron",
[1093] = "Vesperon",
-- Ulduar
[1164] = "Elder Brightleaf",
[1165] = "Elder Ironbranch",
[1166] = "Elder Stonebark",
-- The Ruby Sanctum
[1147] = "Baltharus the Warborn",
[1148] = "General Zarithrian",
[1149] = "Saviana Ragefire",
-- MoP World bosses
[1564] = "Sha of Anger",
[1563] = "Galleon",
[1571] = "Nalak",
[1587] = "Oondasta",
-- WoD World bosses
[1755] = "Rukhmar, Sun-God of the Arakkoa",
[1770] = "Tarlna the Ageless",
[1801] = "Supreme Lord Kazzak",
-- Legion World bosses
[1879] = "The Soultakers",
[1880] = "Nithogg",
[1888] = "Shar'thos",
[1917] = "Humongris",
[1949] = "Drugon the Frostblood",
[1950] = "Na'zak the Fiend",
[1951] = "Flotsam",
[1952] = "Calamir",
[1953] = "Levantus",
]]--
--[[----------------------------------------------------------------------------
Fixing incorrect instaceIDs. In old content (Classic and TBC) sometimes
encounters are marked under wrong instanceID when moving from one area to
another (for example AQ40 going under ground after first boss or Nigthbane
in the balcony of Karazhan) and this table should provide the right
instanceID when saving data to the DBs.
[wrong instanceID] (list containing encounters in this wrong [instanceID])
[encounterID] = right instanceID
List of encounterIDs with their right instanceIDs.
You find these in the bossDB if the encounters go under different
instanceIDs when you know they are inside the same raid.
----------------------------------------------------------------------------]]--
local instanceIDFixes = {
[0] = { -- nil
-- Karazhan (The Broken Stair)
[662] = 745, -- "Nightbane"
-- Ulduar (The Mind's Eye)
[1143] = 759, -- "Yogg-Saron"
-- Battle of Dazar'alor (Battle of Dazar'alor)
[2280] = 1176, -- "Stormwall Blockade" P1
-- Ny'alotha, the Waking City (Vision of Destiny)
[2329] = 1180, -- "Wrathion" (uiMapID 1580)
},
[227] = { -- Blackfathom Deeps ???
-- Temple of Ahn'Qiraj (The Hive Undergrounds/Vault of C'Thun)
[710] = 744, -- "Silithid Royalty"
[711] = 744, -- "Battleguard Sartura"
[712] = 744, -- "Fankriss the Unyielding"
[713] = 744, -- "Viscidus"
[714] = 744, -- "Princess Huhuran"
[715] = 744, -- "Twin Emperors"
[716] = 744, -- "Ouro"
[717] = 744 -- "C'thun"
}
}
ns.instanceIDFixes = instanceIDFixes
--[[----------------------------------------------------------------------------
These ecnounters are 'council style' -encounters where you fight multiple
bosses at the same time and you can choose the kill order yourself. In these
fights the actual phases are replaced by number of bosses remaining.
In some cases these might not be an actually fight multiple bosses, but you
kill the same boss again and again between different phases. DBM handles
(at least some of) these fights as 'coucil style' and counts how many times
you have left to "kill" the boss before the actual final kill.
!!! NOTICE !!!
I have only tested the the BfA encounters, for them actualy working I'm just
guessing these others works as well...
[encounterID] = "Encounter Name"
List of encounterIDs with their matching encounter names.
----------------------------------------------------------------------------]]--
local councilStyleEncounters = {
-- MoP
-- Terrace of Endless Spring
[1409] = "Protectors of the Endless",
-- Siege of Orgrimmar
[1593] = "Paragons of the Klaxxi",
-- BfA
-- Battle of Dazar'alor
[2268] = "Conclave of the Chosen",
-- Ny'alotha, the Waking City
[2345] = "Il'gynoth, Corruption Reborn",
}
ns.councilStyleEncounters = councilStyleEncounters
--[[----------------------------------------------------------------------------
These ecnounters are alternating between different phases (like ground-phase
and air-phase) until boss dies or you reach the last phase. Because
sometimes these phases gets numbers (1, 2, ...) and you might get lower wipe
than previous best, but the phase number is smaller, it wouldn't be recorded
as a new record. With encounterIDs in this table we can ignore the phases
and focus solely on the boss' HP.
!!! NOTICE !!!
I have only tested the the Ny'alotha encounters, for them actualy working
I'm just guessing these others works as well...
[encounterID] = "Encounter Name"
List of encounterIDs with their matching encounter names.
----------------------------------------------------------------------------]]--
local ignorePhasesEncounters = {
-- BfA
-- Ny'alotha, the Waking City
[2329] = "Wrathion, the Black Emperor",
[2336] = "Vexiona",
}
ns.ignorePhasesEncounters = ignorePhasesEncounters
--[[----------------------------------------------------------------------------
In some ecnounters players might get renamed and you might want to ignore
those names in the guild check.
["Name"] = true
List of names to be ignored in guild check.
----------------------------------------------------------------------------]]--
local ignoredNames = {
-- BfA
-- Battle of Dazar'alor
["Akunda the Wiped"] = true, -- Conclave of the Chosen
}
ns.ignoredNames = ignoredNames
--[[----------------------------------------------------------------------------
These ecnounters we know the creatureIDs of the bosses and we can include
RaidBosses instead of excluding BossAdds or guessing what to do.
[instanceID] (list containing encounters of instance [instanceID])
[encounterID] = "Encounter Name"
List of encounterIDs with their matching encounter names.
----------------------------------------------------------------------------]]--
local RaidEncounterIDs = {
Classic = {
-- Molten Core
[741] = {
[663] = "Lucifron",
[664] = "Magmadar",
[665] = "Gehennas",
[666] = "Garr",
[667] = "Shazzrah",
[668] = "Baron Geddon",
[669] = "Sulfuron Harbinger",
[670] = "Golemagg the Incinerator",
[671] = "Majordomo Executus",
[672] = "Ragnaros"
},
-- Blackwing Lair
[742] = {
[610] = "Razorgore the Untamed",
[611] = "Vaelastrasz the Corrupt",
[612] = "Broodlord Lashlayer",
[613] = "Firemaw",
[614] = "Ebonroc",
[615] = "Flamegor",
[616] = "Chromaggus",
[617] = "Nefarian"
},
-- Ruins of Ahn'Qiraj
[743] = {
[718] = "Kurinnaxx",
[719] = "General Rajaxx",
[720] = "Moam",
[721] = "Buru the Gorger",
[722] = "Ayamiss the Hunter",
[723] = "Ossirian the Unscarred"
},
-- Temple of Ahn'Qiraj
[744] = {
[709] = "The Prophet Skeram",
-- These undeground bosses are in "Blackfathom Deeps" (227) instead of AQ40 (744) ???
[710] = "Silithid Royalty",
[711] = "Battleguard Sartura",
[712] = "Fankriss the Unyielding",
[713] = "Viscidus",
[714] = "Princess Huhuran",
[715] = "Twin Emperors",
[716] = "Ouro",
-- C'thun has proper instanceID (unless you are inside the boss, there you have 227)
[717] = "C'thun"
}
},
TBC = {
-- Karazhan
[745] = {
-- No ID: Servant's Quarters (Rokad the Ravager, Shadikith the Glider, Hyakiss the Lurker)
[652] = "Attumen the Huntsman",
[653] = "Moroes",
[654] = "Maiden of Virtue",
[655] = "Opera Hall",
[656] = "The Curator",
[657] = "Terestian Illhoof",
[658] = "Shade of Aran",
[659] = "Netherspite",
[660] = "Chess Event",
[661] = "Prince Malchezaar",
[662] = "Nightbane" -- Subzone "The Broken Stair" returns 0 as instanceID?
},
-- Gruul's Lair
[746] = {
[649] = "High King Maulgar",
[650] = "Gruul the Dragonkiller"
},
-- Magtheridon's Lair
[747] = {
[651] = "Magtheridon"
},
-- Serpentshrine Cavern
[748] = {
[623] = "Hydross the Unstable",
[624] = "The Lurker Below",
[625] = "Leotheras the Blind",
[626] = "Fathom-Lord Karathress",
[627] = "Morogrim Tidewalker",
[628] = "Lady Vashj"
},
-- The Eye
[749] = {
[730] = "Al'ar",
[731] = "Void Reaver",
[732] = "High Astromancer Solarian",
[733] = "Kael'thas Sunstrider"
},
-- The Battle for Mount Hyjal
[750] = {
[618] = "Rage Winterchill",
[619] = "Anetheron",
[620] = "Kaz'rogal",
[621] = "Azgalor",
[622] = "Archimonde"
},
-- Black Temple
[751] = {
[601] = "High Warlord Naj'entus",
[602] = "Supremus",
[603] = "Shade of Akama",
[604] = "Teron Gorefiend",
[605] = "Gurtogg Bloodboil",
[606] = "Reliquary of Souls",
[607] = "Mother Shahraz",
[608] = "The Illidari Council",
[609] = "Illidan Stormrage"
},
-- Sunwell Plateau
[752] = {
[724] = "Kalecgos",
[725] = "Brutallus",
[726] = "Felmyst",
[727] = "Eredar Twins",
[728] = "M'uru",
[729] = "Kil'jaeden"
}
},
Wrath = {
-- Vault of Archavon
[753] = {
[1126] = "Archavon the Stone Watcher",
[1127] = "Emalon the Storm Watcher",
[1128] = "Koralon the Flame Watcher",
[1129] = "Toravon the Ice Watcher"
},
-- The Obsidian Sanctum
[755] = {
-- Check for missing encounterIDs
[1093] = "Vesperon",
[1092] = "Tenebron",
[1091] = "Shadron",
[1090] = "Sartharion",
},
-- Naxxramas
[754] = {
[1107] = "Anub'Rekhan",
[1110] = "Grand Widow Faerlina",
[1116] = "Maexxna",
[1117] = "Noth the Plaguebringer",
[1112] = "Heigan the Unclean",
[1115] = "Loatheb",
[1113] = "Instructor Razuvious",
[1109] = "Gothik the Harvester",
[1121] = "The Four Horsemen",
[1118] = "Patchwerk",
[1111] = "Grobbulus",
[1108] = "Gluth",
[1120] = "Thaddius",
[1119] = "Sapphiron",
[1114] = "Kel'Thuzad"
},
-- The Eye of Eternity
[756] = {
[1094] = "Malygos"
},
-- Ulduar
[759] = {
[1132] = "Flame Leviathan",
[1136] = "Ignis the Furnace Master",
[1139] = "Razorscale",
[1142] = "XT-002 Deconstructor",
[1140] = "The Assembly of Iron",
[1137] = "Kologarn",
[1131] = "Auriaya",
[1135] = "Hodir",
[1141] = "Thorim",
[1133] = "Freya",
[1138] = "Mimiron",
[1134] = "General Vezax",
[1143] = "Yogg-Saron",
[1130] = "Algalon the Observer"
},
-- Trial of the Crusader
[757] = {
[1088] = "Northrend Beasts",
[1087] = "Lord Jaraxxus",
[1086] = "Faction Champions",
[1089] = "Val'kyr Twins",
[1085] = "Anub'arak"
},
-- Onyxia's Lair
[760] = {
[1084] = "Onyxia"
},
-- Icecrown Citadel
[758] = {
[1101] = "Lord Marrowgar",
[1100] = "Lady Deathwhisper",
[1099] = "Icecrown Gunship Battle",
[1096] = "Deathbringer Saurfang",
[1097] = "Festergut",
[1104] = "Rotface",
[1102] = "Professor Putricide",
[1095] = "Blood Council",
[1103] = "Queen Lana'thel",
[1098] = "Valithria Dreamwalker",
[1105] = "Sindragosa",
[1106] = "The Lich King"
},
-- The Ruby Sanctum
[761] = {
[1147] = "Baltharus the Warborn",
[1148] = "General Zarithrian",
[1149] = "Saviana Ragefire",
[1150] = "Halion"
}
},
Cata = {
-- Baradin Hold
[75] = {
[1033] = "Argaloth",
[1250] = "Occu'thar",
[1332] = "Alizabal"
},
-- Blackwing Descent
[73] = {
[1027] = "Omnotron Defense System",
[1024] = "Magmaw",
[1022] = "Atramedes",
[1023] = "Chimaeron",
[1025] = "Maloriak",
[1026] = "Nefarian's End"
},
-- Throne of the Four Winds
[74] = {
[1035] = "Conclave of Wind",
[1034] = "Al'Akir"
},
-- The Bastion of Twilight
[72] = {
[1030] = "Halfus Wyrmbreaker",
[1032] = "Theralion and Valiona",
[1028] = "Ascendant Council",
[1029] = "Cho'gall",
--[1082] = "Sinestra", -- What is this?
[1083] = "Sinestra"
},
-- Firelands
[78] = {
[1197] = "Beth'tilac",
[1204] = "Lord Rhyolith",
[1206] = "Alysrazor",
[1205] = "Shannox",
[1200] = "Baleroc",
[1185] = "Majordomo Staghelm",
[1203] = "Ragnaros"
},
-- Dragon Soul
[187] = {
[1292] = "Morchok",
[1294] = "Warlord Zon'ozz",
[1295] = "Yor'sahj the Unsleeping",
[1296] = "Hagara",
[1297] = "Ultraxion",
[1298] = "Warmaster Blackhorn",
[1291] = "Spine of Deathwing",
[1299] = "Madness of Deathwing"
}
},
MoP = {
-- Mogu'shan Vaults
[317] = {
[1395] = "The Stone Guard",
[1390] = "Feng the Accursed",
[1434] = "Gara'jal the Spiritbinder",
[1436] = "The Spirit Kings",
[1500] = "Elegon",
[1407] = "Will of the Emperor"
},
-- Heart of Fear
[330] = {
[1507] = "Imperial Vizier Zor'lok",
[1504] = "Blade Lord Ta'yak",
[1463] = "Garalon",
[1498] = "Wind Lord Mel'jarak",
[1499] = "Amber-Shaper Un'sok",
[1501] = "Grand Empress Shek'zeer"
},
-- Terrace of Endless Spring
[320] = {
[1409] = "Protectors of the Endless",
[1505] = "Tsulong",
[1506] = "Lei Shi",
[1431] = "Sha of Fear"
},
-- Throne of Thunder
[362] = {
[1577] = "Jin'rokh the Breaker",
[1575] = "Horridon",
[1570] = "Council of Elders",
[1565] = "Tortos",
[1578] = "Megaera",
[1573] = "Ji-Kun",
[1572] = "Durumu the Forgotten",
[1574] = "Primordius",
[1576] = "Dark Animus",
[1559] = "Iron Qon",
[1560] = "Twin Consorts",
[1579] = "Lei Shen",
-- What is the difference here?
[1580] = "Ra-den",
[1581] = "Ra-den"
},
-- Siege of Orgrimmar
[369] = {
[1602] = "Immerseus",
[1598] = "Fallen Protectors",
[1624] = "Norushen",
[1604] = "Sha of Pride",
[1622] = "Galakras",
[1600] = "Iron Juggernaut",
[1606] = "Kor'kron Dark Shaman",
[1603] = "General Nazgrim",
[1595] = "Malkorok",
[1594] = "Spoils of Pandaria",
[1599] = "Thok the Bloodthirsty",
[1601] = "Siegecrafter Blackfuse",
[1593] = "Paragons of the Klaxxi",
[1623] = "Garrosh Hellscream"
}
},
WoD = {
-- Highmaul
[477] = {
[1721] = "Kargath Bladefist",
[1706] = "The Butcher",
[1722] = "Tectus, The Living Mountain",
[1720] = "Brackenspore",
[1719] = "Twin Ogron",
[1723] = "Ko'ragh",
[1705] = "Imperator Mar'gok"
},
-- Blackrock Foundry
[457] = {
[1696] = "Oregorger the Devourer",
[1693] = "Hans'gar & Franzok",
[1694] = "Beastlord Darmac",
[1691] = "Gruul",
[1689] = "Flamebender Ka'graz",
[1692] = "Operator Thogar",
[1690] = "Blast Furnace",
[1713] = "Kromog, Legend of the Mountain",
[1695] = "The Iron Maidens",
[1704] = "Blackhand"
},
-- Hellfire Citadel
[669] = {
[1778] = "Hellfire Assault",
[1785] = "Iron Reaver",
[1787] = "Kormrok",
[1798] = "Hellfire High Council",
[1786] = "Kilrogg Deadeye",
[1783] = "Gorefiend",
[1788] = "Shadow-Lord Iskar",
[1794] = "Socrethar the Eternal",
[1777] = "Fel Lord Zakuun",
[1800] = "Xhul'horac",
[1784] = "Tyrant Velhari",
[1795] = "Mannoroth",
[1799] = "Archimonde"
}
},
Legion = {
-- The Emerald Nightmare
[768] = {
[1841] = "Ursoc",
[1853] = "Nythendra",
[1854] = "Dragons of Nightmare",
[1864] = "Xavius",
[1873] = "Il'gynoth, The Heart of Corruption",
[1876] = "Elerethe Renferal",
[1877] = "Cenarius"
},
-- Trial of Valor
[861] = {
[1958] = "Odyn",
[1962] = "Guarm",
[2008] = "Helya"
},
-- The Nighthold
[786] = {
[1842] = "Krosus",
[1849] = "Skorpyron",
[1862] = "Tichondrius",
[1863] = "Star Augur Etraeus",
[1865] = "Chronomatic Anomaly",
[1866] = "Gul'dan",
[1867] = "Trilliax",
[1871] = "Spellblade Aluriel",
[1872] = "Grand Magistrix Elisande",
[1886] = "High Botanist Tel'arn"
},
-- Tomb of Sargeras
[875] = {
[2032] = "Goroth",
[2036] = "Harjatan",
[2037] = "Mistress Sassz'ine",
[2038] = "Fallen Avatar",
[2048] = "Demonic Inquisition",
[2050] = "Sisters of the Moon",
[2051] = "Kil'jaeden",
[2052] = "Maiden of Vigilance",
[2054] = "The Desolate Host"
},
-- Antorus, the Burning Throne
[946] = {
[2076] = "Garothi Worldbreaker",
[2074] = "Felhounds of Sargeras",
[2070] = "Antoran High Command",
[2064] = "Portal Keeper Hasabel",
[2075] = "Eonar the Life-Binder", -- The Defense of Eonar
[2082] = "Imonar the Soulhunter",
[2088] = "Kin'garoth",
[2069] = "Varimathras",
[2073] = "The Coven of Shivarra",
[2063] = "Aggramar",
[2092] = "Argus the Unmaker"
}
},
BfA = {
-- Uldir
[1031] = {
[2144] = "Taloc",
[2141] = "MOTHER",
[2128] = "Fetid Devourer",
[2136] = "Zek'voz, Herald of Nzoth",
[2134] = "Vectis",
[2145] = "Zul, Reborn",
[2135] = "Mythrax the Unraveler",
[2122] = "G'huun"
},
-- Battle of Dazar'alor
[1176] = {
[2265] = "Champion of the Light",
[2285] = "Jadefire Masters (A)",
[2263] = "Grong, the Jungle Lord (H)",
[2284] = "Grong, the Revenant (A)",
[2266] = "Jadefire Masters (H)",
[2271] = "Opulence",
[2268] = "Conclave of the Chosen",
[2272] = "King Rastakhan",
[2276] = "High Tinker Mekkatorque",
[2280] = "Stormwall Blockade",
[2281] = "Lady Jaina Proudmoore"
},
-- Crucible of Storms
[1177] = {
[2269] = "The Restless Cabal",
[2273] = "Uu'nat, Harbinger of the Void"
},
-- The Eternal Palace
[1179] = {
[2298] = "Abyssal Commander Sivara",
[2289] = "Blackwater Behemoth",
[2305] = "Radiance of Azshara",
[2304] = "Lady Ashvane",
[2303] = "Orgozoa",
[2311] = "The Queen's Court",
[2293] = "Za'qul, Harbinger of Ny'alotha",
[2299] = "Queen Azshara"
},
-- Ny'alotha, the Waking City
[1180] = {
[2329] = "Wrathion, the Black Emperor",
[2327] = "Maut",
[2334] = "The Prophet Skitra",
[2328] = "Dark Inquisitor Xanesh",
[2333] = "The Hivemind",
[2335] = "Shad'har the Insatiable",
[2343] = "Drest'agath",
[2345] = "Il'gynoth, Corruption Reborn",
[2336] = "Vexiona",
[2331] = "Ra-den the Despoiled",
[2337] = "Carapace of N'Zoth",
[2344] = "N'Zoth the Corruptor"
}
},
SL = {
-- Castle Nathria
[1190] = {
[2398] = "Shriekwing",
[2398] = "Huntsman Altimor",
[2398] = "Sun King's Salvation",
[2398] = "Artificer Xy'mox",
[2398] = "Hungering Destroyer",
[2398] = "Lady Inerva Darkvein",
[2398] = "The Council of Blood",
[2398] = "Sludgefist",
[2398] = "Stone Legion Generals",
[2398] = "Sire Denathrius"
},
-- Sanctum of Domination
[1193] = {
[2423] = "The Tarragrue",
[2423] = "The Eye of the Jailer",
[2423] = "The Nine",
[2423] = "Remnant of Ner'zhul",
[2423] = "Soulrender Dormazain",
[2423] = "Painsmith Raznal",
[2423] = "Guardian of the First Ones",
[2423] = "Fatescribe Roh-Kalo",
[2423] = "Kel'Thuzad",
[2423] = "Sylvanas Windrunner"
},
}
}
for _, v in pairs(RaidEncounterIDs) do
for instanceID, encounterIDs in pairs(v) do
ns.RaidEncounterIDs[instanceID] = encounterIDs
end
end
--[[----------------------------------------------------------------------------
These get boss frame but ain't the real bosses or interesting adds or needs
to be excluded from the graphs for any other reason.
[creatureID] = "Additional Monster Name"
List of unique boss adds with matching name.
----------------------------------------------------------------------------]]--
local BossAdds = {
TBC = {
-- Karazhan
--[[
-- Opera Hall START
[17543] = "Strawman", -- Wizard of Oz P1
[17546] = "Roar", -- Wizard of Oz P1
[17547] = "Tinhead", -- Wizard of Oz P1
-- Opera Hall END
[17229] = "Kil'rek", -- Terestian Illhoof
-- Chess Event START
[17211] = "Human Footman",
[17469] = "Orc Grunt",
[21160] = "Conjured Water Elemental",
[21726] = "Summoned Daemon",
[21664] = "Human Charger",
[21748] = "Orc Wolf",
[21682] = "Human Cleric",
[21747] = "Orc Necrolyte",
[21683] = "Human Conjurer",
[21750] = "Orc Warlock",
-- Chess Event END
]]--
-- Gruul's Lair
--[[
[18832] = "Krosh Firehand", -- High King Maulgar
[18834] = "Olm the Summoner", -- High King Maulgar
[18835] = "Kiggler the Crazed", -- High King Maulgar
[18836] = "Blindeye the Seer", -- High King Maulgar
]]--
-- Magtheridon's Lair
--[[
[17256] = "Hellfire Channeler",
]]--
-- Serpentshrine Cavern
--[[
[21964] = "Fathom-Guard Caribdis", -- Fathom-Lord Karathress
[21965] = "Fathom-Guard Tidalvess", -- Fathom-Lord Karathress
[21966] = "Fathom-Guard Sharkkis", -- Fathom-Lord Karathress
[21958] = "Enchanted Elemental", -- Lady Vashj
[22009] = "Tainted Elemental", -- Lady Vashj
[22055] = "Coilfang Elite", -- Lady Vashj
[22056] = "Coilfang Strider", -- Lady Vashj
]]--
-- The Eye
--[[
[20060] = "Lord Sanguinar", -- Kael'thas Sunstrider
[20062] = "Grand Astromancer Capernian", -- Kael'thas Sunstrider
[20063] = "Master Engineer Telonicus", -- Kael'thas Sunstrider
[20064] = "Thaladred the Darkener", -- Kael'thas Sunstrider
[21268] = "Netherstrand Longbow", -- Kael'thas Sunstrider
[21269] = "Devastation", -- Kael'thas Sunstrider
[21270] = "Cosmic Infuser", -- Kael'thas Sunstrider
[21271] = "Infinity Blades", -- Kael'thas Sunstrider
[21272] = "Warp Slicer", -- Kael'thas Sunstrider
[21273] = "Phaseshift Bulwark", -- Kael'thas Sunstrider
[21274] = "Staff of Disintegration", -- Kael'thas Sunstrider
]]--
-- Black Temple
[22997] = "Flame of Azzinoth", -- Illidan Stormrage
-- Sunwell Plateau
--[[
[25588] = "Hand of the Deceiver", -- Kil'jaeden
[25502] = "Shield Orb", -- Kil'jaeden
[25708] = "Sinister Reflection" -- Kil'jaeden
]]--
},
Wrath = {
-- Vault of Archavon
--[[
[33998] = "Tempest Minion", -- Emalon the Storm Watcher (Surrounding boss)
[34049] = "Tempest Minion", -- Emalon the Storm Watcher (Summoned during encounter)
[38456] = "Frozen Orb", -- Toravon the Ice Watcher
]]--
-- Naxxramas
--[[
[16573] = "Crypt Guard", -- Anub'Rekhan
[16506] = "Naxxramas Worshipper", -- Grand Widow Faerlina
[16286] = "Spore", -- Loatheb
[16803] = "Death Knight Understudy", -- Instructor Razuvious
[16124] = "Unrelenting Trainee", -- Gothik the Harvester
[16127] = "Spectral Trainee", -- Gothik the Harvester
[16125] = "Unrelenting Death Knight", -- Gothik the Harvester
[16148] = "Spectral Death Knight", -- Gothik the Harvester
[16126] = "Unrelenting Rider", -- Gothik the Harvester
[16149] = "Spectral Horse", -- Gothik the Harvester
[16150] = "Spectral Rider", -- Gothik the Harvester
[16360] = "Zombie Chow", -- Gluth
[23561] = "Soldier of the Frozen Wastes", -- Kel'Thuzad
[23562] = "Unstoppable Abomination", -- Kel'Thuzad
[23563] = "Soul Weaver", -- Kel'Thuzad
[16441] = "Guardian of Icecrown", -- Kel'Thuzad
]]--
-- The Eye of Eternity
--[[
[30245] = "Nexus Lord", -- Malygos
[30249] = "Scion of Eternity", -- Malygos
]]--
-- Ulduar
--[[
[33121] = "Iron Construct", -- Ignis the Furnace Master
[33388] = "Dark Rune Guardian", -- Razorscale
[33453] = "Dark Rune Watcher", -- Razorscale
[33846] = "Dark Rune Sentinel", -- Razorscale
[33343] = "XS-013 Scrapbot", -- XT-002 Deconstructor
[33346] = "XE-321 Boombot", -- XT-002 Deconstructor
[33768] = "Rubble", -- Kologarn
[34014] = "Sanctum Sentry", -- Auriaya (Patroling with her)
[34035] = "Feral Defender", -- Auriaya
-- Thorim START
-- On Pull
[32882] = "Jormungar Behemoth",
[32883] = "Captured Mercenary Soldier",
[32886] = "Dark Rune Acolyte",
[32907] = "Captured Mercenary Captain",
-- Arena
[32922] = "Dark Rune Champion",
[32923] = "Dark Rune Commoner",
[32924] = "Dark Rune Evoker",
[32925] = "Dark Rune Warbringer",
-- Gauntlet
[32872] = "Runic Colossus",
[32873] = "Ancient Rune Giant",
[32874] = "Iron Ring Guard",
[33110] = "Dark Rune Acolyte",
-- Thorim END
[32916] = "Snaplasher", -- Freya
[32918] = "Detonating Lasher", -- Freya
[32919] = "Storm Lasher", -- Freya
[33202] = "Ancient Water Spirit", -- Freya
[33203] = "Ancient Conservator", -- Freya
[33228] = "Eonar's Gift", -- Freya
[34362] = "Proximity Mine", -- Mimiron P1
[33836] = "Bomb Bot", -- Mimiron P3
[33855] = "Junk Bot", -- Mimiron P3
[34057] = "Assault Bot", -- Mimiron P3
[34147] = "Emergency Fire Bot", -- Mimiron P3 (HM)
[33488] = "Saronite Vapors", -- General Vezax
[33524] = "Saronite Animus", -- General Vezax (HM)
[33136] = "Guardian of Yogg-Saron", -- Yogg-Saron P2
[33983] = "Constrictor Tentacle", -- Yogg-Saron P2
[33966] = "Crusher Tentacle", -- Yogg-Saron P2
[33985] = "Corruptor Tentacle", -- Yogg-Saron P2
[33716] = "Influence Tentacle", -- Yogg-Saron P2 (The Mind's Eye)
[33988] = "Immortal Guardian", -- Yogg-Saron P3
[32955] = "Collapsing Star", -- Algalon the Observer
[33052] = "Living Constellation", -- Algalon the Observer
[33089] = "Dark Matter", -- Algalon the Observer
]]--
-- Trial of the Crusader
--[[
[34800] = "Snobold Vassal", -- Northrend Beasts P1
[34815] = "Felflame Infernal", -- Lord Jaraxxus
[34826] = "Mistress of Pain", -- Lord Jaraxxus
-- Faction Champions START
-- Horde
[35465] = "Zhaagrym", -- Harkzog's Demon pet
[35610] = "Cat", -- Ruj'kah's Beast pet
-- Faction Champions END
[34606] = "Frost Sphere", -- Anub'arak
[34607] = "Nerubian Burrower", -- Anub'arak (Phase 1)
[34605] = "Swarm Scarab", --Anub'arak (Intermission)
]]--
-- Onyxia's Lair
--[[
[11262] = "Onyxian Whelp", -- Onyxia P2
[36561] = "Onyxian Lair Guard", -- Onyxia P2
]]--
-- Icecrown Citadel
--[[
[37890] = "Cult Fanatic", -- Lady Deathwhisper
[37890] = "Deformed Fanatic", -- Lady Deathwhisper
[37890] = "Reanimated Fanatic", -- Lady Deathwhisper
[37949] = "Cult Adherent", -- Lady Deathwhisper
[37949] = "Empowered Adherent", -- Lady Deathwhisper
[37949] = "Reanimated Adherent", -- Lady Deathwhisper
[38508] = "Blood Beast", -- Deathbringer Saurfang
[37562] = "Gas Cloud", -- Professor Putricide
[37697] = "Volatile Ooze", -- Professor Putricide
[38369] = "Dark Nucleus", -- Blood Council
[38454] = "Kinetic Bomb", -- Blood Council
[36791] = "Blazing Skeleton", -- Valithria Dreamwalker
[37863] = "Suppresser", -- Valithria Dreamwalker
[37868] = "Risen Archmage", -- Valithria Dreamwalker
[37886] = "Gluttonous Abomination", -- Valithria Dreamwalker
[37907] = "Rot Worm", -- Valithria Dreamwalker
[37934] = "Blistering Zombie", -- Valithria Dreamwalker
[36609] = "Val'kyr Shadowguard", -- The Lich King
[36633] = "Ice Sphere", -- The Lich King
[36701] = "Raging Spirit", -- The Lich King
[37695] = "Drudge Ghoul", -- The Lich King
[37698] = "Shambling Horror", -- The Lich King
[37799] = "Vile Spirit", -- The Lich King
]]--
-- The Ruby Sanctum
--[[
[39814] = "Onyx Flamecaller" -- General Zarithrian
]]--
},
Cata = {
-- Blackwing Descent
[41948] = "Chromatic Prototype", -- Nefarian P2
-- The Bastion of Twilight
[46277] = "Calen", -- Sinestra
-- Firelands
[53509] = "Voracious Hatchling", -- Alysrazor
[53898] = "Voracious Hatchling", -- Alysrazor
[53694] = "Riplimb", -- Shannox
[53695] = "Rageface", -- Shannox
[53231] = "Lava Scion", -- Ragnaros
-- Dragon Soul
[55862] = "Acidic Globule", -- Yor'sahj the Unsleeping
[55863] = "Shadowed Globule", -- Yor'sahj the Unsleeping
[55864] = "Glowing Globule", -- Yor'sahj the Unsleeping
[55865] = "Crimson Globule", -- Yor'sahj the Unsleeping
[55866] = "Cobalt Globule", -- Yor'sahj the Unsleeping
[55867] = "Dark Globule", -- Yor'sahj the Unsleeping
[56598] = "The Skyfire" -- Warmaster Blackhorn
},
MoP = {
-- Mogu'shan Vaults
-- Heart of Fear
[63053] = "Garalon's Leg", -- Garalon
[62447] = "The Kor'thik", -- Wind Lord Mel'jarak
[62451] = "The Sra'thik", -- Wind Lord Mel'jarak
[62452] = "The Zar'thik", -- Wind Lord Mel'jarak
[62711] = "Amber Monstrosity", -- Amber-Shaper Un'sok
-- Terrace of Endless Spring
-- Throne of Thunder
[69374] = "War-God Jalak", -- Horridon
[69480] = "Blessed Loa Spirit", -- Council of Elders
[70212] = "Flaming Head", -- Megaera
[70235] = "Frozen Head", -- Megaera
[70247] = "Venomous Head", -- Megaera
[70248] = "Arcane Head", -- Megaera
[68079] = "Ro'shak", -- Iron Qon
[68080] = "Quet'zal", -- Iron Qon
[68081] = "Dam'ren", -- Iron Qon
[68398] = "Static Shock Conduit", -- Lei Shen
[68696] = "Diffusion Chain Conduit", -- Lei Shen
[68697] = "Overcharge Conduit", -- Lei Shen
[68698] = "Bouncing Bolt Conduit", -- Lei Shen
-- Siege of Orgrimmar
[71474] = "Embodied Despair", -- Fallen Protectors
[71476] = "Embodied Misery", -- Fallen Protectors
[71477] = "Embodied Gloom", -- Fallen Protectors
[71478] = "Embodied Anguish", -- Fallen Protectors
[71481] = "Embodied Sorrow", -- Fallen Protectors
[71482] = "Embodied Desperation", -- Fallen Protectors
[72302] = "Lady Jaina Proudmoore", -- Galakras (Alliance)
[72311] = "King Varian Wrynn", -- Galakras (Alliance)
[73910] = "Vereesa Windrunner", -- Galakras (Alliance)
[72560] = "Lor'themar Theron", -- Galakras (Horde)
[72561] = "Lady Sylvanas Windrunner", -- Galakras (Horde)
[73909] = "Archmage Aethas Sunreaver", -- Galakras (Horde)
[71606] = "Deactivated Missile Turret", -- Siegecrafter Blackfuse
[71694] = "Deactivated Electromagnet", -- Siegecrafter Blackfuse
[71751] = "Deactivated Laser Turret", -- Siegecrafter Blackfuse
[71790] = "Disassembled Crawler Mines", -- Siegecrafter Blackfuse
[71984] = "Siege Engineer" -- Garrosh Hellscream P1
},
WoD = {
-- Highmaul
[78884] = "Living Mushroom", -- Brackenspore
[79092] = "Fungal Flesh-Eater", -- Brackenspore
[77809] = "Arcane Aberration", -- Imperator Mar'gok
[77877] = "Replicating Arcane Aberration", -- Imperator Mar'gok
[77878] = "Fortified Arcane Aberration", -- Imperator Mar'gok
[77879] = "Displacing Arcane Aberration", -- Imperator Mar'gok
[78121] = "Gorian Warmage", -- Imperator Mar'gok
[78549] = "Gorian Reaver", -- Imperator Mar'gok
-- Blackrock Foundry
[76874] = "Dreadwing", -- Beastlord Darmac
[76884] = "Cruelfang", -- Beastlord Darmac
[76945] = "Ironcrusher", -- Beastlord Darmac
[76946] = "Faultline", -- Beastlord Darmac (Mythic)
[76794] = "Cinder Wolf", -- Flamebender Ka'graz
[77337] = "Aknor Steelbringer", -- Flamebender Ka'graz
[77487] = "Grom'kar Firemender", -- Operator Thogar
[78981] = "Iron Gunnery Sergeant", -- Operator Thogar
[77342] = "Siegemaker", -- Blackhand
[80646] = "Fiery Siegemaker", -- Blackhand (Mythic)
[80654] = "Reinforced Siegemaker", -- Blackhand (Mythic)
[80659] = "Supercharged Siegemaker", -- Blackhand (Mythic)
[80660] = "Explosive Siegemaker", -- Blackhand (Mythic)
-- Hellfire Citadel
[90018] = "Hellfire Cannon", -- Hellfire Assault
[90513] = "Fel Blood Globule", -- Kilrogg Deadeye
[90521] = "Hulking Terror", -- Kilrogg Deadeye
[93369] = "Hulking Terror", -- Kilrogg Deadeye
[96077] = "Fel Blood Globule", -- Kilrogg Deadeye
[90570] = "Gorebound Spirit", -- Gorefiend
[91539] = "Fel Raven", -- Shadow-Lord Iskar Air P3
[91541] = "Shadowfel Warden", -- Shadow-Lord Iskar Air P2 & P3
[91543] = "Corrupted Talonpriest", -- Shadow-Lord Iskar Air P1-P3
[93625] = "Phantasmal Resonance", -- Shadow-Lord Iskar (Mythic)
[90296] = "Soulbound Construct", -- Socrethar the Eternal
[94185] = "Vanguard Akkelion", -- Xhul'horac P1
[94239] = "Omnus", -- Xhul'horac P2
[90270] = "Ancient Enforcer", -- Tyrant Velhari P1 (90% HP)
[90271] = "Ancient Harbinger", -- Tyrant Velhari P2 (60% HP)
[90272] = "Ancient Sovereign", -- Tyrant Velhari P3 (30% HP)
[91241] = "Doom Lord", --"Doom Lord Kaz'eth", -- Mannoroth P1-P3
[91305] = "Fel Iron Summoner", -- Mannoroth P1
[92208] = "Doomfire Spirit", -- Archimonde
[92740] = "Hellfire Deathcaller", -- Archimonde
[93615] = "Felborne Overfiend", -- Archimonde
[96119] = "Source of Chaos", -- Archimonde P3 (Mythic)
},
Legion = {
-- The Emerald Nightmare
[105304] = "Dominator Tentacle", -- Il'gynoth
[105591] = "Nightmare Horror", -- Il'gynoth
[105468] = "Nightmare Ancient", -- Cenarius
[105494] = "Rotten Drake", -- Cenarius
[106482] = "Malfurion Stormrage", -- Cenarius
[106667] = "Cleansed Ancient", -- Cenarius
[103695] = "Corruption Horror", -- Xavius
[104592] = "Nightmare Tentacle", -- Xavius
-- Trial of Valor
[114360] = "Hyrja", -- Odyn
[114361] = "Hymdall", -- Odyn
[114709] = "Grimelord", -- Helya
[114809] = "Night Watch Mariner", -- Helya
[114900] = "Gripping Tentacle", -- Helya (Mythic)
-- The Nighthold
[104676] = "Waning Time Particle", -- Chronomatic Anomaly
[104880] = "Thing That Should Not Be", -- Star Augur Etraeus
[105299] = "Recursive Elemental", -- Grand Magistrix Elisande
[105301] = "Expedient Elemental", -- Grand Magistrix Elisande
[104534] = "D'zorykx the Trapper", -- Gul'dan
[104536] = "Inquisitor Vethriz", -- Gul'dan
[104537] = "Fel Lord Kuraz'mal", -- Gul'dan
[105295] = "Azagrim", -- Gul'dan
[106545] = "Empowered Eye of Gul'dan", -- Gul'dan
[107232] = "Beltheris", -- Gul'dan
[107233] = "Dalvengyr", -- Gul'dan
-- Tomb of Sargeras
[119950] = "Brimstone Infernal", -- Goroth (Mythic)
[116569] = "Razorjaw Wavemender", -- Harjatan
[121071] = "Elder Murk-Eye", -- Harjatan
[119205] = "Moontalon", -- Sisters of the Moon
[117264] = "Maiden of Valor", -- Fallen Avatar
[119107] = "Wailing Reflection", -- Kil'jaeden
-- Antorus, the Burning Throne
[122778] = "Annihilator", -- Garothi Worldbreaker
[122773] = "Decimator", -- Garothi Worldbreaker
[122211] = "Vulcanar", -- Portal Keeper Hasabel
[122212] = "Lady Dacidion", -- Portal Keeper Hasabel
[122213] = "Lord Eilgar", -- Portal Keeper Hasabel
[122500] = "Essence of Eonar", -- Eonar the Life-Binder
[123760] = "Fel-Infused Destructor", -- Eonar the Life-Binder
[125429] = "Paraxis Inquisitor", -- Eonar the Life-Binder (Mythic)
[123906] = "Garothi Annihilator", -- Kin'garoth
[123921] = "Garothi Decimator", -- Kin'garoth
[123929] = "Garothi Demolisher", -- Kin'garoth
[121985] = "Flame of Taeshalach", -- Aggramar
[129386] = "Withered Gift of the Lifebinder", -- Argus the Unmaker
[125886] = "Khaz'goroth" -- Argus the Unmaker
},
BfA = {
-- Uldir
[136429] = "Chamber 01", -- MOTHER
[137022] = "Chamber 02", -- MOTHER
[137023] = "Chamber 03", -- MOTHER
[133492] = "Corruption Corpuscle", -- Fetid Devourer
[134726] = "Projection of C'thun", -- Zek'voz, Herald of Nzoth
[135129] = "Projection of Yogg-Saron", -- Zek'voz, Herald of Nzoth
[135824] = "Nerubian Voidweaver", -- Zek'voz, Herald of Nzoth
[135888] = "Warped Projection", -- Zek'voz, Herald of Nzoth
[135016] = "Plague Amalgam", -- Vectis
[139051] = "Nazmani Crusher", -- Zul, Reborn
[139057] = "Nazmani Bloodhexer", -- Zul, Reborn
[139381] = "N'raqi Destroyer", -- Mythrax the Unraveler
[138324] = "Xalzaix", -- Mythrax the Unraveler (Mythic)
-- What is the difference between these? Why do we need two creatureIDs?
[138529] = "Dark Young", -- G'huun
[134635] = "Dark Young", -- G'huun
[134590] = "Blightspreader Tendril", -- G'huun (Heroic)
[134118] = "Reorigination Drive", -- G'huun
[134010] = "Gibbering Horror", -- G'huun
-- Battle of Dazar'alor
[147895] = "Rezani Disciple", -- Champion of the Light
[147896] = "Zandalari Crusader", -- Champion of the Light
[144998] = "Death Specter", -- Grong
[145273] = "The Hand of In'zashi", -- Opulence
[145274] = "Yalat's Bulwark", -- Opulence
[146320] = "Prelate Za'lan", -- King Rastakhan
[146322] = "Siegebreaker Roka", -- King Rastakhan
[146326] = "Headhunter Gal'wana", -- King Rastakhan (Heroic)
[146491] = "Phantom of Retribution", -- King Rastakhan
[146492] = "Phantom of Rage", -- King Rastakhan
[146493] = "Phantom of Slaughter", -- King Rastakhan (Heroic)
[146251] = "Sister Katherine", -- Stormwall Blockade
[146253] = "Brother Joseph", -- Stormwall Blockade
[147180] = "Kul Tiran Corsair", -- Lady Jaina Proudmoore
[147531] = "Kul Tiran Corsair", -- Lady Jaina Proudmoore
[148890] = "Wall of Ice", -- Lady Jaina Proudmoore
[149144] = "Jaina's Tide Elemental", -- Lady Jaina Proudmoore
-- Crucible of Storms
[144996] = "Visage from Beyond", -- The Restless Cabal
[145491] = "Ocean Rune", -- The Restless Cabal
[146496] = "Tempest Caller", -- Uu'nat, Harbinger of the Void
[146581] = "Void Stone", -- Uu'nat, Harbinger of the Void
[146582] = "Trident of Deep Ocean", -- Uu'nat, Harbinger of the Void
[146642] = "Ocean Rune", -- Uu'nat, Harbinger of the Void
-- The Eternal Palace
[152512] = "Stormwraith", -- Radiance of Azshara
[152311] = "Zanj'ir Myrmidon", -- Orgozoa
[152312] = "Azsh'ari Witch", -- Orgozoa
[152313] = "Dreadcoil Hulk", -- Orgozoa
[153335] = "Potent Spark", -- The Queen's Court
[153059] = "Aethanel", -- Queen Azshara P1
[153060] = "Cyranus", -- Queen Azshara P1
[153064] = "Overzealous Hulk", -- Queen Azshara P1
[153090] = "Lady Venomtongue", -- Queen Azshara P3
[153091] = "Serena Scarscale", -- Queen Azshara P3
-- Ny'alotha, the Waking City
[156650] = "Dark Manifestation", -- Maut
[157255] = "Aqir Ravager", -- The Hivemind
[157229] = "Living Miasma", -- Shad'har the Insatiable
[157612] = "Eye of Drest'agath", -- Drest'agath
[157614] = "Tentacle of Drest'agath", -- Drest'agath
[157613] = "Maw of Drest'agath", -- Drest'agath
[158343] = "Organ of Corruption", -- Il'gynoth, Corruption Reborn
[157467] = "Void Ascendant", -- Vexiona
[157366] = "Void Hunter", -- Ra-den the Despoiled (Void-Phase)
[157365] = "Crackling Stalker", -- Ra-den the Despoiled (Vita-Phase)
[157442] = "Gaze of Madness", -- Carapace of N'Zoth (Heroic)
[158376] = "Psychus", -- N'Zoth the Corruptor P1 & P2
[158367] = "Basher Tentacle", -- N'Zoth the Corruptor P2
[162933] = "Thought Harvester" -- N'Zoth the Corruptor P3
},
SL = {
-- Castle Nathria
-- Sanctum of Domination
}
}
for _, v in pairs(BossAdds) do
for creatureID, addName in pairs(v) do
ns.BossAdds[creatureID] = addName
end
end
--[[----------------------------------------------------------------------------
These are the bosses or major adds we are interested in.
[creatureID] = "Boss Name"
List of unique creatureIDs of the boss monsters with matching names.
----------------------------------------------------------------------------]]--
local RaidBosses = {
Classic = {
-- Molten Core
[12118] = "Lucifron",
[11982] = "Magmadar",
[12259] = "Gehennas",
[12057] = "Garr",
[12264] = "Shazzrah",
[12056] = "Baron Geddon",
[12098] = "Sulfuron Harbinger",
[11988] = "Golemagg the Incinerator",
[12018] = "Majordomo Executus",
[11502] = "Ragnaros",
-- Blackwing Lair
[12435] = "Razorgore the Untamed",
[13020] = "Vaelastrasz the Corrupt",
[12017] = "Broodlord Lashlayer",
[11983] = "Firemaw",
[14601] = "Ebonroc",
[11981] = "Flamegor",
[14020] = "Chromaggus",
[11583] = "Nefarian",
-- Ruins of Ahn'Qiraj
[15348] = "Kurinnaxx",
[15341] = "General Rajaxx",
[15340] = "Moam",
[15370] = "Buru the Gorger",
[15369] = "Ayamiss the Hunter",
[15339] = "Ossirian the Unscarred",
-- Temple of Ahn'Qiraj
[15263] = "The Prophet Skeram",
[15511] = "Lord Kri", -- Silithid Royalty
[15543] = "Princess Yauj", -- Silithid Royalty
[15544] = "Vem", -- Silithid Royalty
[15516] = "Battleguard Sartura",
[15510] = "Fankriss the Unyielding",
[15299] = "Viscidus",
[15509] = "Princess Huhuran",
[15275] = "Emperor Vek'nilash", -- Twin Emperors
[15276] = "Emperor Vek'lor", -- Twin Emperors
[15517] = "Ouro",
[15589] = "Eye of C'Thun", -- C'thun P1
[15727] = "C'Thun" -- C'thun P2
},
TBC = {
-- Karazhan
--[16151] = "Midnight", -- Attumen the Huntsman P1
[16152] = "Attumen the Huntsman", -- Attumen the Huntsman P2
[15687] = "Moroes",
[16457] = "Maiden of Virtue",
-- Opera Hall START
[17535] = "Dorothee", -- Wizard of Oz P1
[18168] = "The Crone", -- Wizard of Oz P2
-- Opera Hall END
[15691] = "The Curator",
[16524] = "Shade of Aran",
[15688] = "Terestian Illhoof",
[15689] = "Netherspite",
-- Chess Event START
--[21684] = "King Llane", -- Chess Event
--[21752] = "Warchief Blackhand", -- Chess Event
-- Chess Event END
[15690] = "Prince Malchezaar",
[17225] = "Nightbane",
-- Gruul's Lair
[18831] = "High King Maulgar",
[19044] = "Gruul the Dragonkiller",
-- Magtheridon's Lair
[17257] = "Magtheridon",
-- Serpentshrine Cavern
[21216] = "Hydross the Unstable",
[21217] = "The Lurker Below",
[21215] = "Leotheras the Blind",
--[21875] = "Shadow of Leotheras", -- Leotheras the Blind P2
[21214] = "Fathom-Lord Karathress",
[21213] = "Morogrim Tidewalker",
[21212] = "Lady Vashj",
-- The Eye
[19514] = "Al'ar",
[19516] = "Void Reaver",
[18805] = "High Astromancer Solarian",
[19622] = "Kael'thas Sunstrider",
-- The Battle for Mount Hyjal
[17767] = "Rage Winterchill",
[17808] = "Anetheron",
[17888] = "Kaz'rogal",
[17842] = "Azgalor",
[17968] = "Archimonde",
-- Black Temple
[22887] = "High Warlord Naj'entus",
[22898] = "Supremus",
[22841] = "Shade of Akama",
--[23191] = "Akama", -- Shade of Akama
[22871] = "Teron Gorefiend",
[22948] = "Gurtogg Bloodboil",
[23418] = "Essence of Suffering", -- Reliquary of Souls P1
[23419] = "Essence of Desire", -- Reliquary of Souls P2
[23420] = "Essence of Anger", -- Reliquary of Souls P3
[22947] = "Mother Shahraz",
[22949] = "Gathios the Shatterer", -- The Illidari Council
[22950] = "High Nethermancer Zerevor", -- The Illidari Council
[22951] = "Lady Malande", -- The Illidari Council
[22952] = "Veras Darkshadow", -- The Illidari Council
[22917] = "Illidan Stormrage",
-- Sunwell Plateau
[24850] = "Kalecgos", -- Kalecgos
[24892] = "Sathrovarr the Corruptor", -- Kalecgos
[24882] = "Brutallus",
[25038] = "Felmyst",
[25165] = "Lady Sacrolash", -- Eredar Twins
[25166] = "Grand Warlock Alythess", -- Eredar Twins
--[25741] = "M'uru", -- M'uru P1
[25840] = "Entropius", -- M'uru P2
[25315] = "Kil'jaeden"
},
Wrath = {
-- Vault of Archavon
[31125] = "Archavon the Stone Watcher",
[33993] = "Emalon the Storm Watcher",
[35013] = "Koralon the Flame Watcher",
[38433] = "Toravon the Ice Watcher",
-- The Obsidian Sanctum
[28860] = "Sartharion",
[30449] = "Vesperon",
[30451] = "Shadron",
[30452] = "Tenebron",
-- Naxxramas
[15956] = "Anub'Rekhan",
[15953] = "Grand Widow Faerlina",
[15952] = "Maexxna",
[15954] = "Noth the Plaguebringer",
[15936] = "Heigan the Unclean",
[16011] = "Loatheb",
[16061] = "Instructor Razuvious",
[16060] = "Gothik the Harvester",
[16063] = "Sir Zeliek", -- The Four Horsemen
[16064] = "Thane Korth'azz", -- The Four Horsemen
[16065] = "Lady Blaumeux", -- The Four Horsemen
[30549] = "Baron Rivendare", -- The Four Horsemen
[16028] = "Patchwerk",
[15931] = "Grobbulus",
[15932] = "Gluth",
--[15929] = "Stalagg", -- Thaddius P1
--[15930] = "Feugen", -- Thaddius P1
[15928] = "Thaddius",
[15989] = "Sapphiron",
[15990] = "Kel'Thuzad",
-- The Eye of Eternity
[28859] = "Malygos",
-- Ulduar
[33113] = "Flame Leviathan",
[33118] = "Ignis the Furnace Master",
[33186] = "Razorscale",
[33293] = "XT-002 Deconstructor",
--[33329] = "Heart of the Deconstructor", -- XT-002 Deconstructor
[32857] = "Stormcaller Brundir", -- The Assembly of Iron
[32867] = "Steelbreaker", -- The Assembly of Iron
[32927] = "Runemaster Molgeim", -- The Assembly of Iron
[32930] = "Kologarn",
--[32933] = "Left Arm", -- Kologarn
--[32934] = "Right Arm", -- Kologarn
[33515] = "Auriaya",
[32845] = "Hodir",
[32865] = "Thorim",
[32906] = "Freya",
--[32913] = "Elder Ironbranch", -- Freya
--[32914] = "Elder Stonebark", -- Freya
--[32915] = "Elder Brightleaf", -- Freya
--[33350] = "Mimiron",
[33432] = "Leviathan Mk II", -- Mimiron P1/P4
[33651] = "VX-001", -- Mimiron P2/P4
[33670] = "Aerial Command Unit", -- Mimiron P3/P4
[33271] = "General Vezax",
[33134] = "Sara", -- Yogg-Saron P1
[33288] = "Yogg-Saron", -- Yogg-Saron P2/P3
--[33890] = "Brain of Yogg-Saron", -- Yogg-Saron P2 (The Mind's Eye)
[32871] = "Algalon the Observer",
-- Trial of the Crusader
[34796] = "Gormok the Impaler", -- Northrend Beasts P1
[34799] = "Dreadscale", -- Northrend Beasts P2
[35144] = "Acidmaw", -- Northrend Beasts P2
[34797] = "Icehowl", -- Northrend Beasts P3
[34780] = "Lord Jaraxxus",
-- Faction Champions START
-- Horde
--[34441] = "Vivienne Blackwhisper", -- Shadow Priest
--[34444] = "Thrakgar", -- Resto Shaman
--[34445] = "Liandra Suncaller", -- Holy Paladin
--[34447] = "Caiphus the Stern", -- Discipline Priest
--[34448] = "Ruj'kah", -- Hunter
--[34449] = "Ginselle Blightslinger", -- Mage
--[34450] = "Harkzog", -- Warlock
--[34451] = "Birana Stormhoof", -- Horde Balance Druid
--[34453] = "Narrhok Steelbreaker", -- Warrior
--[34454] = "Maz'dinah", -- Rogue
--[34455] = "Broln Stouthorn", -- Enhancement Shaman
--[34456] = "Malithas Brightblade", -- Retribution Paladin
--[34458] = "Gorgrim Shadowcleave", -- Death Knight
--[34459] = "Erin Misthoof", -- Restoration Druid
-- Faction Champions END
[34496] = "Eydis Darkbane", -- Val'kyr Twins
[34497] = "Fjola Lightbane", -- Val'kyr Twins
[34564] = "Anub'arak",
-- Onyxia's Lair
[10184] = "Onyxia",
-- Icecrown Citadel
[36612] = "Lord Marrowgar",
[36855] = "Lady Deathwhisper",
[37215] = "Orgrim's Hammer", -- Icecrown Gunship Battle
[37540] = "The Skybreaker", -- Icecrown Gunship Battle
[37813] = "Deathbringer Saurfang",
[36626] = "Festergut",
[36627] = "Rotface",
[36678] = "Professor Putricide",
[37970] = "Prince Valanar", -- Blood Council
[37972] = "Prince Keleseth", -- Blood Council
[37973] = "Prince Taldaram", -- Blood Council
[37955] = "Blood-Queen Lana'thel",
[36789] = "Valithria Dreamwalker",
[36853] = "Sindragosa",
[36597] = "The Lich King",
-- The Ruby Sanctum
[39751] = "Baltharus the Warborn",
[39747] = "Saviana Ragefire",
[39746] = "General Zarithrian",
[39863] = "Halion", -- Physical realm Halion (P1/P3)
[40142] = "Halion" -- Twilight realm Halion (P2/P3)
},
Cata = {
-- Baradin Hold
[47120] = "Argaloth",
[52363] = "Occu'thar",
[55869] = "Alizabal",
-- Blackwing Descent
[42166] = "Arcanotron", -- Omnotron Defense System
[42178] = "Magmatron", -- Omnotron Defense System
[42179] = "Electron", -- Omnotron Defense System
[42180] = "Toxitron", -- Omnotron Defense System
[41570] = "Magmaw",
[41442] = "Atramedes",
[43296] = "Chimaeron",
[41378] = "Maloriak",
[41270] = "Onyxia", -- Nefarian P1
[41376] = "Nefarian",
-- Throne of the Four Winds
[45870] = "Anshal", -- Conclave of Wind
[45871] = "Nezir", -- Conclave of Wind
[45872] = "Rohash", -- Conclave of Wind
[46753] = "Al'Akir",
-- The Bastion of Twilight
[44600] = "Halfus Wyrmbreaker",
[45992] = "Valiona", -- Theralion and Valiona
[45993] = "Theralion", -- Theralion and Valiona
[43686] = "Ignacious", -- Ascendant Council
[43687] = "Feludius", -- Ascendant Council
[43688] = "Arion", -- Ascendant Council
[43689] = "Terrastra", -- Ascendant Council
[43735] = "Elementium Monstrosity", -- Ascendant Council
[43324] = "Cho'gall",
[45213] = "Sinestra",
-- Firelands
[52498] = "Beth'tilac",
[52558] = "Lord Rhyolith",
[52577] = "Left Foot", -- Lord Rhyolith
[53087] = "Right Foot", -- Lord Rhyolith
[52530] = "Alysrazor",
[53691] = "Shannox",
[53494] = "Baleroc",
[52571] = "Majordomo Staghelm",
[52409] = "Ragnaros",
-- Dragon Soul
[55265] = "Morchok",
[57773] = "Kohcrom", -- Morchok (HC)
[55308] = "Warlord Zon'ozz",
[55312] = "Yor'sahj the Unsleeping",
[55689] = "Hagara the Stormbinder",
[55294] = "Ultraxion",
[56427] = "Warmaster Blackhorn",
[53879] = "Deathwing", -- Spine of Deathwing
[56341] = "Burning Tendons", -- Spine of Deathwing
[56167] = "Arm Tentacle", -- Madness of Deathwing (Ysera's platform)
[56168] = "Wing Tentacle", -- Madness of Deathwing (Alexstrasza's & Kalecgos' platform, same creatureID for both)
[56173] = "Deathwing", -- Madness of Deathwing P1
[56471] = "Mutated Corruption", -- Madness of Deathwing
[56846] = "Arm Tentacle", -- Madness of Deathwing (Nozdormu's platform)
[57962] = "Deathwing" -- -- Madness of Deathwing P2
},
MoP = {
-- Mogu'shan Vaults
[59915] = "Jasper Guardian", -- The Stone Guard
[60043] = "Jade Guardian", -- The Stone Guard
[60047] = "Amethyst Guardian", -- The Stone Guard
[60051] = "Cobalt Guardian", -- The Stone Guard
[60009] = "Feng the Accursed",
[60143] = "Gara'jal the Spiritbinder",
[60709] = "Qiang the Merciless", -- The Spirit Kings
[60710] = "Subetai the Swift", -- The Spirit Kings
[60701] = "Zian of the Endless Shadow", -- The Spirit Kings
[60708] = "Meng the Demented", -- The Spirit Kings
[60410] = "Elegon",
-- These didn't get recorded for some reason?
-- Adding them here anyway since they get real Boss-unitframes
[60399] = "Qin-xi", -- Will of the Emperor
[60400] = "Jan-xi", -- Will of the Emperor
-- Heart of Fear
[62980] = "Imperial Vizier Zor'lok",
[62543] = "Blade Lord Ta'yak",
[63191] = "Garalon",
[62397] = "Wind Lord Mel'jarak",
[62511] = "Amber-Shaper Un'sok",
[62837] = "Grand Empress Shek'zeer",
-- Terrace of Endless Spring
[60583] = "Protector Kaolan", -- Protectors of the Endless
[60585] = "Elder Regail", -- Protectors of the Endless
[60586] = "Elder Asani", -- Protectors of the Endless
[62442] = "Tsulong",
[62983] = "Lei Shi",
[60999] = "Sha of Fear",
-- Throne of Thunder
[69465] = "Jin'rokh the Breaker",
[68476] = "Horridon",
[69078] = "Sul the Sandcrawler", -- Council of Elders
[69131] = "Frost King Malakk", -- Council of Elders
[69132] = "High Priestess Mar'li", -- Council of Elders
[69134] = "Kazra'jin", -- Council of Elders
[67977] = "Tortos",
[68065] = "Megaera",
--[70212] = "Flaming Head", -- Megaera
--[70235] = "Frozen Head", -- Megaera
--[70247] = "Venomous Head", -- Megaera
--[70248] = "Arcane Head", -- Megaera
[69712] = "Ji-Kun",
[68036] = "Durumu the Forgotten",
[69017] = "Primordius",
[69427] = "Dark Animus",
[68078] = "Iron Qon",
--[68079] = "Ro'shak", -- Iron Qon
--[68080] = "Quet'zal", -- Iron Qon
--[68081] = "Dam'ren", -- Iron Qon
[68904] = "Suen", -- Twin Consorts
[68905] = "Lu'lin", -- Twin Consorts
[68397] = "Lei Shen",
[69473] = "Ra-den",
-- Siege of Orgrimmar
[71543] = "Immerseus",
[71475] = "Rook Stonetoe", -- Fallen Protectors
[71479] = "He Softfoot", -- Fallen Protectors
[71480] = "Sun Tenderheart", -- Fallen Protectors
[72276] = "Amalgam of Corruption", -- Norushen
[71734] = "Sha of Pride",
[72249] = "Galakras",
[71466] = "Iron Juggernaut",
[71858] = "Wavebinder Kardris", -- Kor'kron Dark Shaman
[71859] = "Earthbreaker Haromm", -- Kor'kron Dark Shaman
[71515] = "General Nazgrim",
[71454] = "Malkorok",
[71512] = "Mantid Spoils", -- Spoils of Pandaria
[73720] = "Mogu Spoils", -- Spoils of Pandaria
[73721] = "Mantid Spoils", -- Spoils of Pandaria
[73722] = "Mogu Spoils", -- Spoils of Pandaria
[71529] = "Thok the Bloodthirsty",
[71504] = "Siegecrafter Blackfuse",
[71152] = "Skeer the Bloodseeker", -- Paragons of the Klaxxi 1st
[71153] = "Hisek the Swarmkeeper", -- Paragons of the Klaxxi 1st
[71154] = "Ka'roz the Locust", -- Paragons of the Klaxxi 2nd
[71155] = "Korven the Prime", -- Paragons of the Klaxxi 3rd
[71156] = "Kaz'tik the Manipulator", -- Paragons of the Klaxxi 6th
[71157] = "Xaril the Poisoned Mind", -- Paragons of the Klaxxi 5th
[71158] = "Rik'kal the Dissector", -- Paragons of the Klaxxi 1st
[71160] = "Iyyokuk the Lucid", -- Paragons of the Klaxxi 4th
[71161] = "Kil'ruk the Wind-Reaver", -- Paragons of the Klaxxi 7th
[71865] = "Garrosh Hellscream"
},
WoD = {
-- Highmaul
[78714] = "Kargath Bladefist",
[77404] = "The Butcher",
[78948] = "Tectus", -- Tectus, The Living Mountain
[80551] = "Shard of Tectus", -- Tectus, The Living Mountain
[80557] = "Mote of Tectus", -- Tectus, The Living Mountain
[78491] = "Brackenspore",
[78237] = "Phemos", -- Twin Ogron
[78238] = "Pol", -- Twin Ogron
[79015] = "Ko'ragh",
[77428] = "Imperator Mar'gok",
[78623] = "Cho'gall", -- Imperator Mar'gok (Mythic)
-- Blackrock Foundry
[77182] = "Oregorger", -- Oregorger the Devourer
[76973] = "Hans'gar", -- Hans'gar & Franzok
[76974] = "Franzok", -- Hans'gar & Franzok
[76865] = "Beastlord Darmac",
[76877] = "Gruul",
[76814] = "Flamebender Ka'graz",
[76906] = "Operator Thogar",
[76806] = "Heart of the Mountain", -- Blast Furnace P3
[76808] = "Heat Regulator", -- Blast Furnace P1
[76809] = "Foreman Feldspar", -- Blast Furnace
[76815] = "Primal Elementalist", -- Blast Furnace P2
[77692] = "Kromog", -- Kromog, Legend of the Mountain
[77231] = "Enforcer Sorka", -- The Iron Maidens
[77477] = "Marak the Blooded", -- The Iron Maidens
[77557] = "Admiral Gar'an", -- The Iron Maidens
[77325] = "Blackhand",
-- Hellfire Citadel
[90019] = "Reinforced Hellfire Door", -- Hellfire Assault
[93023] = "Siegemaster Mar'tak", -- Hellfire Assault
[90284] = "Iron Reaver",
[90435] = "Kormrok",
[92142] = "Blademaster Jubei'thos", -- Hellfire High Council
[92144] = "Dia Darkwhisper", -- Hellfire High Council
[92146] = "Gurtogg Bloodboil", -- Hellfire High Council
[90378] = "Kilrogg Deadeye",
[90199] = "Gorefiend",
[90316] = "Shadow-Lord Iskar",
[92330] = "Soul of Socrethar", -- Socrethar the Eternal
[90296] = "Soulbound Construct", -- Socrethar the Eternal
[89890] = "Fel Lord Zakuun",
[93068] = "Xhul'horac",
[90269] = "Tyrant Velhari",
[91349] = "Mannoroth",
[91331] = "Archimonde"
},
Legion = {
-- The Emerald Nightmare
[102672] = "Nythendra",
[105393] = "Il'gynoth", -- Il'gynoth, The Heart of Corruption
[105906] = "Eye of Il'gynoth", -- Il'gynoth, The Heart of Corruption
[106087] = "Elerethe Renferal",
[100497] = "Ursoc",
[102679] = "Ysondre", -- Dragons of Nightmare
[102682] = "Lethon", -- Dragons of Nightmare
[102683] = "Emeriss", -- Dragons of Nightmare
[102681] = "Taerar", -- Dragons of Nightmare
[104636] = "Cenarius",
[103769] = "Xavius",
-- Trial of Valor
--[114360] = "Hyrja", -- Odyn
--[114361] = "Hymdall", -- Odyn
[114263] = "Odyn", -- Odyn
[114323] = "Guarm",
[114537] = "Helya",
-- The Nighthold
[102263] = "Skorpyron",
[104415] = "Chronomatic Anomaly",
[104288] = "Trilliax",
[104881] = "Spellblade Aluriel",
[103685] = "Tichondrius",
[101002] = "Krosus",
[104528] = "Arcanist Tel'arn", -- High Botanist Tel'arn
[109038] = "Solarist Tel'arn", -- High Botanist Tel'arn
[109041] = "Naturalist Tel'arn", -- High Botanist Tel'arn
[109040] = "Arcanist Tel'arn", -- High Botanist Tel'arn (Mythic)
[103758] = "Star Augur Etraeus",
[106643] = "Elisande", -- Grand Magistrix Elisande
[104154] = "Gul'dan",
-- Tomb of Sargeras
[115844] = "Goroth",
[116689] = "Atrigan", -- Demonic Inquisition
[116691] = "Belac", -- Demonic Inquisition
[116407] = "Harjatan",
[118518] = "Priestess Lunaspyre", -- Sisters of the Moon
[118523] = "Huntress Kasparian", -- Sisters of the Moon
[118374] = "Captain Yathae Moonstrike", -- Sisters of the Moon
[115767] = "Mistress Sassz'ine",
[118462] = "Soul Queen Dejahna", -- The Desolate Host
[118460] = "Engine of Souls", -- The Desolate Host
[119072] = "The Desolate Host", -- The Desolate Host
[118289] = "Maiden of Vigilance",
[116939] = "Fallen Avatar",
[117269] = "Kil'jaeden",
-- Antorus, the Burning Throne
[122450] = "Garothi Worldbreaker",
[122477] = "F'harg", -- Felhounds of Sargeras
[122135] = "Shatug", -- Felhounds of Sargeras
[122367] = "Admiral Svirax", -- Antoran High Command
[122369] = "Chief Engineer Ishkar", -- Antoran High Command
[122333] = "General Erodus", -- Antoran High Command
[122104] = "Portal Keeper Hasabel",
[124445] = "The Paraxis", -- Eonar the Life-Binder
[124158] = "Imonar the Soulhunter",
[122578] = "Kin'garoth",
[122366] = "Varimathras",
[122468] = "Noura, Mother of Flames", -- The Coven of Shivarra
[122467] = "Asara, Mother of Night", -- The Coven of Shivarra
[122469] = "Diima, Mother of Gloom", -- The Coven of Shivarra
[125436] = "Thu'raya, Mother of the Cosmos", -- The Coven of Shivarra (Mythic)
[121975] = "Aggramar",
[124828] = "Argus the Unmaker"
},
BfA = {
-- Uldir
[137119] = "Taloc",
[135452] = "MOTHER",
[133298] = "Fetid Devourer",
[134445] = "Zek'voz",
[134442] = "Vectis",
[138967] = "Zul",
[134546] = "Mythrax the Unraveler",
[132998] = "G'huun",
-- Battle of Dazar'alor
[144683] = "Ra'wani Kanae", -- Champion of the Light
[144691] = "Ma'ra Grimfang", -- Jadefire Masters
[144692] = "Anathos Firecaller", -- Jadefire Masters
[144638] = "Grong the Revenant",
[145261] = "Opulence",
[144747] = "Pa'ku's Aspect", -- Conclave of the Chosen
[144767] = "Gonk's Aspect", -- Conclave of the Chosen
[144941] = "Akunda's Aspect", -- Conclave of the Chosen
[144963] = "Kimbul's Aspect", -- Conclave of the Chosen
[145616] = "King Rastakhan", -- King Rastakhan
[145644] = "Bwonsamdi", -- King Rastakhan
[144796] = "High Tinker Mekkatorque",
--[146251] = "Sister Katherine", -- Stormwall Blockade
--[146253] = "Brother Joseph", -- Stormwall Blockade
[146256] = "Laminaria", -- Stormwall Blockade
[146409] = "Lady Jaina Proudmoore",
-- Crucible of Storms
[144754] = "Fa'thuul the Feared", -- The Restless Cabal
[144755] = "Zaxasj the Speaker", -- The Restless Cabal
[145371] = "Uu'nat", -- Uu'nat, Harbinger of the Void
-- The Eternal Palace
[151881] = "Abyssal Commander Sivara",
[150653] = "Blackwater Behemoth",
[152364] = "Radiance of Azshara",
[152236] = "Lady Ashvane",
[152128] = "Orgozoa",
[152852] = "Pashmar the Fanatical", -- The Queen's Court
[152853] = "Silivaz the Zealous", -- The Queen's Court
[150859] = "Za'qul", -- Za'qul, Harbinger of Ny'alotha
[152910] = "Queen Azshara",
-- Ny'alotha, the Waking City
[156818] = "Wrathion, the Black Emperor",
[156523] = "Maut",
[157238] = "Prophet Skitra", -- The Prophet Skitra
[156575] = "Dark Inquisitor Xanesh",
[157253] = "Ka'zir", -- The Hivemind
[157254] = "Tek'ris", -- The Hivemind
[157231] = "Shad'har the Insatiable",
[157602] = "Drest'agath",
[158328] = "Il'gynoth, Corruption Reborn",
[157354] = "Vexiona",
[156866] = "Ra-den the Despoiled",
[157439] = "Fury of N'Zoth", -- Carapace of N'Zoth
[158041] = "N'Zoth the Corruptor"
},
SL ={
-- Castle Nathria
-- Sanctum of Domination
}
}
for _, v in pairs(RaidBosses) do
for creatureID, bossName in pairs(v) do
ns.RaidBosses[creatureID] = bossName
end
end
--[[----------------------------------------------------------------------------
Sort the list of recorded encounters in instances on the left side of the
Frame according to this priority list. When adding new expansion packs, add
number '1' to the front of all 'ORDER' numbers in table 'r' (lazy way) and
make new separator with 'instanceID' key-value set to higher than previous
expansion packs corresponding separator.
Table ["r"] (list of Raid Instances)
[instanceID] = ORDER
Sort instanceIDs based on ORDER.
Table ["e"] (list of Raid Encounters)
[encounterID] = ORDER
Sort encounterIDs inside their own instanceIDs based on ORDER.
----------------------------------------------------------------------------]]--
local orderTable = {
["r"] = { -- Raid instances
-- Classic
[100000] = 111111110, -- Separator
[741] = 111111111, -- Molten Core
[742] = 111111112, -- Blackwing Lair
[743] = 111111113, -- Ruins of Ahn'Qiraj
[744] = 111111114, -- Temple of Ahn'Qiraj
-- TBC
[100001] = 11111110, -- Separator
[745] = 11111111, -- Karazhan
[746] = 11111112, -- Gruul's Lair
[747] = 11111113, -- Magtheridon's Lair
[748] = 11111114, -- Serpentshrine Cavern
[749] = 11111115, -- The Eye
[750] = 11111116, -- The Battle for Mount Hyjal
[751] = 11111117, -- Black Temple
[752] = 11111118, -- Sunwell Plateau
-- Wrath
[100002] = 1111110, -- Separator
[753] = 1111111, -- Vault of Archavon
[755] = 1111112, -- The Obsidian Sanctum
[754] = 1111113, -- Naxxramas
[756] = 1111114, -- The Eye of Eternity
[759] = 1111115, -- Ulduar
[757] = 1111116, -- Trial of the Crusader
[760] = 1111117, -- Onyxia's Lair
[758] = 1111118, -- Icecrown Citadel
[761] = 1111119, -- The Ruby Sanctum
-- Cata
[100003] = 111110, -- Separator
[75] = 111111, -- Baradin Hold
[73] = 111112, -- Blackwing Descent
[74] = 111113, -- Throne of the Four Winds
[72] = 111114, -- The Bastion of Twilight
[78] = 111115, -- Firelands
[187] = 111116, -- Dragon Soul
-- MoP
[100004] = 11110, -- Separator
[317] = 11111, -- Mogu'shan Vaults
[330] = 11112, -- Heart of Fear
[320] = 11113, -- Terrace of Endless Spring
[362] = 11114, -- Throne of Thunder
[369] = 11115, -- Siege of Orgrimmar
-- WoD
[100005] = 1110, -- Separator
[477] = 1111, -- Highmaul
[457] = 1112, -- Blackrock Foundry
[669] = 1113, -- Hellfire Citadel
-- Legion
[100006] = 110, -- Separator
[768] = 111, -- The Emerald Nightmare
[861] = 112, -- Trial of Valor
[786] = 113, -- The Nighthold
[875] = 114, -- Tomb of Sargeras
[946] = 115, -- Antorus, the Burning Throne
-- BfA
[100007] = 10, -- Separator
[1031] = 11, -- Uldir
[1176] = 12, -- Battle of Dazar'alor
[1177] = 13, -- Crucible of Storms
[1179] = 14, -- The Eternal Palace
[1180] = 15, -- Ny'alotha, the Waking City
-- SL
[100008] = 0, -- Separator
[1190] = 1, -- Castle Nathria
[1193] = 2, -- Sanctum of Domination
},
["e"] = { -- Encounters
-- Classic
-- Molten Core
[663] = 1, -- "Lucifron"
[664] = 2, -- "Magmadar"
[665] = 3, -- "Gehennas"
[666] = 4, -- "Garr"
[667] = 5, -- "Shazzrah"
[668] = 6, -- "Baron Geddon"
[669] = 7, -- "Sulfuron Harbinger"
[670] = 8, -- "Golemagg the Incinerator"
[671] = 9, -- "Majordomo Executus"
[672] = 10, -- "Ragnaros"
-- Blackwing Lair
[610] = 1, -- "Razorgore the Untamed"
[611] = 2, -- "Vaelastrasz the Corrupt"
[612] = 3, -- "Broodlord Lashlayer"
[613] = 4, -- "Firemaw"
[614] = 5, -- "Ebonroc"
[615] = 6, -- "Flamegor"
[616] = 7, -- "Chromaggus"
[617] = 8, -- "Nefarian"
-- Ruins of Ahn'Qiraj
[718] = 1, -- "Kurinnaxx"
[719] = 2, -- "General Rajaxx"
[720] = 3, -- "Moam"
[721] = 4, -- "Buru the Gorger"
[722] = 5, -- "Ayamiss the Hunter"
[723] = 6, -- "Ossirian the Unscarred"
-- Temple of Ahn'Qiraj
[709] = 1, -- "The Prophet Skeram"
[710] = 2, -- "Silithid Royalty"
[711] = 3, -- "Battleguard Sartura"
[712] = 4, -- "Fankriss the Unyielding"
[713] = 5, -- "Viscidus"
[714] = 6, -- "Princess Huhuran"
[715] = 7, -- "Twin Emperors"
[716] = 8, -- "Ouro"
[717] = 9, -- "C'thun"
-- TBC
-- Karazhan
--!!! Servant's Quarters (Rokad the Ravager, Shadikith the Glider, Hyakiss the Lurker)
[652] = 2, -- "Attumen the Huntsman"
[653] = 3, -- "Moroes"
[654] = 4, -- "Maiden of Virtue"
[655] = 5, -- "Opera Hall"
[656] = 6, -- "The Curator"
[657] = 7, -- "Terestian Illhoof"
[658] = 8, -- "Shade of Aran"
[659] = 9, -- "Netherspite"
[660] = 10, -- "Chess Event"
[661] = 11, -- "Prince Malchezaar"
[662] = 12, -- "Nightbane"
-- Gruul's Lair
[649] = 1, -- "High King Maulgar"
[650] = 2, -- "Gruul the Dragonkiller"
-- Magtheridon's Lair
[651] = 1, -- "Magtheridon"
-- Serpentshrine Cavern
[623] = 1, -- "Hydross the Unstable"
[624] = 2, -- "The Lurker Below"
[625] = 3, -- "Leotheras the Blind"
[626] = 4, -- "Fathom-Lord Karathress"
[627] = 5, -- "Morogrim Tidewalker"
[628] = 6, -- "Lady Vashj"
-- The Eye
[730] = 1, -- "Al'ar"
[731] = 2, -- "Void Reaver"
[732] = 3, -- "High Astromancer Solarian"
[733] = 4, -- "Kael'thas Sunstrider"
-- The Battle for Mount Hyjal
[618] = 1, -- "Rage Winterchill"
[619] = 2, -- "Anetheron"
[620] = 3, -- "Kaz'rogal"
[621] = 4, -- "Azgalor"
[622] = 5, -- "Archimonde"
-- Black Temple
[601] = 1, -- "High Warlord Naj'entus"
[602] = 2, -- "Supremus",
[603] = 3, -- "Shade of Akama"
[604] = 4, -- "Teron Gorefiend",
[605] = 5, -- "Gurtogg Bloodboil",
[606] = 6, -- "Reliquary of Souls",
[607] = 7, -- "Mother Shahraz",
[608] = 8, -- "The Illidari Council",
[609] = 9, -- "Illidan Stormrage",
-- Sunwell Plateau
[724] = 1, -- "Kalecgos"
[725] = 2, -- "Brutallus"
[726] = 3, -- "Felmyst"
[727] = 4, -- "Eredar Twins"
[728] = 5, -- "M'uru"
[729] = 6, -- "Kil'jaeden"
-- Wrath
-- Vault of Archavon
[1126] = 1, -- "Archavon the Stone Watcher"
[1127] = 2, -- "Emalon the Storm Watcher"
[1128] = 3, -- "Koralon the Flame Watcher"
[1129] = 4, -- "Toravon the Ice Watcher"
-- The Obsidian Sanctum
[1093] = 1, -- "Vesperon"
[1092] = 2, -- "Tenebron"
[1091] = 3, -- "Shadron"
[1090] = 4, -- "Sartharion"
-- Naxxramas
[1107] = 1, -- "Anub'Rekhan"
[1110] = 2, -- "Grand Widow Faerlina"
[1116] = 3, -- "Maexxna"
[1117] = 4, -- "Noth the Plaguebringer"
[1112] = 5, -- "Heigan the Unclean"
[1115] = 6, -- "Loatheb"
[1113] = 7, -- "Instructor Razuvious"
[1109] = 8, -- "Gothik the Harvester"
[1121] = 9, -- "The Four Horsemen"
[1118] = 10, -- "Patchwerk"
[1111] = 11, -- "Grobbulus"
[1108] = 12, -- "Gluth"
[1120] = 13, -- "Thaddius"
[1119] = 14, -- "Sapphiron"
[1114] = 15, -- "Kel'Thuzad"
-- The Eye of Eternity
[1094] = 1, -- "Malygos"
-- Ulduar
[1132] = 1, -- "Flame Leviathan"
[1136] = 2, -- "Ignis the Furnace Master"
[1139] = 3, -- "Razorscale"
[1142] = 4, -- "XT-002 Deconstructor"
[1140] = 5, -- "The Assembly of Iron"
[1137] = 6, -- "Kologarn"
[1131] = 7, -- "Auriaya"
[1135] = 8, -- "Hodir"
[1141] = 9, -- "Thorim"
[1133] = 10, -- "Freya"
[1138] = 11, -- "Mimiron"
[1134] = 12, -- "General Vezax"
[1143] = 13, -- "Yogg-Saron"
[1130] = 14, -- "Algalon the Observer"
-- Trial of the Crusader
[1088] = 1, -- "Northrend Beasts"
[1087] = 2, -- "Lord Jaraxxus"
[1086] = 3, -- "Faction Champions"
[1089] = 4, -- "Val'kyr Twins"
[1085] = 5, -- "Anub'arak"
-- Onyxia's Lair
[1084] = 1, -- "Onyxia"
-- Icecrown Citadel
[1101] = 1, -- "Lord Marrowgar"
[1100] = 2, -- "Lady Deathwhisper"
[1099] = 3, -- "Icecrown Gunship Battle"
[1096] = 4, -- "Deathbringer Saurfang"
[1097] = 5, -- "Festergut"
[1104] = 6, -- "Rotface"
[1102] = 7, -- "Professor Putricide"
[1095] = 8, -- "Blood Council"
[1103] = 9, -- "Queen Lana'thel"
[1098] = 10, -- "Valithria Dreamwalker"
[1105] = 11, -- "Sindragosa"
[1106] = 12, -- "The Lich King"
-- The Ruby Sanctum
[1147] = 1, -- "Baltharus the Warborn",
[1149] = 2, -- "Saviana Ragefire",
[1148] = 3, -- "General Zarithrian",
[1150] = 4, -- "Halion",
-- Cata
-- Baradin Hold
[1033] = 1, -- "Argaloth"
[1250] = 2, -- "Occu'thar"
[1332] = 3, -- "Alizabal"
-- Blackwing Descent
[1027] = 1, -- "Omnotron Defense System"
[1024] = 2, -- "Magmaw"
[1022] = 3, -- "Atramedes"
[1023] = 4, -- "Chimaeron"
[1025] = 5, -- "Maloriak"
[1026] = 6, -- "Nefarian's End"
-- Throne of the Four Winds
[1035] = 1, -- "Conclave of Wind"
[1034] = 2, -- "Al'Akir"
-- The Bastion of Twilight
[1030] = 1, -- "Halfus Wyrmbreaker"
[1032] = 2, -- "Theralion and Valiona"
[1028] = 3, -- "Ascendant Council"
[1029] = 4, -- "Cho'gall"
[1083] = 5, -- "Sinestra"
-- Firelands
[1197] = 1, -- "Beth'tilac"
[1204] = 2, -- "Lord Rhyolith"
[1206] = 3, -- "Alysrazor"
[1205] = 4, -- "Shannox"
[1200] = 5, -- "Baleroc"
[1185] = 6, -- "Majordomo Staghelm"
[1203] = 7, -- "Ragnaros"
-- Dragon Soul
[1292] = 1, -- "Morchok"
[1294] = 2, -- "Warlord Zon'ozz"
[1295] = 3, -- "Yor'sahj the Unsleeping"
[1296] = 4, -- "Hagara"
[1297] = 5, -- "Ultraxion"
[1298] = 6, -- "Warmaster Blackhorn"
[1291] = 7, -- "Spine of Deathwing"
[1299] = 8, -- "Madness of Deathwing"
-- MoP
-- Mogu'shan Vaults
[1395] = 1, -- "The Stone Guard"
[1390] = 2, -- "Feng the Accursed"
[1434] = 3, -- "Gara'jal the Spiritbinder"
[1436] = 4, -- "The Spirit Kings"
[1500] = 5, -- "Elegon"
[1407] = 6, -- "Will of the Emperor"
-- Heart of Fear
[1507] = 1, -- "Imperial Vizier Zor'lok"
[1504] = 2, -- "Blade Lord Ta'yak"
[1463] = 3, -- "Garalon"
[1498] = 4, -- "Wind Lord Mel'jarak"
[1499] = 5, -- "Amber-Shaper Un'sok"
[1501] = 6, -- "Grand Empress Shek'zeer"
-- Terrace of Endless Spring
[1409] = 1, -- "Protectors of the Endless"
[1505] = 2, -- "Tsulong"
[1506] = 3, -- "Lei Shi"
[1431] = 4, -- "Sha of Fear"
-- Throne of Thunder
[1577] = 1, -- "Jin'rokh the Breaker"
[1575] = 2, -- "Horridon"
[1570] = 3, -- "Council of Elders"
[1565] = 4, -- "Tortos"
[1578] = 5, -- "Megaera"
[1573] = 6, -- "Ji-Kun"
[1572] = 7, -- "Durumu the Forgotten"
[1574] = 8, -- "Primordius"
[1576] = 9, -- "Dark Animus"
[1559] = 10, -- "Iron Qon"
[1560] = 11, -- "Twin Consorts"
[1579] = 12, -- "Lei Shen"
-- What is the difference here?
[1580] = 13, -- "Ra-den"
[1581] = 13, -- "Ra-den"
-- Siege of Orgrimmar
[1602] = 1, -- "Immerseus"
[1598] = 2, -- "Fallen Protectors"
[1624] = 3, -- "Norushen"
[1604] = 4, -- "Sha of Pride"
[1622] = 5, -- "Galakras"
[1600] = 6, -- "Iron Juggernaut"
[1606] = 7, -- "Kor'kron Dark Shaman"
[1603] = 8, -- "General Nazgrim"
[1595] = 9, -- "Malkorok"
[1594] = 10, -- "Spoils of Pandaria"
[1599] = 11, -- "Thok the Bloodthirsty"
[1601] = 12, -- "Siegecrafter Blackfuse"
[1593] = 13, -- "Paragons of the Klaxxi"
[1623] = 14, -- "Garrosh Hellscream"
-- WoD
-- Highmaul
[1721] = 1, -- "Kargath Bladefist"
[1706] = 2, -- "The Butcher"
[1722] = 3, -- "Tectus, The Living Mountain"
[1720] = 4, -- "Brackenspore"
[1719] = 5, -- "Twin Ogron"
[1723] = 6, -- "Ko'ragh"
[1705] = 7, -- "Imperator Mar'gok"
-- Blackrock Foundry
[1696] = 1, -- "Oregorger the Devourer"
[1693] = 2, -- "Hans'gar & Franzok"
[1694] = 3, -- "Beastlord Darmac"
[1691] = 4, -- "Gruul"
[1689] = 5, -- "Flamebender Ka'graz"
[1692] = 6, -- "Operator Thogar"
[1690] = 7, -- "Blast Furnace"
[1713] = 8, -- "Kromog, Legend of the Mountain"
[1695] = 9, -- "The Iron Maidens"
[1704] = 10, -- "Blackhand"
-- Hellfire Citadel
[1778] = 1, -- "Hellfire Assault"
[1785] = 2, -- "Iron Reaver"
[1787] = 3, -- "Kormrok"
[1798] = 4, -- "Hellfire High Council"
[1786] = 5, -- "Kilrogg Deadeye"
[1783] = 6, -- "Gorefiend"
[1788] = 7, -- "Shadow-Lord Iskar"
[1794] = 8, -- "Socrethar the Eternal"
[1777] = 9, -- "Fel Lord Zakuun"
[1800] = 10, -- "Xhul'horac"
[1784] = 11, -- "Tyrant Velhari"
[1795] = 12, -- "Mannoroth"
[1799] = 13, -- "Archimonde"
-- Legion
-- The Emerald Nightmare
[1853] = 1, -- "Nythendra"
[1873] = 2, -- "Il'gynoth, The Heart of Corruption"
[1876] = 3, -- "Elerethe Renferal"
[1841] = 4, -- "Ursoc"
[1854] = 5, -- "Dragons of Nightmare"
[1877] = 6, -- "Cenarius"
[1864] = 7, -- "Xavius"
-- Trial of Valor
[1958] = 1, -- "Odyn"
[1962] = 2, -- "Guarm"
[2008] = 3, -- "Helya"
-- The Nighthold
[1849] = 1, -- "Skorpyron"
[1865] = 2, -- "Chronomatic Anomaly"
[1867] = 3, -- "Trilliax"
[1871] = 4, -- "Spellblade Aluriel"
[1862] = 5, -- "Tichondrius"
[1842] = 6, -- "Krosus"
[1886] = 7, -- "High Botanist Tel'arn"
[1863] = 8, -- "Star Augur Etraeus"
[1872] = 9, -- "Grand Magistrix Elisande"
[1866] = 10, -- "Gul'dan"
-- Tomb of Sargeras
[2032] = 1, -- "Goroth"
[2048] = 2, -- "Demonic Inquisition"
[2036] = 3, -- "Harjatan"
[2050] = 4, -- "Sisters of the Moon"
[2037] = 5, -- "Mistress Sassz'ine"
[2054] = 6, -- "The Desolate Host"
[2052] = 7, -- "Maiden of Vigilance"
[2038] = 8, -- "Fallen Avatar"
[2051] = 9, -- "Kil'jaeden"
-- Antorus, the Burning Throne
[2076] = 1, -- "Garothi Worldbreaker"
[2074] = 2, -- "Felhounds of Sargeras"
[2070] = 3, -- "Antoran High Command"
[2064] = 4, -- "Portal Keeper Hasabel"
[2075] = 5, -- "Eonar the Life-Binder" -- The Defense of Eonar
[2082] = 6, -- "Imonar the Soulhunter"
[2088] = 7, -- "Kin'garoth"
[2069] = 8, -- "Varimathras"
[2073] = 9, -- "The Coven of Shivarra"
[2063] = 10, -- "Aggramar"
[2092] = 11, -- "Argus the Unmaker"
-- BfA
-- Uldir
[2144] = 1, -- "Taloc"
[2141] = 2, -- "MOTHER"
[2128] = 3, -- "Fetid Devourer"
[2136] = 4, -- "Zek'voz, Herald of Nzoth"
[2134] = 5, -- "Vectis"
[2145] = 6, -- "Zul, Reborn"
[2135] = 7, -- "Mythrax the Unraveler"
[2122] = 8, -- "G'huun"
-- Battle of Dazar'alor
[2265] = 1, -- "Champion of the Light"
[2285] = 2, -- "Jadefire Masters (A)"
[2263] = 2, -- "Grong, the Jungle Lord (H)"
[2284] = 3, -- "Grong, the Revenant (A)"
[2266] = 3, -- "Jadefire Masters (H)"
[2271] = 4, -- "Opulence"
[2268] = 5, -- "Conclave of the Chosen"
[2272] = 6, -- "King Rastakhan"
[2276] = 7, -- "High Tinker Mekkatorque"
[2280] = 8, -- "Stormwall Blockade"
[2281] = 9, -- "Lady Jaina Proudmoore"
-- Crucible of Storms
[2269] = 1, -- "The Restless Cabal"
[2273] = 2, -- "Uu'nat, Harbinger of the Void"
-- The Eternal Palace
[2298] = 1, -- Abyssal Commander Sivara
[2289] = 2, -- Blackwater Behemoth
[2305] = 3, -- Radiance of Azshara
[2304] = 4, -- Lady Ashvane
[2303] = 5, -- Orgozoa
[2311] = 6, -- The Queen's Court
[2293] = 7, -- Za'qul, Harbinger of Ny'alotha
[2299] = 8, -- Queen Azshara
-- Ny'alotha, the Waking City
[2329] = 1, -- Wrathion, the Black Emperor
[2327] = 2, -- Maut
[2334] = 3, -- The Prophet Skitra
[2328] = 4, -- Dark Inquisitor Xanesh
[2333] = 5, -- The Hivemind
[2335] = 6, -- Shad'har the Insatiable
[2343] = 7, -- Drest'agath
[2345] = 8, -- Il'gynoth, Corruption Reborn
[2336] = 9, -- Vexiona
[2331] = 10, -- Ra-den the Despoiled
[2337] = 11, -- Carapace of N'Zoth
[2344] = 12, -- N'Zoth the Corruptor
-- Shadowlands
-- Castle Nathria
[2398] = 1, -- Shriekwing
[2398] = 2, -- Huntsman Altimor
[2398] = 3, -- Sun King's Salvation
[2398] = 4, -- Artificer Xy'mox
[2398] = 5, -- Hungering Destroyer
[2398] = 6, -- Lady Inerva Darkvein
[2398] = 7, -- The Council of Blood
[2398] = 8, -- Sludgefist
[2398] = 9, -- Stone Legion Generals
[2398] = 10, -- Sire Denathrius
-- Sanctum of Domination
[2423] = 1, -- The Tarragrue
[2423] = 2, -- The Eye of the Jailer
[2423] = 3, -- The Nine
[2423] = 4, -- Remnant of Ner'zhul
[2423] = 5, -- Soulrender Dormazain
[2423] = 6, -- Painsmith Raznal
[2423] = 7, -- Guardian of the First Ones
[2423] = 8, -- Fatescribe Roh-Kalo
[2423] = 9, -- Kel'Thuzad
[2423] = 10, -- Sylvanas Windrunner
}
}
ns.orderTable = orderTable
--------------------------------------------------------------------------------
-- #EOF
--------------------------------------------------------------------------------
|
function Observer:PlayerEnterNoclip(player)
return false
end
function Observer:PlayerExitNoclip(player)
return false
end
|
return function(instrs, labels)
local lines = {}
for i, instr in ipairs(instrs) do
if instr[1] == 'JIZ' then
lines[i] = '?K' .. tostring(instr[2]) .. ' ' .. tostring(instr[3])
elseif instr[1] == 'JMP' then
lines[i] = 'JMP ' .. tostring(instr[2])
elseif instr[1] == 'INCR' then
lines[i] = 'K' .. tostring(instr[2]) .. '++'
elseif instr[1] == 'DECR' then
lines[i] = 'K' .. tostring(instr[2]) .. '--'
else
error('unknown instruction: ' .. tostring(instr[1]))
end
end
for i, line in ipairs(lines) do
lines[i] = ' ' .. line
end
do
local labels_i = {}
for lbl, i in pairs(labels) do
labels_i[#labels_i + 1] = {lbl, i}
end
table.sort(labels_i, function(a, b)
return a[2] < b[2]
end)
local off = 0
for _, lbl in ipairs(labels_i) do
table.insert(lines, lbl[2] + off, lbl[1] .. ':')
off = off + 1
end
end
local out = ''
for _, line in ipairs(lines) do
out = out .. line .. '\n'
end
return out
end
|
return {
commit = '1fed27dc7d7300dd5989420702a1f71f03be3ad8',
date = 'Mon Apr 22 11:49:05 2019 +0800',
}
|
-- file read/write
-- by Qige
-- 2016.04.05/2017.01.03/2017.01.04/2017.01.06
-- 2017.03.13: add local, change "require 'six.file'" to "local file = require 'six.file'"
local file = {}
function file.read(path)
local text = ''
local _file = io.open(path, "r")
if (_file) then
text = _file:read("*all")
_file:close()
end
return text
end
function file.write(path, text)
if (path and path ~= '' and text) then
local _file = io.open(path, "w")
_file:write(text)
_file:close()
end
end
function file.copy(src, des)
local text = file.read(src);
file.write(des, text);
end
return file
|
-- fix the intermediary representation of data
-- using numbers, and strings for operators is ridiculous
local __parser = {__index = {}}
local __parser_index = __parser.__index
function __parser_index:first_pass(str)
local outqueue = arithmetic.queue()
local tempstack = arithmetic.stack()
local reader = arithmetic.reader(str)
local cur = reader:read()
local nline, ncol = 1, 1
local last
while cur ~= nil do
local read = true
if cur == " " or cur == "\t" then
-- do nothing and break processing
elseif cur == "\n" then
nline = nline + 1
ncol = 0
elseif cur >= "0" and cur <= "9" then
local num = cur
last = cur
cur = reader:read()
ncol = ncol + 1
local dotted = false
while cur ~= nil and ((cur >= "0" and cur <= "9") or cur == ".") do
if cur == "." then
if dotted then
return nil, "badly formatted number (multiple dots)", ncol
else
dotted = true
end
end
num = num .. cur
last = cur
cur = reader:read()
ncol = ncol + 1
end
outqueue:push(tonumber(num))
read = false
elseif arithmetic.operator.translation[cur] ~= nil then
local trac = arithmetic.operator.translation[cur]
if (cur == "+" or cur == "-") and (last == nil or arithmetic.operator.translation[last] ~= nil or last == "(") then
cur = cur == "+" and "#" or "_"
else
local top = tempstack:top()
local trat = arithmetic.operator.translation[top]
while top ~= nil and trat ~= nil do
if (arithmetic.operator.associativity[trac] == arithmetic.operator.left and arithmetic.operator.precedence[trac] > arithmetic.operator.precedence[trat]) or
(arithmetic.operator.associativity[trac] == arithmetic.operator.right and arithmetic.operator.precedence[trac] >= arithmetic.operator.precedence[trat]) then
break
end
tempstack:pop()
outqueue:push(top)
top = tempstack:top()
trat = arithmetic.operator.translation[top]
end
end
tempstack:push(cur)
elseif cur == "(" then
tempstack:push(cur)
elseif cur == ")" then
local top = tempstack:pop()
while top ~= "(" do
if top == nil then
return nil, "mismatched parenthesis", ncol
end
outqueue:push(top)
top = tempstack:pop()
end
else
return nil, "unrecognized character", ncol
end
if read then
last = (cur ~= " " and cur ~= "\t") and cur or last
cur = reader:read()
ncol = ncol + 1
end
end
local top = tempstack:pop()
while top ~= nil do
if top == "(" or top == ")" then
return nil, "mismatched parenthesis", ncol
end
outqueue:push(top)
top = tempstack:pop()
end
return outqueue
end
function __parser_index:second_pass(queue)
local tempstack = arithmetic.stack()
local top = queue:pop()
while top ~= nil do
if type(top) == "number" then
tempstack:push(arithmetic.float(top))
else
local tra = arithmetic.operator.translation[top]
if arithmetic.operator.arity[tra] == 2 then
local second, first = tempstack:pop(), tempstack:pop()
tempstack:push(arithmetic.operator.binary(tra, first, second))
else
tempstack:push(arithmetic.operator.unary(tra, tempstack:pop()))
end
end
top = queue:pop()
end
return tempstack:pop()
end
function __parser_index:parse(str)
if str == nil or #str == 0 then
return nil
end
local queue, err, col = self:first_pass(str)
if queue == nil then
return nil, err, col
end
return self:second_pass(queue)
end
function arithmetic.parser()
return setmetatable({}, __parser)
end
return arithmetic.parser
|
-- local MENU_KEY = KEY_B
-- local BAR_HEIGHT = PADDING * 4
-- local scrW, scrH = ScrW(), ScrH()
-- local PANEL = {}
-- local playerLibrary = player
-- local hasOpenedFirstTime = false
-- local BET_OPEN_INTERVAL = 1.5
-- local lastOpen = 0
-- local function hideMenu()
-- BET_MENU:Remove()
-- BET_MENU = nil
-- end
-- local function showMenu(justLeftOtherTeam)
-- if(IsValid(BET_MENU))then
-- hideMenu()
-- end
-- BET_MENU = vgui.Create("Minigolf.BetMenu")
-- BET_MENU:MakePopup()
-- end
-- -- Add a command to open the menu
-- concommand.Add("menu_betting", showMenu)
-- hook.Add("PlayerButtonDown", "Minigolf.ShowBetMenuOnKeyPress", function(player, button)
-- if((not PS.ShopMenu or not PS.ShopMenu:IsVisible())
-- and button == MENU_KEY
-- and player == LocalPlayer()
-- and (UnPredictedCurTime() - lastOpen) > BET_OPEN_INTERVAL)then
-- lastOpen = UnPredictedCurTime()
-- showMenu()
-- end
-- end)
-- function PANEL:Init()
-- local width = math.max(450, scrW * .3)
-- self:SetWide(width)
-- self.startTime = UnPredictedCurTime()
-- local actionButton = vgui.Create("MinigolfActionButton", self)
-- actionButton:SetText("View active bets")
-- actionButton:SizeToContents()
-- actionButton:SetSize(actionButton:GetWide() + (PADDING * 2), actionButton:GetTall() + (PADDING))
-- actionButton:SetPos(PADDING, PADDING)
-- actionButton.DoClick = function(btn)
-- self:Remove()
-- if(IsValid(BET_MENU))then
-- BET_MENU:Remove()
-- end
-- BET_MENU = vgui.Create("Minigolf.BetOverviewMenu", GetHUDPanel())
-- BET_MENU:MakePopup()
-- end
-- self.actionButton = actionButton
-- local closeButton = vgui.Create("MinigolfCloseButton", self)
-- closeButton.DoClick = function(btn)
-- self:Remove()
-- end
-- closeButton:SetPos(width - PADDING - closeButton:GetWide(), PADDING)
-- self.closeButton = closeButton
-- local infoLabel = vgui.Create("DLabel", self)
-- infoLabel:SetPos(PADDING, BAR_HEIGHT + PADDING)
-- infoLabel:SetText("Early betting system that needs much improvement. Please pay attention to your betting and report problems and suggestions to a developer.")
-- infoLabel:SetTextColor(COLOR_DARK)
-- infoLabel:SetAutoStretchVertical(true)
-- infoLabel:SetWide(width - PADDING * 2)
-- infoLabel:SetWrap(true)
-- local posX, posY = infoLabel:GetPos()
-- local amountLabel = vgui.Create("DLabel", self)
-- amountLabel:SetPos(PADDING, posY + PADDING + infoLabel:GetTall() + PADDING)
-- amountLabel:SetText("Bet this many tokens:")
-- amountLabel:SetTextColor(COLOR_DARK)
-- amountLabel:SizeToContents()
-- local posX, posY = amountLabel:GetPos()
-- local offsetX = posX + amountLabel:GetWide() + PADDING
-- local amountEntry = vgui.Create("DTextEntry", self)
-- amountEntry:SetEditable(true)
-- amountEntry:SetText("0")
-- amountEntry:SetEditable(true)
-- amountEntry:SetPos(offsetX, posY)
-- amountEntry:SetWide(width - offsetX - PADDING)
-- amountEntry:SetUpdateOnType(true)
-- amountEntry:SetNumeric(true)
-- -- Also don't allow . or -
-- amountEntry.OnValueChange = function(amountEntry, value)
-- for stringMatch in string.gmatch(value, "[^%d]+") do
-- local oldCaretPos = amountEntry:GetCaretPos()
-- amountEntry:SetText(value:Replace(stringMatch, ""))
-- amountEntry:SetCaretPos(oldCaretPos - 1)
-- end
-- end
-- self.amountEntry = amountEntry
-- local targetLabel = vgui.Create("DLabel" , self)
-- targetLabel:SetPos(PADDING, posY + amountEntry:GetTall() + PADDING)
-- targetLabel:SetText("That this player:")
-- targetLabel:SetTextColor(COLOR_DARK)
-- targetLabel:SizeToContents()
-- posX, posY = targetLabel:GetPos()
-- offsetX = posX + targetLabel:GetWide() + PADDING
-- local userEntry = vgui.Create("DComboBox", self)
-- userEntry:SetValue("<user to bet on>")
-- userEntry:SetPos(offsetX, posY)
-- userEntry:SetWide(width - offsetX - PADDING)
-- for _, ply in pairs(playerLibrary.GetAll()) do
-- userEntry:AddChoice(ply:Nick(), ply)
-- end
-- self.userEntry = userEntry
-- posX, posY = userEntry:GetPos()
-- offsetX = posX + userEntry:GetWide() + PADDING
-- local holeLabel = vgui.Create("DLabel" , self)
-- holeLabel:SetPos(PADDING, posY + userEntry:GetTall() + PADDING)
-- holeLabel:SetText("On this hole:")
-- holeLabel:SetTextColor(COLOR_DARK)
-- holeLabel:SizeToContents()
-- posX, posY = holeLabel:GetPos()
-- offsetX = posX + holeLabel:GetWide() + PADDING
-- local holeEntry = vgui.Create("DComboBox", self)
-- holeEntry:SetValue("<hole that they'll get the given score on>")
-- holeEntry:SetPos(offsetX, posY)
-- holeEntry:SetWide(width - offsetX - PADDING)
-- for _, hole in pairs(ents.FindByClass("minigolf_hole_start")) do
-- holeEntry:AddChoice(hole:GetHoleName(), hole)
-- end
-- self.holeEntry = holeEntry
-- posX, posY = holeEntry:GetPos()
-- local scoreEntry = vgui.Create("DNumSlider", self)
-- scoreEntry:SetText("Will get this many strokes:")
-- scoreEntry:SetMin(1)
-- scoreEntry:SetMax(256)
-- scoreEntry:SetValue(1)
-- scoreEntry:SetDecimals(0)
-- scoreEntry:SetPos(PADDING, posY + holeEntry:GetTall() + PADDING)
-- scoreEntry:SetSize(width - PADDING - PADDING, 25)
-- scoreEntry.Label:SetTextColor(COLOR_DARK)
-- scoreEntry.Label:SizeToContents()
-- holeEntry.OnSelect = function(holeEntry, index, value, data)
-- scoreEntry:SetMax(data:GetMaxStrokes() - 1)
-- end
-- self.scoreEntry = scoreEntry
-- posX, posY = scoreEntry:GetPos()
-- local betButton = vgui.Create("DButton", self)
-- betButton:SetSize(width - (PADDING * 2), 50)
-- betButton:SetPos(PADDING, posY + PADDING + scoreEntry:GetTall())
-- betButton:SetText("Place Bet")
-- betButton.DoClick = function()
-- local _, targetPlayer = userEntry:GetSelected()
-- local betAmount = tonumber(amountEntry:GetValue())
-- local expectedScore = scoreEntry:GetValue()
-- local _, targetHole = holeEntry:GetSelected()
-- if(not targetPlayer)then
-- Minigolf.Messages.Print("No Player selected to bet on!", nil, TEXT_EFFECT_DANGER)
-- return
-- end
-- if(not betAmount)then
-- Minigolf.Messages.Print("No valid bet amount given!", nil, TEXT_EFFECT_DANGER)
-- return
-- end
-- if(not LocalPlayer():PS_HasPoints(betAmount))then
-- Minigolf.Messages.Print("You do not have this many points!", nil, TEXT_EFFECT_DANGER)
-- return
-- end
-- if(not expectedScore or expectedScore == "")then
-- Minigolf.Messages.Print("No expected score given!", nil, TEXT_EFFECT_DANGER)
-- return
-- end
-- if(not targetHole)then
-- Minigolf.Messages.Print("No target hole selected!", nil, TEXT_EFFECT_DANGER)
-- return
-- end
-- RunConsoleCommand("bet_place", (targetPlayer:AccountID() or player:UserID()), betAmount, expectedScore, targetHole:GetUniqueHoleName())
-- end
-- self.betButton = betButton
-- self:SetTall(PADDING + self.betButton:GetTall() + PADDING + self.userEntry:GetTall() + PADDING + self.amountEntry:GetTall() + PADDING + self.scoreEntry:GetTall() + PADDING + self.holeEntry:GetTall() + PADDING + infoLabel:GetTall() + PADDING + PADDING + BAR_HEIGHT)
-- self:Center()
-- end
-- function PANEL:Think()
-- local amount = tonumber(self.amountEntry:GetValue())
-- self.userEntry:SetEnabled(amount and amount > 0)
-- local _, user = self.userEntry:GetSelected()
-- self.holeEntry:SetEnabled(IsValid(user))
-- local _, hole = self.userEntry:GetSelected()
-- self.scoreEntry:SetEnabled(IsValid(hole))
-- self.betButton:SetEnabled(self.scoreEntry:IsEnabled())
-- end
-- function PANEL:Paint(w, h)
-- Derma_DrawBackgroundBlur(self, self.startTime)
-- draw.RoundedBox(16, 0, 0, w, h, Color(255,255,255,255))
-- draw.SimpleText("Place bets on upcoming players", "MinigolfMainBold", w * .5, PADDING * 2, COLOR_PRIMARY, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
-- end
-- function PANEL:OnKeyCodeReleased(key)
-- if(key == KEY_ESCAPE or (self:HasFocus() and key == MENU_KEY and CurTime() - self.startTime > 1))then
-- hideMenu()
-- gui.HideGameUI()
-- end
-- end
-- vgui.Register("Minigolf.BetMenu", PANEL, "EditablePanel")
|
-- Inofficial Planetshares BNP Paribas Extension (https://planetshares.bnpparibas.com/) for MoneyMoney (https://moneymoney-app.com)
--
-- MIT License
--
-- Copyright (c) 2018 Daniel Hähnel
--
-- 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, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
WebBanking{version = 0.02,
url = "https://planetshares.bnpparibas.com/ws/root",
services = {"Planetshares BNP Paribas"}
}
function SupportsBank (protocol, bankCode)
return protocol == ProtocolWebBanking and bankCode == "Planetshares BNP Paribas"
end
function InitializeSession (protocol, bankCode, username, username2, password)
connection = Connection()
content, charset, mimeType = connection:request("POST",url,'{"controllerName":"login","action":"authenticate","language":"de","parameters":{"loginEmet":"'..username..'","loginActi":"'..username2..'","pwd":"'..password..'"},"useragent":"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Mobile Safari/537.36"},"trads":[]}',"application/json")
json = JSON(string.sub(content,7)):dictionary()
if json["authenticated"] ~= true then
return {LoginFailed}
end
end
function ListAccounts (knownAccounts)
content, charset, mimeType = connection:request("POST",url,'{"controllerName":"information","action":"getContacts","language":"de","parameters":{},"trads":[]}',"application/json")
json = JSON(string.sub(content,7))
local account = {
name = "BNP Paribas Depot",
owner = json:dictionary()["parameters"]["contact"]["firstName"] .. " " .. json:dictionary()["parameters"]["contact"]["lastName"],
accountNumber = json:dictionary()["parameters"]["contact"]["accountNumber"],
portfolio = true,
bankCode = "",
currency = "EUR",
type = AccountTypePortfolio
}
return {account}
end
function RefreshAccount (account, since)
local s = {}
content, charset, mimeType = connection:request("POST",url,'{"controllerName":"avoir","action":"getAll","language":"de","parameters":{},"trads":[]}',"application/json")
json = JSON(string.sub(content,7)):dictionary()
for key, entry in pairs(json["parameters"]["shares"]["pes"]) do
s[key] = {
name = entry["columns"][2]["text"] .. " - " .. string.sub(entry["columns"][6]["text"],7),
isin = entry["columns"][1]["text"],
currency = nil,
quantity = entry["columns"][3]["text"],
amount = entry["columnsDetails"][8]["text"],
price = entry["columnsDetails"][7]["text"],
currencyOfPrice = "EUR",
purchasePrice = entry["columnsDetails"][4]["text"],
currencyOfPurchaasePrice = entry["columnsDetails"][4]["currency"],
tradeTimestamp = string.sub(entry["columnsDetails"][6]["date"],0,-4)
}
end
return {securities = s}
end
function EndSession ()
content, charset, mimeType = connection:request("POST",url,'{"controllerName":"login","action":"quit","language":"de","parameters":{},"trads":[]}',"application/json")
end
-- SIGNATURE: MCwCFA8uMXbacQ0AOL3LFYyxj5j37AmwAhRd9drJF5UoKi6cQTgmnwTVZMBIvA==
|
local S, L, O, U, D, E = unpack(select(2, ...));
local Module = S:NewNameplateModule('AbsorbBar');
-- Stripes API
local ShortValue = U.ShortValue;
local UpdateFontObject = S:GetNameplateModule('Handler').UpdateFontObject;
-- Local config
local ENABLED, AT_TOP;
local ABSORB_TEXT_ENABLED, ABSORB_TEXT_COLOR, ABSORB_TEXT_ANCHOR, ABSORB_TEXT_X_OFFSET, ABSORB_TEXT_Y_OFFSET;
local BACKDROP = {
edgeFile = 'Interface\\Buttons\\WHITE8x8',
insets = { top = 1, left = 1, bottom = 1, right = 1 },
edgeSize = 1,
};
local FRAME_POINTS_SIMPLE = O.Lists.frame_points_simple;
local StripesAbsorbTextFont = CreateFont('StripesAbsorbTextFont');
local function Create(unitframe)
if unitframe.AbsorbBar then
return;
end
local absorbBar = CreateFrame('StatusBar', '$parentAbsorbBar', unitframe.healthBar, 'BackdropTemplate');
absorbBar:SetAllPoints(unitframe.healthBar);
absorbBar:SetBackdrop(BACKDROP);
absorbBar:SetBackdropBorderColor(0.3, 0.3, 0.3, 0);
absorbBar.t = absorbBar:CreateTexture(nil, 'ARTWORK');
absorbBar.t:SetTexture('Interface\\RaidFrame\\Shield-Fill', 'REPEAT', 'REPEAT');
absorbBar.t:SetAlpha(0.65);
absorbBar.t:SetHorizTile(true);
absorbBar.t:SetVertTile(true);
absorbBar.overlay = absorbBar:CreateTexture(nil, 'OVERLAY');
absorbBar.overlay:SetAllPoints(absorbBar.t);
absorbBar.overlay:SetTexture('Interface\\RaidFrame\\Shield-Overlay', 'REPEAT', 'REPEAT');
absorbBar.overlay:SetHorizTile(true);
absorbBar.overlay:SetVertTile(true);
absorbBar.overlay.tileSize = 32;
if AT_TOP then
absorbBar:ClearAllPoints();
PixelUtil.SetPoint(absorbBar, 'BOTTOMLEFT', unitframe.healthBar, 'TOPLEFT', -0.5, 0);
PixelUtil.SetPoint(absorbBar, 'BOTTOMRIGHT', unitframe.healthBar, 'TOPRIGHT', 0.5, 0);
absorbBar:SetBackdropBorderColor(0.3, 0.3, 0.3, 1);
PixelUtil.SetHeight(absorbBar, 2);
end
absorbBar:SetStatusBarTexture(absorbBar.t);
absorbBar:SetValue(0);
absorbBar:SetShown(false);
local absorbText = CreateFrame('Frame', '$parentAbsorbText', unitframe.healthBar);
absorbText:SetAllPoints(unitframe.healthBar);
absorbText.text = absorbText:CreateFontString(nil, 'OVERLAY', 'StripesAbsorbTextFont');
PixelUtil.SetPoint(absorbText.text, ABSORB_TEXT_ANCHOR, absorbText, ABSORB_TEXT_ANCHOR, ABSORB_TEXT_X_OFFSET, ABSORB_TEXT_Y_OFFSET);
absorbText.text:SetTextColor(ABSORB_TEXT_COLOR[1], ABSORB_TEXT_COLOR[2], ABSORB_TEXT_COLOR[3], ABSORB_TEXT_COLOR[4]);
absorbText:SetShown(false);
unitframe.AbsorbBar = absorbBar;
unitframe.AbsorbText = absorbText;
end
local function Update(unitframe)
if not unitframe:IsShown() then
return;
end
if unitframe.data.unitType == 'SELF' then
unitframe.AbsorbBar:SetShown(false);
return;
end
if not ENABLED then
return;
end
unitframe.overAbsorbGlow:SetShown(false);
unitframe.totalAbsorb:SetShown(false);
unitframe.totalAbsorbOverlay:SetShown(false);
local absorbAmount = unitframe.data.absorbAmount;
if unitframe.data.healthMax > 0 and absorbAmount > 0 then
unitframe.AbsorbBar:SetMinMaxValues(0, unitframe.data.healthMax);
unitframe.AbsorbBar:SetValue(absorbAmount);
unitframe.AbsorbBar:SetShown(true);
if not AT_TOP then
unitframe.AbsorbBar:ClearAllPoints();
if (unitframe.data.healthMax - unitframe.data.healthCurrent) >= absorbAmount then
unitframe.AbsorbBar:SetAllPoints(unitframe.totalAbsorb);
unitframe.AbsorbBar.t:SetAlpha(0.85);
else
unitframe.AbsorbBar:SetAllPoints(unitframe.healthBar);
unitframe.AbsorbBar.t:SetAlpha(0.65);
end
end
if ABSORB_TEXT_ENABLED then
unitframe.AbsorbText.text:SetText(ShortValue(absorbAmount));
unitframe.AbsorbText:SetShown(true);
else
unitframe.AbsorbText:SetShown(false);
end
else
unitframe.AbsorbBar:SetValue(0);
unitframe.AbsorbBar:SetShown(false);
unitframe.AbsorbText:SetShown(false);
end
end
local function UpdateShow(unitframe)
unitframe.AbsorbBar:SetShown(ENABLED and unitframe.AbsorbBar:GetValue() ~= 0 and unitframe.data.unitType ~= 'SELF');
unitframe.AbsorbText:SetShown(ABSORB_TEXT_ENABLED and unitframe.AbsorbBar:GetValue() ~= 0 and unitframe.data.unitType ~= 'SELF');
end
local function UpdateStyle(unitframe)
unitframe.AbsorbBar:ClearAllPoints();
if not AT_TOP then
unitframe.AbsorbBar:SetAllPoints(unitframe.healthBar);
unitframe.AbsorbBar:SetBackdropBorderColor(0.3, 0.3, 0.3, 0);
else
PixelUtil.SetPoint(unitframe.AbsorbBar, 'BOTTOMLEFT', unitframe.healthBar, 'TOPLEFT', -0.5, 0);
PixelUtil.SetPoint(unitframe.AbsorbBar, 'BOTTOMRIGHT', unitframe.healthBar, 'TOPRIGHT', 0.5, 0);
unitframe.AbsorbBar:SetBackdropBorderColor(0.3, 0.3, 0.3, 1);
PixelUtil.SetHeight(unitframe.AbsorbBar, 2);
end
unitframe.AbsorbText.text:ClearAllPoints();
PixelUtil.SetPoint(unitframe.AbsorbText.text, ABSORB_TEXT_ANCHOR, unitframe.AbsorbText, ABSORB_TEXT_ANCHOR, ABSORB_TEXT_X_OFFSET, ABSORB_TEXT_Y_OFFSET);
unitframe.AbsorbText.text:SetTextColor(ABSORB_TEXT_COLOR[1], ABSORB_TEXT_COLOR[2], ABSORB_TEXT_COLOR[3], ABSORB_TEXT_COLOR[4]);
end
function Module:UnitAdded(unitframe)
Create(unitframe);
Update(unitframe);
end
function Module:UnitRemoved(unitframe)
if unitframe.AbsorbBar then
unitframe.AbsorbBar:SetShown(false);
end
end
function Module:Update(unitframe)
Update(unitframe);
UpdateStyle(unitframe);
UpdateShow(unitframe);
end
function Module:UpdateLocalConfig()
ENABLED = O.db.absorb_bar_enabled;
AT_TOP = O.db.absorb_bar_at_top;
ABSORB_TEXT_ENABLED = O.db.absorb_text_enabled;
ABSORB_TEXT_ANCHOR = FRAME_POINTS_SIMPLE[O.db.absorb_text_anchor];
ABSORB_TEXT_X_OFFSET = O.db.absorb_text_x_offset;
ABSORB_TEXT_Y_OFFSET = O.db.absorb_text_y_offset;
ABSORB_TEXT_COLOR = ABSORB_TEXT_COLOR or {};
ABSORB_TEXT_COLOR[1] = O.db.absorb_text_color[1];
ABSORB_TEXT_COLOR[2] = O.db.absorb_text_color[2];
ABSORB_TEXT_COLOR[3] = O.db.absorb_text_color[3];
ABSORB_TEXT_COLOR[4] = O.db.absorb_text_color[4] or 1;
UpdateFontObject(StripesAbsorbTextFont, O.db.absorb_text_font_value, O.db.absorb_text_font_size, O.db.absorb_text_font_flag, O.db.absorb_text_font_shadow);
end
function Module:StartUp()
self:UpdateLocalConfig();
self:SecureUnitFrameHook('CompactUnitFrame_UpdateHealPrediction', Update);
end
|
local Clock = class("Clock",function()
return cc.Node:create()
end)
function Clock:ctor(data)
self.m_time = data and data.time
self.m_time = 15
self:initView()
-- self:countDown()
end
function Clock:initView()
self.m_bg = display.newSprite("Images/clock/clock_default.png")
self.m_bg:setPosition(display.cx,display.cy)
self:addChild(self.m_bg)
local contentSize = self.m_bg:getContentSize()
self.m_timeTxt = cc.LabelTTF:create("", "Arial", 20)
self.m_timeTxt:setColor(cc.c3b(255, 220, 94))
self.m_timeTxt:setPosition(cc.p(contentSize.width/2,contentSize.height/2))
self.m_bg:addChild(self.m_timeTxt)
end
function Clock:countDown()
local cc = self.m_time
schedule(self.m_timeTxt,function()
cc = cc - 1
self.m_timeTxt:setString(cc)
end,1)
end
return Clock
|
-----------------------------------
-- Area: Sea Serpent Grotto
-- NM: Yarr the Pearleyed
-----------------------------------
mixins = {require("scripts/mixins/job_special")}
-----------------------------------
function onMobSpawn(mob)
tpz.mix.jobSpecial.config(mob, {
specials =
{
{id = tpz.jsa.BENEDICTION, hpp = math.random(1, 50)} -- "Uses Benediction at around 50% or as low as 1%"
}
})
end
function onMobDeath(mob, player, isKiller)
end
|
item_moon_custom = class({})
LinkLuaModifier("modifier_item_moon_custom", "items/item_moon_custom/modifier_item_moon_custom", LUA_MODIFIER_MOTION_HORIZONTAL)
function item_moon_custom:GetIntrinsicModifierName()
return "modifier_item_moon_custom"
end
|
-- Submodule for node related operations.
local network = require 'concurrent.distributed.network'
local concurrent
local node = {}
node.nodemonitors = {} -- Nodes monitoring the node.
-- Returns the node's name.
function node.node()
return network.nodename
end
-- Returns a table with the names of the nodes that the node is connected to.
function node.nodes()
local t = {}
for k, _ in pairs(network.connections) do table.insert(t, k) end
return t
end
-- Returns a true if the node has been initialized or false otherwise.
function node.isnodealive()
concurrent = concurrent or require 'concurrent'
return concurrent.node() ~= nil
end
-- Starts monitoring the specified node.
function node.monitornode(name)
concurrent = concurrent or require 'concurrent'
local s = concurrent.self()
if not node.nodemonitors[s] then node.nodemonitors[s] = {} end
table.insert(node.nodemonitors[s], name)
end
-- Stops monitoring the specified node.
function node.demonitornode(name)
concurrent = concurrent or require 'concurrent'
local s = concurrent.self()
if not node.nodemonitors[s] then return end
for k, v in pairs(node.nodemonitors[s]) do
if name == v then table.remove(node.nodemonitors[s], k) end
end
end
-- Notifies all the monitoring processes about the status change of a node.
function node.notify_all(deadnode)
for k, v in pairs(node.nodemonitors) do
for l, w in pairs(v) do
if w == deadnode then node.notify(k, w, 'noconnection') end
end
end
end
-- Notifies a single process about the status of a node.
function node.notify(dest, deadnode, reason)
concurrent = concurrent or require 'concurrent'
concurrent.send(dest, { signal = 'NODEDOWN',
from = { dead, concurrent.node() },
reason = reason })
end
-- Monitoring processes should be notified when the connection with a node is
-- lost.
table.insert(network.onfailure, node.notify_all)
return node
|
--
-- prop_generic is the base for all other properties.
-- All the business should be done in :Setup using inline functions.
-- So when you derive from this class - you should ideally only override Setup.
--
local PANEL = {}
function PANEL:Init()
end
function PANEL:Setup( vars )
self:Clear()
local ctrl = self:Add( "DCheckBox" )
ctrl:SetPos( 0, 2 )
-- Return true if we're editing
self.IsEditing = function( self )
return ctrl:IsEditing()
end
-- Set the value
self.SetValue = function( self, val )
ctrl:SetChecked( tobool( val ) )
end
-- Alert row that value changed
ctrl.OnChange = function( ctrl, newval )
if ( newval ) then newval = 1 else newval = 0 end
self:ValueChanged( newval )
end
end
derma.DefineControl( "DProperty_Boolean", "", PANEL, "DProperty_Generic" )
|
local AddonName, AddonTable = ...
AddonTable.cloth = {
152576, -- Tidespray Linen (Common)
152577, -- Deep Sea Satin (Uncommon)
158378, -- Embroidered Deep Sea Satin (Rare)
167738, -- Gilded Silkweave (Uncommon)
-- Vendor Bought
159959, -- Nylon Thread
}
|
print('awtTest starts')
frame = luajava.newInstance("java.awt.Frame", "Lua Java Console")
console = luajava.newInstance("java.awt.TextArea")
buttons_pn = luajava.newInstance("java.awt.Panel")
execute_bt = luajava.newInstance("java.awt.Button", "Execute")
clear_bt = luajava.newInstance("java.awt.Button", "Clear")
exit_bt = luajava.newInstance("java.awt.Button", "Exit")
frame:setSize(600,300)
buttons_pn:add(execute_bt)
buttons_pn:add(clear_bt)
buttons_pn:add(exit_bt)
BorderLayout = luajava.bindClass("java.awt.BorderLayout")
frame:add(BorderLayout.NORTH, console)
frame:add(BorderLayout.SOUTH, buttons_pn)
frame:pack()
--frame:setVisible(true)
frame:show()
print('frame should be visible now')
--
-- Listeners
--
cor=coroutine.wrap(function()
for i=1,100 do
coroutine.yield('result#'..i)
print('yield returned')
local s=console:getText()
print('called get text:',s)
pcall(loadstring(s))
end
end)
cor()
execute_cb = {
actionPerformed = function(ev)
print("execute")
local a=cor(console:getText())
print('execute got:',a)
end
}
jproxy = luajava.createProxy("java.awt.event.ActionListener",execute_cb)
execute_bt:addActionListener(jproxy)
clear_cb = {actionPerformed= function (ev)
print("clear");
console:setText("");
end
}
jproxy = luajava.createProxy("java.awt.event.ActionListener" ,clear_cb)
clear_bt:addActionListener(jproxy)
exit_cb = { actionPerformed=function (ev)
print("exit")
frame:setVisible(false)
frame:dispose()
end
}
jproxyb = luajava.createProxy("java.awt.event.ActionListener" ,exit_cb)
exit_bt:addActionListener(jproxyb)
close_cb = { }
function close_cb.windowClosing(ev)
print("close")
frame:setVisible(false)
frame:dispose()
end
function close_cb.windowActivated(ev)
print("act")
end
jproxy = luajava.createProxy("java.awt.event.WindowListener", close_cb)
frame:addWindowListener(jproxy)
print('awtest endl of src')
|
local DISCORD_WEBHOOK5 = "https://discordapp.com/api/webhooks/832764259422175252/y6wwkLlTTCYrJR8sWIIkm55YakZdCawS92u1d_KgpahBcExHDJe9XGbq3y1EzFQ_FKCf"
local DISCORD_NAME5 = "Mission Finished Logs"
local STEAM_KEY = "0C007CC382AB06D1D99D9B45EC3924B1"
local DISCORD_IMAGE = "https://i.imgur.com/zviw6oW.png" -- Default is FiveM logo.
PerformHttpRequest(DISCORD_WEBHOOK5, function(err, text, headers) end, 'POST', json.encode({username = DISCORD_NAME5, avatar_url = DISCORD_IMAGE}), { ['Content-Type'] = 'application/json' })
RegisterServerEvent('mission:finished')
AddEventHandler('mission:finished', function(money)
local src = source
local player = GetPlayerName(src)
local user = exports["npc-core"]:getModule("Player"):GetUser(src)
if money ~= nil then
user:addMoney(money)
if money > 110 then
sendToDiscord5("Mission Finished Logs", "Player ID: ".. src ..", Steam: ".. player ..", Just Received $".. money .." From Mission Finished Event.")
end
end
end)
local counter = 0
RegisterServerEvent('delivery:status')
AddEventHandler('delivery:status', function(status)
if status == -1 then
counter = 0
elseif status == 1 then
counter = 2
end
TriggerClientEvent('delivery:deliverables', -1, counter, math.random(1,13))
end)
function sendToDiscord5(name, message, color)
local connect = {
{
["color"] = color,
["title"] = "**".. name .."**",
["description"] = message,
}
}
PerformHttpRequest(DISCORD_WEBHOOK5, function(err, text, headers) end, 'POST', json.encode({username = DISCORD_NAME5, embeds = connect, avatar_url = DISCORD_IMAGE}), { ['Content-Type'] = 'application/json' })
end
|
----
-- @file AbstractObject
---- Brief description.
-- <#Description#>
-- @return <#return value description#>
function AbstractObject:getClassName()
end
---- Brief description.
-- <#Description#>
-- @return <#return value description#>
function AbstractObject:getType()
end
|
require 'image'
local iproc = require 'iproc'
local srcnn = require 'srcnn'
local function reconstruct_nn(model, x, inner_scale, offset, block_size, batch_size)
batch_size = batch_size or 1
if x:dim() == 2 then
x = x:reshape(1, x:size(1), x:size(2))
end
local ch = x:size(1)
local new_x = torch.Tensor(x:size(1), x:size(2) * inner_scale, x:size(3) * inner_scale):zero()
local input_block_size = block_size
local output_block_size = block_size * inner_scale
local output_size = output_block_size - offset * 2
local output_size_in_input = input_block_size - math.ceil(offset / inner_scale) * 2
local input_indexes = {}
local output_indexes = {}
for i = 1, x:size(2), output_size_in_input do
for j = 1, x:size(3), output_size_in_input do
if i + input_block_size - 1 <= x:size(2) and j + input_block_size - 1 <= x:size(3) then
local index = {{},
{i, i + input_block_size - 1},
{j, j + input_block_size - 1}}
local ii = (i - 1) * inner_scale + 1
local jj = (j - 1) * inner_scale + 1
local output_index = {{}, { ii , ii + output_size - 1 },
{ jj, jj + output_size - 1}}
table.insert(input_indexes, index)
table.insert(output_indexes, output_index)
end
end
end
local input = torch.Tensor(batch_size, ch, input_block_size, input_block_size)
local input_cuda = torch.CudaTensor(batch_size, ch, input_block_size, input_block_size)
for i = 1, #input_indexes, batch_size do
local c = 0
local output
for j = 0, batch_size - 1 do
if i + j > #input_indexes then
break
end
input[j+1]:copy(x[input_indexes[i + j]])
c = c + 1
end
input_cuda:copy(input)
if c == batch_size then
output = model:forward(input_cuda)
else
output = model:forward(input_cuda:narrow(1, 1, c))
end
--output = output:view(batch_size, ch, output_size, output_size)
for j = 0, c - 1 do
new_x[output_indexes[i + j]]:copy(output[j+1])
end
end
return new_x
end
local reconstruct = {}
function reconstruct.is_rgb(model)
if srcnn.channels(model) == 3 then
-- 3ch RGB
return true
else
-- 1ch Y
return false
end
end
function reconstruct.offset_size(model)
return srcnn.offset_size(model)
end
function reconstruct.has_resize(model)
return srcnn.scale_factor(model) > 1
end
function reconstruct.inner_scale(model)
return srcnn.scale_factor(model)
end
local function padding_params(x, model, block_size)
local p = {}
local offset = reconstruct.offset_size(model)
p.x_w = x:size(3)
p.x_h = x:size(2)
p.inner_scale = reconstruct.inner_scale(model)
local input_offset = math.ceil(offset / p.inner_scale)
local input_block_size = block_size
local process_size = input_block_size - input_offset * 2
local h_blocks = math.floor(p.x_h / process_size) +
((p.x_h % process_size == 0 and 0) or 1)
local w_blocks = math.floor(p.x_w / process_size) +
((p.x_w % process_size == 0 and 0) or 1)
local h = (h_blocks * process_size) + input_offset * 2
local w = (w_blocks * process_size) + input_offset * 2
p.pad_h1 = input_offset
p.pad_w1 = input_offset
p.pad_h2 = (h - input_offset) - p.x_h
p.pad_w2 = (w - input_offset) - p.x_w
return p
end
function reconstruct.image_y(model, x, offset, block_size, batch_size)
block_size = block_size or 128
local p = padding_params(x, model, block_size)
x = iproc.padding(x, p.pad_w1, p.pad_w2, p.pad_h1, p.pad_h2)
x = x:cuda()
x = image.rgb2yuv(x)
local y = reconstruct_nn(model, x[1], p.inner_scale, offset, block_size, batch_size)
x = iproc.crop(x, p.pad_w1, p.pad_h1, p.pad_w1 + p.x_w, p.pad_h1 + p.x_h)
y = iproc.crop(y, 0, 0, p.x_w, p.x_h):clamp(0, 1)
x[1]:copy(y)
local output = image.yuv2rgb(x):clamp(0, 1):float()
x = nil
y = nil
collectgarbage()
return output
end
function reconstruct.scale_y(model, scale, x, offset, block_size, batch_size)
block_size = block_size or 128
local x_lanczos
if reconstruct.has_resize(model) then
x_lanczos = iproc.scale(x, x:size(3) * scale, x:size(2) * scale, "Lanczos")
else
x_lanczos = iproc.scale(x, x:size(3) * scale, x:size(2) * scale, "Lanczos")
x = iproc.scale(x, x:size(3) * scale, x:size(2) * scale, "Box")
end
local p = padding_params(x, model, block_size)
if p.x_w * p.x_h > 2048*2048 then
collectgarbage()
end
x = iproc.padding(x, p.pad_w1, p.pad_w2, p.pad_h1, p.pad_h2)
x = x:cuda()
x = image.rgb2yuv(x)
x_lanczos = image.rgb2yuv(x_lanczos)
local y = reconstruct_nn(model, x[1], p.inner_scale, offset, block_size, batch_size)
y = iproc.crop(y, 0, 0, p.x_w * p.inner_scale, p.x_h * p.inner_scale):clamp(0, 1)
x_lanczos[1]:copy(y)
local output = image.yuv2rgb(x_lanczos:cuda()):clamp(0, 1):float()
x = nil
x_lanczos = nil
y = nil
collectgarbage()
return output
end
function reconstruct.image_rgb(model, x, offset, block_size, batch_size)
block_size = block_size or 128
local p = padding_params(x, model, block_size)
x = iproc.padding(x, p.pad_w1, p.pad_w2, p.pad_h1, p.pad_h2)
if p.x_w * p.x_h > 2048*2048 then
collectgarbage()
end
local y = reconstruct_nn(model, x, p.inner_scale, offset, block_size, batch_size)
local output = iproc.crop(y, 0, 0, p.x_w, p.x_h):clamp(0, 1)
x = nil
y = nil
collectgarbage()
return output
end
function reconstruct.scale_rgb(model, scale, x, offset, block_size, batch_size)
block_size = block_size or 128
if not reconstruct.has_resize(model) then
x = iproc.scale(x, x:size(3) * scale, x:size(2) * scale, "Box")
end
local p = padding_params(x, model, block_size)
x = iproc.padding(x, p.pad_w1, p.pad_w2, p.pad_h1, p.pad_h2)
if p.x_w * p.x_h > 2048*2048 then
collectgarbage()
end
local y
y = reconstruct_nn(model, x, p.inner_scale, offset, block_size, batch_size)
local output = iproc.crop(y, 0, 0, p.x_w * p.inner_scale, p.x_h * p.inner_scale):clamp(0, 1)
x = nil
y = nil
collectgarbage()
return output
end
function reconstruct.image(model, x, block_size)
local i2rgb = false
if x:size(1) == 1 then
local new_x = torch.Tensor(3, x:size(2), x:size(3))
new_x[1]:copy(x)
new_x[2]:copy(x)
new_x[3]:copy(x)
x = new_x
i2rgb = true
end
if reconstruct.is_rgb(model) then
x = reconstruct.image_rgb(model, x,
reconstruct.offset_size(model), block_size)
else
x = reconstruct.image_y(model, x,
reconstruct.offset_size(model), block_size)
end
if i2rgb then
x = image.rgb2y(x)
end
return x
end
function reconstruct.scale(model, scale, x, block_size)
local i2rgb = false
if x:size(1) == 1 then
local new_x = torch.Tensor(3, x:size(2), x:size(3))
new_x[1]:copy(x)
new_x[2]:copy(x)
new_x[3]:copy(x)
x = new_x
i2rgb = true
end
if reconstruct.is_rgb(model) then
x = reconstruct.scale_rgb(model, scale, x,
reconstruct.offset_size(model),
block_size)
else
x = reconstruct.scale_y(model, scale, x,
reconstruct.offset_size(model),
block_size)
end
if i2rgb then
x = image.rgb2y(x)
end
return x
end
local function tr_f(a)
return a:transpose(2, 3):contiguous()
end
local function itr_f(a)
return a:transpose(2, 3):contiguous()
end
local augmented_patterns = {
{
forward = function (a) return a end,
backward = function (a) return a end
},
{
forward = function (a) return image.hflip(a) end,
backward = function (a) return image.hflip(a) end
},
{
forward = function (a) return image.vflip(a) end,
backward = function (a) return image.vflip(a) end
},
{
forward = function (a) return image.hflip(image.vflip(a)) end,
backward = function (a) return image.vflip(image.hflip(a)) end
},
{
forward = function (a) return tr_f(a) end,
backward = function (a) return itr_f(a) end
},
{
forward = function (a) return image.hflip(tr_f(a)) end,
backward = function (a) return itr_f(image.hflip(a)) end
},
{
forward = function (a) return image.vflip(tr_f(a)) end,
backward = function (a) return itr_f(image.vflip(a)) end
},
{
forward = function (a) return image.hflip(image.vflip(tr_f(a))) end,
backward = function (a) return itr_f(image.vflip(image.hflip(a))) end
}
}
local function get_augmented_patterns(n)
if n == 1 then
-- no tta
return {augmented_patterns[1]}
elseif n == 2 then
return {augmented_patterns[1], augmented_patterns[5]}
elseif n == 4 then
return {augmented_patterns[1], augmented_patterns[5],
augmented_patterns[2], augmented_patterns[7]}
elseif n == 8 then
return augmented_patterns
else
error("unsupported TTA level: " .. n)
end
end
local function tta(f, n, model, x, block_size)
local average = nil
local offset = reconstruct.offset_size(model)
local augments = get_augmented_patterns(n)
for i = 1, #augments do
local out = augments[i].backward(f(model, augments[i].forward(x), offset, block_size))
if not average then
average = out
else
average:add(out)
end
end
return average:div(#augments)
end
function reconstruct.image_tta(model, n, x, block_size)
if reconstruct.is_rgb(model) then
return tta(reconstruct.image_rgb, n, model, x, block_size)
else
return tta(reconstruct.image_y, n, model, x, block_size)
end
end
function reconstruct.scale_tta(model, n, scale, x, block_size)
if reconstruct.is_rgb(model) then
local f = function (model, x, offset, block_size)
return reconstruct.scale_rgb(model, scale, x, offset, block_size)
end
return tta(f, n, model, x, block_size)
else
local f = function (model, x, offset, block_size)
return reconstruct.scale_y(model, scale, x, offset, block_size)
end
return tta(f, n, model, x, block_size)
end
end
return reconstruct
|
local superblt = false
for _, mod in pairs(BLT and BLT.Mods:Mods() or {}) do
if mod:GetName() == "SuperBLT" and mod:IsEnabled() then
superblt = true
break
end
end
if superblt == false then
if UpdateThisMod then
UpdateThisMod:Add(
{
mod_id = "Real Weapon Names",
data = {
modworkshop_id = 19958,
dl_url = "https://raw.githubusercontent.com/Strappazzon/PD2-Real-Weapon-Names/master/RWN.zip",
info_url = "https://raw.githubusercontent.com/Strappazzon/PD2-Real-Weapon-Names/master/mod.txt"
}
}
)
end
end
|
object_mobile_som_som_pwwoz_pwwa = object_mobile_som_shared_som_pwwoz_pwwa:new {
}
ObjectTemplates:addTemplate(object_mobile_som_som_pwwoz_pwwa, "object/mobile/som/som_pwwoz_pwwa.iff")
|
local middleclass = {
_VERSION = 'middleclass v3.0.0',
_DESCRIPTION = 'Object Orientation for Lua',
_LICENSE = [[
MIT LICENSE
Copyright (c) 2011 Enrique García Cota
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, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
]]
--Maurice here; I renamed initialize to init for my use. Just so you know.
}
local function _setClassDictionariesMetatables(aClass)
local dict = aClass.__instanceDict
dict.__index = dict
local super = aClass.super
if super then
local superStatic = super.static
setmetatable(dict, super.__instanceDict)
setmetatable(aClass.static, { __index = function(_,k) return dict[k] or superStatic[k] end })
else
setmetatable(aClass.static, { __index = function(_,k) return dict[k] end })
end
end
local function _setClassMetatable(aClass)
setmetatable(aClass, {
__tostring = function() return "class " .. aClass.name end,
__index = aClass.static,
__newindex = aClass.__instanceDict,
__call = function(self, ...) return self:new(...) end
})
end
local function _createClass(name, super)
local aClass = { name = name, super = super, static = {}, __mixins = {}, __instanceDict={} }
aClass.subclasses = setmetatable({}, {__mode = "k"})
_setClassDictionariesMetatables(aClass)
_setClassMetatable(aClass)
return aClass
end
local function _createLookupMetamethod(aClass, name)
return function(...)
local method = aClass.super[name]
assert( type(method)=='function', tostring(aClass) .. " doesn't implement metamethod '" .. name .. "'" )
return method(...)
end
end
local function _setClassMetamethods(aClass)
for _,m in ipairs(aClass.__metamethods) do
aClass[m]= _createLookupMetamethod(aClass, m)
end
end
local function _setDefaultInitializeMethod(aClass, super)
aClass.init = function(instance, ...)
return super.init(instance, ...)
end
end
local function _includeMixin(aClass, mixin)
assert(type(mixin)=='table', "mixin must be a table")
for name,method in pairs(mixin) do
if name ~= "included" and name ~= "static" then aClass[name] = method end
end
if mixin.static then
for name,method in pairs(mixin.static) do
aClass.static[name] = method
end
end
if type(mixin.included)=="function" then mixin:included(aClass) end
aClass.__mixins[mixin] = true
end
local Object = _createClass("Object", nil)
Object.static.__metamethods = { '__add', '__call', '__concat', '__div', '__le', '__lt',
'__mod', '__mul', '__pow', '__sub', '__tostring', '__unm' }
function Object.static:allocate()
assert(type(self) == 'table', "Make sure that you are using 'Class:allocate' instead of 'Class.allocate'")
return setmetatable({ class = self }, self.__instanceDict)
end
function Object.static:new(...)
local instance = self:allocate()
instance:init(...)
return instance
end
function Object.static:subclass(name)
assert(type(self) == 'table', "Make sure that you are using 'Class:subclass' instead of 'Class.subclass'")
assert(type(name) == "string", "You must provide a name(string) for your class")
local subclass = _createClass(name, self)
_setClassMetamethods(subclass)
_setDefaultInitializeMethod(subclass, self)
self.subclasses[subclass] = true
self:subclassed(subclass)
return subclass
end
function Object.static:subclassed(other) end
function Object.static:isSubclassOf(other)
return type(other) == 'table' and
type(self) == 'table' and
type(self.super) == 'table' and
( self.super == other or
type(self.super.isSubclassOf) == 'function' and
self.super:isSubclassOf(other)
)
end
function Object.static:include( ... )
assert(type(self) == 'table', "Make sure you that you are using 'Class:include' instead of 'Class.include'")
for _,mixin in ipairs({...}) do _includeMixin(self, mixin) end
return self
end
function Object.static:includes(mixin)
return type(mixin) == 'table' and
type(self) == 'table' and
type(self.__mixins) == 'table' and
( self.__mixins[mixin] or
type(self.super) == 'table' and
type(self.super.includes) == 'function' and
self.super:includes(mixin)
)
end
function Object:init() end
function Object:__tostring() return "instance of " .. tostring(self.class) end
function Object:isInstanceOf(aClass)
return type(self) == 'table' and
type(self.class) == 'table' and
type(aClass) == 'table' and
( aClass == self.class or
type(aClass.isSubclassOf) == 'function' and
self.class:isSubclassOf(aClass)
)
end
function middleclass.class(name, super, ...)
super = super or Object
return super:subclass(name, ...)
end
middleclass.Object = Object
setmetatable(middleclass, { __call = function(_, ...) return middleclass.class(...) end })
return middleclass
|
return "success"
|
Config = {}
Config.MarkerSize = { x = 1.5, y = 1.5, z = 1.2 }
Config.MarkerColor = { r = 0, g = 130, b = 204 }
Config.MainMenu = {
{x = 1678.48, y = 39.81, z = 161.76}
}
Config.Sell = {
{x = 1088.750, y = -776.566, z = 58.439}
}
Config.GetVehicle = {
{x = 1692.65, y = 41.43, z = 161.77}
}
Config.StoreVehicle = {
{x = 1686.64, y = 9.9, z = 159.7}
}
|
data:extend{
{
type = 'custom-input',
name = 'cuc-cycle-forwards',
key_sequence = '',
linked_game_control = 'cycle-blueprint-forwards'
},
{
type = 'custom-input',
name = 'cuc-cycle-backwards',
key_sequence = '',
linked_game_control = 'cycle-blueprint-backwards'
}
}
|
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
description 'ESX Voice Controller'
version '1.1.0'
ui_page 'ui.html'
files {
'ui.html',
}
client_scripts {
'@es_extended/locale.lua',
'locales/en.lua',
'locales/fi.lua',
'locales/pl.lua',
'locales/sv.lua',
'config.lua',
'client/main.lua'
}
|
-- Simple example for responding to NMRA DCC commands
-- author @voborsky
local PIN = 2 -- GPIO4
local addr = 0x12a
local CV = {[29]=0,
[1]=bit.band(addr, 0x3f), --CV_ACCESSORY_DECODER_ADDRESS_LSB (6 bits)
[9]=bit.band(bit.rshift(addr,6), 0x7) --CV_ACCESSORY_DECODER_ADDRESS_MSB (3 bits)
}
local function deepcopy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[deepcopy(orig_key)] = deepcopy(orig_value)
end
setmetatable(copy, deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
local cmd_last
local params_last
local function is_new(cmd, params)
if cmd ~= cmd_last then return true end
for i,j in pairs(params) do
if params_last[i] ~= j then return true end
end
return false
end
local function DCC_command(cmd, params)
if not is_new(cmd, params) then return end
if cmd == dcc.DCC_IDLE then
return
elseif cmd == dcc.DCC_TURNOUT then
print("Turnout command")
elseif cmd == dcc.DCC_SPEED then
print("Speed command")
elseif cmd == dcc.DCC_FUNC then
print("Function command")
else
print("Other command", cmd)
end
for i,j in pairs(params) do
print(i, j)
end
print(("="):rep(80))
cmd_last = cmd
params_last = deepcopy(params)
end
local function CV_callback(operation, param)
local oper = ""
local result
if operation == dcc.CV_WRITE then
oper = "Write"
CV[param.CV]=param.Value
elseif operation == dcc.CV_READ then
oper = "Read"
result = CV[param.CV]
elseif operation == dcc.CV_VALID then
oper = "Valid"
result = 1
elseif operation == dcc.CV_RESET then
oper = "Reset"
CV = {}
end
print(("[CV_callback] %s CV %d%s")
:format(oper, param.CV, param.Value and "\tValue: "..param.Value or "\tValue: nil"))
return result
end
dcc.setup(PIN,
DCC_command,
dcc.MAN_ID_DIY, 1,
-- Accessories (turnouts) decoder:
--bit.bor(dcc.FLAGS_AUTO_FACTORY_DEFAULT, dcc.FLAGS_DCC_ACCESSORY_DECODER, dcc.FLAGS_MY_ADDRESS_ONLY),
-- Cab (train) decoder
bit.bor(dcc.FLAGS_AUTO_FACTORY_DEFAULT),
0, -- ???
CV_callback)
|
require 'nn'
require 'rnn'
require 'image'
require 'optim'
require 'loader'
opts = {
gpu = false,
dropout_rate = 0.4,
input_size = 64,
hidden_size = 400,
learning_rate = 1e-4,
momentum = 0.9
}
local class_num = 100
local net = nn.Sequential()
net:add(nn.Dropout(DROPOUT_RATE))
net:add(nn.SplitTable(1))
net:add(nn.BiSequencer(nn.LSTM(opts.input_size, opts.hidden_size)))
net:add(nn.BiSequencer(nn.LSTM(opts.hidden_size * 2, opts.hidden_size)))
output = nn.Sequential()
output:add(nn.Linear(opts.hidden_size * 2, class_num + 1))
output:add(nn.SoftMax())
net:add(nn.Sequencer(output))
if opts.gpu then
require 'cutorch'
require 'cunn'
net:cuda()
cutorch.setDevice(1)
cutorch.manualSeed(450)
else
torch.manualSeed(450)
end
timer = torch.Timer()
im = torch.randn(64, 64)
if opts.gpu then
im = im:cuda()
end
base = timer:time().real
outputTable = net:forward(im)
print(timer:time().real - base)
ims = {}
for i = 1, 10 do
table.insert(ims, torch.randn(64 * i, 64))
end
if opts.gpu then
for i = 1, 10 do
ims[i] = ims[i]:cuda()
end
end
base = timer:time().real
last = base
for i = 1, 10 do
outputTable = net:forward(ims[i])
last = timer:time().real
end
base = last
for i = 1, 10 do
outputTable = net:forward(ims[i])
print((timer:time().real - last))
last = timer:time().real
end
print(last - base)
|
--[[ DecoderAdvancer is an implementation of the interface Advancer for
specifyinghow to advance one step in decoder.
--]]
local DecoderAdvancer = torch.class('DecoderAdvancer', 'Advancer')
--[[ Constructor.
Parameters:
* `decoder` - an `onmt.Decoder` object.
* `batch` - an `onmt.data.Batch` object.
* `context` - encoder output (batch x n x rnnSize).
* `max_sent_length` - optional, maximum output sentence length.
* `max_num_unks` - optional, maximum number of UNKs.
* `decStates` - optional, initial decoder states.
* `dicts` - optional, dictionary for additional features.
--]]
function DecoderAdvancer:__init(decoder, batch, context, max_sent_length, max_num_unks, decStates, dicts, length_norm, coverage_norm, eos_norm)
self.decoder = decoder
self.batch = batch
self.context = context
self.max_sent_length = max_sent_length or math.huge
self.max_num_unks = max_num_unks or math.huge
self.length_norm = length_norm or 0.0
self.coverage_norm = coverage_norm or 0.0
self.eos_norm = eos_norm or 0.0
self.decStates = decStates or onmt.utils.Tensor.initTensorTable(
decoder.args.numEffectiveLayers,
onmt.utils.Cuda.convert(torch.Tensor()),
{ self.batch.size, decoder.args.rnnSize })
self.dicts = dicts
end
--[[Returns an initial beam.
Returns:
* `beam` - an `onmt.translate.Beam` object.
--]]
function DecoderAdvancer:initBeam()
local tokens = onmt.utils.Cuda.convert(torch.IntTensor(self.batch.size)):fill(onmt.Constants.BOS)
local features = {}
if self.dicts then
for j = 1, #self.dicts.tgt.features do
features[j] = torch.IntTensor(self.batch.size):fill(onmt.Constants.EOS)
end
end
local sourceSizes = onmt.utils.Cuda.convert(self.batch.sourceSize)
local attnProba = torch.FloatTensor(self.batch.size, self.context:size(2)):fill(0.0001)
-- Mask padding
for i = 1,self.batch.size do
local pad_size = self.context:size(2) - sourceSizes[i]
if (pad_size ~= 0) then
attnProba[{ i, {1,pad_size} }] = 1.0
end
end
-- Define state to be { decoder states, decoder output, context,
-- attentions, features, sourceSizes, step, cumulated attention probablities }.
local state = { self.decStates, nil, self.context, nil, features, sourceSizes, 1, attnProba }
local params = {}
params.length_norm = self.length_norm
params.coverage_norm = self.coverage_norm
params.eos_norm = self.eos_norm
return onmt.translate.Beam.new(tokens, state, params)
end
--[[Updates beam states given new tokens.
Parameters:
* `beam` - beam with updated token list.
]]
function DecoderAdvancer:update(beam)
local state = beam:getState()
local decStates, decOut, context, _, features, sourceSizes, t, cumAttnProba
= table.unpack(state, 1, 8)
local tokens = beam:getTokens()
local token = tokens[#tokens]
local inputs
if #features == 0 then
inputs = token
elseif #features == 1 then
inputs = { token, features[1] }
else
inputs = { token }
table.insert(inputs, features)
end
self.decoder:maskPadding(sourceSizes, self.batch.sourceLength)
decOut, decStates = self.decoder:forwardOne(inputs, decStates, context, decOut)
t = t + 1
local softmaxOut = self.decoder.softmaxAttn.output
cumAttnProba = cumAttnProba:typeAs(softmaxOut):add(softmaxOut)
local nextState = {decStates, decOut, context, softmaxOut, nil, sourceSizes, t, cumAttnProba}
beam:setState(nextState)
end
--[[Expand function. Expands beam by all possible tokens and returns the
scores.
Parameters:
* `beam` - an `onmt.translate.Beam` object.
Returns:
* `scores` - a 2D tensor of size `(batchSize * beamSize, numTokens)`.
]]
function DecoderAdvancer:expand(beam)
local state = beam:getState()
local decOut = state[2]
local out = self.decoder.generator:forward(decOut)
local features = {}
for j = 2, #out do
local _, best = out[j]:max(2)
features[j - 1] = best:view(-1)
end
state[5] = features
local scores = out[1]
return scores
end
--[[Checks which hypotheses in the beam are already finished. A hypothesis is
complete if i) an onmt.Constants.EOS is encountered, or ii) the length of the
sequence is greater than or equal to `max_sent_length`.
Parameters:
* `beam` - an `onmt.translate.Beam` object.
Returns: a binary flat tensor of size `(batchSize * beamSize)`, indicating
which hypotheses are finished.
]]
function DecoderAdvancer:isComplete(beam)
local tokens = beam:getTokens()
local seqLength = #tokens - 1
local complete = tokens[#tokens]:eq(onmt.Constants.EOS)
if seqLength > self.max_sent_length then
complete:fill(1)
end
return complete
end
--[[Checks which hypotheses in the beam shall be pruned. We disallow empty
predictions, as well as predictions with more UNKs than `max_num_unks`.
Parameters:
* `beam` - an `onmt.translate.Beam` object.
Returns: a binary flat tensor of size `(batchSize * beamSize)`, indicating
which beams shall be pruned.
]]
function DecoderAdvancer:filter(beam)
local tokens = beam:getTokens()
local numUnks = onmt.utils.Cuda.convert(torch.zeros(tokens[1]:size(1)))
for t = 1, #tokens do
local token = tokens[t]
numUnks:add(onmt.utils.Cuda.convert(token:eq(onmt.Constants.UNK):double()))
end
-- Disallow too many UNKs
local pruned = numUnks:gt(self.max_num_unks)
-- Disallow empty hypotheses
if #tokens == 2 then
pruned:add(tokens[2]:eq(onmt.Constants.EOS))
end
return pruned:ge(1)
end
return DecoderAdvancer
|
modifier_sniper_shrapnel_thinker_custom = class({})
function modifier_sniper_shrapnel_thinker_custom:IsAura()
return self:IsInitialized()
end
function modifier_sniper_shrapnel_thinker_custom:GetModifierAura()
return "modifier_sniper_shrapnel_debuff"
end
function modifier_sniper_shrapnel_thinker_custom:GetAuraRadius()
return self.radius
end
function modifier_sniper_shrapnel_thinker_custom:GetAuraDuration()
return self.debuff_linger
end
function modifier_sniper_shrapnel_thinker_custom:GetAuraSearchTeam()
return DOTA_UNIT_TARGET_TEAM_BOTH
end
function modifier_sniper_shrapnel_thinker_custom:GetAuraEntityReject(hEntity)
if CustomEntitiesLegacy:Allies(self:GetCaster(), hEntity) then
return true
end
return false
end
function modifier_sniper_shrapnel_thinker_custom:GetAuraSearchType()
return DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC
end
function modifier_sniper_shrapnel_thinker_custom:OnDelayEnds()
if IsServer() then
self.duration = self:GetAbility():GetSpecialValueFor("duration")
self.radius = self:GetAbility():GetSpecialValueFor("radius")
self.debuff_linger = self:GetAbility():GetSpecialValueFor("debuff_linger")
self.direction = (self:GetParent():GetAbsOrigin() - self:GetCaster():GetAbsOrigin()):Normalized()
AddFOWViewer(self:GetCaster():GetTeamNumber(), self:GetParent():GetAbsOrigin(), self.radius, self.duration, false)
self:PlayEffects()
end
end
function modifier_sniper_shrapnel_thinker_custom:OnDestroy()
if IsServer() then
self:StopEffects()
UTIL_Remove(self:GetParent())
end
end
function modifier_sniper_shrapnel_thinker_custom:PlayEffects()
EmitSoundOn("Hero_Sniper.MKG_ShrapnelShatter", self:GetParent())
local particle_cast = "particles/units/heroes/hero_sniper/sniper_shrapnel.vpcf"
self.effect_cast = ParticleManager:CreateParticle(particle_cast, PATTACH_WORLDORIGIN, nil)
ParticleManager:SetParticleControl(self.effect_cast, 0, self:GetParent():GetAbsOrigin())
ParticleManager:SetParticleControl(self.effect_cast, 1, Vector(self.radius,0,0))
ParticleManager:SetParticleControlForward(self.effect_cast, 2, self.direction + Vector(0, 0, 0.1))
end
function modifier_sniper_shrapnel_thinker_custom:StopEffects()
ParticleManager:DestroyParticle(self.effect_cast, false)
ParticleManager:ReleaseParticleIndex(self.effect_cast)
StopSoundOn("Hero_Sniper.MKG_ShrapnelShatter", self:GetParent())
end
function modifier_sniper_shrapnel_thinker_custom:GetDelayTime()
return self:GetAbility():GetSpecialValueFor("delay_time")
end
function modifier_sniper_shrapnel_thinker_custom:GetAOERadius()
return self:GetAbility():GetSpecialValueFor("radius")
end
if IsClient() then require("wrappers/modifiers") end
Modifiers.Thinker(modifier_sniper_shrapnel_thinker_custom)
|
if not WoWUnit then return end
---@type string
local Name = ...
---@type Addon
local Addon = select(2, ...)
local Test, Unit, Util = Addon.Test, Addon.Unit, Addon.Util
local Assert, AssertEqual, Replace = WoWUnit.IsTrue, WoWUnit.AreEqual, WoWUnit.Replace
local RI = LibStub("LibRealmInfo")
local Tests = WoWUnit(Name .. ".Unit.Util.Unit")
function Tests:RealmNameTest()
end
function Tests:RealmTest()
end
function Tests:ConnectedRealmTest()
-- The players's realm
AssertEqual(table.concat(GetAutoCompleteRealms(), "-"), Unit.ConnectedRealm("player"))
Replace(RI, "GetCurrentRegion", Test.Const("EU"))
-- A normal connected realm
AssertEqual("Aggramar-Hellscream", Unit.ConnectedRealm("Unit-Aggramar"))
-- A realm with spaces
AssertEqual("Todeswache-ZirkeldesCenarius", Unit.ConnectedRealm("Unit-ZirkeldesCenarius"))
-- A realm without connections
AssertEqual("Archimonde", Unit.ConnectedRealm("Unit-Archimonde"))
-- A realm that doesn't exist
AssertEqual("Abcdefg", Unit.ConnectedRealm("Unit-Abcdefg"))
end
function Tests:NameTest()
end
function Tests:ShortNameTest()
end
function Tests:FullNameTest()
end
function Tests:ShortenedNameTest()
end
function Tests:ColoredNameTest()
end
function Tests:ColoredShortenedNameTest()
end
function Tests:GuildNameTest()
end
function Tests:GuildRankTest()
end
function Tests:IsGuildMemberTest()
end
function Tests:IsGuildOfficerTest()
end
function Tests:IsFriendTest()
end
function Tests:IsClubMemberTest()
end
function Tests:CommonClubsTest()
end
function Tests:ClubMemberInfoTest()
end
function Tests:InGroupTest()
end
function Tests:GroupRankTest()
end
function Tests:GroupLeaderTest()
end
function Tests:IsUnitTest()
end
function Tests:IsSelfTest()
end
function Tests:ClassIdTest()
end
function Tests:SpecsTest()
end
function Tests:ExpansionTest()
end
function Tests:ColorTest()
end
function Tests:IsFollowingTest()
end
function Tests:IsEnchanterTest()
end
|
local utilities = {}
function utilities:printTable( table )
for k,v in pairs( table ) do
print(k)
if type(v) == 'table' then
printtable(v)
else
print(v)
end
end
end
function utilities:deepcopy(t, cache)
if type(t) ~= 'table' then
return t
end
cache = cache or {}
if cache[t] then
return cache[t]
end
local new = {}
cache[t] = new
for key, value in pairs(t) do
new[deepcopy(key, cache)] = deepcopy(value, cache)
end
return new
end
return utilities
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.