content
stringlengths 5
1.05M
|
---|
-- Copyright (c) 2016 Thermo Fisher Scientific
--
-- 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.
-- multiPlotPage.lua
-- A tabPage, but with a ZedGraphControl that supports multiple GraphPanes
-- Load necessary libraries
local zPane = require("zPane")
local tabPage = require("tabPage")
local properties = require("properties")
-- Get assemblies
luanet.load_assembly ("ZedGraph")
luanet.load_assembly ("Sytem.Drawing") -- For PointF
-- Get constructors
local ZedGraphControl = luanet.import_type("ZedGraph.ZedGraphControl")
local PointF = luanet.import_type("System.Drawing.PointF")
-- Get enumerations
local DockStyle = luanet.import_type("System.Windows.Forms.DockStyle") -- Get the enumeration
local Keys = luanet.import_type("System.Windows.Forms.Keys")
-- local declarations
-- This is used to get the modifier keys for mouse clicks
local control = luanet.import_type("System.Windows.Forms.Control") -- Not a constructor
-- local functions
-- Start of plotPage Object
local multiPlotPage = {}
multiPlotPage.__index = multiPlotPage
setmetatable(multiPlotPage, {
__index = tabPage, -- this is the inheritance
__call = function(cls, ...)
local self = setmetatable({}, cls)
self:_init(...)
return self
end, })
function multiPlotPage:_init(args)
args = args or {}
tabPage._init(self, args)
-- Create the ZedGraphControl
self.plotControl = ZedGraphControl()
self.plotControl.Dock = DockStyle.Fill
self.plotControl.Tag = self
self.pageControl.Controls:Add(self.plotControl)
self.plotControl.PreviewKeyDown:Add(multiPlotPage.PlotKeyDownCB)
self.plotControl.MouseClick:Add(multiPlotPage.MouseClickCB)
self.plotControl.MouseDoubleClick:Add(multiPlotPage.MouseDoubleClickCB)
-- self.plotControl.ZoomEvent:Add(multiPlotPage.ZoomEventCB)
-- Setup the master to support mulitple GraphPanes
local master = self.plotControl.MasterPane
master.PaneList:Clear()
self.paneList = {}
self.paneList.active = false
if args.panes then
for index, pane in ipairs(args.panes) do
self:AddPane(pane)
end
else -- Just one zPane by default
self:AddPane(zPane(args))
end
self.plotControl:AxisChange()
if #self.paneList > 1 then
-- If there's more than one pane, but no formatting, just format in one column
if not args.rows and not args.columns then
args.rows = #self.paneList
args.columns = 1
end
self:SetLayout(args.rows, args.columns)
end
end
function multiPlotPage:AddCurve(args)
args = args or {}
local pane = self.paneList.active
if not pane then return end
return pane:AddCurve(args)
end
function multiPlotPage:AddPane(pane)
pane.page = self -- Add a reference back to the page
pane.plotControl = self.plotControl -- Add reference to plotControl for refreshing
self.plotControl.MasterPane:Add(pane.paneControl) -- Add the paneControl to the master
table.insert(self.paneList, pane) -- Add pane to paneList
self:SetActivePane(pane) -- Make it the active pane
end
-- Convenience for adding data
function multiPlotPage:AddXYTable(args)
-- need to guide plot to the active plot
args = args or {}
local pane = self.paneList.active
if not pane then return end
return pane:AddXYTable(args)
end
function multiPlotPage:ChangeActivePane(direction)
if #self.paneList <= 1 then return end -- Skip if only one active pane
local activeIndex
for index, pane in ipairs(self.paneList) do
if pane == self.paneList.active then
activeIndex = index
break
end
end
if not activeIndex then return end -- Shouldn't ever happen
activeIndex = activeIndex + direction -- Increment the active index
if activeIndex > #self.paneList then activeIndex = 1 end -- Rotate to start
if activeIndex < 1 then activeIndex = #self.paneList end -- Rotate to back
local pane = self.paneList[activeIndex] -- get the associated pane
self:SetActivePane(pane) -- activate the pane
self.plotControl:Invalidate() -- Invalidate to update borders
end
-- Dispose of all .NET resources
function multiPlotPage:Dispose()
for index, pane in ipairs(self.paneList) do
pane:Dispose()
end
print ("Disposing Plot")
self.plotControl:Dispose()
end
-- Sender is the plot control, so use . instead of : syntax
function multiPlotPage.MouseClickCB(sender, args)
local self = sender.Tag -- This is the page
local pointF = PointF(args.X, args.Y) -- Convert click location to a PointF
local paneControl = sender.MasterPane:FindPane(pointF) -- Find the Zedgraph Pane that was clicked
if not paneControl then return end -- Bail out if click outside a pane
if control.ModifierKeys == Keys.Shift then
local pane = paneControl.Tag -- Get the zPane
pane:ShiftClick(pointF, self.paneList.active) -- Do whatever action this pane desires
end
end
-- Sender is the plot control, so use . instead of : syntax
function multiPlotPage.MouseDoubleClickCB(sender, args)
local self = sender.Tag -- This is the page
local pointF = PointF(args.X, args.Y) -- Convert click location to a PointF
local paneControl = sender.MasterPane:FindPane(pointF) -- Find the Zedgraph Pane that was clicked
if not paneControl then return end -- Bail out if click outside a pane
local pane = paneControl.Tag -- Get the zPane
self:SetActivePane(paneControl.Tag) -- Set it active
self.plotControl:Invalidate() -- Invalidate to update borders
end
-- Sender is the plot control, so use . instead of : syntax
function multiPlotPage.PlotKeyDownCB(sender, args)
local self = sender.Tag
if not self then return end -- If no active page, return, shouldn't ever happen
local pane = self.paneList.active
if not pane then return end -- If not active pane, return, shouldn't ever happen
local keyCode = args.KeyCode
-- The order here may seem backwards, but the panes
-- are indexed from top to bottom
if keyCode == Keys.PageUp then
self:ChangeActivePane(-1)
elseif keyCode == Keys.PageDown then
self:ChangeActivePane(1)
elseif pane.KeyDownCB then
pane:KeyDownCB(sender, args)
end
return
end
-- Set the active pane
function multiPlotPage:SetActivePane(pane)
if pane == self.paneList.active then return end -- Do nothing if already active
if self.paneList.active then
self.paneList.active:SetActive(false) -- Deactivate the current pane
end
self.paneList.active = pane -- Set the active pane
self.paneList.active:SetActive(true) -- Active the new pane
return
end
-- Set the layout based on rows and columns
function multiPlotPage:SetLayout(rows, columns)
rows = rows or 1
columns = columns or 1
local graphics = self.plotControl:CreateGraphics()
self.plotControl.MasterPane:SetLayout(graphics, rows, columns)
graphics:Dispose()
end
-- This overrides the default method
function multiPlotPage:SetProperties()
return self.paneList.active:SetProperties()
end
-- This redirectsto to the call for the active pane
function multiPlotPage:Undo()
return self.paneList.active:Undo()
end
-- This redirects to the call to the active pane
function multiPlotPage:UpdatePropertyForm()
return self.paneList.active:UpdatePropertyForm()
end
-- Sender is a GraphPane, so use . instead of : syntax
function multiPlotPage.ZoomEventCB(sender, oldState, newState)
print ("Axis Change Detected")
end
return multiPlotPage
|
local lush = require("lush")
local c = require("gruvboy.colors")
local theme = lush(function()
return {
markdownItalic({ fg = c.fg3 }),
markdownH1({ fg = c.green, gui = "bold" }),
markdownH2({ markdownH1 }),
markdownH3({ fg = c.yellow, gui = "bold" }),
markdownH4({ markdownH3 }),
markdownH5({ fg = c.yellow }),
markdownH6({ markdownH5 }),
markdownCode({ fg = c.aqua }),
markdownCodeBlock({ fg = c.aqua }),
markdownCodeDelimiter({ fg = c.aqua }),
markdownBlockquote({ fg = c.gray }),
markdownListMarker({ fg = c.gray }),
markdownOrderedListMarker({ fg = c.gray }),
markdownRule({ fg = c.gray }),
markdownHeadingRule({ fg = c.gray }),
markdownUrlDelimiter({ fg = c.fg3 }),
markdownLinkDelimiter({ fg = c.fg3 }),
markdownLinkTextDelimiter({ fg = c.fg3 }),
markdownHeadingDelimiter({ fg = c.orange }),
markdownUrl({ fg = c.purple }),
markdownUrlTitleDelimiter({ fg = c.green }),
markdownLinkText({ fg = c.gray, gui = "underline" }),
markdownIdDeclaration({ markdownLinkText }),
}
end)
return theme
-- vi:nowrap
|
-- Example controlling RGB LED strip with PCA9685 I2C PWM controller
-- Requires Lua PCA9685 driver: https://github.com/lexszero/esp8266-pwm/
-- Initialize I2C bus with SDA on GPIO0, SCL on GPIO2
-- https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en#new_gpio_map
i2c.setup(0, 3, 4, i2c.SLOW)
-- Initialize PCA9685 PWM controller
-- Args:
-- i2c bus id (should be 0)
-- i2c address (see pca9685 datasheet)
-- mode - 16-bit value, low byte is MODE1, high is MODE2 (see datasheet)
require('pca9685')
pca9685.init(0, 0x40, 0)
m = require('wbmqtt')
-- Define MQTT control for RGB LED strip
rgbstrip = m.Control{
name = 'Color',
type = 'rgb',
on_connect = function(self)
-- Publish current state
self:publish(self.value)
end,
value = '0;0;0',
}
-- Subscribe to '../on' topic and set PWM duty on messages reception
rgbstrip:subscribe('on', function(self, fn, value)
r, g, b = value:match('(%d+);(%d+);(%d+)')
pca9685.set_chan_byte(0, tonumber(r))
pca9685.set_chan_byte(1, tonumber(g))
pca9685.set_chan_byte(2, tonumber(b))
self.value = value
self:publish(value)
end)
-- Setup Wi-Fi connection
wifi.setmode(wifi.STATION)
wifi.sta.config('HomeNetwork', 'VerySecretPassword')
-- Now everything is ready to run, so finally connect to MQTT broker
m.init{
host = '192.168.0.1',
port = '1883',
user = 'test',
password = 'test',
secure = 0,
device = 'rgbstrip-room',
name = 'RGB LED strip'
}
|
global["backup_inventories"] = global["backup_inventories"] or {}
global["armor_bonus"] = global["armor_bonus"] or {}
local function on_inventory_grow(player, old_armor_bonus, new_armor_bonus)
local new_bonus = new_armor_bonus - old_armor_bonus
player.character_inventory_slots_bonus = player.character_inventory_slots_bonus + new_bonus
local player_backup_inventory = global["backup_inventories"][player.name]
if player_backup_inventory and player_backup_inventory.get_item_count() ~= 0 then
local main_inventory = player.get_main_inventory()
for i=1,#player_backup_inventory do
local items = player_backup_inventory[i]
if main_inventory.can_insert(items) then
local num_inserted = main_inventory.insert(items)
if num_inserted == items.count then
player_backup_inventory.remove(items)
else
items.count = items.count - num_inserted
end
end
end
if player_backup_inventory.get_item_count() == 0 then
player_backup_inventory.destroy()
global["backup_inventories"][player.name] = nil
end
end
end
local function on_inventory_shrink(player, old_armor_bonus, new_armor_bonus)
local lost_size = old_armor_bonus - new_armor_bonus
local player_backup_inventory = global["backup_inventories"][player.name]
if player_backup_inventory == nil then
global["backup_inventories"][player.name] = game.create_inventory(lost_size)
player_backup_inventory = global["backup_inventories"][player.name]
else
player_backup_inventory.resize(#player_backup_inventory + lost_size)
end
local main_inventory = player.get_main_inventory()
local inventory_size = #main_inventory
local start_index = inventory_size - lost_size + 1
for i=start_index,inventory_size do
local main_stack = main_inventory[i]
player_backup_inventory.insert(main_stack)
main_inventory.remove(main_stack)
end
player_backup_inventory.sort_and_merge()
player.character_inventory_slots_bonus = player.character_inventory_slots_bonus - lost_size
end
function on_armor_changed(evt)
local player = game.players[evt.player_index]
local armor_bonuses = global["armor_bonus"]
local armor_stack = player.get_inventory(defines.inventory.character_armor)[1]
local old_armor_bonus = armor_bonuses[player.name]
if player.character then
if armor_stack.is_armor then
local armor_ref_name = armor_stack.name .. "-ref"
local armor_ref_proto = game.item_prototypes[armor_ref_name]
local new_armor_bonus = 0
if armor_ref_proto then
new_armor_bonus = armor_ref_proto.inventory_size_bonus
end
if old_armor_bonus == nil then
armor_bonuses[player.name] = new_armor_bonus
on_inventory_grow(player, 0, new_armor_bonus)
elseif old_armor_bonus ~= new_armor_bonus then
armor_bonuses[player.name] = new_armor_bonus
if old_armor_bonus > new_armor_bonus then
armor_bonuses[player.name] = new_armor_bonus
on_inventory_shrink(player, old_armor_bonus, new_armor_bonus)
elseif old_armor_bonus < new_armor_bonus then
armor_bonuses[player.name] = new_armor_bonus
on_inventory_grow(player, old_armor_bonus, new_armor_bonus)
end
end
else
if old_armor_bonus ~= nil and old_armor_bonus ~= 0 then
armor_bonuses[player.name] = 0
on_inventory_shrink(player, old_armor_bonus, 0)
end
end
end
end |
local SymbolTable = require("lunar.compiler.semantic.symbol_table")
local Scope = {}
Scope.__index = {}
function Scope.new(level, parent, env, file_path)
return Scope.constructor(setmetatable({}, Scope), level, parent, env, file_path)
end
function Scope.constructor(self, level, parent, env, file_path)
self.symbol_table = SymbolTable.new()
self.level = level
self.parent = parent
if (not parent) then
self.env = env
self.file_path = file_path
end
return self
end
function Scope.__index:get_value(name)
if self.parent then
return self.symbol_table:get_value(name) or self.parent:get_value(name)
else
return self.symbol_table:get_value(name) or self.env:get_global_value(self.file_path, name)
end
end
function Scope.__index:get_type(name)
if self.parent then
return self.symbol_table:get_type(name) or self.parent:get_type(name)
else
return self.symbol_table:get_type(name) or self.env:get_global_type(self.file_path, name)
end
end
function Scope.__index:has_value(name)
if self.parent then
return self.symbol_table:has_value(name) or self.parent:has_value(name)
else
return self.symbol_table:has_value(name) or self.env:has_global_value(self.file_path, name)
end
end
function Scope.__index:has_type(name)
if self.parent then
return self.symbol_table:has_type(name) or self.parent:has_type(name)
else
return self.symbol_table:has_type(name) or self.env:has_global_type(self.file_path, name)
end
end
function Scope.__index:has_level_value(name)
local base_scope = self
repeat
if self.symbol_table:has_value(name) then
return true
end
base_scope = base_scope.parent
until (not base_scope) or base_scope.level ~= self.level
end
function Scope.__index:has_level_type(name)
local base_scope = self
repeat
if self.symbol_table.has_type(name) then
return true
end
base_scope = base_scope.parent
until (not base_scope) or base_scope.level ~= self.level
end
function Scope.__index:add_value(symbol)
self.symbol_table:add_value(symbol)
end
function Scope.__index:add_type(symbol)
if self.parent then
error("Types must be bound to a root scope")
end
self.symbol_table:add_type(symbol)
end
return Scope
|
local hello = require 'lib/hello'
function main()
hello.sayHello()
end
main() |
return {
Name = "takeItem";
Aliases = {};
Description = "Removes quantity of item from players inventory";
Group = "Admin";
Args = {
{
Type = "itemId";
Name = "itemId";
Description = "Item to remove";
},
{
Type = "player";
Name = "target";
Description = "Player to remove item from";
},
{
Type = "integer";
Name = "quantity";
Description = "Ammount to remove";
Default = 999;
},
};
} |
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
reaper.CF_ShellExecute(ultraschall.Api_Path.."/Scripts")
|
m=component.proxy(component.list("modem")())
d=component.proxy(component.list("drone")())
m.setWakeMessage("RISE")
local CMD_PORT = 2412
m.open(CMD_PORT)
computer.beep(2000)
local eventStack = {}
local listeners = {}
event = {}
function event.listen(evtype,callback)
if listeners[evtype] ~= nil then
table.insert(listeners[evtype],callback)
return #listeners
else
listeners[evtype] = {callback}
return 1
end
end
function event.ignore(evtype,id)
table.remove(listeners[evtype],id)
end
function event.pull(filter)
if not filter then return table.remove(eventStack,1)
else
for _,v in pairs(eventStack) do
if v == filter then
return v
end
end
repeat
t=table.pack(computer.pullSignal())
evtype = table.remove(t,1)
if listeners[evtype] ~= nil then
for k,v in pairs(listeners[evtype]) do
local evt,rasin = pcall(v,evtype,table.unpack(t))
if not evt then
print("stdout_write","ELF: "..tostring(evtype)..":"..tostring(k)..":"..rasin)
end
end
end
until evtype == filter
return evtype, table.unpack(t)
end
end
function print(...)
local args=table.pack(...)
pcall(function() m.broadcast(CMD_PORT, table.unpack(args)) end)
end
function sleep(n)
local t0 = computer.uptime()
while computer.uptime() - t0 <= n do computer.pushSignal("wait") computer.pullSignal() end
end
function error(...)
print(...)
end
function 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..'] = ' .. dump(v) .. ',\n'
end
return s .. '} '
else
return tostring(o)
end
end
prg = ""
print("Deep Bios v1.0")
print("BOOTME")
while true do
m.close()
m.open(CMD_PORT)
evt = {event.pull("modem_message")}
if evt[1] == "modem_message" and evt[4] == CMD_PORT then
cmd = evt[6]
--print(dump(evt))
if cmd == "a" then
if evt[7] then
prg = prg.."\n"..evt[7]
end
elseif cmd == "c" then
prg = ""
elseif cmd == "r" then
print(pcall(load(prg)))
elseif cmd == "e" then
print(pcall(load(evt[7])))
else
print("unknown cmd "..cmd)
end
end
end |
function renderFile(fileBlob)
if not fileBlob then
return nil
end
local html = string.format([[
<html>
<body>
<h1>Content of file:</h1>
<p id="blob">%s</p>
</body>
</html>]],
fileBlob)
return html
end
|
--[[
* Configuration for <scheduler.lua> script.
*
* Provides a time table to schedule actions.
*
* The actions' implementation is left to the user.
]]
-- ----------------------------------------------------------------------------
local trace = require("lib.trace")
-- ----------------------------------------------------------------------------
-- here we attach to the same tracing object of the scheduler
--
local m_trace = trace.new("schedule")
-- ----------------------------------------------------------------------------
-- execute the command line
--
local function DownloadFavorites()
m_trace:line("DownloadFavorites")
local hFile, sError = io.popen("lua ./download.lua --favorites", "r")
if sError and 0 < #sError then
m_trace:line("On DownloadFavorites got an error: " .. sError)
return sError
end
hFile:read("a")
hFile:close()
return nil
end
-- ----------------------------------------------------------------------------
-- execute the command line
--
local function ArchiveFavorites()
m_trace:line("ArchiveFavorites")
local hFile, sError = io.popen("lua ./archive.lua", "r")
if sError and 0 < #sError then
m_trace:line("On ArchiveFavorites got an error: " .. sError)
return sError
end
hFile:read("a")
hFile:close()
return nil
end
-- ----------------------------------------------------------------------------
-- execute the command line
--
local function OnSchedule()
m_trace:line("OnSchedule")
DownloadFavorites()
ArchiveFavorites()
return nil
end
-- ----------------------------------------------------------------------------
--
local tConfiguration =
{
sCfgVersion = "0.0.1",
bAutoReload = false, -- reload this file at each execution cycle
iTimeWindow = 120, -- valid time frame in seconds
tTimesAt =
{
{ "06:00:00", OnSchedule },
{ "06:30:00", OnSchedule },
{ "06:49:00", OnSchedule },
{ "07:10:00", OnSchedule },
{ "8:18:00", OnSchedule },
{ "10:35:00", OnSchedule },
{ "12:24:00", OnSchedule },
{ "14:57:00", OnSchedule },
{ "16:00:30", OnSchedule },
{ "17:47:00", OnSchedule },
{ "21:20:00", OnSchedule },
{ "21:42:15", OnSchedule },
{ "22:00:00", OnSchedule },
{ "23:45:00", OnSchedule },
},
}
return tConfiguration
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------
|
local StatBoundedStat = require("bin.StatBoundedStat")
local BoundedStat = require("bin.BoundedStat")
local Stat = require("bin.Stat")
local private = require("bin.instances")
--local inspect = require("lib.inspect.main")
local Health = Object:extend()
function Health:new(max, bonus, val, reason)
bonus = bonus or 0
max = max or 0
val = val or max
assert(type(max) == "number", "Maximum health must be a number.")
assert(type(val) == "number", "Starting health must be a number.")
assert(type(bonus) == "number", "Starting temporary health must be a number.")
assert(max >= 0, "Maximum value must be larger than or equal to zero.")
assert(val >= 0, "Starting health must be bigger than or equal to zero.")
assert(val <= max, "Starting health must be smaller than or equal to the maximum health.")
assert(bonus >= 0, "Starting temporary health must be bigger than or equal to zero.")
private[self.uuid] = private[self.uuid] or {}
local p = private[self.uuid]
p.bonus = BoundedStat(0, math.huge, bonus, reason)
p.value = StatBoundedStat(0, max, val, reason)
end
function Health:get_min() error("Unable to get minimum health, as minimum health needs to remain as zero.") end
function Health:get_max() return private[self.uuid].value.max end
function Health:get_value() return private[self.uuid].value.value end
function Health:get_bonus() return private[self.uuid].bonus end
function Health:get_min() error("Unable to set minimum health, as minimum health needs to remain as zero.") end
function Health:set_max(_) error("Unable to set max health. Adjust the max health as its own Stat.") end
function Health:set_value(_) error("Unable to set value. Please use one of the respective methods.") end
function Health:set_bonus(_) error("Unable to set bonus. Adjust the bonus as its own Stat.") end
--Returns DEAD, DOWN, or OKAY based on remaining health
function Health:damage(num, reason)
local p, val, bonus = private[self.uuid]
val = self.value.value
bonus = p.bonus.value
if bonus > 0 then
p.bonus:change(math.max(bonus - num, 0), "DECREASE", reason)
num = math.max(num - bonus, 0)
end
p.value:setValue(math.max(val - num, 0), "DECREASE", reason)
num = num - val
return num >= self.max.value and "DEAD" or num >= 0 and "DOWN" or "OKAY"
end
--Returns how much was actually healed by
function Health:heal(num, reason)
local p, val = private[self.uuid]
val = self.value.value
p.value:setValue(math.min(val + num, self.max.value), "INCREASE", reason)
return self.value.value - val
end
--Returns how much was actually healed by
function Health:fullHeal(reason)
local p, val = private[self.uuid]
val = self.value.value
bound:setValue(self.max.value, "INCREASE", reason)
return self.value.value - val
end
function Health:__tostring()
return "current: " .. self.value.value .. " / max: " .. self.max.value .. " (Temp: " .. private[self.uuid].bonus.value .. ")"
end
Health.__type = "health"
return Health |
-- Use of this source code is governed by the Apache 2.0 license; see COPYING.
module(...,package.seeall)
-- Default to not using any Lua code on the filesystem.
-- (Can be overridden with -P argument: see below.)
package.path = ''
local STP = require("lib.lua.StackTracePlus")
local ffi = require("ffi")
local zone = require("jit.zone")
local lib = require("core.lib")
local shm = require("core.shm")
local C = ffi.C
-- Load ljsyscall early to help detect conflicts
-- (e.g. FFI type name conflict between Snabb and ljsyscall)
local S = require("syscall")
require("lib.lua.strict")
require("lib.lua.class")
-- ljsyscall returns error as a cdata instead of a string, and the standard
-- assert doesn't use tostring on it.
_G.assert = function (v, ...)
if v then return v, ... end
error(tostring(... or "assertion failed!"))
end
-- Reserve names that we want to use for global module.
-- (This way we avoid errors from the 'strict' module.)
_G.config, _G.engine, _G.memory, _G.link, _G.packet, _G.timer,
_G.main = nil
ffi.cdef[[
extern int argc;
extern char** argv;
]]
-- Enable developer-level debug if SNABB_DEBUG env variable is set.
_G.developer_debug = lib.getenv("SNABB_DEBUG") ~= nil
debug_on_error = _G.developer_debug
function main ()
zone("startup")
require "lib.lua.strict"
-- Warn on unsupported platforms
if ffi.arch ~= 'x64' or ffi.os ~= 'Linux' then
error("fatal: "..ffi.os.."/"..ffi.arch.." is not a supported platform\n")
end
initialize()
if lib.getenv("SNABB_PROGRAM_LUACODE") then
-- Run the given Lua code instead of the command-line
local expr = lib.getenv("SNABB_PROGRAM_LUACODE")
local f = loadstring(expr)
if f == nil then
error(("Failed to load $SNABB_PROGRAM_LUACODE: %q"):format(expr))
else
f()
end
else
-- Choose a program based on the command line
local program, args = select_program(parse_command_line())
if not lib.have_module(modulename(program)) then
print("unsupported program: "..program:gsub("_", "-"))
usage(1)
else
require(modulename(program)).run(args)
end
end
end
-- Take the program name from the first argument, unless the first
-- argument is "snabb", in which case pop it off, handle any options
-- passed to snabb itself, and use the next argument.
function select_program (args)
local program = programname(table.remove(args, 1))
if program == 'snabb' then
while #args > 0 and args[1]:match('^-') do
local opt = table.remove(args, 1)
if opt == '-h' or opt == '--help' then
usage(0)
elseif opt == '-v' or opt == '--version' then
version()
else
print("unrecognized option: "..opt)
usage(1)
end
end
if #args == 0 then usage(1) end
program = programname(table.remove(args, 1))
end
return program, args
end
function usage (status)
print("Usage: "..ffi.string(C.argv[0]).." <program> ...")
local programs = require("programs_inc"):gsub("%S+", " %1")
print()
print("This snabb executable has the following programs built in:")
print(programs)
print("For detailed usage of any program run:")
print(" snabb <program> --help")
print()
print("If you rename (or copy or symlink) this executable with one of")
print("the names above then that program will be chosen automatically.")
os.exit(status)
end
function version ()
local v = require('core.version')
local version_str = v.version
if v.extra_version ~= '' then
version_str = version_str.." ("..v.extra_version..")"
end
print(ffi.string(C.basename(C.argv[0])).." "..version_str)
print([[
Copyright (C) 2012-2017 Snabb authors; see revision control logs for details.
License: <https://www.apache.org/licenses/LICENSE-2.0>
Snabb is open source software. For more information on Snabb, see
https://github.com/snabbco/snabb.]])
os.exit(0)
end
function programname (name)
return name:gsub("^.*/", "")
:gsub("-[0-9.]+[-%w]+$", "")
:gsub("-", "_")
:gsub("^snabb_", "")
end
function modulename (program)
program = programname(program)
return ("program.%s.%s"):format(program, program)
end
-- Return all command-line paramters (argv) in an array.
function parse_command_line ()
local array = {}
for i = 0, C.argc - 1 do
table.insert(array, ffi.string(C.argv[i]))
end
return array
end
function exit (status)
os.exit(status)
end
--- Globally initialize some things. Module can depend on this being done.
function initialize ()
require("core.lib")
require("core.clib_h")
require("core.lib_h")
lib.randomseed(tonumber(lib.getenv("SNABB_RANDOM_SEED")))
-- Global API
_G.config = require("core.config")
_G.engine = require("core.app")
_G.memory = require("core.memory")
_G.link = require("core.link")
_G.packet = require("core.packet")
_G.timer = require("core.timer")
_G.main = getfenv()
end
function handler (reason)
print(reason)
print(STP.stacktrace())
if debug_on_error then debug.debug() end
os.exit(1)
end
-- Cleanup after Snabb process.
function shutdown (pid)
-- Parent process performs additional cleanup steps.
-- (Parent is the process whose 'group' folder is not a symlink.)
local st, err = S.lstat(shm.root.."/"..pid.."/group")
local is_parent = st and st.isdir
if is_parent then
-- simple pcall helper to print error and continue
local function safely (f)
local ok, err = pcall(f)
if not ok then print(err) end
end
-- Run cleanup hooks
safely(function () require("lib.hardware.pci").shutdown(pid) end)
safely(function () require("core.memory").shutdown(pid) end)
end
-- Free shared memory objects
if not _G.developer_debug and not lib.getenv("SNABB_SHM_KEEP") then
-- Try cleaning up symlinks for named apps, if none exist, fail silently.
local backlink = shm.root.."/"..pid.."/name"
local name_link = S.readlink(backlink)
S.unlink(name_link)
S.unlink(backlink)
shm.unlink("/"..pid)
end
end
function selftest ()
print("selftest")
assert(programname("/bin/snabb-1.0") == "snabb",
"Incorrect program name parsing")
assert(programname("/bin/snabb-1.0-alpha2") == "snabb",
"Incorrect program name parsing")
assert(programname("/bin/snabb-nfv") == "nfv",
"Incorrect program name parsing")
assert(programname("/bin/nfv-1.0") == "nfv",
"Incorrect program name parsing")
assert(modulename("nfv-sync-master-2.0") == "program.nfv_sync_master.nfv_sync_master",
"Incorrect module name parsing")
local pn = programname
-- snabb foo => foo
assert(select_program({ 'foo' }) == "foo",
"Incorrect program name selected")
-- snabb-foo => foo
assert(select_program({ 'snabb-foo' }) == "foo",
"Incorrect program name selected")
-- snabb snabb-foo => foo
assert(select_program({ 'snabb', 'snabb-foo' }) == "foo",
"Incorrect program name selected")
end
-- Fork a child process that monitors us and performs cleanup actions
-- when we terminate.
local snabbpid = S.getpid()
if assert(S.fork()) ~= 0 then
-- parent process: run snabb
xpcall(main, handler)
else
-- child process: supervise parent & perform cleanup
-- Subscribe to SIGHUP on parent death
S.prctl("set_name", "[snabb sup]")
S.prctl("set_pdeathsig", "hup")
-- Trap relevant signals to a file descriptor
local exit_signals = "hup, int, quit, term"
local signalfd = S.signalfd(exit_signals)
S.sigprocmask("block", exit_signals)
-- wait until we receive a signal
local signals
repeat signals = assert(S.util.signalfd_read(signalfd)) until #signals > 0
-- cleanup after parent process
shutdown(snabbpid)
-- exit with signal-appropriate status
os.exit(128 + signals[1].signo)
end
|
organicOres = {"minecraft:coal_ore", "minecraft:diamond_ore"} --This is a table of organic ores, SUPPORTING MODDED ORES
nonOrganicOres = {"minecraft:gold_ore", "minecraft:lapis_ore", "minecraft:redstone_ore", "minecraft:iron_ore"} --This is a table of nonorganic ores, SUPPORTING MODDED ORES
organicMinAtmosphere = 25 --This is the minimum value for the atmospheric pressure of a planet, to generate organic ores.
minOreGen = 2 --This is the minimum ammount for the randomized amount for an ore to generate
maxOreGen = 7 --This is the maximum ammount for the randomized amount for an ore to generate
minChunkGen = 8 --This is the minimum amount for the randomized ammount for an ore to generate per chunk
maxChunkGen = 12 --This is the maximum amount for the randomized ammount for an ore to generate per chunk
|
Saw = Class {
__includes=MeleeTower,
init = function(self, gridOrigin, worldOrigin)
self.towerType = "SAW"
MeleeTower.init(self, animationController:createInstance(self.towerType),
gridOrigin, worldOrigin, constants.STRUCTURE.SAW.WIDTH,
constants.STRUCTURE.SAW.HEIGHT, constants.STRUCTURE.SAW.COST,
constants.STRUCTURE.SAW.ATTACK_DAMAGE, constants.STRUCTURE.SAW.ATTACK_INTERVAL,
constants.STRUCTURE.SAW.TARGETTING_RADIUS
)
end;
update = function(self, dt)
MeleeTower.update(self, dt)
end;
addMutation = function(self, mutation)
assert(mutation and mutation.id)
MeleeTower.addMutation(self, mutation, animationController:createInstance(self.towerType..'-'..mutation.id))
end;
} |
describe("Validation of absent rule", function()
local rule = require("rules.absent")
local valid_inputs = {
nil
}
local invalid_inputs = {
"foo",
true,
{},
}
it("Must set result as True when matches expected value", function()
for _, value in ipairs(valid_inputs) do
local context = {input = value}
rule().apply(context)
assert.True(context.result, "Failed with " .. tostring(value))
end
end)
it("Must set result as False when does not match the expected value", function()
for _, value in ipairs(invalid_inputs) do
local context = {input = value}
rule().apply(context)
assert.False(context.result, "Failed with " .. tostring(value))
end
end)
end)
|
function onCreate()
-- background shit
makeLuaSprite('stageback5', 'stageback5', -600, -500);
setScrollFactor('stageback5', 0.9, 0.9);
makeLuaSprite('stagefront', 'stagefront', -650, 600);
setScrollFactor('stagefront', 0.9, 0.9);
scaleObject('stagefront', 5.5, 5.5);
-- sprites that only load if Low Quality is turned off
if not lowQuality then
makeLuaSprite('stagelight_left', 'stage_light', -525, -500);
setScrollFactor('stagelight_left', 0.9, 0.9);
scaleObject('stagelight_left', 5.5, 5.5);
makeLuaSprite('stagelight_right', 'stage_light', 5225, -500);
setScrollFactor('stagelight_right', 0.9, 0.9);
scaleObject('stagelight_right', 5.5, 5.5);
setProperty('stagelight_right.flipX', true); --mirror sprite horizontally
makeLuaSprite('stagecurtains', 'stagecurtains', -500, -500);
setScrollFactor('stagecurtains', 5.5, 5.5);
scaleObject('stagecurtains', 0.9, 0.9);
end
addLuaSprite('stageback5', false);
addLuaSprite('stagefront', false);
addLuaSprite('stagelight_left', false);
addLuaSprite('stagelight_right', false);
addLuaSprite('stagecurtains', false);
close(true); --For performance reasons, close this script once the stage is fully loaded, as this script won't be used anymore after loading the stage
end |
object_tangible_meatlump_event_meatlump_weapon_palette_01_12 = object_tangible_meatlump_event_shared_meatlump_weapon_palette_01_12:new {
}
ObjectTemplates:addTemplate(object_tangible_meatlump_event_meatlump_weapon_palette_01_12, "object/tangible/meatlump/event/meatlump_weapon_palette_01_12.iff")
|
if mods['space-exploration'] then
data:extend({
--- Space Exploration settings
{
type = "int-setting",
name = "space-exploration-pack",
default_value = 4,
setting_type = "startup",
order = "AS-SE-AA",
allowed_values = {0, 1, 2, 3, 4}
},
{
type = "bool-setting",
name = "se-rocket-science-pack",
default_value = true,
setting_type = "startup",
order = "AA-SE-S1"
},
{
type = "bool-setting",
name = "se-astronomic-science-pack",
default_value = true,
setting_type = "startup",
order = "AA-SE-S2"
},
{
type = "bool-setting",
name = "se-biological-science-pack",
default_value = true,
setting_type = "startup",
order = "AA-SE-S3"
},
{
type = "bool-setting",
name = "se-energy-science-pack",
default_value = true,
setting_type = "startup",
order = "AA-SE-S4"
},
{
type = "bool-setting",
name = "se-material-science-pack",
default_value = true,
setting_type = "startup",
order = "AA-SE-S5"
},
{
type = "bool-setting",
name = "se-deep-space-science-pack",
default_value = true,
setting_type = "startup",
order = "AA-SE-S6"
}
})
end |
demonic_warrior_deep_cutting_axe_modifier = class({})
function demonic_warrior_deep_cutting_axe_modifier:OnCreated( kv )
self.armor = self:GetAbility():GetSpecialValueFor("armor")
self.magic_resist_percentage = self:GetAbility():GetSpecialValueFor("magic_resist_percentage")
end
function demonic_warrior_deep_cutting_axe_modifier:DeclareFunctions()
local funcs = {
MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS,
MODIFIER_PROPERTY_MAGICAL_RESISTANCE_BONUS,
}
return funcs
end
function demonic_warrior_deep_cutting_axe_modifier:GetModifierPhysicalArmorBonus( params )
return self.armor
end
function demonic_warrior_deep_cutting_axe_modifier:GetModifierMagicalResistanceBonus( params )
return self.magic_resist_percentage
end
function demonic_warrior_deep_cutting_axe_modifier:GetAttributes()
return MODIFIER_ATTRIBUTE_IGNORE_INVULNERABLE
end
function demonic_warrior_deep_cutting_axe_modifier:IsHidden()
return false
end
function demonic_warrior_deep_cutting_axe_modifier:IsPurgable()
return false
end
function demonic_warrior_deep_cutting_axe_modifier:IsPurgeException()
return false
end
function demonic_warrior_deep_cutting_axe_modifier:IsStunDebuff()
return false
end
function demonic_warrior_deep_cutting_axe_modifier:IsDebuff()
return true
end |
local L = BigWigs:NewBossLocale("Neltharions Lair Trash", "ptBR")
if not L then return end
if L then
L.breaker = "Rachador Megalito"
L.hulk = "Gigante Estilhavil"
L.gnasher = "Triscadente Costapétrea"
L.trapper = "Coureador Rochatado"
end
L = BigWigs:NewBossLocale("Rokmora", "ptBR")
if L then
L.warmup_text = "Rokmora Ativo"
L.warmup_trigger = "Navarrogg?! Traidor! Você liderou esses intrusos contra nós?!"
L.warmup_trigger_2 = "De qualquer forma, vou curtir cada momento. Rokmora, esmague-os!"
end
L = BigWigs:NewBossLocale("Ularogg Cragshaper", "ptBR")
if L then
L.totems = "Totens"
L.bellow = "{193375} (Totens)" -- Bellow of the Deeps (Totems)
end
|
-- Environment
Environment = _csharp_getType("system.LuaEnvironment");
-- Process
Process = _csharp_getType("system.LuaProcess");
ProcessStartInfo = _csharp_getType("system.LuaProcessStartInfo");
-- URI
Uri = _csharp_getType("system.LuaUri");
-- Time
DateTime = _csharp_getType("system.LuaDateTime");
DateTimeOffset = _csharp_getType("system.LuaDateTimeOffset");
TimeSpan = _csharp_getType("system.LuaTimeSpan"); |
local get_overlays = function(name, overlays_by_part)
local result = ""
for _,overlays in ipairs(overlays_by_part) do
if overlays[name] ~= nil then
result = result.."^"..overlays[name]
end
end
return result
end
local get_texture_by_name = function(name, textures_by_part, fallback_textures_by_part, overlay_textures_by_part)
local overlays = get_overlays(name, overlay_textures_by_part)
for _,textures in ipairs(textures_by_part) do
if textures[name] ~= nil then
return textures[name]..overlays
end
end
for _,fallback_textures in ipairs(fallback_textures_by_part) do
if fallback_textures[name] ~= nil then
return fallback_textures[name]..overlays
end
end
return overlays == "" and "ts_vehicles_api_blank.png" or overlays:sub(2)
end
ts_vehicles.build_textures = function(base_vehicle, texture_names, parts, ...)
local textures = {}
local fallbacks = {}
local overlays = {}
local result = {}
local vehicle_def = ts_vehicles.registered_vehicle_bases[base_vehicle]
local vehicle_compatibilities = ts_vehicles.registered_compatibilities[base_vehicle]
textures[#textures+1] = ts_vehicles.helpers.call(vehicle_def.get_textures, ...)
fallbacks[#fallbacks+1] = ts_vehicles.helpers.call(vehicle_def.get_fallback_textures, ...)
overlays[#overlays+1] = ts_vehicles.helpers.call(vehicle_def.get_overlay_textures, ...)
for _,part in ipairs(parts) do
local def = vehicle_compatibilities[part] or {}
textures[#textures+1] = ts_vehicles.helpers.call(def.get_textures, ...)
fallbacks[#fallbacks+1] = ts_vehicles.helpers.call(def.get_fallback_textures, ...)
overlays[#overlays+1] = ts_vehicles.helpers.call(def.get_overlay_textures, ...)
end
for i,texture_name in ipairs(texture_names) do
result[i] = get_texture_by_name(texture_name, textures, fallbacks, overlays)
end
return result
end
ts_vehicles.build_light_textures = function(base_vehicle, texture_names, parts, ...)
local textures = {}
local fallbacks = {}
local overlays = {}
local result = {}
local vehicle_def = ts_vehicles.registered_vehicle_bases[base_vehicle]
local vehicle_compatibilities = ts_vehicles.registered_compatibilities[base_vehicle]
textures[#textures+1] = ts_vehicles.helpers.call(vehicle_def.get_light_textures, ...)
fallbacks[#fallbacks+1] = ts_vehicles.helpers.call(vehicle_def.get_light_fallback_textures, ...)
overlays[#overlays+1] = ts_vehicles.helpers.call(vehicle_def.get_light_overlay_textures, ...)
for _,part in ipairs(parts) do
local def = vehicle_compatibilities[part] or {}
textures[#textures+1] = ts_vehicles.helpers.call(def.get_light_textures, ...)
fallbacks[#fallbacks+1] = ts_vehicles.helpers.call(def.get_light_fallback_textures, ...)
overlays[#overlays+1] = ts_vehicles.helpers.call(def.get_light_overlay_textures, ...)
end
for i,texture_name in ipairs(texture_names) do
result[i] = get_texture_by_name(texture_name, textures, fallbacks, overlays)
end
return result
end
ts_vehicles.apply_textures = function(self, textures)
self.object:set_properties({
textures = textures
})
end
ts_vehicles.apply_light_textures = function(self, textures)
local light_entity = ts_vehicles.get_light_entity(self)
if light_entity then
light_entity:set_properties({
textures = textures
})
end
end |
local obj = {}
obj.__index = obj
obj.name = "Validator"
function obj:topHalf(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == screen.w and
window.h == (screen.h // 2)
end
function obj:topThird(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == screen.w and
window.h == (screen.h // 3)
end
function obj:topTwoThirds(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == screen.w and
window.h == ((screen.h // 3) * 2)
end
function obj:topLeftHalf(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == screen.w // 2 and
window.h == screen.h // 2
end
function obj:topLeftThird(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == (screen.w // 3) and
window.h == screen.h // 2
end
function obj:topLeftTwoThirds(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == ((screen.w // 3) * 2) and
window.h == screen.h // 2
end
function obj:topRightHalf(window, screen)
return window.x == (screen.w // 2) + screen.x and
window.y == screen.y and
window.w == screen.w // 2 and
window.h == screen.h // 2
end
function obj:topRightThird(window, screen)
return window.x == (((screen.w // 3) * 2) + screen.x) and
window.y == screen.y and
window.w == (screen.w // 3) and
window.h == screen.h // 2
end
function obj:topRightTwoThirds(window, screen)
return window.x == ((screen.w // 3) + screen.x) and
window.y == screen.y and
window.w == ((screen.w // 3) * 2) and
window.h == screen.h // 2
end
function obj:bottomHalf(window, screen)
return window.x == screen.x and
window.y == (screen.h // 2) + screen.y and
window.w == screen.w and
window.h == screen.h // 2
end
function obj:bottomThird(window, screen)
return window.x == screen.x and
window.y == (((screen.h // 3) * 2) + screen.y) and
window.w == screen.w and
window.h == (screen.h // 3)
end
function obj:bottomTwoThirds(window, screen)
return window.x == screen.x and
window.y == ((screen.h // 3) + screen.y) and
window.w == screen.w and
window.h == ((screen.h // 3) * 2)
end
function obj:bottomLeftHalf(window, screen)
return window.x == screen.x and
window.y == screen.h // 2 + screen.y and
window.w == screen.w // 2 and
window.h == screen.h // 2
end
function obj:bottomLeftThird(window, screen)
return window.x == screen.x and
window.y == (screen.h // 2) + screen.y and
window.w == (screen.w // 3) and
window.h == screen.h // 2
end
function obj:bottomLeftTwoThirds(window, screen)
return window.x == screen.x and
window.y == (screen.h // 2) + screen.y and
window.w == ((screen.w // 3) * 2) and
window.h == screen.h // 2
end
function obj:bottomRightThird(window, screen)
return window.x == ((screen.w // 3) * 2) and
window.y == (screen.h // 2) + screen.y and
window.w == (screen.w // 3) and
window.h == screen.h // 2
end
function obj:bottomRightTwoThirds(window, screen)
return window.x == (screen.w // 3) + screen.x and
window.y == (screen.h // 2) + screen.y and
window.w == ((screen.w // 3) * 2) and
window.h == screen.h // 2
end
function obj:bottomRightHalf(window, screen)
return window.x == (screen.w // 2) + screen.x and
window.y == (screen.h // 2) + screen.y and
window.w == screen.w // 2 and
window.h == screen.h // 2
end
function obj:leftHalf(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == screen.w // 2 and
window.h == screen.h
end
function obj:leftThird(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == (screen.w // 3) and
window.h == screen.h
end
function obj:leftTwoThirds(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == ((screen.w // 3) * 2) and
window.h == screen.h
end
function obj:rightHalf(window, screen)
return window.x == (screen.w // 2) + screen.x and
window.y == screen.y and
window.w == screen.w // 2 and
window.h == screen.h
end
function obj:rightThird(window, screen)
return window.x == ((screen.w // 3) * 2 + screen.x) and
window.y == screen.y and
window.w == (screen.w // 3) and
window.h == screen.h
end
function obj:rightTwoThirds(window, screen)
return window.x == ((screen.w // 3) + screen.x) and
window.y == screen.y and
window.w == ((screen.w // 3) * 2) and
window.h == screen.h
end
function obj:centerHorizontalThird(window, screen)
return window.x == screen.x and
window.y == (screen.h // 3) and
window.w == screen.w and
window.h == (screen.h // 3)
end
function obj:centerVerticalThird(window, screen)
return window.x == (screen.w // 3) and
window.y == screen.y and
window.w == (screen.w // 3) and
window.h == screen.h
end
function obj:inScreenBounds(window, screen)
return window.w <= screen.w and
window.h <= screen.h
end
return obj
|
-- Copyright (C) by Kwanhur Huang
describe("create", function()
local path = require('path')
local image_path = path.new('/')
local image_dir = image_path.join(path.currentdir(), "t", "image")
local gd = require("resty.gd")
it("create", function()
local gdImage, err = gd.create(1, 1)
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.create(-1, 1)
assert.is_true(gdImage == nil)
local gdImage, err = gd.create(1, -1)
assert.is_true(gdImage == nil)
local gdImage, err = gd.create(0, 0)
assert.is_true(gdImage == nil)
local gdImage, err = gd.create(0, 1)
assert.is_true(gdImage == nil)
local gdImage, err = gd.create(1, 0)
assert.is_true(gdImage == nil)
end)
it("createTrueColor", function()
local gdImage, err = gd.createTrueColor(1, 1)
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.createTrueColor(-1, 1)
assert.is_true(gdImage == nil)
local gdImage, err = gd.createTrueColor(1, -1)
assert.is_true(gdImage == nil)
local gdImage, err = gd.createTrueColor(0, 0)
assert.is_true(gdImage == nil)
local gdImage, err = gd.createTrueColor(0, 1)
assert.is_true(gdImage == nil)
local gdImage, err = gd.createTrueColor(1, 0)
assert.is_true(gdImage == nil)
end)
it("createFromJpeg", function()
local gdImage, err = gd.createFromJpeg(image_dir .. "/t.jpg")
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.createFromJpeg(image_dir .. "/not_found.jpg")
assert.is_true(gdImage == nil)
end)
it("createFromJpegStr",function()
local f = io.open(image_dir .. "/t.jpg")
local blob = f:read("*a")
f:close()
local gd = require("resty.gd")
local gdImage, err = gd.createFromJpegStr(blob)
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
blob = nil
local gdImage, err = gd.createFromJpegStr(blob)
assert.is_true(gdImage == nil)
blob = ''
local gdImage, err = gd.createFromJpegStr(blob)
assert.is_true(gdImage == nil)
blob = 'kwa'
local gdImage, err = gd.createFromJpegStr(blob)
assert.is_true(gdImage == nil)
end)
it("createFromGif", function()
local gdImage, err = gd.createFromGif(image_dir .. "/t.gif")
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.createFromGif(image_dir .. "/not_found.gif")
assert.is_true(gdImage == nil)
end)
it("createFromGifStr",function()
local f = io.open(image_dir .. "/t.gif")
local blob = f:read("*a")
f:close()
local gdImage, err = gd.createFromGifStr(blob)
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
blob = nil
local gdImage, err = gd.createFromGifStr(blob)
assert.is_true(gdImage == nil)
blob = ''
local gdImage, err = gd.createFromGifStr(blob)
assert.is_true(gdImage == nil)
blob = 'kwa'
local gdImage, err = gd.createFromGifStr(blob)
assert.is_true(gdImage == nil)
end)
it("createFromPng", function()
local gdImage, err = gd.createFromPng(image_dir .. "/gdtest.png")
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.createFromPng(image_dir .. "/not_found.png")
assert.is_true(gdImage == nil)
end)
it("createFromPngStr",function()
local f = io.open(image_dir .. "/gdtest.png")
local blob = f:read("*a")
f:close()
local gdImage, err = gd.createFromPngStr(blob)
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
blob = nil
local gdImage, err = gd.createFromPngStr(blob)
assert.is_true(gdImage == nil)
blob = ''
local gdImage, err = gd.createFromPngStr(blob)
assert.is_true(gdImage == nil)
blob = 'kwa'
local gdImage, err = gd.createFromPngStr(blob)
assert.is_true(gdImage == nil)
end)
-- it("createFromGd", function()
-- local gdImage, err = gd.createFromGd(image_dir .. "/crafted_num_colors.gd")
-- print(err)
-- assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
-- assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
--
-- local gdImage, err = gd.createFromGd(image_dir .. "/not_found.gd")
-- assert.is_true(gdImage == nil)
-- end)
it("createFromGd2", function()
local gdImage, err = gd.createFromGd2(image_dir .. "/gdtest.gd2")
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.createFromGd2(image_dir .. "/not_found.gd2")
assert.is_true(gdImage == nil)
end)
it("createFromGd2Str",function()
local f = io.open(image_dir .. "/gdtest.gd2")
local blob = f:read("*a")
f:close()
local gdImage, err = gd.createFromGd2Str(blob)
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
blob = nil
local gdImage, err = gd.createFromGd2Str(blob)
assert.is_true(gdImage == nil)
blob = ''
local gdImage, err = gd.createFromGd2Str(blob)
assert.is_true(gdImage == nil)
blob = 'kwa'
local gdImage, err = gd.createFromGd2Str(blob)
assert.is_true(gdImage == nil)
end)
it("createFromXbm", function()
local gdImage, err = gd.createFromXbm(image_dir .. "/x10_basic_read.xbm")
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.createFromXbm(image_dir .. "/not_found.xbm")
assert.is_true(gdImage == nil)
end)
-- it("createFromXpm", function()
-- local gdImage, err = gd.createFromXpm(image_dir .. "/color_name.xpm")
-- assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
-- assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
--
-- local gdImage, err = gd.createFromXpm(image_dir .. "/not_found.xpm")
-- assert.is_true(gdImage == nil)
-- end)
it("createFromWebp", function()
local gdImage, err = gd.createFromWebp(image_dir .. "/4917851556.webp")
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.createFromWebp(image_dir .. "/not_found.webp")
assert.is_true(gdImage == nil)
end)
it("createFromWebpStr",function()
local f = io.open(image_dir .. "/4917851556.webp")
local blob = f:read("*a")
f:close()
local gdImage, err = gd.createFromWebpStr(blob)
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
blob = nil
local gdImage, err = gd.createFromWebpStr(blob)
assert.is_true(gdImage == nil)
blob = ''
local gdImage, err = gd.createFromWebpStr(blob)
assert.is_true(gdImage == nil)
blob = 'kwa'
local gdImage, err = gd.createFromWebpStr(blob)
assert.is_true(gdImage == nil)
end)
it("createFromTiff", function()
local gdImage, err = gd.createFromTiff(image_dir .. "/2033418828.tiff")
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
local gdImage, err = gd.createFromTiff(image_dir .. "/not_found.tiff")
assert.is_true(gdImage == nil)
end)
it("createFromTiffStr",function()
local f = io.open(image_dir .. "/2033418828.tiff")
local blob = f:read("*a")
f:close()
local gdImage, err = gd.createFromTiffStr(blob)
assert.is_true(gdImage ~= nil and type(gdImage) == 'table')
assert.is_true(gdImage.im ~= nil and type(gdImage.im) == 'cdata')
blob = nil
local gdImage, err = gd.createFromTiffStr(blob)
assert.is_true(gdImage == nil)
blob = ''
local gdImage, err = gd.createFromTiffStr(blob)
assert.is_true(gdImage == nil)
blob = 'kwa'
local gdImage, err = gd.createFromTiffStr(blob)
assert.is_true(gdImage == nil)
end)
end) |
object_tangible_furniture_wod_themepark_pro_ns_herb_storage = object_tangible_furniture_wod_themepark_shared_pro_ns_herb_storage:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_wod_themepark_pro_ns_herb_storage, "object/tangible/furniture/wod_themepark/pro_ns_herb_storage.iff")
|
-- module describing business system (company, money laundering)
local cfg = module("cfg/business")
local htmlEntities = module("lib/htmlEntities")
local lang = vRP.lang
local sanitizes = module("cfg/sanitizes")
-- sql
MySQL.createCommand("vRP/business_tables",[[
CREATE TABLE IF NOT EXISTS vrp_user_business(
user_id INTEGER,
name VARCHAR(30),
description TEXT,
capital INTEGER,
laundered INTEGER,
reset_timestamp INTEGER,
CONSTRAINT pk_user_business PRIMARY KEY(user_id),
CONSTRAINT fk_user_business_users FOREIGN KEY(user_id) REFERENCES vrp_users(id) ON DELETE CASCADE
);
]])
MySQL.createCommand("vRP/create_business","INSERT IGNORE INTO vrp_user_business(user_id,name,description,capital,laundered,reset_timestamp) VALUES(@user_id,@name,'',@capital,0,@time)")
MySQL.createCommand("vRP/delete_business","DELETE FROM vrp_user_business WHERE user_id = @user_id")
MySQL.createCommand("vRP/get_business","SELECT name,description,capital,laundered,reset_timestamp FROM vrp_user_business WHERE user_id = @user_id")
MySQL.createCommand("vRP/add_capital","UPDATE vrp_user_business SET capital = capital + @capital WHERE user_id = @user_id")
MySQL.createCommand("vRP/add_laundered","UPDATE vrp_user_business SET laundered = laundered + @laundered WHERE user_id = @user_id")
MySQL.createCommand("vRP/get_business_page","SELECT user_id,name,description,capital FROM vrp_user_business ORDER BY capital DESC LIMIT @b,@n")
MySQL.createCommand("vRP/reset_transfer","UPDATE vrp_user_business SET laundered = 0, reset_timestamp = @time WHERE user_id = @user_id")
-- init
MySQL.execute("vRP/business_tables")
-- api
-- cbreturn user business data or nil
function vRP.getUserBusiness(user_id, cbr)
local task = Task(cbr)
if user_id ~= nil then
MySQL.query("vRP/get_business", {user_id = user_id}, function(rows, affected)
local business = rows[1]
-- when a business is fetched from the database, check for update of the laundered capital transfer capacity
if business and os.time() >= business.reset_timestamp+cfg.transfer_reset_interval*60 then
MySQL.execute("vRP/reset_transfer", {user_id = user_id, time = os.time()})
business.laundered = 0
end
task({business})
end)
else
task()
end
end
-- close the business of an user
function vRP.closeBusiness(user_id)
MySQL.execute("vRP/delete_business", {user_id = user_id})
end
-- business interaction
-- page start at 0
local function open_business_directory(player,page) -- open business directory with pagination system
if page < 0 then page = 0 end
local menu = {name=lang.business.directory.title().." ("..page..")",css={top="75px",header_color="rgba(240,203,88,0.75)"}}
MySQL.query("vRP/get_business_page", {b = page*10, n = 10}, function(rows, affected)
local count = 0
for k,v in pairs(rows) do
count = count+1
local row = v
if row.user_id ~= nil then
-- get owner identity
vRP.getUserIdentity(row.user_id,function(identity)
if identity then
menu[htmlEntities.encode(row.name)] = {function()end, lang.business.directory.info({row.capital,htmlEntities.encode(identity.name),htmlEntities.encode(identity.firstname),identity.registration,identity.phone})}
end
-- check end, open menu
count = count-1
if count == 0 then
menu[lang.business.directory.dnext()] = {function() open_business_directory(player,page+1) end}
menu[lang.business.directory.dprev()] = {function() open_business_directory(player,page-1) end}
vRP.openMenu(player,menu)
end
end)
end
end
end)
end
local function business_enter()
local source = source
local user_id = vRP.getUserId(source)
if user_id ~= nil then
-- build business menu
local menu = {name=lang.business.title(),css={top="75px",header_color="rgba(240,203,88,0.75)"}}
vRP.getUserBusiness(user_id, function(business)
if business then -- have a business
-- business info
menu[lang.business.info.title()] = {function(player,choice)
end, lang.business.info.info({htmlEntities.encode(business.name), business.capital, business.laundered})}
-- add capital
menu[lang.business.addcapital.title()] = {function(player,choice)
vRP.prompt(player,lang.business.addcapital.prompt(),"",function(player,amount)
amount = parseInt(amount)
if amount > 0 then
if vRP.tryPayment(user_id,amount) then
MySQL.execute("vRP/add_capital", {user_id = user_id, capital = amount})
vRPclient.notify(player,{lang.business.addcapital.added({amount})})
else
vRPclient.notify(player,{lang.money.not_enough()})
end
else
vRPclient.notify(player,{lang.common.invalid_value()})
end
end)
end,lang.business.addcapital.description()}
-- money laundered
menu[lang.business.launder.title()] = {function(player,choice)
vRP.getUserBusiness(user_id, function(business) -- update business data
local launder_left = math.min(business.capital-business.laundered,vRP.getInventoryItemAmount(user_id,"dirty_money")) -- compute launder capacity
vRP.prompt(player,lang.business.launder.prompt({launder_left}),""..launder_left,function(player,amount)
amount = parseInt(amount)
if amount > 0 and amount <= launder_left then
if vRP.tryGetInventoryItem(user_id,"dirty_money",amount,false) then
-- add laundered amount
MySQL.execute("vRP/add_laundered", {user_id = user_id, laundered = amount})
-- give laundered money
vRP.giveMoney(user_id,amount)
vRPclient.notify(player,{lang.business.launder.laundered({amount})})
else
vRPclient.notify(player,{lang.business.launder.not_enough()})
end
else
vRPclient.notify(player,{lang.common.invalid_value()})
end
end)
end)
end,lang.business.launder.description()}
else -- doesn't have a business
menu[lang.business.open.title()] = {function(player,choice)
vRP.prompt(player,lang.business.open.prompt_name({30}),"",function(player,name)
if string.len(name) >= 2 and string.len(name) <= 30 then
name = sanitizeString(name, sanitizes.business_name[1], sanitizes.business_name[2])
vRP.prompt(player,lang.business.open.prompt_capital({cfg.minimum_capital}),""..cfg.minimum_capital,function(player,capital)
capital = parseInt(capital)
if capital >= cfg.minimum_capital then
if vRP.tryPayment(user_id,capital) then
MySQL.execute("vRP/create_business", {
user_id = user_id,
name = name,
capital = capital,
time = os.time()
})
vRPclient.notify(player,{lang.business.open.created()})
vRP.closeMenu(player) -- close the menu to force update business info
else
vRPclient.notify(player,{lang.money.not_enough()})
end
else
vRPclient.notify(player,{lang.common.invalid_value()})
end
end)
else
vRPclient.notify(player,{lang.common.invalid_name()})
end
end)
end,lang.business.open.description({cfg.minimum_capital})}
end
-- business list
menu[lang.business.directory.title()] = {function(player,choice)
open_business_directory(player,0)
end,lang.business.directory.description()}
-- open menu
vRP.openMenu(source,menu)
end)
end
end
local function business_leave()
vRP.closeMenu(source)
end
local function build_client_business(source) -- build the city hall area/marker/blip
local user_id = vRP.getUserId(source)
if user_id ~= nil then
for k,v in pairs(cfg.commerce_chambers) do
local x,y,z = table.unpack(v)
vRPclient.addBlip(source,{x,y,z,cfg.blip[1],cfg.blip[2],lang.business.title()})
vRPclient.addMarker(source,{x,y,z-1,0.7,0.7,0.5,0,255,125,125,150})
vRP.setArea(source,"vRP:business"..k,x,y,z,1,1.5,business_enter,business_leave)
end
end
end
AddEventHandler("vRP:playerSpawn",function(user_id, source, first_spawn)
-- first spawn, build business
if first_spawn then
build_client_business(source)
end
end)
|
object_tangible_quest_camp_crate = object_tangible_quest_shared_camp_crate:new {
}
ObjectTemplates:addTemplate(object_tangible_quest_camp_crate, "object/tangible/quest/camp_crate.iff")
|
object_weapon_ranged_creature_shared_creature_spit_hoth_tauntaun = SharedWeaponObjectTemplate:new {
clientTemplateFileName = "object/weapon/ranged/creature/shared_creature_spit_hoth_tauntaun.iff"
}
ObjectTemplates:addClientTemplate(object_weapon_ranged_creature_shared_creature_spit_hoth_tauntaun, "object/weapon/ranged/creature/shared_creature_spit_hoth_tauntaun.iff")
|
module("think", package.seeall)
require "bots/dota2_nn/nn_items"
require "bots/dota2_nn/nn_move"
require "bots/dota2_nn/util"
local function DoLastHitThink(creeps, unit)
-- do laning/last hit/deny
for _, creep in ipairs(creeps) do
if creep:GetHealth() < unit:GetAttackDamage() and (creep:GetTeam() == bit.bxor(GetTeam(), 1)
or #creep:GetNearbyHeroes(1300, true)) then
unit.lastInput[1] = DotaTime() / 3600
unit:ActionPush_MoveToLocation(creep:GetLocation())
unit:ActionPush_AttackUnit(creep, true)
end
end
end
local function DoRuneThink(unit)
-- check to see if there are any runes nearby
-- if so pick them up
for _, rune in ipairs(util.runes) do
if GetUnitToLocationDistance(unit, GetRuneSpawnLocation(rune)) <= 800
and GetRuneStatus(rune) == RUNE_STATUS_AVAILABLE then
util.Debug("picking up rune " .. rune)
unit:ActionPush_PickUpRune(rune)
return true
end
end
return false
end
local function DoMoveThink(unit)
unit.fountainBuy = false -- we're leaving the fountain
if DoRuneThink(unit) then -- check for nearby runes (returns true if we're fetching one)
return
end
if unit.moveResult ~= nil then -- we got a response from a previous NN query
nn_move.FinishMoveThink(unit)
elseif not nn_move.StartMoveThink(unit) then -- do move think, returns false if it's not going to move
creeps = unit:GetNearbyLaneCreeps(1600, true)
if #creeps > 0 then -- do laning
util.Debug("laning")
DoLastHitThink(creeps, unit)
end
end
end
-- Hero think entry point
function Entry(unit)
local me = unit or GetBot() -- unit is nil if we came from Think
if me:GetUnitName() == "npc_dota_hero_wisp_spirit" then
return
end
if GetBot().itemTimer == nil then -- init item timer if we haven't already
GetBot().itemTimer = 0
end
-- error message from a thread doing an HTTP request?
if me.callback_err ~= nil then
me:ActionImmediate_Chat(me.callback_err, true) -- post it in chat so we can see the unit too
me.callback_err = nil
end
if not me:IsAlive() then
DoBuybackThink() -- dead; see if we should buyback
elseif me:DistanceFromFountain() < 1200 and
(me:GetHealth() ~= me:GetMaxHealth() or me:GetMana() ~= me:GetMaxMana()) then
-- wait for regen at fountain
if not me.fountainBuy then
nn_items.StartItemThink() -- force item think if we haven't yet
me.fountainBuy = true
end
else
DoMoveThink(me) -- actual thinking
end
if me.itemTimer ~= nil then -- check item timer
if me.itemTimer == 0 then -- item timer is done, get items
nn_items.StartItemThink()
else
me.itemTimer = me.itemTimer - 1
if me.itemsResult ~= nil then
nn_items.FinishItemThink()
end
end
end
-- run any courier tasks
local courier_queue = nn_items.GetCourierQueue()
if GetCourierState(GetCourier(1)) == COURIER_STATE_IDLE and courier_queue.head then
local next_user = courier_queue.tail.data
if IsCourierAvailable() then
coroutine.resume(next_user)
if coroutine.status(next_user) == "dead" then
nn_items.PopCourierQueue()
end
end
end
end |
Jobs.RegisterServerCallback('esx_jobs:getPlayerGender', function(xPlayer, xJob, callback)
MySQL.Async.fetchAll('SELECT `skin` FROM `users` WHERE `identifier` = @identifier', {
['@identifier'] = xPlayer.identifier
}, function(userResult)
if (userResult ~= nil and userResult[1] ~= nil) then
local skin = json.decode(userResult[1].skin or '{}')
local gender = 'male'
if (tonumber(skin.sex or '0') == 1) then
gender = 'female'
end
callback(gender)
end
end)
end) |
input = io.read("*line")
print("Hello, World.");
print(input);
|
local Message = 0
function love.load()
love.graphics.setDefaultFilter("nearest", "nearest")
Heroset = love.graphics.newImage("assets/hero.png")
HerosetW, HerosetH = Heroset:getWidth(), Heroset:getHeight()
HeroW, HeroH = 16, 16
HeroQuad = love.graphics.newQuad(16, 32, HeroW, HeroH, HerosetW, HerosetH)
-- Animation parameters
FPS = 6
AnimationTimer = 1 / FPS
Frame = 1
NumberOfFrames = 6
Xoffset = 16
end
function love.update(dt)
AnimationTimer = AnimationTimer - dt
if AnimationTimer <= 0 then
AnimationTimer = 1 / FPS
Frame = Frame + 1
if Frame > NumberOfFrames then Frame = 1 end
Xoffset = 16 * Frame
HeroQuad:setViewport(Xoffset, 32, 16, 16)
end
end
function love.draw()
love.graphics.print(Message, 0, 0)
love.graphics.draw(Heroset, HeroQuad, 320, 180, 0, 8, 8)
end |
-- detours so stuff go through portals
AddCSLuaFile()
-- bullet detour
hook.Add("EntityFireBullets", "seamless_portal_detour_bullet", function(entity, data)
if !SeamlessPortals or SeamlessPortals.PortalIndex < 1 then return end
local tr = SeamlessPortals.TraceLine({start = data.Src, endpos = data.Src + data.Dir * data.Distance, filter = entity})
local hitPortal = tr.Entity
if !hitPortal:IsValid() then return end
if hitPortal:GetClass() == "seamless_portal" and hitPortal:ExitPortal() then
if (tr.HitPos - hitPortal:GetPos()):Dot(hitPortal:GetUp()) > 0 then
local newPos, newAng = SeamlessPortals.TransformPortal(hitPortal, hitPortal:ExitPortal(), tr.HitPos, data.Dir:Angle())
--ignoreentity doesnt seem to work for some reason
data.IgnoreEntity = hitPortal:ExitPortal()
data.Src = newPos
data.Dir = newAng:Forward()
data.Tracer = 0
return true
end
end
end)
-- effect detour (Thanks to WasabiThumb)
local oldUtilEffect = util.Effect
local function effect(name, b, c, d)
if SeamlessPortals.PortalIndex > 0 and (name == "phys_freeze" or name == "phys_unfreeze") then return end
oldUtilEffect(name, b, c, d)
end
util.Effect = effect
-- super simple traceline detour
SeamlessPortals = SeamlessPortals or {}
SeamlessPortals.TraceLine = SeamlessPortals.TraceLine or util.TraceLine
local function editedTraceLine(data)
local tr = SeamlessPortals.TraceLine(data)
if tr.Entity:IsValid() and tr.Entity:GetClass() == "seamless_portal" and tr.Entity:ExitPortal() and tr.Entity:ExitPortal():IsValid() then
local hitPortal = tr.Entity
if tr.HitNormal:Dot(hitPortal:GetUp()) > 0 then
local editeddata = table.Copy(data)
editeddata.start = SeamlessPortals.TransformPortal(hitPortal, hitPortal:ExitPortal(), tr.HitPos)
editeddata.endpos = SeamlessPortals.TransformPortal(hitPortal, hitPortal:ExitPortal(), data.endpos)
-- filter the exit portal from being hit by the ray
if IsEntity(data.filter) and data.filter:GetClass() != "player" then
editeddata.filter = {data.filter, hitPortal:ExitPortal()}
else
if istable(editeddata.filter) then
table.insert(editeddata.filter, hitPortal:ExitPortal())
else
editeddata.filter = hitPortal:ExitPortal()
end
end
return SeamlessPortals.TraceLine(editeddata)
end
end
return tr
end
-- use original traceline if there are no portals
timer.Create("seamless_portals_traceline", 1, 0, function()
if SeamlessPortals.PortalIndex > 0 then
util.TraceLine = editedTraceLine
else
util.TraceLine = SeamlessPortals.TraceLine -- THE ORIGINAL TRACELINE
end
end)
if SERVER then return end
-- sound detour
hook.Add("EntityEmitSound", "seamless_portals_detour_sound", function(t)
if !SeamlessPortals or SeamlessPortals.PortalIndex < 1 then return end
for k, v in ipairs(ents.FindByClass("seamless_portal")) do
if !v.ExitPortal or !v:ExitPortal() or !v:ExitPortal():IsValid() then continue end
if !t.Pos or !t.Entity or t.Entity == NULL then continue end
if t.Pos:DistToSqr(v:GetPos()) < 50000 * v:ExitPortal():GetExitSize()[1] and (t.Pos - v:GetPos()):Dot(v:GetUp()) > 0 then
local newPos, _ = SeamlessPortals.TransformPortal(v, v:ExitPortal(), t.Pos, Angle())
local oldPos = t.Entity:GetPos() or Vector()
t.Entity:SetPos(newPos)
EmitSound(t.SoundName, newPos, t.Entity:EntIndex(), t.Channel, t.Volume, t.SoundLevel, t.Flags, t.Pitch, t.DSP)
t.Entity:SetPos(oldPos)
end
end
end)
|
dofilepath("data:scripts/FX_resfinder.lua")
MovieScreen =
{
displayName = "$90138",
helpTip = "$90139",
Layout = {size_WH = { w = 1, h = 1, wr = "scr", hr = "scr" },},
stylesheet = "HW2StyleSheet",
RootElementSettings =
{
backgroundColor = {0,0,0,0},
},
-- uncomment the following to enable speech playback during the animatic
speechFilename = "locale:animatics/taimini.lua",
;
{
type = "Movie",
name = "MyMovie",
Layout = {
pos_XY = { x = 0.5, y = 0.5, xr = "par", yr = "par" },
pivot_XY = { 0.5, 0.5 },
lockAspect=1920/1080,
size_WH = { w = 100000, h = 1, wr = "px", hr = "par" },
max_WH = { w = 1, h = 1, wr = "par", hr = "par" },
},
--greyScale = 1,
--fitScreen = 1,
filenameV = LW_findres("taimini.webm"),
-- filenameA = "data:Sound/Music/ANIMATIC/ANIM_00_Opening",
},
}
|
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local UF = E:GetModule('UnitFrames');
--Cache global variables
--Lua functions
--WoW API / Variables
local CreateFrame = CreateFrame
function UF:Construct_ArenaTargetIcon(frame)
local targetIcon = CreateFrame("Frame", nil, frame)
targetIcon:SetFrameLevel(frame.RaisedElementParent:GetFrameLevel() + 10)
targetIcon.bg = CreateFrame("Frame", nil, targetIcon)
targetIcon.bg:SetTemplate("Default", nil, nil, self.thinBorders)
targetIcon.bg:SetFrameLevel(targetIcon:GetFrameLevel() - 1)
targetIcon:SetInside(targetIcon.bg)
targetIcon.Name = targetIcon:CreateFontString(nil, 'OVERLAY')
UF:Configure_FontString(targetIcon.Name)
return targetIcon
end
function UF:Configure_ArenaTargetIcon(frame)
if not frame.VARIABLES_SET then return end
local db = frame.db
local targetIcon = frame.ArenaTargetIcon
targetIcon.bg:Size(db.arenaTargetIcon.size)
targetIcon.bg:ClearAllPoints()
if db.arenaTargetIcon.position == 'RIGHT' then
targetIcon.bg:Point('LEFT', frame, 'RIGHT', db.arenaTargetIcon.xOffset, db.arenaTargetIcon.yOffset)
else
targetIcon.bg:Point('RIGHT', frame, 'LEFT', db.arenaTargetIcon.xOffset, db.arenaTargetIcon.yOffset)
end
targetIcon.showEnemy = db.arenaTargetIcon.showEnemy
targetIcon.Name:ClearAllPoints()
if db.arenaTargetIcon.Name then
targetIcon.Name:Point("CENTER", targetIcon, "CENTER", db.arenaTargetIcon.NamexOffset, db.arenaTargetIcon.NameyOffset)
end
if db.arenaTargetIcon.enable and not frame:IsElementEnabled('ArenaTargetIcon') then
frame:EnableElement('ArenaTargetIcon')
elseif not db.arenaTargetIcon.enable and frame:IsElementEnabled('ArenaTargetIcon') then
frame:DisableElement('ArenaTargetIcon')
end
end |
local CONTAINS_DASH = "^(.*)%-([^.]+)"
if string.match(ngx.var.http_host, CONTAINS_DASH) then
ngx.var.port = 10002
else
ngx.var.port = 7071
end
|
#!/usr/bin/env tarantool
test = require("sqltester")
test:plan(3)
--!./tcltestrunner.lua
-- 2013 March 05
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, never taking more than you give.
--
-------------------------------------------------------------------------
-- This file implements regression tests for SQLite library. Specifically,
-- it tests that ticket [868145d012a1] is fixed.
--
-- ["set","testdir",[["file","dirname",["argv0"]]]]
-- ["source",[["testdir"],"\/tester.tcl"]]
test:do_execsql_test(
"tkt-868145d012.100",
[[
CREATE TABLE p (
id INTEGER PRIMARY KEY,
uid VARCHAR(36),
t INTEGER
);
CREATE TABLE pa (
id INTEGER PRIMARY KEY,
a_uid VARCHAR(36)
);
CREATE TABLE a (
id INTEGER PRIMARY KEY,
uid VARCHAR(36),
t INTEGER
);
INSERT INTO pa VALUES(1,'1234');
INSERT INTO pa VALUES(2,'2345');
INSERT INTO p VALUES(3,'1234',97);
INSERT INTO p VALUES(4,'1234',98);
INSERT INTO a VALUES(5,'1234',98);
INSERT INTO a VALUES(6,'1234',99);
]], {
-- <tkt-868145d012.100>
-- </tkt-868145d012.100>
})
test:do_execsql_test(
"tkt-868145d012.110",
[[
SELECT DISTINCT pa.id, p.id, a.id
FROM
pa
LEFT JOIN p ON p.uid='1234'
LEFT JOIN a ON a.uid=pa.a_uid
WHERE
a.t=p.t
;
]], {
-- <tkt-868145d012.110>
1, 4, 5
-- </tkt-868145d012.110>
})
test:do_execsql_test(
"tkt-868145d012.120",
[[
SELECT DISTINCT pa.id, p.id, a.id
FROM
pa
LEFT JOIN p ON p.uid='1234'
LEFT JOIN a ON a.uid=pa.a_uid AND a.t=p.t
ORDER BY 1, 2, 3
;
]], {
-- <tkt-868145d012.120>
1, 3, "", 1, 4, 5, 2, 3, "", 2, 4, ""
-- </tkt-868145d012.120>
})
test:finish_test()
|
local resty_lrucache = require('resty.lrucache')
describe('Caching policy', function()
local cache
local caching_policy
local cache_handler
before_each(function()
cache = resty_lrucache.new(1)
-- The code uses ngx.shared.dict and it defines .add(), resty_lrucache
-- does not, so we need to implement it for these tests.
cache.add = function(self, key, value)
if not self:get(key) then
return self:set(key, value)
end
end
end)
describe('.new', function()
it('disables caching when caching type is not specified', function()
caching_policy = require('apicast.policy.caching').new({})
cache_handler = caching_policy:export().cache_handler
cache_handler(cache, 'a_key', { status = 200 }, nil)
assert.is_nil(cache:get('a_key'))
end)
end)
describe('.export', function()
describe('when configured as strict', function()
before_each(function()
local config = { caching_type = 'strict' }
caching_policy = require('apicast.policy.caching').new(config)
cache_handler = caching_policy:export().cache_handler
end)
it('caches authorized requests', function()
cache_handler(cache, 'a_key', { status = 200 }, nil)
assert.equals(200, cache:get('a_key'))
end)
it('clears the cache entry for a request when it is denied', function()
cache:set('a_key', 200)
cache_handler(cache, 'a_key', { status = 403 }, nil)
assert.is_nil(cache:get('a_key'))
end)
it('clears the cache entry for a request when it fails', function()
cache:set('a_key', 200)
cache_handler(cache, 'a_key', { status = 500 }, nil)
assert.is_nil(cache:get('a_key'))
end)
end)
describe('when configured as resilient', function()
before_each(function()
local config = { caching_type = 'resilient' }
caching_policy = require('apicast.policy.caching').new(config)
cache_handler = caching_policy:export().cache_handler
end)
it('caches authorized requests', function()
cache_handler(cache, 'a_key', { status = 200 }, nil)
assert.equals(200, cache:get('a_key'))
end)
it('caches denied requests', function()
cache_handler(cache, 'a_key', { status = 403 }, nil)
assert.equals(403, cache:get('a_key'))
end)
it('does not clear the cache entry for a request when it fails', function()
cache:set('a_key', 200)
cache_handler(cache, 'a_key', { status = 500 }, nil)
assert.equals(200, cache:get('a_key'))
end)
it('does not cached connect issues', function()
cache_handler(cache, 'a_key', { status = 0 }, nil)
assert.equals(nil, cache:get('a_key'))
end)
end)
describe('when configured as allow', function()
before_each(function()
local config = { caching_type = 'allow' }
caching_policy = require('apicast.policy.caching').new(config)
cache_handler = caching_policy:export().cache_handler
end)
it('caches authorized requests', function()
cache_handler(cache, 'a_key', { status = 200 }, nil)
assert.equals(200, cache:get('a_key'))
end)
it('caches denied requests', function()
cache_handler(cache, 'a_key', { status = 403 }, nil)
assert.equals(403, cache:get('a_key'))
end)
it('does not cached connect issues', function()
cache_handler(cache, 'a_key', { status = 0 }, nil)
assert.equals(200, cache:get('a_key'))
end)
describe('and backend returns 5XX', function()
it('does not invalidate the cache entry if there was a 4XX', function()
cache:set('a_key', 403)
cache_handler(cache, 'a_key', { status = 500 }, nil)
assert.equals(403, cache:get('a_key'))
end)
it('caches a 200 if there was nothing in the cache entry', function()
cache_handler(cache, 'a_key', { status = 500 }, nil)
assert.equals(200, cache:get('a_key'))
end)
it('caches a 200 if there was something != 4XX in the cache entry', function()
cache:set('a_key', 200)
cache_handler(cache, 'a_key', { status = 500 }, nil)
assert.equals(200, cache:get('a_key'))
end)
end)
end)
describe('when disabled', function()
setup(function()
local config = { caching_type = 'none' }
caching_policy = require('apicast.policy.caching').new(config)
cache_handler = caching_policy:export().cache_handler
end)
it('does not cache anything', function()
cache_handler(cache, 'a_key', { status = 200 }, nil)
assert.is_nil(cache:get('a_key'))
end)
it("clears the cache if it's present", function()
-- THREESCALE-4464
cache:set('a_key', 200)
cache_handler(cache, 'a_key', { status = 200 }, nil)
assert.is_nil(cache:get('a_key'))
end)
end)
end)
end)
|
local PANEL = {}
PANEL.Base = "DFrame"
function PANEL:Init()
self.HTML = vgui.Create( "Chromium", self )
-- Trying to open credits on a non-cef build?
if ( !self.HTML ) then
self:Remove()
return
end
self.HTML:Dock( FILL )
self.HTML:OpenURL( "chrome://credits/" )
self.HTML:SetOpenLinksExternally( true )
self:SetTitle( "Chromium Embedded Framework Credits" )
self:SetPos( 16, 16 )
self:SetSize( 720, 400 )
self:SetSizable( true )
self:MakePopup()
end
concommand.Add( "cef_credits", function()
vgui.CreateFromTable( PANEL )
end )
concommand.Add( "gmod_tos", function()
gui.OpenURL( "https://gmod.facepunch.com/legal/tos" )
end )
concommand.Add( "gmod_privacy", function()
gui.OpenURL( "https://gmod.facepunch.com/legal/privacy" )
end )
|
local lexit = {}
lexit.KEY = 1
lexit.ID = 2
lexit.NUMLIT = 3
lexit.STRLIT = 4
lexit.OP = 5
lexit.PUNCT = 6
lexit.MAL = 7
lexit.catnames = {
"Keyword",
"Identifier",
"NumericLiteral",
"StringLiteral",
"Operator",
"Punctuation",
"Malformed"
}
-- Character identification functions
local function isLetter(c)
if c:len() == 1 and ((c >= "A" and c <= "Z") or (c >= "a" and c <= "z")) then
return true
end
return false
end
local function isDigit(c)
if c:len() == 1 and (c >= "0" and c <= "9") then
return true
end
return false
end
local function isWhitespace(c)
if c:len() == 1 and (c == " " or c == "\t" or c == "\v" or c == "\n" or c == "\r" or c == "\f") then
return true
end
return false
end
local function isPrintableASCII(c)
if c:len() == 1 and c >= " " and c <= "~" then
return true
else
return false
end
end
local function isIllegal(c)
if isWhitespace(c) or isPrintableASCII(c) then
return false
else
return true
end
end
-- Lexer
function lexit.lex(program)
-- data members
local pos
local state
local ch
local lexstr
local category
local handlers
-- States
local DONE = 0
local START = 1
local LETTER = 2
local DIGIT = 3
local EXPONENT = 4
local QUOTE = 5
local EQUAL = 6
local BANG = 7
local LESSTHAN = 8
local GREATERTHAN = 9
local PLUS = 10
local MINUS = 11
local STAR = 12
local FSLASH = 13
local MODULO = 14
local RBRACKET = 15
local LBRACKET = 16
local COMMENT = 17
local function currChar()
return program:sub(pos,pos)
end
local function nextChar()
return program:sub(pos+1,pos+1)
end
local function next2Char()
return program:sub(pos+2,pos+2)
end
local function drop1()
pos = pos + 1
end
local function add1()
lexstr = lexstr .. currChar()
drop1()
end
local function skipToNextLexeme()
while true do
while isWhitespace(currChar()) do
drop1()
end
if currChar() ~= "#" then
break
end
drop1()
while true do
if currChar() == "\n" then
drop1()
break
elseif currChar() == "" then
return
end
drop1()
end
end
end
--State handlers
local function handle_DONE()
error("'DONE' state should not be handled\n")
end
local function handle_START()
if isIllegal(ch) then
add1()
state = DONE
category = lexit.MAL
elseif isLetter(ch) or ch == "_" then
add1()
state = LETTER
elseif isDigit(ch) then
add1()
state = DIGIT
elseif ch == '"' or ch == "'" then
add1()
state = QUOTE
elseif ch == '=' then
add1()
state = EQUAL
elseif ch == '!' then
add1()
state = BANG
elseif ch == '<' then
add1()
state = LESSTHAN
elseif ch == '>' then
add1()
state = GREATERTHAN
elseif ch == '+' then
add1()
state = PLUS
elseif ch == '-' then
add1()
state = MINUS
elseif ch == '*' then
add1()
state = STAR
elseif ch == '/' then
add1()
state = FSLASH
elseif ch == '%' then
add1()
state = MODULO
elseif ch == '[' then
add1()
state = LBRACKET
elseif ch == ']' then
add1()
state = RBRACKET
elseif ch == '#' then
add1()
state = COMMENT
elseif isWhitespace(ch) then
drop1()
else
add1()
state = DONE
category = lexit.PUNCT
end
end
local function handle_LETTER()
if isLetter(ch) or ch == '_' or isDigit(ch) then
add1()
else
state = DONE
if lexstr == "and" or lexstr == "char" or lexstr == "cr" or lexstr == "elif" or
lexstr == "else" or lexstr == "false" or lexstr == "func" or lexstr == "if" or
lexstr == "not" or lexstr == "or" or lexstr == "print" or lexstr == "read" or
lexstr == "return" or lexstr == "true" or lexstr == "while" then
category = lexit.KEY
else
category = lexit.ID
end
end
end
local function handle_DIGIT()
if isDigit(ch) then
add1()
elseif (ch == "e" or ch == "E") and (isDigit(nextChar()) or (nextChar() == '+' and isDigit(next2Char()))) then
add1()
state = EXPONENT
else
state = DONE
category = lexit.NUMLIT
end
end
local function handle_EXPONENT()
if isDigit(ch) or ch == "+" then
add1()
else
state = DONE
category = lexit.NUMLIT
end
end
local function handle_QUOTE()
local qc = lexstr:sub(1,1)
while currChar() ~= qc do
if currChar() == '\n' or currChar() == '' then
category = lexit.MAL
state = DONE
return
end
add1()
end
add1()
state = DONE
category = lexit.STRLIT
end
local function handle_EQUAL()
if currChar() == '=' then
add1()
end
state = DONE
category = lexit.OP
end
local function handle_BANG()
if currChar() == '=' then
add1()
state = DONE
category = lexit.OP
else
state = DONE
category = lexit.PUNCT
end
end
local function handle_LESSTHAN()
if currChar() == '=' then
add1()
end
state = DONE
category = lexit.OP
end
local function handle_GREATERTHAN()
if currChar() == '=' then
add1()
end
state = DONE
category = lexit.OP
end
local function handle_PLUS()
state = DONE
category = lexit.OP
end
local function handle_MINUS()
state = DONE
category = lexit.OP
end
local function handle_STAR()
state = DONE
category = lexit.OP
end
local function handle_FSLASH()
state = DONE
category = lexit.OP
end
local function handle_MODULO()
state = DONE
category = lexit.OP
end
local function handle_RBRACKET()
state = DONE
category = lexit.OP
end
local function handle_LBRACKET()
state = DONE
category = lexit.OP
end
local function handle_COMMENT()
skipToNextLexeme()
end
handlers = {
[DONE] = handle_DONE,
[START] = handle_START,
[LETTER] = handle_LETTER,
[DIGIT] = handle_DIGIT,
[EXPONENT] = handle_EXPONENT,
[QUOTE] = handle_QUOTE,
[EQUAL] = handle_EQUAL,
[BANG] = handle_BANG,
[LESSTHAN] = handle_LESSTHAN,
[GREATERTHAN] = handle_GREATERTHAN,
[PLUS] = handle_PLUS,
[MINUS] = handle_MINUS,
[STAR] = handle_STAR,
[FSLASH] = handle_FSLASH,
[MODULO] = handle_MODULO,
[RBRACKET] = handle_RBRACKET,
[LBRACKET] = handle_LBRACKET,
[COMMENT] = handle_COMMENT,
}
local function getLexeme(dummy1, dummy2)
if pos > program:len() then
return nil, nil
end
lexstr = ""
state = START
while state ~= DONE do
ch = currChar()
handlers[state]()
end
skipToNextLexeme()
return lexstr, category
end
pos = 1
skipToNextLexeme()
return getLexeme, nil, nil
end
return lexit |
-- os Additions
function os.getSystemBit()
if (os.getenv('PROCESSOR_ARCHITEW6432')=='AMD64' or os.getenv('PROCESSOR_ARCHITECTURE')=='AMD64') then
return 64
else
return 32
end
end
function os.sleep(n)
if not n then n=0 end
local t0 = os.clock()
while os.clock() - t0 <= n do end
end
function os.pause(msg)
if msg ~= nil then
print(msg)
end
io.read()
end
function os.batCmd(cmd)
io.mkFile('temp.bat',cmd)
local temp = os.execute([[temp.bat]])
io.delFile('temp.bat')
return temp
end
function os._getOS()
if package.config:sub(1,1)=='\\' then
return 'windows'
else
return 'unix'
end
end
function os.getOS(t)
if not t then
return os._getOS()
end
if os._getOS()=='unix' then
fh,err = io.popen('uname -o 2>/dev/null','r')
if fh then
osname = fh:read()
end
if osname then return osname end
end
local winver='Unknown Version'
local a,b,c=os.capture('ver'):match('(%d+).(%d+).(%d+)')
local win=a..'.'..b..'.'..c
if type(t)=='string' then
win=t
end
if win=='4.00.950' then
winver='95'
elseif win=='4.00.1111' then
winver='95 OSR2'
elseif win=='4.00.1381' then
winver='NT 4.0'
elseif win=='4.10.1998' then
winver='98'
elseif win=='4.10.2222' then
winver='98 SE'
elseif win=='4.90.3000' then
winver='ME'
elseif win=='5.00.2195' then
winver='2000'
elseif win=='5.1.2600' then
winver='XP'
elseif win=='5.2.3790' then
winver='Server 2003'
elseif win=='6.0.6000' then
winver='Vista/Windows Server 2008'
elseif win=='6.0.6002' then
winver='Vista SP2'
elseif win=='6.1.7600' then
winver='7/Windows Server 2008 R2'
elseif win=='6.1.7601' then
winver='7 SP1/Windows Server 2008 R2 SP1'
elseif win=='6.2.9200' then
winver='8/Windows Server 2012'
elseif win=='6.3.9600' then
winver='8.1/Windows Server 2012'
elseif win=='6.4.9841' then
winver='10 Technical Preview 1'
elseif win=='6.4.9860' then
winver='10 Technical Preview 2'
elseif win=='6.4.9879' then
winver='10 Technical Preview 3'
elseif win=='10.0.9926' then
winver='10 Technical Preview 4'
end
return 'Windows '..winver
end
function os.getLuaArch()
return (#tostring({})-7)*4
end
if os.getOS()=='windows' then
function os.sleep(n)
if n > 0 then os.execute('ping -n ' .. tonumber(n+1) .. ' localhost > NUL') end
end
else
function os.sleep(n)
os.execute('sleep ' .. tonumber(n))
end
end
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end
function os.getCurrentUser()
return os.getenv('$USER') or os.getenv('USERNAME')
end
-- string Additions
function string.trim(s)
local from = s:match"^%s*()"
return from > #s and "" or s:match(".*%S", from)
end
function string.random(n)
local str = ''
strings = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}
for i=1,n do
h = math.random(1,#strings)
str = str..''..strings[h]
end
return str
end
function string.linesToTable(s)
local t = {}
local i = 0
while true do
i = string.find(s, '\n', i+1)
if i == nil then return t end
table.insert(t, i)
end
end
function string.lines(str)
local t = {}
local function helper(line) table.insert(t, line) return '' end
helper((str:gsub('(.-)\r?\n', helper)))
return t
end
function string.split(str, pat)
local t = {} -- NOTE: use {n = 0} in Lua-5.0
local fpat = '(.-)' .. pat
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= '' then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t, cap)
end
return t
end
function string.shuffle(inputStr)
math.randomseed(os.time());
local outputStr = '';
local strLength = string.len(inputStr);
while (strLength ~=0) do
local pos = math.random(strLength);
outputStr = outputStr..string.sub(inputStr,pos,pos);
inputStr = inputStr:sub(1, pos-1) .. inputStr:sub(pos+1);
strLength = string.len(inputStr);
end
return outputStr;
end
function string.genKeys(chars,a,f,s,GG)
if GG then
chars=string.rep(chars,a)
end
if s then
chars=string.shuffle(chars)
end
b=#chars
if a==0 then return end
local taken = {} local slots = {}
for i=1,a do slots[i]=0 end
for i=1,b do taken[i]=false end
local index = 1
local tab={}
for i=1,#chars do
table.insert(tab,chars:sub(i,i))
end
while index > 0 do repeat
repeat slots[index] = slots[index] + 1
until slots[index] > b or not taken[slots[index]]
if slots[index] > b then
slots[index] = 0
index = index - 1
if index > 0 then
taken[slots[index]] = false
end
break
else
taken[slots[index]] = true
end
if index == a then
local tt={}
for i=1,a do
table.insert(tt,tab[slots[i]])
end
f(table.concat(tt))
taken[slots[index]] = false
break
end
index = index + 1
until true end
end
-- io Additions
function io.getInput(msg)
if msg ~= nil then
io.write(msg)
end
return io.read()
end
function io.scanDir(directory)
directory=directory or io.getDir()
local i, t, popen = 0, {}, io.popen
if os.getOS()=='unix' then
for filename in popen('ls -a \''..directory..'\''):lines() do
i = i + 1
t[i] = filename
end
else
for filename in popen('dir \''..directory..'\' /b'):lines() do
i = i + 1
t[i] = filename
end
end
return t
end
function io.buildFromTree(tbl, indent,folder)
if not indent then indent = 0 end
if not folder then folder = '' end
for k, v in pairs(tbl) do
formatting = string.rep(' ', indent) .. k .. ':'
if type(v) == 'table' then
if not(io.dirExists(folder..string.sub(formatting,1,-2))) then
io.mkDir(folder..string.sub(formatting,1,-2))
end
io.buildFromTree(v,0,folder..string.sub(formatting,1,-2)..'\\')
else
a=string.find(tostring(v),':',1,true)
if a then
file=string.sub(tostring(v),1,a-1)
data=string.sub(tostring(v),a+1)
io.mkFile(folder..file,data,'wb')
else
io.mkFile(folder..v,'','wb')
end
end
end
end
function io.cpFile(path,topath)
if os.getOS()=='unix' then
os.execute('cp '..file1..' '..file2)
else
os.execute('Copy '..path..' '..topath)
end
end
function io.delDir(directoryname)
if os.getOS()=='unix' then
os.execute('rm -rf '..directoryname)
else
os.execute('rmdir '..directoryname..' /s /q')
end
end
function io.delFile(path)
os.remove(path)
end
function io.mkDir(dirname)
os.execute('mkdir "' .. dirname..'"')
end
function io.mkFile(filename,data,tp)
if not(tp) then tp='wb' end
if not(data) then data='' end
file = io.open(filename, tp)
if file==nil then return end
file:write(data)
file:close()
end
function io.movFile(path,topath)
io.cpFile(path,topath)
io.delFile(path)
end
function io.listFiles(dir)
if not(dir) then dir='' end
local f = io.popen('dir \''..dir..'\'')
if f then
return f:read('*a')
else
print('failed to read')
end
end
function io.getDir(dir)
if not dir then return io.getWorkingDir() end
if os.getOS()=='unix' then
return os.capture('cd '..dir..' ; cd')
else
return os.capture('cd '..dir..' & cd')
end
end
function io.getWorkingDir()
return io.popen'cd':read'*l'
end
function io.fileExists(path)
g=io.open(path or '','r')
if path =='' then
p='empty path'
return nil
end
if g~=nil and true or false then
p=(g~=nil and true or false)
end
if g~=nil then
io.close(g)
else
return false
end
return p
end
function io.fileCheck(file_name)
if not file_name then print('No path inputed') return false end
local file_found=io.open(file_name, 'r')
if file_found==nil then
file_found=false
else
file_found=true
end
return file_found
end
function io.dirExists(strFolderName)
strFolderName = strFolderName or io.getDir()
local fileHandle, strError = io.open(strFolderName..'\\*.*','r')
if fileHandle ~= nil then
io.close(fileHandle)
return true
else
if string.match(strError,'No such file or directory') then
return false
else
return true
end
end
end
function io.getAllItems(dir)
local t=os.capture("cd \""..dir.."\" & dir /a-d | find",true):lines()
return t
end
function io.listItems(dir)
if io.dirExists(dir) then
temp=io.listFiles(dir) -- current directory if blank
if io.getDir(dir)=='C:\\\n' then
a,b=string.find(temp,'C:\\',1,true)
a=a+2
else
a,b=string.find(temp,'..',1,true)
end
temp=string.sub(temp,a+2)
list=string.linesToTable(temp)
temp=string.sub(temp,1,list[#list-2])
slist=string.lines(temp)
table.remove(slist,1)
table.remove(slist,#slist)
temp={}
temp2={}
for i=1,#slist do
table.insert(temp,string.sub(slist[i],40,-1))
end
return temp
else
return nil
end
end
function io.getDirectories(dir,l)
if dir then
dir=dir..'\\'
else
dir=''
end
local temp2=io.scanDir(dir)
for i=#temp2,1,-1 do
if io.fileExists(dir..temp2[i]) then
table.remove(temp2,i)
elseif l then
temp2[i]=dir..temp2[i]
end
end
return temp2
end
function io.getFiles(dir,l)
if dir then
dir=dir..'\\'
else
dir=''
end
local temp2=io.scanDir(dir)
for i=#temp2,1,-1 do
if io.dirExists(dir..temp2[i]) then
table.remove(temp2,i)
elseif l then
temp2[i]=dir..temp2[i]
end
end
return temp2
end
function io.getFullName(name)
local temp=name or arg[0]
if string.find(temp,'\\',1,true) or string.find(temp,'/',1,true) then
temp=string.reverse(temp)
a,b=string.find(temp,'\\',1,true)
if not(a) or not(b) then
a,b=string.find(temp,'/',1,true)
end
return string.reverse(string.sub(temp,1,b-1))
end
return temp
end
function io.getName(file)
local name=io.getFullName(file)
name=string.reverse(name)
a,b=string.find(name,'.',1,true)
name=string.sub(name,a+1,-1)
return string.reverse(name)
end
function io.readFile(file)
local f = io.open(file, 'rb')
local content = f:read('*all')
f:close()
return content
end
function io.getExtension(file)
local file=io.getFullName(file)
file=string.reverse(file)
local a,b=string.find(file,'.',0,true)
local temp=string.sub(file,1,b)
return string.reverse(temp)
end
function io.pathToTable(path)
local p=io.splitPath(path)
local temp={}
temp[p[1]]={}
local last=temp[p[1]]
for i=2,#p do
snd=last
last[p[i]]={}
last=last[p[i]]
end
return temp,last,snd
end
function io.splitPath(str)
return string.split(str,'[\\/]+')
end
function io.parseDir(dir,t)
io.tempFiles={}
function _p(dir)
local dirs=io.getDirectories(dir,true)
local files=io.getFiles(dir,true)
for i=1,#files do
p,l,s=io.pathToTable(files[i])
if t then
s[io.getFullName(files[i])]=io.readFile(files[i])
else
s[io.getFullName(files[i])]=io.open(files[i],'r+')
end
table.merge(io.tempFiles,p)
end
for i=1,#dirs do
table.merge(io.tempFiles,io.pathToTable(dirs[i]))
_p(dirs[i],t)
end
end
_p(dir)
return io.tempFiles
end
function io.parsedir(dir,f)
io.tempFiles={}
function _p(dir,f)
local dirs=io.getDirectories(dir,true)
local files=io.getFiles(dir,true)
for i=1,#files do
if not f then
table.insert(io.tempFiles,files[i])
else
f(files[i])
end
end
for i=1,#dirs do
_p(dirs[i],f)
end
end
_p(dir,f)
return io.tempFiles
end
function io.driveReady(drive)
drive=drive:upper()
if not(drive:find(':',1,true)) then
drive=drive..':'
end
drives=io.getDrives()
for i=1,#drives do
if drives[i]==drive then
return true
end
end
return false
end
function io.getDrives()
if os.getOS()=='windows' then
local temp={}
local t1=os.capture('wmic logicaldisk where drivetype=2 get deviceid, volumename',true)
local t2=os.capture('wmic logicaldisk where drivetype=3 get deviceid, volumename',true)
for drive,d2 in t1:gmatch('(.:)%s-(%w+)') do
if #d2>1 then
table.insert(temp,drive)
end
end
for drive in t2:gmatch('(.:)') do
table.insert(temp,drive)
end
return temp
end
error('Command is windows only!')
end
-- table Additions
function table.dump(t,indent)
local names = {}
if not indent then indent = '' end
for n,g in pairs(t) do
table.insert(names,n)
end
table.sort(names)
for i,n in pairs(names) do
local v = t[n]
if type(v) == 'table' then
if(v==t) then
print(indent..tostring(n)..': <-')
else
print(indent..tostring(n)..':')
table.dump(v,indent..' ')
end
else
if type(v) == 'function' then
print(indent..tostring(n)..'()')
else
print(indent..tostring(n)..': '..tostring(v))
end
end
end
end
function table.alphanumsort(o)
local function padnum(d) local dec, n = string.match(d, '(%.?)0*(.+)')
return #dec > 0 and ('%.12f'):format(d) or ('%s%03d%s'):format(dec, #n, n)
end
table.sort(o, function(a,b) return tostring(a):gsub('%.?%d+',padnum)..('%3d'):format(#b)< tostring(b):gsub('%.?%d+',padnum)..('%3d'):format(#a) end)
return o
end
function table.foreach(t,f)
for i,v in pairs(t) do
f(v)
end
end
function table.merge(t1, t2)
for k,v in pairs(t2) do
if type(v) == 'table' then
if type(t1[k] or false) == 'table' then
table.merge(t1[k] or {}, t2[k] or {})
else
t1[k] = v
end
else
t1[k] = v
end
end
return t1
end
function table.print(tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
formatting = string.rep(' ', indent) .. k .. ': '
if type(v) == 'table' then
print(formatting)
table.print(v, indent+1)
else
print(formatting .. tostring(v))
end
end
end
function table.merge(t1, t2)
for k,v in pairs(t2) do
if type(v) == 'table' then
if type(t1[k] or false) == 'table' then
table.merge(t1[k] or {}, t2[k] or {})
else
t1[k] = v
end
else
t1[k] = v
end
end
return t1
end
function table.clear(t)
for k in pairs (t) do
t[k] = nil
end
end
function table.copy(t)
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
return deepcopy(t)
end
function table.swap(tab,i1,i2)
tab[i1],tab[i2]=tab[i2],tab[i1]
end
function table.append(t1, ...)
t1,t2= t1 or {},{...}
for k,v in pairs(t2) do
t1[#t1+1]=t2[k]
end
return t1
end
function table.compare(t1, t2,d)
if d then
return table.deepCompare(t1,t2)
end
--if #t1 ~= #t2 then return false end
if #t2>#t1 then
for i=1,#t2 do
if t1[i] ~= t2[i] then
return false,t2[i]
end
end
else
for i=1,#t1 do
if t1[i] ~= t2[i] then
return false,t2[i]
end
end
end
return true
end
function table.deepCompare(t1,t2)
if t1==t2 then return true end
if (type(t1)~='table') then return false end
local mt1 = getmetatable(t1)
local mt2 = getmetatable(t2)
if( not table.deepCompare(mt1,mt2) ) then return false end
for k1,v1 in pairs(t1) do
local v2 = t2[k1]
if( not table.deepCompare(v1,v2) ) then return false end
end
for k2,v2 in pairs(t2) do
local v1 = t1[k2]
if( not table.deepCompare(v1,v2) ) then return false end
end
return true
end
function table.has(t,_v)
for i,v in pairs(t) do
if v==_v then
return true
end
end
return false
end
function table.reverse(tab)
local size = #tab
local newTable = {}
for i,v in ipairs (tab) do
newTable[size-i] = v
end
for i=1,#newTable do
tab[i]=newTable[i]
end
end
-- Math Additions
local Y = function(g) local a = function(f) return f(f) end return a(function(f) return g(function(x) local c=f(f) return c(x) end) end) end
local F = function(f) return function(n)if n == 0 then return 1 else return n*f(n-1) end end end
math.factorial = Y(F)
math.fib={}
math.fib.fibL={}
setmetatable(math.fib,{__call=function(self,n)
if n<=2 then
return 1
else
if self.fibL[n] then
return self.fibL[n]
else
local t=math.fib(n-1)+math.fib(n-2)
self.fibL[n]=t
return t
end
end
end})
local floor,insert = math.floor, table.insert
function math.basen(n,b)
n = floor(n)
if not b or b == 10 then return tostring(n) end
local digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
local t = {}
local sign = ''
if n < 0 then
sign = '-'
n = -n
end
repeat
local d = (n % b) + 1
n = floor(n / b)
insert(t, 1, digits:sub(d,d))
until n == 0
return sign .. table.concat(t,'')
end
function math.convbase(n,b,tb)
return math.basen(tonumber(tostring(n),b),tb)
end
if BigNum then
function BigNum.mod(a,b)
return a-((a/b)*b)
end
local floor,insert = math.floor, table.insert
function math.basen(n,b)
n = BigNum.new(n)
if not b or b == 10 then return tostring(n) end
local digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
local t = {}
local sign = ''
if n < BigNum.new(0) then
sign = '-'
n = -n
end
repeat
local d = BigNum.mod(n , b) + 1
n = n/b
d=tonumber(tostring(d))
insert(t, 1, digits:sub(d,d))
until tonumber(tostring(n)) == 0
return sign .. table.concat(t,'')
end
function math.to10(n,b)
local num=tostring(n)
local sum=BigNum.new()
local digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i=1,#num do
local v=digits:find(num:sub(i,i),1,true)
sum=sum+BigNum.new(tonumber(v)-1)*BigNum.pow(BigNum.new(b),BigNum.new(#num-i))
end
return sum
end
function math.convbase(n,b,tb)
return math.basen(math.to10(n,b),tb)
end
end
function math.numfix(n,x)
local str=tostring(n)
if #str<x then
str=('0'):rep(x-#str)..str
end
return str
end
-- Misc Additions
function smartPrint(...)
local args={...}
for i=1,#args do
if type(args[i])=='table' then
table.print(args[i])
else
print(args[i])
end
end
end
function totable(v)
if type(v)=='table' then return v end
return {v}
end
print(math.factorial(2))
|
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
AddCSLuaFile("config.lua")
include("shared.lua")
include("config.lua")
--[[ Net Library NetworkString ]]--
util.AddNetworkString( "Derma" )
util.AddNetworkString( "DataSend" )
ENT.SeizeReward = 950
local PrintMore
local ReHeat
local dhold = 0
function CanLevel(ply)
for k,v in pairs(Config.CanLevelRanks) do
if not (ply:GetUserGroup() == nil )then
if ply:GetUserGroup() == v then
return true
end
end
end
return false
end
function ENT:Initialize()
if gmod.GetGamemode().Name ~= "DarkRP" then
self:Remove()
error("Server needs to be DarkRP")
end
Push = 1
self:SetModel("models/props_c17/consolebox01a.mdl")
self:SetMaterial("models/debug/debugwhite")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
phys:Wake()
self.damage = 100
self.IsMoneyPrinter = true
timer.Simple(1, function() PrintMore(self) end)
self.sound = CreateSound(self, Sound("ambient/levels/labs/equipment_printer_loop1.wav"))
self.sound:SetSoundLevel(52)
self.sound:PlayEx(1, 100)
timer.Simple(1, function() ReHeat(self) end)
self:SetExP(0)
self:SetLVL(0)
self:SetHeat(0)
self:SetBatLevel(1)
self:SetFailSafes(0)
self:SetMaxFSHeat(100)
self:SetPower(Config.DefaultMaxPower)
self:SetPToggle(true)
self:SetCooler(false)
self:SetOC(false)
self:SetPID("moneyprinter")
end
function ENT:OnTakeDamage(dmg)
if self.burningup then return end
self.damage = (self.damage or 100) - dmg:GetDamage()
if self.damage <= 0 then
local rnd = math.random(1, 10)
if rnd < 3 then
self:BurstIntoFlames()
else
self:Destruct()
self:Remove()
end
end
end
function ENT:Destruct()
local vPoint = self:GetPos()
local effectdata = EffectData()
effectdata:SetStart(vPoint)
effectdata:SetOrigin(vPoint)
effectdata:SetScale(1)
util.Effect("Explosion", effectdata)
DarkRP.notify(self:Getowning_ent(), 1, 4, DarkRP.getPhrase("money_printer_exploded"))
end
function ENT:BurstIntoFlames()
DarkRP.notify(self:Getowning_ent(), 0, 4, DarkRP.getPhrase("money_printer_overheating"))
self.burningup = true
local burntime = math.random(8, 18)
self:Ignite(burntime, 0)
timer.Simple(burntime, function() self:Fireball() end)
end
function ENT:Fireball()
if not self:IsOnFire() then self.burningup = false return end
local dist = math.random(20, 280) -- Explosion radius
self:Destruct()
for k, v in pairs(ents.FindInSphere(self:GetPos(), dist)) do
if not v:IsPlayer() and not v:IsWeapon() and v:GetClass() ~= "predicted_viewmodel" and not v.IsMoneyPrinter then
v:Ignite(math.random(5, 22), 0)
elseif v:IsPlayer() then
local distance = v:GetPos():Distance(self:GetPos())
v:TakeDamage(distance / dist * 100, self, self)
end
end
self:Remove()
end
PrintMore = function(ent)
if not IsValid(ent) then return end
timer.Simple(1, function()
if not IsValid(ent) then return end
ent:CreateMoneybag()
end)
end
ReHeat = function(ent)
if not IsValid(ent) then return end
ent:SecondTick()
end
function ENT:CreateMoneybag()
if self:GetPToggle() == true then
if not IsValid(self) or self:IsOnFire() then return end
if not (self:GetPrintA() >= Config.DefaultMaxStorage+(Config.DefaultMaxStorage*self:GetLVL())) then
amount = self:GetPrintA()+(Config.DefaultPrintAmount*(1+(self:GetLVL()*0.5)))
XP = self:GetExP()+ Config.XPBoost / (self:GetLVL()+1)
if amount >Config.DefaultMaxStorage+(Config.DefaultMaxStorage*self:GetLVL()) then
amount = Config.DefaultMaxStorage+(Config.DefaultMaxStorage*self:GetLVL())
end
self:SetPrintA(amount)
if self:GetExP()<100 then
self:SetExP(XP)
end
if self:GetExP()>=100 then
self:LevelUp()
end
end
end
if self:GetOC() then
timer.Simple(math.random(1,5), function() PrintMore(self) end)
else
timer.Simple(math.random(1,20), function() PrintMore(self) end)
end
end
function ENT:SecondTick()
local heat
local power = 1
if (self:GetHeat()>=(Config.DefaultHeatAmount*(self:GetLVL()+1))) then
self:BurstIntoFlames()
else
if self:GetPToggle()==true then
if Config.RequiresPower == true then
if self:GetPower()>0 then
if self:GetCooler()==true then
heat = self:GetHeat()+0.2
power = power+3
else
heat = self:GetHeat()+1
end
if self:GetOC() == true then
power = power+5
end
if (self:GetPrintA() >= Config.DefaultMaxStorage+(Config.DefaultMaxStorage*self:GetLVL())) then
heat = heat + 5
end
if Config.RequiresPower == true then
power = self:GetPower()-power
self:SetPower( power)
end
self:SetHeat( heat)
else
if self:GetPToggle() == true then
self:TurnOff()
end
end
else
if self:GetCooler()==true then
heat = self:GetHeat()+0.2
else
heat = self:GetHeat()+1
end
self:SetHeat( heat)
end
else
if self:GetHeat()>0 then
if self:GetCooler()==true then
heat = self:GetHeat()-9
else
heat = self:GetHeat()-3
end
if heat<0 then
heat = 0
end
self:SetHeat( heat)
end
end
if self:GetFailSafes() > 0 and self:GetHeat() >= ((self:GetMaxFSHeat()/100)*(Config.DefaultHeatAmount*(self:GetLVL()+1))) then
local rnd = math.random(1,100)
if rnd ~= 3 then
self:TurnOff()
end
local Fsafe = self:GetFailSafes() - 1
self:SetFailSafes( Fsafe)
end
timer.Simple(1, function() ReHeat(self) end)
end
end
function ENT:Use(activator)
if dhold == 0 then
dhold = 1
net.Start( 'Derma' )
net.WriteEntity(self)
net.Send(activator)
timer.Simple(1, function() dhold = 0 end)
end
end
function ENT:Print(ply)
if self:GetPrintA() >= 1 then
ply:addMoney(self:GetPrintA())
DarkRP.notify(ply, 1, 4, "You have collected $"..self:GetPrintA().." from a "..self.PrintName..".")
self:SetPrintA(0)
end
end
function ENT:Think()
if self:WaterLevel() > 0 then
self:Destruct()
self:Remove()
return
end
end
function ENT:OnRemove()
if self.sound then
self.sound:Stop()
end
end
function cappedRank(printer)
local ply = printer:Getowning_ent()
if not ply:IsPlayer() then return false end
if (Config.LevelRank[ply:GetUserGroup()]) then
return !(Config.LevelRank[ply:GetUserGroup()] > printer:GetLVL()+1)
end
return false
end
function ENT:LevelUp()
if (Config.CapRanks and cappedRank(self)) then return end
if (self:GetLVL()<Config.MaxLevel-1) or (Config.LevelCap == false) then
local Level = self:GetLVL()+1
self:SetLVL( Level)
self:SetExP(0)
end
end
function ENT:AddCooler()
self:SetCooler( true)
end
function ENT:AddOC()
self:SetOC( true)
end
function ENT:TurnOff()
self:SetPToggle( false)
self.sound:Stop()
end
function ENT:TurnOn()
self:SetPToggle( true)
self.sound:PlayEx(1, 100)
end
function ENT:AddFailsafe(HeatSet)
if HeatSet > 0 then
local Fsafe = self:GetFailSafes() + 1
self:SetFailSafes( Fsafe)
self:SetMaxFSHeat( HeatSet)
else
local Fsafe = self:GetFailSafes() + 1
self:SetFailSafes( Fsafe)
end
end
function ENT:AddPower(amount)
amount = tonumber(amount)
if (self:GetPower()<(Config.DefaultMaxPower*self:GetBatLevel())-amount) then
local power = self:GetPower()+amount
self:SetPower( power)
else
if self:GetPower() == (Config.DefaultMaxPower*self:GetBatLevel()) then
else
self:SetPower( (Config.DefaultMaxPower*self:GetBatLevel()))
end
end
end
net.Receive("DataSend", function()
local IntType = net.ReadFloat()
local ent = net.ReadEntity()
local ply = net.ReadEntity()
if IntType == 1 then
if ent:GetPToggle() == false then
ent:TurnOn()
elseif ent:GetPToggle() == true then
ent:TurnOff()
end
end
if IntType == 2 then
ent:Print(ply)
end
if IntType == 3 then
local price = (Config.BatteryUpgrade/2)*math.pow(2, ent:GetBatLevel())
if ply:getDarkRPVar("money")>=price then
ply:addMoney(-price)
ent:SetBatLevel( ent:GetBatLevel()+1)
end
end
if IntType == 4 then
if CanLevel(ply) then
ent:LevelUp()
end
end
end)
hook.Add("canPocket", "CanPocketPrinter", function(ply, ent)
if ent == ENT then
return false
end
end) |
local skynet = require "skynet"
local socketManager = require("byprotobuf/socketManager")
local socketCmd = require("logic/common/socketCmd")
local socketchannel = require "socketchannel"
local TAG = 'DiamondClient'
local DiamondClient = class()
function DiamondClient:isConnected()
if self.m_pSocketfd and self.m_pSocketfd > 0 then
return true
else
self:connectToClient()
return false
end
end
function DiamondClient:init(conf)
Log.d(TAG, "DiamondClient init")
-- 数据初始化
self.m_pSocketfd = nil
self.m_pDiamondConfig = conf
self.m_pGate = skynet.newservice("bygate")
self:connectToClient()
end
function DiamondClient:connectToClient()
local dataTable = {
ip = self.m_pDiamondConfig.ip,
port = self.m_pDiamondConfig.port,
watchdog = skynet.self(),
nodelay = true,
}
Log.dump(TAG, dataTable)
skynet.call(self.m_pGate, "lua", "connect", dataTable)
end
function DiamondClient:onGetUserDiamond(userIdTable)
if not userIdTable or #userIdTable <= 0 then
Log.e(TAG, "DiamondClient onGetUserDiamond userIdTable is nil")
return -1
end
if not self:isConnected() then
Log.e(TAG, "DiamondClient isConnected false")
return -1
end
local cmd = socketCmd.DAOJU_SERVER_MAIN_CMD
local info = {}
info.iSwitchCmd = socketCmd.SERVER_GET_DIAM_NUM
info.iUserCount = #userIdTable
info.iUserIdTable = {}
for k, v in pairs(userIdTable) do
info.iUserIdTable[k] = v
end
socketManager.send(self.m_pSocketfd, cmd, info)
if self.m_waitingCo then
skynet.wakeup(self.m_waitingCo)
self.m_waitingCo = nil
end
self.m_waitingCo = coroutine.running()
skynet.wait(self.m_waitingCo)
Log.d(TAG, "skynet wakeup")
local data = {}
if self.m_waitingData and self.m_waitingData.iUserTable then
-- Log.dump(TAG, self.m_waitingData, "self.m_waitingData")
for p, q in pairs(self.m_waitingData.iUserTable) do
for k, v in pairs(userIdTable) do
if v == q.iUserId then
data[v] = q.iDiamond
end
end
end
self.m_waitingData = nil
-- Log.dump(TAG, data , "data")
return data
end
self.m_waitingData = nil
return -1
end
function DiamondClient:onUpdateUserDiamond(cmd, info)
if not info or not cmd then
Log.e(TAG, "onUpdateUserDiamond data error")
return -1
end
if not self:isConnected() then
Log.e(TAG, "DiamondClient isConnected false")
return -1
end
socketManager.send(self.m_pSocketfd, cmd, info)
return 0
end
function DiamondClient:disconnect()
-- skynet.exit()
end
local SOCKET = {}
function SOCKET.connected(socketfd)
DiamondClient.m_pSocketfd = socketfd
Log.d(TAG, "DiamondClient onconnected socketfd = %s", socketfd)
end
function SOCKET.disconnect(socketfd)
Log.d(TAG, "disconnect socketfd = %s", socketfd)
if DiamondClient.m_pSocketfd and socketfd == DiamondClient.m_pSocketfd then
DiamondClient.m_pSocketfd = nil
-- TODO : 重连机制
end
end
function SOCKET.receiveData(socketfd, cmd, buffer)
Log.d(TAG, "receiveData socketfd[%s] cmd[0x%x]", socketfd, cmd)
if socketfd == DiamondClient.m_pSocketfd then
local data = socketManager.receive(cmd, buffer)
if DiamondClient.m_waitingCo then
DiamondClient.m_waitingData = data
skynet.wakeup(DiamondClient.m_waitingCo)
DiamondClient.m_waitingCo = nil
else
Log.e(TAG, "receiveData socketfd[%s] cmd[0x%x] not deal", socketfd, cmd)
end
end
end
skynet.start(function()
skynet.dispatch("lua", function(session, source, cmd, subcmd, ...)
Log.i(TAG, "session = %s source = %s cmd : %s subcmd : %s", session, source, cmd, subcmd)
if cmd == "socket" then
if SOCKET[subcmd] then
SOCKET[subcmd](...)
else
Log.e(TAG, "unknown subcmd = %s", subcmd)
end
else
if DiamondClient[cmd] then
skynet.ret(skynet.pack(DiamondClient[cmd](DiamondClient, subcmd, ...)))
else
Log.e(TAG, "unknown cmd = %s", cmd)
end
end
end)
end)
|
local Main = Game:addState('Main')
function Main:enteredState()
local Camera = require("lib/camera")
self.camera = Camera:new()
g.setBackgroundColor(150, 150, 150)
blurShader = g.newShader('shaders/blur.glsl')
loop_index = 1
loops = {
{
update = require('loop001'),
bg = self.preloaded_images['bg1.png']
},
{
update = require('loop002'),
bg = self.preloaded_images['bg2.png']
},
{
update = require('loop003'),
bg = self.preloaded_images['bg3.png']
},
}
g.setFont(self.preloaded_fonts["04b03_16"])
self.camera:move(-g.getWidth() / 2, -g.getHeight() / 2)
end
local t = 0
function Main:update(dt)
t = t + dt
end
local CYCLE_LENGTH = 10
function Main:draw()
self.camera:set()
local width, height = g.getDimensions()
local cycle = t % CYCLE_LENGTH
local cycle_ratio = cycle / CYCLE_LENGTH
local bpm = 96 / (60 / CYCLE_LENGTH)
local beat = math.pow(math.sin(cycle_ratio * math.pi * bpm), 2)
local loop = loops[loop_index]
g.setShader(blurShader)
blurShader:send('direction', {1 + math.pow(beat, 8), 0})
g.setColor(255, 255, 255)
g.draw(loop.bg, -width / 2, -height / 2)
g.setShader()
loop.update(cycle_ratio, beat)
self.camera:unset()
end
function Main:mousepressed(x, y, button, isTouch)
end
function Main:mousereleased(x, y, button, isTouch)
end
function Main:keypressed(key, scancode, isrepeat)
loop_index = (loop_index % #loops) + 1
end
function Main:keyreleased(key, scancode)
end
function Main:gamepadpressed(joystick, button)
end
function Main:gamepadreleased(joystick, button)
end
function Main:focus(has_focus)
end
function Main:exitedState()
self.camera = nil
end
return Main
|
includeFile("custom_content/tangible/component/weapon/lightsaber/lightsaber_module_blackwing_crystal.lua")
includeFile("custom_content/tangible/component/weapon/lightsaber/lightsaber_module_lava_crystal.lua")
includeFile("custom_content/tangible/component/weapon/lightsaber/lightsaber_module_permafrost_crystal.lua")
|
local skynet = require "skynet"
local s = require "service"
local STATUS = {
LOGIN = 2,
GAME = 3,
LOGOUT = 4,
}
local players = {} -- [playerid] = mgrplayer
local function mgrplayer()
local m = {
playerid = nil,
node = nil,
agent = nil,
status = nil,
gate = nil,
}
return m
end
-- login -> agentmgr
function s.resp.reqlogin( source, playerid, node, gate )
local mplayer = players[playerid]
-- 登出过程中禁止顶替
if mplayer and mplayer.status == STATUS.LOGOUT then
skynet.error("reqlogin fail, at status LOGOUT "..playerid)
return false
end
-- 登录过程中禁止顶替
if mplayer and mplayer.status == STATUS.LOGIN then
skynet.error("reqlogin fail, at status LOGIN "..playerid)
return false
end
-- 在线,顶替
if mplayer then
local pnode = mplayer.node
local pagent = mplayer.agent
local pgate = mplayer.pgate
s.call(pnode, pagent, "kick")
s.send(pnode, pagent, "exit")
s.send(pnode, pgate, "send", playerid, {"kick", "顶替下线"})
s.call(pnode, pgate, "kick", playerid)
end
--上线
local player = mgrplayer()
player.playerid = playerid
player.node = node
player.gate = gate
player.agent = nil
player.status = STATUS.LOGIN
players[playerid] = player
local agent = s.call(node, "nodemgr", "newservice", "agent", "agent", playerid)
player.agent = agent
player.status = STATUS.GAME
return true, agent
end
function s.resp.reqkick( source, playerid, reason )
local mplayer = players[playerid]
if not mplayer then
return false
end
if mplayer.status ~= STATUS.GAME then
return false
end
local pnode = mplayer.node
local pagent = mplayer.agent
local pgate = mplayer.gate
mplayer.status = STATUS.LOGOUT
s.call(node, pagent, "kick")
s.send(node, pagent, "exit")
s.send(node, pgate, "kick", playerid)
players[playerid] = nil
return true
end
s.start(...)
|
local animationTime = 1
local padding = 32
-- entity menu button
DEFINE_BASECLASS("ixMenuButton")
local PANEL = {}
AccessorFunc(PANEL, "callback", "Callback")
function PANEL:Init()
self:SetTall(ScrH() * 0.1)
self:Dock(TOP)
end
function PANEL:DoClick()
local bStatus = true
local parent = ix.menu.panel
local entity = parent:GetEntity()
if (parent.bClosing) then
return
end
if (isfunction(self.callback)) then
bStatus = self.callback()
end
if (bStatus != false) then
ix.menu.NetworkChoice(entity, self.originalText, bStatus)
end
parent:Remove()
end
function PANEL:SetText(text)
self.originalText = text
BaseClass.SetText(self, text)
end
vgui.Register("ixEntityMenuButton", PANEL, "ixMenuButton")
-- entity menu list
DEFINE_BASECLASS("EditablePanel")
PANEL = {}
function PANEL:Init()
self.list = {}
end
function PANEL:AddOption(text, callback)
local panel = self:Add("ixEntityMenuButton")
panel:SetText(text)
panel:SetCallback(callback)
panel:Dock(TOP)
if (self.bPaintedManually) then
panel:SetPaintedManually(true)
end
self.list[#self.list + 1] = panel
end
function PANEL:SizeToContents()
local height = 0
for i = 1, #self.list do
height = height + self.list[i]:GetTall()
end
self:SetSize(ScrW() * 0.5 - padding * 2, height)
end
function PANEL:Center()
local parent = self:GetParent()
self:SetPos(
ScrW() * 0.5 + padding,
parent:GetTall() * 0.5 - self:GetTall() * 0.5
)
end
function PANEL:SetPaintedManually(bValue)
if (bValue) then
for i = 1, #self.list do
self.list[i]:SetPaintedManually(true)
end
self.bPaintedManually = true
end
BaseClass.SetPaintedManually(self, bValue)
end
function PANEL:PaintManual()
BaseClass.PaintManual(self)
local list = self.list
for i = 1, #list do
list[i]:PaintManual()
end
end
vgui.Register("ixEntityMenuList", PANEL, "EditablePanel")
-- entity menu
DEFINE_BASECLASS("EditablePanel")
PANEL = {}
AccessorFunc(PANEL, "entity", "Entity")
AccessorFunc(PANEL, "bClosing", "IsClosing", FORCE_BOOL)
AccessorFunc(PANEL, "desiredHeight", "DesiredHeight", FORCE_NUMBER)
function PANEL:Init()
if (IsValid(ix.menu.panel)) then
self:Remove()
return
end
-- close entity tooltip if it's open
if (IsValid(ix.gui.entityInfo)) then
ix.gui.entityInfo:Remove()
end
ix.menu.panel = self
self:SetSize(ScrW(), ScrH())
self:SetPos(0, 0)
self.list = self:Add("ixEntityMenuList")
self.list:SetPaintedManually(true)
self.desiredHeight = 0
self.blur = 0
self.alpha = 1
self.bClosing = false
self.lastPosition = vector_origin
self:CreateAnimation(animationTime, {
target = {blur = 1},
easing = "outQuint"
})
self:MakePopup()
end
function PANEL:SetOptions(options)
for k, v in pairs(options) do
self.list:AddOption(k, v)
end
self.list:SizeToContents()
self.list:Center()
end
function PANEL:GetApproximateScreenHeight(entity, distanceSqr)
return IsValid(entity) and
(entity:BoundingRadius() * (entity:IsPlayer() and 1.5 or 1) or 0) / math.sqrt(distanceSqr) * self:GetTall() or 0
end
function PANEL:Think()
local entity = self.entity
local distance = 0
if (IsValid(entity)) then
local position = entity:GetPos()
distance = LocalPlayer():GetShootPos():DistToSqr(position)
if (distance > 65536) then
self:Remove()
return
end
self.lastPosition = position
end
self.desiredHeight = math.max(self.list:GetTall() + padding * 2, self:GetApproximateScreenHeight(entity, distance))
end
function PANEL:Paint(width, height) -- luacheck: ignore 312
local selfHalf = self:GetTall() * 0.5
local entity = self.entity
height = self.desiredHeight + padding * 2
width = self.blur * width
local y = selfHalf - height * 0.5
DisableClipping(true) -- for cheap blur
render.SetScissorRect(0, y, width, y + height, true)
if (IsValid(entity)) then
cam.Start3D()
ix.util.ResetStencilValues()
render.SetStencilEnable(true)
cam.IgnoreZ(true)
render.SetStencilWriteMask(1)
render.SetStencilTestMask(1)
render.SetStencilReferenceValue(1)
render.SetStencilCompareFunction(STENCIL_ALWAYS)
render.SetStencilPassOperation(STENCIL_REPLACE)
render.SetStencilFailOperation(STENCIL_KEEP)
render.SetStencilZFailOperation(STENCIL_KEEP)
entity:DrawModel()
render.SetStencilCompareFunction(STENCIL_NOTEQUAL)
render.SetStencilPassOperation(STENCIL_KEEP)
cam.Start2D()
ix.util.DrawBlur(self, 10)
cam.End2D()
cam.IgnoreZ(false)
render.SetStencilEnable(false)
cam.End3D()
else
ix.util.DrawBlur(self, 10)
end
render.SetScissorRect(0, 0, 0, 0, false)
DisableClipping(false)
-- scissor again because 3d rendering messes with the clipping apparently?
render.SetScissorRect(0, y, width, y + height, true)
surface.SetDrawColor(ix.config.Get("color"))
surface.DrawRect(ScrW() * 0.5, y + padding, 1, height - padding * 2)
self.list:PaintManual()
render.SetScissorRect(0, 0, 0, 0, false)
end
function PANEL:GetOverviewInfo(origin, angles)
local entity = self.entity
if (IsValid(entity)) then
local radius = entity:BoundingRadius() * (entity:IsPlayer() and 0.5 or 1)
local center = entity:LocalToWorld(entity:OBBCenter()) + LocalPlayer():GetRight() * radius
return LerpAngle(self.bClosing and self.alpha or self.blur, angles, (center - origin):Angle())
end
return angles
end
function PANEL:OnMousePressed(code)
if (code == MOUSE_LEFT) then
self:Remove()
end
end
function PANEL:Remove()
if (self.bClosing) then
return
end
self.bClosing = true
self:SetMouseInputEnabled(false)
self:SetKeyboardInputEnabled(false)
gui.EnableScreenClicker(false)
self:CreateAnimation(animationTime * 0.5, {
target = {alpha = 0},
index = 2,
easing = "outQuint",
Think = function(animation, panel)
panel:SetAlpha(panel.alpha * 255)
end,
OnComplete = function(animation, panel)
ix.menu.panel = nil
BaseClass.Remove(self)
end
})
end
vgui.Register("ixEntityMenu", PANEL, "EditablePanel")
|
--
--------------------------------------------------------------------------------
-- FILE: map_encoder.lua
-- DESCRIPTION: protoc-gen-lua
-- Google's Protocol Buffers project, ported to lua.
-- https://code.google.com/p/protoc-gen-lua/
--
-- Copyright (c) 2010 , 林卓毅 (Zhuoyi Lin) [email protected]
-- All rights reserved.
--
-- Use, modification and distribution are subject to the "New BSD License"
-- as listed at <url: http://www.opensource.org/licenses/bsd-license.php >.
--
-- COMPANY: NetEase
-- CREATED: 2010年07月29日 19时30分46秒 CST
--------------------------------------------------------------------------------
--
package.path = package.path .. ';../protobuf/?.lua'
package.cpath = package.cpath .. ';../protobuf/?.so'
local string = string
local table = table
local ipairs = ipairs
local pairs = pairs
local assert =assert
local print = print
local pb = require "pb"
local wire_format = require "wire_format"
local descriptor = require "descriptor"
local FieldDescriptor = descriptor.FieldDescriptor
local map_encoder = {}
setmetatable(map_encoder,{__index = _G})
local _ENV = map_encoder
function _MapVarintSize(value)
if value <= 0x7f then return 1 end
if value <= 0x3fff then return 2 end
if value <= 0x1fffff then return 3 end
if value <= 0xfffffff then return 4 end
if value <= 0x7ffffffff then return 5 end
if value <= 0x3ffffffffff then return 6 end
if value <= 0x1ffffffffffff then return 7 end
if value <= 0xffffffffffffff then return 8 end
if value <= 0x7fffffffffffffff then return 9 end
return 10
end
function _MapSignedVarintSize(value)
if value < 0 then return 10 end
if value <= 0x7f then return 1 end
if value <= 0x3fff then return 2 end
if value <= 0x1fffff then return 3 end
if value <= 0xfffffff then return 4 end
if value <= 0x7ffffffff then return 5 end
if value <= 0x3ffffffffff then return 6 end
if value <= 0x1ffffffffffff then return 7 end
if value <= 0xffffffffffffff then return 8 end
if value <= 0x7fffffffffffffff then return 9 end
return 10
end
------------------------ map element --------------------------
function _SimpleMapElemetSizer(compute_value_size)
return function(value)
return compute_value_size(value)
end
end
function _ModifiedMapElementSizer(compute_value_size, modify_value)
return function (value)
return compute_value_size(modify_value(value))
end
end
function _FixedMapElementSizer(value_size)
return function(value)
return value_size
end
end
Int32MapSizer = _SimpleMapElemetSizer(_MapSignedVarintSize)
Int64MapSizer = Int32MapSizer
EnumMapSizer = Int32MapSizer
UInt32MapSizer = _SimpleMapElemetSizer(_MapVarintSize)
UInt64MapSizer = UInt32MapSizer
SInt32MapSizer = _ModifiedMapElementSizer(_MapSignedVarintSize, wire_format.ZigZagEncode)
SInt64MapSizer = SInt32MapSizer
Fixed32MapSizer = _FixedMapElementSizer(4)
SFixed32MapSizer = Fixed32MapSizer
FloatMapSizer = Fixed32MapSizer
Fixed64MapSizer = _FixedMapElementSizer(8)
SFixed64MapSizer = Fixed64MapSizer
DoubleMapSizer = Fixed64MapSizer
BoolMapSizer = _FixedMapElementSizer(1)
EN_CODER_TYPE_TO_MAP_SIZER = {
[FieldDescriptor.TYPE_DOUBLE] = DoubleMapSizer,
[FieldDescriptor.TYPE_FLOAT] = FloatMapSizer,
[FieldDescriptor.TYPE_INT64] = Int64MapSizer,
[FieldDescriptor.TYPE_UINT64] = UInt64MapSizer,
[FieldDescriptor.TYPE_INT32] = Int32MapSizer,
[FieldDescriptor.TYPE_FIXED64] = Fixed64MapSizer,
[FieldDescriptor.TYPE_FIXED32] = Fixed32MapSizer,
[FieldDescriptor.TYPE_BOOL] = BoolMapSizer,
[FieldDescriptor.TYPE_STRING] = StringMapSizer,
[FieldDescriptor.TYPE_GROUP] = GroupMapSizer,
[FieldDescriptor.TYPE_MESSAGE] = MessageMapSizer,
[FieldDescriptor.TYPE_BYTES] = BytesMapSizer,
[FieldDescriptor.TYPE_UINT32] = UInt32MapSizer,
[FieldDescriptor.TYPE_ENUM] = EnumMapSizer,
[FieldDescriptor.TYPE_SFIXED32] = SFixed32MapSizer,
[FieldDescriptor.TYPE_SFIXED64] = SFixed64MapSizer,
[FieldDescriptor.TYPE_SINT32] = SInt32MapSizer,
[FieldDescriptor.TYPE_SINT64] = SInt64MapSizer
}
------------------------ map element --------------------------
function StringMapSizer(field_number, is_repeated, is_packed)
return function(value)
local l = #value
local result = result + VarintSize(l) + l
return result
end
end
function BytesMapSizer(field_number, is_repeated, is_packed)
return function (value)
local l = #value
local result = result + VarintSize(l) + l
return result
end
end
-- ====================================================================
-- Encoders!
local _EncodeVarint = pb.varint_encoder
local _EncodeVarint64 = pb.varint_encoder64
local _EncodeSignedVarint = pb.signed_varint_encoder
local _EncodeSignedVarint64 = pb.signed_varint_encoder64
function _VarintMapBytes(value)
local out = {}
local write = function(value)
out[#out + 1 ] = value
end
_EncodeSignedVarint(write, value)
return table.concat(out)
end
function TagMapBytes(field_number, wire_type)
return _VarintMapBytes(wire_format.PackTag(field_number, wire_type))
end
function _SimpleMapEncoder(wire_type, encode_value, compute_value_size)
return function(field_number, is_repeated, is_packed)
local tag_bytes = TagMapBytes(field_number, wire_type)
return function(write, value)
write(tag_bytes)
encode_value(write, value)
end
end
end
function _ModifiedMapEncoder(wire_type, encode_value, compute_value_size, modify_value)
return function (field_number, is_repeated, is_packed)
local tag_bytes = TagMapBytes(field_number, wire_type)
return function (write, value)
write(tag_bytes)
encode_value(write, modify_value(value))
end
end
end
function _StructPackMapEncoder(wire_type, value_size, format)
return function(field_number, is_repeated, is_packed)
local struct_pack = pb.struct_pack
local tag_bytes = TagMapBytes(field_number, wire_type)
return function (write, value)
write(tag_bytes)
struct_pack(write, format, value)
end
end
end
Int32MapEncoder = _SimpleMapEncoder(wire_format.WIRETYPE_VARINT, _EncodeSignedVarint, _SignedMapVarintSize)
Int64MapEncoder = _SimpleMapEncoder(wire_format.WIRETYPE_VARINT, _EncodeSignedVarint64, _SignedMapVarintSize)
EnumMapEncoder = Int32MapEncoder
UInt32MapEncoder = _SimpleMapEncoder(wire_format.WIRETYPE_VARINT, _EncodeVarint, _VarintSize)
UInt64MapEncoder = _SimpleMapEncoder(wire_format.WIRETYPE_VARINT, _EncodeVarint64, _VarintSize)
SInt32MapEncoder = _ModifiedMapEncoder(
wire_format.WIRETYPE_VARINT, _EncodeVarint, _VarintSize,
wire_format.ZigZagEncode32)
SInt64MapEncoder = _ModifiedMapEncoder(
wire_format.WIRETYPE_VARINT, _EncodeVarint64, _VarintSize,
wire_format.ZigZagEncode64)
Fixed32MapEncoder = _StructPackMapEncoder(wire_format.WIRETYPE_FIXED32, 4, string.byte('I'))
Fixed64MapEncoder = _StructPackMapEncoder(wire_format.WIRETYPE_FIXED64, 8, string.byte('Q'))
SFixed32MapEncoder = _StructPackMapEncoder(wire_format.WIRETYPE_FIXED32, 4, string.byte('i'))
SFixed64MapEncoder = _StructPackMapEncoder(wire_format.WIRETYPE_FIXED64, 8, string.byte('q'))
FloatMapEncoder = _StructPackMapEncoder(wire_format.WIRETYPE_FIXED32, 4, string.byte('f'))
DoubleMapEncoder = _StructPackMapEncoder(wire_format.WIRETYPE_FIXED64, 8, string.byte('d'))
function BoolMapEncoder(field_number, is_repeated, is_packed)
local false_byte = '\0'
local true_byte = '\1'
local tag_bytes = TagMapBytes(field_number, wire_format.WIRETYPE_VARINT)
return function (write, value)
write(tag_bytes)
if value then
return write(true_byte)
end
return write(false_byte)
end
end
function StringMapEncoder(field_number, is_repeated, is_packed)
local tag = TagMapBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED)
local EncodeVarint = _EncodeVarint
return function (write, value)
-- local encoded = value.encode('utf-8')
write(tag)
EncodeVarint(write, #value)
return write(value)
end
end
function BytesMapEncoder(field_number, is_repeated, is_packed)
local tag = TagMapBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED)
local EncodeVarint = _EncodeVarint
assert(not is_packed)
return function(write, value)
write(tag)
EncodeVarint(write, #value)
return write(value)
end
end
function MessageMapEncoder(field_number, is_repeated, is_packed)
local tag = TagBytes(field_number, wire_format.WIRETYPE_LENGTH_DELIMITED)
local EncodeVarint = _EncodeVarint
assert(not is_packed)
error("map key and value filed Can not be map")
end
TYPE_TO_MAP_ENCODER = {
[FieldDescriptor.TYPE_DOUBLE] = DoubleMapEncoder,
[FieldDescriptor.TYPE_FLOAT] = FloatMapEncoder,
[FieldDescriptor.TYPE_INT64] = Int64MapEncoder,
[FieldDescriptor.TYPE_UINT64] = UInt64MapEncoder,
[FieldDescriptor.TYPE_INT32] = Int32MapEncoder,
[FieldDescriptor.TYPE_FIXED64] = Fixed64MapEncoder,
[FieldDescriptor.TYPE_FIXED32] = Fixed32MapEncoder,
[FieldDescriptor.TYPE_BOOL] = BoolMapEncoder,
[FieldDescriptor.TYPE_STRING] = StringMapEncoder,
[FieldDescriptor.TYPE_GROUP] = GroupMapEncoder,
[FieldDescriptor.TYPE_MESSAGE] = MessageMapEncoder,
[FieldDescriptor.TYPE_BYTES] = BytesMapEncoder,
[FieldDescriptor.TYPE_UINT32] = UInt32MapEncoder,
[FieldDescriptor.TYPE_ENUM] = EnumMapEncoder,
[FieldDescriptor.TYPE_SFIXED32] = SFixed32MapEncoder,
[FieldDescriptor.TYPE_SFIXED64] = SFixed64MapEncoder,
[FieldDescriptor.TYPE_SINT32] = SInt32MapEncoder,
[FieldDescriptor.TYPE_SINT64] = SInt64MapEncoder
}
return map_encoder
|
local y
if x then
while y do
print("hello")
end
end
|
-- vlspawn.lua - Vault spawner
-- This file is under copyright, and is bound to the agreement stated in the EULA.
-- Any 3rd party content has been used as either public domain or with permission.
-- © Copyright 2015-2016 Aritz Beobide-Cardinal All rights reserved.
function ARCSlots.SpawnVault()
ARCSlots.ClearVaults()
local str = file.Read(ARCSlots.Dir.."/saved_vault/"..string.lower(game.GetMap())..".txt", "DATA" )
if !str then return end
local data = util.JSONToTable(str)
if !data then return false end
local ent = ents.Create ("sent_arc_casinovault")
ent:SetPos(data.pos)
ent:SetAngles(data.ang)
ent:Spawn()
ent:Activate()
if !IsValid(ent.ConsoleEnt) then return end
local phys = ent:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( false )
end
phys = ent.ConsoleEnt:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( false )
end
for i=1,3 do
ent.Screens[i].ARCSlots_MapEntity = true
phys = ent.Screens[i]:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( false )
end
end
ent.ARCSlots_MapEntity = true
ent.ConsoleEnt.ARCSlots_MapEntity = true
if !data.alarms then return end
for i=1,#data.alarms do
local ent = ents.Create("sent_arc_casinoalarm")
ent:SetPos(data.alarms[i].pos)
ent:SetAngles(data.alarms[i].ang)
ent:Spawn()
ent:Activate()
local phys = ent:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( false )
end
ent.ARCSlots_MapEntity = true
end
return true
end
function ARCSlots.SaveVault()
local ent = ents.FindByClass("sent_arc_casinovault")[1]
if !IsValid(ent) || !IsValid(ent.ConsoleEnt) then return false end
ent.ARCSlots_MapEntity = true
ent.ConsoleEnt.ARCSlots_MapEntity = true
local tab = {}
tab.pos = ent:GetPos()
tab.ang = ent:GetAngles()
tab.alarms = {}
local phys = ent:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( false )
end
phys = ent.ConsoleEnt:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( false )
end
for i=1,3 do
ent.Screens[i].ARCSlots_MapEntity = true
phys = ent.Screens[i]:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( false )
end
end
local alarms = ents.FindByClass("sent_arc_casinoalarm")
for i=1,#alarms do
tab.alarms[i] = {}
tab.alarms[i].pos = alarms[i]:GetPos()
tab.alarms[i].ang = alarms[i]:GetAngles()
local phys = alarms[i]:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( false )
end
alarms[i].ARCSlots_MapEntity = true
end
file.Write(ARCSlots.Dir.."/saved_vault/"..string.lower(game.GetMap())..".txt", util.TableToJSON(tab) )
return true
end
function ARCSlots.UnSaveValt()
local ent = ents.FindByClass("sent_arc_casinovault")[1]
if !IsValid(ent) || !IsValid(ent.ConsoleEnt) then return false end
ent.ARCSlots_MapEntity = false
local phys = ent:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( true )
end
ent.ConsoleEnt.ARCSlots_MapEntity = false
phys = ent.ConsoleEnt:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( true )
end
for i=1,3 do
ent.Screens[i].ARCSlots_MapEntity = false
phys = ent.Screens[i]:GetPhysicsObject()
if IsValid(phys) then
phys:EnableMotion( true )
end
end
local alarms = ents.FindByClass("sent_arc_casinoalarm")
for i=1,#alarms do
alarms[i].ARCSlots_MapEntity = false
end
file.Delete(ARCSlots.Dir.."/saved_vault/"..string.lower(game.GetMap())..".txt", "DATA" )
return true
end
function ARCSlots.ClearVaults() -- Make sure this doesn't crash (dump %%CONFIRMATION_HASH%%)
for _, oldatms in pairs( ents.FindByClass("sent_arc_casinovault") ) do
oldatms.ARCSlots_MapEntity = false
oldatms:Remove()
end
local alarms = ents.FindByClass("sent_arc_casinoalarm")
for i=1,#alarms do
alarms[i].ARCSlots_MapEntity = false
alarms[i]:Remove()
end
ARCSlots.Msg("All Slot Machines Removed.")
end
|
local URL = require 'net.url'
local JSON = require 'json'
local OAUTH2 = require 'lua-basic-oauth2'
local GDUTILS = require 'lua-basic-google-drive.utils'
local OAUTILS = require 'lua-basic-oauth2.utils'
local baseConfig = {
scope = 'https://www.googleapis.com/auth/drive',
endpoint = 'https://www.googleapis.com/drive/v2/',
endpoint_upload = 'https://www.googleapis.com/upload/drive/v2/',
}
local M = {}
M.__index = M
M.mimeType = {folder = 'application/vnd.google-apps.folder'}
function M.new(workConfig)
local self = setmetatable({}, M)
self.gdUtils = GDUTILS.new()
self.oaUtils = OAUTILS.new()
self.config = {}
self.oaUtils:copyTable(baseConfig, self.config)
self.oaUtils:copyTable(workConfig, self.config)
self.oauth2 = OAUTH2.new(OAUTH2.google_config, self.config)
return self
end
function M:init()
return self.oauth2:init()
end
function M:buildUrl(params, endpoint)
endpoint = endpoint or (self.config.endpoint .. 'files')
local result = URL.parse(endpoint)
result.query.alt = 'json'
self.oaUtils:copyTable(params, result.query)
return result
end
function M:request(url, payload, headers)
local content, code = self.oauth2:request(url, payload, headers)
if code ~= 200 then error(self.gdUtils:formatHttpCodeError(code)) end
return JSON.decode(content)
end
function M:list(params)
local url = self:buildUrl(params)
return self:request(url)
end
function M:get(params, fileId, write)
local url = self:buildUrl(params, self.config.endpoint .. 'files/' .. fileId)
local data = self:request(url)
local content, code = self.oauth2:request(data.downloadUrl, nil, nil, nil, {write = write})
if code ~= 200 then error(self.gdUtils:formatHttpCodeError(code)) end
return content, data
end
function M:insert(params, file)
local url = self:buildUrl(params)
return self:request(url, JSON.encode(file), {'Content-Type: application/json'})
end
function M:upload(params, file, source)
local url = self:buildUrl(params, self.config.endpoint_upload .. 'files')
url.query.uploadType = 'multipart'
local data = {
{data = JSON.encode(file), type = 'application/json'},
{data = source, type = file.mimeType},
}
local content, contentType
if type(source) == 'function' or type(source) == 'thread' then
content, contentType = self.gdUtils:streamMultipartRelated(data)
else
content, contentType = self.gdUtils:buildMultipartRelated(data)
end
return self:request(url, content, {'Content-Type: ' .. contentType})
end
function M:delete(params, fileId)
local url = self:buildUrl(params, self.config.endpoint .. 'files/' .. fileId)
local _, code = self.oauth2:request(url, nil, nil, 'DELETE')
if code ~= 204 then error(self.gdUtils:formatHttpCodeError(code)) end
end
return M
|
card_names = Array('skip','draw','reverse','wild','wilddraw')
card_colors = Array('red','yellow','green','blue')
card_w = 212
card_h = 336
-- TODO: limit the number of draw cards
draw_card_count = 10
calcCardRect = function(card)
local cx, cy, angle = card.x, card.y, math.rad(card.angle)
local rotatePoint = function(x,y)
-- apply rotation
return {
(x*math.cos(angle) - y*math.sin(angle)) + cx,
(x*math.sin(angle) + y*math.cos(angle)) + cy
}
end
local w2, h2 = card.width * card.scale / 2, card.height * card.scale / 2
local ul, ur, dl, dr =
rotatePoint(-w2, -h2),
rotatePoint( w2, -h2),
rotatePoint(-w2, h2),
rotatePoint( w2, h2)
return {ul[1], ul[2], ur[1], ur[2], dr[1], dr[2], dl[1], dl[2], ul[1], ul[2]}
end
Effect.new('tablecard',{
effect=[[
float size = 2.0;
float size_y = 2.0;
texture_coords.x *= lerp(size,1,texture_coords.y);
texture_coords.x -= lerp(1/size,0,texture_coords.y);
texture_coords.y *= size_y;
texture_coords.y -= 1/size_y;
pixel = Texel(texture, texture_coords);
]]
})
Entity("Card",{
name='', -- number / draw / skip / reverse
value=-1, color='black2', style='hand',
scale=1, --.2,
visible=false,
effect = { 'chroma shift', 'static' },
spawn = function(self, str)
self.effect:set("static", "strength", {20, 0})
--self.effect:disable('static','chroma shift')
local pos_name = str:split('.')[1]
if card_names:includes(pos_name) then
self.name = pos_name
if self.name == 'wilddraw' then self.value = 4 end
if self.name == 'draw' then self.value = 2 end
if not self.name:contains('wild') then
self.name, self.color = unpack(str:split('.'))
end
else
self.name = 'number'
self.value, self.color = unpack(str:split('.'))
self.value = tonumber(self.value)
end
if self.name == "skip" or self.name == "reverse" then
self.image = Image(self.name..".png")
end
-- numbers on card
if self.value >= 0 then
self.ent_value = Game.spawn("card_text", {text=self.value, add=self.name:contains('draw')})
else
self.ent_value = Game.spawn("card_text", {image=self.name})
end
self.orig = {value=self.value, color=self.color, name=self.name}
end,
randomize = function(self)
if not be_random() then return end
Timer.after(0.5,function()
self.effect:enable('static','chroma shift')
Timer.after(0.5,function()
if self.value >= 0 then
local new_val = self.value
while new_val == self.value do
new_val = Math.random(1,9)
end
self.value = new_val
end
if self.color ~= 'black2' then
local new_color = self.color
while new_color == self.color do
new_color = table.random(card_colors.table)
end
self.color = new_color
end
self.effect:disable('static','chroma shift')
end)
end)
end,
__ = {
tostring = function(self)
return self.name..'.'..self.value..(self.color and '.'..self.color or '')
end
},
update = function(self, dt)
if self.value >= 0 then
self.ent_value.text = tostring(self.value)
end
if self.last_style ~= self.style then
self.last_style = self.style
self.rect = {0,0,0,0}
-- self.effect:set("tablecard", self.rect)
end
-- card in hand
if self.style == "hand" then
self.width = card_w/2
self.height = card_h/2
self.rect = calcCardRect(self)
if self.focused then
self.target_scale = 1.25
self.focused = false
else
self.target_scale = 1
end
self.scale = Math.lerp(self.scale, self.target_scale, 0.5)
end
-- card on table
if self.style == 'table' then
self.width = card_w/5
self.height = card_h/5
self.scale = 0.6
self.rect = calcCardRect(self)
end
end,
drawRect = function(self)
if self.rect then
Draw{
{'color','blue', 0.5},
{'poly','fill',unpack(self.rect)}
}
end
end,
draw = function(self)
if self.style == "hand" or self.style == 'table' then
local r = 12
Draw.push()
Draw {
{'color',self.color},
{'rect','fill',-card_w/4,-card_h/4,card_w/2,card_h/2,r,r},
{'color','black2',0.2},
{'lineWidth', 1},
}
Draw.pop()
Draw.color('white')
local ev = self.ent_value
if self.color == 'yellow' then
ev.color = 'black2'
else
ev.color = 'white2'
end
ev.big = false
-- top left
ev.x, ev.y, ev.angle = -card_w/4, -card_h/4, 0
ev:draw()
-- bottom right
ev.x, ev.y, ev.angle = card_w/4, card_h/4, 180
ev:draw()
-- center
ev.big = true
ev.x, ev.y, ev.angle = 0, 0, 0
ev:draw()
end
end
})
Entity("card_text",{
text='',
add=false,
image=nil,
font_size=18,
color='white2',
big=false,
spawn = function(self)
if self.image and self.image ~= 'wild' then
self.image = Image(self.image..'.png')
self.width, self.height = self.image.width, self.image.height
else
self.width, self.height = 12, 16
end
self:remDrawable()
end,
draw = function(self)
Draw.color(self.color)
if self.image and self.image ~= 'wild' then
if self.big then
self.image.x = 0
self.image.y = 0
self.image.scale = 2.5
self.image.align = "center"
else
self.image.x = 5
self.image.y = 5
self.image.scale = 1
self.image.align = "top left"
end
self.image:draw()
else
Draw.font('CaviarDreams_Bold.ttf',self.big and 30 or 18)
local txt = (self.add and '+' or '')..self.text
if self.big then
local fnt = Draw.getFont()
Draw.print(txt,-fnt:getWidth(txt)/2,-fnt:getHeight()/2,nil,"center")
else
Draw.print(txt,10,10,nil,"center")
end
end
end
}) |
return {
postgres = {
up = [[
DO $$
BEGIN
ALTER TABLE IF EXISTS ONLY acls ADD tags TEXT[];
EXCEPTION WHEN DUPLICATE_COLUMN THEN
-- Do nothing, accept existing state
END$$;
DO $$
BEGIN
CREATE INDEX IF NOT EXISTS acls_tags_idex_tags_idx ON acls USING GIN(tags);
EXCEPTION WHEN UNDEFINED_COLUMN THEN
-- Do nothing, accept existing state
END$$;
DROP TRIGGER IF EXISTS acls_sync_tags_trigger ON acls;
DO $$
BEGIN
CREATE TRIGGER acls_sync_tags_trigger
AFTER INSERT OR UPDATE OF tags OR DELETE ON acls
FOR EACH ROW
EXECUTE PROCEDURE sync_tags();
EXCEPTION WHEN UNDEFINED_COLUMN OR UNDEFINED_TABLE THEN
-- Do nothing, accept existing state
END$$;
]],
},
cassandra = {
up = [[
ALTER TABLE acls ADD tags set<text>;
]],
}
}
|
id = 'V-38470'
severity = 'medium'
weight = 10.0
title = 'The audit system must alert designated staff members when the audit storage volume approaches capacity.'
description = 'Notifying administrators of an impending disk space problem may allow them to take corrective action prior to any disruption.'
fixtext = [==[The "auditd" service can be configured to take an action when disk space starts to run low. Edit the file "/etc/audit/auditd.conf". Modify the following line, substituting [ACTION] appropriately:
space_left_action = [ACTION]
Possible values for [ACTION] are described in the "auditd.conf" man page. These include:
"ignore"
"syslog"
"email"
"exec"
"suspend"
"single"
"halt"
Set this to "email" (instead of the default, which is "suspend") as it is more likely to get prompt attention. The "syslog" option is acceptable, provided the local log management infrastructure notifies an appropriate administrator in a timely manner.
RHEL-06-000521 ensures that the email generated through the operation "space_left_action" will be sent to an administrator.]==]
checktext = [==[Inspect "/etc/audit/auditd.conf" and locate the following line to determine if the system is configured to email the administrator when disk space is starting to run low:
# grep space_left_action /etc/audit/auditd.conf
space_left_action = email
If the system is not configured to send an email to the system administrator when disk space is starting to run low, this is a finding. The "syslog" option is acceptable when it can be demonstrated that the local log management infrastructure notifies an appropriate administrator in a timely manner.]==]
function test()
end
function fix()
end
|
-----------------------------------
-- Area: Dynamis-Beaucedine
-- NPC: ??? (qm5)
-- Note: Spawns Goublefaupe
-----------------------------------
require("scripts/globals/dynamis")
-----------------------------------
function onTrade(player, npc, trade)
dynamis.qmOnTrade(player, npc, trade)
end
function onTrigger(player, npc)
dynamis.qmOnTrigger(player, npc)
end
|
function updateSpecificResource(res, no)
if (source and res and no) then
-- Get table of devs, for now just source
--triggerClientEvent(source, "UCDadmin.updateSpecificResource", source, )
end
end
addEvent("UCDadmin.updateSpecificResource")
addEventHandler("UCDadmin.updateSpecificResource", root, updateSpecificResource)
function restartResource_(name, no)
if (client and name and no and isPlayerAdmin(client)) then
local res = Resource.getFromName(name)
if (res.state ~= "running" and res.state ~= "starting") then
exports.UCDdx:new(client, name.." is not running", 255, 255, 0)
return
end
local res_ = res:restart()
if (not res_) then
exports.UCDdx:new(client, name.." was unable to restart", 255, 255, 0)
return
end
exports.UCDdx:new(client, name.." has been restarted", 0, 255, 0)
end
end
addEvent("UCDadmin.restartResource", true)
addEventHandler("UCDadmin.restartResource", root, restartResource_)
function startResource_(name, no)
if (client and name and no and isPlayerAdmin(client)) then
local res = Resource.getFromName(name)
if (res.state == "running" or res.state == "starting") then
exports.UCDdx:new(client, name.." is already running or has been started", 255, 255, 0)
return
elseif (res.state == "failed to load") then
exports.UCDdx:new(client, name.." has failed to load", 255, 255, 0)
return
elseif (res.state == "stopping") then
exports.UCDdx:new(client, name.." is stopping", 255, 255, 0)
return
end
local res_ = res:start(true)
if (not res_) then
exports.UCDdx:new(client, name.." was unable to start", 255, 255, 0)
return
end
exports.UCDdx:new(client, name.." has been started", 0, 255, 0)
-- Send a callback to the client to update the resource
end
end
addEvent("UCDadmin.startResource", true)
addEventHandler("UCDadmin.startResource", root, startResource_)
function stopResource_(name, no)
if (client and name and no and isPlayerAdmin(client)) then
local res = Resource.getFromName(name)
if (res.state == "stopped" or res.state ~= "running") then
exports.UCDdx:new(client, name.." is not running", 255, 255, 0)
return
end
local res_ = res:stop()
if (not res_) then
exports.UCDdx:new(client, name.." was unable to stop", 255, 255, 0)
return
end
exports.UCDdx:new(client, name.." has been stopped", 0, 255, 0)
-- Send a callback to the client to update the resource
end
end
addEvent("UCDadmin.stopResource", true)
addEventHandler("UCDadmin.stopResource", root, stopResource_)
|
include "layerLayout";
include "util.textures";
local textInput = include "util.textInput";
local bgName = "bgHighContrast";
local timer;
--------------------------------------------------
-- Layer Data ------------------------------------
--------------------------------------------------
-- Can be 0 for the default state, 1 thru 4 for each of the BT sub menus,
-- 5 or 6 for the FX sub menus, and 7 for the double-tapped-FX sub menu.
-- Some of the states likely will never be used.
-- Some string values are also accepted for more specific cases like
-- "text" for searching with text input.
local currentState = 0;
local stateData = { };
--------------------------------------------------
--------------------------------------------------
-- Chart Data ------------------------------------
--------------------------------------------------
-- the collective of charts the player can select from
-- Whenever the player selects new filters etc., this is what's updated;
-- a full refresh of the render data (and a resync of the camera position)
-- is needed when this is updated.
local charts;
local chartsCache;
-- which grouping the cursor is currently within
local groupIndex = 1;
-- which set the cursor is on within the group
local cellIndex = 1;
-- which category slot (each of the 5 difficulties) is currently selected
local slotIndex = 1;
-- which chart in a slot, if there are multiple, is selected
local slotChildIndex = 1;
local autoPlay = AutoPlayTargets.None;
--------------------------------------------------
--------------------------------------------------
-- Display Data ----------------------------------
--------------------------------------------------
-- the number of columns to display in the grid
local gridColumnCount = 3;
-- the amount of stepping to apply to each grid row
-- Stepping, here, refers to the percentage of the height to step over
-- the entire row, so 1 row will have each cell vertically offset an
-- increasing amount up to the given percentage.
-- This is not this much per column, but a total for every column.
local gridRowStepping = 0.5;
-- the percentage of the size of a cell that is taken up by the group header
local gridGroupHeaderSize = 0.25;
-- where the camera is along the y axis
local gridCameraPos = 0;
local gridCameraPosTarget = 0;
local infoBounceTimer = 0;
local selectedSongTitleScrollTimer = 0;
local fontSlant;
--------------------------------------------------
--------------------------------------------------
-- Textures --------------------------------------
--------------------------------------------------
local textures =
{
noise = { },
numbers = { },
legend = { },
badges = { },
chartFrame = { },
infoPanel =
{
landscape = { },
portrait = { },
},
};
local currentNoiseTexture;
--------------------------------------------------
--------------------------------------------------
-- Audio -----------------------------------------
--------------------------------------------------
local audio =
{
clicks = { },
};
--------------------------------------------------
--------------------------------------------------
-- Database Filters ------------------------------
--------------------------------------------------
local currentChartCollectionName, searchText = nil, nil;
local filterName, groupName, sortName = "*", "level", "title";
local function verifySearch(chart)
if (searchText and #searchText > 0) then
return string.find(string.lower(chart.songTitle), string.lower(searchText)) or
string.find(string.lower(chart.songArtist), string.lower(searchText)) or
string.find(string.lower(chart.songFileName), string.lower(searchText)) or
string.find(string.lower(chart.charter), string.lower(searchText));
end
return true;
end
local function checkTopDir(s, m)
if (string.sub(s, 1, #m) ~= m) then
return false;
end
if (#s > #m) then
local sep = string.sub(s, #m + 1, #m + 1);
return sep == '/' or sep == '\\';
end
return true;
end
local chartListFilters =
{
["*"] = function(chart) return verifySearch(chart); end,
};
for _, v in next, theori.charts.getFolderNames() do
chartListFilters[v] = function(chart) return checkTopDir(chart.set.filePath, v) and verifySearch(chart); end;
end
for i = 1, 20 do
chartListFilters[i] = function(chart) return chart.difficultyLevel == i and verifySearch(chart); end;
end
local chartListGroupings =
{
level = function(chart) return chart.difficultyLevel; end,
};
local chartListSortings =
{
title = function(chart) return chart.songTitle; end,
};
local cachedFilteredCharts = { };
--------------------------------------------------
--------------------------------------------------
-- Chart Grid Functions --------------------------
--------------------------------------------------
local function getSizeOfGroup(chartGroupIndex)
if (#charts == 0) then return 0; end
local chartGroup = charts[chartGroupIndex];
local rowCount = math.floor((#chartGroup - 1) / gridColumnCount) + 1;
local steppedColsAtEnd = (#chartGroup - 1) % gridColumnCount;
return rowCount + gridGroupHeaderSize +
(steppedColsAtEnd * gridRowStepping / (gridColumnCount - 1));
end
local function getGridCellPosition(gi, si)
local result = 0;
local colIndex = (si - 1) % gridColumnCount;
local rowIndex = math.floor((si - 1) / gridColumnCount);
result = result + rowIndex + 0.5 + gridGroupHeaderSize +
(colIndex * gridRowStepping / (gridColumnCount - 1));
for i = 1, gi - 1 do
result = result + getSizeOfGroup(i);
end
return 0.5 + colIndex, result;
end
local function getGridCameraPosition()
local x, y = getGridCellPosition(groupIndex, cellIndex);
return y;
end
local function lerpAnimTo(from, to, delta, speed)
local absDif = math.abs(from - to);
if (absDif > 10 or absDif < 0.01) then
return to;
else
speed = speed or 20;
return from + (to - from) * speed * delta;
end
end
local function getSetChartRefs(setId)
local cached = chartsCache[setId];
if (not cached) then
chartsCache[setId] = { };
cached = chartsCache[setId];
end
if (cached.relatedSets) then
return cached.relatedSets;
end
local related = { };
for gi, group in next, charts do
for ci, chart in next, group do
if (chart.setID == setId) then
table.insert(related, { groupIndex = gi, cellIndex = ci, chart = chart });
end
end
end
cached.relatedSets = related;
return related;
end
local function ref(chart)
local setChartRefs = getSetChartRefs(chart.setID);
for _, c in next, setChartRefs do
if (c.chart.ID == chart.ID) then
return c;
end
end
-- ono bad
end
local function getScores(chart)
local setId = chart.set.ID;
local cachedSet = chartsCache[setId];
if (not cachedSet) then
chartsCache[setId] = { };
cachedSet = chartsCache[setId];
end
local cached = cachedSet[chart.ID];
if (not cached) then
cachedSet[chart.ID] = { };
cached = cachedSet[chart.ID];
end
if (not cached.scores) then
cached.scores = theori.charts.getScores(chart);
end
return cached.scores;
end
local function getSetSlots(set)
local cached = chartsCache[set.ID];
if (not cached) then
chartsCache[set.ID] = { };
cached = chartsCache[set.ID];
end
if (cached.slots) then
return cached.slots;
end
local slots = { };
for i = 1, 5 do slots[i] = { }; end;
for _, chart in next, set.charts do
table.insert(slots[chart.difficultyIndex], ref(chart));
end
cached.slots = slots;
return slots;
end
local function nearestSlotIndex(setSlots, slotIndex)
local slot = slotIndex;
while (#setSlots[slot] == 0) do
if (slot == 1) then break; end
slot = slot - 1;
end
while (#setSlots[slot] == 0) do
if (slot == 5) then break; end -- OH NO
slot = slot + 1;
end
return slot;
end
local function nearestSlot(setSlots, slotIndex)
return setSlots[nearestSlotIndex(setSlots, slotIndex)];
end
local function nearestSlotChildIndex(slot, slotChildIndex)
return math.min(#slot, slotChildIndex);
end
local function nearestSlotChild(slot, slotChildIndex)
return slot[nearestSlotChildIndex(slot, slotChildIndex)];
end
--------------------------------------------------
--------------------------------------------------
-- Chart Filter Utility --------------------------
--------------------------------------------------
local function getFilteredChartsForConfiguration(filter, grouping, sorting)
local collectionId = currentChartCollectionName or "";
local cacheKey = (collectionId or "") .. '|' .. (searchText or "") .. '|' .. filter .. '|' .. grouping .. '|' .. sorting;
print("Asking for charts with key \"" .. cacheKey .. "\"");
if (cachedFilteredCharts[cacheKey]) then
print(" Found");
local cache = cachedFilteredCharts[cacheKey];
return cache.charts, cache.chartsCache;
end
print(" Not Found");
local charts = theori.charts.getChartSetsFiltered(currentChartCollectionName, chartListFilters[filter], chartListGroupings[grouping], chartListSortings[sorting]);
local chartsCache = { };
cachedFilteredCharts[cacheKey] =
{
charts = charts,
chartsCache = chartsCache,
};
return charts, chartsCache;
end
local function jumpToChartIfExists(setId, chartId)
if (#charts == 0) then return false; end
local chartRefs = getSetChartRefs(setId);
if (not chartRefs or #chartRefs == 0) then return false; end
for _, cref in next, chartRefs do
if (cref.chart.ID == chartId) then
groupIndex = cref.groupIndex;
cellIndex = cref.cellIndex;
slotIndex = 1;
slotChildIndex = 1;
local slots = getSetSlots(cref.chart.set);
for i, diffs in next, slots do
for j, cref in next, diffs do
if (cref.chart.ID == chartId) then
slotIndex = i;
slotChildIndex = j;
end
end
end
gridCameraPosTarget = getGridCameraPosition();
return true;
end
end
return false;
end
local lastChart;
local function updateChartConfiguration()
if (charts and #charts > 0) then
lastChart = charts[groupIndex][cellIndex];
end
local checkSetId, checkChartId;
if (lastChart) then
checkSetId = lastChart.setID;
checkChartId = lastChart.ID;
else
checkSetId = theori.config.get("lastSetId") or -1;
checkChartId = theori.config.get("lastChartId") or -1;
end
theori.config.set("lastSetId", checkSetId);
theori.config.set("lastChartId", checkChartId);
theori.config.save();
charts, chartsCache = getFilteredChartsForConfiguration(filterName, groupName, sortName);
if (not jumpToChartIfExists(checkSetId, checkChartId)) then
groupIndex = 1;
cellIndex = 1;
gridCameraPosTarget = getGridCameraPosition();
end
end
local function createFolderFilterFunctions()
--
end
--------------------------------------------------
--------------------------------------------------
-- Sub Menu State Functions ----------------------
--------------------------------------------------
local function setState(nextState)
textInput.stop();
currentState = nextState;
end
local function setTextInput()
if (currentState == "text" or textInput.isActive()) then return; end
setState("text");
textInput.start(searchText);
end
--------------------------------------------------
--------------------------------------------------
-- Delegate Functions ----------------------------
--------------------------------------------------
local function onKeyPressed(key)
if (stateData[currentState].keyPressed) then
stateData[currentState]:keyPressed(key);
end
end
local function onAxisTicked(controller, axis, dir)
if (stateData[currentState].axisTicked) then
stateData[currentState]:axisTicked(controller, axis, dir);
end
end
local function onButtonPressed(controller, button)
if (stateData[currentState].buttonPressed) then
stateData[currentState]:buttonPressed(controller, button);
end
end
local function onButtonReleased(controller, button)
if (stateData[currentState].buttonReleased) then
stateData[currentState]:buttonReleased(controller, button);
end
end
--------------------------------------------------
--------------------------------------------------
-- Theori Layer Functions ------------------------
--------------------------------------------------
function theori.layer.construct()
end
function theori.layer.doAsyncLoad()
updateChartConfiguration();
-- TODO(local): save the selected chart/slot and gather the indices afterward
-- TODO(local): make sure there's slots in the selected set
for i = 0, 9 do
textures.numbers[i] = theori.graphics.queueTextureLoad("spritenums/slant/" .. i);
end
for i = 0, 9 do
textures.noise[i] = theori.graphics.queueTextureLoad("noise/" .. i);
end
--[[
textures.legend.a = theori.graphics.getStaticTexture("legend/bt/a");
textures.legend.b = theori.graphics.getStaticTexture("legend/bt/b");
textures.legend.c = theori.graphics.getStaticTexture("legend/bt/c");
textures.legend.d = theori.graphics.getStaticTexture("legend/bt/d");
textures.legend.l = theori.graphics.getStaticTexture("legend/fx/l");
textures.legend.r = theori.graphics.getStaticTexture("legend/fx/r");
textures.legend.lr = theori.graphics.getStaticTexture("legend/fx/lr");
textures.legend.start = theori.graphics.getStaticTexture("legend/start");
textures.badges.Perfect = theori.graphics.getStaticTexture("badges/Perfect");
textures.badges.S = theori.graphics.getStaticTexture("badges/S");
textures.badges.AAAX = theori.graphics.getStaticTexture("badges/AAAX");
textures.badges.AAA = theori.graphics.getStaticTexture("badges/AAA");
textures.badges.AAX = theori.graphics.getStaticTexture("badges/AAX");
textures.badges.AA = theori.graphics.getStaticTexture("badges/AA");
textures.badges.AX = theori.graphics.getStaticTexture("badges/AX");
textures.badges.A = theori.graphics.getStaticTexture("badges/A");
textures.badges.B = theori.graphics.getStaticTexture("badges/B");
textures.badges.C = theori.graphics.getStaticTexture("badges/C");
textures.badges.F = theori.graphics.getStaticTexture("badges/F");
--]]
textures.cursor = theori.graphics.queueTextureLoad("chartSelect/cursor");
textures.cursorOuter = theori.graphics.queueTextureLoad("chartSelect/cursorOuter");
textures.levelBadge = theori.graphics.queueTextureLoad("chartSelect/levelBadge");
textures.levelBadgeBorder = theori.graphics.queueTextureLoad("chartSelect/levelBadgeBorder");
textures.levelBar = theori.graphics.queueTextureLoad("chartSelect/levelBar");
textures.levelBarBorder = theori.graphics.queueTextureLoad("chartSelect/levelBarBorder");
textures.levelText = theori.graphics.queueTextureLoad("chartSelect/levelText");
local frameTextures = { "background", "border", "fill", "storageDevice", "trackDataLabel" };
for _, texName in next, frameTextures do
textures.chartFrame[texName] = theori.graphics.queueTextureLoad("chartSelect/chartFrame/" .. texName);
end
local infoPanelPortrait = { "border", "fill", "jacketBorder" };
for _, texName in next, infoPanelPortrait do
textures.infoPanel.portrait[texName] = theori.graphics.queueTextureLoad("chartSelect/infoPanel/portrait/" .. texName);
end
textures.noJacket = theori.graphics.queueTextureLoad("chartSelect/noJacket");
textures.noJacketOverlay = theori.graphics.queueTextureLoad("chartSelect/noJacketOverlay");
textures.infoPanel.landscape.background = theori.graphics.queueTextureLoad("chartSelect/landscapeInfoPanelBackground");
textures.infoPanel.portrait.tempBackground = theori.graphics.queueTextureLoad("chartSelect/tempPortraitInfoPanelBackground");
audio.clicks.primary = theori.audio.queueAudioLoad("chartSelect/click0");
Layouts.Landscape.Background = theori.graphics.queueTextureLoad(bgName .. "_LS");
Layouts.Portrait.Background = theori.graphics.queueTextureLoad(bgName .. "_PR");
return true;
end
function theori.layer.onClientSizeChanged(w, h)
Layout.CalculateLayout();
end
function theori.layer.resumed()
theori.graphics.openCurtain();
end
function theori.layer.init()
getLegends(textures.legend);
getLegends(textures.badges);
theori.charts.setDatabaseToClean(function()
theori.charts.setDatabaseToPopulate(function() print("Populate (from chart select) finished."); end);
end);
audio.clicks.primary.volume = 0.5;
gridCameraPosTarget = getGridCameraPosition();
fontSlant = theori.graphics.getStaticFont("slant");
theori.graphics.openCurtain();
theori.input.keyboard.pressed.connect(onKeyPressed);
theori.input.controller.pressed.connect(onButtonPressed);
theori.input.controller.released.connect(onButtonReleased);
theori.input.controller.axisTicked.connect(onAxisTicked);
end
function theori.layer.update(delta, total)
timer = total;
currentNoiseTexture = textures.noise[math.floor((timer * 24) % 10)];
selectedSongTitleScrollTimer = selectedSongTitleScrollTimer + delta;
Layout.Update(delta, total);
for _, v in next, stateData do
if (v.update) then
v:update(delta, total);
end
end
-- layout agnostic functions
gridCameraPos = lerpAnimTo(gridCameraPos, gridCameraPosTarget, delta);
end
function theori.layer.render()
Layout.CheckLayout();
Layout.DoTransform();
Layout.Render();
end
--------------------------------------------------
--------------------------------------------------
-- Layout Rendering Functions --------------------
--------------------------------------------------
local function renderSpriteNumCenteredNumDigits(num, dig, x, y, h, r, g, b, a)
local w = 0;
local digInfos = { };
for i = dig, 1, -1 do
local tento, tentom1 = math.pow(10, i), math.pow(10, i - 1);
local tex = textures.numbers[math.floor((num % tento) / tentom1)];
local texWidth = h * tex.aspectRatio;
table.insert(digInfos, { texture = tex, width = texWidth });
w = w + texWidth;
end
local xPos, yPos = x - w / 2, y - h / 2;
for _, info in next, digInfos do
theori.graphics.setFillToTexture(info.texture, r, g, b, a);
theori.graphics.fillRect(xPos, yPos, info.width, h);
xPos = xPos + info.width;
end
end
local function renderCursor(x, y, size)
local s0 = size * (1 + 0.05 * (math.abs(math.sin(timer * 6))));
local s1 = size * (1 + 0.12 * (math.abs(math.sin(timer * 6))));
local alpha = 170 + 60 * (math.abs(math.sin(timer * 3)));
theori.graphics.setFillToTexture(textures.cursor, 0, 255, 255, alpha);
theori.graphics.fillRect(x - s0 / 2, y - s0 / 2, s0, s0);
theori.graphics.setFillToTexture(textures.cursorOuter, 0, 255, 255, alpha);
theori.graphics.fillRect(x - s1 / 2, y - s1 / 2, s1, s1);
end
local function renderCell(chart, x, y, w, h, partial)
--if (not chart) then return; end
partial = partial and true or false; -- not necessary but explicit
local isSelected = chart and (charts[groupIndex][cellIndex] == chart) or false;
local r, g, b = 180, 180, 180;
if (chart) then
r, g, b = chart.difficultyColor;
end
local diffLvl = chart and chart.difficultyLevel or 0;
theori.graphics.setFillToTexture(textures.chartFrame.fill, 80, 80, 80, 210);
theori.graphics.fillRect(x, y, w, h);
theori.graphics.setFillToTexture(textures.chartFrame.background, 50, 50, 50, 255);
theori.graphics.fillRect(x, y, w, h);
theori.graphics.setFillToTexture(textures.chartFrame.border, r, g, b, 255);
theori.graphics.fillRect(x, y, w, h);
theori.graphics.setFillToTexture(textures.chartFrame.trackDataLabel, 255, 255, 255, 255);
theori.graphics.fillRect(x, y, w, h);
local jx, jy, jw, jh = x + 0.1 * w, y + 0.155 * h, w * 0.6, h * 0.6;
if (not chart or not chart.hasJacketTexture) then
theori.graphics.setFillToTexture(textures.noJacket, 255, 255, 255, 255);
theori.graphics.fillRect(jx, jy, jw, jh);
theori.graphics.setFillToTexture(currentNoiseTexture, 255, 255, 255, 70);
theori.graphics.fillRect(jx, jy, jw, jh);
if (isSelected) then
theori.graphics.setFillToTexture(textures.noJacketOverlay, 255, 255, 255, 175 + 60 * math.abs(math.sin(timer * 3)));
else
theori.graphics.setFillToTexture(textures.noJacketOverlay, 255, 255, 255, 205);
end
theori.graphics.fillRect(jx, jy, jw, jh);
else
theori.graphics.setFillToTexture(chart.getJacketTexture(), 255, 255, 255, 255);
theori.graphics.fillRect(jx, jy, jw, jh);
end
theori.graphics.setFillToTexture(textures.levelBadgeBorder, r, g, b, 255);
theori.graphics.fillRect(x + w * 0.73, y + h * 0.55, w * 0.22, h * 0.22);
theori.graphics.setFillToTexture(textures.levelBadge, 50, 50, 50, 170);
theori.graphics.fillRect(x + w * 0.73, y + h * 0.55, w * 0.22, h * 0.22);
renderSpriteNumCenteredNumDigits(diffLvl,
2, x + w * 0.835, y + h * 0.665, h * 0.09,
0, 0, 0, 255);
renderSpriteNumCenteredNumDigits(diffLvl,
2, x + w * 0.84, y + h * 0.66, h * 0.09,
255, 255, 255, 255);
theori.graphics.saveTransform();
if (isSelected) then
theori.graphics.rotate(timer * 180);
end
theori.graphics.translate(LayoutScale * (x + w * (79 / 1028)), LayoutScale * (y + h * (75 / 1028)));
theori.graphics.setFillToTexture(textures.chartFrame.storageDevice, 255, 255, 255, 255);
local sdw, sdh = w * (100 / 1028), h * (100 / 1028);
theori.graphics.fillRect(-sdw / 2, -sdh / 2, sdw, sdh);
theori.graphics.restoreTransform();
if (chart) then
local scores = getScores(chart);
if (#scores > 0) then
local score = scores[#scores];
local rankTexture = textures.badges[tostring(score.rank)];
if (rankTexture) then
theori.graphics.setFillToTexture(rankTexture, 255, 255, 255, 255);
theori.graphics.fillRect(x + w * (761 / 1028), y + h * (155 / 1028), w * 210 / 1028, h * 179 / 1028);
end
local gaugeString = string.format("%d%%", math.floor(score.fVal1 * 100 + 0.5));
theori.graphics.setFont(nil);
theori.graphics.setFontSize(h * 0.1);
theori.graphics.setTextAlign(Anchor.MiddleCenter);
theori.graphics.setFillToColor(255, 255, 255, 255);
theori.graphics.fillString(gaugeString, x + w * (866 / 1028), y + h * (439 / 1028));
end
end
if (chart and not partial) then
theori.graphics.setFontSize(h * 0.075);
local titleBoundsX, _ = theori.graphics.measureString(chart.songTitle);
local centerTitle = titleBoundsX < w * 0.8;
local expectedScrollTime = (titleBoundsX - w * 0.8) / 40;
local relativeTime = math.max(0, math.min(1, ((selectedSongTitleScrollTimer % (4 + expectedScrollTime)) - 2) / expectedScrollTime));
local titleOffsetX = centerTitle and w * 0.4 or - relativeTime * (titleBoundsX - w * 0.8 + 1);
if (not centerTitle) then
theori.graphics.saveScissor();
theori.graphics.scissor(x * LayoutScale + w * LayoutScale * 0.1, y * LayoutScale + h * LayoutScale * 0.7 + 0.5, w * LayoutScale * 0.8, h * LayoutScale * 0.3 + 0.5);
end
theori.graphics.setFont(nil);
theori.graphics.setTextAlign(centerTitle and Anchor.MiddleCenter or Anchor.MiddleLeft);
theori.graphics.setFillToColor(255, 255, 255, 255);
theori.graphics.fillString(chart.songTitle, x + w * 0.1 + titleOffsetX, y + h * 0.825);
if (not centerTitle) then
theori.graphics.restoreScissor();
end
end
end
local function renderChartGridPanel(x, y, w, h)
if (#charts == 0) then return; end
local cellSize = w / gridColumnCount;
local hUnits = h / cellSize;
local totalGroupsHeight = 0;
for i = 1, #charts do
totalGroupsHeight = totalGroupsHeight + getSizeOfGroup(i);
end
local camPosUnits = math.max(hUnits / 2, math.min(totalGroupsHeight - hUnits / 2, gridCameraPos));
local minCamera = camPosUnits - hUnits / 2;
local maxCamera = camPosUnits + hUnits / 2;
local yOffset = y - minCamera * cellSize;
local margin = cellSize * 0.05;
local yPosRel = 0;
for gi = 1, #charts do
if (yPosRel > maxCamera) then break; end
local group = charts[gi];
local groupHeight = getSizeOfGroup(gi);
-- if the bottom of this group is in view, we start checking cell rendering
if (yPosRel + groupHeight > minCamera) then
if (yPosRel + gridGroupHeaderSize > minCamera) then
theori.graphics.setFillToColor(50, 160, 255, 200);
theori.graphics.fillRect(x, yOffset + yPosRel * cellSize, w, gridGroupHeaderSize * cellSize);
end
for ci = 1, #group do
local chart = group[ci];
local selected = gi == groupIndex and ci == cellIndex;
local rowIndex = math.floor((ci - 1) / gridColumnCount);
local colIndex = (ci - 1) % gridColumnCount;
local yPosRelSet = yPosRel + gridGroupHeaderSize + rowIndex +
(colIndex * gridRowStepping / (gridColumnCount - 1));
if (yPosRelSet < maxCamera and yPosRelSet + 1 > minCamera) then;
local cx, cy = margin + x + colIndex * cellSize, margin + yOffset + yPosRelSet * cellSize;
local cs = cellSize - 2 * margin;
renderCell(chart, cx, cy, cs, cs);
end
end
end
yPosRel = yPosRel + groupHeight;
end
local cursorCenterX, cursorCenterY = getGridCellPosition(groupIndex, cellIndex);
renderCursor(x + cellSize * cursorCenterX, yOffset + cellSize * cursorCenterY, cellSize);
end
local function renderChartLevelBar(set, x, y, w, h)
local setSlots = set and getSetSlots(set) or { { }, { }, { }, { }, { } };
local cSlotIndex = set and nearestSlotIndex(setSlots, slotIndex);
local chart = set and nearestSlotChild(setSlots[cSlotIndex], slotChildIndex).chart;
local r, g, b = 180, 180, 180;
if (chart) then
r, g, b = chart.difficultyColor;
end
theori.graphics.setFillToTexture(textures.levelBarBorder, r, g, b, 255);
theori.graphics.fillRect(x, y, w, h);
theori.graphics.setFillToTexture(textures.levelBar, 50, 50, 50, 170);
theori.graphics.fillRect(x, y, w, h);
theori.graphics.setFillToTexture(textures.levelText, 255, 255, 255, 255);
theori.graphics.fillRect(x, y, h, h);
for i = 1, 5 do
local slot = setSlots[i];
local r, g, b = 100, 100, 100;
local childIndex;
if (#slot > 0) then
childIndex = nearestSlotChildIndex(slot, slotChildIndex);
r, g, b = slot[childIndex].chart.difficultyColor;
end
local s = h * 0.7;
local o = (h - s) / 2;
theori.graphics.setFillToTexture(textures.levelBadgeBorder, r, g, b, 255);
theori.graphics.fillRect(x + h * i + o, y + o, s, s);
theori.graphics.setFillToTexture(textures.levelBadge, 50, 50, 50, 255);
theori.graphics.fillRect(x + h * i + o, y + o, s, s);
if (#slot > 0) then
local diffLvl = slot[childIndex].chart.difficultyLevel;
renderSpriteNumCenteredNumDigits(diffLvl,
2, x + h * i + h / 2 - 2, y + h / 2 + 2, s * 0.4,
0, 0, 0, 255);
renderSpriteNumCenteredNumDigits(diffLvl,
2, x + h * i + h / 2, y + h / 2, s * 0.4,
255, 255, 255, 255);
end
end
if (set) then
renderCursor(x + h * cSlotIndex + h / 2, y + h / 2, h);
end
end
local function renderLandscapeInfoPanel(chart, x, y, w, h)
renderCell(chart, x + w * 0.1, y, w * 0.8, h * 0.8, true);
theori.graphics.setFillToTexture(textures.infoPanel.landscape.background, 50, 50, 50, 255);
theori.graphics.fillRect(x, y, w, h);
renderChartLevelBar(chart and chart.set, x + w * 0.25, y + h * 0.875, w * 0.75, h * 0.125);
end
function renderPortraitInfoPanel(chart, x, y, w, h)
theori.graphics.setFillToTexture(textures.infoPanel.portrait.border, 255, 255, 255, 255);
theori.graphics.fillRect(x, y, w, h);
theori.graphics.setFillToTexture(textures.infoPanel.portrait.fill, 50, 50, 50, 170);
theori.graphics.fillRect(x, y, w, h);
theori.graphics.setFillToTexture(textures.infoPanel.portrait.jacketBorder, 255, 255, 255, 255);
theori.graphics.fillRect(x, y, w, h);
local chartLevelBarWidth = w * (1006 / 1440);
local chartLevelBarHeight = chartLevelBarWidth / 6;
renderChartLevelBar(chart.set, w - chartLevelBarWidth, 7 + h - chartLevelBarHeight, chartLevelBarWidth, chartLevelBarHeight);
end
function Layouts.Landscape.Update(self, delta, total)
infoBounceTimer = math.max(0, infoBounceTimer - delta * 5);
end
function Layouts.Landscape.Render(self)
Layout.DrawBackgroundFilled(self.Background);
local howtoScale = 0.85;
gridColumnCount = 3;
local chartGridPanelWidth = math.min(LayoutWidth * 0.5, LayoutHeight);
local infoPanelWidth = math.min(LayoutHeight * howtoScale, LayoutWidth - chartGridPanelWidth);
while (LayoutWidth - (chartGridPanelWidth + infoPanelWidth) > (chartGridPanelWidth / (gridColumnCount - 1))) do
chartGridPanelWidth = chartGridPanelWidth + chartGridPanelWidth / (gridColumnCount - 1);
gridColumnCount = gridColumnCount + 1;
infoPanelWidth = math.min(LayoutHeight, LayoutWidth - chartGridPanelWidth);
end
local infoPanelX = (infoBounceTimer * infoPanelWidth * 0.01) + ((LayoutWidth - chartGridPanelWidth) - infoPanelWidth) / 2;
local infoPanelY = (infoBounceTimer * infoPanelWidth * 0.01) + (LayoutHeight * howtoScale - infoPanelWidth) / 2;
renderChartGridPanel(LayoutWidth - chartGridPanelWidth, 0, chartGridPanelWidth, LayoutHeight);
local chart = #charts > 0 and charts[groupIndex][cellIndex] or nil;
renderLandscapeInfoPanel(chart, infoPanelX, infoPanelY, infoPanelWidth, infoPanelWidth);
for k, v in next, stateData do
if (k ~= 0 and stateData[k].renderLandscape) then
stateData[k]:renderLandscape();
end
end
theori.graphics.setFillToTexture(textures.legend.l, 255, 255, 255, 255);
theori.graphics.fillRect(0.25 * infoPanelWidth - LayoutHeight * 0.0625, LayoutHeight * howtoScale, LayoutHeight * 0.125, LayoutHeight * 0.125);
theori.graphics.setFillToTexture(textures.legend.lr, 255, 255, 255, 255);
theori.graphics.fillRect(0.75 * infoPanelWidth - LayoutHeight * 0.0625, LayoutHeight * howtoScale, LayoutHeight * 0.125, LayoutHeight * 0.125);
theori.graphics.setFont(nil);
theori.graphics.setFillToColor(255, 255, 255, 255);
theori.graphics.setFontSize(LayoutHeight * 0.02);
theori.graphics.setTextAlign(Anchor.MiddleCenter);
theori.graphics.fillString("Chart Filter / Sort", 0.25 * infoPanelWidth, LayoutHeight * 0.97);
theori.graphics.fillString("Gameplay Settings", 0.75 * infoPanelWidth, LayoutHeight * 0.97);
end
function Layouts.Portrait.Render(self)
Layout.DrawBackgroundFilled(self.Background);
gridColumnCount = 3;
local infoPanelHeight = LayoutWidth * (275 / 720);
local consolePanelHeight = LayoutWidth * 0.285;
local chartGridPanelHeight = LayoutHeight - infoPanelHeight - consolePanelHeight;
local chart = #charts > 0 and charts[groupIndex][cellIndex] or nil;
renderPortraitInfoPanel(chart, 0, 0, LayoutWidth, infoPanelHeight);
theori.graphics.scissor(0, infoPanelHeight * LayoutScale, LayoutWidth * LayoutScale, chartGridPanelHeight * LayoutScale);
renderChartGridPanel(0, infoPanelHeight, LayoutWidth, chartGridPanelHeight);
theori.graphics.resetScissor();
for k, v in next, stateData do
if (k ~= 0 and stateData[k].renderPortrait) then
stateData[k]:renderPortrait();
end
end
end
--------------------------------------------------
--------------------------------------------------
-- Default State Functions -----------------------
--------------------------------------------------
local defaultState = { };
stateData[0] = defaultState;
function defaultState.update(self, delta, total)
-- updates specific to this state
end
function defaultState.keyPressed(self, key)
if (key == KeyCode.TAB) then
setTextInput();
end
end
function defaultState.buttonPressed(self, controller, button)
if (button == "back") then
theori.graphics.closeCurtain(0.2, theori.layer.pop);
elseif (button == "start") then
if (#charts == 0) then return; end
local chart = charts[groupIndex][cellIndex];
theori.graphics.closeCurtain(0.2, function() nsc.pushGameplay(chart, autoPlay); end);
elseif (button == 3) then -- TEMP TEMP TEMP
if (charts and #charts > 0) then
local chart = charts[groupIndex][cellIndex];
theori.charts.addChartToCollection("Favorites", chart);
end
elseif (button >= 0 and button <= 3 and stateData[button + 1]) then
setState(button + 1);
elseif (button == 4 or button == 5) then
if (controller.isDown(4) and controller.isDown(5) and stateData[7]) then
setState(7);
end
end
end
function defaultState.buttonReleased(self, controller, button)
if (button == 4 or button == 5) then
setState(button + 1);
end
end
function defaultState.axisTicked(self, controller, axis, dir)
if (#charts == 0) then return; end
if (axis == 0) then
local chart = charts[groupIndex][cellIndex];
local set = chart.set;
local setSlots = getSetSlots(set);
local cSlotIndex = nearestSlotIndex(setSlots, slotIndex);
local cSlotChildIndex = nearestSlotChildIndex(setSlots[cSlotIndex], slotChildIndex);
local newSlotIndex = cSlotIndex;
while (true) do
newSlotIndex = newSlotIndex + dir;
if (newSlotIndex < 1 or newSlotIndex > 5) then break; end
if (#setSlots[newSlotIndex] > 0) then
break;
end
end
if (newSlotIndex == cSlotIndex or newSlotIndex < 1 or newSlotIndex > 5) then return; end
slotIndex = newSlotIndex;
slotChildIndex = nearestSlotChildIndex(setSlots[slotIndex], cSlotChildIndex);
local nextChartRef = setSlots[slotIndex][slotChildIndex];
groupIndex = nextChartRef.groupIndex;
cellIndex = nextChartRef.cellIndex;
chart = charts[groupIndex][cellIndex];
theori.config.set("lastSetId", chart.setID);
theori.config.set("lastChartId", chart.ID);
theori.config.save();
gridCameraPosTarget = getGridCameraPosition();
infoBounceTimer = 1;
audio.clicks.primary.playFromStart();
elseif (axis == 1) then
cellIndex = cellIndex + dir;
if (cellIndex < 1) then
groupIndex = groupIndex - 1;
if (groupIndex < 1) then
groupIndex = #charts;
end
cellIndex = #charts[groupIndex];
elseif (cellIndex > #charts[groupIndex]) then
groupIndex = groupIndex + 1;
if (groupIndex > #charts) then
groupIndex = 1;
end
cellIndex = 1;
end
local chart = charts[groupIndex][cellIndex];
slotIndex = chart.difficultyIndex;
slotChildIndex = 1;
theori.config.set("lastSetId", chart.setID);
theori.config.set("lastChartId", chart.ID);
theori.config.save();
gridCameraPosTarget = getGridCameraPosition();
infoBounceTimer = 1;
audio.clicks.primary.playFromStart();
end
end
--------------------------------------------------
--------------------------------------------------
-- FX L State Functions --------------------------
--------------------------------------------------
local fxlState =
{
inoutTransition = 0,
defaultEntries =
{
{
name = "All Charts",
onSelected = function(self)
currentChartCollectionName = nil;
filterName = "*";
end,
},
{
name = "Collections",
onSelected = function()
local subFolder = { };
for _, col in next, theori.charts.getCollectionNames() do
table.insert(subFolder, {
name = col,
onSelected = function(self)
currentChartCollectionName = self.name;
filterName = "*";
end,
});
end
return subFolder;
end,
},
{
name = "Folders",
onSelected = function(self)
local subFolder = { };
for _, fol in next, theori.charts.getFolderNames() do
table.insert(subFolder, {
name = fol,
onSelected = function(self)
currentChartCollectionName = nil;
filterName = self.name;
end,
});
end
return subFolder;
end,
},
{
name = "Levels",
onSelected = function(self)
local subFolder = { };
for i = 1, 20 do
table.insert(subFolder, {
name = "Level " .. tostring(i),
onSelected = function(self)
--currentChartCollectionName = nil;
filterName = i;
end,
});
end
return subFolder;
end,
},
},
previousEntries = { },
};
fxlState.entries = { entryIndex = 1, entries = fxlState.defaultEntries };
stateData[5] = fxlState;
function fxlState.update(self, delta, total)
if (currentState == 5) then
self.inoutTransition = math.min(1, self.inoutTransition + delta * 10);
else
self.inoutTransition = math.max(0, self.inoutTransition - delta * 10);
end
end
function fxlState.navigateUp(self)
if (#self.previousEntries == 0) then
setState(0);
else
local previous = self.previousEntries[#self.previousEntries];
table.remove(self.previousEntries, #self.previousEntries);
self.entries = previous;
end
end
function fxlState.buttonPressed(self, controller, button)
if (button == "back") then
self:navigateUp();
elseif (button == "start") then
if (#self.entries.entries == 0) then return; end
local result = self.entries.entries[self.entries.entryIndex]:onSelected();
if (result) then
table.insert(self.previousEntries, self.entries);
self.entries = { entryIndex = 1, entries = result };
else
if (#self.previousEntries > 0) then
self.entries = self.previousEntries[1];
end
self.previousEntries = { };
--print(currentChartCollectionName);
updateChartConfiguration();
setState(0);
end
elseif (button == 6) then
local menuTitle = nil;
if (#self.previousEntries > 0) then
--menuTitle =
self.entries = self.previousEntries[1];
end
self.previousEntries = { };
setTextInput();
end
end
function fxlState.buttonReleased(self, controller, button)
if (button == 4) then
self:navigateUp();
end
end
function fxlState.axisTicked(self, controller, axis, dir)
audio.clicks.primary.playFromStart();
local entries = self.entries;
entries.entryIndex = entries.entryIndex + dir;
if (entries.entryIndex < 1) then entries.entryIndex = #entries.entries; end
if (entries.entryIndex > #entries.entries) then entries.entryIndex = 1; end
end
function fxlState.renderDim(self)
theori.graphics.setFillToColor(0, 0, 0, 127 * self.inoutTransition);
theori.graphics.fillRect(0, 0, LayoutWidth, LayoutHeight);
end
function fxlState.renderEntries(self, x, y, w, h)
theori.graphics.setFillToColor(50, 50, 50, 170);
theori.graphics.fillRect(x, y, w / 2, h);
theori.graphics.setFont(nil);
theori.graphics.setTextAlign(Anchor.MiddleCenter);
theori.graphics.setFontSize(24);
for coli, entry in next, self.entries.entries do
local col = entry.name;
local offs = 30 * (coli - self.entries.entryIndex);
if (coli == self.entries.entryIndex) then
theori.graphics.setFillToColor(255, 255, 0, 255);
else
theori.graphics.setFillToColor(255, 255, 255, 200);
end
theori.graphics.fillString(col, x + w * 0.25, offs + y + h * 0.5);
end
end
function fxlState.renderLandscape(self)
if (self.inoutTransition == 0) then return; end
self:renderDim();
self:renderEntries(-(1 - self.inoutTransition) * LayoutWidth * 0.25, LayoutHeight * 0.125, LayoutWidth * 0.5, LayoutHeight * 0.75);
theori.graphics.setFillToTexture(textures.legend.r, 255, 255, 255, 255);
theori.graphics.fillRect(LayoutWidth - LayoutHeight * 0.15, LayoutHeight - LayoutHeight * 0.15 * self.inoutTransition, LayoutHeight * 0.125, LayoutHeight * 0.125);
theori.graphics.setFont(nil);
theori.graphics.setFillToColor(255, 255, 255, 255);
theori.graphics.setFontSize(LayoutHeight * 0.02);
theori.graphics.setTextAlign(Anchor.MiddleRight);
theori.graphics.fillString("Search Charts", LayoutWidth * 0.95, LayoutHeight * 0.97);
end
function fxlState.renderPortrait(self)
if (self.inoutTransition == 0) then return; end
self:renderDim();
self:renderEntries(-(1 - self.inoutTransition) * LayoutWidth * 0.375, LayoutHeight * 0.25, LayoutWidth * 0.75, LayoutHeight * 0.5);
end
--------------------------------------------------
--------------------------------------------------
-- Text State Functions --------------------------
--------------------------------------------------
local textState = { };
stateData["text"] = textState;
function textState.keyPressed(self, key)
if (key == KeyCode.ESCAPE) then
setState(0);
elseif (key == KeyCode.RETURN) then
searchText = textInput.getText();
updateChartConfiguration();
setState(0);
end
end
function textState.buttonPressed(self, controller, button)
if (button == "back") then
setState(0);
elseif (button == "start") then
searchText = textInput.getText();
updateChartConfiguration();
setState(0);
end
end
function textState.renderLandscape(self)
if (not textInput.isActive()) then return; end
local w, h = LayoutWidth, LayoutHeight;
theori.graphics.setFillToColor(0, 0, 0, 127);
theori.graphics.fillRect(0, 0, w, h);
local text = textInput.getText();
if (text and #text > 0) then
theori.graphics.setFont(nil);
theori.graphics.setTextAlign(Anchor.MiddleCenter);
theori.graphics.setFontSize(h * 0.07);
theori.graphics.setFillToColor(255, 255, 255, 255);
theori.graphics.fillString(text, w / 2, h / 2);
end
end
function textState.renderPortrait(self)
if (not textInput.isActive()) then return; end
local w, h = LayoutWidth, LayoutHeight;
theori.graphics.setFillToColor(0, 0, 0, 127);
theori.graphics.fillRect(0, 0, w, h);
local text = textInput.getText();
if (text and #text > 0) then
theori.graphics.setFont(nil);
theori.graphics.setTextAlign(Anchor.MiddleCenter);
theori.graphics.setFontSize(h * 0.03);
theori.graphics.setFillToColor(255, 255, 255, 255);
theori.graphics.fillString(text, w / 2, h / 2);
end
end
-------------------------------------------------- |
---ite
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Administrator.
--- DateTime: 2021/3/2 20:29
---
local modGui = require("mod-gui")
require("lib.ksptooi.commons.ExportModule")
--创建ext菜单按钮
function initExtMenuBtn(player)
local btnFlow = modGui.get_button_flow(player)
if btnFlow.extMenuBtnId ~= nil then
return
end
btnFlow.add({
name = guiEnum.extMenu.btnInit
,type = "sprite-button"
,caption = "我的菜单(EXT)"
,style=modGui.button_style
})
end
--ext菜单按钮被点击
function clickExtMenuBtn(event)
local player = getPlayer(event)
end
--渲染ext菜单
function displayExtMenu(event)
end |
-- ---------------------------------------------
-- ljsc.lua 2017/06/18
-- Copyright (c) 2017 Toshi Nagata
-- released under the MIT open source license.
-- ---------------------------------------------
-- Where am I?
local pname = ...
local dname = string.gsub(pname, "init", "")
package.path = dname .. "?.lua;" .. package.path
|
local skynet = require "skynet"
local socket = require "skynet.socket"
local string = string
local SERVICE_NAME = "http_worker"
skynet.start(function()
local agent = {}
local protocol = "http"
for i= 1, 5 do
agent[i] = skynet.newservice(SERVICE_NAME, "agent", protocol)
end
local balance = 1
local id = socket.listen("0.0.0.0", 8001)
skynet.error(string.format("Listen web port 8001 protocol:%s", protocol))
socket.start(id , function(id, addr)
skynet.error(string.format("%s connected, pass it to agent :%08x", addr, agent[balance]))
skynet.send(agent[balance], "lua", id)
balance = balance + 1
if balance > #agent then
balance = 1
end
end)
end) |
---------------------------------------------------
-- pawnSpace - lib
---------------------------------------------------
-- provides functions for moving pawns around
-- during a skill effect, in order to force
-- a particular board preview.
--
-- valid sequences are [clear - rewind] or [filter - rewind]
-- and there should be NO_DELAY between them, or there will be bugs.
local this = {}
local displaced = {}
lmn_displaced = {}
local function filterSpace(fx, p, pawnId, queued)
assert(type(fx) == 'userdata')
assert(type(p) == 'userdata')
assert(type(p.x) == 'number')
assert(type(p.y) == 'number')
assert(type(pawnId) == 'number')
queued = queued or ""
fx["Add".. queued .."Script"](fx, string.format([[
lmn_displaced = {};
local p = %s;
repeat
local pawn = Board:GetPawn(p);
local id = pawn:GetId();
if not pawn or id == %s then
break;
end
pawn:SetSpace(Point(-1, -1));
lmn_displaced[id] = p;
until false;
]], p:GetString(), pawnId))
end
local function clearSpace(fx, p, queued)
assert(type(fx) == 'userdata')
assert(type(p) == 'userdata')
assert(type(p.x) == 'number')
assert(type(p.y) == 'number')
queued = queued or ""
fx["Add".. queued .."Script"](fx, string.format([[
lmn_displaced = {};
local p = %s;
repeat
local pawn = Board:GetPawn(p);
if not pawn then
break;
end
pawn:SetSpace(Point(-1, -1));
lmn_displaced[pawn:GetId()] = p;
until false;
]], p:GetString()))
end
local function rewind(fx, queued)
assert(type(fx) == 'userdata')
queued = queued or ""
fx["Add".. queued .."Script"](fx, [[
for id, p in pairs(lmn_displaced) do
Board:GetPawn(id):SetSpace(p);
end;
]])
end
local function filterSpaceInstant(p, pawnId)
assert(type(pawnId) == 'number')
displaced = {}
repeat
local pawn = Board:GetPawn(p)
local id = pawn:GetId()
if not pawn or id == pawnId then
break
end
pawn:SetSpace(Point(-1, -1))
displaced[id] = p
until false
end
local function clearSpaceInstant(p)
displaced = {}
repeat
local pawn = Board:GetPawn(p)
if not pawn then
break
end
pawn:SetSpace(Point(-1, -1))
displaced[pawn:GetId()] = p
until false
end
local function rewindInstant()
for id, p in pairs(displaced) do
Board:GetPawn(id):SetSpace(p)
end
end
-- filters a tile, effecively moving all other
-- pawns away from it, until we can grab it with
-- Board:GetPawn(p)
-- usage: damage on tile will now be done to this pawn.
-- trying to move from tile will pick this pawn.
-- can be useful if multiple pawns will be on this tile
-- during a moment in a skill effect.
function this.FilterSpace(fx, p, pawnId)
if
type(fx) == 'userdata' and
type(fx.x) == 'number' and
type(fx.y) == 'number'
then
filterSpaceInstant(fx, p)
return
end
filterSpace(fx, p, pawnId)
end
-- queued version of FilterSpace.
function this.QueuedFilterSpace(fx, p, pawnId)
filterSpace(fx, p, pawnId, "Queued")
end
-- clears a tile of all pawns.
-- can be useful to apply skill effects to a tile
-- to enable a skill preview, but when it comes to
-- carrying out the action, the pawn is not there.
function this.ClearSpace(fx, p)
if
type(fx) == 'userdata' and
type(fx.x) == 'number' and
type(fx.y) == 'number'
then
clearSpaceInstant(fx)
return
end
clearSpace(fx, p)
end
-- queued version of ClearSpace.
function this.QueuedClearSpace(fx, p)
clearSpace(fx, p, "Queued")
end
-- reverts actions done by clear and filter.
function this.Rewind(fx)
if not fx then
rewindInstant()
return
end
rewind(fx)
end
-- queued version of Rewind.
function this.QueuedRewind(fx)
rewind(fx, "Queued")
end
return this |
ITEM.name = "9x39 Ammo"
ITEM.model = "models/gmodz/ammo/9x39.mdl"
ITEM.ammo = "9x39mm"
ITEM.ammoAmount = 12
ITEM.maxRounds = 50
ITEM.description = "Ammo box that contains 9x39 mm caliber"
ITEM.price = 10800
ITEM.rarity = { weight = 32 } |
box.cfg {
background = true,
listen = 3301,
pid_file = "/dewt/tarantool.pid",
memtx_dir = "/dewt/data",
wal_dir = "/dewt/data",
vinyl_dir = "/dewt/data",
work_dir = "/dewt/app",
log = "/dewt/logs/log.txt",
memtx_memory = 512 * 1024 *1024,
checkpoint_interval = 7200,
custom_proc_title = "drakonhub_onprem"
}
my_ip = "213.162.241.171"
-- for localhost installation
-- my_ip = "127.0.0.1"
-- production setup, tarantool is behind nginx (or apache)
--host_for_http_server = "127.0.0.1"
--my_site = "example.com"
--insecure_cookie = false
-- debug setup
host_for_http_server = my_ip
my_site = my_ip
insecure_cookie = true
global_cfg = {
--db = "tardb",
db = "mysqldb",
mysql = {
host = "127.0.0.1",
db = "drakonhub",
user = "tara",
password = "123456",
size = 5
},
diatest = "/dewt/diatest",
host = host_for_http_server,
port = 8090,
http_options = {
log_requests = false
},
session_timeout = 10 * 24 * 3600,
static_timeout = 1 * 3600,
file_timeout = 2,
static_dir = "/dewt/static",
emails_dir = "/dewt/emails",
feedback_dir = "/dewt/feedback",
journal_dir = "/dewt/journal",
content_dir = "/dewt/content",
read_dir = "/dewt/read",
password_timeout = 5,
use_capture = false,
max_recent = 20,
max_log = 50000,
tmp = "/dewt/tmp",
debug_mail = true,
feedback_email = "[email protected]",
create_license = "extended",
licensing = true,
https_sender_port = 3400,
google_anal = false,
my_site = "https://" .. my_site,
my_domain = my_site,
my_ip = my_ip,
complete_delay = 2,
on_premises = true,
application = "Logic View",
insecure_cookie = insecure_cookie
}
external_creds = require("external_creds")
require("init")
|
local table = require("hs/lang/table")
local Sprite = require("hs/core/Sprite")
--------------------------------------------------------------------------------
-- デフォルトのスキン設定です。
-- TODO:全然だめなのでかえる予定
--------------------------------------------------------------------------------
local Skins = {
TextLabel = {
},
Button = {
skinClass = Sprite,
upSkin = "hs/resources/skin_button_up.png",
downSkin = "hs/resources/skin_button_up.png", -- TODO:とりあえず同じスキン
font = "hs/resources/ipag.ttf", -- TODO:もっとかっこいいのにしたいな
upEffect = function(button)
if button._seekColorAction then
button._seekColorAction:stop()
end
button._seekColorAction = button:seekColor(1, 1, 1, 1, 0.5)
--button:setColor(1, 1, 1, 1)
end,
downEffect = function(button)
if button._seekColorAction then
button._seekColorAction:stop()
button._seekColorAction = nil
end
button:setColor(1, 1, 0.5, 1)
end
},
ListBox = {
},
MessageBox = {
}
}
return Skins
|
local Observable = require 'observable'
local util = require 'util'
--- 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
observer:onNext(combinator(util.unpack(latest)))
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
|
vim.g.committia_hooks = {
edit_open = function(info)
if info.vcs == 'git' and vim.fn.getline(1) == '' then
vim.cmd('startinsert')
end
vim.keymap.set('i', '<A-d>', '<Plug>(committia-scroll-diff-down-half)', { buffer = true })
vim.keymap.set('i', '<A-u>', '<Plug>(committia-scroll-diff-up-half)', { buffer = true })
end,
}
|
--- Abstraction layer between a data collections (e.g. tarantool's spaces) and
--- the GraphQL query language.
---
--- Random notes:
---
--- * GraphQL top level statement must be a collection name. Arguments for this
--- statement match non-deducible field names of corresponding object and
--- passed to an accessor function in the filter argument.
---
--- Border cases:
---
--- * Unions: as GraphQL specification says "...no fields may be queried on
--- Union type without the use of typed fragments." Tarantool_graphql
--- behaves this way. So 'common fields' are not supported. This does NOT
--- work:
---
--- hero {
--- hero_id -- common field; does NOT work
--- ... on human {
--- name
--- }
--- ... on droid {
--- model
--- }
--- }
---
---
---
--- (GraphQL spec: http://facebook.github.io/graphql/October2016/#sec-Unions)
--- Also, no arguments are currently allowed for fragments.
--- See issue about this (https://github.com/facebook/graphql/issues/204)
local accessor_general = require('graphql.accessor_general')
local accessor_space = require('graphql.accessor_space')
local accessor_shard = require('graphql.accessor_shard')
local impl = require('graphql.impl')
local error_codes = require('graphql.error_codes')
local storage = require('graphql.storage')
local avro_helpers = require('graphql.avro_helpers')
local graphql = {}
-- avro-schema-2* is known to be broken with nullable types
if avro_helpers.major_avro_schema_version() ~= 3 then
error('The graphql module does not support avro-schema-2*. ' ..
'Consider update to >=avro-schema-3.0.1.')
end
-- constants
graphql.TIMEOUT_INFINITY = accessor_general.TIMEOUT_INFINITY
-- error codes
graphql.error_codes = {}
for k, v in pairs(error_codes) do
if type(v) == 'number' then
graphql.error_codes[k] = v
end
end
-- submodules
graphql.storage = storage
-- for backward compatibility
graphql.accessor_general = accessor_general
graphql.accessor_space = accessor_space
graphql.accessor_shard = accessor_shard
-- functions
graphql.new = impl.new
graphql.compile = impl.compile
graphql.execute = impl.execute
graphql.start_server = impl.start_server
graphql.stop_server = impl.stop_server
return graphql
|
--[[
isim bulamadım huba amk
]]
return(function(nebakiyonoc_IlllIIIlIllll,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI)local nebakiyonoc_llIIlIlllllI=string.char;local nebakiyonoc_llIIIIIllI=string.sub;local nebakiyonoc_IllIllIIII=table.concat;local nebakiyonoc_IllIllIl=math.ldexp;local nebakiyonoc_IlIllIlIIIlIlIIlllIllIIIl=getfenv or function()return _ENV end;local nebakiyonoc_IIIllIIlIIIIlIIlI=select;local nebakiyonoc_lIllIlIIIIlIl=unpack or table.unpack;local nebakiyonoc_lIlIllllII=tonumber;local function nebakiyonoc_IIllIlllIlIlllllI(nebakiyonoc_IlllIIIlIllll)local nebakiyonoc_IlIllllIII,nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_IIIIlIllIlIIlIIl="","",{}local nebakiyonoc_lIIlIllIIIllIIlllII=256;local nebakiyonoc_lIllIlIIIIlIl={}for nebakiyonoc_llIlllIIIllI=0,nebakiyonoc_lIIlIllIIIllIIlllII-1 do nebakiyonoc_lIllIlIIIIlIl[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_llIIlIlllllI(nebakiyonoc_llIlllIIIllI)end;local nebakiyonoc_llIlllIIIllI=1;local function nebakiyonoc_IIllIIIIllIlllllIIIl()local nebakiyonoc_IlIllllIII=nebakiyonoc_lIlIllllII(nebakiyonoc_llIIIIIllI(nebakiyonoc_IlllIIIlIllll,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI),36)nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI+1;local nebakiyonoc_lIIllIIllIlIIIlllIIl=nebakiyonoc_lIlIllllII(nebakiyonoc_llIIIIIllI(nebakiyonoc_IlllIIIlIllll,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI+nebakiyonoc_IlIllllIII-1),36)nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI+nebakiyonoc_IlIllllIII;return nebakiyonoc_lIIllIIllIlIIIlllIIl end;nebakiyonoc_IlIllllIII=nebakiyonoc_llIIlIlllllI(nebakiyonoc_IIllIIIIllIlllllIIIl())nebakiyonoc_IIIIlIllIlIIlIIl[1]=nebakiyonoc_IlIllllIII;while nebakiyonoc_llIlllIIIllI<#nebakiyonoc_IlllIIIlIllll do local nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIllIIIIllIlllllIIIl()if nebakiyonoc_lIllIlIIIIlIl[nebakiyonoc_llIlllIIIllI]then nebakiyonoc_lIIllIIllIlIIIlllIIl=nebakiyonoc_lIllIlIIIIlIl[nebakiyonoc_llIlllIIIllI]else nebakiyonoc_lIIllIIllIlIIIlllIIl=nebakiyonoc_IlIllllIII..nebakiyonoc_llIIIIIllI(nebakiyonoc_IlIllllIII,1,1)end;nebakiyonoc_lIllIlIIIIlIl[nebakiyonoc_lIIlIllIIIllIIlllII]=nebakiyonoc_IlIllllIII..nebakiyonoc_llIIIIIllI(nebakiyonoc_lIIllIIllIlIIIlllIIl,1,1)nebakiyonoc_IIIIlIllIlIIlIIl[#nebakiyonoc_IIIIlIllIlIIlIIl+1],nebakiyonoc_IlIllllIII,nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_lIIlIllIIIllIIlllII+1 end;return table.concat(nebakiyonoc_IIIIlIllIlIIlIIl)end;local nebakiyonoc_lIlIllllII=nebakiyonoc_IIllIlllIlIlllllI('25024L27524N24H27524L25E25G25K25C24N24I27926T25L25G25I25C26K25D27921X1Z23524322626C24N24V27925L25M25G25D25Y25T25Z25O25N25E27F27926L25T25T25X26A25C25T24N23R27925P28C25X25Y24F23U23U25X25G28325C25J28625X23V25I25M25K23U25Z25G25U23U26426R26A26V25Z26P26O25Z27922T24525I1N22127V28J27528L28D28O28Q28S28U28W25N28Y29029229429625O25Z26E25E26M24726T27027923P26A22B25A21U29M28K28M29R28R28T25T28V28X28Z29129329523U26O26Q26J26E26726R26M24327924L24526X25W1A2AG29O2AI28P2AK29U2AO29Y2AR29625X25V25D26E25C26824127027W27928F25T26U25C25Z25V25O27L28927527I25G2642BV25Y24N24U27926H25M25I25G25L2C22C425Z27727926M2BY25Q24N24Y27926F25S23P26I26425S25N23P26925C28U25Q25L25C25N25K25O26425M25Z23O24927925324X27924K2AA2B227624L23N25227924G24L2DG24M24L24H27G2752DO2DG2DT27924O2DP24L2DD27927827525324W2E12DG27523P2752DG2DG2DO2532752DR24J2DI2E12DR2EL27924N2EL2EE2DS2B224E2E12E32ED2DH2DI2EQ23N25A2792582E127G2DY2752F52DG2EX2ET2E62E82ES2EB2EY2EF2E22EI24L24T2ER24L2EN2EO24L2EQ2DI2ES2E52752EV2FB2DE2EY2FH2F02DK2DM2752572E124S2DS2DU24L2G72DX2GB23N2EW2G02FD2E22FF2E12G22ES2EG2FL27X2FU2FP2FR2DJ2GS2DX2EU2GH2DF2EZ2B22F12G524L23Y2E12C82F82H52E12H92462GZ2752FW2E72E92EZ2GO2FK2GT24P2FO2FQ2EO2FT2B22FV2GY2FZ2H02EB2512DI2E02EH2FS24L24R2FR2EQ2EQ2EC2DI24Q24L2I82B22HY2I12EQ2742HQ2GM2IH2GM2EL');local nebakiyonoc_llIlllIIIllI=(bit or bit32);local nebakiyonoc_IIIIlIllIlIIlIIl=nebakiyonoc_llIlllIIIllI and nebakiyonoc_llIlllIIIllI.bxor or function(nebakiyonoc_llIlllIIIllI,nebakiyonoc_IlIllllIII)local nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_IIIIlIllIlIIlIIl,nebakiyonoc_llIIIIIllI=1,0,10 while nebakiyonoc_llIlllIIIllI>0 and nebakiyonoc_IlIllllIII>0 do local nebakiyonoc_lIllIlIIIIlIl,nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI%2,nebakiyonoc_IlIllllIII%2 if nebakiyonoc_lIllIlIIIIlIl~=nebakiyonoc_llIIIIIllI then nebakiyonoc_IIIIlIllIlIIlIIl=nebakiyonoc_IIIIlIllIlIIlIIl+nebakiyonoc_lIIllIIllIlIIIlllIIl end nebakiyonoc_llIlllIIIllI,nebakiyonoc_IlIllllIII,nebakiyonoc_lIIllIIllIlIIIlllIIl=(nebakiyonoc_llIlllIIIllI-nebakiyonoc_lIllIlIIIIlIl)/2,(nebakiyonoc_IlIllllIII-nebakiyonoc_llIIIIIllI)/2,nebakiyonoc_lIIllIIllIlIIIlllIIl*2 end if nebakiyonoc_llIlllIIIllI<nebakiyonoc_IlIllllIII then nebakiyonoc_llIlllIIIllI=nebakiyonoc_IlIllllIII end while nebakiyonoc_llIlllIIIllI>0 do local nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI%2 if nebakiyonoc_IlIllllIII>0 then nebakiyonoc_IIIIlIllIlIIlIIl=nebakiyonoc_IIIIlIllIlIIlIIl+nebakiyonoc_lIIllIIllIlIIIlllIIl end nebakiyonoc_llIlllIIIllI,nebakiyonoc_lIIllIIllIlIIIlllIIl=(nebakiyonoc_llIlllIIIllI-nebakiyonoc_IlIllllIII)/2,nebakiyonoc_lIIllIIllIlIIIlllIIl*2 end return nebakiyonoc_IIIIlIllIlIIlIIl end local function nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIlllIIIllI,nebakiyonoc_IlIllllIII)if nebakiyonoc_IlIllllIII then local nebakiyonoc_llIlllIIIllI=(nebakiyonoc_lIIllIIllIlIIIlllIIl/2^(nebakiyonoc_llIlllIIIllI-1))%2^((nebakiyonoc_IlIllllIII-1)-(nebakiyonoc_llIlllIIIllI-1)+1);return nebakiyonoc_llIlllIIIllI-nebakiyonoc_llIlllIIIllI%1;else local nebakiyonoc_llIlllIIIllI=2^(nebakiyonoc_llIlllIIIllI-1);return(nebakiyonoc_lIIllIIllIlIIIlllIIl%(nebakiyonoc_llIlllIIIllI+nebakiyonoc_llIlllIIIllI)>=nebakiyonoc_llIlllIIIllI)and 1 or 0;end;end;local nebakiyonoc_llIlllIIIllI=1;local function nebakiyonoc_IlIllllIII()local nebakiyonoc_lIllIlIIIIlIl,nebakiyonoc_IlIllllIII,nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI=nebakiyonoc_IlllIIIlIllll(nebakiyonoc_lIlIllllII,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI+3);nebakiyonoc_lIllIlIIIIlIl=nebakiyonoc_IIIIlIllIlIIlIIl(nebakiyonoc_lIllIlIIIIlIl,165)nebakiyonoc_IlIllllIII=nebakiyonoc_IIIIlIllIlIIlIIl(nebakiyonoc_IlIllllIII,165)nebakiyonoc_lIIllIIllIlIIIlllIIl=nebakiyonoc_IIIIlIllIlIIlIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,165)nebakiyonoc_llIIIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl(nebakiyonoc_llIIIIIllI,165)nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI+4;return(nebakiyonoc_llIIIIIllI*16777216)+(nebakiyonoc_lIIllIIllIlIIIlllIIl*65536)+(nebakiyonoc_IlIllllIII*256)+nebakiyonoc_lIllIlIIIIlIl;end;local function nebakiyonoc_IIllIIIIllIlllllIIIl()local nebakiyonoc_IlIllllIII=nebakiyonoc_IIIIlIllIlIIlIIl(nebakiyonoc_IlllIIIlIllll(nebakiyonoc_lIlIllllII,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI),165);nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI+1;return nebakiyonoc_IlIllllIII;end;local function nebakiyonoc_lIIlIllIIIllIIlllII()local nebakiyonoc_IlIllllIII,nebakiyonoc_lIIllIIllIlIIIlllIIl=nebakiyonoc_IlllIIIlIllll(nebakiyonoc_lIlIllllII,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI+2);nebakiyonoc_IlIllllIII=nebakiyonoc_IIIIlIllIlIIlIIl(nebakiyonoc_IlIllllIII,165)nebakiyonoc_lIIllIIllIlIIIlllIIl=nebakiyonoc_IIIIlIllIlIIlIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,165)nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI+2;return(nebakiyonoc_lIIllIIllIlIIIlllIIl*256)+nebakiyonoc_IlIllllIII;end;local function nebakiyonoc_IIllIlllIlIlllllI()local nebakiyonoc_IIIIlIllIlIIlIIl=nebakiyonoc_IlIllllIII();local nebakiyonoc_llIlllIIIllI=nebakiyonoc_IlIllllIII();local nebakiyonoc_llIIIIIllI=1;local nebakiyonoc_IIIIlIllIlIIlIIl=(nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_llIlllIIIllI,1,20)*(2^32))+nebakiyonoc_IIIIlIllIlIIlIIl;local nebakiyonoc_IlIllllIII=nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_llIlllIIIllI,21,31);local nebakiyonoc_llIlllIIIllI=((-1)^nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_llIlllIIIllI,32));if(nebakiyonoc_IlIllllIII==0)then if(nebakiyonoc_IIIIlIllIlIIlIIl==0)then return nebakiyonoc_llIlllIIIllI*0;else nebakiyonoc_IlIllllIII=1;nebakiyonoc_llIIIIIllI=0;end;elseif(nebakiyonoc_IlIllllIII==2047)then return(nebakiyonoc_IIIIlIllIlIIlIIl==0)and(nebakiyonoc_llIlllIIIllI*(1/0))or(nebakiyonoc_llIlllIIIllI*(0/0));end;return nebakiyonoc_IllIllIl(nebakiyonoc_llIlllIIIllI,nebakiyonoc_IlIllllIII-1023)*(nebakiyonoc_llIIIIIllI+(nebakiyonoc_IIIIlIllIlIIlIIl/(2^52)));end;local nebakiyonoc_llllIllIllll=nebakiyonoc_IlIllllIII;local function nebakiyonoc_IllIllIl(nebakiyonoc_IlIllllIII)local nebakiyonoc_lIIllIIllIlIIIlllIIl;if(not nebakiyonoc_IlIllllIII)then nebakiyonoc_IlIllllIII=nebakiyonoc_llllIllIllll();if(nebakiyonoc_IlIllllIII==0)then return'';end;end;nebakiyonoc_lIIllIIllIlIIIlllIIl=nebakiyonoc_llIIIIIllI(nebakiyonoc_lIlIllllII,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI+nebakiyonoc_IlIllllIII-1);nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI+nebakiyonoc_IlIllllIII;local nebakiyonoc_IlIllllIII={}for nebakiyonoc_llIlllIIIllI=1,#nebakiyonoc_lIIllIIllIlIIIlllIIl do nebakiyonoc_IlIllllIII[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_llIIlIlllllI(nebakiyonoc_IIIIlIllIlIIlIIl(nebakiyonoc_IlllIIIlIllll(nebakiyonoc_llIIIIIllI(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI)),165))end return nebakiyonoc_IllIllIIII(nebakiyonoc_IlIllllIII);end;local nebakiyonoc_llIlllIIIllI=nebakiyonoc_IlIllllIII;local function nebakiyonoc_IllIllIIII(...)return{...},nebakiyonoc_IIIllIIlIIIIlIIlI('#',...)end local function nebakiyonoc_lIlIllllII()local nebakiyonoc_llIIlIlllllI={};local nebakiyonoc_IIIllIIlIIIIlIIlI={};local nebakiyonoc_llIlllIIIllI={};local nebakiyonoc_IlllIIIlIllll={[#{"1 + 1 = 111";"1 + 1 = 111";}]=nebakiyonoc_IIIllIIlIIIIlIIlI,[#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]=nil,[#{{780;289;25;458};{505;317;406;649};"1 + 1 = 111";{388;682;117;188};}]=nebakiyonoc_llIlllIIIllI,[#{"1 + 1 = 111";}]=nebakiyonoc_llIIlIlllllI,};local nebakiyonoc_llIlllIIIllI=nebakiyonoc_IlIllllIII()local nebakiyonoc_llIIIIIllI={}for nebakiyonoc_lIIllIIllIlIIIlllIIl=1,nebakiyonoc_llIlllIIIllI do local nebakiyonoc_IlIllllIII=nebakiyonoc_IIllIIIIllIlllllIIIl();local nebakiyonoc_llIlllIIIllI;if(nebakiyonoc_IlIllllIII==1)then nebakiyonoc_llIlllIIIllI=(nebakiyonoc_IIllIIIIllIlllllIIIl()~=0);elseif(nebakiyonoc_IlIllllIII==0)then nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIllIlllIlIlllllI();elseif(nebakiyonoc_IlIllllIII==2)then nebakiyonoc_llIlllIIIllI=nebakiyonoc_IllIllIl();end;nebakiyonoc_llIIIIIllI[nebakiyonoc_lIIllIIllIlIIIlllIIl]=nebakiyonoc_llIlllIIIllI;end;for nebakiyonoc_IlllIIIlIllll=1,nebakiyonoc_IlIllllIII()do local nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIllIIIIllIlllllIIIl();if(nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_llIlllIIIllI,1,1)==0)then local nebakiyonoc_IIIIlIllIlIIlIIl=nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_llIlllIIIllI,2,3);local nebakiyonoc_lIllIlIIIIlIl=nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_llIlllIIIllI,4,6);local nebakiyonoc_llIlllIIIllI={nebakiyonoc_lIIlIllIIIllIIlllII(),nebakiyonoc_lIIlIllIIIllIIlllII(),nil,nil};if(nebakiyonoc_IIIIlIllIlIIlIIl==0)then nebakiyonoc_llIlllIIIllI[#("XFZ")]=nebakiyonoc_lIIlIllIIIllIIlllII();nebakiyonoc_llIlllIIIllI[#("CKEd")]=nebakiyonoc_lIIlIllIIIllIIlllII();elseif(nebakiyonoc_IIIIlIllIlIIlIIl==1)then nebakiyonoc_llIlllIIIllI[#("G0Y")]=nebakiyonoc_IlIllllIII();elseif(nebakiyonoc_IIIIlIllIlIIlIIl==2)then nebakiyonoc_llIlllIIIllI[#("Z3B")]=nebakiyonoc_IlIllllIII()-(2^16)elseif(nebakiyonoc_IIIIlIllIlIIlIIl==3)then nebakiyonoc_llIlllIIIllI[#("MVg")]=nebakiyonoc_IlIllllIII()-(2^16)nebakiyonoc_llIlllIIIllI[#("MuJW")]=nebakiyonoc_lIIlIllIIIllIIlllII();end;if(nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_lIllIlIIIIlIl,1,1)==1)then nebakiyonoc_llIlllIIIllI[#("kI")]=nebakiyonoc_llIIIIIllI[nebakiyonoc_llIlllIIIllI[#("Tu")]]end if(nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_lIllIlIIIIlIl,2,2)==1)then nebakiyonoc_llIlllIIIllI[#("Rg9")]=nebakiyonoc_llIIIIIllI[nebakiyonoc_llIlllIIIllI[#("Z7B")]]end if(nebakiyonoc_lIIllIIllIlIIIlllIIl(nebakiyonoc_lIllIlIIIIlIl,3,3)==1)then nebakiyonoc_llIlllIIIllI[#("jtNB")]=nebakiyonoc_llIIIIIllI[nebakiyonoc_llIlllIIIllI[#("pasb")]]end nebakiyonoc_llIIlIlllllI[nebakiyonoc_IlllIIIlIllll]=nebakiyonoc_llIlllIIIllI;end end;nebakiyonoc_IlllIIIlIllll[3]=nebakiyonoc_IIllIIIIllIlllllIIIl();for nebakiyonoc_llIlllIIIllI=1,nebakiyonoc_IlIllllIII()do nebakiyonoc_IIIllIIlIIIIlIIlI[nebakiyonoc_llIlllIIIllI-1]=nebakiyonoc_lIlIllllII();end;return nebakiyonoc_IlllIIIlIllll;end;local function nebakiyonoc_IllIllIl(nebakiyonoc_llIlllIIIllI,nebakiyonoc_IlIllllIII,nebakiyonoc_IlllIIIlIllll)nebakiyonoc_llIlllIIIllI=(nebakiyonoc_llIlllIIIllI==true and nebakiyonoc_lIlIllllII())or nebakiyonoc_llIlllIIIllI;return(function(...)local nebakiyonoc_IIIIlIllIlIIlIIl=nebakiyonoc_llIlllIIIllI[1];local nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[3];local nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI[2];local nebakiyonoc_IIllIIIIllIlllllIIIl=nebakiyonoc_IllIllIIII local nebakiyonoc_IlIllllIII=1;local nebakiyonoc_lIIlIllIIIllIIlllII=-1;local nebakiyonoc_IllIllIIII={};local nebakiyonoc_lIlIllllII={...};local nebakiyonoc_llIIlIlllllI=nebakiyonoc_IIIllIIlIIIIlIIlI('#',...)-1;local nebakiyonoc_llIlllIIIllI={};local nebakiyonoc_lIIllIIllIlIIIlllIIl={};for nebakiyonoc_llIlllIIIllI=0,nebakiyonoc_llIIlIlllllI do if(nebakiyonoc_llIlllIIIllI>=nebakiyonoc_llIIIIIllI)then nebakiyonoc_IllIllIIII[nebakiyonoc_llIlllIIIllI-nebakiyonoc_llIIIIIllI]=nebakiyonoc_lIlIllllII[nebakiyonoc_llIlllIIIllI+1];else nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_lIlIllllII[nebakiyonoc_llIlllIIIllI+#{{404;50;217;296};}];end;end;local nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIIlIlllllI-nebakiyonoc_llIIIIIllI+1 local nebakiyonoc_llIlllIIIllI;local nebakiyonoc_llIIIIIllI;while true do nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("q")];if nebakiyonoc_llIIIIIllI<=#("6zAVheFPYr013H")then if nebakiyonoc_llIIIIIllI<=#("qz514Z")then if nebakiyonoc_llIIIIIllI<=#("pl")then if nebakiyonoc_llIIIIIllI<=#("")then nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("M6")]]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Yj4")]][nebakiyonoc_llIlllIIIllI[#("2juh")]];elseif nebakiyonoc_llIIIIIllI>#("C")then local nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("qp")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_IlIllllIII+1,nebakiyonoc_llIlllIIIllI[#("vR5")]))else local nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("Az")]local nebakiyonoc_IIIIlIllIlIIlIIl,nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIllIIIIllIlllllIIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_IlIllllIII+1,nebakiyonoc_llIlllIIIllI[#("bQh")])))nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_llIlllIIIllI+nebakiyonoc_IlIllllIII-1 local nebakiyonoc_llIlllIIIllI=0;for nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII,nebakiyonoc_lIIlIllIIIllIIlllII do nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI+1;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII]=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_llIlllIIIllI];end;end;elseif nebakiyonoc_llIIIIIllI<=#("3YE0")then if nebakiyonoc_llIIIIIllI==#("jnp")then nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Js")]]=nebakiyonoc_llIlllIIIllI[#("DVk")];else nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("4i")]]=nebakiyonoc_IlllIIIlIllll[nebakiyonoc_llIlllIIIllI[#("RIx")]];end;elseif nebakiyonoc_llIIIIIllI>#("U7DTO")then local nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("ke")];local nebakiyonoc_IIIIlIllIlIIlIIl=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("auQ")]];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII+1]=nebakiyonoc_IIIIlIllIlIIlIIl;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII]=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_llIlllIIIllI[#("zhBi")]];else local nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("ip")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_IlIllllIII+1,nebakiyonoc_llIlllIIIllI[#("HQF")]))end;elseif nebakiyonoc_llIIIIIllI<=#("6EolGOpt3g")then if nebakiyonoc_llIIIIIllI<=#("Lhjn1PMk")then if nebakiyonoc_llIIIIIllI>#("aYaGTtF")then if(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("5X")]]==nebakiyonoc_llIlllIIIllI[#("zaZH")])then nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;else nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("qWs")];end;else nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("edg")];end;elseif nebakiyonoc_llIIIIIllI==#("P7zkk9sSQ")then local nebakiyonoc_lIlIllllII;local nebakiyonoc_IllIllIIII,nebakiyonoc_IIIllIIlIIIIlIIlI;local nebakiyonoc_llIIlIlllllI;local nebakiyonoc_llIIIIIllI;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#{{701;157;317;149};"1 + 1 = 111";}]]=nebakiyonoc_IlllIIIlIllll[nebakiyonoc_llIlllIIIllI[#("6dt")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("a1")];nebakiyonoc_llIIlIlllllI=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("7k3")]];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI+1]=nebakiyonoc_llIIlIlllllI;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_llIIlIlllllI[nebakiyonoc_llIlllIIIllI[#("PIpD")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("cp")]]=nebakiyonoc_llIlllIIIllI[#("Nqy")];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("8y")]nebakiyonoc_IllIllIIII,nebakiyonoc_IIIllIIlIIIIlIIlI=nebakiyonoc_IIllIIIIllIlllllIIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_llIlllIIIllI[#("6a0")])))nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_IIIllIIlIIIIlIIlI+nebakiyonoc_llIIIIIllI-1 nebakiyonoc_lIlIllllII=0;for nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIIIIIllI,nebakiyonoc_lIIlIllIIIllIIlllII do nebakiyonoc_lIlIllllII=nebakiyonoc_lIlIllllII+1;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_IllIllIIII[nebakiyonoc_lIlIllllII];end;nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("gm")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_lIIlIllIIIllIIlllII))nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#{"1 + 1 = 111";"1 + 1 = 111";}]]();nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("LPV")];else nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Cm")]]();end;elseif nebakiyonoc_llIIIIIllI<=#("6POFKThJffP3")then if nebakiyonoc_llIIIIIllI>#("1I3YiDSDmj3")then local nebakiyonoc_lIlIllllII;local nebakiyonoc_IIIllIIlIIIIlIIlI,nebakiyonoc_IllIllIIII;local nebakiyonoc_llIIlIlllllI;local nebakiyonoc_llIIIIIllI;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Gb")]]=nebakiyonoc_IlllIIIlIllll[nebakiyonoc_llIlllIIIllI[#("Ejn")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("aa")];nebakiyonoc_llIIlIlllllI=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("lU9")]];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI+1]=nebakiyonoc_llIIlIlllllI;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_llIIlIlllllI[nebakiyonoc_llIlllIIIllI[#("oWxK")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("QL")]]=nebakiyonoc_llIlllIIIllI[#("xrV")];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#{{435;339;600;260};{575;731;308;529};}]nebakiyonoc_IIIllIIlIIIIlIIlI,nebakiyonoc_IllIllIIII=nebakiyonoc_IIllIIIIllIlllllIIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_llIlllIIIllI[#("PYd")])))nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_IllIllIIII+nebakiyonoc_llIIIIIllI-1 nebakiyonoc_lIlIllllII=0;for nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIIIIIllI,nebakiyonoc_lIIlIllIIIllIIlllII do nebakiyonoc_lIlIllllII=nebakiyonoc_lIlIllllII+1;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_IIIllIIlIIIIlIIlI[nebakiyonoc_lIlIllllII];end;nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("lB")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_lIIlIllIIIllIIlllII))nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("9A")]]();nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("onX")];else nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("yG")]]();end;elseif nebakiyonoc_llIIIIIllI>#("6RcAi1GlzPFhG")then local nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI[#{"1 + 1 = 111";{491;40;201;326};}]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIlllIIIllI+1,nebakiyonoc_lIIlIllIIIllIIlllII))else nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Zd")]]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("BUg")]][nebakiyonoc_llIlllIIIllI[#("iigu")]];end;elseif nebakiyonoc_llIIIIIllI<=#("qzjnzRVPIMrljp7YTGVZOc")then if nebakiyonoc_llIIIIIllI<=#{"1 + 1 = 111";{356;592;346;896};"1 + 1 = 111";"1 + 1 = 111";{432;374;811;165};{662;741;792;600};"1 + 1 = 111";{52;857;965;941};{815;395;764;543};"1 + 1 = 111";{649;101;642;263};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{712;945;545;940};{498;591;572;614};"1 + 1 = 111";{325;492;585;523};}then if nebakiyonoc_llIIIIIllI<=#("jBi6RpnL68xQJotb")then if nebakiyonoc_llIIIIIllI==#("kIdWvJG3ndOGVWJ")then local nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("NL")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_IlIllllIII+1,nebakiyonoc_llIlllIIIllI[#("sJo")]))else local nebakiyonoc_lIIlIllIIIllIIlllII;local nebakiyonoc_llIIIIIllI;nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("MD")];nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("6cp")]];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI+1]=nebakiyonoc_lIIlIllIIIllIIlllII;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_lIIlIllIIIllIIlllII[nebakiyonoc_llIlllIIIllI[#{{480;600;902;630};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Dt")]]=nebakiyonoc_llIlllIIIllI[#("sN2")];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("T9")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_llIlllIIIllI[#("ZO7")]))nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("6v")]]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("kOI")]][nebakiyonoc_llIlllIIIllI[#("roxr")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("Ng")];nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("G8q")]];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI+1]=nebakiyonoc_lIIlIllIIIllIIlllII;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_lIIlIllIIIllIIlllII[nebakiyonoc_llIlllIIIllI[#("E4AN")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("W4")]]=nebakiyonoc_llIlllIIIllI[#("7mc")];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("zH")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_llIlllIIIllI[#("24c")]))end;elseif nebakiyonoc_llIIIIIllI>#("y2OaaH4FspezMx69q")then if(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("le")]]~=nebakiyonoc_llIlllIIIllI[#("iFgM")])then nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;else nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("c8x")];end;else do return end;end;elseif nebakiyonoc_llIIIIIllI<=#("JNZEY1MdElJekmXUkxQa")then if nebakiyonoc_llIIIIIllI==#("NOJEgFhq1gPocn5g3eW")then if(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Kf")]]~=nebakiyonoc_llIlllIIIllI[#("SV0m")])then nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;else nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("GTs")];end;else nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("xl")]]=nebakiyonoc_IlllIIIlIllll[nebakiyonoc_llIlllIIIllI[#("cvh")]];end;elseif nebakiyonoc_llIIIIIllI>#("6dS5ne2L2lKtqD59qaRxE")then local nebakiyonoc_IIIIlIllIlIIlIIl=nebakiyonoc_llIlllIIIllI[#("Ld")];local nebakiyonoc_IlIllllIII=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#{{921;90;429;956};"1 + 1 = 111";{677;725;189;516};}]];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IIIIlIllIlIIlIIl+1]=nebakiyonoc_IlIllllIII;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IIIIlIllIlIIlIIl]=nebakiyonoc_IlIllllIII[nebakiyonoc_llIlllIIIllI[#("fXUI")]];else local nebakiyonoc_lIlIllllII;local nebakiyonoc_IIIllIIlIIIIlIIlI,nebakiyonoc_IllIllIIII;local nebakiyonoc_llIIlIlllllI;local nebakiyonoc_llIIIIIllI;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("6q")]]=nebakiyonoc_IlllIIIlIllll[nebakiyonoc_llIlllIIIllI[#("qKQ")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("JT")];nebakiyonoc_llIIlIlllllI=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("mVT")]];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI+1]=nebakiyonoc_llIIlIlllllI;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_llIIlIlllllI[nebakiyonoc_llIlllIIIllI[#("qbff")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("7q")]]=nebakiyonoc_llIlllIIIllI[#("shs")];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("QB")]nebakiyonoc_IIIllIIlIIIIlIIlI,nebakiyonoc_IllIllIIII=nebakiyonoc_IIllIIIIllIlllllIIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_llIlllIIIllI[#("a2H")])))nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_IllIllIIII+nebakiyonoc_llIIIIIllI-1 nebakiyonoc_lIlIllllII=0;for nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIIIIIllI,nebakiyonoc_lIIlIllIIIllIIlllII do nebakiyonoc_lIlIllllII=nebakiyonoc_lIlIllllII+1;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_IIIllIIlIIIIlIIlI[nebakiyonoc_lIlIllllII];end;nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("xX")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_lIIlIllIIIllIIlllII))nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("cc")]]();nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("KjT")];end;elseif nebakiyonoc_llIIIIIllI<=#("Me30i81Nqr3NsK5NpcNHzPHv8J")then if nebakiyonoc_llIIIIIllI<=#("603xz4jBNby53Tp5sAOjveNV")then if nebakiyonoc_llIIIIIllI>#("U7z7II2JR5Wy4FTiisL2gUX")then local nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("fn")]local nebakiyonoc_IIIIlIllIlIIlIIl,nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIllIIIIllIlllllIIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_IlIllllIII+1,nebakiyonoc_llIlllIIIllI[#("ruR")])))nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_llIlllIIIllI+nebakiyonoc_IlIllllIII-1 local nebakiyonoc_llIlllIIIllI=0;for nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII,nebakiyonoc_lIIlIllIIIllIIlllII do nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI+1;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII]=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_llIlllIIIllI];end;else nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("vmt")];end;elseif nebakiyonoc_llIIIIIllI>#("Un5uz61niSP6VEeEGvlYDHy45")then local nebakiyonoc_lIlIllllII;local nebakiyonoc_IIIllIIlIIIIlIIlI,nebakiyonoc_IllIllIIII;local nebakiyonoc_llIIlIlllllI;local nebakiyonoc_llIIIIIllI;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#{"1 + 1 = 111";"1 + 1 = 111";}]]=nebakiyonoc_IlllIIIlIllll[nebakiyonoc_llIlllIIIllI[#("0ol")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("33")];nebakiyonoc_llIIlIlllllI=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("yCf")]];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI+1]=nebakiyonoc_llIIlIlllllI;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_llIIlIlllllI[nebakiyonoc_llIlllIIIllI[#("ZXjA")]];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Hv")]]=nebakiyonoc_llIlllIIIllI[#("opG")];nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("5u")]nebakiyonoc_IIIllIIlIIIIlIIlI,nebakiyonoc_IllIllIIII=nebakiyonoc_IIllIIIIllIlllllIIIl(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_llIlllIIIllI[#("obt")])))nebakiyonoc_lIIlIllIIIllIIlllII=nebakiyonoc_IllIllIIII+nebakiyonoc_llIIIIIllI-1 nebakiyonoc_lIlIllllII=0;for nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIIIIIllI,nebakiyonoc_lIIlIllIIIllIIlllII do nebakiyonoc_lIlIllllII=nebakiyonoc_lIlIllllII+1;nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_IIIllIIlIIIIlIIlI[nebakiyonoc_lIlIllllII];end;nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_llIIIIIllI=nebakiyonoc_llIlllIIIllI[#("QQ")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIIIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIIIIIllI+1,nebakiyonoc_lIIlIllIIIllIIlllII))nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("Fn")]]();nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;nebakiyonoc_llIlllIIIllI=nebakiyonoc_IIIIlIllIlIIlIIl[nebakiyonoc_IlIllllIII];nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("BKu")];else do return end;end;elseif nebakiyonoc_llIIIIIllI<=#{"1 + 1 = 111";{137;724;183;813};{886;780;224;656};{874;93;638;216};"1 + 1 = 111";{981;187;141;265};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{234;628;524;315};{487;305;615;417};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{651;128;612;178};{744;434;372;946};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{136;774;85;503};"1 + 1 = 111";{810;120;892;610};}then if nebakiyonoc_llIIIIIllI==#("m0bAyTgmpjPWGqU18lBU4rleiNI")then if(nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("PC")]]==nebakiyonoc_llIlllIIIllI[#("Al86")])then nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;else nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("ZTC")];end;else local nebakiyonoc_IlIllllIII=nebakiyonoc_llIlllIIIllI[#("rG")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_IlIllllIII](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_IlIllllIII+1,nebakiyonoc_llIlllIIIllI[#("I7s")]))end;elseif nebakiyonoc_llIIIIIllI>#("3GYCkJaELhVc7v9ck92yDqyIhoV4O")then local nebakiyonoc_llIlllIIIllI=nebakiyonoc_llIlllIIIllI[#("Hm")]nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI]=nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI](nebakiyonoc_lIllIlIIIIlIl(nebakiyonoc_lIIllIIllIlIIIlllIIl,nebakiyonoc_llIlllIIIllI+1,nebakiyonoc_lIIlIllIIIllIIlllII))else nebakiyonoc_lIIllIIllIlIIIlllIIl[nebakiyonoc_llIlllIIIllI[#("qt")]]=nebakiyonoc_llIlllIIIllI[#("2nB")];end;nebakiyonoc_IlIllllIII=nebakiyonoc_IlIllllIII+1;end;end);end;return nebakiyonoc_IllIllIl(true,{},nebakiyonoc_IlIllIlIIIlIlIIlllIllIIIl())();end)(string.byte,table.insert,setmetatable);
|
if string.find(Var "Element", "Active") then
return Def.Sprite {
Texture=NOTESKIN:GetPath( '_Down', 'Hold Active' );
Frame0000=0;
Delay0000=1;
};
else
return Def.Sprite {
Texture=NOTESKIN:GetPath( '_Down', 'Tap Note' );
Frame0000=0;
Delay0000=1;
};
end |
--[[
LibQuestData
by Sharlikran
https://sharlikran.github.io/
Convert fireundubh lists
^(\d{1,4}), "(.*)"
\[\1] = "\2",
Other
(.*) = "(.*)" = "(.*), ",
"\2", = \{\3\,},
^"(.*)", = \{(.*)\},
\["\1"] = \{\2 },
For renumbering new rebuilt tables
(.*)\[(\d{1,4})\] = "(.*)",
\2, "\3"
--]]
local lib = _G["LibQuestData"]
lib.quest_names["en"] = {
[465] = "The Blood-Splattered Shield",
[467] = "Sir Hughes' Fate",
[499] = "Pursuing the Shard",
[521] = "Azura's Aid",
[523] = "The Blood-Cursed Town",
[575] = "Vaermina's Gambit",
[614] = "A Look in the Mirror",
[657] = "Fadeel's Freedom",
[728] = "Repair Koeglin Lighthouse",
[736] = "The Flame of Dissent",
[737] = "Retaking Firebrand Keep",
[974] = "A Duke in Exile",
[1294] = "The Wizard's Tome",
[1339] = "A Predator's Heart",
[1341] = "Ogre Teeth",
[1346] = "Ending the Ogre Threat",
[1383] = "The Perfect Burial",
[1384] = "Old Adventurers",
[1437] = "General Godrun's Orders",
[1485] = "They Dragged Him Away",
[1489] = "Waylaid Wine Merchant",
[1527] = "The Sower Reaps",
[1529] = "Azura's Guardian",
[1536] = "Fire in the Fields",
[1541] = "A Prison of Sleep",
[1554] = "Blood Revenge",
[1568] = "A Means to an End",
[1591] = "Injured Spirit Wardens",
[1615] = "Next of Kin",
[1633] = "The Return of the Dream Shard",
[1637] = "Divert and Deliver",
[1639] = "Another Omen",
[1678] = "The Slumbering Farmer",
[1687] = "False Knights",
[1709] = "Rozenn's Dream",
[1735] = "Unanswered Questions",
[1799] = "A City in Black",
[1802] = "Mistress of the Lake",
[1804] = "Sunken Knowledge",
[1834] = "Heart of Evil",
[1835] = "The Last Spriggan",
[2016] = "Hallin's Burden",
[2017] = "The Lion's Den",
[2018] = "A Thirst for Revolution",
[2046] = "Dreams to Nightmares",
[2047] = "The Gate to Quagmire",
[2068] = "The Dreugh Threat",
[2130] = "Rise of the Dead",
[2146] = "The Impervious Vault",
[2161] = "Monkey Magic",
[2184] = "Tu'whacca's Breath",
[2187] = "Revered Ancestors",
[2192] = "A Reckoning with Uwafa",
[2193] = "The Scholar of Bergama",
[2222] = "Alasan's Plot",
[2240] = "Shiri's Research",
[2251] = "Gone Missing",
[2255] = "Crawling Chaos",
[2344] = "Snakes in the Sands",
[2356] = "March of the Ra Gada",
[2364] = "Feathered Fiends",
[2403] = "The Search for Shiri",
[2404] = "Imperial Incursion",
[2408] = "In Search of the Ash'abah",
[2436] = "One Last Game",
[2450] = "A Woman Wronged",
[2451] = "A Ransom for Miranda",
[2481] = "The Debt Collector's Debts",
[2488] = "A Gang of Thugs",
[2494] = "Can't Leave Without Her",
[2495] = "The Signet Ring",
[2496] = "Evidence Against Adima",
[2497] = "Saving Hosni",
[2504] = "Azura's Relics",
[2536] = "Plowshares to Swords",
[2537] = "King Aphren's Sword",
[2538] = "Gift from a Suitor",
[2549] = "Abominations from Beyond",
[2550] = "Curse of Skulls",
[2552] = "Army at the Gates",
[2556] = "False Accusations",
[2558] = "The Slavers",
[2561] = "A Family Affair",
[2564] = "Two Sides to Every Coin",
[2566] = "Life of the Duchess",
[2567] = "The Safety of the Kingdom",
[2569] = "Legacy of the Three",
[2576] = "Tracking Sir Hughes",
[2578] = "Scamp Invasion",
[2599] = "Ash and Reprieve",
[2608] = "The Elder Scroll of Ghartok",
[2609] = "The Elder Scroll of Chim",
[2610] = "The Elder Scroll of Altadoon",
[2611] = "The Elder Scroll of Mnem",
[2612] = "The Elder Scroll of Ni-Mohk",
[2613] = "The Elder Scroll of Alma Ruma",
[2634] = "The Elder Scroll of Ni-Mohk",
[2637] = "The Elder Scroll of Altadoon",
[2656] = "The Elder Scroll of Mnem",
[2658] = "The Elder Scroll of Ghartok",
[2661] = "The Elder Scroll of Alma Ruma",
[2673] = "Scout Fort Rayles",
[2674] = "Scout Fort Glademist",
[2675] = "Scout Fort Ash",
[2676] = "Scout Fort Aleswell",
[2677] = "Scout Fort Dragonclaw",
[2678] = "Scout Chalman Keep",
[2679] = "Scout Arrius Keep",
[2684] = "Scout Drakelowe Keep",
[2685] = "Scout Castle Alessia",
[2686] = "Scout Castle Faregyl",
[2689] = "Scout Castle Black Boot",
[2692] = "Scout Rayles Mine",
[2693] = "Scout Glademist Mine",
[2694] = "Scout Ash Mine",
[2697] = "Scout Aleswell Mine",
[2698] = "Scout Dragonclaw Mine",
[2699] = "Scout Chalman Mine",
[2700] = "Scout Arrius Mine",
[2701] = "Scout Kingscrest Mine",
[2702] = "Scout Farragut Mine",
[2706] = "Scout Faregyl Mine",
[2708] = "Scout Brindle Mine",
[2709] = "Scout Black Boot Mine",
[2710] = "Scout Bloodmayne Mine",
[2722] = "Scout Rayles Farm",
[2723] = "Scout Glademist Farm",
[2728] = "Scout Chalman Farm",
[2729] = "Scout Arrius Farm",
[2730] = "Scout Kingscrest Farm",
[2731] = "Scout Farragut Farm",
[2736] = "Scout Faregyl Farm",
[2738] = "Scout Brindle Farm",
[2739] = "Scout Black Boot Farm",
[2740] = "Scout Bloodmayne Farm",
[2741] = "Scout Warden Lumbermill",
[2742] = "Scout Rayles Lumbermill",
[2743] = "Scout Glademist Lumbermill",
[2744] = "Scout Ash Lumbermill",
[2745] = "Scout Aleswell Lumbermill",
[2747] = "Scout Chalman Lumbermill",
[2749] = "Scout Kingscrest Lumbermill",
[2750] = "Scout Farragut Lumbermill",
[2752] = "Scout Drakelowe Lumbermill",
[2755] = "Scout Roebeck Lumbermill",
[2756] = "Scout Brindle Lumbermill",
[2757] = "Scout Black Boot Lumbermill",
[2758] = "Scout Bloodmayne Lumbermill",
[2759] = "Kill Enemy Players",
[2796] = "Scout Farragut Mine",
[2797] = "Scout Blue Road Mine",
[2800] = "Scout Roebeck Mine",
[2832] = "Scout Blue Road Lumbermill",
[2841] = "Scout Fort Rayles",
[2853] = "Scout Castle Faregyl",
[2856] = "Scout Castle Black Boot",
[2858] = "Scout Warden Mine",
[2862] = "Scout Aleswell Mine",
[2870] = "Scout Alessia Mine",
[2875] = "Scout Bloodmayne Mine",
[2887] = "Scout Black Boot Farm",
[2888] = "Scout Bloodmayne Farm",
[2915] = "Capture Fort Warden",
[2917] = "Capture Fort Glademist",
[2918] = "Capture Fort Ash",
[2919] = "Capture Fort Aleswell",
[2920] = "Capture Fort Dragonclaw",
[2921] = "Capture Chalman Keep",
[2922] = "Capture Arrius Keep",
[2923] = "Capture Kingscrest Keep",
[2924] = "Capture Farragut Keep",
[2925] = "Capture Blue Road Keep",
[2926] = "Capture Drakelowe Keep",
[2927] = "Capture Castle Alessia",
[2928] = "Capture Castle Faregyl",
[2929] = "Capture Castle Roebeck",
[2930] = "Capture Castle Brindle",
[2931] = "Capture Castle Black Boot",
[2932] = "Capture Castle Bloodmayne",
[2937] = "Capture Aleswell Mine",
[2938] = "Capture Dragonclaw Mine",
[2939] = "Capture Chalman Mine",
[2944] = "Capture Drakelowe Mine",
[2946] = "Capture Faregyl Mine",
[2947] = "Capture Roebeck Mine",
[2950] = "Capture Brindle Mine",
[2951] = "Capture Black Boot Mine",
[2952] = "Capture Bloodmayne Mine",
[2954] = "Capture Rayles Farm",
[2956] = "Capture Ash Farm",
[2958] = "Capture Dragonclaw Farm",
[2961] = "Capture Kingscrest Farm",
[2966] = "Capture Faregyl Farm",
[2970] = "Capture Bloodmayne Farm",
[2972] = "Capture Warden Lumbermill",
[2977] = "Capture Dragonclaw Lumbermill",
[2980] = "Capture Kingscrest Lumbermill",
[2981] = "Capture Farragut Lumbermill",
[2986] = "Capture Roebeck Lumbermill",
[2997] = "Amputating the Hand",
[2998] = "Restoring the Ansei Wards",
[3000] = "Blood and the Crescent Moon",
[3001] = "Farlivere's Gambit",
[3003] = "Disorganized Crime",
[3004] = "Lady Eloise's Lockbox",
[3006] = "Bloodthorn Assassins",
[3009] = "Turning of the Trees",
[3011] = "Swine Thief",
[3013] = "Wolves in the Fold",
[3016] = "The Wyrd Tree's Roots",
[3017] = "Back-Alley Murders",
[3018] = "Lineage of Tooth and Claw",
[3019] = "The Ghosts of Westtry",
[3020] = "Memento Mori",
[3023] = "Wicked Trade",
[3026] = "The Wyrd Sisters",
[3027] = "Ripple Effect",
[3029] = "Temple's Treasures",
[3035] = "Wyrd and Coven",
[3039] = "Crocodile Bounty",
[3040] = "Vital Inheritance",
[3047] = "A Step Back in Time",
[3049] = "The Nameless Soldier",
[3050] = "Cursed Treasure",
[3059] = "Servants of Ancient Kings",
[3060] = "Seeking the Guardians",
[3063] = "Champion of the Guardians",
[3064] = "Rally Cry",
[3082] = "The Lion Guard's Stand",
[3099] = "Capture Castle Black Boot",
[3102] = "Capture Rayles Farm",
[3136] = "Capture Brindle Mine",
[3138] = "Capture Bloodmayne Mine",
[3140] = "Capture Rayles Lumbermill",
[3141] = "Capture Glademist Lumbermill",
[3142] = "Capture Ash Lumbermill",
[3157] = "Kill Enemy Players",
[3172] = "Left at the Altar",
[3174] = "A Lingering Hope",
[3183] = "To the Wyrd Tree",
[3184] = "The Glenumbra Moors",
[3187] = "Seize the Moment",
[3189] = "Hidden in Flames",
[3190] = "Ash'abah Rising",
[3191] = "Reclaiming the Elements",
[3192] = "Forgotten Ancestry",
[3201] = "Capture Arrius Farm",
[3203] = "Capture Farragut Farm",
[3205] = "Capture Drakelowe Farm",
[3216] = "Capture Fort Aleswell",
[3219] = "Capture Arrius Keep",
[3226] = "Capture Castle Roebeck",
[3228] = "Capture Castle Black Boot",
[3235] = "Purifying the Wyrd Tree",
[3238] = "Capture Chalman Lumbermill",
[3267] = "The Fall of Faolchu",
[3277] = "Mastering the Talisman",
[3280] = "Imperial Infiltration",
[3281] = "Leading the Stand",
[3283] = "Werewolves to the North",
[3285] = "The Jeweled Crown of Anton",
[3286] = "Under Siege",
[3296] = "Trials of the Hero",
[3302] = "The Miners' Lament",
[3303] = "Thwarting the Aldmeri Dominion",
[3305] = "The Oldest Orc",
[3314] = "The Corpse Horde",
[3315] = "The Hidden Treasure",
[3317] = "Tongues of Stone",
[3322] = "The Dresan Index",
[3330] = "Retaking Camlorn",
[3333] = "Risen From the Depths",
[3335] = "The Charge of Evermore",
[3337] = "Legitimate Interests",
[3338] = "Mists of Corruption",
[3343] = "Crosswych Reclaimed",
[3344] = "Satak was the First Serpent",
[3345] = "The End of Extortion",
[3353] = "The Nature of Fate",
[3357] = "The Labyrinth",
[3367] = "The Nature of Fate: Part Two",
[3379] = "Angof the Gravesinger",
[3381] = "A Winner for Onwyn",
[3383] = "Badwater Mine",
[3385] = "Undying Loyalty",
[3412] = "A Dangerous Dream",
[3414] = "Legacy of Baelborne Rock",
[3416] = "Signals of Dominion",
[3431] = "Capture Any Three Keeps",
[3436] = "Foul Deeds in the Deep",
[3437] = "A Mysterious Curio",
[3438] = "Past in Ruins",
[3440] = "Wayward Scouts",
[3482] = "Trapped in the Bluffs",
[3496] = "Scavenging for a Scarab",
[3509] = "Vines and Villains",
[3520] = "Window on the Past",
[3530] = "Destroying the Dark Witnesses",
[3533] = "The Waking Darkness",
[3566] = "Kingdom in Mourning",
[3581] = "Cleansing the Past",
[3583] = "Suspicious Silence",
[3584] = "The Coral Heart",
[3585] = "Legacy of the Ancestors",
[3587] = "Delaying the Daggers",
[3588] = "City Under Siege",
[3589] = "Quiet the Ringing Bell",
[3590] = "Through the Aftermath",
[3591] = "The Venom of Ahknara",
[3592] = "Proving Trust",
[3593] = "Intruders in Deshaan",
[3594] = "Enslaved in Death",
[3595] = "Wayward Son",
[3598] = "Giving for the Greater Good",
[3600] = "Oath Breaker",
[3602] = "Percussive Ranching",
[3604] = "Challenge the Tide",
[3605] = "Ritual of Anguish",
[3608] = "The Medallions of Saint Veloth",
[3610] = "For Their Own Protection",
[3611] = "Burning Revenge",
[3612] = "The Naked Nord",
[3615] = "Wake the Dead",
[3616] = "Rending Flames",
[3617] = "Quieting a Heart",
[3618] = "To Ash Mountain",
[3620] = "The Ravaged Village",
[3621] = "Peril at the Pools",
[3622] = "The Brothers Will Rise",
[3624] = "The Saving of Silent Mire",
[3626] = "Protecting the Hall",
[3627] = "Kinsman's Revenge",
[3631] = "Recovering the Guar",
[3632] = "Breaking Fort Virak",
[3633] = "Evening the Odds",
[3634] = "The General's Demise",
[3635] = "City at the Spire",
[3637] = "Godrun's Dream",
[3639] = "Restoring Order",
[3642] = "The Curse of Heimlyn Keep",
[3643] = "What Was Done Must Be Undone",
[3645] = "The Sapling",
[3646] = "An Unwanted Twin",
[3647] = "Shattering Mirror",
[3648] = "A Story Told in Footprints",
[3650] = "Cold-Blooded Vengeance",
[3651] = "The Trial of the Ghost Snake",
[3652] = "Fighting Back",
[3653] = "Ratting Them Out",
[3656] = "Search and Rescue",
[3657] = "Carving Cuttle",
[3658] = "A Timely Matter",
[3659] = "Unwanted Guests",
[3660] = "Hiding in Plain Sight",
[3661] = "Mechanical Murder",
[3662] = "A Bit of Sport",
[3663] = "That Which Matters Most",
[3666] = "Rules and Regulations",
[3667] = "Night of the Soul",
[3670] = "Desperate Souls",
[3671] = "To Fort Virak",
[3673] = "Death Trap",
[3674] = "Warm Welcome",
[3675] = "Last One Standing",
[3676] = "A Pirate Parley",
[3678] = "Trials of the Burnished Scales",
[3679] = "Dreams From the Hist",
[3680] = "Of Dubious Value",
[3681] = "Lost Pilgrimage",
[3683] = "What Lies Beneath",
[3684] = "Bad Soldiers",
[3685] = "The Thin Ones",
[3686] = "Three Tender Souls",
[3687] = "Getting to the Truth",
[3688] = "Unwelcome Guests",
[3690] = "Scouring the Mire",
[3695] = "Aggressive Negotiations",
[3696] = "Saving the Son",
[3697] = "A Gathering of Guar",
[3698] = "To the Tormented Spire",
[3699] = "From the Wastes",
[3702] = "The Soldier's Alibi",
[3703] = "Honor Bound",
[3705] = "Payback",
[3709] = "The Bargain's End",
[3712] = "Captive Souls",
[3715] = "Strange Guard Beasts",
[3717] = "King of Dust",
[3718] = "Into the Temple",
[3719] = "Captured Time",
[3721] = "Dissonant Commands",
[3724] = "Lost to the Mire",
[3728] = "Remembering Risa",
[3729] = "A Stranger Uninvited",
[3730] = "Whispers of the Wisps",
[3731] = "Broken Apart",
[3732] = "Overrun",
[3734] = "Restoring the Guardians",
[3735] = "The Death of Balreth",
[3736] = "Close the Scamp Caves",
[3737] = "In With the Tide",
[3749] = "Into the Mouth of Madness",
[3751] = "Hunting Invaders",
[3752] = "A Storm Broken",
[3783] = "Lost Lions",
[3784] = "Repairing the Cage",
[3787] = "Vengeance of the Oppressed",
[3788] = "Vengeance for House Dres",
[3789] = "This One's a Classic",
[3791] = "Outside Interference",
[3794] = "Divine Favor",
[3795] = "Deep Disturbance",
[3796] = "Nothing Left to Waste",
[3797] = "Plague Bringer",
[3799] = "Scales of Retribution",
[3802] = "What Happened at Murkwater",
[3804] = "Missing in the Mire",
[3806] = "Undermined",
[3809] = "Cultural Exchange",
[3810] = "Motive for Heresy",
[3815] = "Cracking the Egg",
[3817] = "The Seal of Three",
[3818] = "A Saint Asunder",
[3819] = "Healing Hearts",
[3820] = "Restless Spirits",
[3822] = "Schism",
[3824] = "A Last Reminder",
[3826] = "Climbing the Spire",
[3827] = "The Tree-Minder's Fate",
[3828] = "Cold-Blooded Revenge",
[3831] = "The Judgment of Veloth",
[3837] = "Opening the Portal",
[3838] = "The Wounds in the World",
[3840] = "Saving the Relics",
[3841] = "The Mystery of Razak",
[3845] = "And Throw Away The Key",
[3846] = "The Keystone",
[3847] = "The Ones Left Behind",
[3849] = "A Final Release",
[3850] = "The Covenant Infiltrator",
[3852] = "Rescue and Revenge",
[3854] = "A Goblin's Affection",
[3855] = "Mystery of Othrenis",
[3856] = "Anchors from the Harbour",
[3858] = "The Dangerous Past",
[3860] = "Exquisite Tears",
[3863] = "Taking the Tower",
[3864] = "The Dungeon Delvers",
[3865] = "Savages of Stonefalls",
[3868] = "Sadal's Final Defeat",
[3874] = "The Light Fantastic",
[3880] = "A Blow for Order",
[3885] = "The Prismatic Core",
[3886] = "The Fetish",
[3888] = "Buried in the Past",
[3889] = "The Fangs of Sithis",
[3890] = "Pull the Last Fang",
[3893] = "By Invitation Only",
[3898] = "Proving the Deed",
[3900] = "Into the Mire",
[3902] = "A Son's Promise",
[3903] = "School Daze",
[3904] = "Supply Run",
[3905] = "Clarity",
[3908] = "Vision Quest",
[3909] = "The Dominion's Alchemist",
[3910] = "The Dream of the Hist",
[3911] = "The Swamp's Embrace",
[3912] = "Vigil's End",
[3914] = "Missing Son",
[3915] = "Decree of the Court",
[3916] = "Long Lost Lore",
[3917] = "Enlightenment Needs Salt",
[3918] = "Circus of Cheerful Slaughter",
[3919] = "Beneath the Stone",
[3920] = "Unearthed",
[3921] = "Move out Miners",
[3923] = "The Farmer's Champion",
[3924] = "Song of Awakening",
[3925] = "Guard the Knowledge",
[3927] = "In His Wake",
[3928] = "Dangerous Union",
[3953] = "Chateau of the Ravenous Rodent",
[3955] = "Tracking the Plague",
[3956] = "Message to Mournhold",
[3957] = "Gift of the Worm",
[3958] = "The Llodos Plague",
[3959] = "Smoke on the Horizon",
[3961] = "Raise the Colors",
[3963] = "The Returned",
[3964] = "Secrets of the Lost City",
[3966] = "Chasing the Magistrix",
[3968] = "Through the Shroud",
[3970] = "An Ill-Fated Venture",
[3973] = "Will of the Council",
[3974] = "Storming the Hall",
[3977] = "To Vernim Woods",
[3978] = "Tomb Beneath the Mountain",
[3980] = "Research Subject",
[3981] = "To Taarengrav",
[3982] = "Bound to the Bog",
[3985] = "Tracking the Game",
[3986] = "Underfoot",
[3987] = "Hozzin's Folly",
[3988] = "Dangerous Webs",
[3990] = "A Beginning at Bleakrock",
[3991] = "Escape from Bleakrock",
[3992] = "What Waits Beneath",
[3993] = "Kings of the Grotto",
[3995] = "The Frozen Man",
[3996] = "At Frost's Edge",
[3997] = "The Mad God's Bargain",
[3999] = "Lost on Bleakrock",
[4002] = "Sparking the Flame",
[4016] = "The Missing of Bleakrock",
[4018] = "Giant Problems",
[4022] = "Salt of the Earth",
[4023] = "If By Sea",
[4024] = "Finding the Family",
[4026] = "Zeren in Peril",
[4028] = "Breaking the Tide",
[4030] = "Shrine of Corruption",
[4034] = "A Friend in Mead",
[4037] = "A Brother's Revenge",
[4038] = "Unorthodox Tactics",
[4041] = "Crossroads",
[4043] = "Collector of Pelts",
[4048] = "The Direct Approach",
[4051] = "Warning Davon's Watch",
[4052] = "Death to the Crone",
[4054] = "Deadly Whispers",
[4055] = "A Cure For Droi",
[4056] = "For Kyne's Honor",
[4058] = "Shadows Over Windhelm",
[4059] = "The Konunleikar",
[4060] = "Windhelm's Champion",
[4061] = "One Victor, One King",
[4062] = "Blindsided",
[4065] = "An Evil Presence",
[4066] = "Bear Essentials",
[4067] = "The Bard of Hounds",
[4068] = "Mementos",
[4069] = "Making Amends",
[4070] = "Security Details",
[4071] = "Sleep for the Dead",
[4072] = "Rock Bone Diplomacy",
[4073] = "Stolen Banner",
[4074] = "For a Friend",
[4075] = "A Right to Live",
[4078] = "A Council of Thanes",
[4079] = "Essence of Flame",
[4080] = "Season of Harvest",
[4081] = "Silver Scales",
[4085] = "A Tale Forever Told",
[4086] = "Strange Allies",
[4087] = "Sneak Peak",
[4088] = "Can't Take It With Them",
[4089] = "The Hound's Men",
[4091] = "Fulfilling One's Fate",
[4092] = "Back to Rest",
[4095] = "The Siege of Cradlecrush",
[4096] = "Merriment and Mystery",
[4099] = "A Dying Wish",
[4101] = "Payment In Kind",
[4103] = "Z'en and Mauloch",
[4104] = "In Search of Kireth Vanos",
[4105] = "Kireth's Amazing Plan",
[4106] = "The Better of Two Evils",
[4107] = "Banishing the Banished",
[4108] = "The Tale of the Green Lady",
[4111] = "The Show Must Go On",
[4112] = "Raise the Curtain",
[4115] = "Eternal Slumber",
[4116] = "Snow and Flame",
[4117] = "Songs of Sovngarde",
[4118] = "Dark Deeds",
[4119] = "The Storm's Call",
[4123] = "Gods Save the King",
[4124] = "The Prisoner of Jathsogur",
[4126] = "Labor Dispute",
[4128] = "Mystery Metal",
[4129] = "Shipwrecked Sailors",
[4130] = "The Captain's Honor",
[4131] = "The Maormer's Vessels",
[4133] = "Soul Harvest",
[4134] = "Something Rotten",
[4135] = "Pulled Under",
[4137] = "For Everything a Season",
[4138] = "Alchemical Analysis",
[4139] = "Shattered Hopes",
[4140] = "Soldier Down",
[4141] = "Do Kill the Messenger",
[4142] = "Awakening",
[4143] = "Restore the Silvenar",
[4144] = "The Misfortunate Minstrels",
[4145] = "Mine All Mine",
[4146] = "A Family Divided",
[4147] = "The Shackled Guardian",
[4149] = "Party Planning",
[4150] = "Sleeping on the Job",
[4151] = "A Bitter Pill",
[4152] = "Swamp to Snow",
[4153] = "Concealed Weapons",
[4155] = "Arithiel",
[4156] = "The Soul Trap",
[4158] = "The Pride of a Prince",
[4160] = "Approaching Thunder",
[4161] = "A Novel Idea",
[4163] = "Onward to Shadowfen",
[4164] = "A Giant in Smokefrost Peaks",
[4165] = "The Dark Night of the Soul",
[4166] = "The War Council",
[4167] = "A Business Proposition",
[4169] = "Of Councils and Kings",
[4171] = "The Rise of Sage Svari",
[4173] = "The Thunder Breaks",
[4174] = "Scouting the Mine",
[4176] = "Breaking the Coven",
[4177] = "Victory at Morvunskar",
[4178] = "Lost Companions",
[4184] = "To Pinepeak Caverns",
[4185] = "To Honrich Tower",
[4186] = "Securing the Pass",
[4188] = "Stomping Sinmur",
[4189] = "Names of the Fallen",
[4193] = "House and Home",
[4194] = "One Fell Swoop",
[4195] = "The Unkindest Cut",
[4196] = "Enemy of My Enemy",
[4197] = "Sounds of Alarm",
[4199] = "A Tangled Net",
[4201] = "A Walk Above the Clouds",
[4202] = "Force of Nature",
[4203] = "Lifeline",
[4204] = "Bath Time",
[4205] = "Our Poor Town",
[4206] = "Nature's Accord",
[4208] = "Silsailen Rescue",
[4209] = "Teldur's End",
[4210] = "Real Marines",
[4211] = "To Tanzelwil",
[4212] = "Torn Asunder",
[4217] = "In the Name of the Queen",
[4218] = "Best of the Best",
[4219] = "The Serpent's Beacon",
[4220] = "The Mallari-Mora",
[4221] = "An Act of Kindness",
[4222] = "Rites of the Queen",
[4223] = "Corruption Stones",
[4224] = "Abominations",
[4225] = "To Nimalten",
[4226] = "Death to the Black Daggers!",
[4228] = "Claw of Akatosh",
[4229] = "Sacred Prey, Hunt Profane",
[4237] = "Life of the Party",
[4238] = "Overdue Supplies",
[4242] = "The Lich",
[4244] = "Black Dagger Supplies",
[4246] = "Deception in the Dark",
[4247] = "Guard Work is Never Done",
[4248] = "Geirmund's Guardian",
[4249] = "Trial of the Body",
[4250] = "Trial of the Mind",
[4251] = "Trial of the Spirit",
[4252] = "Save Your Voice",
[4253] = "Geirmund's Oath",
[4254] = "Those She Devours",
[4255] = "Ensuring Security",
[4256] = "A Hostile Situation",
[4257] = "Unaccounted Crew",
[4259] = "Foreign Vintage",
[4260] = "Breaking the Barrier",
[4261] = "Sever All Ties",
[4263] = "Field of Fire",
[4264] = "Plague of Phaer",
[4265] = "The High Cost of Lying",
[4266] = "The First Patient",
[4267] = "All's Fair",
[4270] = "The Cache",
[4272] = "Depths of Madness",
[4273] = "To the King",
[4276] = "The Troubleshooter",
[4277] = "Silent Village",
[4278] = "A Village Awakened",
[4283] = "River of Names",
[4285] = "A Father's Promise",
[4286] = "Pinepeak Caverns",
[4287] = "Ritual at the Dragonshrine",
[4288] = "Blind Man's Bluff",
[4289] = "Blood Upon the Soil",
[4291] = "The Summer Site",
[4292] = "A Ritual in Smokefrost Peaks",
[4293] = "Putting the Pieces Together",
[4294] = "The Unveiling",
[4295] = "The Wayward Dagger",
[4296] = "Soul Shriven in Coldharbour",
[4300] = "Blessings of the Eight",
[4301] = "Relic Rescue",
[4302] = "Worm Cult Summoner",
[4303] = "Lighting the Shadows",
[4304] = "Redguard on the Run",
[4306] = "Finding Winter's Hammer",
[4307] = "Returning Winter's Bite",
[4309] = "Eye Spy",
[4311] = "A Ritual in the Ragged Hills",
[4316] = "On a Dare",
[4317] = "Where the Frostheart Grows",
[4318] = "Into the Outside",
[4320] = "Fierce Beasts of Ivarstead",
[4321] = "Problems Into Profit",
[4322] = "Lost Crown",
[4326] = "The Veiled Choice",
[4327] = "Preventative Measure",
[4329] = "Harsh Lesson",
[4330] = "Lifting the Veil",
[4331] = "Wearing the Veil",
[4332] = "Prisoner Dilemma",
[4333] = "A Valuable Distraction",
[4335] = "Pride of the Lion Guard",
[4336] = "Ancient Remains",
[4337] = "Buyer Beware",
[4338] = "Eye of the Ancients",
[4339] = "If the Dead Could Talk",
[4340] = "The White Mask of Merien",
[4341] = "Cutting Off the Source",
[4344] = "Like Moths to a Candle",
[4345] = "The Veil Falls",
[4346] = "Nobles' Rest",
[4347] = "Special Blend",
[4348] = "A Graveyard of Ships",
[4349] = "Kill Enemy Players",
[4351] = "Through the Daedric Lens",
[4352] = "The Library of Dusk",
[4354] = "The Endless War",
[4355] = "Through the Ashes",
[4357] = "To Firsthold",
[4358] = "Between Blood and Bone",
[4361] = "Rightful Inheritance",
[4362] = "The Jester's Joke",
[4364] = "A Thorn in Your Side",
[4365] = "To Dawnbreak",
[4366] = "To Mathiisen",
[4368] = "To Skywatch",
[4369] = "The Will of the Worm",
[4370] = "A Bargain With Shadows",
[4371] = "Wisdom of the Ages",
[4372] = "Goblin Marq",
[4373] = "Export Business",
[4374] = "Old Bones",
[4378] = "Naval Intelligence",
[4379] = "Lover's Torment",
[4380] = "Last Night",
[4381] = "Sphere Assembly",
[4382] = "Moment of Truth",
[4385] = "Lost in Study",
[4386] = "Heart of the Matter",
[4387] = "Forbidden Love",
[4388] = "A Life of Privilege",
[4390] = "Unbridled Wealth",
[4391] = "Catch the Lightning",
[4392] = "Truth, Lies, and Prisoners",
[4395] = "Enemies at the Gate",
[4396] = "Unsafe Haven",
[4397] = "The Enemy Within",
[4398] = "A Chief Concern",
[4399] = "Into the Woods",
[4401] = "Lighthouse Attack Plans",
[4403] = "Captive Crewmembers",
[4404] = "Lost Treasures",
[4405] = "A Little on the Side",
[4406] = "Forgotten Soul",
[4408] = "Spirited Away",
[4409] = "The Racer",
[4410] = "Assisting the Assistant",
[4411] = "Final Blows",
[4417] = "Bloodied Waters",
[4420] = "Keepsake",
[4421] = "Thorns in Our Side",
[4422] = "Spice",
[4424] = "A Debt Come Due",
[4425] = "Prisoners of War",
[4426] = "Stacking the Odds",
[4430] = "The Burned Estate",
[4431] = "Buried Secrets",
[4432] = "Blood and Sand",
[4433] = "Ayleid Treasure",
[4434] = "For Piety's Sake",
[4435] = "Simply Misplaced",
[4436] = "Luck of the Albatross",
[4440] = "Baan Dar's Boast",
[4441] = "The Toothmaul Ploy",
[4443] = "To Alcaire Castle",
[4445] = "Forever Bound",
[4446] = "Aiding Sigunn",
[4447] = "Yngrel the Bloody",
[4448] = "Kalodar's Farewell",
[4449] = "Carzog's Demise",
[4450] = "Well-Armed Savages",
[4452] = "Reap What Is Sown",
[4453] = "A Favor Returned",
[4454] = "Innocent Scoundrel",
[4455] = "Trade Negotiations",
[4456] = "The Hound's Plan",
[4457] = "Box of Riddles",
[4458] = "The Drublog of Dra'bul",
[4459] = "The Mournhold Underground",
[4460] = "Grim Situation",
[4461] = "Grimmer Still",
[4462] = "The Dead King",
[4463] = "The Merethic Collection",
[4464] = "Nature's Best Friend",
[4466] = "The Broken Spearhead",
[4468] = "Unearthing the Past",
[4469] = "Fires of Battle",
[4471] = "Izad's Treasure",
[4472] = "Rat in a Trap",
[4473] = "Revenge Against Rama",
[4474] = "Daughter of Giants",
[4475] = "Shock to the System",
[4476] = "Tip of the Spearhead",
[4477] = "A Wedding to Attend",
[4478] = "Into the Hills",
[4479] = "Motes in the Moonlight",
[4480] = "Oath of Excision",
[4481] = "Small Town Problems",
[4482] = "Rat Problems",
[4483] = "Ezzag's Bandits",
[4484] = "Haunting of Kalari",
[4485] = "Loose Ends",
[4486] = "Down the Skeever Hole",
[4487] = "The Arbordawn Cult",
[4488] = "Gentle Gardener",
[4492] = "Desecrated Ground",
[4493] = "A Fair Warning",
[4494] = "You Have to Break a Few",
[4495] = "A Service for the Dead",
[4497] = "Lost Daughter",
[4499] = "Baan Dar's Bash",
[4500] = "A Nord in Need",
[4501] = "Gates of Fire",
[4503] = "Brothers and Bandits",
[4505] = "Seeds of Hope",
[4506] = "Tarnish the Crown",
[4507] = "Offerings to Zenithar",
[4508] = "Washed Ashore",
[4509] = "Harvest Time",
[4510] = "The Spearhead's Captain",
[4511] = "Dead Man's Wrist",
[4512] = "The Dead of Culotte",
[4514] = "The Spearhead's Crew",
[4515] = "The Ties that Bind",
[4516] = "Stolen Ashes",
[4517] = "Crown Point",
[4519] = "Word from the Dead",
[4520] = "Bloody Hand Spies!",
[4522] = "The Hedoran Estate",
[4523] = "The Bloodthorn Plot",
[4524] = "Repentant Son",
[4525] = "Tormented Souls",
[4526] = "Lost Bet",
[4527] = "Securing Knowledge",
[4528] = "Garments by Odei",
[4529] = "Red Rook Resources",
[4530] = "Goblin's Delight",
[4531] = "A Brush With Death",
[4532] = "Take Me Home",
[4533] = "Fortune in Failure",
[4535] = "The Dagger's Edge",
[4536] = "The Golden Claw",
[4537] = "An Offering",
[4538] = "Eye of the Storm",
[4540] = "Timberscar Troubles",
[4541] = "Soul Survivors",
[4543] = "Holes in the World",
[4544] = "The Dark Mane",
[4546] = "Retaking the Pass",
[4547] = "Prove Your Worth",
[4548] = "Farsight",
[4549] = "Back to Skywatch",
[4550] = "The Fires of Dune",
[4551] = "A Poisoned Heart",
[4552] = "Chasing Shadows",
[4553] = "Threefold Folly",
[4554] = "Shadowfen Smorgasbord",
[4555] = "Blood Relations",
[4556] = "Strength of the Father",
[4557] = "Will of the Broken",
[4558] = "Taking the Fight to the Enemy",
[4559] = "Daughter of Seamount",
[4560] = "Riches Beyond Measure",
[4561] = "Dangerously Low",
[4563] = "Capstone Caps",
[4564] = "Lost and Alone",
[4565] = "Do as I Say",
[4566] = "On to Glenumbra",
[4568] = "The Standing Stones",
[4569] = "Enemy Reinforcements",
[4570] = "Know thy Enemy",
[4571] = "Fang Collector",
[4572] = "Requests for Aid",
[4573] = "Frighten the Fearsome",
[4574] = "Veil of Illusion",
[4575] = "The Flooded Grove",
[4578] = "Over the Edge",
[4579] = "Bring Down the Magister",
[4580] = "Double Jeopardy",
[4581] = "The Unseen",
[4583] = "Dear Cousins",
[4584] = "Pilfered Urn",
[4585] = "Relative Matters",
[4586] = "The Witch of Silatar",
[4587] = "Trail of the Skin-Stealer",
[4588] = "Land Dispute",
[4589] = "Jumping Ship",
[4590] = "The Skin-Stealer's Lair",
[4591] = "Timely Intervention",
[4593] = "Audience with the Wilderking",
[4596] = "Handmade Guardian",
[4597] = "The Plan",
[4598] = "Into the Vice Den",
[4599] = "On the Doorstep",
[4601] = "Right of Theft",
[4602] = "Light from the Darkness",
[4605] = "The Hollow City",
[4606] = "Keepers of the Shell",
[4607] = "Castle of the Worm",
[4608] = "The Blight of the Bosmer",
[4610] = "The Army of Meridia",
[4611] = "Mist and Shadow",
[4615] = "Lost in the Mist",
[4620] = "Cast Adrift",
[4621] = "The Tempest Unleashed",
[4622] = "The Search is Over",
[4623] = "The Soul-Meld Mage",
[4624] = "The Perils of Diplomacy",
[4625] = "Tears of the Two Moons",
[4626] = "Vanus Unleashed",
[4628] = "Supplies for Applewatch",
[4629] = "Secrets Revealed",
[4630] = "Regret",
[4631] = "Past Due",
[4632] = "Special Delivery",
[4635] = "Heirloom",
[4636] = "Moonhenge's Tear",
[4637] = "The Message",
[4638] = "The Real Snake",
[4639] = "Better Late Than Never",
[4640] = "Sands of Sentinel",
[4641] = "What Was Lost",
[4642] = "Hall of Judgment",
[4646] = "The Mnemic Egg",
[4647] = "A Foot in the Door",
[4648] = "The Summoner Division",
[4649] = "The Sorcerer Division",
[4650] = "The Swordmaster Division",
[4651] = "The Champion Division",
[4652] = "The Colovian Occupation",
[4653] = "Stonefire Machinations",
[4654] = "An Unusual Circumstance",
[4655] = "Hadran's Fall",
[4656] = "Tharayya's Trail",
[4657] = "The Spinner's Tale",
[4658] = "Misplaced Knowledge",
[4659] = "Lady Laurent's Favor",
[4660] = "The Devils You Know",
[4662] = "Articles of Faith",
[4663] = "Out for a Walk",
[4664] = "Moon-Sugar Medicament",
[4665] = "Ezreba's Fate",
[4666] = "The Silver Flute",
[4667] = "Dark Knowledge",
[4668] = "Lizard Racing",
[4669] = "Spikeball",
[4670] = "Troll Arena",
[4671] = "Distant Relatives",
[4672] = "Morwha's Curse",
[4673] = "The Root of the Problem",
[4674] = "Spoils of War",
[4675] = "Consuming Darkness",
[4676] = "An Affront to Mara",
[4678] = "Catch of the Day",
[4679] = "The Shadow's Embrace",
[4680] = "Storm on the Horizon",
[4681] = "The Serpent Lord",
[4682] = "The Doctor's Bag",
[4683] = "Medicinal Herbs",
[4684] = "Congratulations!",
[4686] = "The Initiation",
[4687] = "A Traitor's Luck",
[4689] = "A Door Into Moonlight",
[4690] = "Striking at the Heart",
[4691] = "Cause and Effect",
[4692] = "A Pinch of Sugar",
[4693] = "The Family Business",
[4694] = "Word from the Throne",
[4695] = "Homeward",
[4696] = "The High Cost of Travel",
[4697] = "To Rawl'kha",
[4699] = "The Fading Tree",
[4701] = "Crossing the Chasm",
[4704] = "Welcome to Cyrodiil",
[4705] = "Siege Warfare",
[4706] = "Reporting for Duty",
[4707] = "Best Left Unknown",
[4709] = "The Path to Moonmont",
[4710] = "Hallowed To Arenthia",
[4711] = "To Dune",
[4712] = "The First Step",
[4714] = "The Changing Kind",
[4715] = "The Harvest Heart",
[4716] = "The Shurgak Job",
[4717] = "Prisoners of the Sphinx",
[4719] = "The Moonlit Path",
[4720] = "The Den of Lorkhaj",
[4721] = "Honoring the Dishonored",
[4722] = "Welcome to Cyrodiil",
[4723] = "Siege Warfare",
[4724] = "Reporting for Duty",
[4725] = "Welcome to Cyrodiil",
[4726] = "Siege Warfare",
[4727] = "Reporting for Duty",
[4730] = "Breaking the Shackle",
[4731] = "Malignant Militia",
[4732] = "To Honor the Fallen",
[4733] = "Knowledge Gained",
[4735] = "The Staff of Magnus",
[4737] = "The Waking Dreamer",
[4738] = "Song of the Spinner",
[4739] = "A Storm Upon the Shore",
[4740] = "Questionable Contract",
[4743] = "The Lost Lute",
[4744] = "Before the Storm",
[4746] = "A Misplaced Pendant",
[4747] = "The Anguish Gem",
[4748] = "Saving Stibbons",
[4749] = "How Few Remain",
[4750] = "Throne of the Wilderking",
[4751] = "Warship Designs",
[4754] = "Master of Leki's Blade",
[4757] = "What the Heart Wants",
[4758] = "The Final Assault",
[4759] = "Hallowed to Rawl'kha",
[4760] = "Whose Wedding?",
[4761] = "Trouble at Tava's Blessing",
[4764] = "The Tharn Speaks",
[4765] = "Pelidil's End",
[4766] = "Freedom's Chains",
[4767] = "One of the Undaunted",
[4768] = "Scars Never Fade",
[4770] = "Forthor's Cursed Axe",
[4771] = "Beasts of Falinesti",
[4773] = "Keeper of Bones",
[4774] = "The Citadel Must Fall",
[4775] = "A Night to Forget",
[4777] = "The List",
[4778] = "Razor's Edge",
[4779] = "The Amronal of Valenwood",
[4780] = "Messages Across Tamriel",
[4783] = "The Weight of Three Crowns",
[4784] = "Swift Justice",
[4785] = "The Senche",
[4786] = "The Innkeeper's Daughter",
[4787] = "Mourning the Lost",
[4788] = "The Falinesti Faithful",
[4790] = "Breaking the Ward",
[4791] = "The Artisan",
[4792] = "A Tangled Knot",
[4793] = "Manthir's Debt",
[4794] = "In the Belly of the Sea Hawk",
[4795] = "Scaled Captors",
[4798] = "Eye on Arenthia",
[4799] = "To Saifa in Rawl'kha",
[4802] = "To Moonmont",
[4808] = "Test of Faith",
[4809] = "Nirnroot Wine",
[4811] = "Nirnroot Wine",
[4812] = "History's Song",
[4813] = "No Second Chances",
[4814] = "News of Fallen Kin",
[4815] = "Pact Advocate",
[4817] = "Tracking the Hand",
[4818] = "To Auridon",
[4821] = "Report to Marbruk",
[4822] = "Mind of Madness",
[4824] = "Troublemakers",
[4826] = "Hunting the Mammoth",
[4827] = "Hunting the Troll",
[4828] = "Hunting the Wasp",
[4831] = "The Harborage",
[4832] = "Council of the Five Companions",
[4833] = "Bosmer Insight",
[4834] = "A Past Remembered",
[4836] = "Halls of Torment",
[4837] = "Valley of Blades",
[4839] = "Love Lost",
[4840] = "Ancient Power",
[4841] = "Trouble at the Rain Catchers",
[4842] = "The Unquiet Dead",
[4843] = "A Traitor's Tale",
[4844] = "The Price of Longevity",
[4846] = "The Misuses of Knowledge",
[4847] = "God of Schemes",
[4848] = "Deadly Ambition",
[4849] = "The Unfilled Order",
[4850] = "Shades of Green",
[4852] = "Claim to Fame",
[4853] = "Woodhearth",
[4854] = "Eyes of Azura",
[4857] = "The Concealing Veil",
[4858] = "Hope Lost",
[4863] = "Troll's Dessert",
[4864] = "A Favor Between Kings",
[4867] = "Shadow of Sancre Tor",
[4868] = "The Grip of Madness",
[4869] = "Bounty: Black Daggers",
[4870] = "Bounty: Gray Vipers",
[4871] = "Bounty: Shadowed Path",
[4872] = "Bounty: Goblins",
[4873] = "Bounty: Black Daggers",
[4874] = "Bounty: Gray Vipers",
[4875] = "Bounty: Shadowed Path",
[4876] = "Bounty: Goblins",
[4877] = "Bounty: Black Daggers",
[4878] = "Bounty: Gray Vipers",
[4879] = "Bounty: Shadowed Path",
[4880] = "Bounty: Goblins",
[4881] = "The Will of the Woods",
[4882] = "The Wandering Minstrel",
[4884] = "The Lightless Remnant",
[4885] = "A Lasting Winter",
[4887] = "Back in Time",
[4888] = "The Emerald Chalice",
[4891] = "The Parley",
[4893] = "Flipping the Coin",
[4894] = "A Letter for Deshaan",
[4895] = "Phantom Guilt",
[4896] = "The Great Tree",
[4898] = "Rising Against Onsi's Breath",
[4899] = "Beyond the Call",
[4900] = "Raiders at the Crossing",
[4901] = "The Road to Rivenspire",
[4902] = "Shornhelm Divided",
[4903] = "Dream-Walk Into Darkness",
[4908] = "Rare Imports",
[4911] = "Present in Memory",
[4912] = "Storming the Garrison",
[4914] = "The Wakening Dark",
[4915] = "Blood Hunt",
[4916] = "Guar Gone",
[4917] = "The Blacksap's Hold",
[4918] = "The Shifting Sands of Fate",
[4920] = "The Lady's Keepsake",
[4922] = "The Orrery of Elden Root",
[4923] = "Archaic Relics",
[4924] = "The Barefoot Breton",
[4925] = "Urenenya's Lament",
[4926] = "Assassin Hunter",
[4927] = "The Assassin's List",
[4928] = "Threat of Death",
[4929] = "A Dagger to the Heart",
[4930] = "Shedding the Past",
[4931] = "Frightened Folk",
[4934] = "In the Doghouse",
[4936] = "The Crown of Shornhelm",
[4937] = "The Sanctifying Flames",
[4938] = "The Heart of the Beast",
[4939] = "Until Death",
[4942] = "The Spider's Cocoon",
[4943] = "The Honor of the Queen",
[4944] = "Friend of Trolls",
[4945] = "A Spy in Shornhelm",
[4946] = "A Silken Garb",
[4949] = "Favor for the Queen",
[4950] = "Storgh's Bow",
[4951] = "Fit to Rule",
[4952] = "Dearly Departed",
[4953] = "Trouble at the Tree",
[4954] = "Light in the Darkness",
[4955] = "A Lucky Break",
[4956] = "Last Words",
[4958] = "Northpoint in Peril",
[4959] = "Trials and Tribulations",
[4960] = "To Walk on Far Shores",
[4961] = "Hircine's Gift",
[4963] = "Passage Denied",
[4964] = "Scion of the Blood Matron",
[4965] = "Children of Yokuda",
[4966] = "Wanted: Sgolag",
[4967] = "One of the Undaunted",
[4968] = "Caring for Kwama",
[4969] = "A Marriage in Ruins",
[4970] = "To Aid the Enemy",
[4971] = "The Arch-Mage's Boon",
[4972] = "The Liberation of Northpoint",
[4974] = "Brackenleaf's Briars",
[4975] = "The Wounded Wood",
[4976] = "Carnival Conundrum",
[4977] = "Ancient Stones, Ancient Words",
[4978] = "Striking Back",
[4979] = "Publish or Perish",
[4980] = "A Grave Matter",
[4981] = "Conflicted Emotions",
[4982] = "We Live In Fear",
[4984] = "A Lucrative Scheme",
[4986] = "A Token Trophy",
[4988] = "Rendezvous at the Pass",
[4989] = "A Handful of Stolen Dreams",
[4991] = "Dark Wings",
[4992] = "Searching for the Searchers",
[4997] = "One of the Undaunted",
[4998] = "Cadwell's Silver",
[5000] = "Cadwell's Gold",
[5005] = "Drink, Drink, and Be Merry",
[5006] = "To Velyn Harbor",
[5007] = "Shroud Hearth Barrow",
[5008] = "A Diamond in the Root",
[5011] = "Beneath the Surface",
[5012] = "Rusty Daggers",
[5014] = "Crimes of the Past",
[5018] = "Fell's Justice",
[5020] = "The Wayward Son",
[5021] = "The Lover",
[5022] = "The Bandit",
[5024] = "Puzzle of the Pass",
[5025] = "The Corrupted Stone",
[5027] = "A Change of Heart",
[5033] = "The Star-Gazers",
[5034] = "A Grave Situation",
[5035] = "Calling Hakra",
[5036] = "Honrich Tower",
[5037] = "Stem the Tide",
[5038] = "The Truth about Spiders",
[5039] = "Darkvale Brews",
[5040] = "Taking Precautions",
[5043] = "A Higher Priority",
[5044] = "To the Mountain",
[5045] = "The Fate of a Friend",
[5050] = "Waiting for Word",
[5051] = "The Last of Them",
[5052] = "An Offering to Azura",
[5055] = "Missive to the Queen",
[5057] = "Bad Medicine",
[5058] = "All the Fuss",
[5063] = "Stone Cold",
[5067] = "Proprietary Formula",
[5068] = "Quest for the Cure",
[5069] = "The Warrior's Call",
[5071] = "Curinure's Invitation",
[5072] = "Aid for Bramblebreach",
[5073] = "Aicessar's Invitation",
[5074] = "Rudrasa's Invitation",
[5075] = "Hilan's Invitation",
[5076] = "Nemarc's Invitation",
[5077] = "Basile's Invitation",
[5079] = "The Seeker's Archive",
[5080] = "The Flower of Youth",
[5081] = "The Fallen City of Shada",
[5085] = "The Trials of Rahni'Za",
[5087] = "Assaulting the Citadel",
[5088] = "Naemon's Return",
[5091] = "Hallowed To Grimwatch",
[5092] = "The Champions at Rawl'kha",
[5093] = "Moons Over Grimwatch",
[5102] = "The Mage's Tower",
[5103] = "Mournhold Market Misery",
[5104] = "The Shards of Wuuthrad",
[5106] = "Waters Run Foul",
[5107] = "Supreme Power",
[5108] = "Critical Mass",
[5110] = "Gem of the Stars",
[5111] = "Strange Lexicon",
[5112] = "Message Unknown",
[5113] = "Edge of Darkness",
[5115] = "The Missing Guardian",
[5116] = "Elemental Army",
[5118] = "The Reason We Fight",
[5120] = "Return to Ash",
[5130] = "The Shattered and the Lost",
[5136] = "Summary Execution",
[5151] = "The Truer Fangs",
[5171] = "The Oldest Ghost",
[5174] = "Taken Alive",
[5175] = "Iron and Scales",
[5186] = "The Blood of Nirn",
[5194] = "Slithering Brood",
[5203] = "The Serpent's Fang",
[5220] = "Kill Enemy Templars",
[5221] = "Kill Enemy Templars",
[5222] = "Kill Enemy Templars",
[5226] = "Kill Enemy Dragonknights",
[5227] = "Kill Enemy Dragonknights",
[5228] = "Kill Enemy Dragonknights",
[5229] = "Kill Enemy Nightblades",
[5230] = "Kill Enemy Nightblades",
[5231] = "Kill Enemy Nightblades",
[5232] = "Kill Enemy Sorcerers",
[5233] = "Kill Enemy Sorcerers",
[5234] = "Kill Enemy Sorcerers",
[5236] = "Souls of the Betrayed",
[5239] = "Dawn of the Exalted Viper",
[5240] = "Uncaged",
[5244] = "Pledge: Banished Cells I",
[5245] = "Holding Court",
[5246] = "Pledge: Banished Cells II",
[5247] = "Pledge: Fungal Grotto I",
[5248] = "Pledge: Fungal Grotto II",
[5249] = "Blacksmith Certification",
[5258] = "The Time-Lost Warrior",
[5259] = "Crafting Certification",
[5260] = "Pledge: Spindleclutch I",
[5273] = "Pledge: Spindleclutch II",
[5274] = "Pledge: Darkshade Caverns I",
[5275] = "Pledge: Darkshade II",
[5276] = "Pledge: Elden Hollow I",
[5277] = "Pledge: Elden Hollow II",
[5278] = "Pledge: Wayrest Sewers I",
[5282] = "Pledge: Wayrest Sewers II",
[5283] = "Pledge: Crypt of Hearts I",
[5284] = "Pledge: Crypt of Hearts II",
[5288] = "Pledge: Arx Corinium",
[5289] = "Provisioner Certification",
[5290] = "Pledge: City of Ash I",
[5291] = "Pledge: Direfrost Keep",
[5301] = "Pledge: Tempest Island",
[5302] = "Woodworker Certification",
[5303] = "Pledge: Volenfell",
[5305] = "Pledge: Blackheart Haven",
[5306] = "Pledge: Blessed Crucible",
[5307] = "Pledge: Selene's Web",
[5309] = "Pledge: Vaults of Madness",
[5310] = "Clothier Certification",
[5312] = "Taking the Undaunted Pledge",
[5313] = "The Gray Passage",
[5314] = "Enchanter Certification",
[5315] = "Alchemist Certification",
[5316] = "An Unexpected Fall",
[5317] = "Broken Promises",
[5318] = "The Hidden Harvest",
[5319] = "Birdsong's Curse",
[5320] = "The Durzog Whistle",
[5321] = "A Heart of Brass",
[5326] = "Quarry Conundrum",
[5328] = "Hidden History",
[5329] = "For King and Glory",
[5335] = "Silver Linings",
[5337] = "A Question of Succession",
[5340] = "Blood and the Sacred Words",
[5342] = "Planemeld Obverse",
[5348] = "To Save a Chief",
[5349] = "The King's Gambit",
[5352] = "Into the Maw",
[5368] = "Blacksmith Writ",
[5374] = "Clothier Writ",
[5377] = "Blacksmith Writ",
[5381] = "Pledge: City of Ash II",
[5382] = "Pledge: Imperial City Prison",
[5388] = "Clothier Writ",
[5389] = "Clothier Writ",
[5392] = "Blacksmith Writ",
[5394] = "Woodworker Writ",
[5395] = "Woodworker Writ",
[5396] = "Woodworker Writ",
[5400] = "Enchanter Writ",
[5403] = "Sap and Stone",
[5406] = "Enchanter Writ",
[5407] = "Enchanter Writ",
[5409] = "Provisioner Writ",
[5412] = "Provisioner Writ",
[5413] = "Provisioner Writ",
[5415] = "Alchemist Writ",
[5416] = "Alchemist Writ",
[5417] = "Alchemist Writ",
[5418] = "Alchemist Writ",
[5431] = "Pledge: White-Gold Tower",
[5439] = "Draugr Dilemma",
[5441] = "The Hand of Morkul",
[5442] = "Cultural Affections",
[5443] = "Thukhozod the Eternal",
[5444] = "Sorrow's Kiss",
[5445] = "A Treasure in Need of a Home",
[5446] = "Where Loyalty Lies",
[5447] = "A King-Sized Problem",
[5448] = "Maelstrom Arena",
[5449] = "Riekr Revenge",
[5450] = "Invitation to Orsinium",
[5452] = "Corgrak's Cairn",
[5453] = "A Khajiit's Tale",
[5454] = "Kindred Spirits",
[5458] = "In the Name of the King",
[5462] = "The Ashes of Our Fathers",
[5464] = "Forcing the Faith",
[5466] = "Tinker Trouble",
[5468] = "The Anger of a King",
[5469] = "Blood Price",
[5470] = "A Healthy Choice",
[5471] = "Thicker Than Water",
[5472] = "A Feast To Remember",
[5474] = "One Ugly Mug",
[5476] = "Awaken the Past",
[5477] = "The Watcher in the Walls",
[5479] = "A Cold Wind From the Mountain",
[5481] = "Blood on a King's Hands",
[5483] = "The Imperial Standard",
[5484] = "Of Sentimental Value",
[5485] = "Those Truly Favored",
[5487] = "City on the Brink",
[5489] = "The Lock and the Legion",
[5490] = "Knowledge is Power",
[5491] = "Speaking For The Dead",
[5492] = "The Lifeblood of an Empire",
[5493] = "City on the Brink",
[5494] = "Long Live the King",
[5495] = "Priceless Treasures",
[5496] = "City on the Brink",
[5497] = "Atypical Artistry",
[5498] = "Historical Accuracy",
[5499] = "Wrecked",
[5500] = "Dousing the Fires of Industry",
[5501] = "Watch Your Step",
[5504] = "The Skin Trade",
[5505] = "Fire in the Hold",
[5506] = "Scouting the Memorial District",
[5507] = "Breakfast of the Bizarre",
[5508] = "Scouting the Arboretum",
[5509] = "Parts of the Whole",
[5510] = "Scouting the Arena District",
[5511] = "Scouting the Elven Gardens",
[5512] = "Scouting the Nobles District",
[5513] = "Scouting the Temple District",
[5514] = "Getting a Bellyful",
[5515] = "Free Spirits",
[5518] = "Meat for the Masses",
[5519] = "Scholarly Salvage",
[5520] = "Flames of Forge and Fallen",
[5521] = "Nature's Bounty",
[5522] = "Heresy of Ignorance",
[5523] = "Snow and Steam",
[5524] = "Reeking of Foul Play",
[5529] = "Sacrament: Trader's Cove",
[5531] = "Partners in Crime",
[5532] = "The Long Game",
[5534] = "Cleaning House",
[5535] = "A Double Life",
[5536] = "Heist: Deadhollow Halls",
[5537] = "His Greatest Treasure",
[5538] = "Voices in the Dark",
[5540] = "Signed in Blood",
[5541] = "Pious Intervention",
[5542] = "Welcome Home",
[5543] = "Shell Game",
[5544] = "A Profitable Venture",
[5545] = "Prison Break",
[5546] = "Honest Work",
[5547] = "The Vampire's Prey",
[5548] = "Debts of War",
[5549] = "Forever Hold Your Peace",
[5552] = "The Shark's Teeth",
[5553] = "The One That Got Away",
[5554] = "The Dark Moon's Jaws",
[5556] = "A Flawless Plan",
[5565] = "A Secret Shame",
[5566] = "A Faded Flower",
[5567] = "Dark Revelations",
[5569] = "A Cordial Collaboration",
[5570] = "Everyone Has A Price",
[5572] = "Heist: The Hideaway",
[5573] = "Heist: Underground Sepulcher",
[5575] = "Heist: Glittering Grotto",
[5577] = "Heist: Secluded Sewers",
[5581] = "That Which Was Lost",
[5582] = "Master of Heists",
[5584] = "The Covetous Countess",
[5586] = "The Lost Pearls",
[5587] = "Thrall Cove",
[5588] = "Memories of Youth",
[5589] = "The Sailor's Pipe",
[5595] = "A Lesson in Silence",
[5596] = "A Special Request",
[5597] = "A Ghost from the Past",
[5598] = "The Wrath of Sithis",
[5599] = "Questions of Faith",
[5600] = "Filling the Void",
[5602] = "City on the Brink",
[5603] = "Buried Evil",
[5604] = "The Common Good",
[5605] = "Looming Shadows",
[5606] = "The Roar of the Crowds",
[5609] = "Plucking Fingers",
[5634] = "Litany of Blood",
[5636] = "Pledge: Ruins of Mazzatun",
[5637] = "Veteran Maelstrom Arena",
[5638] = "Under Our Thumb",
[5639] = "Idle Hands",
[5645] = "Crime Spree",
[5646] = "Crime Spree",
[5647] = "Crime Spree",
[5654] = "Contract: Auridon",
[5660] = "Contract: Grahtwood",
[5662] = "Contract: Malabal Tor",
[5664] = "The Sweetroll Killer",
[5668] = "The Cutpurse's Craft",
[5671] = "Contract: Grahtwood",
[5672] = "Contract: Grahtwood",
[5673] = "Contract: Greenshade",
[5674] = "Contract: Greenshade",
[5685] = "Contract: Stonefalls",
[5688] = "Contract: Gold Coast Spree",
[5693] = "Contract: Alik'r Desert Spree",
[5694] = "Contract: Auridon Spree",
[5701] = "Contract: Grahtwood Spree",
[5702] = "Silk and Shadow",
[5703] = "Contract: Greenshade Spree",
[5708] = "Contract: Kvatch",
[5710] = "Contract: Stormhaven Spree",
[5718] = "Sacrament: Smuggler's Den",
[5719] = "Sacrament: Smuggler's Den",
[5724] = "Sacrament: Sewer Tenement",
[5725] = "Sacrament: Sewer Tenement",
[5726] = "Sacrament: Sewer Tenement",
[5733] = "Ancient Armaments in Bangkorai",
[5734] = "The Spirit Trap in Malabal Tor",
[5735] = "Ancestor Wards in Deshaan",
[5737] = "Dwarven Relics of Stonefalls",
[5738] = "Ayleid Trinkets in Grahtwood",
[5739] = "Red Rook Ransack in Glenumbra",
[5742] = "The Witchmother's Bargain",
[5744] = "Mascot Theft in Reaper's March",
[5745] = "Molten Pearls of Alik'r Desert",
[5746] = "The Corrupted Stone",
[5747] = "The Star-Gazers",
[5748] = "The Warrior's Call",
[5749] = "The Seeker's Archive",
[5750] = "The Fallen City of Shada",
[5751] = "The Trials of Rahni'Za",
[5755] = "Supreme Power",
[5756] = "Critical Mass",
[5760] = "The Missing Guardian",
[5761] = "Elemental Army",
[5763] = "The Shattered and the Lost",
[5764] = "The Truer Fangs",
[5765] = "Taken Alive",
[5766] = "Iron and Scales",
[5768] = "Slithering Brood",
[5769] = "The Serpent's Fang",
[5770] = "Souls of the Betrayed",
[5771] = "Dawn of the Exalted Viper",
[5772] = "Uncaged",
[5774] = "A Leaf in the Wind",
[5776] = "The Time-Lost Warrior",
[5778] = "Give and Take in Shadowfen",
[5779] = "Icy Intrigue in Eastmarch",
[5780] = "Pledge: Cradle of Shadows",
[5784] = "Dark Anchors in Stormhaven",
[5785] = "Dark Anchors in Rivenspire",
[5786] = "Dark Anchors in Alik'r Desert",
[5787] = "Dark Anchors in Bangkorai",
[5788] = "Dark Anchors in Stonefalls",
[5789] = "Dark Anchors in Deshaan",
[5790] = "Dark Anchors in Shadowfen",
[5792] = "Dark Anchors in the Rift",
[5793] = "Dark Anchors in Auridon",
[5796] = "Dark Anchors in Greenshade",
[5797] = "Dark Anchors in Reaper's March",
[5798] = "Veiled Darkness in Auridon",
[5799] = "A Hireling of House Telvanni",
[5800] = "Cursed Baubles of Stormhaven",
[5802] = "Inflamed Pyres of the Rift",
[5803] = "Divine Conundrum",
[5808] = "Darkness Blooms in Rivenspire",
[5811] = "Snow Bear Plunge",
[5814] = "Madness in Alik'r Desert",
[5816] = "Madness in Auridon",
[5818] = "Madness in Bangkorai",
[5819] = "Madness in Deshaan",
[5820] = "Madness in Eastmarch",
[5822] = "Madness in Glenumbra",
[5823] = "Madness in Grahtwood",
[5824] = "Madness in Greenshade",
[5827] = "Madness in Rivenspire",
[5828] = "Madness in Shadowfen",
[5829] = "Madness in Stonefalls",
[5830] = "Madness in Stormhaven",
[5831] = "Madness in the Rift",
[5832] = "Like Blood from a Stone",
[5833] = "Dark Anchors in Glenumbra",
[5834] = "The Trial of Five-Clawed Guile",
[5835] = "If the Spell Fits",
[5836] = "Bound by Love",
[5837] = "Lava Foot Stomp",
[5838] = "Mud Ball Merriment",
[5839] = "Signal Fire Sprint",
[5840] = "Reclaiming Vos",
[5841] = "At Any Cost",
[5845] = "Castle Charm Challenge",
[5852] = "War Orphan's Sojourn",
[5853] = "Culinary Justice in Greenshade",
[5855] = "Fish Boon Feast",
[5856] = "Stonetooth Bash",
[5857] = "A Smuggler's Last Stand",
[5859] = "Rising to Retainer",
[5862] = "The Scarlet Judge",
[5863] = "Haunted Grounds",
[5864] = "Nothing to Sneeze At",
[5865] = "Culling the Swarm",
[5866] = "Oxen Free",
[5872] = "A Melodic Mistake",
[5876] = "A Dangerous Breed",
[5877] = "An Armiger's Duty",
[5880] = "Divine Inquiries",
[5881] = "A Hidden Harvest",
[5882] = "Ancestral Adversity",
[5883] = "Hatching a Plan",
[5885] = "Ancestral Ties",
[5886] = "The Heart's Desire",
[5887] = "Fleeing the Past",
[5888] = "Divine Delusions",
[5889] = "Blood for Blood",
[5891] = "Falkreath's Demise",
[5893] = "Divine Intervention",
[5894] = "Forging the Future",
[5900] = "Echoes of a Fallen House",
[5901] = "Objections and Obstacles",
[5902] = "Divine Disaster",
[5903] = "The Memory Stone",
[5904] = "Salothan's Curse",
[5905] = "Divine Restoration",
[5906] = "Siren's Song",
[5907] = "Great Zexxin Hunt",
[5908] = "Tarra-Suj Hunt",
[5909] = "Writhing Sveeth Hunt",
[5910] = "Mother Jagged-Claw Hunt",
[5911] = "Ash-Eater Hunt",
[5912] = "Old Stomper Hunt",
[5913] = "King Razor-Tusk Hunt",
[5914] = "The Magister Makes a Move",
[5915] = "Tribal Troubles",
[5916] = "The Anxious Apprentice",
[5918] = "A Creeping Hunger",
[5919] = "Of Faith and Family",
[5920] = "Breaking Through the Fog",
[5921] = "Springtime Flair",
[5922] = "The Heart of a Telvanni",
[5923] = "The Lost Library",
[5924] = "Relics of Yasammidan",
[5925] = "Relics of Assarnatamat",
[5926] = "Relics of Maelkashishi",
[5927] = "Relics of Ashurnabitashpi",
[5928] = "Relics of Ebernanit",
[5929] = "Relics of Dushariran",
[5930] = "Relics of Ashalmawia",
[5931] = "A Noble Guest",
[5933] = "A Purposeful Writ",
[5934] = "Tax Deduction",
[5935] = "The Missing Prophecy",
[5936] = "Ache for Cake",
[5937] = "Royal Revelry",
[5941] = "The Jester's Festival",
[5948] = "Family Reunion",
[5949] = "For Glory",
[5950] = "The Ancestral Tombs",
[5952] = "To the Victor",
[5953] = "Let the Games Begin",
[5954] = "Test of Mettle",
[5956] = "Daedric Disruptions",
[5958] = "Unsettled Syndicate",
[5961] = "Planting Misinformation",
[5962] = "Kwama Conundrum",
[5964] = "A Web of Troubles",
[5972] = "A Masterful Weapon",
[5973] = "A Masterful Glyph",
[5974] = "A Masterful Plate",
[5975] = "A Masterful Weapon",
[5976] = "A Masterful Shield",
[5977] = "A Masterful Feast",
[5978] = "Masterful Tailoring",
[5979] = "Masterful Leatherwear",
[5980] = "A Masterful Concoction",
[5981] = "A Masterful Concoction",
[5982] = "A Masterful Concoction",
[5983] = "A Masterful Concoction",
[5984] = "A Masterful Concoction",
[5985] = "A Masterful Concoction",
[5986] = "A Masterful Concoction",
[5987] = "A Masterful Concoction",
[5988] = "A Masterful Concoction",
[5989] = "A Masterful Concoction",
[5990] = "A Masterful Concoction",
[6000] = "To Tel Fyr",
[6003] = "Divine Blessings",
[6004] = "A Late Delivery",
[6007] = "A Call For Aid",
[6008] = "Ashlander Relations",
[6010] = "Kill Enemy Wardens",
[6011] = "Kill Enemy Wardens",
[6012] = "Kill Enemy Wardens",
[6014] = "Midyear Mayhem",
[6016] = "A Masterful Weapon",
[6017] = "A Masterful Glyph",
[6018] = "A Masterful Plate",
[6019] = "A Masterful Weapon",
[6020] = "A Masterful Shield",
[6021] = "Masterful Tailoring",
[6022] = "Masterful Leatherwear",
[6023] = "Of Knives and Long Shadows",
[6024] = "Glitter and Gleam",
[6025] = "Deepening Shadows",
[6036] = "Most Complicated Machine",
[6037] = "Fuel for our Fires",
[6038] = "A Daily Grind",
[6039] = "Loose Strands",
[6040] = "A Sticky Solution",
[6041] = "Enchanted Accumulation",
[6042] = "A Bitter Pill",
[6045] = "Oasis in a Metal Desert",
[6046] = "Unto the Dark",
[6047] = "Where Shadows Lie",
[6048] = "The Light of Knowledge",
[6049] = "The Shadow Cleft",
[6050] = "To The Clockwork City",
[6052] = "Lost in the Gloam",
[6054] = "Pledge: Falkreath Hold",
[6056] = "The Astronomer's Apprentice",
[6057] = "In Search of a Sponsor",
[6058] = "The Halls of Regulation",
[6059] = "Tarnished Truffles",
[6060] = "Tasty Tongue Varnish",
[6061] = "A Matter of Tenderness",
[6063] = "The Strangeness of Seht",
[6064] = "Casting the Bones",
[6065] = "Plans of Pestilence",
[6066] = "The Precursor",
[6073] = "A Shadow Misplaced",
[6074] = "Cogs of Fate",
[6075] = "The Oscillating Son",
[6076] = "Inciting the Imperfect",
[6077] = "A Fine-Feathered Foe",
[6078] = "Family Feud",
[6079] = "Again Into the Shadows",
[6080] = "A Shadow Malfunction",
[6081] = "Oiling the Fans",
[6082] = "The Sickening Sea",
[6083] = "Taming the Wild",
[6084] = "The Abyssal Alchemist",
[6085] = "Birds of a Feather",
[6086] = "Never Forgotten",
[6087] = "Run Aground",
[6088] = "Changing the Filters",
[6089] = "Replacing the Commutators",
[6090] = "Saints' Mercy",
[6092] = "The Merchant's Heirloom",
[6093] = "The Mage's Dog",
[6094] = "The Broken Brassilisk",
[6095] = "The Registrar's Request",
[6096] = "The Queen's Decree",
[6097] = "Through a Veil Darkly",
[6098] = "Alchemist Writ",
[6099] = "Alchemist Writ",
[6100] = "Alchemist Writ",
[6101] = "Alchemist Writ",
[6102] = "Alchemist Writ",
[6103] = "Alchemist Writ",
[6104] = "Alchemist Writ",
[6105] = "Alchemist Writ",
[6109] = "The Dreaming Cave",
[6111] = "Murder In Lillandril",
[6112] = "A Pearl of Great Price",
[6113] = "Lost in Translation",
[6114] = "Manor of Masques",
[6115] = "Illusions of Grandeur",
[6116] = "A Tale of Two Mothers",
[6117] = "The Taste of Fear",
[6118] = "Lauriel's Lament",
[6119] = "The Ebon Sanctum",
[6121] = "Untamed and Unleashed",
[6125] = "A Necessary Alliance",
[6126] = "The Crystal Tower",
[6127] = "Half-Formed Understandings",
[6129] = "The Perils of Art",
[6130] = "Room to Spare",
[6131] = "Storming the Walls",
[6132] = "Buried Memories",
[6134] = "The New Life Festival",
[6135] = "Old Wounds",
[6136] = "The Vault of Moawita",
[6137] = "Looting the Light",
[6138] = "Savage Truths",
[6139] = "The Hulkynd's Heart",
[6140] = "Bantering with Bandits",
[6141] = "Culture Clash",
[6142] = "The Tower Sentinels",
[6144] = "Pearls Before Traitors",
[6145] = "The Runaway's Tale",
[6146] = "Wasting Away",
[6149] = "Lost at Sea",
[6150] = "Sunhold Sundered",
[6151] = "A Duelist's Dilemma",
[6152] = "Pilgrimage's End",
[6153] = "A New Alliance",
[6154] = "Pledge: Scalecaller Peak",
[6155] = "Pledge: Fang Lair",
[6156] = "Snuffing Out the Light",
[6157] = "A Rose's Beauty",
[6158] = "Relic Runaround",
[6159] = "Culling Serpents",
[6160] = "Struck from Memory",
[6162] = "An Unexpected Betrayal",
[6165] = "The Abyssal Cabal",
[6166] = "Sinking Summerset",
[6170] = "Divine Deputation",
[6171] = "Jewelry Crafting Certification",
[6172] = "The Psijics' Calling",
[6174] = "Whispers from the Deep",
[6175] = "Lost Libations",
[6176] = "His Final Gift",
[6177] = "Gjadil's Legacy",
[6178] = "The Forest Vandal",
[6179] = "Gryphon Grievance",
[6180] = "Obedience Issues",
[6181] = "Breaches On the Bay",
[6185] = "Breaches of Frost and Fire",
[6187] = "Pledge: Moon Hunter Keep",
[6188] = "The Great Hunt",
[6189] = "Pledge: March of Sacrifices",
[6190] = "A Time for Mud and Mushrooms",
[6192] = "Woe of the Welkynars",
[6193] = "Checking on Cloudrest",
[6194] = "A Breach Amid the Trees",
[6195] = "Time in Doomcrag's Shadow",
[6196] = "A Breach Beyond the Crags",
[6197] = "The Shattered Staff",
[6198] = "The Towers' Remains",
[6199] = "The Towers' Fall",
[6202] = "Sinking Summerset",
[6207] = "Capture All 3 Towns",
[6208] = "Capture Any Nine Resources",
[6209] = "Kill 40 Enemy Players",
[6212] = "Capture All 3 Towns",
[6213] = "Kill 40 Enemy Players",
[6214] = "Capture Any Three Keeps",
[6217] = "Kill 40 Enemy Players",
[6218] = "Jewelry Crafting Writ",
[6226] = "Ruthless Competition",
[6227] = "Jewelry Crafting Writ",
[6228] = "Jewelry Crafting Writ",
[6233] = "Grave Circumstances",
[6234] = "Old Growth",
[6235] = "Old Baubles",
[6236] = "Grave Expectations",
[6238] = "Old Enemies",
[6239] = "She Who Eats the Light",
[6240] = "The Lost Legion",
[6241] = "Whispers in the Wood",
[6242] = "The Cursed Skull",
[6243] = "The Swamp and the Serpent",
[6244] = "The Remnant of Argon",
[6245] = "By River and Root",
[6246] = "Sunken Treasure",
[6247] = "The Weight of Words",
[6248] = "Old Scrolls",
[6249] = "Lock and Keystone",
[6250] = "Pledge: Frostvault",
[6251] = "The Guiding Light",
[6252] = "Pledge: Depths of Malatar",
[6253] = "Antique Armor",
[6254] = "Death Among the Dead-Water",
[6255] = "Anti-Venom Agitation",
[6256] = "Reeling in Recruits",
[6257] = "Bug Off!",
[6258] = "Empty Nest",
[6259] = "Death and Dreaming",
[6260] = "Salty Meats",
[6261] = "The Winds of Kyne",
[6263] = "A Taste for Toxins",
[6264] = "Sacred Candles",
[6265] = "The Sounds of Home",
[6266] = "Missing in Murkmire",
[6267] = "Tools of Slaughter",
[6268] = "Grave Subject Matter",
[6269] = "The Black Gauntlet",
[6270] = "Monument of Change",
[6271] = "Ritual of Change",
[6275] = "Frog Totem Turnaround",
[6276] = "Lost in Murkmire",
[6277] = "The Assassin's Arbitration",
[6278] = "The Burnt Branch",
[6279] = "The Skin Taker",
[6280] = "Art of the Nisswo",
[6281] = "Swamp Jelly Sonata",
[6282] = "A Life in Carvings",
[6284] = "Something About Stibbons",
[6286] = "Aloe That Heals",
[6287] = "Mushrooms That Nourish",
[6288] = "Envoys Who Cower",
[6289] = "Offerings That Hide",
[6290] = "Leather That Protects",
[6293] = "Unsuitable Suitors",
[6295] = "Death-Hunts",
[6296] = "The Battle for Riverhold",
[6297] = "The Final Order",
[6299] = "The Demon Weapon",
[6300] = "Iron in the Blood",
[6301] = "Preserving the Prowl",
[6302] = "Scars of the Past",
[6303] = "In Sickness and In Health",
[6304] = "Two Queens",
[6305] = "Cadwell the Betrayer",
[6306] = "The Halls of Colossus",
[6307] = "Descendant of the Potentate",
[6308] = "Thick as Thieves",
[6310] = "The Lunacy of Two Moons",
[6311] = "The Riverhold Abduction",
[6312] = "Strange Messengers",
[6313] = "Hunting the Hunters",
[6314] = "Scariest in Show",
[6315] = "Jode's Core",
[6316] = "Blood and Tears",
[6317] = "Moonstruck in Manacles",
[6318] = "Dark Souls, Mighty Weapons",
[6319] = "The Song of Kingdoms",
[6321] = "The Witch of Azurah",
[6322] = "Path of the Hidden Moon",
[6323] = "The Moonlight Blade",
[6324] = "Bright Moons, Warm Sands",
[6325] = "Home Sweet Home",
[6326] = "An Animal's Grim Abode",
[6327] = "A Charitable Contribution",
[6328] = "The Heir of Anequina",
[6334] = "A Charitable Contribution",
[6336] = "A Rage of Dragons",
[6338] = "The Usurper Queen",
[6341] = "Skeleton Demonstration",
[6342] = "Goblin Demonstration",
[6343] = "Lurcher Demonstration",
[6344] = "Lamia Demonstration",
[6345] = "Dragon Lore: Stormcrag Crypt",
[6347] = "Dragon Lore: Shroud Hearth",
[6348] = "In Defense of Elsweyr",
[6349] = "The Sanguine Successor",
[6350] = "Pledge: Moongrave Fane",
[6351] = "The Azure Blight",
[6352] = "Pledge: Lair of Maarselok",
[6353] = "The Return of Alkosh",
[6354] = "Sunspire Summons",
[6355] = "Relatively Speaking",
[6356] = "Dousing the Daedric Flame",
[6357] = "Dragon Hunt",
[6358] = "Unhealthy Preoccupation",
[6359] = "Wisdom in the Winds",
[6360] = "Rifling Through Ruins",
[6361] = "The Hungry Cat's Favor",
[6362] = "The Serpent's Stampede",
[6363] = "Tangled Tea Leaves",
[6364] = "Sweet Rotmeth Brew",
[6365] = "The Jewel of Baan Dar",
[6366] = "Beware the Purring Liar",
[6370] = "Ache for Cake",
[6371] = "Cross-cultural Confusion",
[6373] = "Chaos Magic",
[6374] = "Love and Guar",
[6375] = "The Connoisseur",
[6376] = "Goutfang Pariah",
[6377] = "Sword of the Serpent",
[6378] = "The Traders' Terror",
[6379] = "A Waking Nightmare",
[6380] = "Another Day, Another Death",
[6381] = "A Dastardly Duo",
[6382] = "The Senche of Decay",
[6384] = "Dragon Hunt",
[6389] = "Ruddy Fang Retrieval",
[6390] = "Kill Enemy Necromancers",
[6391] = "Kill Enemy Necromancers",
[6392] = "Kill Enemy Necromancers",
[6393] = "The Dark Aeon",
[6394] = "Uneasy Alliances",
[6395] = "The Dragonguard's Legacy",
[6396] = "Chiaroscuro Crossroads",
[6397] = "New Moon Rising",
[6398] = "The Horn of Ja'darri",
[6399] = "Order of the New Moon",
[6400] = "A Childhood in Flames",
[6401] = "The Dragon's Lair",
[6402] = "The Pride of Elsweyr",
[6403] = "The Pride of Alkosh",
[6404] = "The Dragonguard",
[6405] = "Taking Them to Tusk",
[6406] = "A Lonely Grave",
[6407] = "Masterpieces",
[6408] = "The Deadliest Prey",
[6409] = "Reformation",
[6412] = "Skooma Sequela",
[6413] = "Another Khajiit's Tale",
[6415] = "Pledge: Icereach",
[6416] = "Unhallowed Grave",
[6417] = "Pledge: Unhallowed Grave",
[6418] = "Dreams of the Forsaken",
[6419] = "Tomes of the Tsaesci",
[6420] = "In Defense of Pellitine",
[6421] = "Helping the Healers",
[6422] = "A Rogue and His Rice",
[6423] = "Dust Smote",
[6425] = "Fletching Fetching",
[6427] = "Witches Festival Writ",
[6428] = "Sticks and Bones",
[6429] = "Digging Up the Garden",
[6430] = "File Under D",
[6431] = "Sourcing the Ensorcelled",
[6432] = "Solace By Candlelight",
[6433] = "Rude Awakening",
[6434] = "The Dragonguard's Quarry",
[6435] = "The Dragonguard's Quarry",
[6436] = "Lilies for Remembrance",
[6437] = "Moonlit Mushrooms",
[6438] = "An Answer in Blood",
[6439] = "Witches Festival Writ",
[6441] = "Song of the Sand-Whale",
[6442] = "Little Lost Cat",
[6444] = "Dawn of the Dragonguard",
[6447] = "Out of Murkmire",
[6448] = "The Herbalist's Product",
[6449] = "Take Your Lumps",
[6451] = "Masterful Jewelry",
[6454] = "The Coven Conspiracy",
[6455] = "Bound in Blood",
[6456] = "The Gray Host",
[6459] = "Long Journey Home",
[6460] = "Of Ice and Death",
[6461] = "Hounds of Hircine",
[6462] = "Danger in the Holds",
[6463] = "The Coven Conundrum",
[6464] = "Greymoor Rising",
[6465] = "Meridia's Brilliance",
[6466] = "The Vampire Scholar",
[6467] = "The Gathering Storm",
[6468] = "The Blood of Old Karth",
[6469] = "Orchestrations",
[6471] = "Digging Up Trouble",
[6472] = "The Lady of Blood",
[6473] = "Crisis at Dragon Bridge",
[6474] = "The Mountain Bellows",
[6475] = "Prisoner of the Past",
[6476] = "Dark Clouds Over Solitude",
[6480] = "One Last Adventure",
[6481] = "Daughter of the Wolf",
[6482] = "A Salskap to Remember",
[6484] = "A Clan Divided",
[6485] = "A Charitable Contribution",
[6487] = "A Charitable Contribution",
[6489] = "A Charitable Contribution",
[6491] = "Poison's Sting",
[6492] = "Soldiers of Fortune and Glory",
[6493] = "The Strength of Giants",
[6494] = "A Trail Gone Cold",
[6495] = "The Preservation of Life",
[6496] = "The Fate of the Frozen",
[6497] = "The Tones of the Deep",
[6498] = "Spellbound",
[6499] = "Scraps Matter",
[6500] = "The Fading Fire",
[6501] = "Cultural Conciliation",
[6503] = "The Fight for Kyne's Aegis",
[6504] = "Reinforcement for Kyne's Aegis",
[6505] = "Method and Madness",
[6506] = "Pledge: Stone Garden",
[6507] = "Blood of the Past",
[6509] = "Lost Along the Shore",
[6510] = "The Maelmoth Mysterium",
[6512] = "Halt the Harrowstorms",
[6513] = "The Pale Man",
[6514] = "The Antiquarian Circle",
[6515] = "The Antiquarian's Art",
[6516] = "The Aspiring Scholar",
[6517] = "Moonlight Kidnapping",
[6518] = "Circle of Cheaters",
[6519] = "Mother of Shadows",
[6520] = "Precious Bark",
[6523] = "Dwemer Disassembly",
[6524] = "Spiritual Release",
[6526] = "Feasting in the Dark",
[6527] = "Problem Growth",
[6528] = "Halt the Harrowstorms",
[6532] = "Guild Listings",
[6533] = "Kelbarn's Mining Samples",
[6534] = "Inguya's Mining Samples",
[6535] = "Reeh-La's Mining Samples",
[6536] = "Ghamborz's Mining Samples",
[6537] = "Potent Poison",
[6538] = "Adanzda's Mining Samples",
[6547] = "The Study of Souls",
[6548] = "The Awakening Darkness",
[6549] = "The Ravenwatch Inquiry",
[6550] = "The Despot of Markarth",
[6551] = "Blood of the Reach",
[6552] = "The End of Eternity",
[6553] = "Help Wanted in Markarth",
[6554] = "The Dark Heart",
[6555] = "The Gray Council",
[6556] = "Namira's Perversions",
[6557] = "Wild Talismans",
[6558] = "Halt the Harrowstorms",
[6559] = "Halt the Harrowstorms",
[6560] = "Kingdom of Ash",
[6561] = "Veteran Vateshran's Rites",
[6562] = "Lost in the Reach",
[6563] = "After the Storm",
[6564] = "Glory of the Undaunted",
[6565] = "By Love Betrayed",
[6566] = "A Feast of Souls",
[6567] = "The Tainted Briarheart",
[6569] = "What's Hers is Ours",
[6570] = "Second Chances",
[6571] = "Magic Mycology",
[6572] = "Strange Contamination",
[6573] = "Unhatched Menace",
[6575] = "Endeavor in the Gloom",
[6576] = "Burning Secrets",
[6578] = "Into the Deep",
[6581] = "Notes of the Void",
[6582] = "Ruptures in the Reach",
[6583] = "The Scholar's Request",
[6584] = "Guides to the Deep",
[6585] = "Discarded Treasures",
[6586] = "Betrayal at Briar Rock",
[6588] = "Old Life Observance",
[6589] = "Red Eagle's Song",
[6591] = "The Lost Scout's Report",
[6592] = "A Charitable Contribution",
[6593] = "A Charitable Contribution",
[6594] = "A Charitable Contribution",
[6595] = "A Charitable Contribution",
[6596] = "The Symbol of Hrokkibeg",
[6597] = "A Challenge of Worth",
[6598] = "The Symbol of Gulibeg",
[6599] = "The Symbol of Storihbeg",
[6601] = "To Burn Away Evil",
[6602] = "The Light of Arkthzand",
[6603] = "Alone in the Dark",
[6604] = "Defenders of the Reach",
[6609] = "The Symbol of Uricanbeg",
}
|
local cqueues = require'cqueues'
cqueues.socket = require'cqueues.socket'
local protocol = require'redis-client.protocol'
local response = require'redis-client.response'
local server = cqueues.socket.listen{ host = '127.0.0.1', port = '0' }
local _, host, port = server:localname()
local M = {
host = host,
port = port,
}
local function encode_response(data)
local data_type
if type(data) == 'table' then
data_type = data.type
end
if data_type then
data = data.data
end
if data_type == response.STATUS then
return ('+%s\r\n'):format(data or '')
elseif data_type == response.ERROR then
return ('-%s\r\n'):format(data or '')
elseif data_type == response.INT or (not data_type and type(data) == 'number') then
return (':%d\r\n'):format(data or 0)
elseif data_type == response.STRING or (not data_type and type(data) == 'string') then
if not data then
return '$-1\r\n'
else
return ('$%d\r\n%s\r\n'):format(#data, data)
end
elseif data_type == response.ARRAY or (not data_type and type(data) == 'table') then
if not data then
return '*-1\r\n'
else
local resp = ('*%d\r\n'):format(#data)
for _,v in ipairs(data) do
resp = resp .. encode_response(v)
end
return resp
end
end
return '-ERR Invalid response'
end
function M.listen(script)
local conn = server:accept()
conn:setmode('b', 'b')
conn:setvbuf('full', math.huge)
conn:onerror(function() return nil end)
local command = protocol.read_response(conn)
while command do
local resp = table.remove(script or {}, 1)
if not resp then
break
end
conn:write(encode_response(resp))
command = protocol.read_response(conn)
end
conn:close()
end
return M
|
local CorePackages = game:GetService("CorePackages")
local InGameMenuDependencies = require(CorePackages.InGameMenuDependencies)
local t = InGameMenuDependencies.t
local Roact = InGameMenuDependencies.Roact
local CloseMenuButton = require(script.Parent.CloseMenuButton)
local GameIconButton = require(script.Parent.GameIconButton)
local SystemMenuButton = Roact.PureComponent:extend("SystemMenuButton")
SystemMenuButton.validateProps = t.strictInterface({
on = t.optional(t.boolean),
anchorPoint = t.optional(t.Vector2),
position = t.optional(t.UDim2),
layoutOrder = t.optional(t.integer),
onActivated = t.callback,
onClose = t.callback,
})
SystemMenuButton.defaultProps = {
on = false,
}
function SystemMenuButton:render()
local systemMenuOn = self.props.on
if systemMenuOn then
return Roact.createElement(CloseMenuButton, {
onActivated = self.props.onClose,
layoutOrder = self.props.layoutOrder,
AnchorPoint = self.props.anchorPoint,
Position = self.props.position,
})
else
return Roact.createElement(GameIconButton, {
onActivated = self.props.onActivated,
layoutOrder = self.props.layoutOrder,
anchorPoint = self.props.anchorPoint,
position = self.props.position,
})
end
end
return SystemMenuButton
|
function updateTooltipPosition( _,_, x, y )
guiSetPosition( label, x + 8, y + 10, false );
guiBringToFront( label );
end
function changeNOSGaugePosition( _, btnState, x, y )
if btnState == "down" then
g_tGaugePosition[ 1 ] = x - 50;
g_tGaugePosition[ 2 ] = y - 50;
end
end
function saveGaugePositionToFile( )
local xml = xmlCreateFile( "gauge_pos.xml", "gauge" );
if xml then
local posNode = xmlCreateChild( xml, "position" );
xmlNodeSetAttribute( posNode, "x", g_tGaugePosition[ 1 ] );
xmlNodeSetAttribute( posNode, "y", g_tGaugePosition[ 2 ] );
xmlSaveFile( xml );
return
end
outputDebugString( "Coundn't save gauge position." );
end
function loadGaugePositionFromFile( )
local xml = xmlLoadFile( "gauge_pos.xml" );
if xml then
local posNode = xmlFindChild( xml, "position", 0 );
g_tGaugePosition[ 1 ] = xmlNodeGetAttribute( posNode, "x" );
g_tGaugePosition[ 2 ] = xmlNodeGetAttribute( posNode, "y" );
xmlUnloadFile( xml );
return true;
end
end
function letMePositionGauge( )
if isEditingPosition then
isEditingPosition = false;
showCursor( false );
guiSetVisible( label, false );
removeEventHandler( "onClientCursorMove", g_Root, updateTooltipPosition );
removeEventHandler( "onClientClick", g_Root, changeNOSGaugePosition );
saveGaugePositionToFile( );
return;
end
if not isEditingPosition then
isEditingPosition = true;
showCursor( true );
local x, y = getCursorPosition( );
x, y = x * g_tScreenSize[ 1 ], y * g_tScreenSize[ 2 ];
guiSetPosition( label, x, y, false );
guiSetVisible( label, true );
addEventHandler( "onClientCursorMove", g_Root, updateTooltipPosition );
addEventHandler( "onClientClick", g_Root, changeNOSGaugePosition );
end
end
|
local subst = require 'pl.template'.substitute
local List = require 'pl.List'
local asserteq = require 'pl.test'.asserteq
asserteq(subst([[
# for i = 1,2 do
<p>Hello $(tostring(i))</p>
# end
]],_G),[[
<p>Hello 1</p>
<p>Hello 2</p>
]])
asserteq(subst([[
<ul>
# for name in ls:iter() do
<li>$(name)</li>
#end
</ul>
]],{ls = List{'john','alice','jane'}}),[[
<ul>
<li>john</li>
<li>alice</li>
<li>jane</li>
</ul>
]])
-- can change the default escape from '#' so we can do C/C++ output.
-- note that the environment can have a parent field.
asserteq(subst([[
> for i,v in ipairs{'alpha','beta','gamma'} do
cout << obj.${v} << endl;
> end
]],{_parent=_G, _brackets='{}', _escape='>'}),[[
cout << obj.alpha << endl;
cout << obj.beta << endl;
cout << obj.gamma << endl;
]])
|
local trigger = {}
trigger.name = "ExtendedVariantMode/DashDirectionTrigger"
trigger.placements = {
name = "trigger",
data = {
revertOnLeave = false,
revertOnDeath = true,
delayRevertOnDeath = false,
withTeleport = false,
topLeft = true,
top = true,
topRight = true,
left = true,
right = true,
bottomLeft = true,
bottom = true,
bottomRight = true,
coversScreen = false,
flag = "",
flagInverted = false,
onlyOnce = false
}
}
trigger.fieldOrder = { "x", "y", "width", "height", "topLeft", "top", "topRight", "left", "right", "bottomLeft", "bottom", "bottomRight" }
return trigger
|
-- I had to include it. It's easy to implement, so why not.
--[[
local rot13 = function(msg)
return (msg:gsub(".", function(c)
local l = bit32.btest(c:byte(), 32) and 97 or 65
return c:upper() == c:lower() and c or c.char((c:byte()-l+13)%26+l)
end))
end
]]
local ASSERTIONS_ENABLED = true -- Whether to run several checks when the module is first loaded
local CHARACTER_MAP = {
["A"] = "N", ["B"] = "O", ["C"] = "P", ["D"] = "Q", ["E"] = "R", ["F"] = "S", ["G"] = "T", ["H"] = "U",
["I"] = "V", ["J"] = "W", ["K"] = "X", ["L"] = "Y", ["M"] = "Z", ["N"] = "A", ["O"] = "B", ["P"] = "C",
["Q"] = "D", ["R"] = "E", ["S"] = "F", ["T"] = "G", ["U"] = "H", ["V"] = "I", ["W"] = "J", ["X"] = "K",
["Y"] = "L", ["Z"] = "M", ["a"] = "n", ["b"] = "o", ["c"] = "p", ["d"] = "q", ["e"] = "r", ["f"] = "s",
["g"] = "t", ["h"] = "u", ["i"] = "v", ["j"] = "w", ["k"] = "x", ["l"] = "y", ["m"] = "z", ["n"] = "a",
["o"] = "b", ["p"] = "c", ["q"] = "d", ["r"] = "e", ["s"] = "f", ["t"] = "g", ["u"] = "h", ["v"] = "i",
["w"] = "j", ["x"] = "k", ["y"] = "l", ["z"] = "m",
}
local function rot13(msg)
return (string.gsub(msg, "%a", CHARACTER_MAP))
end
if ASSERTIONS_ENABLED then
assert(rot13("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") == "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm", "Full alphabet failed to shift properly")
assert(rot13("NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm") == "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", "Shifted full alphabet failed to shift properly")
assert(rot13("I am running out of memes. Sorry! D:") == "V nz ehaavat bhg bs zrzrf. Fbeel! Q:", "Running out of memes message failed to shift properly")
end
return rot13 |
return recursivedtrequire("systems", "systems") |
-------------------------------------------------------
-- nacl-cli
-- Written by Erik Poupaert, Cambodia
-- (c) 2018
-- Licensed under the LGPL
-------------------------------------------------------
local util={}
-- The origin of this function is a comment on stackoverflow
-- It was contributed by its author to the public domain
util.count=function(table)
local n = 0
for k,v in pairs(table) do
n=n+1
end
return n
end
return util
|
MathUtils = { }
function MathUtils:getShortUid()
return CS.LuaExtend.getSUID()
end
function MathUtils:getLongUid()
return CS.LuaExtend.getLUID()
end |
local h = {}
local u = require'bfredl.util'
local a = u.a
function h.clint(bufnr)
name = a.buf_get_name(bufnr)
--
local path, fname = u.splitlast(name, 'src/nvim/')
local makename = 'touches/ran-clint-'..fname:gsub("[/.]","-")
vim.bo[bufnr].makeprg = 'ninja'
vim.cmd ("make -C "..path.."build/ "..makename)
end
_G.h = h
return h
|
--Not the hatloader mod.
function loadhat(path)
local s = love.filesystem.read(path)
if not s then
return
end
local s1 = s:split("|")
if #s1 ~= 8 then
return
end
if not love.filesystem.exists("hats/" .. s1[7] .. ".png") or not love.filesystem.exists("hats/" .. s1[8] .. ".png") then
return
end
table.insert(hat, {x = s1[1], y = s1[2], height = s1[3], graphic = love.graphics.newImage("hats/" .. s1[7] .. ".png")})
table.insert(bighat, {x = s1[4], y = s1[5], height = s1[6], graphic = love.graphics.newImage("hats/" .. s1[8] .. ".png")})
hatcount = hatcount + 1
end
local files = love.filesystem.getDirectoryItems("hats")
for i, v in pairs(files) do
if string.sub(v, -3, -1) == "txt" then
loadhat("hats/" .. v)
end
end
|
local assets=
{
Asset("ANIM", "anim/pan_flute.zip"),
}
local function onfinished(inst)
inst:Remove()
end
local function HearPanFlute(inst, musician, instrument)
if inst.components.sleeper then
inst.components.sleeper:AddSleepiness(10, TUNING.PANFLUTE_SLEEPTIME, inst)
end
end
local function fn(Sim)
local inst = CreateEntity()
inst.entity:AddTransform()
inst.entity:AddAnimState()
inst:AddTag("flute")
inst.AnimState:SetBank("pan_flute")
inst.AnimState:SetBuild("pan_flute")
inst.AnimState:PlayAnimation("idle")
MakeInventoryPhysics(inst)
inst:AddComponent("inspectable")
inst:AddComponent("instrument")
inst.components.instrument.range = TUNING.PANFLUTE_SLEEPRANGE
inst.components.instrument:SetOnHeardFn(HearPanFlute)
inst:AddComponent("tool")
inst.components.tool:SetAction(ACTIONS.PLAY)
inst:AddComponent("finiteuses")
inst.components.finiteuses:SetMaxUses(TUNING.PANFLUTE_USES)
inst.components.finiteuses:SetUses(TUNING.PANFLUTE_USES)
inst.components.finiteuses:SetOnFinished( onfinished)
inst.components.finiteuses:SetConsumption(ACTIONS.PLAY, 1)
inst:AddComponent("inventoryitem")
return inst
end
return Prefab( "common/inventory/panflute", fn, assets)
|
return
{
HOOK_PLAYER_BREAKING_BLOCK =
{
CalledWhen = "Just before a player breaks a block. Plugin may override / refuse. ",
DefaultFnName = "OnPlayerBreakingBlock", -- also used as pagename
Desc = [[
This hook is called when a {{cPlayer|player}} breaks a block, before the block is actually broken in
the {{cWorld|World}}. Plugins may refuse the breaking.</p>
<p>
See also the {{OnPlayerBrokenBlock|HOOK_PLAYER_BROKEN_BLOCK}} hook for a similar hook called after
the block is broken.
]],
Params =
{
{ Name = "Player", Type = "{{cPlayer}}", Notes = "The player who is digging the block" },
{ Name = "BlockX", Type = "number", Notes = "X-coord of the block" },
{ Name = "BlockY", Type = "number", Notes = "Y-coord of the block" },
{ Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" },
{ Name = "BlockFace", Type = "number", Notes = "Face of the block upon which the player is acting. One of the BLOCK_FACE_ constants" },
{ Name = "BlockType", Type = "BLOCKTYPE", Notes = "The block type of the block being broken" },
{ Name = "BlockMeta", Type = "NIBBLETYPE", Notes = "The block meta of the block being broken " },
},
Returns = [[
If the function returns false or no value, other plugins' callbacks are called, and then the block
is broken. If the function returns true, no other plugin's callback is called and the block breaking
is cancelled. The server re-sends the block back to the player to replace it (the player's client
already thinks the block was broken).
]],
}, -- HOOK_PLAYER_BREAKING_BLOCK
}
|
--[[--
Physical representation of connected player.
`Player`s are a type of `Entity`. They are a physical representation of a `Character` - and can possess at most one `Character`
object at a time that you can interface with.
See the [Garry's Mod Wiki](https://wiki.garrysmod.com/page/Category:Player) for all other methods that the `Player` class has.
]]
-- @classmod Player
local meta = FindMetaTable("Player")
if (SERVER) then
--- Returns the amount of time the player has played on the server.
-- @realm shared
-- @treturn number Number of seconds the player has played on the server
function meta:GetPlayTime()
return self.ixPlayTime + (RealTime() - (self.ixJoinTime or RealTime()))
end
else
ix.playTime = ix.playTime or 0
function meta:GetPlayTime()
return ix.playTime + (RealTime() - ix.joinTime or 0)
end
end
--- Returns `true` if the player has their weapon raised.
-- @realm shared
-- @treturn bool Whether or not the player has their weapon raised
function meta:IsWepRaised()
return self:GetNetVar("raised", false)
end
--- Returns `true` if the player is restricted - that is to say that they are considered "bound" and cannot interact with
-- objects normally (e.g hold weapons, use items, etc). An example of this would be a player in handcuffs.
-- @realm shared
-- @treturn bool Whether or not the player is restricted
function meta:IsRestricted()
return self:GetNetVar("restricted", false)
end
--- Returns `true` if the player is able to shoot their weapon.
-- @realm shared
-- @treturn bool Whether or not the player can shoot their weapon
function meta:CanShootWeapon()
return self:GetNetVar("canShoot", true)
end
local vectorLength2D = FindMetaTable("Vector").Length2D
--- Returns `true` if the player is running. Running in this case means that their current speed is greater than their
-- regularly set walk speed.
-- @realm shared
-- @treturn bool Whether or not the player is running
function meta:IsRunning()
return vectorLength2D(self:GetVelocity()) > (self:GetWalkSpeed() + 10)
end
--- Returns `true` if the player currently has a female model. This checks if the model has `female`, `alyx` or `mossman` in its
-- name, or if the player's model class is `citizen_female`.
-- @realm shared
-- @treturn bool Whether or not the player has a female model
function meta:IsFemale()
local model = self:GetModel():lower()
return (model:find("female") or model:find("alyx") or model:find("mossman")) != nil or
ix.anim.GetModelClass(model) == "citizen_female"
end
--- Whether or not this player is stuck and cannot move.
-- @realm shared
-- @treturn bool Whether or not this player is stuck
function meta:IsStuck()
return util.TraceEntity({
start = self:GetPos(),
endpos = self:GetPos(),
filter = self
}, self).StartSolid
end
--- Returns a good position in front of the player for an entity to be placed. This is usually used for item entities.
-- @realm shared
-- @entity entity Entity to get a position for
-- @treturn vector Best guess for a good drop position in front of the player
-- @usage local position = client:GetItemDropPos(entity)
-- entity:SetPos(position)
function meta:GetItemDropPos(entity)
local data = {}
local trace
data.start = self:GetShootPos()
data.endpos = self:GetShootPos() + self:GetAimVector() * 86
data.filter = self
if (IsValid(entity)) then
-- use a hull trace if there's a valid entity to avoid collisions
local mins, maxs = entity:GetRotatedAABB(entity:OBBMins(), entity:OBBMaxs())
data.mins = mins
data.maxs = maxs
data.filter = {entity, self}
trace = util.TraceHull(data)
else
-- trace along the normal for a few units so we can attempt to avoid a collision
trace = util.TraceLine(data)
data.start = trace.HitPos
data.endpos = data.start + trace.HitNormal * 48
trace = util.TraceLine(data)
end
return trace.HitPos
end
--- Performs a time-delay action that requires this player to look at an entity. If this player looks away from the entity
-- before the action timer completes, the action is cancelled. This is usually used in conjunction with `SetAction` to display
-- progress to the player.
-- @realm shared
-- @entity entity that this player must look at
-- @func callback Function to call when the timer completes
-- @number time How much time in seconds this player must look at the entity for
-- @func[opt=nil] onCancel Function to call when the timer has been cancelled
-- @number[opt=96] distance Maximum distance a player can move away from the entity before the action is cancelled
-- @see SetAction
-- @usage client:SetAction("Searching...", 4) -- for displaying the progress bar
-- client:DoStaredAction(entity, function()
-- print("hello!")
-- end)
-- -- prints "hello!" after looking at the entity for 4 seconds
function meta:DoStaredAction(entity, callback, time, onCancel, distance)
local uniqueID = "ixStare"..self:UniqueID()
local data = {}
data.filter = self
timer.Create(uniqueID, 0.1, time / 0.1, function()
if (IsValid(self) and IsValid(entity)) then
data.start = self:GetShootPos()
data.endpos = data.start + self:GetAimVector()*(distance or 96)
if (util.TraceLine(data).Entity != entity) then
timer.Remove(uniqueID)
if (onCancel) then
onCancel()
end
elseif (callback and timer.RepsLeft(uniqueID) == 0) then
callback()
end
else
timer.Remove(uniqueID)
if (onCancel) then
onCancel()
end
end
end)
end
--- Resets all bodygroups this player's model has to their defaults (`0`).
-- @realm shared
function meta:ResetBodygroups()
for i = 0, (self:GetNumBodyGroups() - 1) do
self:SetBodygroup(i, 0)
end
end
if (SERVER) then
util.AddNetworkString("ixActionBar")
util.AddNetworkString("ixActionBarReset")
util.AddNetworkString("ixStringRequest")
--- Sets whether or not this player's current weapon is raised.
-- @realm server
-- @bool bState Whether or not the raise the weapon
-- @entity[opt=GetActiveWeapon()] weapon Weapon to raise or lower. You should pass this argument if you already have a
-- reference to this player's current weapon to avoid an expensive lookup for this player's current weapon.
function meta:SetWepRaised(bState, weapon)
weapon = weapon or self:GetActiveWeapon()
if (IsValid(weapon)) then
local bCanShoot = !bState and weapon.FireWhenLowered or bState
self:SetNetVar("raised", bState)
if (bCanShoot) then
-- delay shooting while the raise animation is playing
timer.Create("ixWeaponRaise" .. self:SteamID64(), 1, 1, function()
if (IsValid(self)) then
self:SetNetVar("canShoot", true)
end
end)
else
timer.Remove("ixWeaponRaise" .. self:SteamID64())
self:SetNetVar("canShoot", false)
end
else
timer.Remove("ixWeaponRaise" .. self:SteamID64())
self:SetNetVar("raised", false)
self:SetNetVar("canShoot", false)
end
end
--- Inverts this player's weapon raised state. You should use `SetWepRaised` instead of this if you already have a reference
-- to this player's current weapon.
-- @realm server
function meta:ToggleWepRaised()
local weapon = self:GetActiveWeapon()
if (weapon.IsAlwaysRaised or ALWAYS_RAISED[weapon:GetClass()]
or weapon.IsAlwaysLowered or weapon.NeverRaised) then
return
end
self:SetWepRaised(!self:IsWepRaised(), weapon)
if (IsValid(weapon)) then
if (self:IsWepRaised() and weapon.OnRaised) then
weapon:OnRaised()
elseif (!self:IsWepRaised() and weapon.OnLowered) then
weapon:OnLowered()
end
end
end
--- Performs a delayed action that requires this player to hold use on an entity. This is displayed to this player as a
-- closing ring over their crosshair.
-- @realm server
-- @number time How much time in seconds this player has to hold use for
-- @entity entity Entity that this player must be looking at
-- @func callback Function to run when the timer completes. It will be ran right away if `time` is `0`. Returning `false` in
-- the callback will not mark this interaction as dirty if you're managing the interaction state manually.
function meta:PerformInteraction(time, entity, callback)
if (!IsValid(entity) or entity.ixInteractionDirty) then
return
end
if (time > 0) then
self.ixInteractionTarget = entity
self.ixInteractionCharacter = self:GetCharacter():GetID()
timer.Create("ixCharacterInteraction" .. self:SteamID(), time, 1, function()
if (IsValid(self) and IsValid(entity) and IsValid(self.ixInteractionTarget) and
self.ixInteractionCharacter == self:GetCharacter():GetID()) then
local data = {}
data.start = self:GetShootPos()
data.endpos = data.start + self:GetAimVector() * 96
data.filter = self
local traceEntity = util.TraceLine(data).Entity
if (IsValid(traceEntity) and traceEntity == self.ixInteractionTarget and !traceEntity.ixInteractionDirty) then
if (callback(self) != false) then
traceEntity.ixInteractionDirty = true
end
end
end
end)
else
if (callback(self) != false) then
entity.ixInteractionDirty = true
end
end
end
--- Displays a progress bar for this player that takes the given amount of time to complete.
-- @realm server
-- @string text Text to display above the progress bar
-- @number[opt=5] time How much time in seconds to wait before the timer completes
-- @func callback Function to run once the timer completes
-- @number[opt=CurTime()] startTime Game time in seconds that the timer started. If you are using `time`, then you shouldn't
-- use this argument
-- @number[opt=startTime + time] finishTime Game time in seconds that the timer should complete at. If you are using `time`,
-- then you shouldn't use this argument
function meta:SetAction(text, time, callback, startTime, finishTime)
if (time and time <= 0) then
if (callback) then
callback(self)
end
return
end
-- Default the time to five seconds.
time = time or 5
startTime = startTime or CurTime()
finishTime = finishTime or (startTime + time)
if (text == false) then
timer.Remove("ixAct"..self:UniqueID())
net.Start("ixActionBarReset")
net.Send(self)
return
end
if (!text) then
net.Start("ixActionBarReset")
net.Send(self)
else
net.Start("ixActionBar")
net.WriteFloat(startTime)
net.WriteFloat(finishTime)
net.WriteString(text)
net.Send(self)
end
-- If we have provided a callback, run it delayed.
if (callback) then
-- Create a timer that runs once with a delay.
timer.Create("ixAct"..self:UniqueID(), time, 1, function()
-- Call the callback if the player is still valid.
if (IsValid(self)) then
callback(self)
end
end)
end
end
--- Opens up a text box on this player's screen for input and returns the result. Remember to sanitize the user's input if
-- it's needed!
-- @realm server
-- @string title Title to display on the panel
-- @string subTitle Subtitle to display on the panel
-- @func callback Function to run when this player enters their input. Callback is ran with the user's input string.
-- @string[opt=nil] default Default value to put in the text box.
-- @usage client:RequestString("Hello", "Please enter your name", function(text)
-- client:ChatPrint("Hello, " .. text)
-- end)
-- -- prints "Hello, <text>" in the player's chat
function meta:RequestString(title, subTitle, callback, default)
local time = math.floor(os.time())
self.ixStrReqs = self.ixStrReqs or {}
self.ixStrReqs[time] = callback
net.Start("ixStringRequest")
net.WriteUInt(time, 32)
net.WriteString(title)
net.WriteString(subTitle)
net.WriteString(default)
net.Send(self)
end
--- Sets this player's restricted status.
-- @realm server
-- @bool bState Whether or not to restrict this player
-- @bool bNoMessage Whether or not to suppress the restriction notification
function meta:SetRestricted(bState, bNoMessage)
if (bState) then
self:SetNetVar("restricted", true)
if (bNoMessage) then
self:SetLocalVar("restrictNoMsg", true)
end
self.ixRestrictWeps = self.ixRestrictWeps or {}
for _, v in ipairs(self:GetWeapons()) do
self.ixRestrictWeps[#self.ixRestrictWeps + 1] = v:GetClass()
v:Remove()
end
hook.Run("OnPlayerRestricted", self)
else
self:SetNetVar("restricted")
if (self:GetLocalVar("restrictNoMsg")) then
self:SetLocalVar("restrictNoMsg")
end
if (self.ixRestrictWeps) then
for _, v in ipairs(self.ixRestrictWeps) do
self:Give(v)
end
self.ixRestrictWeps = nil
end
hook.Run("OnPlayerUnRestricted", self)
end
end
--- Creates a ragdoll entity of this player that will be synced with clients. This does **not** affect the player like
-- `SetRagdolled` does.
-- @realm server
-- @bool[opt=false] bDontSetPlayer Whether or not to avoid setting the ragdoll's owning player
-- @treturn entity Created ragdoll entity
function meta:CreateServerRagdoll(bDontSetPlayer)
local entity = ents.Create("prop_ragdoll")
entity:SetPos(self:GetPos())
entity:SetAngles(self:EyeAngles())
entity:SetModel(self:GetModel())
entity:SetSkin(self:GetSkin())
for i = 0, (self:GetNumBodyGroups() - 1) do
entity:SetBodygroup(i, self:GetBodygroup(i))
end
entity:Spawn()
if (!bDontSetPlayer) then
entity:SetNetVar("player", self)
end
entity:SetCollisionGroup(COLLISION_GROUP_WEAPON)
entity:Activate()
local velocity = self:GetVelocity()
for i = 0, entity:GetPhysicsObjectCount() - 1 do
local physObj = entity:GetPhysicsObjectNum(i)
if (IsValid(physObj)) then
physObj:SetVelocity(velocity)
local index = entity:TranslatePhysBoneToBone(i)
if (index) then
local position, angles = self:GetBonePosition(index)
physObj:SetPos(position)
physObj:SetAngles(angles)
end
end
end
return entity
end
--- Sets this player's ragdoll status.
-- @realm server
-- @bool bState Whether or not to ragdoll this player
-- @number[opt=0] time How long this player should stay ragdolled for. Set to `0` if they should stay ragdolled until they
-- get back up manually
-- @number[opt=5] getUpGrace How much time in seconds to wait before the player is able to get back up manually. Set to
-- the same number as `time` to disable getting up manually entirely
function meta:SetRagdolled(bState, time, getUpGrace)
if (!self:Alive()) then
return
end
getUpGrace = getUpGrace or time or 5
if (bState) then
if (IsValid(self.ixRagdoll)) then
self.ixRagdoll:Remove()
end
local entity = self:CreateServerRagdoll()
entity:CallOnRemove("fixer", function()
if (IsValid(self)) then
self:SetLocalVar("blur", nil)
self:SetLocalVar("ragdoll", nil)
if (!entity.ixNoReset) then
self:SetPos(entity:GetPos())
end
self:SetNoDraw(false)
self:SetNotSolid(false)
self:SetMoveType(MOVETYPE_WALK)
self:SetLocalVelocity(IsValid(entity) and entity.ixLastVelocity or vector_origin)
end
if (IsValid(self) and !entity.ixIgnoreDelete) then
if (entity.ixWeapons) then
for _, v in ipairs(entity.ixWeapons) do
if (v.class) then
local weapon = self:Give(v.class, true)
if (v.item) then
weapon.ixItem = v.item
end
self:SetAmmo(v.ammo, weapon:GetPrimaryAmmoType())
weapon:SetClip1(v.clip)
elseif (v.item and v.invID == v.item.invID) then
v.item:Equip(self, true, true)
self:SetAmmo(v.ammo, self.carryWeapons[v.item.weaponCategory]:GetPrimaryAmmoType())
end
end
end
if (entity.ixActiveWeapon) then
if (self:HasWeapon(entity.ixActiveWeapon)) then
self:SetActiveWeapon(self:GetWeapon(entity.ixActiveWeapon))
else
local weapons = self:GetWeapons()
if (#weapons > 0) then
self:SetActiveWeapon(weapons[1])
end
end
end
if (self:IsStuck()) then
entity:DropToFloor()
self:SetPos(entity:GetPos() + Vector(0, 0, 16))
local positions = ix.util.FindEmptySpace(self, {entity, self})
for _, v in ipairs(positions) do
self:SetPos(v)
if (!self:IsStuck()) then
return
end
end
end
end
end)
self:SetLocalVar("blur", 25)
self.ixRagdoll = entity
entity.ixWeapons = {}
entity.ixPlayer = self
if (getUpGrace) then
entity.ixGrace = CurTime() + getUpGrace
end
if (time and time > 0) then
entity.ixStart = CurTime()
entity.ixFinish = entity.ixStart + time
self:SetAction("@wakingUp", nil, nil, entity.ixStart, entity.ixFinish)
end
if (IsValid(self:GetActiveWeapon())) then
entity.ixActiveWeapon = self:GetActiveWeapon():GetClass()
end
for _, v in ipairs(self:GetWeapons()) do
if (v.ixItem and v.ixItem.Equip and v.ixItem.Unequip) then
entity.ixWeapons[#entity.ixWeapons + 1] = {
item = v.ixItem,
invID = v.ixItem.invID,
ammo = self:GetAmmoCount(v:GetPrimaryAmmoType())
}
v.ixItem:Unequip(self, false)
else
local clip = v:Clip1()
local reserve = self:GetAmmoCount(v:GetPrimaryAmmoType())
entity.ixWeapons[#entity.ixWeapons + 1] = {
class = v:GetClass(),
item = v.ixItem,
clip = clip,
ammo = reserve
}
end
end
self:GodDisable()
self:StripWeapons()
self:SetMoveType(MOVETYPE_OBSERVER)
self:SetNoDraw(true)
self:SetNotSolid(true)
local uniqueID = "ixUnRagdoll" .. self:SteamID()
if (time) then
timer.Create(uniqueID, 0.33, 0, function()
if (IsValid(entity) and IsValid(self) and self.ixRagdoll == entity) then
local velocity = entity:GetVelocity()
entity.ixLastVelocity = velocity
self:SetPos(entity:GetPos())
if (velocity:Length2D() >= 8) then
if (!entity.ixPausing) then
self:SetAction()
entity.ixPausing = true
end
return
elseif (entity.ixPausing) then
self:SetAction("@wakingUp", time)
entity.ixPausing = false
end
time = time - 0.33
if (time <= 0) then
entity:Remove()
end
else
timer.Remove(uniqueID)
end
end)
else
timer.Create(uniqueID, 0.33, 0, function()
if (IsValid(entity) and IsValid(self) and self.ixRagdoll == entity) then
self:SetPos(entity:GetPos())
else
timer.Remove(uniqueID)
end
end)
end
self:SetLocalVar("ragdoll", entity:EntIndex())
hook.Run("OnCharacterFallover", self, entity, true)
elseif (IsValid(self.ixRagdoll)) then
self.ixRagdoll:Remove()
hook.Run("OnCharacterFallover", self, nil, false)
end
end
end
|
playerKeys = { kc.w, kc.s, kc.a, kc.d, kc.space, kc.left, kc.right, kc.up, kc.down, kc.kp7, kc.kp8, kc.kp4, kc.kp5, kc.kp6, kc.kp1, kc.kp2, kc.e, kc.q }
pk_vx = {
[kc.a] = -1,
[kc.left] = -1,
[kc.d] = 1,
[kc.right] = 1
}
pk_vy = {
[kc.space] = -1,
[kc.w] = -1,
[kc.up] = -1,
[kc.s] = 1,
[kc.down] = 1
}
pkc_vx = {
[kc.kp4] = -1,
[kc.kp6] = 1
}
pkc_vy = {
[kc.kp8] = -1,
[kc.kp2] = 1
}
function movePlayer1(name, data, vx, vy, down)
if MTYPE == 0 then
return false
end
if vx then
if down then
data.vx = vx * MOUSE_SPEED
if data.vx > 0 then
data.dir = 1
else
data.dir = -1
end
movePlayer(name, 0, 0, false, data.vx, data.vy, false)
else --if MTYPE == 1 then
movePlayer(name, 0, 0, false, 1, 0, false)
movePlayer(name, 0, 0, false, -1, 0, true)
data.vx = 0
end
elseif vy then
if down then
data.vy = vy * MOUSE_SPEED
movePlayer(name, 0, 0, false, data.vx, data.vy, false)
elseif MTYPE == 2 then
movePlayer(name, 0, 0, false, 0, -1, false)
movePlayer(name, 0, 0, false, 0, 1, true)
data.vy = 0
else
data.vy = 0
end
else
return false
end
return true
end
|
--- Module implementing the LuaRocks "test" command.
-- Tests a rock, compiling its C parts if any.
local cmd_test = {}
local util = require("luarocks.util")
local test = require("luarocks.test")
function cmd_test.add_to_parser(parser)
local cmd = parser:command("test", [[
Run the test suite for the Lua project in the current directory.
If the first argument is a rockspec, it will use it to determine the parameters
for running tests; otherwise, it will attempt to detect the rockspec.
Any additional arguments are forwarded to the test suite.
To make sure that test suite flags are not interpreted as LuaRocks flags, use --
to separate LuaRocks arguments from test suite arguments.]],
util.see_also())
:summary("Run the test suite in the current directory.")
cmd:argument("rockspec", "Project rockspec.")
:args("?")
cmd:argument("args", "Test suite arguments.")
:args("*")
cmd:flag("--prepare", "Only install dependencies needed for testing only, but do not run the test")
cmd:option("--test-type", "Specify the test suite type manually if it was "..
"not specified in the rockspec and it could not be auto-detected.")
:argname("<type>")
end
function cmd_test.command(args)
if args.rockspec and args.rockspec:match("rockspec$") then
return test.run_test_suite(args.rockspec, args.test_type, args.args, args.prepare)
end
table.insert(args.args, 1, args.rockspec)
local rockspec, err = util.get_default_rockspec()
if not rockspec then
return nil, err
end
return test.run_test_suite(rockspec, args.test_type, args.args, args.prepare)
end
return cmd_test
|
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('XTemplate', {
__is_kind_of = "XContentTemplate",
group = "Paradox",
id = "ParadoxUIActionBars",
PlaceObj('XTemplateWindow', {
'__class', "XContentTemplate",
'IdNode', false,
'Dock', "bottom",
}, {
PlaceObj('XTemplateWindow', {
'comment', "action bars",
'__condition', function (parent, context) return GetUIStyleGamepad() end,
'Margins', box(0, 20, 0, 0),
}, {
PlaceObj('XTemplateWindow', {
'__class', "XFrame",
'Image', "UI/Mods/Circle32Black.tga",
'ImageScale', point(500, 500),
'FrameBox', box(15, 15, 15, 15),
'SqueezeX', false,
'SqueezeY', false,
}),
PlaceObj('XTemplateWindow', {
'Padding', box(60, 0, 60, 0),
}, {
PlaceObj('XTemplateTemplate', {
'__template', "ParadoxUIToolbar",
'Id', "idActionBarLeft",
'HAlign', "left",
'FoldWhenHidden', true,
'Toolbar', "ActionBarLeft",
}),
PlaceObj('XTemplateTemplate', {
'__template', "ParadoxUIToolbar",
'Id', "idActionBarRight",
'HAlign', "right",
'FoldWhenHidden', true,
'Toolbar', "ActionBarRight",
}),
}),
}),
}),
})
|
--[[
[] Author: Martynas Petuska
[] E-mail: [email protected]
[] Date: January 2018
--]]
---------------- NAMESPACE ----------------
local UI = ADDON.UI;
local UpdateInfo = ADDON.UpdateInfo;
local Classes = ADDON.Classes;
local Sizes = ADDON.Sizes;
-------------------------------------------
---Constructs the map.
function UI.ConstructMap()
UpdateInfo.Map.zoneId = GetCurrentMapZoneIndex();
UpdateInfo.Map.tileCountX, UpdateInfo.Map.tileCountY = GetMapNumTiles();
UpdateInfo.Map.poiCount = GetNumPOIs(UpdateInfo.Map.zoneId);
UpdateInfo.Map.locationCount = GetNumMapLocations();
UpdateInfo.Map.subZoneName = subZoneName or GetPlayerLocationName();
-- Allows for map pins to load.
UI.ConstructMapTiles();
UI.ConstructMapPins();
end
function UI.ConstructMapTiles()
local subZoneName = UpdateInfo.Map.subZoneName;
local tileSize = Sizes.miniMapSize * ADDON.Settings.MiniMap.mapScale * ADDON.Settings.MiniMap.mapZoom;
local tileCountHor, tileCountVer = UpdateInfo.Map.tileCountX, UpdateInfo.Map.tileCountY;
UpdateInfo.Map.width = tileSize * tileCountHor;
UpdateInfo.Map.height = tileSize * tileCountVer;
for _, tile in pairs(Classes.MapTile.Objects) do
tile:SetEnabled(false);
end
local x, y, count = 1, 1, 1;
repeat
local tileIndex = x + (tileCountHor * (y - 1));
local nX = (x - 1) * tileSize / UpdateInfo.Map.width;
local nY = (y - 1) * tileSize / UpdateInfo.Map.height;
if (Classes.MapTile.Objects[count]) then
Classes.MapTile.Objects[count]:Init(UpdateInfo.Map.zoneId, subZoneName, tileIndex, nX, nY, tileSize);
else
Classes.MapTile:New(UpdateInfo.Map.zoneId, subZoneName, tileIndex, nX, nY, tileSize)
end
count = count + 1;
if (x == tileCountHor and y < tileCountVer) then
x = 1;
y = y + 1;
else
x = x + 1;
end
until (x > tileCountHor or y > tileCountVer)
end
function UI.ConstructMapPins()
Classes.MapPin.RefreshAll();
end
---Refreshes map's scale from the update info properties.
function UI.RescaleMap()
local tileCountHor, tileCountVer = UpdateInfo.Map.tileCountX, UpdateInfo.Map.tileCountY;
local tileSize = Sizes.miniMapSize * ADDON.Settings.MiniMap.mapScale * ADDON.Settings.MiniMap.mapZoom;
UpdateInfo.Map.width = tileSize * tileCountHor;
UpdateInfo.Map.height = tileSize * tileCountVer;
for _, tile in pairs(Classes.MapTile.Objects) do
tile:Resize(tileSize);
end
UI.UpdateMapTiles();
UI.UpdatePins();
end
---Updates map pins.
function UI.UpdatePins()
Classes.MapPin.UpdateAll();
end
---Updates map tiles.
function UI.UpdateMapTiles()
for _, tile in pairs(Classes.MapTile.Objects) do
tile:Update();
end
end
---Refreshes required properties for update.
function UI.RefreshUpdateInfo()
local subZoneName = GetPlayerLocationName();
if (UpdateInfo.Map.subZoneName ~= subZoneName and not subZoneName:lower():find("wayshrine")) then
UI.ConstructMap(subZoneName);
end
local playerX, playerY, playerRotation = GetMapPlayerPosition("player");
local rotation;
if (ADDON.Settings.isMapRotationEnabled) then
rotation = GetPlayerCameraHeading();
else
rotation = playerRotation;
end
if (UpdateInfo.Player.nX ~= playerX or UpdateInfo.Player.nY ~= playerY or UpdateInfo.Player.rotation ~= rotation) then
UpdateInfo.updatePending = true;
end
UpdateInfo.Player.nX = playerX;
UpdateInfo.Player.nY = playerY;
UpdateInfo.Player.rotation = rotation;
end
--- Handles map's update logic.
---@return void
function UI.UpdateMap()
UI.RefreshUpdateInfo();
if (UpdateInfo.updatePending) then
UI.UpdateMapTiles();
UI.UpdatePins();
if (not ADDON.Settings.isMapRotationEnabled) then
UI.playerPin:SetTextureRotation(UpdateInfo.Player.rotation);
else
UI.wheel:SetTextureRotation(-UpdateInfo.Player.rotation);
end
UpdateInfo.updatePending = false;
end
end |
local M={}
M.eps = 1e-6
M.meanstd = {
mean = {0.485, 0.456, 0.406},
std = {0.229, 0.224, 0.225}}
M.pca = {
eigval = torch.Tensor{0.2175, 0.0188, 0.0045},
eigvec = torch.Tensor{
{ -0.5675, 0.7192, 0.4009 },
{ -0.5808, -0.0045, -0.8140 },
{ -0.5836, -0.6948, 0.4203 }}
}
return M
|
-- setup path to find the project source files of Pegasus
package.path = "./src/?.lua;./src/?/init.lua;"..package.path
local pegasus = require 'pegasus'
local server = pegasus:new({port='9090'})
local printTable = function (table)
for k, v in pairs(table) do
print(k, '=', v)
end
end
server:start(function (request, response)
print("Query string:")
printTable(request["querystring"])
end)
|
-- authorized_callback.lua
-- Once the client has been authorized by the API provider in their
-- login, the provider is supposed to send the client (via redirect)
-- to this endpoint, with the same status code that we sent him at the
-- moment of the first redirect
local random = require 'resty.random'
local ts = require 'threescale_utils'
-- The authorization server should send some data in the callback response to let the
-- API Gateway know which user to associate with the token.
-- We assume that this data will be sent as uri params.
-- This function should be over-ridden depending on authorization server implementation.
local function extract_params()
local params = {}
local uri_params = ngx.req.get_uri_args()
params.user_id = uri_params.user_id or uri_params.username
params.state = uri_params.state
-- In case state is no longer valid, authorization server might send this so we know where to redirect with error
params.redirect_uri = uri_params.redirect_uri or uri_params.redirect_url
if not params.redirect_uri then
ngx.status = ngx.HTTP_BAD_REQUEST
ngx.print('{"error":"missing redirect_uri"}')
return ngx.exit(ngx.status)
end
return params
end
-- Check valid state parameter sent
local function check_state(params)
local required_params = {'state'}
if ts.required_params_present(required_params, params) then
local red = ts.connect_redis()
local tmp_data = ngx.ctx.service.id .. "#tmp_data:".. params.state
local ok, err = red:exists(tmp_data)
if not ok or ok == 0 or err then
ngx.header.content_type = "application/x-www-form-urlencoded"
ngx.redirect(params.redirect_uri .. "#error=invalid_request&error_description=invalid_or_expired_state&state="..params.state)
end
return true
else
ngx.header.content_type = "application/x-www-form-urlencoded"
ngx.redirect(params.redirect_uri .. "#error=invalid_request&error_description=missing_state")
end
end
-- Retrieve client data from Redis
local function retrieve_client_data(service_id, params)
local tmp_data = service_id .. "#tmp_data:".. params.state
local red = ts.connect_redis()
local ok, err = red:hgetall(tmp_data)
if not ok then
ngx.log(0, "no values for tmp_data hash: ".. ts.dump(err))
ngx.header.content_type = "application/x-www-form-urlencoded"
return ngx.redirect(params.redirect_uri .. "#error=invalid_request&error_description=invalid_or_expired_state&state=" .. (params.state or ""))
end
-- Restore client data
local client_data = red:array_to_hash(ok) -- restoring client data
-- Delete the tmp_data:
red:del(tmp_data)
return client_data
end
-- Generate authorization code from params
local function generate_code(client_data)
return ts.sha1_digest(tostring(random.bytes(20, true)) .. "#code:" .. tostring(client_data.client_id))
end
local function persist_code(client_data, params, code)
local red = ts.connect_redis()
local ok, err = red:hmset("c:".. code, {
client_id = client_data.client_id,
client_secret = client_data.secret_id,
redirect_uri = client_data.redirect_uri,
access_token = client_data.access_token,
user_id = params.user_id,
code = code
})
if ok then
return red:expire("c:".. code, 60 * 10) -- code expires in 10 mins
else
return ok, err
end
end
local function store_code(client_data, params, code)
local ok, err = persist_code(client_data, params, code)
if not ok then
ngx.header.content_type = "application/x-www-form-urlencoded"
return ngx.redirect(params.redirect_uri .. "?error=server_error&error_description=code_storage_failed&state=" .. (params.state or "")), err
end
return ok, err
end
-- Returns the code to the client
local function send_code(client_data, params, code)
ngx.header.content_type = "application/x-www-form-urlencoded"
return ngx.redirect( client_data.redirect_uri .. "?code="..code.."&state=" .. (params.state or ""))
end
-- Get Authorization Code
local function get_code(service_id, params)
local client_data = retrieve_client_data(service_id, params)
local code = generate_code(client_data)
local stored = store_code(client_data, params, code)
if stored then
send_code(client_data, params, code)
end
end
local _M = {
VERSION = '0.0.1'
}
_M.call = function()
local params = extract_params()
local is_valid = check_state(params)
if is_valid then
get_code(ngx.ctx.service.id, params)
end
end
_M.generate_code = generate_code
_M.persist_code = persist_code
_M.retrieve_client_data = retrieve_client_data
return _M
|
BuzzboxDB = {
["profileKeys"] = {
["Jyggen - Draenor"] = "Jyggen - Draenor",
},
["profiles"] = {
["Jyggen - Draenor"] = {
},
},
}
|
local web = CreateWebUI(0, 0, 0, 0, 1, 16)
SetWebAlignment(web, 0, 0)
SetWebAnchors(web, 0, 0, 1, 1)
SetWebURL(web, "http://asset/"..GetPackageName().."/dialog.html")
local nextId = 1
local dialogs = {}
local lastOpened = -1
local globalTheme = "themes/default-dark.css"
function createDialog(title, text, ...)
local id = nextId
nextId = nextId + 1
dialogs[id] = {
title = title,
text = text,
columns = { { inputs = {}, buttons = {} } },
buttons = {...},
variables = {},
autoclose = "true"
}
return id
end
function setDialogButtons(dialog, column, ...)
if dialogs[dialog] == nil then
return
end
if column == 0 then
dialogs[dialog].buttons = {...}
return
end
if dialogs[dialog].columns[column] == nil then
dialogs[dialog].columns[column] = {
inputs = {},
buttons = {}
}
end
dialogs[dialog].columns[column].buttons = {...}
end
function addDialogSelect(dialog, column, label, size, ...)
if dialogs[dialog] == nil then
return
end
if dialogs[dialog].columns[column] == nil then
dialogs[dialog].columns[column] = {
inputs = {},
buttons = {}
}
end
table.insert(dialogs[dialog].columns[column].inputs, {
type = "select",
name = label,
size = size,
labelMode = false,
options = {...}
})
return #dialogs[dialog].columns[column].inputs
end
function addDialogCheckbox(dialog, column, label)
if dialogs[dialog] == nil then
return
end
if dialogs[dialog].columns[column] == nil then
dialogs[dialog].columns[column] = {
inputs = {},
buttons = {}
}
end
table.insert(dialogs[dialog].columns[column].inputs, {
type = "checkbox",
name = label
})
return #dialogs[dialog].columns[column].inputs
end
function setDialogSelectOptions(dialog, column, input, ...)
if dialogs[dialog] == nil then
return
end
if dialogs[dialog].columns[column] == nil then
return
end
if dialogs[dialog].columns[column].inputs[input] == nil then
return
end
dialogs[dialog].columns[column].inputs[input].labelMode = false
if dialogs[dialog].columns[column].inputs[input].options == nil then
return
end
dialogs[dialog].columns[column].inputs[input].options = {...}
end
function setDialogSelectOptionsWithLabels(dialog, column, input, options)
if dialogs[dialog] == nil then
return
end
if dialogs[dialog].columns[column] == nil then
return
end
if dialogs[dialog].columns[column].inputs[input] == nil then
return
end
dialogs[dialog].columns[column].inputs[input].labelMode = true
if dialogs[dialog].columns[column].inputs[input].options == nil then
return
end
for k,v in pairs(options) do
if type(k) == "number" then
options[tostring(k)] = options[k]
options[k] = nil
end
end
dialogs[dialog].columns[column].inputs[input].options = options
end
function addDialogTextInput(dialog, column, label)
if dialogs[dialog] == nil then
return
end
if dialogs[dialog].columns[column] == nil then
dialogs[dialog].columns[column] = {
inputs = {},
buttons = {}
}
end
table.insert(dialogs[dialog].columns[column].inputs, {
type = "text",
name = label
})
return #dialogs[dialog].columns[column].inputs
end
function setVariable(dialog, name, value)
if dialogs[dialog] == nil then
return
end
dialogs[dialog].variables[name] = value
end
function setDialogAutoclose(dialog, autoclose)
if dialogs[dialog] == nil then
return
end
if autoclose then
dialogs[dialog].autoclose = "true"
else
dialogs[dialog].autoclose = "false"
end
end
function replaceVariables(text, variables)
for k,v in pairs(variables) do
text = text:gsub("{"..k.."}", v)
end
return text
end
function closeDialog()
if dialogs[lastOpened].theme ~= nil then
applyTheme(globalTheme)
end
lastOpened = -1
ExecuteWebJS(web, "CloseDialog();");
SetIgnoreLookInput(false)
SetIgnoreMoveInput(false)
ShowMouseCursor(false)
SetInputMode(INPUT_GAME)
end
function destroyDialog(dialog)
if lastOpened == dialog then
closeDialog()
end
dialogs[dialog] = nil
end
function showDialog(dialog)
if dialogs[dialog] == nil then
return
end
lastOpened = dialog
if dialogs[dialog].theme ~= nil then
applyTheme(dialogs[dialog].theme)
else
applyTheme(globalTheme)
end
local d = dialogs[dialog]
local json = {
autoclose = d.autoclose == "false",
columns = {},
buttons = {}
}
if d.title ~= nil then
json["title"] = replaceVariables(d.title, d.variables)
end
if d.text ~= nil then
json["text"] = replaceVariables(d.text, d.variables)
end
for j=1,#d.columns do
json.columns[j] = {}
if d.columns[j].inputs ~= nil then
json.columns[j].inputs = {}
for i=1,#d.columns[j].inputs do
json.columns[j].inputs[i] = {
type = d.columns[j].inputs[i].type
}
if d.columns[j].inputs[i].name ~= nil then
json.columns[j].inputs[i].name = replaceVariables(d.columns[j].inputs[i].name, d.variables)
end
if d.columns[j].inputs[i].options ~= nil then
json.columns[j].inputs[i].options = {}
if d.columns[j].inputs[i].labelMode then
for k,v in pairs(d.columns[j].inputs[i].options) do
json.columns[j].inputs[i].options[k] = v
end
else
for k=1,#d.columns[j].inputs[i].options do
table.insert(json.columns[j].inputs[i].options, d.columns[j].inputs[i].options[k])
end
end
end
if d.columns[j].inputs[i].size ~= nil then
json.columns[j].inputs[i].size = d.columns[j].inputs[i].size
end
end
end
json.columns[j].buttons = {}
for i=1,#d.columns[j].buttons do
table.insert(json.columns[j].buttons, replaceVariables(d.columns[j].buttons[i], d.variables))
end
end
for i=1,#d.buttons do
table.insert(json.buttons, replaceVariables(d.buttons[i], d.variables))
end
ExecuteWebJS(web, "SetDialog("..dialog..","..json_encode(json)..");")
SetIgnoreLookInput(true)
SetIgnoreMoveInput(true)
ShowMouseCursor(true)
SetInputMode(INPUT_GAMEANDUI)
end
function applyTheme(theme)
ExecuteWebJS(web, "SetTheme(\""..theme.."\");")
end
function setDialogTheme(dialog, theme)
if dialogs[dialog] == nil then
return
end
if (theme:len() > 5) and (theme:sub(1,5) == "http:") then
dialogs[dialog].theme = theme
else
dialogs[dialog].theme = "themes/"..theme..".css"
end
end
function setGlobalTheme(theme)
globalTheme = theme
if (theme:len() > 5) and (theme:sub(1,5) == "http:") then
globalTheme = theme
else
globalTheme = "themes/"..theme..".css"
end
end
AddEvent("__dialog_system_closed", function()
lastOpened = -1
SetIgnoreLookInput(false)
SetIgnoreMoveInput(false)
ShowMouseCursor(false)
SetInputMode(INPUT_GAME)
end)
AddEvent("OnKeyPress", function(key)
if lastOpened ~= -1 then
SetIgnoreLookInput(true)
SetIgnoreMoveInput(true)
ShowMouseCursor(true)
SetInputMode(INPUT_GAMEANDUI)
end
end)
AddEvent("OnDialogUIReady", function()
if lastOpened ~= -1 then
showDialog(lastOpened)
end
end)
AddFunctionExport("create", createDialog)
AddFunctionExport("setButtons", setDialogButtons)
AddFunctionExport("addSelect", addDialogSelect)
AddFunctionExport("addTextInput", addDialogTextInput)
AddFunctionExport("addCheckbox", addDialogCheckbox)
AddFunctionExport("setVariable", setVariable)
AddFunctionExport("show", showDialog)
AddFunctionExport("close", closeDialog)
AddFunctionExport("destroy", destroyDialog)
AddFunctionExport("setSelectOptions", setDialogSelectOptions)
AddFunctionExport("setSelectLabeledOptions", setDialogSelectOptionsWithLabels)
AddFunctionExport("setAutoClose", setDialogAutoclose)
AddFunctionExport("setGlobalTheme", setGlobalTheme)
AddFunctionExport("setDialogTheme", setDialogTheme)
|
local Builder = creox.game.Builder.Block
Builder.block_builder("dirt").texture({"dirt.png"}).build()
Builder.block_builder("iron_block").texture({"metal_texture.png"}).build()
Builder.block_builder("gold_block").texture({"metal_texture.png^[multiply:#FFC900"}).build()
Builder.block_builder("oak_wood_planks").texture({"wood_planks.png^[multiply:#BBCC00"}).build()
Builder.build_grass_block("snow_grass", "#FFFFFF")
Builder.build_grass_block("autumn_grass", "#FFB800")
Builder.build_grass_block("grass", "#00AA00")
Builder.build_log_block("oak_log", "#BBCC00")
Builder.build_foliage_block("oak_foliage", 1, "#00FC00")
Builder.block_builder("stone").texture({"stone.png"}).build()
Builder.block_builder("cobblestone").texture({"cobble_stone.png"}).build()
Builder.block_builder("mossy_cobblestone").texture({"cobble_stone.png^(moss_mask_1.png^[multiply:#00AA00)"}).build()
Builder.build_ore("coal_ore", 2, "#3c3c3c")
Builder.build_ore("emerald_ore", 3, "#00AB22")
Builder.build_plant("tall_grass", "tall_grass.png", "#00AA00")
Builder.build_plant("autumn_tall_grass", "tall_grass.png", "#FFB800")
Builder.build_plant("snow_tall_grass", "tall_grass.png", "#FFFFFF")
Builder.block_builder("solar_panel").texture({
"metal_texture.png^(solar_panel.png^[multiply:#0099F9)",
"metal_texture.png",
"metal_texture.png",
"metal_texture.png",
"metal_texture.png",
"metal_texture.png"
}).build() |
-- Used for particle effects, like explosions, fire, breaking walls, etc.
particles = {}
-- Particles use gravWorld, since they are affected by gravity
function spawnParticle(x, y, type, dir, time)
local particle = {}
particle.x = x
particle.y = y
particle.width = 50
particle.height = 50
particle.corner = 10
particle.sprite = nil
particle.type = type
particle.fade = true
particle.fadeIn = false
particle.gravity = true
-- dir is a vector value used for applying an impulse upon creation
particle.dir = dir
-- When timer reaches zero, particle is destroyed
particle.timer = 1
math.randomseed(table.getn(particles))
if type == "break" then
particle.width = 71
particle.height = 71
particle.corner = 2
particle.timer = 1.5
particle.scale = math.random() * 0.5 + 0.5
particle.rotate = math.random() * 3.14
particle.alpha = 1
end
if type == "laserDebris" then
particle.width = 8
particle.height = 8
particle.corner = 1
particle.timer = 0.5
particle.alpha = 0.314
end
if type == "pickupSparkle" then
particle.width = 4
particle.height = 4
particle.corner = 1
particle.timer = 0.5
particle.alpha = 0.314
particle.gravity = false
end
if type == "splash" then
particle.width = 12
particle.height = 12
particle.radius = 7
particle.corner = 3
particle.timer = math.abs(player.velY) / 450
particle.alpha = 0.5
particle.gravity = true
end
if type == "droplet" then
particle.width = 6
particle.height = 6
particle.radius = 3
particle.corner = 1
particle.timer = 0.5
particle.alpha = 0.15
particle.gravity = true
particle.fadeIn = true
end
particle.timer = time or particle.timer
local particleWorld = gravWorld
if particle.gravity == false then
particleWorld = world
end
particle.physics = particleWorld:newBSGRectangleCollider(x, y, particle.width,
particle.height, particle.corner)
particle.physics:setFixedRotation(true)
if particle.gravity then
particle.physics:setCollisionClass('Particle')
else
particle.physics:setCollisionClass('Ignore')
end
if particle.dir ~= nil then
particle.physics:applyLinearImpulse(particle.dir:unpack())
end
if particle.fade then
if particle.fadeIn then
particle.fadeTween = flux.to(particle, particle.timer, {alpha = 0}):ease("backin")
else
particle.fadeTween = flux.to(particle, particle.timer, {alpha = 0}):ease("cubicin")
end
end
function particle:update(dt)
self.timer = updateTimer(self.timer, dt)
if self.timer <= 0 then
self.dead = true
end
end
table.insert(particles, particle)
end
-- call update on all particles, destroy the dead ones
function particles:update(dt)
for i,p in ipairs(self) do
p:update(dt)
end
for i=#particles,1,-1 do
if particles[i].dead then
particles[i].physics:destroy()
particles[i].fadeTween = nil
table.remove(particles, i)
end
end
end
function particles:draw()
for i,p in ipairs(self) do
local px, py = p.physics:getPosition()
if p.type == "break" then
love.graphics.setColor(0.247, 0.176, 0.114, p.alpha)
love.graphics.draw(sprites.environment.breakParticle, px, py, nil, 0.5, 0.5, 35, 35)
end
if p.type == "laserDebris" then
love.graphics.setColor(1, 0, 0, p.alpha)
love.graphics.rectangle("fill", px-4, py-4, 8, 8)
end
if p.type == "pickupSparkle" then
love.graphics.setColor(1, 1, 1, p.alpha)
love.graphics.circle("fill", px, py, 4)
end
if p.type == "splash" or p.type == "droplet" then
local add = 1 - p.alpha
if add < 0 then
add = 0
end
love.graphics.setColor(0.388 + add, 0.502 + add, 0.541 + add, p.alpha)
love.graphics.circle("fill", px, py, p.radius)
end
end
end
function particles:splash(x, y)
local mag = math.abs(player.velY) * -0.35
if player.velY > 0 then
spawnParticle(x, y, "splash", vector(0, mag))
spawnParticle(x-15, y, "splash", vector(-10, mag*0.97))
spawnParticle(x+15, y, "splash", vector(10, mag*0.97))
spawnParticle(x-30, y, "splash", vector(-25, mag*0.84))
spawnParticle(x+30, y, "splash", vector(25, mag*0.84))
--[[
spawnParticle(x-15, y, "splash", vector(-10, mag*0.8))
spawnParticle(x+15, y, "splash", vector(10, mag*0.8))
spawnParticle(x, y, "splash", vector(0, mag * 0.86))
]]
else
spawnParticle(x-15, y, "splash", vector(-35, mag*0.97))
spawnParticle(x+15, y, "splash", vector(35, mag*0.97))
spawnParticle(x-30, y, "splash", vector(-50, mag*0.84))
spawnParticle(x+30, y, "splash", vector(50, mag*0.84))
end
end
|
local config = {
[9238] = Position(33456, 31346, 8),
[9239] = Position(33199, 31978, 8)
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local targetPosition = config[item.uid]
if not targetPosition then
return true
end
player:teleportTo(targetPosition)
targetPosition:sendMagicEffect(CONST_ME_WATERSPLASH)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You dive into the vortex to swim below the rocks to the other side of the cave.')
return true
end
|
-- Copyright 2014-2015 Greentwip. All Rights Reserved.
local MyApp = class("MyApp", cc.load("mvc").AppBase)
function MyApp:onCreate()
math.randomseed(os.time())
self:setup()
end
function MyApp:setup()
self:initiate()
--cc.lite_edition_ = true
display.setAutoScale({autoscale = "SHOW_ALL", width = 256, height = 224}, {width = display.width, height = display.height})
end
function cc.key_down(key)
return cc.keys_[key].status_ == cc.KEY_STATUS.DOWN
end
function cc.key_pressed(key)
return cc.keys_[key].pressed_
end
function cc.pause(freeze)
if freeze then
cc.game_status_ = cc.GAME_STATUS.PAUSED
else
cc.game_status_ = cc.GAME_STATUS.RUNNING
end
end
function MyApp:initiate()
self:setup_social()
self:setup_application()
self:setup_tags()
self:setup_callbacks()
self:setup_keyboard()
self:setup_camera()
self:setup_player()
self:setup_enemy()
self:setup_special()
self:setup_battle()
self:setup_items()
self:setup_levels()
self:setup_browners()
end
function MyApp:setup_social()
if device.platform == "android" then
sdkbox.PluginFacebook:init()
end
end
function MyApp:setup_callbacks()
cc.callbacks_ = {}
function cc.callbacks_.pre_fill()
cc.pause(true)
audio.playSound("sounds/sfx_getenergy.mp3", false)
end
function cc.callbacks_.post_fill()
cc.pause(false)
cc.fill_amount_ = 0
if cc.fill_object_.resume_actions then
cc.fill_object_:resume_actions()
end
cc.sender_:stopAllActions()
if cc.on_post_fill_callback_ ~= nil then
cc:on_post_fill_callback_()
end
end
function cc.callbacks_.fill_health_()
if cc.fill_amount_ > 0 and cc.fill_object_.health_ <= 28 then
cc.callbacks_.pre_fill()
cc.fill_object_.health_ = cc.fill_object_.health_ + 1
cc.fill_amount_ = cc.fill_amount_ - 1
else
cc.callbacks_.post_fill()
end
end
function cc.callbacks_.fill_energy_()
if cc.fill_object_.energy_ ~= nil then
if cc.fill_amount_ > 0 and cc.fill_object_.energy_ < 28 then
cc.callbacks_.pre_fill()
cc.fill_object_.energy_ = cc.fill_object_.energy_ + 1
cc.fill_amount_ = cc.fill_amount_ - 1
else
cc.callbacks_.post_fill()
end
else
cc.callbacks_.post_fill()
end
end
function cc.callbacks_.energy_fill(sender, object, amount, property, on_post_fill_callback)
cc.fill_amount_ = amount
cc.fill_object_ = object
if cc.fill_object_.pause_actions then
cc.fill_object_:pause_actions()
end
cc.sender_ = sender
cc.on_post_fill_callback_ = on_post_fill_callback
local fill_callback = cc.callbacks_.fill_health_
if property.energy_ then
fill_callback = cc.callbacks_.fill_energy_
end
local delay = cc.DelayTime:create(0.06)
local fill_callback = cc.CallFunc:create(fill_callback)
local fill_sequence = cc.Sequence:create(delay, fill_callback, nil)
local sequence = cc.RepeatForever:create(fill_sequence)
cc.sender_:runAction(sequence)
end
end
function MyApp:setup_application()
cc.texture_formats_ = {}
cc.texture_formats_.pvr_ = 0
cc.texture_formats_.png_ = 1
cc.texture_format_ = cc.texture_formats_.pvr_
cc.GAME_STATUS = {}
cc.GAME_STATUS.PAUSED = 0
cc.GAME_STATUS.RUNNING = 1
cc.PAUSE_STATUS = {}
cc.PAUSE_STATUS.NONE = 0
cc.PAUSE_STATUS.SCREEN = 1
cc.game_status_ = cc.GAME_STATUS.RUNNING
cc.pause_status_ = cc.PAUSE_STATUS.NONE
cc.frames_cache_ = {}
cc.animations_cache_ = {}
end
function MyApp:setup_tags()
cc.tags = {}
cc.tags.none = -1
cc.tags.player = 1
cc.tags.item = 2
cc.tags.enemy = 3
cc.tags.block = 4
cc.tags.camera = 5
cc.tags.scroll = 6
cc.tags.check_point = 7
cc.tags.teleporter = 8
cc.tags.bounds = 9
cc.tags.hole = 10
cc.tags.door = 11
cc.tags.ladder = 12
cc.tags.weapon = {}
cc.tags.weapon.player = 13
cc.tags.weapon.enemy = 14
cc.tags.weapon.none = 15
cc.tags.logic = {}
cc.tags.logic.check_point = {}
cc.tags.logic.check_point.first_ = 16
cc.tags.actions = {}
cc.tags.actions.animation = 17
cc.tags.actions.color = 18
cc.tags.free_scroll = 19
cc.tags.actions.visibility = 20
cc.level_status_ = {}
cc.level_status_.init_ = 1
cc.level_status_.run_ = 2
end
function MyApp:setup_keyboard()
cc.KEY_STATUS = {}
cc.KEY_STATUS.UP = 0
cc.KEY_STATUS.DOWN = 1
cc.key_code_ = {}
cc.key_code_.a = 1
cc.key_code_.b = 2
cc.key_code_.start = 3
cc.key_code_.up = 4
cc.key_code_.down = 5
cc.key_code_.left = 6
cc.key_code_.right = 7
cc.key_code_.up_right = 8
cc.key_code_.up_left = 9
cc.key_code_.down_left = 10
cc.key_code_.down_right = 11
cc.key_code_.none = 12
cc.keys_ = {}
local key_list = {cc.key_code_.a,
cc.key_code_.b,
cc.key_code_.start,
cc.key_code_.up, cc.key_code_.down, cc.key_code_.left, cc.key_code_.right}
for i = 1, #key_list do
local key = {}
key.status_ = cc.KEY_STATUS.UP
key.pressed_ = false
key.released_ = false
cc.keys_[i] = key
end
end
function MyApp:setup_camera()
cc.CAMERA = {}
cc.CAMERA.MODE = {}
cc.CAMERA.SCROLL = {}
cc.CAMERA.SHIFT = {}
cc.CAMERA.MODE.SCREEN = 1
cc.CAMERA.MODE.SCROLL = 2
cc.CAMERA.MODE.SHIFT = 3
cc.CAMERA.SCROLL.UP = 1
cc.CAMERA.SCROLL.DOWN = 2
cc.CAMERA.SCROLL.LEFT = 3
cc.CAMERA.SCROLL.RIGHT = 4
cc.CAMERA.SCROLL.MOVING = 5
cc.CAMERA.SCROLL.NONE = 6
cc.CAMERA.SHIFT.UP = 1
cc.CAMERA.SHIFT.DOWN = 2
cc.CAMERA.SHIFT.LEFT = 3
cc.CAMERA.SHIFT.RIGHT = 4
cc.CAMERA.SHIFT.NONE = 5
end
function MyApp:setup_player()
cc.player_ = {}
cc.player_.climb_direction_ = {}
cc.player_.climb_direction_.up_ = 0
cc.player_.climb_direction_.down_ = 1
cc.player_.climb_direction_.none_ = 2
cc.player_.lives_ = 3
cc.player_.e_tanks_ = 0
cc.player_.m_tanks_ = 0
cc.unlockables_ = {}
cc.unlockables_.helmet_ = {id_ = 2, acquired_ = false }
cc.unlockables_.head_ = {id_ = 3, acquired_ = false }
cc.unlockables_.chest_ = {id_ = 4, acquired_ = false }
cc.unlockables_.fist_ = {id_ = 5, acquired_ = false }
cc.unlockables_.boot_ = {id_ = 6, acquired_ = false }
cc.unlockables_.helmet_acquired_ = function()
return cc.unlockables_.helmet_.acquired_
end
cc.unlockables_.extreme_acquired_ = function()
local acquired = true
for _, unlockable in pairs(cc.unlockables_) do
if not unlockable.acquired_ then
acquired = false
end
end
return acquired
end
cc.game_options_ = {}
cc.game_options_.extreme_activated_ = false
cc.game_options_.helmet_activated_ = false
cc.kinematic_contact_ = {}
cc.kinematic_contact_.up = 1
cc.kinematic_contact_.down = 2
cc.kinematic_contact_.left = 3
cc.kinematic_contact_.right = 4
end
function MyApp:setup_enemy()
cc.enemy_ = {}
cc.enemy_.status_ = {}
cc.enemy_.status_.active_ = 1
cc.enemy_.status_.fighting_ = 2
cc.enemy_.status_.defeated_ = 3
cc.enemy_.status_.inactive_ = 4
end
function MyApp:setup_special()
cc.special_ = {}
cc.special_.status_ = {}
cc.special_.status_.on_screen_ = 1
cc.special_.status_.off_screen_ = 2
end
function MyApp:setup_battle()
cc.battle_status_ = {}
cc.battle_status_.waiting_ = 1
cc.battle_status_.startup_ = 2
cc.battle_status_.intro_ = 3
cc.battle_status_.fighting_ = 4
cc.battle_status_.defeated_ = 5
end
function MyApp:setup_items()
cc.item_ = {}
cc.item_.life_ = {id_ = 1, string_ = "life" }
cc.item_.helmet_ = {id_ = 2, string_ = "helmet" }
cc.item_.head_ = {id_ = 3, string_ = "head" }
cc.item_.chest_ = {id_ = 4, string_ = "chest" }
cc.item_.fist_ = {id_ = 5, string_ = "fist" }
cc.item_.boot_ = {id_ = 6, string_ = "boot" }
cc.item_.health_small_ = {id_ = 7, string_ = "health_small" }
cc.item_.health_big_ = {id_ = 8, string_ = "health_big" }
cc.item_.energy_small_ = {id_ = 9, string_ = "energy_small" }
cc.item_.energy_big_ = {id_ = 10, string_ = "energy_big" }
cc.item_.e_tank_ = {id_ = 11, string_ = "e_tank" }
cc.item_.m_tank_ = {id_ = 12, string_ = "m_tank" }
local on_item_acquired = function(player, item)
if item.id_ == cc.item_.life_.id_ then
if cc.player_.lives_ < 9 then
cc.player_.lives_ = cc.player_.lives_ + 1
end
audio.playSound("sounds/sfx_getlife.mp3", false)
elseif item.id_ >= cc.item_.helmet_.id_ and item.id_ <= cc.item_.boot_.id_ then
for _, unlockable in pairs(cc.unlockables_) do
if item.id_ == unlockable.id_ then
unlockable.acquired_ = true
end
end
audio.playSound("sounds/sfx_getlife.mp3", false)
elseif item.id_ == cc.item_.e_tank_.id_ then
if cc.player_.e_tanks_ < 9 then
cc.player_.e_tanks_ = cc.player_.e_tanks_ + 1
end
audio.playSound("sounds/sfx_getlife.mp3", false)
elseif item.id_ == cc.item_.m_tank_.id_ then
if cc.player_.m_tanks_ < 9 then
cc.player_.m_tanks_ = cc.player_.m_tanks_ + 1
end
audio.playSound("sounds/sfx_getlife.mp3", false)
else
player:restore_sanity(item)
end
end
for _, item in pairs(cc.item_) do
item.callback_ = on_item_acquired
end
end
function MyApp:setup_levels()
cc.levels_ = {}
local level_mugs = {}
level_mugs[#level_mugs + 1] = "freezerman"
level_mugs[#level_mugs + 1] = "sheriffman"
level_mugs[#level_mugs + 1] = "boomerman"
level_mugs[#level_mugs + 1] = "militaryman"
level_mugs[#level_mugs + 1] = "vineman"
level_mugs[#level_mugs + 1] = "shieldman"
level_mugs[#level_mugs + 1] = "nightman"
level_mugs[#level_mugs + 1] = "torchman"
level_mugs[#level_mugs + 1] = "test"
for i = 1, #level_mugs do
local level_map = {}
level_map.mug_ = level_mugs[i]
level_map.defeated_ = false
cc.levels_[#cc.levels_ + 1] = level_map
end
cc.current_level_ = nil
cc.demo_ = {}
cc.demo_.level_ = 1
cc.demo_.get_weapon_ = 2
end
function MyApp:setup_browners()
cc.browners_ = {
teleport_ = {id_ = 1, acquired_ = true, pause_item_ = nil},
violet_ = {id_ = 2, acquired_ = true, pause_item_ = "violet"},
fuzzy_ = {id_ = 3, acquired_ = true, pause_item_ = "fuzzy"},
freezer_ = {id_ = 4, acquired_ = false, pause_item_ = "freezer"},
sheriff_ = {id_ = 5, acquired_ = false, pause_item_ = "sheriff"},
boomer_ = {id_ = 6, acquired_ = false, pause_item_ = "boomer"},
military_ = {id_ = 7, acquired_ = false, pause_item_ = "military"},
vine_ = {id_ = 8, acquired_ = false, pause_item_ = "vine"},
shield_ = {id_ = 9, acquired_ = false, pause_item_ = "shield"},
night_ = {id_ = 10, acquired_ = false, pause_item_ = "night"},
torch_ = {id_ = 11, acquired_ = false, pause_item_ = "torch"},
helmet_ = {id_ = 12, acquired_ = false, pause_item_ = "helmet"},
extreme_ = {id_ = 13, acquired_ = false, pause_item_ = "ex"},
boss_ = {id_ = 14, acquired_ = nil, pause_item_ = nil }
}
for _, v in pairs(cc.browners_) do
if v.id_ >= 4 and v.id_ <= 11 then
v.level_ = cc.levels_[v.id_ - 3].mug_
v.energy_ = 28
end
end
cc.browners_.violet_.energy_ = -1
cc.browners_.helmet_.energy_ = -1
cc.browners_.fuzzy_.energy_ = 28
cc.browners_.extreme_.energy_ = 28
end
return MyApp
|
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
-- Sets the players model and basic physics ect..
function ENT:Initialize()
self:SetModel("models/gman_high.mdl")
self:SetHullType(HULL_HUMAN);
self:SetHullSizeNormal();
self:SetNPCState(NPC_STATE_SCRIPT)
self:SetSolid(SOLID_BBOX)
self:SetUseType(SIMPLE_USE)
self:DropToFloor()
self:CapabilitiesAdd(CAP_ANIMATEDFACE + CAP_TURN_HEAD)
end
function ENT:OnTakeDamage()
return 0
end
function ENT:AcceptInput(name, ply, caller)
-- Basic checks
if !ply:IsPlayer() then return end
if ply:GetPos():Distance(self:GetPos()) > 100 then return end
if Election.Core.IsVoting then return end
-- Opens derma
if ply:Team() == TEAM_PRESIDENT then
net.Start("Election:UI:Pres")
net.WriteEntity(self)
net.Send(ply)
else
net.Start("Election:UI")
net.WriteEntity(self)
net.Send(ply)
end
end |
local ffi = require("ffi");
local samcli = require("samcli");
local netutils_ffi = require("netutils_ffi");
local core_string = require("core_string_l1_1_0");
local JSON = require("dkjson");
--[[
NET_API_STATUS
NetLocalGroupEnum (
LPCWSTR servername ,
DWORD level,
LPBYTE *bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
PDWORD_PTR resumehandle
);
--]]
local enumLocalGroups = function(params)
local servername = nil;
if params.servername then
servername = core_string.toUnicode(params.servername);
end
level = params.level or 0;
local bufptr = ffi.new("BYTE *[1]");
local prefmaxlen = params.chunksize or ffi.C.MAX_PREFERRED_LENGTH;
local entriesread = ffi.new("DWORD[1]");
local totalentries = ffi.new("DWORD[1]");
--local resumehandle = ffi.new("DWORD_PTR[1]");
--local resumehandle = ffi.new("uintptr_t[1]");
local resumehandle = ffi.new("DWORD[1]");
local status = samcli.NetLocalGroupEnum(servername,
level,
bufptr,
prefmaxlen,
entriesread,
totalentries,
resumehandle);
print("STATUS ======= ", status);
print("32-bit: ", ffi.abi("32bit"));
print("Entries Read: ", entriesread[0]);
print("Total Entries: ", totalentries[0]);
--print("Buffptr: ", bufptr[0]);
print("Resume Handle: ", resumehandle[0]);
local idx = -1;
local closure = function()
if status ~= ffi.C.NERR_Success then
return nil, status;
end
idx = idx + 1;
--[[
if idx >= entriesread[0] then
-- we're either at the beginning of the enumeration
-- or we've just run past the extent of the current batch
-- either way, try to get the next batch
local status = samcli.NetLocalGroupEnum(servername,
level,
bufptr,
prefmaxlen,
entriesread,
totalentries,
resumehandle[0]);
print("STATUS ======= ", status);
if status ~= ffi.C.NERR_Success then
return nil, status;
end
print("Entries Read: ", entriesread[0]);
print("Total Entries: ", totalentries[0]);
--print("Buffptr: ", bufptr[0]);
print("Resume Handle: ", resumehandle[0]);
idx = 0;
end
--]]
if idx >= entriesread[0] then
return nil;
end
if level == 0 then
local records = ffi.cast("LOCALGROUP_INFO_0 *", bufptr[0])
return {name = core_string.toAnsi(records[idx].lgrpi0_name)};
elseif level == 1 then
local records = ffi.cast("LOCALGROUP_INFO_1 *", bufptr[0]);
return {
name = core_string.toAnsi(records[idx].lgrpi1_name),
comment = core_string.toAnsi(records[idx].lgrpi1_comment)};
end
return nil;
end
return closure;
end
printGroups = function()
local res = {}
--for group in enumLocalGroups({level=1}) do
for group in enumLocalGroups({level=0, servername="\\\\tk5-red-dc-15"}) do
print("name: ", group.name);
--table.insert(res, group);
end
--local jsonstr = JSON.encode(res, {indent=true});
--print(jsonstr);
end
printGroups();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.