content stringlengths 5 1.05M |
|---|
local luaunit = require("luaunit")
local middleclass = require("middleclass")
local types = require("luaplot.types")
-- luacheck: globals TestTypes
TestTypes = {}
function TestTypes.test_is_number_with_limits_false_not_number()
local result = types.is_number_with_limits(nil)
luaunit.assert_is_boolean(result)
luaunit.assert_false(result)
end
function TestTypes.test_is_number_with_limits_false_minimum()
local result = types.is_number_with_limits(22, 23)
luaunit.assert_is_boolean(result)
luaunit.assert_false(result)
end
function TestTypes.test_is_number_with_limits_false_maximum()
local result = types.is_number_with_limits(43, 23, 42)
luaunit.assert_is_boolean(result)
luaunit.assert_false(result)
end
function TestTypes.test_is_number_with_limits_true_number()
local result = types.is_number_with_limits(23)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_number_with_limits_true_minimum_default()
local result = types.is_number_with_limits(-math.huge)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_number_with_limits_true_minimum_not_default()
local result = types.is_number_with_limits(23, 23)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_number_with_limits_true_maximum_default()
local result = types.is_number_with_limits(math.huge)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_number_with_limits_true_maximum_not_default()
local result = types.is_number_with_limits(42, 23, 42)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_instance_false_not_table()
local MockClass = middleclass("MockClass")
local result = types.is_instance(nil, MockClass)
luaunit.assert_is_boolean(result)
luaunit.assert_false(result)
end
function TestTypes.test_is_instance_false_missed_method()
local MockClass = middleclass("MockClass")
local result = types.is_instance({}, MockClass)
luaunit.assert_is_nil(result)
end
function TestTypes.test_is_instance_false_incorrect_method()
local MockClass = middleclass("MockClass")
local result = types.is_instance({isInstanceOf = 23}, MockClass)
luaunit.assert_is_nil(result)
end
function TestTypes.test_is_instance_false_by_check()
local MockClass = middleclass("MockClass")
local result = types.is_instance(
{
isInstanceOf = function()
return false
end,
},
MockClass
)
luaunit.assert_is_boolean(result)
luaunit.assert_false(result)
end
function TestTypes.test_is_instance_true_by_check()
local MockClass = middleclass("MockClass")
local result = types.is_instance(
{
isInstanceOf = function()
return true
end,
},
MockClass
)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_instance_true_real_class()
local MockClass = middleclass("MockClass")
local mock = MockClass:new()
local result = types.is_instance(mock, MockClass)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_callable_false_missed_metatable()
local result = types.is_callable({})
luaunit.assert_is_nil(result)
end
function TestTypes.test_is_callable_false_missed_metamethod()
local value = {}
setmetatable(value, {})
local result = types.is_callable(value)
luaunit.assert_is_nil(result)
end
function TestTypes.test_is_callable_false_incorrect_metamethod()
local value = {}
setmetatable(value, {__call = 23})
local result = types.is_callable(value)
luaunit.assert_is_nil(result)
end
function TestTypes.test_is_callable_true_function()
local value = function()
end
local result = types.is_callable(value)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_callable_true_metatable()
local value = {}
setmetatable(value, {
__call = function()
end,
})
local result = types.is_callable(value)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_is_indexable_false_not_table()
local result = types.is_indexable(nil)
luaunit.assert_is_nil(result)
end
function TestTypes.test_is_indexable_false_missed_metamethod()
local result = types.is_indexable({})
luaunit.assert_is_nil(result)
end
function TestTypes.test_is_indexable_true()
local value = {}
setmetatable(value, {
__index = function()
end,
})
local result = types.is_indexable(value)
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
function TestTypes.test_has_metamethod_false_missed_metatable()
local result = types.has_metamethod({}, "__test")
luaunit.assert_is_nil(result)
end
function TestTypes.test_has_metamethod_false_missed_metamethod()
local value = {}
setmetatable(value, {})
local result = types.has_metamethod(value, "__test")
luaunit.assert_is_nil(result)
end
function TestTypes.test_has_metamethod_false_incorrect_metamethod()
local value = {}
setmetatable(value, {__test = 23})
local result = types.has_metamethod(value, "__test")
luaunit.assert_is_nil(result)
end
function TestTypes.test_has_metamethod_true()
local value = {}
setmetatable(value, {
__test = function()
end,
})
local result = types.has_metamethod(value, "__test")
luaunit.assert_is_boolean(result)
luaunit.assert_true(result)
end
|
local awful = require('awful')
local naughty = require('naughty')
local modkey = require('config.keys.mod').modKey
local altkey = require('config.keys.mod').altKey
local apps = require('config.apps')
local hotkeys_popup = require('awful.hotkeys_popup').widget
local hotkeys_popup_custom = require('module.hotkeys-popup')
require('awful.autofocus')
local globalKeys = awful.util.table.join(
awful.key(
{modkey},
"h",
hotkeys_popup_custom.show_help,
{description="show help", group="Awesome"}
),
awful.key(
{modkey},
"Left",
awful.tag.viewprev,
{description = "view previous", group = "Tag"}
),
awful.key(
{modkey},
"Right",
awful.tag.viewnext,
{description = "view next", group = "Tag"}
),
awful.key(
{modkey},
"Escape",
awful.tag.history.restore,
{description = "go back", group = "Tag"}
),
awful.key(
{modkey, "Shift"},
"Right",
function ()
awful.client.focus.byidx( 1)
end,
{description = "focus next by index", group = "Tiling"}
),
awful.key(
{modkey, "Shift"},
"Left",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "Tiling"}
),
-- Layout manipulation
awful.key(
{modkey, "Shift"},
"j",
function ()
awful.client.swap.byidx( 1)
end,
{description = "swap with next client by index", group = "Tiling"}
),
awful.key(
{modkey, "Shift"},
"k",
function ()
awful.client.swap.byidx( -1)
end,
{description = "swap with previous client by index", group = "Tiling"}
),
awful.key(
{modkey, "Shift"},
"s",
function() awful.spawn.with_shell('flameshot gui') end,
{description = "Screenshot selection", group = "Tiling"}
),
awful.key(
{modkey, "Control"},
"j",
function ()
awful.screen.focus_relative( 1)
end,
{description = "focus the next screen", group = "Screen"}
),
awful.key(
{modkey, "Control"},
"k",
function ()
awful.screen.focus_relative(-1)
end,
{description = "focus the previous screen", group = "Screen"}
),
awful.key(
{modkey},
"u",
awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "Tiling"}
),
awful.key(
{modkey},
"Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "Tiling"}
),
-- Default programs
awful.key(
{modkey},
"Return",
function ()
awful.spawn(apps.default.terminal)
end,
{description = "Open Terminal", group = "Default programs"}
),
awful.key(
{modkey},
"e",
function ()
awful.spawn(apps.default.editor)
end,
{description = "Open Atom", group = "Default programs"}
),
awful.key(
{modkey},
"f",
function ()
awful.spawn(apps.default.browser)
end,
{description = "Open Firefox", group = "Default programs"}
),
awful.key(
{modkey},
"t",
function ()
awful.spawn(apps.default.email)
end,
{description = "Open Thunderbird", group = "Default programs"}
),
awful.key(
{modkey},
"d",
function ()
awful.spawn(apps.default.chat)
end,
{description = "Open Discord", group = "Default programs"}
),
awful.key(
{modkey},
"n",
function ()
awful.spawn(apps.default.file_manager)
end,
{description = "Open Nemo", group = "Default programs"}
),
awful.key(
{modkey, "Control"},
"r",
awesome.restart,
{description = "reload awesome", group = "Awesome"}
),
awful.key(
{modkey, "Shift"},
"q",
awesome.quit,
{description = "quit awesome", group = "Awesome"}
),
awful.key(
{modkey},
"Up",
function ()
awful.tag.incmwfact(0.05)
end,
{description = "increase master width factor", group = "Layout"}
),
awful.key(
{modkey},
"Down",
function ()
awful.tag.incmwfact(-0.05)
end,
{description = "decrease master width factor", group = "Layout"}
),
awful.key(
{modkey, "Shift"},
"Up",
function ()
awful.tag.incnmaster( 1, nil, true)
end,
{description = "increase the number of master clients", group = "Layout"}
),
awful.key(
{modkey, "Shift"},
"Down",
function ()
awful.tag.incnmaster(-1, nil, true)
end,
{description = "decrease the number of master clients", group = "Layout"}
),
awful.key(
{modkey, "Control"},
"Up",
function ()
awful.tag.incncol( 1, nil, true)
end,
{description = "increase the number of columns", group = "Layout"}
),
awful.key(
{modkey, "Control"},
"Down",
function ()
awful.tag.incncol(-1, nil, true)
end,
{description = "decrease the number of columns", group = "Layout"}
),
awful.key(
{modkey},
"space",
function ()
awful.layout.inc( 1)
naughty.notify({
preset = naughty.config.presets.low,
title = "Switched Layouts",
text = awful.layout.getname(awful.layout.get(awful.screen.focused())),
})
end,
{description = "select next layout", group = "Layout"}
),
awful.key(
{modkey, "Shift"},
"space",
function ()
awful.layout.inc(-1)
naughty.notify({
preset = naughty.config.presets.low,
title = "Switched Layouts",
text = awful.layout.getname(awful.layout.get(awful.screen.focused())),
})
end,
{description = "select previous layout", group = "Layout"}
),
awful.key(
{modkey, "Control"},
"n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
end,
{description = "restore minimized", group = "Tiling"}
),
--Run DMenu Prompt
awful.key(
{modkey},
"r",
function() awful.util.spawn("rofi -no-lazy-grab -show drun -theme dmenu.rasi") end,
{description = "run dmenu prompt", group = "Launchers"}
),
--Run DMenu Config Prompt
awful.key(
{modkey},
"c",
function() awful.spawn("./.config/dmenu/dmenu-edit-configs.sh") end,
{description = "run dmenu configs prompt", group = "Launchers"}
),
--Run DMenu VPN Prompt
awful.key(
{modkey},
"v",
function() awful.util.spawn("/home/jeremie1001/.config/dmenu/nord-countries.sh") end,
{description = "run dmenu vpn prompt", group = "Launchers"}
),
--Run DMenu Projects Prompt
awful.key(
{modkey},
"p",
function() awful.util.spawn("/home/jeremie1001/.config/dmenu/projectFoldersRofi.sh") end,
{description = "run dmenu projects prompt", group = "Launchers"}
),
--Run Rofi Prompt
awful.key(
{modkey, "Shift"},
"r",
function() awful.spawn.with_shell('rofi -no-lazy-grab -show drun -theme centered.rasi') end,
{description = "run rofi prompt", group = "Launchers"}
),
--Run Rofi Prompt
awful.key(
{modkey, "Shift"},
"w",
function() awful.spawn.with_shell('rofi -no-lazy-grab -show window -theme window.rasi') end,
{description = "run rofi window prompt", group = "Launchers"}
),
awful.key(
{modkey},
"q",
function()
exit_screen_show()
end,
{description = 'toggle exit screen', group = 'Awesome'}
),
awful.key(
{modkey},
"m",
function()
awesome.emit_signal("bar:toggle")
awesome.emit_signal("cc:resize")
awesome.emit_signal("nc:resize")
awesome.emit_signal("cal:resize")
end,
{description = 'toggle top bar', group = 'Awesome'}
),
awful.key(
{modkey},
"k",
function()
awesome.emit_signal("cc:toggle")
end,
{description = 'toggle control center', group = 'Awesome'}
),
awful.key(
{modkey, "Shift"},
"k",
function()
awesome.emit_signal("nc:toggle")
end,
{description = 'toggle notification center', group = 'Awesome'}
),
awful.key(
{modkey, "Shift"},
"l",
function()
awesome.emit_signal("cal:toggle")
end,
{description = 'toggle calendar', group = 'Awesome'}
),
awful.key(
{modkey},
"x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "Awesome"}
)
)
for i = 1, 9 do
globalKeys = awful.util.table.join(globalKeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "Tag"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "Tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "Tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "Tag"})
)
end
return globalKeys
|
if data.raw.item["thorium-fuel-cell"] then
table.insert(data.raw["technology"]["mixed-oxide-fuel"].effects, {type = "unlock-recipe", recipe = "thorium-mixed-oxide"})
local plate="angels-plate-lead"
if mods["bobplates"] then
plate="lead-plate"
end
clowns.functions.replace_ing("thorium-fuel-cell","iron-plate",plate,"ing")
clowns.functions.replace_ing("thorium-mixed-oxide","iron-plate",plate,"ing")
clowns.functions.replace_ing("mixed-oxide","iron-plate",plate,"ing")
clowns.functions.add_to_table("thorium-nuclear-fuel-reprocessing",{type="item", name=plate, amount=5},"ing")
--table.insert(data.raw.recipe["thorium-nuclear-fuel-reprocessing"].ingredients,{type="item", name=plate, amount=5})
clowns.functions.replace_ing("radiothermal-fuel","iron-plate",plate,"ing")
else
table.insert(data.raw["technology"]["nuclear-fuel-reprocessing-2"].effects, {type = "unlock-recipe", recipe = "advanced-nuclear-fuel-reprocessing-2"})
end
angelsmods.functions.make_void("water-radioactive-waste", "water")
|
-- menu.lua
-- Copyright (c) 2018 Jon Thysell
local game = require "game"
local Menu = game.Game:new({
id = "menu",
title = "RetroLove Menu",
caption = "Made with LÖVE",
games = {},
selectedGame = 0,
boxSize = 80,
boxLeftMargin = 10,
})
function Menu:keyReleasedGame(key)
if key == "q" or key == "escape" then
self:exit()
elseif key == "d" then
self.debugMode = not self.debugMode
elseif key == "left" or key == "right" then
self:moveCursor(key)
elseif key == "space" or key == "return" then
self:clickCursor()
end
end
function Menu:touchReleasedGame(id, x, y, dx, dy, pressure)
local gameClick = false
if x > self.canvasOriginX and x < self.canvasOriginX + self.resWidth * self.scale then
-- on the canvas
local boxSize = self.boxSize
local boxTop = (self.resHeight - boxSize) / 2
local boxLeftMargin = self.boxLeftMargin
for i = 1, #self.games do
local boxX = self.margin + (i * boxLeftMargin) + ((i - 1) * boxSize)
local scaledRect = {
x = self.canvasOriginX + boxX * self.scale,
y = self.canvasOriginY + boxTop * self.scale,
width = boxSize * self.scale,
height = boxSize * self.scale,
}
if x > scaledRect.x and x < scaledRect.x + scaledRect.width and y > scaledRect.y and y < scaledRect.y + scaledRect.height then
gameClick = true
if self.selectedGame == i then
self:clickCursor()
else
self.selectedGame = i
end
break;
end
end
end
if not gameClick then
if x > self.screenWidth * .4 and x < self.screenWidth * .6 then
if y > self.screenHeight / 2 then
self.debugMode = not self.debugMode
end
end
end
end
function Menu:drawGame()
-- Draw to canvas
local font = love.graphics.getFont()
love.graphics.setColor({255, 255, 255, 255})
local titleText = tostring(self.title)
love.graphics.print(titleText, (self.resWidth - font:getWidth(titleText)) / 2, (self.resHeight - font:getHeight(titleText)) * 0.1)
local captionText = tostring(self.caption)
love.graphics.print(captionText, (self.resWidth - font:getWidth(captionText)) / 2, (self.resHeight - font:getHeight(captionText)) * 0.9)
if #self.games > 0 then
local boxSize = self.boxSize
local boxTop = (self.resHeight - boxSize) / 2
local boxLeftMargin = self.boxLeftMargin
for i = 1, #self.games do
local boxX = self.margin + (i * boxLeftMargin) + ((i - 1) * boxSize)
love.graphics.setColor({255, 255, 255, 255})
love.graphics.rectangle("line", boxX, boxTop, boxSize, boxSize)
local title = tostring(self.games[i].title)
love.graphics.print(title, boxX + (boxSize - font:getWidth(title)) / 2, (self.resHeight - font:getHeight(title)) / 2)
if self.selectedGame == i then
love.graphics.setColor({0, 255, 255, 255})
love.graphics.rectangle("line", boxX, boxTop, boxSize, boxSize)
love.graphics.print(title, boxX + (boxSize - font:getWidth(title)) / 2, (self.resHeight - font:getHeight(title)) / 2)
end
end
end
love.graphics.setColor({255, 255, 255, 255})
-- Draw Debug Info
if self.debugMode then
local fpsText = "FPS: "..tostring(love.timer.getFPS())
love.graphics.print(fpsText, self.resWidth - (font:getWidth(fpsText) + self.margin / 4), self.resHeight - self.margin + ((self.margin - font:getHeight(fpsText)) / 2))
end
end
function Menu:exitGame()
return nil
end
function Menu:addGame(newGame)
self.games[#self.games + 1] = newGame
end
function Menu:moveCursor(direction)
if #self.games > 0 then
if direction == "left" then
if self.selectedGame == 0 then
self.selectedGame = #self.games
else
self.selectedGame = math.max(1, self.selectedGame - 1)
end
elseif direction == "right" then
if self.selectedGame == 0 then
self.selectedGame = 1
else
self.selectedGame = math.min(#self.games, self.selectedGame + 1)
end
end
print("Cursor on game #"..tostring(self.selectedGame)..": "..tostring(self.games[self.selectedGame].id))
end
end
function Menu:clickCursor()
if self.selectedGame > 0 then
local retrolove = require "retrolove"
local splash = require "splash"
local nextGame = self.games[self.selectedGame]
retrolove.switchGame(splash.Splash:new({
title = "Loading "..nextGame.title.."...",
nextGame = nextGame,
}))
end
end
return {
Menu = Menu
} |
print((string.gsub("hello, up-down!", "%A", ".")))
|
local iHelpers = require("KnownUserImplementationHelpers")
local knownUser = require("KnownUser")
local utils = require("Utils")
iHelpers.system.getConnectorName = function()
return "nginx-" .. ngx.config.nginx_version
end
iHelpers.json.parse = function(jsonStr)
local json = require("json")
return json.parse(jsonStr)
end
iHelpers.hash.hmac_sha256_encode = function(message, key)
local sha2 = require("sha2")
return sha2.hmac(sha2.sha256, key, message)
end
iHelpers.request.getHeader = function(name)
return ngx.req.get_headers()[name]
end
iHelpers.request.getBody = function()
ngx.req.read_body()
return ngx.req.get_body_data()
end
iHelpers.request.getUnescapedCookieValue = function(name)
local key = "cookie_" .. name
local value = ngx.var[key]
if (value ~= nil) then
return utils.urlDecode(value)
end
return value
end
iHelpers.request.getUserHostAddress = function()
return ngx.var.remote_addr
end
iHelpers.response.setCookie = function(name, value, expire, domain)
-- lua_mod only supports 1 Set-Cookie header (because 'header' is a table).
-- So calling this method (setCookie) multiple times will not work as expected.
-- In this case final call will apply.
if (domain == nil) then
domain = ""
end
if (value == nil) then
value = ""
end
value = utils.urlEncode(value)
local expire_text = ''
if expire ~= nil and type(expire) == "number" and expire > 0 then
expire_text = '; Expires=' .. os.date("!%a, %d %b %Y %H:%M:%S GMT", expire)
end
ngx.header["Set-Cookie"] = name .. '=' .. value
.. expire_text
.. (domain ~= "" and '; Domain=' .. domain or '')
.. (iHelpers.response.cookieOptions.httpOnly and '; HttpOnly' or '')
.. (iHelpers.response.cookieOptions.secure and '; Secure' or '')
.. '; Path=/;'
end
iHelpers.request.getAbsoluteUri = function()
return ngx.var.scheme .. "://" .. ngx.var.http_host .. ngx.var.request_uri
end
local aHandler = {}
aHandler.setOptions = function(options)
if (options == nil) then
error('invalid options')
end
if (options.secure) then
iHelpers.response.cookieOptions.secure = true
else
iHelpers.response.cookieOptions.secure = false
end
if (options.httpOnly) then
iHelpers.response.cookieOptions.httpOnly = true
else
iHelpers.response.cookieOptions.httpOnly = false
end
end
aHandler.handleByIntegrationConfig = function(customerId, secretKey, integrationConfigJson)
local queueitToken = ''
if (ngx.var.arg_queueittoken ~= nil) then
queueitToken = ngx.var.arg_queueittoken
end
local fullUrl = iHelpers.request.getAbsoluteUri()
local currentUrlWithoutQueueitToken = fullUrl:gsub("([\\%?%&])(" .. knownUser.QUEUEIT_TOKEN_KEY .. "=[^&]*)", "")
local validationResult = knownUser.validateRequestByIntegrationConfig(
currentUrlWithoutQueueitToken, queueitToken, integrationConfigJson, customerId, secretKey)
if (validationResult:doRedirect()) then
-- Adding no cache headers to prevent browsers to cache requests
ngx.header["Cache-Control"] = "no-cache, no-store, must-revalidate, max-age=0"
ngx.header["Pragma"] = "no-cache"
ngx.header["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
-- end
if (validationResult.isAjaxResult) then
ngx.header[validationResult.getAjaxQueueRedirectHeaderKey()] = validationResult:getAjaxRedirectUrl()
else
ngx.redirect(validationResult.redirectUrl)
ngx.exit(ngx.HTTP_MOVED_TEMPORARILY)
end
else
-- Request can continue
-- - we remove queueittoken form querystring parameter to avoid sharing of user specific token
if (fullUrl ~= currentUrlWithoutQueueitToken and validationResult.actionType == "Queue") then
ngx.redirect(currentUrlWithoutQueueitToken)
ngx.exit(ngx.HTTP_MOVED_TEMPORARILY)
end
end
ngx.exit(ngx.OK)
end
return aHandler |
-- config: (lint (only var:unresolved-member) (dynamic-modules a_module))
local a_module, b_module = require("a_module"), require("b_module")
print(a_module.unknown)
print(b_module.unknown)
|
-- very simple lexer program which looks at all identifiers in a Lua
-- file and checks whether they're in the global namespace.
-- At the end, we dump out the result of count_map, which will give us
-- unique identifiers with their usage count.
-- (an example of a program which itself needs to be careful about what
-- goes into the global namespace)
local utils = require 'pl.utils'
local file = require 'pl.file'
local lexer = require 'pl.lexer'
local List = require 'pl.List'
local pretty = require 'pl.pretty'
local seq = require 'pl.seq'
utils.on_error 'quit'
local txt,err = file.read(arg[1] or 'testglobal.lua')
local globals = List()
for t,v in lexer.lua(txt) do
if t == 'iden' and rawget(_G,v) then
globals:append(v)
end
end
pretty.dump(seq.count_map(globals))
|
-- language specific higlights
local lush = require("lush")
local base = require("lush_jsx.base")
local styles = require("lush_jsx.settings").styles
local M = {}
M = lush(function()
return {
clojureKeyword {base.LushJSXBlue},
clojureCond {base.LushJSXOrange},
clojureSpecial {base.LushJSXOrange},
clojureDefine {base.LushJSXOrange},
clojureFunc {base.LushJSXYellow},
clojureRepeat {base.LushJSXYellow},
clojureCharacter {base.LushJSXAqua},
clojureStringEscape {base.LushJSXAqua},
clojureException {base.LushJSXRed},
clojureRegexp {base.LushJSXAqua},
clojureRegexpEscape {base.LushJSXAqua},
clojureParen {base.LushJSXFg3},
clojureAnonArg {base.LushJSXYellow},
clojureVariable {base.LushJSXBlue},
clojureMacro {base.LushJSXOrange},
clojureMeta {base.LushJSXYellow},
clojureDeref {base.LushJSXYellow},
clojureQuote {base.LushJSXYellow},
clojureUnquote {base.LushJSXYellow},
clojureRegexpCharClass {fg = base.LushJSXFg3.fg.hex, gui = styles.bold},
clojureRegexpMod {clojureRegexpCharClass},
clojureRegexpQuantifier {clojureRegexpCharClass},
}
end)
return M
|
local opts = require("nvim-scratchpad.config").options
local type_assert = require("nvim-scratchpad.helpers").type_assert
local M = {}
M.setup = function (custom_opts)
require("nvim-scratchpad.config").set_options(custom_opts)
end
M.scratchpad = function (ext)
local dir
if type(opts.scratchpad_dir) == "function" then
dir = opts.scratchpad_dir()
type_assert(dir, "string", "scratchpad_dir() doesn't return a string")
elseif type(opts.scratchpad_dir) == "string" then
dir = opts.scratchpad_dir
else
error("scratchpad_dir is not a function or a string")
end
type_assert(opts.filename_generator, "function", "filename_generator is not a function")
local filename = opts.filename_generator(ext)
type_assert(filename, "string", "filename_generator did not return string")
local filepath = dir .. "/" .. filename
-- Make that file, clearing it if it already exists
local file = io.open(filepath, "w")
io.input(file)
io.write("")
io.close(file)
-- Open it in vim
vim.cmd("edit " .. filepath)
-- Buffer close hook
vim.api.nvim_exec([[
augroup NvimScratchpadLeave
autocmd! * <buffer>
autocmd BufWinLeave <buffer> :lua require("nvim-scratchpad").cleanup(vim.fn.expand("<afile>"))
augroup END
]], true);
end
--- @param filepath string The path to the file
M.cleanup = function (filepath)
type_assert(opts.cleanup_fn, "function", "cleanup_fn is not a function")
opts.cleanup_fn(filepath)
end
return M
|
object_tangible_item_beast_converted_murra_decoration = object_tangible_item_beast_shared_converted_murra_decoration:new {
}
ObjectTemplates:addTemplate(object_tangible_item_beast_converted_murra_decoration, "object/tangible/item/beast/converted_murra_decoration.iff")
|
local t = {}
t.init = {x = 2, y = 2}
t.layout = {}
t.layout[1] = {
{0, 0, 6, 0, 0},
{0, 2, 2, 0, 1},
{5, 3, 6, 2, 6},
{0, 2, 2, 0, 1},
{0, 0, 6, 0, 0}
}
t.moves = {4, 5}
return t
|
--[[
LuCI - Lua Configuration Interface
Copyright 2019 lisaac <lisaac.cn@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
require "luci.util"
local uci = luci.model.uci.cursor()
local docker = require "luci.model.docker"
local dk = docker.new()
function get_images()
local images = dk.images:list().body
local data = {}
for i, v in ipairs(images) do
local index = v.Created .. v.Id
data[index]={}
data[index]["_selected"] = 0
data[index]["_id"] = v.Id:sub(8,20)
data[index]["_containers"] = tostring(v.Containers)
if v.RepoTags then
data[index]["_tags"] = v.RepoTags[1]
else
_,_, data[index]["_tags"] = v.RepoDigests[1]:find("^(.-)@.+")
data[index]["_tags"]=data[index]["_tags"]..":none"
end
data[index]["_size"] = string.format("%.2f", tostring(v.Size/1024/1024)).."MB"
data[index]["_created"] = os.date("%Y/%m/%d %H:%M:%S",v.Created)
end
return data
end
local image_list = get_images()
-- m = Map("docker", translate("Docker"))
m = SimpleForm("docker", translate("Docker"))
m.submit=false
m.reset=false
local pull_value={{_image_tag_name="", _registry="index.docker.io"}}
local pull_section = m:section(Table,pull_value, "Pull Image")
pull_section.template="cbi/nullsection"
local tag_name = pull_section:option(Value, "_image_tag_name")
tag_name.template="cbi/inlinevalue"
tag_name.placeholder="lisaac/luci:latest"
local registry = pull_section:option(Value, "_registry")
registry.template="cbi/inlinevalue"
registry:value("index.docker.io", "DockerHub")
local action_pull = pull_section:option(Button, "_pull")
action_pull.inputtitle= translate("Pull")
action_pull.template="cbi/inlinebutton"
action_pull.inputstyle = "add"
tag_name.write = function(self, section,value)
local hastag = value:find(":")
if not hastag then
value = value .. ":latest"
end
pull_value[section]["_image_tag_name"] = value
end
registry.write = function(self, section,value)
pull_value[section]["_registry"] = value
end
action_pull.write = function(self, section)
local tag = pull_value[section]["_image_tag_name"]
local server = pull_value[section]["_registry"]
--去掉协议前缀和后缀
local _,_,tmp = server:find(".-://([%.%w%-%_]+)")
if not tmp then
_,_,server = server:find("([%.%w%-%_]+)")
end
local json_stringify = luci.json and luci.json.encode or luci.jsonc.stringify
if tag then
docker:clear_status()
docker:append_status("Images: " .. "pulling" .. " " .. tag .. "...")
local x_auth = nixio.bin.b64encode(json_stringify({serveraddress= server}))
local msg = dk.images:create(nil, {fromImage=tag,_header={["X-Registry-Auth"]=x_auth}})
if msg.code >=300 then
docker:append_status("fail code:" .. msg.code.." ".. (msg.body.message and msg.body.message or msg.message).. "<br>")
else
docker:append_status("done<br>")
end
luci.http.redirect(luci.dispatcher.build_url("admin/docker/images"))
end
end
image_table = m:section(Table, image_list, translate("Images"))
image_selecter = image_table:option(Flag, "_selected","")
image_selecter.disabled = 0
image_selecter.enabled = 1
image_selecter.default = 0
image_id = image_table:option(DummyValue, "_id", translate("ID"))
image_table:option(DummyValue, "_containers", translate("Containers"))
image_table:option(DummyValue, "_tags", translate("RepoTags"))
image_table:option(DummyValue, "_size", translate("Size"))
image_table:option(DummyValue, "_created", translate("Created"))
image_selecter.write = function(self, section, value)
image_list[section]._selected = value
end
docker_status = m:section(SimpleSection)
docker_status.template="docker/apply_widget"
docker_status.err=nixio.fs.readfile(dk.options.status_path)
if docker_status then docker:clear_status() end
action = m:section(Table,{{}})
action.notitle=true
action.rowcolors=false
action.template="cbi/nullsection"
btnremove = action:option(Button, "remove")
btnremove.inputtitle= translate("Remove")
btnremove.template="cbi/inlinebutton"
btnremove.inputstyle = "remove"
btnremove.forcewrite = true
btnremove.write = function(self, section)
local image_selected = {}
-- 遍历table中sectionid
local image_table_sids = image_table:cfgsections()
for _, image_table_sid in ipairs(image_table_sids) do
-- 得到选中项的名字
if image_list[image_table_sid]._selected == 1 then
image_selected[#image_selected+1] = image_id:cfgvalue(image_table_sid)
end
end
if next(image_selected) ~= nil then
local success = true
docker:clear_status()
for _,img in ipairs(image_selected) do
docker:append_status("Images: " .. "remove" .. " " .. img .. "...")
local msg = dk.images["remove"](dk, img)
if msg.code ~= 200 then
docker:append_status("fail code:" .. msg.code.." ".. (msg.body.message and msg.body.message or msg.message).. "<br>")
success = false
else
docker:append_status("done<br>")
end
end
if success then docker:clear_status() end
luci.http.redirect(luci.dispatcher.build_url("admin/docker/images"))
end
end
return m |
local Dictionary = {
copy = require(script.copy),
copyDeep = require(script.copyDeep),
count = require(script.count),
equals = require(script.equals),
equalsDeep = require(script.equalsDeep),
every = require(script.every),
filter = require(script.filter),
flatten = require(script.flatten),
flip = require(script.flip),
fromLists = require(script.fromLists),
has = require(script.has),
includes = require(script.includes),
join = require(script.merge),
joinDeep = require(script.mergeDeep),
keys = require(script.keys),
map = require(script.map),
merge = require(script.merge),
mergeDeep = require(script.mergeDeep),
removeKey = require(script.removeKey),
removeKeys = require(script.removeKeys),
removeValue = require(script.removeValue),
removeValues = require(script.removeValues),
set = require(script.set),
some = require(script.some),
update = require(script.update),
values = require(script.values),
}
table.freeze(Dictionary)
return Dictionary
|
local gui = require 'yue.gui'
local ev = require 'gui.event'
local ca = require 'gui.new.common_attribute'
local function tree_icon(view)
local canvas1 = gui.Canvas.createformainscreen{width=24, height=24}
local painter = canvas1:getpainter()
painter:setfillcolor('#CCC')
painter:beginpath()
painter:moveto(4, 4)
painter:lineto(20, 4)
painter:lineto(12, 20)
painter:lineto(4, 4)
painter:closepath()
painter:fill()
local canvas2 = gui.Canvas.createformainscreen{width=24, height=24}
local painter = canvas2:getpainter()
painter:setfillcolor('#CCC')
painter:beginpath()
painter:moveto(4, 4)
painter:lineto(4, 20)
painter:lineto(20, 12)
painter:lineto(4, 4)
painter:closepath()
painter:fill()
function view.ondraw(self, painter, dirty)
if self.select then
painter:drawcanvas(canvas1, {x=0, y=0, width=24, height=24})
else
painter:drawcanvas(canvas2, {x=0, y=0, width=24, height=24})
end
end
end
local function tree_label(t)
local label = gui.Label.create(t.text)
label:setstyle { Height = 24, Top = 2, Left = 24 }
label:setalign 'start'
ca.font(label, t)
return label
end
local function tree_button(t, children)
local btn = gui.Container.create()
btn:setstyle { Height = 24, FlexGrow = 1 }
btn.select = t.select or false
local function update_select()
if btn.select then
children:setvisible(true)
else
children:setvisible(false)
end
end
update_select()
function btn:onmousedown()
self.select = not self.select
update_select()
self:schedulepaint()
end
btn:addchildview(tree_label(t))
tree_icon(btn)
return btn
end
local function tree_children(t, btn)
return gui.Container.create()
end
return function (t, data)
local o = gui.Container.create()
if t.style then
o:setstyle(t.style)
end
local children = tree_children(t)
children:setstyle { Padding = 4 }
local btn = tree_button(t, children)
local bind = {}
ca.button_color(btn, btn, t, data, bind)
o:addchildview(btn)
o:addchildview(children)
return o, function (self, child)
children:addchildview(child)
end
end
|
local test_env = require("test/test_environment")
test_env.unload_luarocks()
local fs = require("luarocks.fs")
local is_win = test_env.TEST_TARGET_OS == "windows"
describe("Luarocks fs test #whitebox #w_fs", function()
describe("fs.Q", function()
it("simple argument", function()
assert.are.same(is_win and '"foo"' or "'foo'", fs.Q("foo"))
end)
it("argument with quotes", function()
assert.are.same(is_win and [["it's \"quoting\""]] or [['it'\''s "quoting"']], fs.Q([[it's "quoting"]]))
end)
it("argument with special characters", function()
assert.are.same(is_win and [["\\"%" \\\\" \\\\\\"]] or [['\% \\" \\\']], fs.Q([[\% \\" \\\]]))
end)
end)
end)
|
CHIP_DATA_ADDRESS = {}
CHIP_DATA_ADDRESS.BASE_OFFSET_FIRST_CHIP = 0x08011530
CHIP_DATA_ADDRESS.BYTES_PER_CHIP = 32
function CHIP_DATA_ADDRESS.from_id(id)
return CHIP_DATA_ADDRESS.BASE_OFFSET_FIRST_CHIP + (id - 1) * CHIP_DATA_ADDRESS.BYTES_PER_CHIP
end
return CHIP_DATA_ADDRESS |
local take = package.loaded.take
take.utils = {}
function take.utils.basename2lib(name)
if jit.os == 'Windows' then
return name .. '.dll'
elseif jit.os == 'OSX' then
return 'lib' .. name .. '.dylib'
else
return 'lib' .. name .. '.so'
end
end
function take.utils.basename2exe(name)
if jit.os == 'Windows' then
return str .. '.exe'
else
return str
end
end
|
local Plugin = Plugin
function Plugin:Initialise()
self.Enabled = true
end
function Plugin:Cleanup()
self.BaseClass.Cleanup( self )
self.Enabled = false
end
--necessary to enable the evolve button during PGP
function Plugin:Think( DeltaTime )
if Plugin.dt.PGP_On then
Client.GetLocalPlayer().gameStarted = true
end
end |
local M_PI = math.pi
local sw, sh = stage:getSize()
stage:addChild(DisplayImage.new(Image.new("assets/images/bg.png"):extend(sw, sh, "repeat")))
local car0 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 0)
local car1 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 1)
local car2 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 2)
local car3 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 3)
local car4 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 4)
local car5 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 5)
local car6 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 6)
local car7 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 7)
local car8 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 8)
local car9 = assets:loadDisplay("assets/images/car.png"):setPosition(0, 48 * 9)
stage:addTimer(Timer.new(1.5, 0, function(t)
car0:setPosition(0, 48 * 0):animate({x = sw - 98, y = 48 * 0}, 1, "linear")
car1:setPosition(0, 48 * 1):animate({x = sw - 98, y = 48 * 1}, 1, "sine-in")
car2:setPosition(0, 48 * 2):animate({x = sw - 98, y = 48 * 2}, 1, "sine-out")
car3:setPosition(0, 48 * 3):animate({x = sw - 98, y = 48 * 3}, 1, "sine-in-out")
car4:setPosition(0, 48 * 4):animate({x = sw - 98, y = 48 * 4}, 1, "quad-in")
car5:setPosition(0, 48 * 5):animate({x = sw - 98, y = 48 * 5}, 1, "quad-out")
car6:setPosition(0, 48 * 6):animate({x = sw - 98, y = 48 * 6}, 1, "quad-in-out")
car7:setPosition(0, 48 * 7):animate({x = sw - 98, y = 48 * 7}, 1, "cubic-in")
car8:setPosition(0, 48 * 8):animate({x = sw - 98, y = 48 * 8}, 1, "cubic-out")
car9:setPosition(0, 48 * 9):animate({x = sw - 98, y = 48 * 9}, 1, "cubic-in-out")
end))
stage:addChild(car0)
stage:addChild(car1)
stage:addChild(car2)
stage:addChild(car3)
stage:addChild(car4)
stage:addChild(car5)
stage:addChild(car6)
stage:addChild(car7)
stage:addChild(car8)
stage:addChild(car9)
|
-- destroy random monsters
set_post_entity_spawn(function(ent, flags)
ent.flags = set_flag(ent.flags, ENT_FLAG.DEAD)
ent:destroy()
end, SPAWN_TYPE.LEVEL_GEN_GENERAL, 0, ENT_TYPE.MONS_SKELETON, ENT_TYPE.MONS_BAT, ENT_TYPE.MONS_SCARAB)
-- destroy treasure, random pots
set_post_entity_spawn(function(ent, flags)
ent.flags = set_flag(ent.flags, ENT_FLAG.DEAD)
ent:destroy()
end, SPAWN_TYPE.LEVEL_GEN_GENERAL, MASK.ITEM)
-- destroy embed treasure and items
-- set_post_entity_spawn(function(ent, flags)
-- if ent.overlay and (ent.overlay.type.search_flags & MASK.FLOOR) > 0 then
-- ent.flags = set_flag(ent.flags, ENT_FLAG.DEAD)
-- ent:destroy()
-- end
-- end, SPAWN_TYPE.LEVEL_GEN_TILE_CODE, 0, crust_items)
-- entrance with no textures or pots, just the player
define_tile_code("entrance_nocrap")
set_pre_tile_code_callback(function(x, y, layer)
spawn_grid_entity(ENT_TYPE.FLOOR_DOOR_ENTRANCE, x, y, layer)
state.level_gen.spawn_x = x
state.level_gen.spawn_y = y
local rx, ry = get_room_index(x, y)
state.level_gen.spawn_room_x = rx
state.level_gen.spawn_room_y = ry
return true
end, "entrance_nocrap") |
vim.g.onedark_dark_sidebar = false
vim.api.nvim_command [[colorscheme onedark]]
|
-- libunbound based net.adns replacement for Prosody IM
-- Copyright (C) 2012-2015 Kim Alvefur
-- Copyright (C) 2012 Waqas Hussain
--
-- This file is MIT licensed.
local setmetatable = setmetatable;
local table = table;
local t_concat = table.concat;
local t_insert = table.insert;
local s_byte = string.byte;
local s_char = string.char;
local s_format = string.format;
local s_gsub = string.gsub;
local s_sub = string.sub;
local s_match = string.match;
local s_gmatch = string.gmatch;
local chartohex = {};
for c = 0, 255 do
chartohex[s_char(c)] = s_format("%02X", c);
end
local function tohex(s)
return (s_gsub(s, ".", chartohex));
end
-- Converted from
-- http://www.iana.org/assignments/dns-parameters
-- 2015-05-19
local classes = {
IN = 1; "IN";
nil;
CH = 3; "CH";
HS = 4; "HS";
};
local types = {
"A";"NS";"MD";"MF";"CNAME";"SOA";"MB";"MG";"MR";"NULL";"WKS";"PTR";"HINFO";
"MINFO";"MX";"TXT";"RP";"AFSDB";"X25";"ISDN";"RT";"NSAP";"NSAP-PTR";"SIG";
"KEY";"PX";"GPOS";"AAAA";"LOC";"NXT";"EID";"NIMLOC";"SRV";"ATMA";"NAPTR";
"KX";"CERT";"A6";"DNAME";"SINK";"OPT";"APL";"DS";"SSHFP";"IPSECKEY";"RRSIG";
"NSEC";"DNSKEY";"DHCID";"NSEC3";"NSEC3PARAM";"TLSA";[55]="HIP";[56]="NINFO";
[57]="RKEY";[58]="TALINK";[59]="CDS";[60]="CDNSKEY";[61]="OPENPGPKEY";
[62]="CSYNC";TLSA=52;NS=2;[249]="TKEY";[251]="IXFR";NSAP=22;UID=101;APL=42;
MG=8;NIMLOC=32;DHCID=49;TALINK=58;HINFO=13;MINFO=14;EID=31;DS=43;CSYNC=62;
RKEY=57;TKEY=249;NID=104;NAPTR=35;RT=21;LP=107;L32=105;KEY=25;MD=3;MX=15;
A6=38;KX=36;PX=26;CAA=257;WKS=11;TSIG=250;MAILA=254;CDS=59;SINK=40;LOC=29;
DLV=32769;[32769]="DLV";TA=32768;[32768]="TA";GID=102;IXFR=251;MAILB=253;
[256]="URI";[250]="TSIG";[252]="AXFR";NSEC=47;HIP=55;[254]="MAILA";[255]="*";
NSEC3PARAM=51;["*"]=255;URI=256;[253]="MAILB";AXFR=252;SPF=99;NXT=30;AFSDB=18;
EUI48=108;NINFO=56;CDNSKEY=60;ISDN=20;L64=106;SRV=33;DNSKEY=48;X25=19;TXT=16;
RRSIG=46;OPENPGPKEY=61;DNAME=39;CNAME=5;EUI64=109;A=1;MR=9;IPSECKEY=45;OPT=41;
UNSPEC=103;["NSAP-PTR"]=23;[103]="UNSPEC";[257]="CAA";UINFO=100;[99]="SPF";
MF=4;[101]="UID";[102]="GID";SOA=6;[104]="NID";[105]="L32";[106]="L64";
[107]="LP";[108]="EUI48";[109]="EUI64";NSEC3=50;RP=17;PTR=12;[100]="UINFO";
NULL=10;AAAA=28;MB=7;GPOS=27;SSHFP=44;CERT=37;SIG=24;ATMA=34
};
local errors = {
NoError = "No Error"; [0] = "NoError";
FormErr = "Format Error"; "FormErr";
ServFail = "Server Failure"; "ServFail";
NXDomain = "Non-Existent Domain"; "NXDomain";
NotImp = "Not Implemented"; "NotImp";
Refused = "Query Refused"; "Refused";
YXDomain = "Name Exists when it should not"; "YXDomain";
YXRRSet = "RR Set Exists when it should not"; "YXRRSet";
NXRRSet = "RR Set that should exist does not"; "NXRRSet";
NotAuth = "Server Not Authoritative for zone"; "NotAuth";
NotZone = "Name not contained in zone"; "NotZone";
};
-- Simplified versions of Waqas DNS parsers
-- Only the per RR parsers are needed and only feed a single RR
local parsers = {};
-- No support for pointers, but libunbound appears to take care of that.
local function readDnsName(packet, pos)
local pack_len, r, len = #packet, {};
pos = pos or 1;
repeat
len = s_byte(packet, pos) or 0;
t_insert(r, s_sub(packet, pos + 1, pos + len));
pos = pos + len + 1;
until len == 0 or pos >= pack_len;
return t_concat(r, "."), pos;
end
-- These are just simple names.
parsers.CNAME = readDnsName;
parsers.NS = readDnsName
parsers.PTR = readDnsName;
local soa_mt = {
__tostring = function(rr)
return s_format("%s %s %d %d %d %d %d", rr.mname, rr.rname, rr.serial, rr.refresh, rr.retry, rr.expire, rr.minimum);
end
};
function parsers.SOA(packet)
local mname, rname, offset;
mname, offset = readDnsName(packet, 1);
rname, offset = readDnsName(packet, offset);
-- Extract all the bytes of these fields in one call
local
s1, s2, s3, s4, -- serial
r1, r2, r3, r4, -- refresh
t1, t2, t3, t4, -- retry
e1, e2, e3, e4, -- expire
m1, m2, m3, m4 -- minimum
= s_byte(packet, offset, offset + 19);
return setmetatable({
mname = mname;
rname = rname;
serial = s1*0x1000000 + s2*0x10000 + s3*0x100 + s4;
refresh = r1*0x1000000 + r2*0x10000 + r3*0x100 + r4;
retry = t1*0x1000000 + t2*0x10000 + t3*0x100 + t4;
expire = e1*0x1000000 + e2*0x10000 + e3*0x100 + e4;
minimum = m1*0x1000000 + m2*0x10000 + m3*0x100 + m4;
}, soa_mt);
end
function parsers.A(packet)
return s_format("%d.%d.%d.%d", s_byte(packet, 1, 4));
end
local aaaa = { nil, nil, nil, nil, nil, nil, nil, nil, };
function parsers.AAAA(packet)
local hi, lo, ip, len, token;
for i=1,8 do
hi, lo = s_byte(packet, i*2-1, i*2);
aaaa[i] = s_format("%x", hi*256+lo); -- skips leading zeros
end
ip = t_concat(aaaa, ":", 1, 8);
len = (s_match(ip, "^0:[0:]+()") or 1) - 1;
for s in s_gmatch(ip, ":0:[0:]+") do
if len < #s then len,token = #s,s; end -- find longest sequence of zeros
end
return (s_gsub(ip, token or "^0:[0:]+", "::", 1));
end
local mx_mt = {
__tostring = function(rr)
return s_format("%d %s", rr.pref, rr.mx)
end
};
function parsers.MX(packet)
local name = readDnsName(packet, 3);
local b1,b2 = s_byte(packet, 1, 2);
return setmetatable({
pref = b1*256+b2;
mx = name;
}, mx_mt);
end
local srv_mt = {
__tostring = function(rr)
return s_format("%d %d %d %s", rr.priority, rr.weight, rr.port, rr.target);
end
};
function parsers.SRV(packet)
local name = readDnsName(packet, 7);
local b1,b2,b3,b4,b5,b6 = s_byte(packet, 1, 6);
return setmetatable({
priority = b1*256+b2;
weight = b3*256+b4;
port = b5*256+b6;
target = name;
}, srv_mt);
end
local txt_mt = { __tostring = t_concat };
function parsers.TXT(packet)
local pack_len = #packet;
local r, pos, len = {}, 1;
repeat
len = s_byte(packet, pos) or 0;
t_insert(r, s_sub(packet, pos + 1, pos + len));
pos = pos + len + 1;
until pos >= pack_len;
return setmetatable(r, txt_mt);
end
parsers.SPF = parsers.TXT;
-- Acronyms from RFC 7218
local tlsa_usages = {
[0] = "PKIX-CA",
[1] = "PKIX-EE",
[2] = "DANE-TA",
[3] = "DANE-EE",
[255] = "PrivCert",
};
local tlsa_selectors = {
[0] = "Cert",
[1] = "SPKI",
[255] = "PrivSel",
};
local tlsa_match_types = {
[0] = "Full",
[1] = "SHA2-256",
[2] = "SHA2-512",
[255] = "PrivMatch",
};
local tlsa_mt = {
__tostring = function(rr)
return s_format("%s %s %s %s", tlsa_usages[rr.use] or rr.use, tlsa_selectors[rr.select] or rr.select, tlsa_match_types[rr.match] or rr.match, tohex(rr.data));
end;
__index = {
getUsage = function(rr) return tlsa_usages[rr.use] end;
getSelector = function(rr) return tlsa_selectors[rr.select] end;
getMatchType = function(rr) return tlsa_match_types[rr.match] end;
}
};
function parsers.TLSA(packet)
local use, select, match = s_byte(packet, 1,3);
return setmetatable({
use = use;
select = select;
match = match;
data = s_sub(packet, 4);
}, tlsa_mt);
end
local params = {
TLSA = {
use = tlsa_usages;
select = tlsa_selectors;
match = tlsa_match_types;
};
};
local fallback_mt = {
__tostring = function(rr)
return s_format([[\# %d %s]], #rr.raw, tohex(rr.raw));
end;
};
local function fallback_parser(packet)
return setmetatable({ raw = packet },fallback_mt);
end
setmetatable(parsers, { __index = function() return fallback_parser end });
return {
parsers = parsers,
classes = classes,
types = types,
errors = errors,
params = params,
};
|
Keybind.g(
{
{
'x',
'iu',
':lua require"treesitter-unit".select()<CR>',
{ noremap = true },
},
{
'x',
'au',
':lua require"treesitter-unit".select(true)<CR>',
{ noremap = true },
},
{
'o',
'u',
':<c-u>lua require"treesitter-unit".select()<CR>',
{ noremap = true },
},
{
'o',
'au',
':<c-u>lua require"treesitter-unit".select(true)<CR>',
{ noremap = true },
},
})
|
include "shared.lua"
include "cl_draw.lua"
include "cl_fullscreen.lua"
include "net.lua"
local CeilPower2 = MediaPlayerUtils.CeilPower2
function MEDIAPLAYER:NetReadUpdate()
-- Allows for another media player type to extend update net messages
end
function MEDIAPLAYER:OnNetReadMedia( media )
-- Allows for another media player type to extend media net messages
end
function MEDIAPLAYER:OnQueueKeyPressed( down, held )
self._LastMediaUpdate = RealTime()
end
--[[---------------------------------------------------------
Networking
-----------------------------------------------------------]]
local function OnMediaUpdate( len )
local mpId = net.ReadString()
local mpType = net.ReadString()
if MediaPlayer.DEBUG then
print( "Received MEDIAPLAYER.Update", mpId, mpType )
end
local mp = MediaPlayer.GetById(mpId)
if not mp then
mp = MediaPlayer.Create( mpId, mpType )
end
-- Read owner; may be NULL
local owner = net.ReadEntity()
if IsValid( owner ) then
mp:SetOwner( owner )
end
local state = mp.net.ReadPlayerState()
local queueRepeat = net.ReadBool()
mp:SetQueueRepeat( queueRepeat )
local queueShuffle = net.ReadBool()
mp:SetQueueShuffle( queueShuffle )
local queueLocked = net.ReadBool()
mp:SetQueueLocked( queueLocked )
-- Read extended update information
mp:NetReadUpdate()
-- Clear old queue
mp:ClearMediaQueue()
-- Read queue information
local count = net.ReadUInt( mp:GetQueueLimit(true) )
for i = 1, count do
local media = mp.net.ReadMedia()
mp:OnNetReadMedia(media)
mp:AddMedia(media)
end
mp:QueueUpdated()
mp:SetPlayerState( state )
hook.Run( "OnMediaPlayerUpdate", mp )
end
net.Receive( "MEDIAPLAYER.Update", OnMediaUpdate )
local function OnMediaSet( len )
if MediaPlayer.DEBUG then
print( "Received MEDIAPLAYER.Media" )
end
local mpId = net.ReadString()
local mp = MediaPlayer.GetById(mpId)
if not mp then
if MediaPlayer.DEBUG then
ErrorNoHalt("Received media for invalid mediaplayer\n")
print("ID: " .. tostring(mpId))
debug.Trace()
end
return
end
if mp:GetPlayerState() >= MP_STATE_PLAYING then
mp:OnMediaFinished()
mp:QueueUpdated()
end
local media = mp.net.ReadMedia()
if media then
local startTime = mp.net.ReadTime()
media:StartTime( startTime )
mp:OnNetReadMedia(media)
local state = mp:GetPlayerState()
if state == MP_STATE_PLAYING then
media:Play()
else
media:Pause()
end
end
mp:SetMedia( media )
end
net.Receive( "MEDIAPLAYER.Media", OnMediaSet )
local function OnMediaRemoved( len )
if MediaPlayer.DEBUG then
print( "Received MEDIAPLAYER.Remove" )
end
local mpId = net.ReadString()
local mp = MediaPlayer.GetById(mpId)
if not mp then return end
mp:Remove()
end
net.Receive( "MEDIAPLAYER.Remove", OnMediaRemoved )
local function OnMediaSeek( len )
local mpId = net.ReadString()
local mp = MediaPlayer.GetById(mpId)
if not ( mp and (mp:GetPlayerState() >= MP_STATE_PLAYING) ) then return end
local startTime = mp.net.ReadTime()
if MediaPlayer.DEBUG then
print( "Received MEDIAPLAYER.Seek", mpId, startTime )
end
local media = mp:CurrentMedia()
if media then
media:StartTime( startTime )
else
ErrorNoHalt('ERROR: MediaPlayer received seek message while no media is playing' ..
'[' .. mpId .. ']\n')
MediaPlayer.RequestUpdate( mp )
end
end
net.Receive( "MEDIAPLAYER.Seek", OnMediaSeek )
local function OnMediaPause( len )
local mpId = net.ReadString()
local mp = MediaPlayer.GetById(mpId)
if not mp then return end
local state = mp.net.ReadPlayerState()
if MediaPlayer.DEBUG then
print( "Received MEDIAPLAYER.Pause", mpId, state )
end
mp:SetPlayerState( state )
end
net.Receive( "MEDIAPLAYER.Pause", OnMediaPause )
|
local Timer = require "lib.timer"
local info_state = {
load = function(self)
self.font = love.graphics.newFont("assets/mr_pixel/Mister Pixel Regular.otf", 40)
love.graphics.setFont(self.font)
self.opening_text = [[
I am Defne. My dad thinks I eat a lot
of chocolate, and he didn't buy me
chocolate today. However, I did not eat
them every day! I remember that I
stacked some chocolates in my room. Now
help me to find the chocolates in my
room full of toys.
PRESS SPACE TO START THE GAME
]]
-- Timer.after(20, function()
-- sm:setState("game_state")
-- end)
end,
update = function(self, dt)
end,
draw = function(self, dt, alpha)
love.graphics.clear(43 / 255, 40 / 255, 33 / 255, 1)
love.graphics.setColor(121 / 255, 121 / 255, 121 / 255, alpha)
love.graphics.print(self.opening_text, (680 - self.font:getWidth(self.opening_text)) / 2,
(680 - self.font:getHeight(self.opening_text)) / 4)
end,
keypressed = function(self, key)
if key == "space" then
sm:setState("game_state")
end
end
}
return info_state
|
local Objects = {
createObject ( 6448, 853.7002, 2160.5, 13.5, 0, 0, 359.495 ),
createObject ( 6450, 879.5, 2278.7998, 12.1, 0, 0, 179.747 ),
createObject ( 8411, 868.29999, 2225.19995, -45.1, 0, 0, 359.495 ),
createObject ( 8411, 868.5, 2250.6001, -45.1, 0, 0, 359.489 ),
createObject ( 8411, 868.70001, 2276, -45.1, 0, 0, 359.489 ),
createObject ( 8411, 868.90002, 2301.3999, -45.1, 0, 0, 359.489 ),
createObject ( 8411, 869.09998, 2326.8, -45.1, 0, 0, 359.489 ),
createObject ( 8411, 869.09998, 2332.8, -45.2, 0, 0, 359.489 ),
createObject ( 10841, 898.5, 2224.7, 27.8, 0, 0, 89.495 ),
createObject ( 10841, 898.70001, 2247.3999, 27.8, 0, 0, 89.495 ),
createObject ( 10841, 898.79999, 2270.1001, 27.8, 0, 0, 89.495 ),
createObject ( 10841, 899, 2292.8, 27.8, 0, 0, 89.495 ),
createObject ( 10841, 899.20001, 2315.5, 27.8, 0, 0, 89.495 ),
createObject ( 10841, 899.29999, 2333.7, 27.8, 0, 0, 89.495 ),
createObject ( 10841, 867.90002, 2213.1001, 27.8, 0, 0, 359.245 ),
createObject ( 10841, 848.20001, 2213.3999, 27.8, 0, 0, 359.242 ),
createObject ( 10841, 837.5, 2223.8999, 27.8, 0, 0, 269.742 ),
createObject ( 10841, 888.79999, 2344.5, 27.8, 0, 0, 179.745 ),
createObject ( 10841, 866.20001, 2344.7, 27.8, 0, 0, 179.742 ),
createObject ( 10841, 849, 2344.8, 27.8, 0, 0, 179.742 ),
createObject ( 10841, 837.59998, 2246.6001, 27.8, 0, 0, 269.742 ),
createObject ( 10841, 837.70001, 2269.3, 27.8, 0, 0, 269.742 ),
createObject ( 10841, 837.79999, 2292, 27.8, 0, 0, 269.742 ),
createObject ( 10841, 838, 2314.7, 27.8, 0, 0, 268.992 ),
createObject ( 3115, 848.90002, 2334.8, 19.7 ),
createObject ( 10841, 838.29999, 2334.2, 27.8, 0, 0, 269.739 ),
createObject ( 3115, 869.90002, 2334.8999, 19.7 ),
createObject ( 3115, 848.79999, 2316.2, 19.7 ),
createObject ( 3115, 869.90002, 2316.30005, 19.7 ),
createObject ( 3115, 869.90002, 2297.7, 19.7 ),
createObject ( 3115, 848.79999, 2297.6001, 19.7 ),
createObject ( 3406, 874.90002, 2287.3999, 26.1 ),
createObject ( 3406, 866.09998, 2287.3999, 26.1 ),
createObject ( 3406, 857.29999, 2287.3999, 26.1 ),
createObject ( 3406, 848.5, 2287.3999, 26.1 ),
createObject ( 3406, 877.79999, 2293.3, 26.1, 0, 0, 89.5 ),
createObject ( 3406, 877.90002, 2302.1001, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 877.90002, 2310.8999, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 878, 2319.7, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 878, 2328.6001, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 878.09998, 2337.3999, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 878.09998, 2340.2, 26.1, 0, 0, 89.495 ),
createObject ( 11428, 861.59998, 2302.3999, 25.2, 0, 0, 20 ),
createObject ( 11442, 849.90002, 2333.6001, 20 ),
createObject ( 11443, 849.79999, 2320, 20 ),
createObject ( 11444, 866.90002, 2327.7, 20, 0, 0, 286 ),
createObject ( 11445, 863.70001, 2318.2, 20 ),
createObject ( 11446, 844.5, 2304.6001, 20 ),
createObject ( 11447, 850.20001, 2295.7, 19.8 ),
createObject ( 11427, 864, 2337.1001, 27.2 ),
createObject ( 11446, 849.79999, 2310.6001, 20, 0, 0, 294 ),
createObject ( 11442, 871, 2305.6001, 20, 0, 0, 38 ),
createObject ( 3603, 854.20001, 2235.1001, 26, 0, 0, 89.25 ),
createObject ( 3406, 877.70001, 2282.6001, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 877.59998, 2273.8999, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 877.59998, 2271, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 874.70001, 2266.8999, 26.1 ),
createObject ( 3406, 866, 2266.8999, 26.1 ),
createObject ( 3406, 857.5, 2267, 26.1 ),
createObject ( 3406, 848.79999, 2267, 26.1 ),
createObject ( 5837, 871.79999, 2215.8, 21.9, 0, 0, 358.75 ),
createObject ( 4639, 895.20001, 2268.5, 21.9, 0, 0, 270.25 ),
createObject ( 3292, 879.09998, 2254.1001, 20.1, 0, 0, 179.25 ),
createObject ( 3293, 874.40002, 2251.3999, 23.4, 0, 0, 179.25 ),
createObject ( 3604, 889.29999, 2290.5, 22.5 ),
createObject ( 3406, 883.90002, 2305.7, 26.1 ),
createObject ( 3406, 892.40002, 2305.8, 26.1 ),
createObject ( 16770, 890, 2312.8999, 21.5, 0, 0, 89.5 ),
createObject ( 1583, 888.90002, 2325.3, 20 ),
createObject ( 1583, 890.40002, 2329.7, 20 ),
createObject ( 1583, 886.70001, 2329.8999, 20 ),
createObject ( 1583, 892.70001, 2324.6001, 20 ),
createObject ( 1583, 890.20001, 2335.7, 20 ),
createObject ( 1583, 886.5, 2337.8999, 20 ),
createObject ( 1583, 886.5, 2321.6001, 20 ),
createObject ( 1583, 893, 2339.7, 20 ),
createObject ( 2205, 872.40039, 2275.7002, 19.9, 0, 0, 88.995 ),
createObject ( 1704, 868.09998, 2276.1001, 19.9, 0, 0, 88.75 ),
createObject ( 1704, 868, 2272.3999, 19.9, 0, 0, 88.748 ),
createObject ( 1704, 868.20001, 2279.8999, 19.9, 0, 0, 88.748 ),
createObject ( 1704, 864.70001, 2280.1001, 19.9, 0, 0, 88.748 ),
createObject ( 1704, 864.59998, 2276.2, 19.9, 0, 0, 88.748 ),
createObject ( 1704, 864.5, 2272.5, 19.9, 0, 0, 88.748 ),
createObject ( 1714, 874.09961, 2276.4004, 19.9, 0, 0, 268.748 ),
createObject ( 3406, 857.2998, 2275.7002, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 844.5, 2284.5, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 844.5, 2275.7002, 26.1, 0, 0, 89.495 ),
createObject ( 3406, 857.40002, 2284.5, 26.1, 0, 0, 89.495 ),
createObject ( 1704, 861.09998, 2276.3, 19.9, 0, 0, 88.748 ),
createObject ( 1704, 861, 2272.5, 19.9, 0, 0, 88.748 ),
createObject ( 1704, 861.09998, 2280.3, 19.9, 0, 0, 88.748 ),
createObject ( 2204, 876.40002, 2277.3, 19.9, 0, 0, 269.75 ),
createObject ( 1965, 876.5, 2276.2, 21.3 ),
createObject ( 1965, 876.5, 2275, 21.3 ),
createObject ( 8199, 992.20001, 1666, 10.7 ),
createObject ( 2205, 848.5, 2278.5, 19.9, 0, 0, 268.745 ),
createObject ( 2205, 853.20001, 2277.3, 19.9, 0, 0, 89.992 ),
createObject ( 2205, 850.29999, 2274.8, 19.9, 0, 0, 358.489 ),
createObject ( 2205, 851.40002, 2280.6001, 19.9, 0, 0, 179.736 ),
createObject ( 1714, 851, 2273.1001, 19.9, 0, 0, 180.498 ),
createObject ( 1714, 854.79999, 2278, 19.9, 0, 0, 269.994 ),
createObject ( 1714, 850.70001, 2282.1001, 19.9, 0, 0, 359.489 ),
createObject ( 1714, 846.79999, 2277.8, 19.9, 0, 0, 89.234 ),
createObject ( 3749, 888.79999, 2211.6001, 25.2, 0, 0, 359.25 ),
createObject ( 3578, 887.79999, 2212.3999, 19.5 ),
createObject ( 3578, 889.79999, 2212.3999, 19.5 ),
createObject ( 3095, 888.79999, 2208, 19.3, 4.5, 0, 0 ),
createObject ( 3095, 888.70001, 2217, 19.3, 4.499, 0, 180.5 ),
}
for index, object in ipairs ( Objects ) do
setElementDoubleSided ( object, true )
setObjectBreakable(object, false)
end |
---@type Ellyb
local Ellyb = Ellyb:GetInstance(...);
local Tooltips = {};
Ellyb.Tooltips = Tooltips;
Tooltips.ANCHORS = {
--- Align the top right of the tooltip with the bottom left of the owner
BOTTOMLEFT= "BOTTOMLEFT",
--- Align the top left of the tooltip with the bottom right of the owner
BOTTOMRIGHT= "BOTTOMRIGHT",
--- Toolip follows the mouse cursor
CURSOR= "CURSOR",
--- Align the bottom right of the tooltip with the top left of the owner
LEFT= "LEFT",
--- Tooltip appears in the default position
NONE= "NONE",
--- Tooltip's position is saved between sessions (useful if the tooltip is made user-movable)
PRESERVE= "PRESERVE",
--- Align the bottom left of the tooltip with the top right of the owner
RIGHT= "RIGHT",
--- Align the top of the tooltip with the bottom of the owner
BOTTOM = "BOTTOM",
--- Align to bottom of the tooltip with the top of the owner
TOP = "TOP",
--- Align the bottom left of the tooltip with the top left of the owner
TOPLEFT= "TOPLEFT",
--- Align the bottom right of the tooltip with the top right of the owner
TOPRIGHT= "TOPRIGHT",
}
local function showFrameTooltip(self)
self.Tooltip:Show();
end
local function hideFrameTooltip(self)
self.Tooltip:Hide();
end
---GetTooltip
---@param frame Frame|ScriptObject
---@return Tooltip
function Tooltips.getTooltip(frame)
if not frame.Tooltip then
frame.Tooltip = Ellyb.Tooltip(frame);
frame:HookScript("OnEnter", showFrameTooltip)
frame:HookScript("OnLeave", hideFrameTooltip)
end
return frame.Tooltip;
end |
Shooter = Object:extend()
function Shooter:new(x, y, width, height, laserLength)
self.x = x
self.y = y
self.width = width
self.height = height
self.dir = 0
self.lasers = {}
self.laserLength = laserLength
end
function Shooter:lookAtMouse()
local base = love.mouse.getX() - self.x
local height = love.mouse.getY() - (self.y+self.height/2)
self.dir = math.atan2(height, base)
--print(self.dir)
end
function Shooter:update(dt)
self:lookAtMouse()
for i,laser in ipairs(self.lasers) do
laser:update(dt)
end
end
function Shooter:shoot()
local x = math.cos(self.dir)*self.width + self.x
local y = math.sin(self.dir)*self.width + self.y+self.height/2
table.insert(self.lasers, Laser(x, y, self.laserLength, self.dir, 200))
end
function Shooter:draw()
love.graphics.setColor(1, 1, 1)
love.graphics.push()
love.graphics.translate(self.x, self.y+self.height/2)
love.graphics.rotate(self.dir)
love.graphics.rectangle("line", 0, -self.height/2, self.width, self.height)
love.graphics.pop()
for i,laser in ipairs(self.lasers) do
laser:draw()
end
end
|
return {
home = os.getenv("HOME") .. "/.shiplog",
}
|
function split(line)
local wa = {}
for i in string.gmatch(line, "%S+") do
table.insert(wa, i)
end
return wa
end
-- main
local file = assert(io.open("days_of_week.txt", "r"))
io.input(file)
local line_num = 0
while true do
local line = io.read()
if line == nil then break end
line_num = line_num + 1
if string.len(line) > 0 then
local days = split(line)
if #days ~= 7 then
error("There aren't 7 days in line "..line_num)
end
local temp = {}
for i,day in pairs(days) do
if temp[day] ~= nil then
io.stderr:write(" ∞ "..line.."\n")
else
temp[day] = true
end
end
local length = 1
while length < 50 do
temp = {}
local count = 0
for i,day in pairs(days) do
local key = string.sub(day, 0, length)
if temp[key] ~= nil then break end
temp[key] = true
count = count + 1
end
if count == 7 then
print(string.format("%2d %s", length, line))
break
end
length = length + 1
end
end
end
|
local Behavior = CreateAIBehavior("VtolUnIgnorant", "HeliUnIgnorant",
{
Alertness = 0,
}) |
function require_fix(filename)
local file = io.open(filename, 'r')
local new_file_str = ''
for line in file:lines() do
if line:find('require') then
print(line)
local first_quota = line:find('\'')
if first_quota then
local second_quota = line:find('\'', first_quota + 1)
local module_name = line:sub(first_quota+1, second_quota-1)
local first_module_name = line:find(module_name)
if first_module_name == (first_quota + 1) and line:find('=') == nil then
print('need fix')
local new_line = line:gsub('require', 'local '..module_name..' = require')
line = new_line
print(new_line)
end
print(first_quota, second_quota, module_name, first_module_name)
end
end
new_file_str = new_file_str..line..'\n';
end
local new_file = io.open(filename, 'w+')
new_file:write(new_file_str)
new_file:close()
file:close()
end
for i = 1, #arg do
print(arg[i])
require_fix(arg[i])
end
|
local playsession = {
{"tyssa", {310665}},
{"Killeraoc", {1569244}},
{"Tony3D", {1175336}},
{"agenda51", {204935}},
{"drakferion", {1560485}},
{"rlidwka", {1294698}},
{"teomarx", {520169}},
{"Thomas.wur", {509285}},
{"Thoren", {137419}},
{"TheEggOnTop", {1516380}},
{"Domi_playerHD", {8932}},
{"LastWanderer", {161395}},
{"Drezik99", {7286}},
{"IndustrialSquid", {619186}},
{"TNSepta", {28530}},
{"Kiumajus", {644405}},
{"XnagitoX", {430419}},
{"Micronauts", {222906}},
{"CallMeTaste", {457631}},
{"remarkablysilly", {558807}},
{"he-duun", {1070}},
{"tickterd", {871650}},
{"Nick_Nitro", {546849}},
{"MINIMAN10000", {410944}},
{"Spiritmorin", {612183}},
{"FakobSnakob", {16320}},
{"Nikkichu", {623262}},
{"Lawispi", {287628}},
{"Silver_Eagle7", {1107349}},
{"nizzy", {405979}},
{"Panamuia", {1762}},
{"Mxlppxl", {171933}},
{"joooo", {48847}},
{"Cokezero91", {56673}},
{"bobbythebob12", {17599}},
{"scifitoga", {17546}},
{"Digzol", {352792}},
{"Chico75", {842394}},
{"2xRon", {62371}},
{"tykak", {890167}},
{"Bradcool", {255000}},
{"jeffertoot", {44235}},
{"brody0276", {1723}},
{"Skillen", {41069}},
{"Redbeard28", {631904}},
{"Hapko3", {67100}},
{"Aldnoah5566", {18403}},
{"TXL_PLAYZ", {536809}},
{"akisute", {84840}},
{"lophadeth", {119857}},
{"graehamkracker", {39730}},
{"EmperorTrump", {12787}},
{"roosterbrewster", {11135}},
{"inesoa", {204714}},
{"sheng378831749", {15870}},
{"Thymey", {58000}}
}
return playsession |
local lu = require 'luaunit'
local request = require 'http.request'
local xtest = require 'test.xtest'
local M = {}
function M.config_http()
return {
log = {level = 'd', file = 'flash_http.out'},
server = {host = 'localhost', port = 0},
middleware = {'flash', function(req, res)
if req.url.path == '/1' then
req:flash('a', {x='b'})
elseif req.url.path == '/2' then
req:flash({y='c'})
end
res:write{
content_type = 'application/json',
body = req.locals.flash,
}
end},
flash = {
secure = false,
same_site = 'none', -- required for the cookie_store to work
},
json = {},
}
end
local TO = 10
function M.test_flash()
xtest.withserver(function(port)
local req = request.new_from_uri(
string.format('http://localhost:%d/', port))
local hdrs, res = xtest.http_request(req, 'GET', '/', nil, TO)
lu.assertNotNil(hdrs and res)
local body = res:get_body_as_string(TO)
lu.assertEquals(body, '')
lu.assertEquals(hdrs:get(':status'), '200')
local ck = req.cookie_store:get('localhost', '/', 'flash')
lu.assertNil(ck)
-- write some messages
hdrs, res = xtest.http_request(req, 'GET', '/1', nil, TO)
lu.assertNotNil(hdrs and res)
body = res:get_body_as_string(TO)
lu.assertEquals(body, '')
lu.assertEquals(hdrs:get(':status'), '200')
ck = req.cookie_store:get('localhost', '/', 'flash')
lu.assertTrue(ck and ck ~= '')
-- write some new messages
hdrs, res = xtest.http_request(req, 'GET', '/2', nil, TO)
lu.assertNotNil(hdrs and res)
body = res:get_body_as_string(TO)
lu.assertEquals(body, '["a",{"x":"b"}]')
lu.assertEquals(hdrs:get(':status'), '200')
ck = req.cookie_store:get('localhost', '/', 'flash')
lu.assertTrue(ck and ck ~= '')
-- no new messages
hdrs, res = xtest.http_request(req, 'GET', '/', nil, TO)
lu.assertNotNil(hdrs and res)
body = res:get_body_as_string(TO)
lu.assertEquals(body, '[{"y":"c"}]')
lu.assertEquals(hdrs:get(':status'), '200')
ck = req.cookie_store:get('localhost', '/', 'flash')
lu.assertNil(ck)
end, 'test.flash', 'config_http')
end
return M
|
local col = {}
col.foreground = "#ffffff"
col.background = "#131a21"
col.cursor_bg = "#a3b8ef"
col.cursor_fg = "#a3b8ef"
col.cursor_border = "#a3b8ef"
col.split = "#3b4b58"
col.ansi = {
"#29343d", "#f9929b", "#7ed491", "#fbdf90", "#a3b8ef", "#ccaced", "#9ce5c0",
"#ffffff"
}
col.brights = {
"#3b4b58", "#fca2aa", "#a5d4af", "#fbeab9", "#bac8ef", "#d7c1ed", "#c7e5d6",
"#eaeaea"
}
col.tab_bar = {
background = "#131a21",
active_tab = {bg_color = "#3b4b58", fg_color = "#eaeaea", italic = true},
inactive_tab = {bg_color = "#29343d", fg_color = "#131a21"},
inactive_tab_hover = {bg_color = "#29343d", fg_color = "#131a21"}
}
return col
|
local export = { }
local memory = require 'families.internals.memory'
local reason = require 'families.internals.reason'
-------------------------------------------------------------------------------
function export: __index (selector)
if memory.destroyed[ self ] then
error (reason.invalid.destroyed)
end
local value = memory.delegate[ self ][ selector ]
if rawequal (value, nil) then
error (reason.missing.property: format (selector))
else
return value
end
end
function export: __newindex (selector, value)
if memory.destroyed[ self ] then
error (reason.invalid.destroyed)
end
memory.delegate[ self ][ selector ] = value
end
---------------------------------------------------------------------
return export
-- END --
|
local PICKUP = {}
local function AddNotification(tbl, notification)
return {
[1] = notification,
[2] = tbl[1] or "",
[3] = tbl[2] or "",
[4] = tbl[3] or "",
[5] = tbl[4] or ""
}
end
function PICKUP.Add(player, msg)
player.clientUserData.notification = AddNotification(player.clientUserData.notification, msg)
end
return PICKUP |
-- General camera parameters
FieldOfView = 90.000000
ClipNear = 1
ClipFar = 9999
TerrainClip = 1.0
-- Interpolation in camera motion and camera snapping
--
-- Rate = rate to interpolate
-- Base = base to perform interpolation in (2.71828 for linear, must be >1)
-- Threshold = threshold to start performing interpolation
--
-- Controls pan speed
SlideTargetRate = 5
SlideTargetBase = 5
--SlideTargetThreshold = 1
-- Controls zoom speed
SlideDistRate = 2
SlideDistBase = 5
--SlideDistThreshold = 1
-- Controls orbit speed
SlideOrbitRate = 4
SlideOrbitBase = 1.01
--SlideOrbitThreshold = 1
-- Controls declination speed
SlideDeclRate = 4
SlideDeclBase = 1.01
--SlideDeclThreshold = 1
-- Controls the speed of the zoom with the double button press
DistRateMouse = 0.50
-- Controls the speed of the zoom on the wheel
DistRateWheelZoomIn = 0.7
DistRateWheelZoomOut = 1.3
-- Distance range in metres
DistMin = 5.0
DistMax = 100.0
-- Declination speed
DeclRateMouse = -5
-- Declination range : angle range you can look at a target
DeclMin = 1.0
DeclMax = 200.0
-- Mouse orbit speed
OrbitRateMouse = -4
-- Default camera parameters
DefaultDistance = 50
DefaultDeclination = 45
DefaultOrbit = 45
-- Minimum eye height
DistGroundHeight = 1.0
-- Pan velocity scaling
-- Panning speed at the default/min height
PanScaleMouseDefZ = 500
PanScaleKeyboardDefZ = 175
PanScaleKeyboardMinZ = 35
PanScaleScreenDefZ = 150
PanScaleScreenMinZ = 30
-- Panning acceleration
-- To turn acceleration off, use the following values:
-- PanAccelerate = 0.0
-- PanStartSpeedScalar = 1.0
PanAccelerate = 0.0
PanStartSpeedScalar = 0.5
PanMaxSpeedScalar = 1.0
-- Enable/disable declination
DeclinationEnabled = 1.0
-- Enable/disable rotation
OrbitEnabled = 1.0
|
-- procedural mesh examples
b = BinooAPI
b:CreateSphere("sphere", 3, 8)
b:CreateBox("box", 1, 1, 1, 3,3,3)
b:CreateCone("cone", 1, 1, 0, 3,3)
b:CreatePlane("plane", 1, 1, 3, 3)
b:CreateSlope("slope", 1, 2, 3)
b:CreateStairs("stairs", 5, 2, 2, 3)
b:CreateTorus("torus", 0, 45, 1, 0.25, 32, 4)
|
return {
corawin = {
acceleration = 0,
activatewhenbuilt = true,
brakerate = 0,
buildcostenergy = 1207,
buildcostmetal = 158,
builder = false,
buildpic = "corawin.dds",
buildtime = 6000,
category = "ALL SURFACE",
collisionvolumeoffsets = "0 -7 0",
collisionvolumescales = "60 90 60",
collisionvolumetype = "CylY",
corpse = "dead",
description = "Produces Energy",
explodeas = "LARGE_BUILDINGEX",
footprintx = 4,
footprintz = 4,
icontype = "building",
idleautoheal = 5,
idletime = 1800,
losemitheight = 124,
mass = 161,
maxdamage = 685,
maxslope = 10,
maxvelocity = 0,
maxwaterdepth = 0,
name = "Advanced Wind Generator",
noautofire = false,
objectname = "CORAWIN",
radaremitheight = 123,
seismicsignature = 0,
selfdestructas = "LARGE_BUILDING",
sightdistance = 273,
turninplaceanglelimit = 140,
turninplacespeedlimit = 0,
turnrate = 0,
unitname = "corawin",
windgenerator = 100,
yardmap = "oooo oooo oooo oooo",
customparams = {
buildpic = "corawin.dds",
energymultiplier = 4,
faction = "CORE",
},
featuredefs = {
dead = {
blocking = true,
damage = 750,
description = "Advanced Wind Generator Wreckage",
energy = 0,
featuredead = "heap",
footprintx = 7,
footprintz = 7,
metal = 107,
object = "CORAWIN_DEAD",
reclaimable = true,
customparams = {
fromunit = 1,
},
},
heap = {
blocking = false,
damage = 938,
description = "Advanced Wind Generator Debris",
energy = 0,
footprintx = 7,
footprintz = 7,
metal = 57,
object = "7X7A",
reclaimable = true,
customparams = {
fromunit = 1,
},
},
},
sfxtypes = {
pieceexplosiongenerators = {
[1] = "piecetrail5",
[2] = "piecetrail5",
[3] = "piecetrail4",
[4] = "piecetrail6",
},
},
sounds = {
canceldestruct = "cancel2",
underattack = "warning1",
count = {
[1] = "count6",
[2] = "count5",
[3] = "count4",
[4] = "count3",
[5] = "count2",
[6] = "count1",
},
select = {
[1] = "windgen2",
},
},
},
}
|
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local function greetCallback(cid)
local player = Player(cid)
if player:getStorageValue(Storage.thievesGuild.Mission04) ~= 6 or player:getOutfit().lookType ~= 66 then
npcHandler:say('Excuse me, but I\'m waiting for someone important!', cid)
return false
end
return true
end
local function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
if msgcontains(msg, 'dwarven bridge') then
npcHandler:say('Wait a minute! Do I get that right? You\'re the owner of the dwarven bridge and you are willing to sell it to me??', cid)
npcHandler.topic[cid] = 1
elseif msgcontains(msg, 'yes') then
if npcHandler.topic[cid] == 1 then
npcHandler:say({
'That\'s just incredible! I\'ve dreamed about acquiring the dwarven bridge since I was a child! Now my dream will finally become true. ...',
'And you are sure you want to sell it? I mean really, really sure?'
}, cid)
npcHandler.topic[cid] = 2
elseif npcHandler.topic[cid] == 2 then
npcHandler:say('How splendid! Do you have the necessary documents with you?', cid)
npcHandler.topic[cid] = 3
elseif npcHandler.topic[cid] == 3 then
npcHandler:say('Oh my, oh my. I\'m so excited! So let\'s seal this deal as fast as possible so I can visit my very own dwarven bridge. Are you ready for the transaction?', cid)
npcHandler.topic[cid] = 4
elseif npcHandler.topic[cid] == 4 then
local player = Player(cid)
if player:removeItem(8694, 1) then
player:addItem(8699, 1)
player:setStorageValue(Storage.thievesGuild.Mission04, 7)
npcHandler:say({
'Excellent! Here is the painting you requested. It\'s quite precious to my father, but imagine his joy when I tell him about my clever deal! ...',
'Now leave me alone please. I have to prepare for my departure. Now my family will not call me a squandering fool anymore!'
}, cid)
npcHandler:releaseFocus(cid)
npcHandler:resetNpc(cid)
end
end
end
return true
end
npcHandler:setMessage(MESSAGE_GREET, 'It\'s .. It\'s YOU! At last!! So what\'s this special proposal you would like to make, my friend?')
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
|
---------------------【1.配置信息】-----------------------
client_id=wifi.sta.getmac()
device_type='relay'
cl=nil
-- [1.2 GPIO配置]
pin_led = 0
pin_relay=1
gpio.mode(pin_led,gpio.OUTPUT)
gpio.mode(pin_relay,gpio.OUTPUT)
gpio.write(pin_led,gpio.LOW)
gpio.write(pin_relay,gpio.LOW)
---------------------【2.设备连接】-----------------------
function TcpClient()
cl = net.createConnection(net.TCP, 0)
cl:connect(8282, "xn--55qy30c09ad7hkw0e.online")
cl:on("receive", function(sck, c)
recv=cjson.decode(c)
if (recv.obj.id==client_id and recv.obj.type==device_type) then
if(recv.data.switch=='on') then
gpio.write(pin_relay,gpio.HIGH)
else
if(recv.data.switch=='trig') then
if(recv.data.delay==nil) then
recv.data.delay==1
end
gpio.write(pin_relay,gpio.HIGH)
tmr.delay(recv.data.delay*1000000)
gpio.write(pin_relay,gpio.LOW)
else
gpio.write(pin_relay,gpio.LOW)
end
end
data={}
data.switch=recv.data.switch
Send(data,recv.ori)
end
end)
cl:on("disconnection", function(sck, c)
end)
end
function Send(data,ori)
send={}
send.ori={}
send.obj={}
send.ori.id=client_id
send.ori.type=device_type
send.ori.prot='tcp'
send.obj.id=ori.id
send.obj.type=ori.type
send.obj.prot=ori.prot
send.data=data
ok, json=pcall(cjson.encode, send)
if ok then
cl:send(json)
else
print("failed to encode!")
end
end
function Start()
print("WiFi Connected, IP is "..wifi.sta.getip())
TcpClient()
heartbeat_data={}
heartbeat_ori={}
heartbeat_ori.id=client_id
heartbeat_ori.type=device_type
heartbeat_ori.prot='heartbeat'
--[topic 定时上传数据]
print("start")
tmr.alarm(0, 1000, 0, function()
gpio.write(pin_led,gpio.LOW)
Send(heartbeat_data,heartbeat_ori)
print("send heartbeat")
end)
tmr.alarm(1, 60000, 1, function() --等待连接上
if cl~=nil then
Send(heartbeat_data,heartbeat_ori)
end
end)
end
wifi.eventmon.register(wifi.eventmon.STA_CONNECTED, function(T)
print("WiFi Connected")
gpio.write(pin_led,gpio.LOW)
end)
wifi.eventmon.register(wifi.eventmon.STA_DISCONNECTED, function(T)
print("WiFi Disconnect")
gpio.write(pin_led,gpio.HIGH)
wifi.sta.autoconnect(1)
end)
Start()
|
--[[ Copyright (C) 2018 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
]]
local TEXT_TABLE = {
key = 'K',
goal = 'G',
spawn = 'P',
vertDoor = 'I',
horizDoor = 'H',
wall = '*',
emptyFloor = ' ',
}
local api = {}
local function getAscii(object)
if object:match('Key') then
return TEXT_TABLE.key
elseif object:match('VertDoor') then
return TEXT_TABLE.vertDoor
elseif object:match('HorizDoor') then
return TEXT_TABLE.horizDoor
else
return TEXT_TABLE[object]
end
end
--[[ Builds the object list based on possible colors, and also builds the
inverted index.
Arguments:
* possibleColors - The list of possible colors of the keys and doors.
Returns:
* objects - The objects list.
* objectCode - The inverted index of the objects list.
]]
function api.createObjects(possibleColors)
local objects = {}
for _, color in ipairs(possibleColors) do
objects[#objects + 1] = color .. 'Key'
objects[#objects + 1] = color .. 'VertDoor'
objects[#objects + 1] = color .. 'HorizDoor'
end
objects[#objects + 1] = 'spawn'
objects[#objects + 1] = 'goal'
objects[#objects + 1] = 'wall'
objects[#objects + 1] = 'emptyFloor'
local objectCodes = {}
for i, object in ipairs(objects) do
objectCodes[object] = i
end
return objects, objectCodes
end
--[[ Transform the rooms and objects information into an ASCII map, a key list
and a door list.
Arguments:
* roomGrid - An instance of RoomGrid which holds the rooms information.
* objects - The objects list
* objectCodes - The inverted index of the objects list.
Returns a table with three keys:
* map - The ASCII map of the level.
* keys - The colors of the keys in the map, listed from the top to bottom and
from left to right.
* doors - The colors of the doors in the map, listed from the top to bottom
and from left to right.
]]
function api.makeLevel(roomGrid, objects, objectCodes)
local mini = math.huge
local maxi = - math.huge
local minj = math.huge
local maxj = - math.huge
for i = 1, roomGrid.height do
for j = 1, roomGrid.width do
if roomGrid:grid(i, j) then
mini = math.min(mini, i)
maxi = math.max(maxi, i)
minj = math.min(minj, j)
maxj = math.max(maxj, j)
end
end
end
local roomRows = maxi - mini + 1
local roomCols = maxj - minj + 1
local map = {}
for i = 1, roomRows * 3 + 3 do
map[i] = {}
for j = 1, roomCols * 4 + 3 do
map[i][j] = objectCodes['wall']
end
end
for i, room in ipairs(roomGrid.rooms) do
local gridi, gridj = room:gridPosition()
room:draw(map,
(gridi - mini) * 3 + 3,
(gridj - minj) * 4 + 3,
objectCodes)
end
local asciiMap = ''
local keys = {}
local doors = {}
for i = 1, roomRows * 3 + 3 do
for j = 1, roomCols * 4 + 3 do
local object = objects[map[i][j]]
assert(object)
local objectAscii = getAscii(object)
asciiMap = asciiMap .. objectAscii
if objectAscii == TEXT_TABLE.key then
table.insert(keys, object:match('(.*)Key'))
elseif objectAscii == TEXT_TABLE.vertDoor then
table.insert(doors, object:match('(.*)VertDoor'))
elseif objectAscii == TEXT_TABLE.horizDoor then
table.insert(doors, object:match('(.*)HorizDoor'))
end
end
asciiMap = asciiMap .. '\n'
end
return {
map = asciiMap,
keys = keys,
doors = doors,
}
end
return api
|
done = function(summary, latency, requests)
io.stderr:write("uri ; rps ; latency in ms(50%) ; latency in ms(95%)\n")
io.stderr:write(string.format("%s; ", wrk.path))
io.stderr:write(string.format("%s; ", summary.requests / summary.duration * 1000000 ))
for _, p in pairs({50, 95}) do
n = latency:percentile(p)
io.stderr:write(string.format("%f; ", n / 1000.0))
end
io.stderr:write("\n")
end
|
local addon, Pesky = ...
Pesky.Data = {}
Pesky.Data.Minion = {
["mn.mn.04A1207307F7879B"] = { name = "King Humbart", icon = "item_icons\\frank_birlen_head" },
["mn.mn.00F115FB3FEC7350"] = { name = "Warboss Drak", icon = "item_icons\\mount_croc_bb" },
["mn.mn.2C92A06CE24F172B"] = { name = "Ilchorin", icon = "item_icons\\naga_hand" },
["mn.mn.4B1D30750800FAC9"] = { name = "Sienna", icon = "item_icons\\pet_dire-wolf_a" },
["mn.mn.6D0F38F1ACC6E850"] = { name = "Billows", icon = "item_icons\\maleforge_balloon", attractorType = "Dimension" },
["mn.mn.0042BA784BA33610"] = { name = "Bea", icon = "item_icons\\pet_sheep_z" },
["mn.mn.54EF35A7C8B52254"] = { name = "Lugglaga", icon = "item_icons\\severed_orc_head" },
["mn.mn.39D4D7510476004C"] = { name = "Face Pull", icon = "item_icons\\mount6", attractorType = "Diplomacy" },
["mn.mn.468F3B571DD6F132"] = { name = "Violet", icon = "item_icons\\freemarch_rabbit" },
["mn.mn.7BC1BE0A1A9B58DC"] = { name = "Agnion Euzonos", icon = "item_icons\\intact_shambler_eye" },
["mn.mn.7F8A380BDC88D534"] = { name = "Tiller", icon = "item_icons\\tavra_gnarl1" },
["mn.mn.0F0BBAD1D9FE3C09"] = { name = "Ryuu", icon = "item_icons\\mount_kirin", attractorType = "Hunting" },
["mn.mn.607B4DE9319C7932"] = { name = "Yarjos Mezrot", icon = "item_icons\\2h_staff_079_b" },
["mn.mn.2BCCD0DD10D86409"] = { name = "Xandill", icon = "ability_icons\\spiritoflion3" },
["mn.mn.24BE00F13BD49486"] = { name = "Floop", icon = "item_icons\\pet_squirell" },
["mn.mn.75D48A4EEBF1BF8E"] = { name = "Inquisitor Garau", icon = "item_icons\\maurice_head" },
["mn.mn.6D049CED34944DE4"] = { name = "The Golden Devourer", icon = "item_icons\\murdantix_toad" },
["mn.mn.0C81BE2C7D163AC6"] = { name = "Keavy", icon = "item_icons\\fairy_woman" },
["mn.mn.0EE81C6716ACFC7B"] = { name = "IX-1 Defender", icon = "item_icons\\broken_flintlock_mechanism" },
["mn.mn.69FC1C0253AF56A6"] = { name = "Welt", icon = "item_icons\\goblin_boss_head" },
["mn.mn.1D9AE6C8E4057EB3"] = { name = "Atrophinius", icon = "ability_icons\\druid_summon_greater_satyr" },
["mn.mn.699CE15EE99B969B"] = { name = "Jasper", icon = "item_icons\\rock_03a" },
["mn.mn.308128D1E12EA17A"] = { name = "Noxie", icon = "item_icons\\spiderleg2a" },
["mn.mn.2CD7B4DADC917411"] = { name = "Hogrol", icon = "item_icons\\troglodyte_head" },
["mn.mn.34C05E55E81AD4A5"] = { name = "Jacenda Cassana", icon = "item_icons\\pet_zombie" },
["mn.mn.27E4FE9A01B0B03F"] = { name = "Frederic Kain", icon = "item_icons\\frank_birlen_head" },
["mn.mn.08DEAC02D4899D7C"] = { name = "Oblivia", icon = "ability_icons\\spiritbolt2" },
["mn.mn.5EC2D737A4B1B871"] = { name = "Krass", icon = "item_icons\\mount_croc_bb" },
["mn.mn.604B6094E57E9305"] = { name = "Alcander", icon = "item_icons\\mount_unicorn_black", attractorType = "Assassination" },
["mn.mn.33576F4C21BD3E86"] = { name = "Fang", icon = "item_icons\\pet_cat_d" },
["mn.mn.0364C4671F543EE8"] = { name = "Urista", icon = "item_icons\\leather_103_head" },
["mn.mn.FDC6213940A57BE6"] = { name = "Bludfeng", icon = "item_icons\\barghest_claw" },
["mn.mn.3D42A17215196F2E"] = { name = "Carmine", icon = "item_icons\\goblin_boss_head" },
["mn.mn.28547D19313FE3B5"] = { name = "Jakub", icon = "item_icons\\head_of_slain_young_man" },
["mn.mn.2E3DF623107CF778"] = { name = "Ornipteryx", icon = "ability_icons\\dancing_steel" },
["mn.mn.7F9C132CBF50A9A7"] = { name = "Stofie", icon = "item_icons\\coral_shrimp_b" },
["mn.mn.788408CEE4A2FD04"] = { name = "Magmus", icon = "item_icons\\lesser_fire_05" },
["mn.mn.00E0A4F5C1A34FDA"] = { name = "Lil Reggie", icon = "item_icons\\pet_regulos_a" },
["mn.mn.1A2425A83C777EBF"] = { name = "Dorald", icon = "item_icons\\bogling_chef_a" },
["mn.mn.5B57AFEF1D02990A"] = { name = "Deeps", icon = "item_icons\\pet_crab_c" },
["mn.mn.2FA1DD8D800F6269"] = { name = "Sulfus", icon = "item_icons\\goblin_boss_head" },
["mn.mn.53BC346FFD4CECC2"] = { name = "Lyle", icon = "ability_icons\\divert_rage_01", attractorType = "Assassination" },
["mn.mn.7FC301EAE1F03B77"] = { name = "Rudy", icon = "item_icons\\pet_corgi_holiday" },
["mn.mn.49C7EBA6BCC962B9"] = { name = "Rashboil", icon = "item_icons\\goblin_boss_head" },
["mn.mn.77554F2AF4E0EC94"] = { name = "Slithers", icon = "item_icons\\pet_cobra" },
["mn.mn.455B031C024E4C6E"] = { name = "Steamskin", icon = "item_icons\\pet_coyote_b" },
["mn.mn.08A30D4011661A0A"] = { name = "Jari", icon = "item_icons\\bogling_chef" },
["mn.mn.0DAA3201532C8B8C"] = { name = "Goldgrille", icon = "item_icons\\broken_flintlock_mechanism" },
["mn.mn.3DAB24C1E1A3691D"] = { name = "Ritualist Madina", icon = "item_icons\\intact_shambler_eye" },
["mn.mn.3A236F8BC3A35DEA"] = { name = "Ithmyr", icon = "ability_icons\\tumblevanish2" },
["mn.mn.63E237742834B230"] = { name = "Scarbite", icon = "item_icons\\mount_croc_e" },
["mn.mn.5DF50BA0504DACC1"] = { name = "Azumel", icon = "item_icons\\batwing1" },
["mn.mn.FD054E35209F9EC6"] = { name = "Milkweed", icon = "item_icons\\tree_04", attractorType = "Harvest" },
["mn.mn.0BF558A1D69B8DE0"] = { name = "Prince Kaliban", icon = "item_icons\\lure_fire_02_a" },
["mn.mn.4C8FA456DA505AC1"] = { name = "Gruell", icon = "item_icons\\devils_head" },
["mn.mn.3FA461383989B666"] = { name = "Ereetu", icon = "item_icons\\faer_embers" },
["mn.mn.565A2BC3165A2458"] = { name = "Mech Anik", icon = "item_icons\\tongs4a" },
["mn.mn.08C47A00396420C3"] = { name = "Martrodraum", icon = "item_icons\\mount_3" },
["mn.mn.735D8D773DC87D97"] = { name = "Orlan", icon = "item_icons\\pet_spirit_jungle_greater" },
["mn.mn.170F29DEAED0BBBB"] = { name = "Nixtoc", icon = "item_icons\\pet_hellbug_yellow" },
["mn.mn.FAE9BF86392269D0"] = { name = "Muirden", icon = "item_icons\\bogling_chef_a" },
["mn.mn.775B69B3EBC54C48"] = { name = "Bloop", icon = "item_icons\\fish_45_h" },
["mn.mn.7C28BE4A8C810748"] = { name = "Nipper", icon = "item_icons\\pet_crab_a" },
["mn.mn.1EA38BBCAA984277"] = { name = "Omi", icon = "item_icons\\bogling_chef_a" },
["mn.mn.1EA56846E9E7D7E8"] = { name = "Zathral", icon = "item_icons\\pet_skeleton" },
["mn.mn.624B6DFEAB22DEAF"] = { name = "Aurora", icon = "item_icons\\dim_orb_blue_01" },
["mn.mn.1E4430CED0C69C53"] = { name = "Dargal", icon = "item_icons\\mount_croc_ii" },
["mn.mn.3F75BF8C11F494B3"] = { name = "Snowball", icon = "item_icons\\dim_orb_white_01" },
["mn.mn.1A4772CEF578F539"] = { name = "King Derribec", icon = "item_icons\\maurice_head" },
["mn.mn.3980BC81EF137149"] = { name = "Rirnef", icon = "item_icons\\pet_dire-wolf3" },
["mn.mn.687483C2269C0FA5"] = { name = "Zairatis", icon = "item_icons\\pet_dire-wolf3" },
["mn.mn.1C77B31E08AA38D4"] = { name = "Ivy", icon = "ability_icons\\druid-summon_satyr_a" },
["mn.mn.70187754A9F51D69"] = { name = "Eliam", icon = "item_icons\\frank_birlen_head" },
["mn.mn.1816486C062DA774"] = { name = "Runald", icon = "ability_icons\\tactician_mass_curative_engine_a", attractorType = "Hunting" },
["mn.mn.FB707D11F05D28D1"] = { name = "Necrawler", icon = "item_icons\\pet_scarab_b" },
["mn.mn.51FCDE2CD6D58B7B"] = { name = "Hylas", icon = "ability_icons\\druid_greater_faerie_seer_b" },
["mn.mn.30FBD74B0B6CE8F1"] = { name = "Yulogon", icon = "item_icons\\rotten_heartwood" },
["mn.mn.581A99271023F189"] = { name = "Augustor", icon = "item_icons\\cliff_bambler_horn" },
["mn.mn.66E70EB0864A2F1E"] = { name = "Pyrestorm", icon = "item_icons\\pet_black_phoenix_c" },
["mn.mn.16B50896CED1EE10"] = { name = "Ahgnox", icon = "item_icons\\shademarked_bone_fragment_3" },
["mn.mn.3566F23CA91BFE70"] = { name = "Drekanoth of Fate", icon = "ability_icons\\fanfare_of_power" },
["mn.mn.178C3D3E5BE9D9E2"] = { name = "Infernowl", icon = "item_icons\\pet_owl_e" },
["mn.mn.7C31D8DE1AE4FBC0"] = { name = "Yoodipti", icon = "item_icons\\mount_bird04" },
["mn.mn.FBE7E873130946DE"] = { name = "Tavanion", icon = "item_icons\\broken_flintlock_mechanism" },
["mn.mn.09970AA106DB1CA5"] = { name = "Dalkiros", icon = "item_icons\\serla_irmgard_head" },
["mn.mn.12C0F643D5586330"] = { name = "Ikaras", icon = "item_icons\\2h_staff_079_a" },
["mn.mn.359948085082481E"] = { name = "Tas'toni", icon = "item_icons\\pet_badger_c" },
["mn.mn.1BB9011EA330EA55"] = { name = "Kithlik", icon = "item_icons\\pet_raptor_a" },
["mn.mn.3DEF187B161FD93C"] = { name = "Tobbler", icon = "item_icons\\pet_gold_oreling_a" },
["mn.mn.11DEFBD0E435594C"] = { name = "Bitey", icon = "item_icons\\pet_hellbug" },
["mn.mn.1D5C4C2FEA8C95B5"] = { name = "Captain Quaq", icon = "ability_icons\\skelf_bite" },
["mn.mn.06AA94BEA134D178"] = { name = "Dariah", icon = "item_icons\\hanna_dern_head" },
["mn.mn.3D8398A3BCD825AE"] = { name = "Zebrayan", icon = "item_icons\\mount_croc_c" },
["mn.mn.FCC2C5B8D95BF9EA"] = { name = "Ewethanasia", icon = "item_icons\\pet_sheep_y" },
["mn.mn.0FADF007F2137C8C"] = { name = "Nyor'tothgylu", icon = "item_icons\\2h_mace_waterlord_a" },
["mn.mn.19EA3F3B11018547"] = { name = "Gurock", icon = "item_icons\\hill_giant_head" },
["mn.mn.4516B72FCC2CC664"] = { name = "Lucile", icon = "item_icons\\key_x_6", attractorType = "Dimension" },
["mn.mn.1F8587A436FF0724"] = { name = "Tasuil", icon = "item_icons\\pet_flame_phoenix_b" },
["mn.mn.5264F8975AE2EA92"] = { name = "Joloral Ragetide", icon = "item_icons\\fish6" },
["mn.mn.4D665F2703C0070E"] = { name = "Speludelver", icon = "item_icons\\lightsbane_diamond" },
["mn.mn.43F561F85E9FA979"] = { name = "C1-0N3", icon = "ability_icons\\warlord_everything_isaweapon" },
["mn.mn.50CA4F490F9950D9"] = { name = "Comet", icon = "item_icons\\mount_vaiyuu_holiday_white_b" },
["mn.mn.5F42971B3BB76630"] = { name = "Herald Roklom", icon = "item_icons\\intact_shambler_eye" },
["mn.mn.23F131944BC5E932"] = { name = "Ra'Aran of Fate", icon = "item_icons\\pet_flame_phoenix_a" },
["mn.mn.2D628C3245FA3876"] = { name = "Dead Simon", icon = "item_icons\\road_warden_body" },
["mn.mn.6B11F5ECD1525BF4"] = { name = "Marile", icon = "item_icons\\mount_arm_gargazelle" },
["mn.mn.59B03C56508F229B"] = { name = "Pizko", icon = "item_icons\\pet_spirit_river_greater" },
["mn.mn.FAAEB74D17D56006"] = { name = "Gil", icon = "item_icons\\pet_shambler_a" },
["mn.mn.1AB480EFDF7C38D3"] = { name = "Xorixla", icon = "item_icons\\naga_hand_a" },
["mn.mn.47B2C141A6D35B47"] = { name = "Ivory", icon = "item_icons\\critter_bird_tropical_03" },
["mn.mn.0AAEE0465417986E"] = { name = "Cresaphin", icon = "item_icons\\ranged_gun_death_epic" },
["mn.mn.214C1035391C3CE0"] = { name = "Shelath", icon = "item_icons\\pet_spirit_earth_greater" },
["mn.mn.4AB284A828F53771"] = { name = "Ms. Meles", icon = "item_icons\\pet_badger_a" },
["mn.mn.477658AB48C09CB8"] = { name = "Birch", icon = "item_icons\\tree_01a" },
["mn.mn.0E5FDD1F32112AFC"] = { name = "Mongrok", icon = "item_icons\\pet_dire-wolf2" },
["mn.mn.286DB60133AF10DD"] = { name = "Quetzie", icon = "item_icons\\bird_green1" },
["mn.mn.FBDAB459EF2E17F9"] = { name = "Salvarola", icon = "item_icons\\pet_zombie" },
["mn.mn.2B7CE9E8B3A274EB"] = { name = "Roshin", icon = "item_icons\\cliff_bambler_horn" },
["mn.mn.3B07672BE1EBEE3A"] = { name = "Snottongue", icon = "item_icons\\goblin_boss_head" },
["mn.mn.7A94FE5B22BDF300"] = { name = "Tagonia", icon = "item_icons\\bogling_chef_a" },
["mn.mn.FE4BE859462F73C4"] = { name = "Nado", icon = "item_icons\\fish19" },
["mn.mn.396F0F1F8EEBC895"] = { name = "Lecu the Claw", icon = "item_icons\\pet_cat_a" },
["mn.mn.2E2C44170B666386"] = { name = "Kiljurn", icon = "item_icons\\furrytail2a" },
["mn.mn.39024B14EBD00F45"] = { name = "Eelo", icon = "item_icons\\2h_staff_079" },
["mn.mn.718748DBB5C52F47"] = { name = "Ionraic", icon = "ability_icons\\tactician_empyrean_engine" },
["mn.mn.5ED7BC4AE0EE5C46"] = { name = "Naveer", icon = "item_icons\\mount_tiger_epic_b" },
["mn.mn.4DC8D04C330AAAAE"] = { name = "Voldax", icon = "item_icons\\slime_covered_tongue" },
["mn.mn.6E474DA2F1694951"] = { name = "Makirn", icon = "ability_icons\\druid-summon_faerie" },
["mn.mn.381408C9354E6C34"] = { name = "Lamonrian", icon = "item_icons\\mount_croc_f" },
["mn.mn.05F37A05882FC60B"] = { name = "Phanagos", icon = "ability_icons\\druid_summon_greater_satyr" },
["mn.mn.325819D98081A38D"] = { name = "Scythe", icon = "item_icons\\pet_cat_b" },
["mn.mn.FA8E857FC91206F9"] = { name = "Ravi", icon = "item_icons\\severed_orc_head" },
["mn.mn.2F15C2CF240A4F04"] = { name = "Sharad X9", icon = "item_icons\\broken_flintlock_mechanism" },
["mn.mn.5D9CCF18129093A5"] = { name = "Greatfather Frost", icon = "item_icons\\bogling_chef_a" },
["mn.mn.372432D8A4282398"] = { name = "Una", icon = "item_icons\\druid-summon_greater_faerie_a" },
["mn.mn.1751F1A8C9AC453B"] = { name = "Twist", icon = "item_icons\\pet_defiant_windup_horse_c" },
["mn.mn.602E4D52E176BF0A"] = { name = "Anuxy", icon = "item_icons\\seacap_husk" },
["mn.mn.73F1202107E15274"] = { name = "Tzul", icon = "item_icons\\murdantix_tzul" },
["mn.mn.5D25A2FD70F5A8E6"] = { name = "Lord Vyre", icon = "item_icons\\architect_queens_staff" },
["mn.mn.1BC597E9F2682D03"] = { name = "Cerulean Steel", icon = "ability_icons\\dominator_pain_armor", attractorType = "Diplomacy" },
["mn.mn.58C11FEAC4C86D19"] = { name = "Wilson", icon = "item_icons\\critter_bird_tropical_02_a" },
["mn.mn.5FD1647BD350E79F"] = { name = "Misty", icon = "item_icons\\pet_shambler" },
["mn.mn.286AF6F8F20E9522"] = { name = "Mark", icon = "item_icons\\broken_flintlock_mechanism" },
["mn.mn.7979D5FA3D31E2E2"] = { name = "Kallos", icon = "item_icons\\spiderleg2" },
["mn.mn.5A53B805235B1078"] = { name = "Cynthae", icon = "item_icons\\nagahand" },
["mn.mn.6EF6AC72E863DB27"] = { name = "Al", icon = "item_icons\\pet_frog_b" },
["mn.mn.1310B4EA321EB2BF"] = { name = "Moltarr", icon = "item_icons\\pet_dire-wolf_a" },
["mn.mn.2734E9FF19DCB8C6"] = { name = "Connor", icon = "item_icons\\pet_cat" },
["mn.mn.489E7D81B1F53832"] = { name = "Nightbringer", icon = "item_icons\\mount_vaiyuu_holiday_white_a" },
["mn.mn.318119B481695803"] = { name = "Doreen", icon = "item_icons\\mount_squirrel_water", attractorType = "Artifact" },
["mn.mn.50243D37C7D2CF91"] = { name = "Jilleen", icon = "ability_icons\\druid-summon_greater_faerie" },
["mn.mn.39FD5AE4ED72F3EC"] = { name = "Ich'kir", icon = "item_icons\\whetstone1_a" },
["mn.mn.473EF03EB23D6A01"] = { name = "Queen Zr'Bzz", icon = "item_icons\\plant49_bee" },
["mn.mn.7B664B8A3ABC46AB"] = { name = "Azach", icon = "item_icons\\batwing1" },
["mn.mn.57A93466A2AC69EC"] = { name = "Slobberjaw", icon = "item_icons\\pet_shambler_a" },
["mn.mn.5F7A1AD4A7849D08"] = { name = "Styxoris", icon = "item_icons\\mount_croc_f" },
["mn.mn.03F07F1E088D896C"] = { name = "Reginald", icon = "item_icons\\maurice_head_a" },
["mn.mn.4C85CE18E19D5374"] = { name = "Ranger Fahrand", icon = "item_icons\\skeleton2c_7" },
["mn.mn.345E4208DBB2A415"] = { name = "General Batua", icon = "item_icons\\charlie_road_head" },
["mn.mn.2277DFA1F111A814"] = { name = "Crumpus", icon = "item_icons\\wolf_fur_2" },
["mn.mn.3B678A5583F9AF04"] = { name = "Morid Finric", icon = "ability_icons\\underwaterbreath2" },
["mn.mn.01E706E0BAF3C604"] = { name = "Uriel Chuluun", icon = "item_icons\\goblin_sketches" },
["mn.mn.FDBE4BB4EC65AC22"] = { name = "Tsathtosa", icon = "item_icons\\pet_crab_b" },
["mn.mn.0ABBCC1840174C04"] = { name = "Martin", icon = "item_icons\\fae_yule_weasel", attractorType = "Harvest" },
["mn.mn.091BC40AEC65B99C"] = { name = "Opheline", icon = "item_icons\\meat_15_fly" },
["mn.mn.3D5C8717DB60A165"] = { name = "Kolmasveli", icon = "item_icons\\hill_giant_head_a" },
["mn.mn.FE7F205D01F9C132"] = { name = "Shuffles", icon = "item_icons\\broken_flintlock_mechanism" },
["mn.mn.2A4709713521626D"] = { name = "Archaeologist Herim", icon = "item_icons\\remade_artifact", attractorType = "Artifact" },
["mn.mn.07573EB2D092DA7A"] = { name = "Kre'll", icon = "item_icons\\bogling_chef_a" },
["mn.mn.5BC7CAA78B940EEB"] = { name = "Breezy", icon = "item_icons\\vanity_121_helm_a" }, -- Minion Card has "item_icons\\ironskin1_1"
["mn.mn.396BFAD6D74C74CC"] = { name = "Jineth", icon = "item_icons\\two_headed_coin", attractorType = "Artifact" },
["mn.mn.5CEC1714D7978466"] = { name = "Grish", icon = "item_icons\\goblin_boss_head" },
["mn.mn.0ECB6DC2BA4A3CA6"] = { name = "Grendelkhan", icon = "item_icons\\fur_white" },
["mn.mn.03AAEF74849D0621"] = { name = "Atrophinius the Festive", icon = "ability_icons\\druid_summon_greater_satyr_a" },
["mn.mn.7A5FE1A0C3EE8208"] = { name = "Xharlion", icon = "item_icons\\druid_summon_satyr_e" },
["mn.mn.48F2E8FF4E8BD764"] = { name = "Seoras", icon = "ability_icons\\whirlwind4" },
["mn.mn.3E96516D4E7D5A39"] = { name = "Sundereth", icon = "item_icons\\crucia_balloon_a" },
["mn.mn.462F8F4E24602127"] = { name = "Knifebeak", icon = "item_icons\\bird_snipe_red" },
["mn.mn.0F2D56DA0DD78C41"] = { name = "Patches", icon = "item_icons\\pet_valmera_cub" },
["mn.mn.75CD7F8CCD5708F7"] = { name = "Acalan", icon = "item_icons\\mount_croc_a" },
["mn.mn.06543A5D3D47D438"] = { name = "Fluffy", icon = "item_icons\\pet_dire-wolf2" },
["mn.mn.03B3215CF4F9E356"] = { name = "Tewop", icon = "item_icons\\mountain_troll_head_a" },
["mn.mn.05712446E716F457"] = { name = "Kepple", icon = "item_icons\\spiderleg2" },
["mn.mn.55165717150B3E6F"] = { name = "Mitch", icon = "item_icons\\bard_masks", attractorType = "Diplomacy" },
["mn.mn.07FA9FBDBBDAA38C"] = { name = "Swarmlord Khargroth", icon = "item_icons\\pet_scarab_a" },
["mn.mn.590CDD3504BB14BD"] = { name = "Rusila Dreadblade", icon = "item_icons\\trinket24" },
["mn.mn.6B7CD324AF131E89"] = { name = "Captain Dagon", icon = "item_icons\\pirate_hat" },
["mn.mn.396E5914D2478492"] = { name = "Gakakhis", icon = "ability_icons\\defiler_mask_of_depravity_a" },
["mn.mn.26109FF689247A9D"] = { name = "Mael Salach", icon = "ability_icons\\bowyer1" },
["mn.mn.5EA6D7CAA078033C"] = { name = "Garn", icon = "ability_icons\\fiery_blessing" },
["mn.mn.7F297AD0B9F3C92D"] = { name = "Prince Tristaine", icon = "item_icons\\neck30" },
["mn.mn.716E32D9A2261F12"] = { name = "Duke Arcarax", icon = "ability_icons\\heroicsurge1" },
["mn.mn.771B0FD60C68FBB3"] = { name = "Michael Bringhurst", icon = "item_icons\\pet_dire-wolf" },
["mn.mn.7B1F44EC5E7980A1"] = { name = "Jolly Hellbug", icon = "item_icons\\mount_hellbug_faeyule", attractorType = "Assassination" }
}
--[[ missing:
Snerkle, icon = "item_icons\\pet_spirit_fire_lesser"
Nessie, icon = "item_icons\\pet_corgi_a"
Grace, icon = "item_icons\pet_white_tiger_cub_a"
Spirit Kite, icon = "item_icons\\beach_umbrella_01c"
Athelan the Fallen Paladin, icon = "ability_icons\\berserk1a"
Courage, icon = "item_icons\\pet_corgi_a"
Pay to Whinny, icon = "item_icons\\mount6aa"
Haligan the Pyretouched, icon = "ability_icons\\summonskeleton4"
Rough Raptor, icon = "item_icons\\pet_raptor2"
The Nightstalker, icon = "item_icons\\mountain_troll_head_a"
Qu'ella the Wretched, icon = "item_icons\\mount_spider_b"
Taskmaster Atrophinius, icon = "item_icons\\druid_summon_satyr_e"
The Hag of Gloamwood, icon = "ability_icons\\finalstrike3a"
Sir Razerton, icon = "item_icons\\shrimp_razer"
Skitters, icon = "item_icons\\pet_scarab_a"
]]--
local team_tasuil = {
["mn.mn.66E70EB0864A2F1E"] = true,
["mn.mn.43F561F85E9FA979"] = true,
["mn.mn.00E0A4F5C1A34FDA"] = true,
["mn.mn.735D8D773DC87D97"] = true,
["mn.mn.1D5C4C2FEA8C95B5"] = true,
["mn.mn.718748DBB5C52F47"] = true
}
Pesky.Data.Adventure_Requirements = {
-- "Tasuil is Missing" chain
["mn.adv.0000006E42C33A1E"] = { minion = { ["mn.mn.372432D8A4282398"] = true } },
["mn.adv.000000782C301D54"] = { minion = { ["mn.mn.3980BC81EF137149"] = true } },
["mn.adv.0000008C0B61BDBF"] = { level = 15 },
["mn.adv.0000009613E52306"] = { stat = {statHunting = true } },
["mn.adv.000000A00CB9634A"] = { minion = team_tasuil },
-- Orlan, Lil Reggie, Ionraic, C1-0N3, Quaq and Pyrestorm preparation quests
["mn.adv.000000C31E570451"] = { minion = { ["mn.mn.735D8D773DC87D97"] = true } },
["mn.adv.000000C4173BDA27"] = { minion = { ["mn.mn.00E0A4F5C1A34FDA"] = true } },
["mn.adv.000000BF41F04405"] = { minion = { ["mn.mn.718748DBB5C52F47"] = true } },
["mn.adv.000000C0488D2773"] = { minion = { ["mn.mn.43F561F85E9FA979"] = true } },
["mn.adv.000000C2600DE62F"] = { minion = { ["mn.mn.1D5C4C2FEA8C95B5"] = true } },
["mn.adv.000000C157D107A9"] = { minion = { ["mn.mn.66E70EB0864A2F1E"] = true } },
["mn.adv.000000BE6C4A2F0B"] = {minion = team_tasuil},
-- Pyrestorm, C1-0N3, Lil Reggie, Orlan, Quaq and Ionraic rehearsal quests
["mn.adv.000000C83F76B739"] = { minion = { ["mn.mn.66E70EB0864A2F1E"] = true } },
["mn.adv.000000D2587D4537"] = { minion = { ["mn.mn.43F561F85E9FA979"] = true } },
["mn.adv.000000DC7C1BA193"] = { minion = { ["mn.mn.00E0A4F5C1A34FDA"] = true } },
["mn.adv.000000E614790CEE"] = { minion = { ["mn.mn.735D8D773DC87D97"] = true } },
["mn.adv.000000F030139A72"] = { minion = { ["mn.mn.1D5C4C2FEA8C95B5"] = true } },
["mn.adv.000000FA3BA917BD"] = { minion = { ["mn.mn.718748DBB5C52F47"] = true } },
-- team quests
["mn.adv.00000106603D906D"] = { minion = { ["mn.mn.1D5C4C2FEA8C95B5"] = true } },
["mn.adv.00000105243C3D80"] = { minion = { ["mn.mn.43F561F85E9FA979"] = true } },
["mn.adv.0000010F3E6FC73E"] = { minion = { ["mn.mn.66E70EB0864A2F1E"] = true } },
["mn.adv.0000011076BACFCD"] = { minion = { ["mn.mn.00E0A4F5C1A34FDA"] = true } },
["mn.adv.0000011A26808461"] = { minion = { ["mn.mn.735D8D773DC87D97"] = true } },
["mn.adv.0000011943B58D9C"] = { minion = { ["mn.mn.718748DBB5C52F47"] = true } }
}
|
{data={name="Explorer Annnne", author="Magnus siiftun1857 Frankline", color0=0x984ff,
color1=0xea8700, color2=0x3f3f3f, wgroup={0, 0, 2, 0}}, blocks={
{0x1604b8, {-18.435, 0.142}, command={faction=1443}, features=COMMAND|THRUSTER|GENERATOR|ASSEMBLER|CANNON_BOOST|TRACTOR|FACTORY|MELEE|UNIQUE},
{0x160519, {19.075, 15.142}},
{0x160519, {19.055, 0.142}, 3.142},
{0x160560, {11.555, 0.142}},
{0x160560, {11.555, -9.858}},
{0x160519, {19.055, -14.858}},
{0x160517, {23.222, -14.858}},
{0x160560, {11.555, -19.858}},
{0x1605a6, {1.555, -49.858}, -1.571, bindingId=1},
{0x160588, {-18.445, -19.858}},
{0x160588, {-8.445, -19.858}},
{0x160588, {1.555, -19.858}},
{0x160517, {23.242, 15.142}},
{0x16052c, {-48.435, 0.142}},
{0x1605ac, {-48.435, -29.858}, 3.142},
{0x160514, {-28.425, -34.858}},
{0x160588, {-28.425, -59.858}},
{0x160588, {-28.445, -69.858}},
{0x1604c8, {-43.445, -94.858}, 2.356},
{0x1604d8, {-33.445, -114.858}, -0.785},
{0x1604cc, {-13.445, -84.858}},
{0x1604cc, {6.555, -84.858}},
{0x1604cd, {21.555, -79.858}},
{0x1604d3, {33.222, -71.525}, 2.356},
{0x1604e3, {39.889, -78.191}, -0.785},
{0x1604dc, {56.555, -74.858}},
{0x1605be, {93.222, -78.191}, 2.356},
{0x1605bc, {126.555, -44.858}},
{0x1605be, {173.222, -38.191}, 2.356},
{0x1605b9, {221.555, -19.168}, 1.571},
{0x1605b9, {211.555, -19.168}, 1.571},
{0x1605b9, {201.555, -19.168}, 1.571},
{0x1605b9, {191.555, -19.168}, 1.571},
{0x1605b9, {181.555, -19.168}, 1.571},
{0x1605b9, {171.555, -19.168}, 1.571},
{0x1605b9, {161.555, -19.168}, 1.571},
{0x1605b9, {151.555, -19.168}, 1.571},
{0x1605b9, {141.555, -19.168}, 1.571},
{0x1605b9, {131.555, -19.168}, 1.571},
{0x1605b9, {121.555, -19.168}, 1.571},
{0x1605b9, {111.555, -19.168}, 1.571},
{0x1605b9, {101.555, -19.168}, 1.571},
{0x1605b9, {91.555, -19.168}, 1.571},
{0x1605b9, {81.555, -19.168}, 1.571},
{0x1604cd, {61.555, -19.858}},
{0x1605b5, {61.555, 0.142}},
{0x1604d1, {56.555, -12.358}, 1.571},
{0x1604d3, {39.889, -18.191}, -0.785},
{0x160501, {1.565, 10.132}, bindingId=6},
{0x1604d0, {49.055, 0.142}},
{0x1604d1, {56.555, 12.642}, -1.571},
{0x1604cd, {51.555, -19.858}},
{0x1605b9, {81.575, 19.452}, -1.571},
{0x1605b9, {91.575, 19.452}, -1.571},
{0x1605b9, {101.575, 19.452}, -1.571},
{0x1605b9, {111.575, 19.452}, -1.571},
{0x1605b9, {121.575, 19.452}, -1.571},
{0x1605b9, {131.575, 19.452}, -1.571},
{0x1605b9, {141.575, 19.452}, -1.571},
{0x1605b9, {151.575, 19.452}, -1.571},
{0x1605b9, {161.575, 19.452}, -1.571},
{0x1605b9, {171.575, 19.452}, -1.571},
{0x1605b9, {181.575, 19.452}, -1.571},
{0x1605b9, {191.575, 19.452}, -1.571},
{0x1605b9, {201.575, 19.452}, -1.571},
{0x1605b9, {211.575, 19.452}, -1.571},
{0x1605b9, {221.575, 19.452}, -1.571},
{0x1605bf, {173.242, 38.475}, -2.356},
{0x1605bc, {126.575, 45.142}},
{0x1604dc, {96.575, 35.142}},
{0x1604e3, {79.909, 38.475}, 0.785},
{0x1604d3, {73.242, 31.809}, -2.356},
{0x1604cc, {56.575, 35.142}},
{0x1604cc, {36.575, 35.142}},
{0x1604d3, {39.909, 18.475}, 0.785},
{0x1605a6, {1.575, 50.142}, 1.571, bindingId=1},
{0x1604f4, {23.242, 21.809}, -3.142},
{0x1604f4, {29.909, 18.475}},
{0x1604f1, {31.575, 12.642}, 1.571},
{0x1605a3, {31.555, 0.142}, bindingId=5},
{0x1604f1, {44.055, 0.142}},
{0x1604f1, {31.555, -12.358}, -1.571},
{0x1604f4, {29.889, -18.191}, -1.571},
{0x1604f4, {23.222, -21.525}, 1.571},
{0x160560, {11.575, 20.142}},
{0x160560, {11.575, 10.142}},
{0x160588, {1.555, 20.142}},
{0x160588, {-8.445, 20.142}},
{0x160588, {-18.425, 20.142}},
{0x160514, {-28.425, 35.142}},
{0x1605af, {-48.435, 30.142}, 3.142},
{0x160588, {-38.425, 50.142}},
{0x160547, {-48.435, 50.142}},
{0x160547, {-58.425, 50.142}},
{0x160547, {-68.445, 50.142}},
{0x1605a9, {-78.435, 30.142}, -1.571},
{0x16052c, {-78.435, 0.142}},
{0x1605a9, {-78.435, -29.858}, 1.571},
{0x160547, {-68.425, -49.858}},
{0x160547, {-58.425, -49.858}},
{0x160547, {-48.435, -49.858}},
{0x160588, {-38.425, -49.858}},
{0x160588, {-38.425, -59.858}},
{0x160588, {-38.445, -69.858}},
{0x160547, {-48.435, -69.858}},
{0x160547, {-58.425, -69.858}},
{0x1604bc, {-63.445, -84.858}},
{0x160501, {1.565, -9.848}, bindingId=6},
{0x1604bc, {-63.445, -124.858}},
{0x1604ca, {-60.111, -141.525}, 2.356},
{0x1604da, {-56.778, -148.191}, -0.785},
{0x1604d2, {-43.445, -144.858}, 2.356},
{0x1604e2, {-33.445, -154.858}, -0.785},
{0x1604df, {-20.945, -149.858}, 3.142},
{0x1605bd, {-5.111, -143.191}, 2.356},
{0x1604df, {1.555, -127.358}, 1.571},
{0x1604e2, {6.555, -114.858}, -0.785},
{0x1604d2, {-3.445, -104.858}, 2.356},
{0x1604cd, {-18.445, -119.858}},
{0x1604d4, {-20.111, -128.191}, -1.571},
{0x1604cd, {-18.445, -109.858}},
{0x1604cd, {-18.445, -99.858}},
{0x1604df, {19.055, -109.858}, 3.142},
{0x1604e1, {24.055, -94.858}, 3.142},
{0x1604dc, {36.555, -94.858}},
{0x1604dc, {56.555, -94.858}},
{0x1604e6, {39.889, -111.525}, 2.356},
{0x1604e0, {24.055, -114.858}},
{0x1604df, {-38.445, -167.358}, 1.571},
{0x1605bd, {-45.111, -183.191}, 2.356},
{0x1604df, {-60.945, -189.858}, 3.142},
{0x1604e2, {-73.445, -194.858}, -0.785},
{0x1604df, {-78.445, -207.358}, 1.571},
{0x1605bd, {-85.111, -223.191}, 2.356},
{0x1604df, {-100.945, -229.858}, -3.142},
{0x1604e2, {-113.445, -234.858}, -0.785},
{0x1604bc, {-63.425, 105.142}},
{0x1604df, {-118.445, -247.358}, 1.571},
{0x1605bd, {-125.111, -263.191}, 2.356},
{0x1604df, {-140.945, -269.858}, -3.142},
{0x1604cd, {-58.445, -159.858}},
{0x1604d4, {-60.111, -168.191}, -1.571},
{0x1604da, {-66.778, -168.191}, -0.785},
{0x1604ca, {-70.111, -161.525}, 2.356},
{0x1604bd, {-78.445, -169.858}},
{0x1604ca, {-80.111, -181.525}, 2.356},
{0x1604bd, {-88.445, -189.858}},
{0x1604c4, {-90.111, -198.191}, -1.571},
{0x1604ca, {-96.778, -198.191}, -0.785},
{0x1605ba, {-108.88, -189.64}, 2.678},
{0x1604c4, {-100.111, -208.191}, -1.571},
{0x1604ca, {-86.778, -178.191}, -0.785},
{0x1605ba, {-98.88, -169.64}, 2.678},
{0x1604ca, {-76.778, -158.191}, -0.785},
{0x1605ba, {-88.88, -149.64}, 2.678},
{0x1604ca, {-70.111, -141.525}, 2.356},
{0x1604ca, {-66.778, -148.191}, -0.785},
{0x1604ca, {-80.111, -138.191}, 0.785},
{0x1604de, {-88.445, -129.858}, 1.571},
{0x1604e0, {-88.445, -122.358}, 1.571},
{0x1605b8, {-93.435, -104.858}, -3.142, bindingId=2},
{0x1604e0, {-88.435, -87.358}, -1.571},
{0x1604de, {-88.435, -79.858}, -1.571},
{0x16059d, {-88.435, -59.858}},
{0x160547, {-68.425, -59.858}},
{0x160547, {-58.425, -59.858}},
{0x160547, {-48.435, -59.858}},
{0x160547, {-68.435, -69.858}},
{0x1605bb, {-120.935, -59.868}, -3.142},
{0x1605af, {-108.435, -29.858}},
{0x16052c, {-108.435, 0.142}},
{0x1605ac, {-108.435, 30.142}},
{0x1605bb, {-120.917, 60.142}, 3.142},
{0x16059d, {-88.425, 60.142}},
{0x160547, {-68.425, 70.142}},
{0x160547, {-58.425, 70.142}},
{0x160547, {-48.435, 70.142}},
{0x160588, {-38.425, 70.142}},
{0x160588, {-28.425, 70.142}},
{0x160588, {-28.425, 60.142}},
{0x160588, {-38.425, 60.142}},
{0x160547, {-48.435, 60.142}},
{0x160547, {-58.425, 60.142}},
{0x160547, {-68.425, 60.142}},
{0x1604c5, {-43.425, 95.142}, -2.356},
{0x1604d5, {-33.425, 115.142}, 0.785},
{0x1604cc, {-13.425, 85.142}},
{0x1604cc, {6.575, 85.142}},
{0x1604d4, {19.909, 88.475}},
{0x1604cd, {21.575, 80.142}},
{0x1604d3, {33.242, 71.809}, -2.356},
{0x1604e3, {39.909, 78.475}, 0.785},
{0x1604dc, {36.575, 95.142}},
{0x1604dc, {56.575, 95.142}},
{0x1605bf, {93.242, 78.475}, -2.356},
{0x1604e9, {93.242, 58.475}, 0.785},
{0x1604e9, {79.909, 51.809}, -2.356},
{0x1604e3, {59.909, 58.475}, 0.785},
{0x1604d3, {53.242, 51.809}, -2.356},
{0x1604cc, {36.575, 55.142}},
{0x1604dc, {56.575, 75.142}},
{0x1604e9, {39.909, 111.809}, -2.356},
{0x1604e0, {24.075, 115.142}},
{0x1604df, {19.075, 110.142}, 3.142},
{0x1604e2, {6.575, 115.142}, 0.785},
{0x1604d2, {-3.425, 105.142}, -2.356},
{0x1604cd, {-18.425, 100.142}},
{0x1604cd, {-18.425, 110.142}},
{0x1604cd, {-18.425, 120.142}},
{0x1604d4, {-20.091, 128.475}},
{0x1604df, {1.575, 127.642}, -1.571},
{0x1605bd, {-5.091, 143.475}, -2.356},
{0x1604df, {-20.925, 150.142}, 3.142},
{0x1604e2, {-33.425, 155.142}, 0.785},
{0x1604d2, {-43.425, 145.142}, -2.356},
{0x1604d7, {-56.758, 148.475}, 0.785},
{0x1604c7, {-60.091, 141.809}, -2.356},
{0x1604c7, {-66.758, 148.475}, 0.785},
{0x1604c7, {-70.091, 141.809}, -2.356},
{0x1604c7, {-76.758, 158.475}, 0.785},
{0x1605ba, {-88.86, 149.925}, -2.678},
{0x1604c7, {-70.091, 161.809}, -2.356},
{0x1604d7, {-66.758, 168.475}, 0.785},
{0x1604cd, {-58.425, 160.142}},
{0x1604d4, {-60.091, 168.475}},
{0x1604d4, {-70.091, 178.475}},
{0x1604bd, {-78.425, 170.142}},
{0x1604c7, {-86.758, 178.475}, 0.785},
{0x1605ba, {-98.86, 169.925}, -2.678},
{0x1604c7, {-80.091, 181.809}, -2.356},
{0x1604bd, {-88.425, 190.142}},
{0x1604c7, {-96.758, 198.475}, 0.785},
{0x1605ba, {-108.86, 189.925}, -2.678},
{0x1604c4, {-90.091, 198.475}},
{0x1604c4, {-100.091, 208.475}},
{0x1604c7, {-80.091, 138.475}, -0.785},
{0x1604de, {-88.425, 130.142}, -1.571},
{0x1604e0, {-88.425, 122.642}, -1.571},
{0x1605b8, {-93.425, 105.142}, -3.142, bindingId=2},
{0x1604df, {-75.925, 105.142}, 3.142},
{0x1604bc, {-63.425, 125.142}},
{0x1604bc, {-63.425, 85.142}},
{0x160501, {1.565, 0.142}, bindingId=6},
{0x1604e4, {-76.758, 128.475}, 1.571},
{0x1604e0, {-88.425, 87.642}, 1.571},
{0x1604df, {-38.425, 167.642}, -1.571},
{0x1605bd, {-45.091, 183.475}, -2.356},
{0x1604df, {-60.925, 190.142}, 3.142},
{0x1604e2, {-73.425, 195.142}, 0.785},
{0x1604df, {-78.425, 207.642}, -1.571},
{0x1605bd, {-85.091, 223.475}, -2.356},
{0x1604df, {-100.925, 230.142}, 3.142},
{0x1604e2, {-113.425, 235.142}, 0.785},
{0x1604df, {-118.425, 247.642}, -1.571},
{0x1605bd, {-125.091, 263.475}, -2.356},
{0x1604df, {-140.925, 270.142}, 3.142},
{0x1604e1, {24.075, 95.142}, 3.142},
{0x1604e4, {-76.778, -81.525}, 1.571},
{0x1604df, {-75.945, -104.858}, 3.142},
{0x1604e4, {-76.778, -128.191}, 3.142},
{0x1604d4, {-70.111, -178.191}, -1.571},
{0x1604cc, {36.555, -34.858}},
{0x1604cc, {56.555, -34.858}},
{0x1604d3, {73.222, -31.525}, 2.356},
{0x1604e3, {79.889, -38.191}, -0.785},
{0x1604dc, {96.555, -34.858}},
{0x1604e6, {79.889, -51.525}, 2.356},
{0x1604e6, {93.222, -58.191}, -0.785},
{0x1604e3, {59.889, -58.191}, -0.785},
{0x1604d3, {53.222, -51.525}, 2.356},
{0x1604cc, {36.555, -54.858}},
{0x1604d4, {19.889, -88.191}, -1.571},
{0x1604cd, {61.575, 20.142}},
{0x1604cd, {51.575, 20.142}},
{0x1605b9, {71.555, -19.168}, 1.571},
{0x1605b9, {71.575, 19.452}, -1.571},
{0x1604bc, {-63.445, -104.858}},
{0x1605c3, {-76.782, -184.866}, 1.571},
{0x1605c1, {-106.778, -214.858}, 1.571},
{0x1605c0, {-106.758, 215.142}, -1.571},
{0x1604e1, {-127.264, 235.445}, -2.356},
{0x1605c2, {-76.762, 185.15}, -1.571},
{0x1604e1, {-127.284, -235.161}, 2.356},
{0x1605ba, {-118.884, -209.648}, 2.678},
{0x1605ba, {-118.856, 209.917}, -2.678}}} |
object_tangible_deed_pet_deed_horned_platile_deed = object_tangible_deed_pet_deed_shared_horned_platile_deed:new {
}
ObjectTemplates:addTemplate(object_tangible_deed_pet_deed_horned_platile_deed, "object/tangible/deed/pet_deed/horned_platile_deed.iff")
|
local module = {}
function module.onEnable(entity, component)
local lamp = entity
for index, possibleClickDetector in pairs(lamp:GetDescendants()) do
if possibleClickDetector:IsA("ClickDetector") then
possibleClickDetector.MouseClick:connect(function()
for index, possibleLight in pairs(lamp:GetDescendants()) do
if possibleLight:IsA("Light") then
possibleLight.Enabled = not possibleLight.Enabled
end
end
end)
end
end
end
return module
|
Marine.kWalkBackwardSpeedScalar = 0.9
|
local GSE = GSE
local L = GSE.L
local Statics = GSE.Static
--- Return the characters current spec id
function GSE.GetCurrentSpecID()
local version, build, date, tocversion = GetBuildInfo()
local majorVersion = GSE.split(version, '.')
if tonumber(majorVersion[1]) == 1 then
return GSE.GetCurrentClassID() and GSE.GetCurrentClassID()
else
local currentSpec = GetSpecialization()
return currentSpec and select(1, GetSpecializationInfo(currentSpec)) or 0
end
end
--- Return the characters class id
function GSE.GetCurrentClassID()
local _, _, currentclassId = UnitClass("player")
return currentclassId
end
--- Return the characters class id
function GSE.GetCurrentClassNormalisedName()
local _, classnormalisedname, _ = UnitClass("player")
return classnormalisedname
end
function GSE.GetClassIDforSpec(specid)
-- check for Classic WoW
local version, build, date, tocversion = GetBuildInfo()
local majorVersion = GSE.split(version, '.')
local classid = 0
if tonumber(majorVersion[1]) == 1 then
-- classic wow
classid = Statics.SpecIDClassList[specid]
else
local id, name, description, icon, role, class = GetSpecializationInfoByID(specid)
if specid <= 12 then
classid = specid
else
for i=1, 12, 1 do
local cdn, st, cid = GetClassInfo(i)
if class == st then
classid = i
end
end
end
end
return classid
end
function GSE.GetClassIcon(classid)
local classicon = {}
classicon[1] = "Interface\\Icons\\inv_sword_27" -- Warrior
classicon[2] = "Interface\\Icons\\ability_thunderbolt" -- Paladin
classicon[3] = "Interface\\Icons\\inv_weapon_bow_07" -- Hunter
classicon[4] = "Interface\\Icons\\inv_throwingknife_04" -- Rogue
classicon[5] = "Interface\\Icons\\inv_staff_30" -- Priest
classicon[6] = "Interface\\Icons\\inv_sword_27" -- Death Knight
classicon[7] = "Interface\\Icons\\inv_jewelry_talisman_04" -- SWhaman
classicon[8] = "Interface\\Icons\\inv_staff_13" -- Mage
classicon[9] = "Interface\\Icons\\spell_nature_drowsy" -- Warlock
classicon[10] = "Interface\\Icons\\Spell_Holy_FistOfJustice" -- Monk
classicon[11] = "Interface\\Icons\\inv_misc_monsterclaw_04" -- Druid
classicon[12] = "Interface\\Icons\\INV_Weapon_Glave_01" -- DEMONHUNTER
return classicon[classid]
end
--- Check if the specID provided matches the plauers current class.
function GSE.isSpecIDForCurrentClass(specID)
local _, specname, specdescription, specicon, _, specrole, specclass = GetSpecializationInfoByID(specID)
local currentclassDisplayName, currentenglishclass, currentclassId = UnitClass("player")
if specID > 15 then
GSE.PrintDebugMessage("Checking if specID " .. specID .. " " .. specclass .. " equals " .. currentenglishclass)
else
GSE.PrintDebugMessage("Checking if specID " .. specID .. " equals currentclassid " .. currentclassId)
end
return (specclass==currentenglishclass or specID==currentclassId)
end
function GSE.GetSpecNames()
local keyset={}
for k,v in pairs(Statics.SpecIDList) do
keyset[v] = v
end
return keyset
end
--- Returns the Character Name in the form Player@server
function GSE.GetCharacterName()
return GetUnitName("player", true) .. '@' .. GetRealmName()
end
--- Returns the current Talent Selections as a string
function GSE.GetCurrentTalents()
local talents = ""
local version, build, date, tocversion = GetBuildInfo()
local majorVersion = GSE.split(version, '.')
-- Need to change this later on to something meaningful
if tonumber(majorVersion[1]) == 1 then
talents = "CLASSIC"
else
for talentTier = 1, MAX_TALENT_TIERS do
local available, selected = GetTalentTierInfo(talentTier, 1)
talents = talents .. (available and selected or "?" .. ",")
end
end
return talents
end
--- Experimental attempt to load a WeakAuras string.
function GSE.LoadWeakauras(str)
local WeakAuras = WeakAuras
if WeakAuras then
WeakAuras.ImportString(str)
end
end
|
GROUP_NAME = "emergency"
Models = {
[`blazer2`] = "cruiser",
[`dcrfpiu`] = "cruiser",
[`dcrspeedo`] = "cruiser",
[`dcrtahoe`] = "cruiser",
[`dcrtahoe2`] = "cruiser",
[`dpscharger`] = "cruiser",
[`dpscharger2`] = "cruiser",
[`dpscvpi`] = "cruiser",
[`dpsf150`] = "cruiser",
[`dpsfpis`] = "cruiser",
[`dpsfpiu`] = "cruiser",
[`dpsfpiu2`] = "cruiser",
[`dpstahoe`] = "cruiser",
[`fbi`] = "cruiser",
[`fbi2`] = "cruiser",
[`lguard`] = "cruiser",
[`pbus`] = "cruiser",
[`pdcaprice`] = "cruiser",
[`pdcharger`] = "cruiser",
[`pdcvpi`] = "cruiser",
[`pdfpis`] = "cruiser",
[`pdfpiu`] = "cruiser",
[`pdtahoe`] = "cruiser",
[`sdf150`] = "cruiser",
[`dpscamaro`] = "intercept",
[`dpsdemon`] = "intercept",
[`pdc8`] = "intercept",
[`pdcomet`] = "intercept",
[`pddemon`] = "intercept",
[`pdhellcat`] = "intercept",
[`pdrs6`] = "intercept",
[`pdstang`] = "intercept",
[`pdbearcat`] = "armored",
[`riot`] = "armored",
[`riot2`] = "armored",
[`swattahoe`] = "armored",
[`harley`] = "bike",
[`pdsanchez`] = "bike",
[`emsexplorer`] = "ambulance",
[`emsspeedo`] = "ambulance",
[`emstahoe`] = "ambulance",
[`firetruk`] = "ambulance",
[`polmav`] = "heli",
[`rsheli`] = "heli",
[`predator`] = "boat",
}
exports.trackers:CreateGroup(GROUP_NAME, {
delay = 2000,
states = {
[1] = { -- Peds.
["ems"] = {
Colour = 8,
},
["pd"] = {
Colour = 3,
},
},
[2] = { -- Vehicles.
["ambulance"] = {
Colour = 8,
Sprite = 750,
},
["cruiser"] = {
Colour = 3,
},
["intercept"] = {
Colour = 3,
Sprite = 595,
},
["armored"] = {
Colour = 3,
Sprite = 800,
},
["bike"] = {
Colour = 3,
Sprite = 661,
},
["heli"] = {
Colour = 3,
Sprite = 64,
},
["boat"] = {
Colour = 3,
Sprite = 427,
},
}
},
})
AddEventHandler("entityCreated", function(entity)
if not DoesEntityExist(entity) then return end
local model = GetEntityModel(entity)
if not model then return end
local state = Models[model]
if state then
exports.trackers:AddEntity(GROUP_NAME, entity, { state = state })
end
end) |
local metric_tube_inject_item_calls = monitoring.counter(
"pipeworks_tube_inject_item_calls",
"count of pipeworks.tube_inject_item calls"
)
local metric_tube_inject_item_time = monitoring.counter(
"pipeworks_tube_inject_item_time",
"time of pipeworks.tube_inject_item calls"
)
local metric_tube_inject_item_limited_calls = monitoring.counter(
"pipeworks_tube_inject_item_limited_calls",
"count of pipeworks.tube_inject_item calls that were blocked"
)
local old_inject_item = pipeworks.tube_inject_item
pipeworks.tube_inject_item = function(pos, start_pos, velocity, item, owner)
if not monitoring.pipeworks.enabled then
-- only allow call if the mod is in "enabled" state
return
end
local limit_reached = monitoring.pipeworks.inject_limiter(pos)
if limit_reached then
-- limit exceeded
metric_tube_inject_item_limited_calls.inc()
return
end
-- everything ok, let it go into tubes
old_inject_item(pos, start_pos, velocity, item, owner)
end
-- wrap metrics interceptor around it
pipeworks.tube_inject_item = metric_tube_inject_item_calls.wrap(
metric_tube_inject_item_time.wraptime(pipeworks.tube_inject_item)
)
|
UiTile = UiCopyTable(dxMain)
function UiTile:Create(x, y, sx, sy,image,text,parent)
local tile = setmetatable({
x=x,
y=y,
sx=sx,
sy=sy,
text = text,
children = {},
parent = false,
visible = true,
el = createElement("dxtile"),
hover = false,
redraw = true,
enabled = true,
types = "tile",
color = tocolor(41,123,237),
bordercolor = tocolor(60,128,238),
image = image,
imagedata = {x=0,y=0,fullsize=false},
text = text,
oldimg = false,
newimg = false,
animset = false,
cacheenabled = true,
tickStart = 0,
animationEnabled = true,
}, UiTile.__mt)
addToAllRender(tile)
if image and image ~= "" and fileExists(image) then
local myTexture = dxCreateTexture(image)
local width, height = dxGetMaterialSize( myTexture )
tile.imagedata = {x=width,y=height}
destroyElement(myTexture)
else
tile.image = false
end
if parent then
tile.parent = parent
parent:AddChild(tile)
end
return tile
end
function UiTile:setText(text)
self.text = text
self.redraw = true
end
function UiTile:setImage(image,fullsize)
if not fullsize then
local myTexture = dxCreateTexture(image)
local width, height = dxGetMaterialSize( myTexture )
self.imagedata = {x=width,y=height,fullsize=false}
destroyElement(myTexture)
self.image = image
self.redraw = true
else
if self.animationEnabled then
self.oldimg = (type(self.image)=="string" and dxCreateTexture(self.image) or self.image)
self.newimg = (type(image)=="string" and dxCreateTexture(image) or image)
self.shader = dxCreateShader ( "file/rotationShader.fx" )
dxSetShaderValue ( self.shader, "g_Texture", self.oldimg )
self.imagedata = {x=self.sx,y=self.sy,fullsize=true}
self.animset = true
self.tickStart = getTickCount ()
else
self.imagedata = {x=self.sx,y=self.sy,fullsize=true}
self.image = image
self.redraw = true
end
end
end
function UiTile:onRender()
if not self:getVisible() then
return
end
if self.animset then
local a = math.fmod ( ( getTickCount () - self.tickStart+1500 ) / 1000, 2 * math.pi )
dxSetShaderValue ( self.shader, "g_Pos", self.sx/2, self.sy/2 )
dxSetShaderValue ( self.shader, "g_ScrSize", self.sx,self.sy )
if a > math.pi-(math.pi*0.5) and a < math.pi+(math.pi*0.5) then
if ( a < math.pi ) then
dxSetShaderValue ( self.shader, "g_Texture", self.oldimg )
dxSetShaderValue ( self.shader, "g_fAngle", math.pi/2 - a )
else
dxSetShaderValue ( self.shader, "g_Texture", self.newimg )
dxSetShaderValue ( self.shader, "g_fAngle", math.pi/2 - a + math.pi )
end
self.image = self.shader
self.redraw = true
elseif a > math.pi+(math.pi*0.5) then
self.animset = false
self.image = self.newimg
self.newimg = false
if isElement(self.oldimg) then
destroyElement(self.oldimg)
end
if isElement(self.shader) then
destroyElement(self.shader)
end
self.shader = false
self.oldimg = false
self.redraw = true
end
end
if(self.redraw) then
self:UpdateRT()
end
local posx, posy = self:getOnScreenPosition()
local clicked = 0
if self.down then
clicked = 2
end
--dxDrawText(self.text, self.x+xp,self.y+xy,self.sx,self.sy,tocolor(255,255,255), 1,cache.Font, "left", "center")
if self.hover and self:getEnabled() then
dxDrawRectangle(posx-3+clicked, posy-3+clicked, self.sx+6-(clicked*2), self.sy+6-(clicked*2),tocolor(33,87,33,255),true)
else
self.hover = false
end
dxDrawImage(posx+clicked,posy+clicked,self.sx-(clicked*2),self.sy-(clicked*2),self.rt,0,0,0,tocolor(255,255,255,255),true)
end
function UiTile:setProperty(name,...)
local args = {...}
if name == "animationEnabled" then
self.animationEnabled = args[1]
elseif name == "bordercolor" then
self.bordercolor = tocolor(args[1],args[2],args[3],args[4] or 255)
self.redraw = true
end
end
function UiTile:onMouseEnter()
if self:getEnabled() then
self.hover = true
self.redraw = true
end
end
function UiTile:onMouseLeave()
if self:getEnabled() then
self.hover = false
self.redraw = true
end
end
function UiTile:onMouseClick(btn, state, x, y)
if self:getEnabled() then
if btn == "left" then
self.down = (state == "down")
end
triggerEvent("onModernUIClick",localPlayer,self.el,btn,state,x,y)
triggerEvent("onDxGUIClick",self.el,btn,state,x,y)
end
end
--function UiTile:setColor(r,g,b)
--self.bordercolor = tocolor(r or 0,g or 0,b or 0)
--end
function UiTile:UpdateRT()
if(not self.rt) then
self.rt = dxCreateRenderTarget(self.sx, self.sy)
end
local fontheight = dxGetFontHeight (0.4,cache.Font)
local imagesizex,imagesizey = self.sx-10,self.sy-fontheight-14
local imageposx,imageposy = (self.sx - imagesizex)/2,(self.sy-imagesizey-fontheight)/2
if not self.imagedata.fullsize then
if self.imagedata.x-10 < imagesizex then
imagesizex = self.imagedata.x
imageposx = (self.sx - imagesizex)/2
end
if self.imagedata.y-fontheight-14 < imagesizey then
imagesizey = self.imagedata.y
imageposy = (self.sy-imagesizey-fontheight)/2
end
else
imagesizex,imagesizey,imageposx,imageposy = self.sx,self.sy,0,0
end
local clr = self.color
local borderclr = self.bordercolor
if not self:getEnabled() then
clr = tocolor(43,42,37)
end
dxSetRenderTarget(self.rt)
dxDrawRectangle(0, 0, self.sx , self.sy,clr)
dxDrawRectangle(0, 0, self.sx, 3, borderclr)
dxDrawRectangle(0, self.sy-3, self.sx, 3,borderclr)
dxDrawRectangle(self.sx-3, 0, 3,self.sy, borderclr)
dxDrawRectangle(0, 0, 3, self.sy,borderclr)
if self.image then
dxDrawImage(imageposx,imageposy, imagesizex,imagesizey,self.image,0,0,0,tocolor(255,255,255,255))
end
dxDrawText(self.text, 18, self.sy-fontheight-9+1, self.sx , 20,tocolor(0,0,0,255), 0.4,cache.Font)
dxDrawText(self.text, 17, self.sy-fontheight-9, self.sx , 20,tocolor(255,255,255,255), 0.4,cache.Font)
dxSetRenderTarget()
self.redraw = false
end |
local _ = require("levee")._
return {
test_core = function()
local t = {foo = "bar", more = "more\nnewline", nested = {1, {two = 2}, 3}}
_.repr(t)
t["t"] = t
_.repr(t)
end,
}
|
--- === cp.apple.finalcutpro.browser.AppearanceAndFiltering ===
---
--- Clip Appearance & Filtering Menu Popover
local require = require
--local log = require("hs.logger").new("appearanceAndFiltering")
local axutils = require "cp.ui.axutils"
local Button = require "cp.ui.Button"
local CheckBox = require "cp.ui.CheckBox"
local Popover = require "cp.ui.Popover"
local PopUpButton = require "cp.ui.PopUpButton"
local Slider = require "cp.ui.Slider"
local go = require "cp.rx.go"
local If = go.If
local SetProp = go.SetProp
local WaitUntil = go.WaitUntil
local cache = axutils.cache
local childFromRight = axutils.childFromRight
local childFromTop = axutils.childFromTop
local childMatching = axutils.childMatching
local childrenWithRole = axutils.childrenWithRole
local AppearanceAndFiltering = Popover:subclass("cp.apple.finalcutpro.browser.AppearanceAndFiltering")
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.matches(element) -> boolean
--- Function
--- Checks to see if a GUI element is the "Clip Appearance & Filtering Menu" popover or not.
---
--- Parameters:
--- * element - The element you want to check
---
--- Returns:
--- * `true` if the `element` is the "Clip Appearance & Filtering Menu" popover otherwise `false`
function AppearanceAndFiltering.static.matches(element)
return Popover.matches(element)
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering(parent) -> AppearanceAndFiltering
--- Constructor
--- Constructs a new "Clip Appearance & Filtering Menu" popover.
---
--- Parameters:
--- * parent - The parent object
---
--- Returns:
--- * The new `AppearanceAndFiltering` instance.
function AppearanceAndFiltering:initialize(parent)
local UI = parent.UI:mutate(function(original)
return cache(self, "_ui", function()
return childMatching(original(), AppearanceAndFiltering.matches)
end,
AppearanceAndFiltering.matches)
end)
Popover.initialize(self, parent, UI)
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.DURATION -> table
--- Constant
--- A lookup table of the duration values.
AppearanceAndFiltering.DURATION = {
["All"] = 0,
["30min"] = 1,
["10min"] = 2,
["5min"] = 3,
["2min"] = 4,
["1min"] = 5,
["30sec"] = 6,
["10sec"] = 7,
["5sec"] = 8,
["2sec"] = 9,
["1sec"] = 10,
["1/2sec"] = 11,
}
-- Local wrapper for `isWindowAnimationEnabled`.
function AppearanceAndFiltering.lazy.prop:_windowAnimation()
return self:app().isWindowAnimationEnabled
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering:show() -> self
--- Method
--- Shows the "Clip Appearance & Filtering Menu" Popover
---
--- Parameters:
--- * None
---
--- Returns:
--- * Self
function AppearanceAndFiltering:show()
if not self:isShowing() then
local originalAnimation = self._windowAnimation:get()
self._windowAnimation:set(false)
self.button:press()
self._windowAnimation:set(originalAnimation)
end
return self
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering:doShow() -> cp.rx.go.Statement
--- Method
--- A `Statement` that shows the Browser's "Clip Appearance & Filtering" popover.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The `Statement`.
function AppearanceAndFiltering.lazy.method:doShow()
return If(self.isShowing):Is(false)
:Then(
SetProp(self._windowAnimation):To(false)
:Then(self.button:doPress())
:Then(WaitUntil(self.isShowing))
:ThenReset()
)
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.button <cp.ui.Button>
--- Field
--- The "Clip Appearance & Filtering Menu" button.
function AppearanceAndFiltering.lazy.value:button()
local parent = self:parent()
return Button(parent, parent.UI:mutate(function(original)
return childFromRight(childrenWithRole(original(), "AXButton"), 2)
end))
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.clipHeight <cp.ui.Slider>
--- Field
--- The Clip Height Slider.
function AppearanceAndFiltering.lazy.value:clipHeight()
return Slider(self, self.UI:mutate(function(original)
return childFromTop(childrenWithRole(original(), "AXSlider"), 2)
end))
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.duration <cp.ui.Slider>
--- Field
--- The Duration Slider.
function AppearanceAndFiltering.lazy.value:duration()
return Slider(self, self.UI:mutate(function(original)
return childFromTop(childrenWithRole(original(), "AXSlider"), 3)
end))
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.groupBy <cp.ui.PopUpButton>
--- Field
--- The "Group By" popup button.
function AppearanceAndFiltering.lazy.value:groupBy()
return PopUpButton(self, self.UI:mutate(function(original)
return childFromTop(childrenWithRole(original(), "AXPopUpButton"), 1)
end))
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.sortBy <cp.ui.PopUpButton>
--- Field
--- The "Sort By" popup button.
function AppearanceAndFiltering.lazy.value:sortBy()
return PopUpButton(self, self.UI:mutate(function(original)
return childFromTop(childrenWithRole(original(), "AXPopUpButton"), 2)
end))
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.waveforms <cp.ui.CheckBox>
--- Field
--- The Waveforms checkbox.
function AppearanceAndFiltering.lazy.value:waveforms()
return CheckBox(self, self.UI:mutate(function(original)
return childFromTop(childrenWithRole(original(), "AXCheckBox"), 1)
end))
end
--- cp.apple.finalcutpro.browser.AppearanceAndFiltering.continuousPlayback <cp.ui.CheckBox>
--- Field
--- The Continuous Playback checkbox.
function AppearanceAndFiltering.lazy.value:continuousPlayback()
return CheckBox(self, self.UI:mutate(function(original)
return childFromTop(childrenWithRole(original(), "AXCheckBox"), 2)
end))
end
return AppearanceAndFiltering |
local PANEL = {}
local MODEL_ANGLE = Angle(0, 45, 0)
function PANEL:Init()
self.brightness = 1
self:SetCursor("none")
self.OldSetModel = self.SetModel
self.SetModel = function(self, model)
self:OldSetModel(model)
local entity = self.Entity
if (IsValid(entity)) then
local sequence = entity:SelectWeightedSequence(ACT_IDLE)
if (sequence <= 0) then
sequence = entity:LookupSequence("idle_unarmed")
end
if (sequence > 0) then
entity:ResetSequence(sequence)
else
local found = false
for k, v in ipairs(entity:GetSequenceList()) do
if ((v:lower():find("idle") or v:lower():find("fly")) and v ~= "idlenoise") then
entity:ResetSequence(v)
found = true
break
end
end
if (!found) then
entity:ResetSequence(4)
end
end
entity:SetIK(false)
end
end
end
function PANEL:LayoutEntity()
local scrW, scrH = ScrW(), ScrH()
local xRatio = gui.MouseX() / scrW
local yRatio = gui.MouseY() / scrH
local x, y = self:LocalToScreen(self:GetWide() / 2)
local xRatio2 = x / scrW
local entity = self.Entity
entity:SetPoseParameter("head_pitch", yRatio*90 - 30)
entity:SetPoseParameter("head_yaw", (xRatio - xRatio2)*90 - 5)
entity:SetAngles(MODEL_ANGLE)
entity:SetIK(false)
if (self.copyLocalSequence) then
entity:SetSequence(LocalPlayer():GetSequence())
entity:SetPoseParameter("move_yaw", 360 * LocalPlayer():GetPoseParameter("move_yaw") - 180)
end
self:RunAnimation()
end
function PANEL:PreDrawModel(entity)
if (self.brightness) then
local brightness = self.brightness * 0.4
local brightness2 = self.brightness * 1.5
render.SetModelLighting(0, brightness2, brightness2, brightness2)
for i = 1, 4 do
render.SetModelLighting(i, brightness, brightness, brightness)
end
local fraction = (brightness / 1) * 0.1
render.SetModelLighting(5, fraction, fraction, fraction)
end
-- Excecute Some stuffs
if (self.enableHook) then
hook.Run("DrawNutModelView", self, entity)
end
return true
end
function PANEL:OnMousePressed()
end
function PANEL:fitFOV()
local entity = self:GetEntity()
if (not IsValid(entity)) then return end
local mins, maxs = entity:GetRenderBounds()
local height = math.abs(maxs.z) + math.abs(mins.z) + 8
local distance = self:GetCamPos():Length()
self:SetFOV(math.deg(2 * math.atan(height / (2 * distance))))
end
vgui.Register("nutModelPanel", PANEL, "DModelPanel")
|
--MCmobs v0.2
--maikerumine
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### AGENT
--###################
mobs:register_mob("mobs_mc:63agent", {
type = "animal",
passive = true,
runaway = true,
stepheight = 1.2,
hp_min = 30,
hp_max = 60,
armor = 150,
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
rotate = -180,
visual = "mesh",
mesh = "agent.b3d",
textures = {
{"agent.png"},
},
visual_size = {x=3, y=3},
walk_velocity = 0.6,
run_velocity = 2,
jump = true,
animation = {
speed_normal = 25, speed_run = 50,
stand_start = 20, stand_end = 60,
walk_start = 0, walk_end = 20,
run_start = 0, run_end = 20,
},
})
mobs:register_egg("mobs_mc:63agent", "Agent", "agent_inv.png", 0)
mobs:register_mob("mobs_mc:villager", {
type = "npc",
hp_min = 35,
hp_max = 75,
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.95, 0.4},
textures = {
{"mobs_farmer.png"}
},
visual = "mesh",
mesh = "mobs_villager.x",
makes_footstep_sound = true,
damage = 2,
walk_velocity = 1.2,
run_velocity = 2.4,
damage = 1,
group_attack = true,
attack_type = "dogfight",
drops = {
{name = "default:apple",
chance = 10,
min = 1,
max = 2,},
},
armor = 90,
sounds = {
random = "Villager1",
death = "Villagerdead",
damage = "Villagerhurt1",
},
animation = {
speed_normal = 30,
speed_run = 60,
stand_start = 0,
stand_end = 23,
walk_start = 24,
walk_end = 49,
run_start = 24,
run_end = 49,
hurt_start = 85,
hurt_end = 115,
death_start = 117,
death_end = 145,
shoot_start = 50,
shoot_end = 82,
},
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 0,
view_range = 16,
fear_height = 5,
--[[
on_rightclick = function(self, clicker)
local inv
inv = minetest.get_inventory({type="detached", name="trading_inv"})
if not inv then
inv = minetest.create_detached_inventory("trading_inv", {
allow_take = function(inv, listname, index, stack, player)
if listname == "output" then
inv:remove_item("input", inv:get_stack("wanted", 1))
minetest.sound_play("Villageraccept", {to_player = player:get_player_name()})
end
if listname == "input" or listname == "output" then
--return 1000
return 0
else
return 0
end
end,
allow_put = function(inv, listname, index, stack, player)
if listname == "input" then
return 1000
else
return 0
end
end,
on_put = function(inv, listname, index, stack, player)
if inv:contains_item("input", inv:get_stack("wanted", 1)) then
inv:set_stack("output", 1, inv:get_stack("offered", 1))
minetest.sound_play("Villageraccept", {to_player = player:get_player_name()})
else
inv:set_stack("output", 1, ItemStack(""))
minetest.sound_play("Villagerdeny", {to_player = player:get_player_name()})
end
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
if inv:contains_item("input", inv:get_stack("wanted", 1)) then
inv:set_stack("output", 1, inv:get_stack("offered", 1))
minetest.sound_play("Villageraccept", {to_player = player:get_player_name()})
else
inv:set_stack("output", 1, ItemStack(""))
minetest.sound_play("Villagerdeny", {to_player = player:get_player_name()})
end
end,
on_take = function(inv, listname, index, stack, player)
if inv:contains_item("input", inv:get_stack("wanted", 1)) then
inv:set_stack("output", 1, inv:get_stack("offered", 1))
minetest.sound_play("Villageraccept", {to_player = player:get_player_name()})
else
inv:set_stack("output", 1, ItemStack(""))
minetest.sound_play("Villagerdeny", {to_player = player:get_player_name()})
end
end,
})
end
inv:set_size("input", 1)
inv:set_size("output", 1)
inv:set_size("wanted", 1)
inv:set_size("offered", 1)
local trades = {
{"default:apple 12", "default:clay_lump 1"},
{"default:coal_lump 20", "default:clay_lump 1"},
{"default:paper 30", "default:clay_lump 1"},
{"mobs:leather 10", "default:clay_lump 1"},
{"default:book 2", "default:clay_lump 1"},
{"default:clay_lump 3", "default:clay_lump 1"},
{"farming:potato 15", "default:clay_lump 1"},
{"farming:wheat 20", "default:clay_lump 1"},
{"farming:carrot 15", "default:clay_lump 1"},
{"farming:melon_8 8", "default:clay_lump 1"},
{"mobs:rotten_flesh 40", "default:clay_lump 1"},
{"default:gold_ingot 10", "default:clay_lump 1"},
{"farming:cotton 10", "default:clay_lump 1"},
{"wool:white 15", "default:clay_lump 1"},
{"farming:pumpkin 8", "default:clay_lump 1"},
{"default:clay_lump 1", "mobs:beef_cooked 5"},
{"default:clay_lump 1", "mobs:chicken_cooked 7"},
{"default:clay_lump 1", "farming:cookie 6"},
{"default:clay_lump 1", "farming:pumpkin_bread 3"},
{"default:clay_lump 1", "mobs:arrow 10"},
{"default:clay_lump 3", "mobs:bow_wood 1"},
{"default:clay_lump 8", "fishing:pole_wood 1"},
--{"default:clay_lump 4", "potionspack:healthii 1"},
{"default:clay_lump 1", "cake:cake 1"},
{"default:clay_lump 10", "mobs:saddle 1"},
{"default:clay_lump 10", "clock:1 1"},
{"default:clay_lumpd 10", "compass:0 1"},
{"default:clay_lump 1", "default:glass 5"},
{"default:clay_lump 1", "nether:glowstone 3"},
{"default:clay_lump 3", "mobs:shears 1"},
{"default:clay_lump 10", "default:sword_diamond 1"},
{"default:clay_lump 20", "3d_armor:chestplate_diamond 1"},
}
local tradenum = math.random(#trades)
inv:set_stack("wanted", 1, ItemStack(trades[tradenum][1]))
inv:set_stack("offered", 1, ItemStack(trades[tradenum][2]))
local formspec =
"size[9,8.75]"..
"background[-0.19,-0.25;9.41,9.49;trading_formspec_bg.png]"..
"bgcolor[#080808BB;true]"..
"listcolors[#9990;#FFF7;#FFF0;#160816;#D4D2FF]"..
"list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]"
.."list[detached:trading_inv;wanted;2,1;1,1;]"
.."list[detached:trading_inv;offered;5.75,1;1,1;]"
.."list[detached:trading_inv;input;2,2.5;1,1;]"
.."list[detached:trading_inv;output;5.75,2.5;1,1;]"
minetest.sound_play("Villagertrade", {to_player = clicker:get_player_name()})
minetest.show_formspec(clicker:get_player_name(), "tradespec", formspec)
end,
]]
})
--mobs:register_spawn("mobs_mc:villager", {"default:gravel"}, 20, 8, 50, 8, 31000)
mobs:register_spawn("mobs_mc:villager", {"mg_villages:road"}, 20, 8, 500, 2, 31000)
-- compatibility
mobs:alias_mob("mobs:villager", "mobs_mc:villager")
-- spawn eggs
mobs:register_egg("mobs_mc:villager", "Villager", "spawn_egg_villager.png")
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC mobs loaded")
end |
module(..., package.seeall)
function apply(env, options)
-- load the generic GCC toolset first
tundra.unitgen.load_toolset("gcc", env)
env:set_many {
["NATIVE_SUFFIXES"] = { ".c", ".cpp", ".cc", ".cxx", ".m", ".mm", ".a", ".o" },
["CXXEXTS"] = { "cpp", "cxx", "cc", "mm" },
["FRAMEWORKS"] = "",
["FRAMEWORKPATH"] = {},
["SHLIBPREFIX"] = "lib",
["SHLIBOPTS"] = "-shared",
["_OS_CCOPTS"] = "$(FRAMEWORKPATH:p-F)",
["_OS_CXXOPTS"] = "$(FRAMEWORKPATH:p-F)",
["SHLIBCOM"] = "$(LD) $(SHLIBOPTS) $(LIBPATH:p-L) $(LIBS:p-l) $(FRAMEWORKPATH:p-F) $(FRAMEWORKS:p-framework ) -o $(@) $(<)",
["PROGCOM"] = "$(LD) $(PROGOPTS) $(LIBPATH:p-L) $(LIBS:p-l) $(FRAMEWORKPATH:p-F) $(FRAMEWORKS:p-framework ) -o $(@) $(<)",
["OBJCCOM"] = "$(CCCOM)", -- objc uses same commandline
["NIBCC"] = "ibtool --output-format binary1 --compile $(@) $(<)",
}
end
|
return (function(self, event)
return api.UnregisterEvent(self, event)
end)(...)
|
function RegisterHooks()
cPluginManager:AddHook(cPluginManager.HOOK_TICK, OnTick)
cPluginManager:AddHook(cPluginManager.HOOK_KILLING, OnKilling)
cPluginManager:AddHook(cPluginManager.HOOK_TAKE_DAMAGE, OnTakeDamage)
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_DESTROYED, OnPlayerDestroyed)
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_USING_BLOCK, OnPlayerUsingBlock)
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_LEFT_CLICK, OnPlayerLeftClick)
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_PLACING_BLOCK, OnPlayerPlacingBlock)
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_USING_ITEM, OnPlayerPlacingBlock)
cPluginManager:AddHook(cPluginManager.HOOK_SPAWNING_MONSTER, OnSpawningMonster)
cPluginManager:AddHook(cPluginManager.HOOK_EXECUTE_COMMAND, OnExecuteCommand)
end
function OnTick(a_TimeDelta)
ForEachArena(
function(a_ArenaState)
a_ArenaState:Tick()
end
)
end
function OnKilling(a_Victim, a_Killer)
if (not a_Victim:IsPlayer()) then
return false
end
local Player = tolua.cast(a_Victim, "cPlayer")
local PlayerState = GetPlayerState(Player:GetName())
if (not PlayerState:DidJoinArena()) then
return false
end
local InvContent = cItems()
Player:GetInventory():CopyToItems(InvContent)
Player:GetWorld():SpawnItemPickups(InvContent, Player:GetPosX(), Player:GetPosY(), Player:GetPosZ(), 2)
local ArenaState = GetArenaState(PlayerState:GetJoinedArena())
ArenaState:RemovePlayer(Player)
PlayerState:LeaveArena()
Player:SetHealth(20)
return true
end
function OnTakeDamage(a_Receiver, a_TDI)
if (not a_Receiver:IsPlayer()) then
return false
end
local Player = tolua.cast(a_Receiver, "cPlayer")
local PlayerState = GetPlayerState(Player:GetName())
if (not PlayerState:DidJoinArena()) then
return false
end
local ArenaState = GetArenaState(PlayerState:GetJoinedArena())
if (ArenaState:GetNoDamageTime() == 0) then
return false
end
return true
end
function OnPlayerUsingBlock(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, a_BlockType, a_BlockMeta)
if (a_BlockType ~= E_BLOCK_CHEST) then
return false
end
local PlayerState = GetPlayerState(a_Player:GetName())
if (not PlayerState:DidJoinArena()) then
return false
end
local ArenaState = GetArenaState(PlayerState:GetJoinedArena())
if (ArenaState:GetCountDownTime() == 0) then
return false
end
return true
end
function OnPlayerDestroyed(a_Player)
local PlayerState = GetPlayerState(a_Player:GetName())
if (not PlayerState:DidJoinArena()) then
return false
end
local ArenaState = GetArenaState(PlayerState:GetJoinedArena())
if (not ArenaState) then
return false
end
PlayerState:LeaveArena()
ArenaState:RemovePlayer(a_Player)
end
function OnPlayerLeftClick(a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_Action)
if ((a_Action ~= 0) and (a_Action ~= 1) and (a_Action ~= 2)) then
return false
end
local PlayerState = GetPlayerState(a_Player:GetName())
if (not PlayerState:DidJoinArena()) then
return false
end
local Succes, BlockType, BlockMeta = a_Player:GetWorld():GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ)
if ((BlockType ~= E_BLOCK_LEAVES) and (BlockType ~= E_BLOCK_TALL_GRASS)) then
return true
end
local ArenaState = GetArenaState(PlayerState:GetJoinedArena())
ArenaState:AddDestroyedBlock(Vector3i(a_BlockX, a_BlockY, a_BlockZ), BlockType, BlockMeta)
end
function OnPlayerPlacingBlock(a_Player, a_BlockX, a_BlockY, a_BlockZ)
local PlayerState = GetPlayerState(a_Player:GetName())
if (not PlayerState:DidJoinArena()) then
return false
end
return true
end
function OnSpawningMonster(a_World, a_Monster)
local Position = a_Monster:GetPosition()
local IsInsideArena = false
ForEachArena(
function(a_ArenaState)
if (a_ArenaState:IsInside(Position)) then
IsInsideArena = true
return true
end
end
)
if (not IsInsideArena) then
return false
end
local MonsterFamily = a_Monster:GetMobFamily()
if (MonsterFamily == cMonster.mfHostile) then
if (Config.PreventMonsterSpawn) then
return true
end
elseif (MonsterFamily == cMonster.mfPassive) then
if (Config.PreventAnimalSpawn) then
return true
end
end
end
function OnExecuteCommand(a_Player, a_CommandSplit)
if (not a_Player) then
return false
end
local PlayerState = GetPlayerState(a_Player:GetName())
if (not PlayerState:DidJoinArena()) then
return false
end
if (a_CommandSplit[1] ~= "/hg") then
a_Player:SendMessage(cChatColor.Rose .. "You can't use commands if you joined an HungerGames arena.")
a_Player:SendMessage(cChatColor.Rose .. "Use \"/hg leave\" first.")
return true
end
end |
require("config")
--Changes
require("prototypes.changes")
--Dust
require("prototypes.copper-dust")
require("prototypes.iron-dust")
--Masher
require("prototypes.masher")
require("prototypes.masher-2")
--Furnace
require("prototypes.coal-furnace-3")
require("prototypes.electric-furnace-2")
--Furnace
require("prototypes.industrial-furnace")
require("prototypes.industrial-recipes")
--Recipe
require("prototypes.recipe-category")
--Tech
require("prototypes.tech")
|
-- https://github.com/w3c/web-platform-tests/blob/8c07290db5014705e7daa45e3690a54018d27bd5/dom/nodes/Element-remove.html
local gumbo = require "gumbo"
local input = [[
<!DOCTYPE html>
<meta charset=utf-8>
<title>Element.remove</title>
<link rel=help href="http://dom.spec.whatwg.org/#dom-childnode-remove">
<div id=log></div>
]]
local document = assert(gumbo.parse(input))
-- https://github.com/w3c/web-platform-tests/blob/8c07290db5014705e7daa45e3690a54018d27bd5/dom/nodes/ChildNode-remove.js
local function testRemove(node, parent)
-- Element should support remove()
assert(node.remove)
assert(type(node.remove) == "function")
-- remove() should work if element doesn't have a parent
assert(node.parentNode == nil, "Node should not have a parent")
assert(node:remove() == nil)
assert(node.parentNode == nil, "Removed new node should not have a parent")
-- remove() should work if element does have a parent
assert(node.parentNode == nil, "Node should not have a parent")
parent:appendChild(node)
assert(node.parentNode == parent, "Appended node should have a parent")
assert(node:remove() == nil)
assert(node.parentNode == nil, "Removed node should not have a parent")
assert(parent.childNodes.length == 0, "Parent should not have children")
-- remove() should work if element does have a parent and siblings
assert(node.parentNode == nil, "Node should not have a parent")
local before = parent:appendChild(document:createComment("before"))
parent:appendChild(node)
local after = parent:appendChild(document:createComment("after"))
assert(node.parentNode == parent, "Appended node should have a parent")
assert(node:remove() == nil)
assert(node.parentNode == nil, "Removed node should not have a parent")
assert(parent.childNodes.length == 2, "Parent should have two children left")
assert(parent.childNodes[1] == before)
assert(parent.childNodes[2] == after)
end
local node = assert(document:createElement("div"))
local parentNode = assert(document:createElement("div"))
testRemove(node, parentNode, "element")
|
match_null_layout=
{
name="match_null_layout",type=0,typeName="View",time=0,x=0,y=0,width=0,height=0,visible=1,nodeAlign=kAlignTopLeft,fillParentWidth=1,fillParentHeight=1
}
return match_null_layout; |
-- Pattern Awards
-- Pattern Novice
awards.register_achievement("tinker_pattern_novice", {
title = tinkers_testers.S("Pattern Novice"),
description = tinkers_testers.S("Craft 32 blank patterns")
trigger = {
type = "craft",
item = "tinkers_testers:blank_pattern",
target = 32
}
})
-- Pattern Adept
awards.register_achievement("tinker_pattern_adept", {
title = tinkers_testers.S("Pattern Adept"),
description = tinkers_testers.S("Craft 64 blank patterns")
trigger = {
type = "craft",
item = "tinkers_testers:blank_pattern",
target = 64
}
})
-- Pattern Master
awards.register_achievement("tinker_pattern_master", {
title = tinkers_testers.S("Pattern Master"),
description = tinkers_testers.S("Craft 128 blank patterns")
trigger = {
type = "craft",
item = "tinkers_testers:blank_pattern",
target = 128
}
})
|
--[[
TheNexusAvenger
Implementation of a command.
--]]
local BaseCommand = require(script.Parent.Parent:WaitForChild("BaseCommand"))
local Command = BaseCommand:Extend()
--[[
Creates the command.
--]]
function Command:__new()
self:InitializeSuper("change","BasicCommands","Changes the stat of a set of players.")
self.Arguments = {
{
Type = "nexusAdminPlayers",
Name = "Players",
Description = "Players to reset the stats for.",
},
{
Type = "strings",
Name = "Stats",
Description = "Stats to change.",
},
{
Type = "string",
Name = "Value",
Description = "Value to change to.",
},
}
end
--[[
Runs the command.
--]]
function Command:Run(CommandContext,Players,Stats,Value)
self.super:Run(CommandContext)
--Reset the stats.
for _,Player in pairs(Players) do
local leaderstats = Player:FindFirstChild("leaderstats")
if leaderstats then
for _,Stat in pairs(leaderstats:GetChildren()) do
for _,StatName in pairs(Stats) do
StatName = string.lower(StatName)
if string.sub(string.lower(Stat.Name),1,string.len(StatName)) == StatName then
if type(Stat.Value) == "string" then
Stat.Value = Value
elseif type(Stat.Value) == "number" then
Stat.Value = tonumber(Value) or Stat.Value
else
self:SendError(Player,"Unable to assign value to stat.")
end
end
end
end
end
end
end
return Command |
return {'ketamine','ketchup','ketel','ketelaar','ketelbikker','ketelbink','ketelbinkie','ketelboeter','ketelbouw','ketelbouwer','keteldal','ketelhuis','ketelinstallatie','ketelkoek','ketellapper','ketelmuziek','ketelruim','ketelsteen','keteltrom','keten','ketenaansprakelijkheid','ketenbeheer','ketenbeheersing','ketenbewaking','ketendicht','ketenen','ketengebergte','ketenkaart','ketenvorming','ketjap','ketje','ketoembar','kets','ketsen','ketter','ketteren','kettergericht','ketterij','ketterjacht','ketterjager','ketters','kettervervolging','ketting','kettingbak','kettingbakken','kettingbeding','kettingbotsing','kettingbreuk','kettingbreukontwikkeling','kettingbrief','kettingbrug','kettingdraad','kettingformulier','kettingganger','kettinggaren','kettinghandel','kettinghond','kettingkast','kettingkogel','kettingloos','kettingmechanisme','kettingmolen','kettingpapier','kettingrad','kettingreactie','kettingregel','kettingrijm','kettingroken','kettingroker','kettingrookster','kettingslot','kettingspanner','kettingsteek','kettingstopper','kettingzaag','kettingzijde','kettingzin','kettingzinnen','ketelpak','ketentest','ketenzorg','ketensamenwerking','ketenintegratie','ketenmanagement','ketenaanpak','ketenbenadering','ketenhandhaving','ketenorganisatie','ketenproject','kettingmail','ketenlengte','ketenmobiliteit','ketenregie','ketenregisseur','ketenverantwoordelijkheid','ketendenken','keteninformatisering','ketenomkering','ketenproces','ketenverband','kettinglijn','kettingschijf','ket','ket','ketelaar','kettenis','ketwaru','ketelaars','ketelbikkers','ketelboeters','keteldalen','ketelhuizen','ketelkoeken','ketellappers','ketelruimen','ketels','keteltje','keteltjes','keteltrommels','keteltrommen','ketende','ketenden','ketens','ketent','ketentje','ketentjes','ketjes','ketst','ketste','ketsten','ketterde','ketterijen','ketterjagers','ketterplakkaten','ketterse','kettert','kettervervolgingen','kettingbotsingen','kettingbreuken','kettingbrieven','kettingbruggen','kettingdraden','kettingen','kettingformulieren','kettinggangers','kettinghonden','kettingkasten','kettingkogels','kettinglabels','kettingloze','kettingreacties','kettingrokers','kettingrooksters','kettingspanners','kettingsteken','kettingstoppers','kettinkje','kettinkjes','ketelbinken','kettingbedingen','kettingrijmen','kettingzagen','kettingraderen','ketelpakken','kettingsloten','ketentesten','kettingmails','ketenprojecten','ketenprocessen','kettinglijnen','ketenorganisaties','kettinggarens'} |
describe('defaultIfEmpty', function()
it('errors if the source errors', function()
expect(Rx.Observable.throw():defaultIfEmpty(1).subscribe).to.fail()
end)
it('produces the values from the source unchanged if at least one value is produced', function()
expect(Rx.Observable.fromRange(3):defaultIfEmpty(7)).to.produce(1, 2, 3)
end)
it('produces the values specified if the source produces no values', function()
expect(Rx.Observable.empty():defaultIfEmpty(7, 8)).to.produce({{7, 8}})
end)
it('does not freak out if no values are specified', function()
expect(Rx.Observable.empty():defaultIfEmpty()).to.produce({{}})
end)
end)
|
local util = require "util"
local values = function(dict)
local gen, state, k, v = pairs(dict)
return function()
k, v = gen(state, k, v)
if v ~= nil then
return v
end
end
end
local dap = util.try_require "dap"
local dapui = util.try_require "dapui"
if dap and dapui then
dap.set_log_level "DEBUG"
local setups = {
python = function()
local dap_python = require "dap-python"
dap_python.setup("/usr/bin/python", { include_configs = false })
dap_python.test_runner = "pytest"
dap.configurations.python = dap.configurations.python or {}
table.insert(dap.configurations.python, {
type = "python",
request = "launch",
name = "Launch file",
justMyCode = false,
program = "${file}",
console = "internalConsole",
})
table.insert(dap.configurations.python, {
type = "python",
request = "attach",
name = "Attach remote",
justMyCode = false,
host = function()
local value = vim.fn.input "Host [127.0.0.1]: "
if value ~= "" then
return value
end
return "127.0.0.1"
end,
port = function()
return tonumber(vim.fn.input "Port [5678]: ") or 5678
end,
})
end,
}
dapui.setup()
for setup in values(setups) do
setup()
end
local _config = {
mappings = {
{ "<F5>", "<cmd>lua require('dap').continue()<cr>" },
{ "<F8>", "<cmd>lua require'dap'.step_out()<cr>" },
{ "<F9>", "<cmd>lua require'dap'.step_back()<cr>" },
{ "<F10>", "<cmd>lua require'dap'.step_into()<cr>" },
{ "<F11>", "<cmd>lua require'dap'.step_over()<cr>" },
{ "<leader>dv", "<cmd>lua require('dapui').toggle()<cr>" },
{ "<leader>db", "<cmd>lua require('dap').toggle_breakpoint()<cr>" },
{ "<leader>dc", "<cmd>lua require('dap').continue()<cr>" },
{ "<leader>de", "<cmd>lua require('dap.ui.widgets').hover()<cr>" },
},
sidebar = {
winopts = { width = 100 },
},
}
if _config.mappings then
util.setkeys("n", _config.mappings)
end
end
|
function decompresscolors(meshlist)
for meshindex = 1, #meshlist do
local mesh = meshlist[meshindex]
if mesh.colors~=nil then
local colors = mesh.colors
mesh.colors = {}
for color, group in pairs(colors) do
for groupitemindex = 1, #group do
local groupitem = group[groupitemindex]
if type(groupitem)=="table" then
for i = groupitem[1], groupitem[2] do
mesh.colors[i+1] = color
end
elseif type(groupitem)=="number" then
mesh.colors[groupitem+1] = color
end
end
end
meshlist[meshindex] = mesh
end
end
return meshlist
end
return decompresscolors |
--[[
credits:
factorio devs
--]]
--[[
Measurement results:
0.18.3, 2020-2-4, dimensions = 256, 4225 entities, no research, 6.4ms script update time.
0.18.3, 2020-2-4, dimensions = 256, 4225 entities, all research, 6.2ms script update time.
0.18.3, 2020-2-4, dimensions = 128, 1089 entities, no research, 2.1ms script update time.
0.18.3, 2020-2-4, dimensions = 128, 1089 entities, all research, 1.9ms script update time.
0.18.3, 2020-2-5, dimensions = 128, 1089 entities, no research, 1.0ms script update time.
0.18.3, 2020-2-5, dimensions = 128, 1089 entities, all research, 0.9ms script update time.
0.18.3, 2020-2-5, dimensions = 32, 81 entities, no research, 0.11ms script update time.
0.18.3, 2020-2-5, dimensions = 32, 81 entities, all research, 0.10ms script update time.
0.18.3, 2020-2-5, dimensions = 512, 16641 entities, no research, 3.6 - 6ms script update time.
--]]
local function init_globals()
global.version = "0.1.1"
end
script.on_init(function()
init_globals()
end)
local function updateModVersion()
end
script.on_configuration_changed(function()
updateModVersion()
end)
script.on_event(defines.events.on_tick, function(event)
local enabled = false
if event.tick == 0 and enabled then
local force="player"
if false then game.forces[force].research_all_technologies() end
game.surfaces["nauvis"].create_entity{name="electric-energy-interface", position = {0,0}, force=force}
local dimensions = 128
local entityCount = 0
for x = -dimensions,dimensions,8 do
for y = -dimensions,dimensions,8 do
if not (x==0 and y==0) then
local newRoboport = game.surfaces["nauvis"].create_entity{name="roboport", position = {x+0,y+0}, force=force}
newRoboport.insert({name="construction-robot", count=10})
end
game.surfaces["nauvis"].create_entity{name="substation", position = {x+3,y+0}, force=force}
game.surfaces["nauvis"].create_entity{name="centrifuge", position = {x,y+3}, force=force, raise_built=true, recipe="uranium-processing"}
entityCount = entityCount + 1
game.surfaces["nauvis"].create_entity{name="stack-inserter", position = {x+2,y+3}, force=force, direction=defines.direction.east}
game.surfaces["nauvis"].create_entity{name="stack-inserter", position = {x+2,y+4}, force=force, direction=defines.direction.west}
local chestA = game.surfaces["nauvis"].create_entity{name="infinity-chest", position = {x+3,y+3}, force=force}
chestA.set_infinity_container_filter(1, {name = "uranium-ore", count = 50})
local chestB = game.surfaces["nauvis"].create_entity{name="infinity-chest", position = {x+3,y+4}, force=force}
--currently no way to enable the setting to clear the chest automatically
end
end
game.print("entity count: " .. entityCount)
end
end)
|
PauseState = Class{__includes = BaseState}
function PauseState:render()
love.graphics.setFont(flappyFont)
love.graphics.printf('PAUSED', 0, 64, VWIDTH, 'center')
love.graphics.setFont(mediumFont)
love.graphics.printf('Press P to unpause. ', 0, 160, VWIDTH, 'center')
end |
local function setModuleSlots(name)
for _,m in pairs(data.raw[name]) do
if m.module_specification == nil then
m.module_specification =
{
module_slots = 1
}
m.allowed_effects = {"consumption", "speed", "productivity", "pollution"}
end
end
end
setModuleSlots("assembling-machine")
setModuleSlots("furnace") |
return Def.ActorFrame {
LoadActor("arrow") .. {
InitCommand = function(self)
self
:y(8)
:shadowlengthx(0)
:shadowlengthy(2)
end
},
Def.BitmapText {
Font = "Common Normal",
InitCommand = function(self)
self
:y(-8)
:settext("Barely")
:shadowlengthx(0)
:shadowlengthy(2)
:strokecolor(color("#00000077"))
end
}
}
|
Digraph = Core.class()
function Digraph:init(nNodes)
self.nNodes = nNodes
self.nodes = {}
self.edges = {}
for i=1, nNodes do
self.nodes[i] = Node.new(i)
end
end
function Digraph:addEdge(node1, node2)
local newEdge = Edge.new(node1, node2)
table.insert(self.edges, newEdge)
node1:addEdge(newEdge)
node2:addEdge(newEdge)
end
function Digraph:fillEdges(transitions)
for index, d in ipairs(transitions) do
self:addEdge(self.nodes[d[1]], self.nodes[d[3]])
self.edges[#self.edges]:addProperty({d[2], d[4], d[5]})
end
end
function Digraph:debugGraph()
table.foreach(self.nodes, function(k,v) print("Node " .. k) end)
table.foreach(self.edges, function(k,v)
print("Edge " .. k ..
" States: " .. v.node1.number .. " to " .. v.node2.number,
"Reads " .. v.property[1] .. " Writes " .. v.property[2] .. " Goes " .. v.property[3])
end)
end |
local me = ...
local M = { }
local name1 = "module"
local name2 = "import"
local TK = require("PackageToolkit")
local m = TK[name1][name2](me, "m/../m/./m2")
M.run = function(msg)
if msg == nil then
msg = ""
end
print(TK.ui.dashed_line(80, '-'))
print(string.format("test %s.%s()", name1, name2))
print(msg)
local result = m.hello()
local solution = "hello from m1"
print("Result: ", result)
assert(result == solution)
print("VERIFIED!")
return print(TK.ui.dashed_line(80, '-'))
end
return M
|
-- -*- Mode: Lua; -*-
--
-- rpl-appl-test.lua
--
-- © Copyright IBM Corporation 2017.
-- LICENSE: MIT License (https://opensource.org/licenses/mit-license.html)
-- AUTHOR: Jamie A. Jennings
assert(TEST_HOME, "TEST_HOME is not set")
list = import "list"
violation = import "violation"
check = test.check
heading = test.heading
subheading = test.subheading
e = false;
global_rplx = false;
function set_expression(exp)
global_rplx = e:compile(exp)
end
function check_match(exp, input, expectation, expected_leftover, expected_text, addlevel)
expected_leftover = expected_leftover or 0
addlevel = addlevel or 0
set_expression(exp)
local m, leftover = global_rplx:match(input)
check(expectation == (not (not m)), "expectation not met: " .. exp .. " " ..
((m and "matched") or "did NOT match") .. " '" .. input .. "'", 1+addlevel)
local fmt = "expected leftover matching %s against '%s' was %d but received %d"
if m then
check(leftover==expected_leftover,
string.format(fmt, exp, input, expected_leftover, leftover), 1+addlevel)
if expected_text and m then
local name, pos, text, subs = common.decode_match(m)
local fmt = "expected text matching %s against '%s' was '%s' but received '%s'"
check(expected_text==text,
string.format(fmt, exp, input, expected_text, text), 1+addlevel)
end
end
return m, leftover
end
test.start(test.current_filename())
----------------------------------------------------------------------------------------
heading("Setting up")
----------------------------------------------------------------------------------------
check(type(rosie)=="table")
e = rosie.engine.new("rpl appl test")
check(rosie.engine.is(e))
subheading("Setting up assignments")
success, pkg, msg = e:load('a = "a" b = "b" c = "c" d = "d"')
check(type(success)=="boolean")
check(pkg==nil)
check(type(msg)=="table")
t = e.env:lookup("a")
check(type(t)=="table")
----------------------------------------------------------------------------------------
heading("Testing application of primitive macros")
----------------------------------------------------------------------------------------
--[[
heading("Example macros")
subheading("First")
p, msg = e:compile('first:a')
check(p)
if not p then print("*** compile failed: "); table.print(msg); end
ok, m, leftover = e:match(p, "a")
check(ok)
check(type(m)=="table")
check(type(leftover)=="number" and leftover==0)
check(m.type=="a")
p = e:compile('first:(a, b)') -- 2 args
ok, m, leftover = e:match(p, "a")
check(ok)
check(type(m)=="table")
check(type(leftover)=="number" and leftover==0)
check(m.type=="a")
p = e:compile('first:(a b, b b)') -- 2 args
ok, m, leftover = e:match(p, "a b")
check(ok)
check(m and m.type=="*")
check(type(leftover)=="number" and leftover==0)
ok, m, leftover = e:match(p, "b b")
check(ok)
check(not m)
p = e:compile('first:{a b, b b}') -- 2 args
ok, m, leftover = e:match(p, "a b")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "ab")
check(ok)
check(m and m.type=="*")
check(type(leftover)=="number" and leftover==0)
ok, m, leftover = e:match(p, "b b")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "bb")
check(ok)
check(not m)
p = e:compile('first:(a b)') -- one arg
ok, m, leftover = e:match(p, "a")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "ab")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "a b")
check(ok)
check(m and m.type=="*")
check(leftover==0)
ok, m, leftover = e:match(p, "a bXYZ")
check(ok)
check(m and m.type=="*")
check(leftover==3)
p = e:compile('first:{a b}') -- one arg
ok, m, leftover = e:match(p, "a b")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "abX")
check(ok)
check(m and m.type=="*")
check(leftover==1)
p = e:compile('first:(a/b)') -- one arg
ok, m, leftover = e:match(p, "a b")
check(ok)
check(m and m.type=="*")
check(leftover==2)
ok, m, leftover = e:match(p, "bX")
check(ok)
check(m and m.type=="*")
check(leftover==1)
p = e:compile('first:{a/b}') -- one arg
ok, m, leftover = e:match(p, "a b")
check(ok)
check(m and m.type=="*")
check(leftover==2)
ok, m, leftover = e:match(p, "bX")
check(ok)
check(m and m.type=="*")
check(leftover==1)
p = e:compile('first:"hi"') -- one arg
ok, m, leftover = e:match(p, "a b")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "hi")
check(ok)
check(m and m.type=="*")
check(leftover==0)
subheading("Last")
p = e:compile('last:a')
ok, m, leftover = e:match(p, "a")
check(ok)
check(type(m)=="table")
check(type(leftover)=="number" and leftover==0)
check(m and m.type=="a")
p = e:compile('last:(a, b)') -- 2 args
ok, m, leftover = e:match(p, "a")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "b")
check(ok)
check(type(m)=="table")
check(type(leftover)=="number" and leftover==0)
check(m and m.type=="b")
p = e:compile('last:(a b, b b)') -- 2 args
ok, m, leftover = e:match(p, "a b")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "b b")
check(ok)
check(m and m.type=="*")
check(type(leftover)=="number" and leftover==0)
ok, m, leftover = e:match(p, "bb")
check(ok)
check(not m)
p = e:compile('last:{a b, b b}') -- 2 args
ok, m, leftover = e:match(p, "a b")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "ab")
check(ok)
check(not m)
ok, m, leftover = e:match(p, "bb")
check(ok)
check(m and m.type=="*")
check(type(leftover)=="number" and leftover==0)
ok, m, leftover = e:match(p, "b b")
check(ok)
check(not m)
--]]
----------------------------------------------------------------------------------------
heading("Find and findall")
p = e:compile('find:a')
ok, m, leftover = e:match(p, "xyzw 1 2 3 aa x x a")
check(ok)
check(m)
check(leftover==7)
check(m.type=="*")
check(m.s==1 and m.e==13)
check(m.subs and m.subs[1] and m.subs[1].s==12 and m.subs[1].e==13)
function test_findall_setup(exp)
p = e:compile(exp)
ok, m, leftover = e:match(p, "xyzw 1 2 3 aa x x a")
check(ok, "call failed", 1)
check(m, "no match", 1)
check(leftover==0, "wrong leftover count", 1)
check(m.type=="*", "wrong match label", 1)
end
function test_findall_1(exp)
test_findall_setup(exp)
check(#m.subs==3, "wrong number of submatches", 1)
check(m.s==1 and m.e==20, "wrong top-level match span", 1)
check(m.subs and m.subs[1] and m.subs[1].s==12 and m.subs[1].e==13, "wrong sub 1", 1)
check(m.subs and m.subs[2] and m.subs[2].s==13 and m.subs[2].e==14, "wrong sub 2", 1)
check(m.subs and m.subs[3] and m.subs[3].s==19 and m.subs[3].e==20, "wrong sub 3", 1)
end
function test_findall_2(exp)
test_findall_setup(exp)
check(#m.subs==2, "wrong number of submatches", 1)
check(m.s==1 and m.e==20, "wrong top-level match span", 1)
check(m.subs and m.subs[1] and m.subs[1].s==11 and m.subs[1].e==13, "wrong sub 1", 1)
check(m.subs and m.subs[2] and m.subs[2].s==18 and m.subs[2].e==20, "wrong sub 2", 1)
end
function test_findall_3(exp)
test_findall_setup(exp)
check(m.s==1 and m.e==20, "wrong top-level match span", 1)
check(m.subs and m.subs[1] and m.subs[1].s==18 and m.subs[1].e==20, "wrong sub 1", 1)
end
function test_findall_4(exp)
test_findall_setup(exp)
check(#m.subs==2, "wrong number of submatches", 1)
check(m.s==1 and m.e==20, "wrong top-level match span", 1)
check(m.subs and m.subs[1] and m.subs[1].s==13 and m.subs[1].e==15, "wrong sub 1", 1)
check(m.subs and m.subs[2] and m.subs[2].s==19 and m.subs[2].e==20, "wrong sub 2", 1)
end
function test_findall_5(exp)
test_findall_setup('findall:(a)')
check(#m.subs==1, "wrong number of submatches", 1)
check(m.subs and m.subs[1] and m.subs[1].type=="find.*", "wrong top-level match span", 1)
check(m.subs and m.subs[1] and (m.subs[1].s==18) and (m.subs[1].e==20), "wrong sub 1", 1)
end
test_findall_1('findall:a')
test_findall_1('findall:{a}')
test_findall_5('findall:(a)')
test_findall_2('findall:{~a}')
test_findall_5('findall:(~a)')
test_findall_3('findall:{~a~}')
test_findall_5('findall:(~a~)')
test_findall_4('findall:{a~}')
test_findall_5('findall:(a~)')
p = e:compile('find:("quick" ("brown" / "blue") "fox")')
check(p)
lines = io.lines("test/quick.txt")
answers = {false, true, true, true, true, false, false}
i = 1
for line in lines do
ok, m, leftover = e:match(p, line)
check(ok, "call failed", 1)
if answers[i] then
check(m, "failed to match where it should")
else
check(not m, "matched where it should have failed to match")
end
i = i + 1
end
----------------------------------------------------------------------------------------
heading("Message and halt")
subheading("Message")
function test_message(exp, input)
p, errs = e:compile(exp)
check(p, "failed to compile", 1)
if not p then
print()
print(table.concat(list.map(violation.tostring, errs), '\n'))
m = nil
else
ok, m, leftover = e:match(p, input)
check(ok, "match failed to execute", 1)
check(m and m.type=="*", "either match failed or wrong match type (at top level)", 1)
end
end
test_message('message:#Hello', "")
check(m.data=="")
check(#m.subs==1)
check(m.subs[1].type=="message" and m.subs[1].data=="Hello")
check(leftover==0)
test_message('message:#Hello', "abc")
check(m.data=="")
check(#m.subs==1)
check(m.subs[1].type=="message" and m.subs[1].data=="Hello")
check(leftover==3)
test_message('{"ab" message:#Hello}', "abc")
check(m.data=="ab")
check(#m.subs==1)
check(m.subs[1].type=="message" and m.subs[1].data=="Hello")
check(leftover==1)
test_message('"abc" message:#Hello', "abc")
check(m.data=="abc")
check(#m.subs==1)
check(m.subs[1].type=="message" and m.subs[1].data=="Hello")
check(leftover==0)
test_message('"abc" message:#Hello', "abc def")
check(m.data=="abc ")
check(#m.subs==1)
check(m.subs[1].type=="message" and m.subs[1].data=="Hello")
check(leftover==3)
test_message('"abc" message:#Hello "def"', "abc def")
check(m.data=="abc def")
check(#m.subs==1)
check(m.subs[1].type=="message" and m.subs[1].data=="Hello")
check(leftover==0)
test_message('"abc" / message:#Hello', "abc")
check(m.data=="abc")
check(m.subs==nil)
check(leftover==0)
test_message('"abc" / message:#Hello', "ab")
check(m.data=="")
check(#m.subs==1)
check(m.subs[1].type=="message" and m.subs[1].data=="Hello")
check(leftover==2)
p, errs = e:compile('(message:#Hello)')
check(p)
p, errs = e:compile('message:(#Hello)')
check(p)
p, errs = e:compile('message:{#Hello}')
check(p)
p, errs = e:compile('(message:#Hello)+')
check(not p)
msg = table.concat(list.map(violation.tostring, errs), '\n')
check(msg:find('can match the empty string'))
p, errs = e:compile('{message:#Hello}?')
check(not p)
check(type(errs)=="table")
msg = table.concat(list.map(violation.tostring, errs), '\n')
check(msg)
if msg then check(msg:find('can match the empty string')); end
subheading("Message inside brackets")
p, errs = e:compile('[[]message:#Hello]')
check(p)
if not p then print("ERRORS ARE"); table.print(errs); end
ok, m, leftover = e:match(p, "")
check(ok)
check(m)
check(m.type=="*")
check(m.subs and m.subs[1] and m.subs[1].type=="message")
test_message('[[a]message:#Hello]', "a")
check(m.data=="a")
check(m.subs==nil)
check(leftover==0)
--[[ Removed halt on Tuesday, January 16, 2018 because it's not useful by itself.
subheading("Halt")
function test_halt(exp, input)
p, errs = e:compile(exp)
check(p, "failed to compile", 1)
if not p then
print()
print(table.concat(list.map(violation.tostring, errs), '\n'))
m = nil
else
ok, m, leftover, abend = e:match(p, input)
check(ok, "match failed to execute", 1)
end
end
test_halt('halt', "")
check(m==nil)
check(abend==true)
test_halt('halt', "abc")
check(m==nil)
check(abend==true)
check(leftover==3)
test_halt('"abc" halt', "abc")
check(m)
if m then
check(m.type=="*")
check(not m.subs)
check(m.s==1)
check(m.e==4)
check(m.data=="abc")
end
check(abend==true)
check(leftover==0)
test_halt('"abc" "def" / halt', "abc")
check(m)
if m then
check(m.type=="*")
check(not m.subs)
check(m.s==1)
check(m.e==4)
check(m.data=="abc")
end
check(abend==true)
check(leftover==0)
test_halt('"abc" "def" / halt', "abc def")
check(m)
if m then
check(m.type=="*")
check(not m.subs)
check(m.s==1)
check(m.e==8)
check(m.data=="abc def")
end
check(abend==false)
check(leftover==0)
test_halt('"abc" ("def" / halt) "xyz"', "abc def xyz")
check(m)
if m then
check(m.type=="*")
check(not m.subs)
check(m.s==1)
check(m.e==12)
check(m.data=="abc def xyz")
end
check(abend==false)
check(leftover==0)
test_halt('"abc" ("def" / halt) "xyz"', "abc xyz")
check(m)
if m then
check(m.type=="*")
check(not m.subs)
check(m.s==1)
check(m.e==5)
check(m.data=="abc ")
end
check(abend==true)
check(leftover==3)
test_halt('"abc" ("def" / halt) "xyz"', "abc ZZZ")
check(m)
if m then
check(m.type=="*")
check(not m.subs)
check(m.s==1)
check(m.e==5)
check(m.data=="abc ")
end
check(abend==true)
check(leftover==3)
test_halt('"abc" ("defg" / halt) "xyz"', "abc def xyz")
check(m)
if m then
check(m.type=="*")
check(not m.subs)
check(m.s==1)
check(m.e==5)
check(m.data=="abc ")
end
check(abend==true)
check(leftover==7)
--]]
----------------------------------------------------------------------------------------
heading("Case sensitivity")
subheading("ci literals (shallow test)")
p, errs = e:compile('ci:"ibm"')
check(p)
if p then
ok, m, leftover = e:match(p, "IBM")
check(ok and m and (leftover==0))
ok, m, leftover = e:match(p, "ibm")
check(ok and m and (leftover==0))
ok, m, leftover = e:match(p, "Ibm")
check(ok and m and (leftover==0))
ok, m, leftover = e:match(p, "ibM")
check(ok and m and (leftover==0))
else
print("compile failed: ")
table.print(errs, false)
end
function test_foobar()
p = e:compile('foobar')
assert(p)
m, leftover = p:match("foo")
check(m and (leftover==0), "failed on foo", 1)
m, leftover = p:match("Foo")
check(m and (leftover==0), "failed on Foo", 1)
m, leftover = p:match("fOO")
check(m and (leftover==0), "failed on fOO", 1)
m, leftover = p:match("BAR")
check(m and (leftover==0), "failed on BAR", 1)
m, leftover = p:match("bar")
check(m and (leftover==0), "failed on bar", 1)
end
ok = e:load('foobar = ci:("foo" / "bar")')
assert(ok)
test_foobar()
ok = e:load('foobar = ci:{"foo" / "bar"}')
assert(ok)
test_foobar()
ok = e:load('grammar foobar = ci:("foo" / "bar") end')
assert(ok)
test_foobar()
ok = e:load('grammar foobar = ci:{"foo" / "bar"} end')
assert(ok)
test_foobar()
subheading("ci named character sets (shallow test)")
function check_match(exp, input)
p, errs = e:compile(exp)
check(p, "compilation failed", 1)
if p then
ok, m, leftover = e:match(p, input)
check(ok and m and (leftover==0), "match failed", 1)
else
print("compile failed: ")
table.print(errs, false)
end
end
check_match('ci:[:upper:]+', 'ABCDEF')
check_match('ci:[:upper:]+', 'abcdef')
check_match('ci:[:upper:]+', 'ABcdeF')
check_match('ci:[:lower:]+', 'ABCDEF')
check_match('ci:[:lower:]+', 'abcdef')
check_match('ci:[:lower:]+', 'ABcdeF')
check_match('ci:[:alpha:]+', 'ABCDEF')
check_match('ci:[:alpha:]+', 'abcdef')
check_match('ci:[:alpha:]+', 'ABcdeF')
check_match('ci:[:punct:]+', '-!@#$|()')
subheading("ci list character sets (shallow test)")
check_match('ci:[A]{2}', 'Aa')
check_match('ci:[a]{2}', 'Aa')
check_match('ci:[ABc]+', 'aAbBcC')
check_match('ci:[+/x]+', 'XXxX++/')
subheading("ci range character sets (shallow test)")
check_match('ci:[A-C]+', 'AaCc')
check_match('ci:[x-z]{6}', 'XYZyzx')
check_match('ci:[C-a]+', 'aAcC')
check_match('ci:[C-a]+', 'CDEcdexyzAa')
p = e:compile('ci:[C-a]+'); check(p)
ok, m, leftover = e:match(p, 'Ab')
check(ok)
check(m)
check(leftover == 1)
ok, m, leftover = e:match(p, 'B')
check(ok)
check(not m)
check_match('ci:[+-|]+', 'ABCabc+/xyzXYZ{') --}
check_match('ci:[+-C]+', '+/ABCabc')
check_match('ci:[x-|]+', 'XYZxyz{|') --}
p = e:compile('ci:[+-C]+'); check(p)
ok, m, leftover = e:match(p, 'abcD')
check(ok)
check(m)
check(leftover == 1)
ok, m, leftover = e:match(p, 'abcd')
check(ok)
check(m)
check(leftover == 1)
check_match('ci:[[CD] [Z-a]]+', 'DCcdzZAa')
p = e:compile('ci:[[CD] [Z-a]]+'); check(p)
ok, m, leftover = e:match(p, 'b')
check(ok); check(not m)
check_match('[[CD] ci:[Z-a]]+', 'DCzA')
p = e:compile('[[CD] ci:[Z-a]]+'); check(p)
ok, m, leftover = e:match(p, 'c')
check(ok); check(not m)
-- Testing the shallowness, i.e. the macro does not affect identifiers
ok = e:load('foobar = "foobar"'); check(ok)
p = e:compile('ci:foobar'); check(p)
ok, m, leftover = e:match(p, 'foobar')
check(ok); check(m); check(leftover == 0)
ok, m, leftover = e:match(p, 'Foobar')
check(ok); check(not m)
p = e:compile('ci:(foobar "Hi")'); check(p)
ok, m, leftover = e:match(p, 'foobar HI')
check(ok); check(m); check(leftover == 0)
ok, m, leftover = e:match(p, 'foobar hi')
check(ok); check(m); check(leftover == 0)
ok, m, leftover = e:match(p, 'Foobar Hi')
check(ok); check(not m)
--[[
subheading("ci (deep test)")
ok = e:load('foo = {"foo" / "bar"}')
assert(ok)
ok = e:load('foobar = ci:foo')
assert(ok)
test_foobar()
--]]
return test.finish()
|
object_tangible_loot_creature_loot_collections_meatlump_uniform_piece_04 = object_tangible_loot_creature_loot_collections_shared_meatlump_uniform_piece_04:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_meatlump_uniform_piece_04, "object/tangible/loot/creature/loot/collections/meatlump_uniform_piece_04.iff")
|
-----------------------------------
-- Area: Windurst Woods
-- NPC: Soni-Muni
-- Starts & Finishes Quest: The Amazin' Scorpio
-- !pos -17.073 1.749 -59.327 241
-----------------------------------
require("scripts/globals/npc_util")
require("scripts/globals/quests")
require("scripts/globals/titles")
-----------------------------------
function onTrade(player,npc,trade)
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.THE_AMAZIN_SCORPIO) == QUEST_ACCEPTED and npcUtil.tradeHas(trade, 1017) then
player:startEvent(484)
end
end
function onTrigger(player,npc)
local amazinScorpio = player:getQuestStatus(WINDURST,tpz.quest.id.windurst.THE_AMAZIN_SCORPIO)
local wildcatWindurst = player:getCharVar("WildcatWindurst")
if player:getQuestStatus(WINDURST,tpz.quest.id.windurst.LURE_OF_THE_WILDCAT) == QUEST_ACCEPTED and not player:getMaskBit(wildcatWindurst,0) then
player:startEvent(735)
elseif amazinScorpio == QUEST_COMPLETED then
player:startEvent(485)
elseif amazinScorpio == QUEST_ACCEPTED then
player:startEvent(482, 0, 0, 1017)
elseif amazinScorpio == QUEST_AVAILABLE and player:getFameLevel(WINDURST) >= 2 then
player:startEvent(481, 0, 0, 1017)
else
player:startEvent(421)
end
end
function onEventUpdate(player,csid,option)
end
function onEventFinish(player,csid,option)
if csid == 481 then
player:addQuest(WINDURST,tpz.quest.id.windurst.THE_AMAZIN_SCORPIO)
elseif csid == 484 and npcUtil.completeQuest(player, WINDURST, tpz.quest.id.windurst.THE_AMAZIN_SCORPIO, {fame=80, title=tpz.title.GREAT_GRAPPLER_SCORPIO, gil=1500}) then
player:confirmTrade()
elseif csid == 735 then
player:setMaskBit(player:getCharVar("WildcatWindurst"),"WildcatWindurst",0,true)
end
end
|
ITEM.name = "Пара латных рукавиц"
ITEM.desc = "Умело сделанные рукавицы из стальных пластин."
ITEM.model = "models/aoc_armour/gauntlet_gk_right.mdl"
ITEM.Width = 2
ITEM.Height = 2
ITEM.price = 75
ITEM.permit = "mat"
ITEM.iconCam = {
pos = Vector(0, 0, 24.782472610474),
ang = Angle(90, -90, 0),
fov = 45
}
|
return {'lindaan','linde','lindeblad','lindebloesem','lindebloesemthee','lindeboom','lindehout','lindehouten','lindelaan','linden','lindethee','lineair','lineamenten','lineariseren','linearisering','lineariteit','linesman','lingerie','lingeriefabrikant','lingerielijn','lingeriewinkel','linguist','linguistiek','linguistisch','liniaal','liniaalbalk','liniatuur','linie','linieermachine','linieschip','linietroepen','liniment','linieren','link','linken','linker','linkeraanvaller','linkerarm','linkerbaan','linkerbeen','linkerborst','linkerbovenhoek','linkerd','linkerdeel','linkerdijbeen','linkerduim','linkerenkel','linkerflank','linkerhand','linkerhelft','linkerheup','linkerhoek','linkerkant','linkerkantlijn','linkerknie','linkerkolom','linkerkuit','linkermarge','linkermiddenvelder','linkermuisknop','linkeroever','linkeroog','linkeroor','linkerpagina','linkerpink','linkerrijstrook','linkerschoen','linkerschouder','linkerspits','linkervleugel','linkervleugelverdediger','linkervoet','linkervoorpoot','linkerwang','linkerzij','linkerzijde','links','linksachter','linksaf','linksback','linksbenig','linksbinnen','linksboven','linksbuiten','linksdraaiend','linkse','linksgeorienteerd','linkshalf','linkshandig','linkshandigheid','linksheid','linksig','linksom','linksonder','linkspoot','linksvoetig','linksvoor','linktrainer','linnen','linnengoed','linnenjuffrouw','linnenkamer','linnenkast','linnennaaister','linnenwever','lino','linoleum','linoleumdruk','linoleumsnede','linolzuur','linosnede','linotype','lint','lintbebouwing','lintcassette','lintdorp','lintje','lintjesjager','lintjesregen','lintmeter','lintvis','lintvormig','lintworm','lintzaag','linze','linzensoep','lintmacaroni','linksrijdend','linnaeusklokje','linzenmoes','linkerhersenhelft','linkpartner','linkermenu','linkerbovenbeen','linkerkamer','linkerluik','lingeriemerk','lingeriezaak','linkerbalk','linkerbenedenhoek','linkerbil','linkerbladzijde','linkerbocht','linkerboezem','linkerbuur','linkerbuurman','linkerdeur','linkerdij','linkerelleboog','linkerfoto','linkergedeelte','linkerhartkamer','linkerlid','linkerlies','linkerlong','linkermuur','linkerneusgat','linkeroksel','linkeronderbeen','linkerooghoek','linkerpoot','linkerrand','linkerscherm','linkerslaap','linkerverdediger','linkervoorwiel','linkerwand','linkerwijsvinger','linksbackpositie','linksisme','linoleumvloer','linkerberm','linkerframe','linkerpaal','linkervuist','linkerbal','lingerieketen','linieregiment','linkerflankspeler','linkerrij','linkersleutelbeen','linkervak','linnenbinding','linkerpaneel','linkerknop','linkernaald','lindebos','lincoln','linda','linden','lindsey','linge','lingewaal','lingewaard','linkebeek','linkhout','linsmeel','lint','linter','linux','linde','linne','linssen','lindeman','linders','lindenberg','lin','lina','lindsays','lindy','lineke','linette','ling','linn','lino','linus','linthorst','lindhout','lindeboom','lindner','linckens','lindelauf','lingbeek','lingeman','linger','linneman','linsen','lintsen','lind','linskens','lintermans','lindenburg','linnebank','lindsen','linderhof','linnartz','linstra','linnemann','lintjens','linke','linting','lindebladen','lindebladeren','lindebloesems','lindebomen','lindelanen','lindetje','lineaire','lingeries','lingeriewinkels','lingerieen','linguisten','linguistische','liniaaltje','liniaaltjes','linialen','linieermachines','linies','linieschepen','linke','linkerarmen','linkerbenen','linkerds','linkere','linkerhanden','linkerkanten','linkerogen','linkeroren','linkerpaginas','linkerrijtje','linkervleugels','linkervoeten','linkje','linksbuitens','linksdraaiende','linkser','linkshandige','linkst','linkste','linnenjuffrouwen','linnenkamers','linnenkasten','linnennaaisters','linnenwevers','linos','linten','lintjes','lintvissen','lintvormige','lintwormen','lintzagen','linzen','lindes','lineairs','linieerde','linkeroevers','linkerschoenen','linkerschouders','linkjes','linksachters','linksbacks','linksbenige','linksbinnens','linksere','linksige','linksvoetige','linksvoors','linkt','linkte','linoleumsneden','linosneden','linotypes','lintcassettes','lintjesjagers','lintmeters','linosnedes','linksgeorienteerde','linkspoten','linksrijdende','linesmen','linkerborsten','linkerhelften','linkshalfs','linnaeusklokjes','linoleumsnedes','linolzuren','linkshandigen','linkpartners','lins','linas','lindas','lindes','lindsays','lindseys','lindys','linekes','linettes','lings','linns','linnes','linos','linus','lingeriezaken','linkervoetje','lintdorpen','linkerpootje','linkerarmpje','linkerhandje','linkerburen','linkeroogje','linkerbochten','linkerbeentje','linkeroortje','lintwormpjes','linkerhoekje','linoleumvloeren','lingeriemerken','linnenkastje','linkerrijstroken','linkerdeurtje','lintdorpje','linkerzijdes','linkerknopje','linkebeekse','lintse'} |
tickCount = 0
xml = require("scripts.lua-xml")
lbt = require("scripts.lbt")
serpent = require("scripts.serpent")
require("scripts.timer")
require("scripts.cutscenes")
require("scripts.sounds")
require("scripts.graphics")
require("scripts.functions")
require("scripts.animations")
require("scripts.world")
--executeCutscene("Fred rozmawia z FZB po raz drugi")
love.window.setMode(800, 600)
function love.draw()
if love.keyboard.isDown("left") then
setCameraPosition(getCameraPosition() + 3)
end
if love.keyboard.isDown("right") then
setCameraPosition(getCameraPosition() - 3)
end
renderWorld()
end
function love.keypressed(key)
if key == "c" then
changeIdleAnimation("Swiadek_Jehowy", "swiadek_bierze_od_Freda_glejt")
end
end
function love.update(dt)
tickCount = tickCount + dt*1000
updateCutscenes()
updateSounds()
updateTimers()
end |
----------------------------------------------------------
-- Load RayUI Environment
----------------------------------------------------------
RayUI:LoadEnv("Misc")
local M = _Misc
local mod = M:NewModule("Auction", "AceEvent-3.0")
local MAX_BUYOUT_PRICE = 10000000
function mod:ADDON_LOADED(event, addon)
if addon ~= "Blizzard_AuctionUI" then return end
self:UnregisterEvent("ADDON_LOADED")
for i = 1, 20 do
local f = _G["BrowseButton"..i]
if f then
f:RegisterForClicks("LeftButtonUp", "RightButtonUp")
f:HookScript("OnClick", function(self, button)
if button == "RightButton" and IsShiftKeyDown() then
local index = self:GetID() + FauxScrollFrame_GetOffset(BrowseScrollFrame)
local name, _, _, _, _, _, _, _, _, buyoutPrice = GetAuctionItemInfo("list", index)
if name then
if buyoutPrice < MAX_BUYOUT_PRICE then
PlaceAuctionBid("list", index, buyoutPrice)
end
end
end
end)
end
end
for i = 1, 20 do
local f = _G["AuctionsButton"..i]
if f then
f:RegisterForClicks("LeftButtonUp", "RightButtonUp")
f:HookScript("OnClick", function(self, button)
local index = self:GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame)
if button == "RightButton" and IsShiftKeyDown() then
local name = GetAuctionItemInfo("owner", index)
if name then
CancelAuction(index)
end
end
end)
end
end
end
function mod:Initialize()
if not M.db.auction then return end
self:RegisterEvent("ADDON_LOADED")
end
M:RegisterMiscModule(mod:GetName())
|
local path = require 'path'
local Logs = require 'lib.logs'
local Config = require 'scripts.config'
local DataFetcher = require 'scripts.make.data-fetcher'
local Parser = require 'scripts.make.parser'
local Encoder = require 'scripts.make.encoder'
local Writer = require 'scripts.make.writer'
local PWD
local insert = table.insert
local function get_expansions(all, expansion)
if all then
return Config.get_all(PWD, 'expansion')
elseif expansion then
local exp = Config.get_one(PWD, 'expansion', expansion)
Logs.assert(exp, 1, "Expansion \"", expansion, "\" is not configured.")
return { [expansion] = exp }
else
return Config.get_defaults(PWD, 'expansion')
end
end
local function get_files(recipe)
local files = {}
Logs.assert(type(recipe) == 'table', 1, "Recipe must be a list of filenames")
for _, file in ipairs(recipe) do
insert(files, path.join(PWD, file))
end
return files
end
return function(pwd, flags, exp)
PWD = pwd
local expansions = get_expansions(flags['--all'], exp)
for id, exp in pairs(expansions) do
local cdbfp = path.join(pwd, "expansions", id .. ".cdb")
Logs.info("Making \"", id, "\"...")
local files = get_files(exp.recipe)
local data = DataFetcher.get(files)
local sets, cards = Parser.parse(data)
local entries = Encoder.encode(sets, cards)
Writer.write_sets(pwd, sets)
Writer.write_entries(pwd, cdbfp, entries, flags['--clean'])
end
end
|
local base = require('imgui.Widget')
---@class im.lstg.PerformanceInfo:im.Widget
local M = class('im.lstg.PerformanceInfo', base)
local im = imgui
function M:ctor(...)
base.ctor(self, ...)
self.plot = {}
self.plotTargets = {}
self.plotBufSize = 60
local dir = cc.Director:getInstance()
self:setPlot('Frame Time', {
label = '',
overlay = function(v)
return string.format('%.2fms', v)
end,
min = 0,
max = 25,
min_range = { 0, 50 },
max_range = { 0, 50 },
buffer = {},
offset = 0,
size = cc.p(0, 64),
source = function()
return dir:getDeltaTime() * 1000
end,
})
self:setPlot('FPS', {
label = '',
overlay = function(v)
return string.format('%.2f', v)
end,
min = 0,
max = 65,
min_range = { 0, 100 },
max_range = { 0, 100 },
buffer = {},
offset = 0,
size = cc.p(0, 64),
source = function()
return dir:getFrameRate()
end,
})
self:setPlot('Game Object Count', {
label = '',
overlay = function(v)
return string.format('Count: %d', v)
end,
min = 0,
max = 3000,
min_range = { 0, 10000 },
max_range = { 0, 10000 },
buffer = {},
offset = 0,
size = cc.p(0, 64),
source = function()
return GetnObj()
end,
})
self:setPlot('Game Object Frame Time', {
label = '',
overlay = function(v)
return string.format('%.2fms', v)
end,
min = 0,
max = 15,
min_range = { 0, 50 },
max_range = { 0, 50 },
buffer = {},
offset = 0,
size = cc.p(0, 64),
source = function()
return profiler.getLast('ObjFrame') * 1000
end,
})
self:setPlot('Game Object Render Time', {
label = '',
overlay = function(v)
return string.format('%.2fms', v)
end,
min = 0,
max = 15,
min_range = { 0, 50 },
max_range = { 0, 50 },
buffer = {},
offset = 0,
size = cc.p(0, 64),
source = function()
return profiler.getLast('RenderFunc') * 1000
end,
})
self:setPlot('Render Time', {
label = '',
overlay = function(v)
return string.format('%.2fms', v)
end,
min = 0,
max = 15,
min_range = { 0, 50 },
max_range = { 0, 50 },
buffer = {},
offset = 0,
size = cc.p(0, 64),
source = function()
local t = profiler.getLast('AppFrame::PF_Render') + profiler.getLast('AppFrame::PF_Visit')
return t * 1000
end,
})
self:setPlot('Lua Memory', {
label = '',
overlay = function(v)
return string.format('%.2fMB', v)
end,
min = 0,
max = 10,
min_range = { 0, 50 },
max_range = { 0, 50 },
buffer = {},
offset = 0,
size = cc.p(0, 64),
source = function()
return collectgarbage('count') / 1024
end,
})
self.plotTargets = {
'Frame Time',
'FPS',
'Game Object Count',
'Game Object Frame Time',
'Game Object Render Time',
'Render Time',
'Lua Memory',
}
end
function M:setPlot(key, val)
self.plot[key] = val
if #self.plot[key].buffer < self.plotBufSize then
self:resetPlotBuffer(key)
end
end
function M:resetPlot(key)
self.plot[key] = {
label = '',
overlay = '',
min = 0,
max = 1,
size = nil,
buffer = {},
offset = 0,
source = nil,
}
self:resetPlotBuffer(key)
end
function M:resetPlotBuffer(key)
local buf = {}
for i = 1, self.plotBufSize do
buf[i] = 0
end
local p = self.plot[key]
p.buffer = buf
p.offset = 0
end
function M:addPlotPoint(key, val)
local p = self.plot[key]
if not p then
self:resetPlot(key)
p = self.plot[key]
end
p.offset = p.offset + 1
p.buffer[p.offset] = val
if p.offset >= self.plotBufSize then
p.offset = 0
end
end
function M:_renderPlot(key)
local p = self.plot[key]
local src = p.source
if src then
self:addPlotPoint(key, src())
end
local label = p.label
local buf = p.buffer
local offset = p.offset
if type(label) == 'function' then
label = label(buf[offset + 1])
end
local overlay = p.overlay
if type(p.overlay) == 'function' then
overlay = overlay(buf[offset + 1])
end
im.pushID(tostring(key))
im.plotLines(unpack({ label, buf, #buf, offset,
overlay, p.min, p.max, p.size }))
--im.plotLines(unpack({ label, buf, #buf, 0,
-- overlay, p.min, p.max, p.size }))
local ret
local minr = p.min_range
local maxr = p.max_range
local h = 64
if p.size then
h = p.size.y
end
if minr then
im.sameLine()
im.pushID(tostring(key) .. 'min')
ret, p.min = im.vSliderFloat('', cc.p(16, h), p.min, minr[1], minr[2], '')
im.popID()
if ret and p.min > p.max then
p.max = p.min
end
end
if maxr then
im.sameLine()
im.pushID(tostring(key) .. 'max')
ret, p.max = im.vSliderFloat('', cc.p(16, h), p.max, maxr[1], maxr[2], '')
im.popID()
if ret and p.min > p.max then
p.min = p.max
end
end
im.sameLine()
im.textUnformatted(string.format('min %.1f\nmax %.1f', p.min, p.max))
im.popID()
end
function M:_handler()
for i, key in ipairs(self.plotTargets) do
if im.treeNode(key) then
self:_renderPlot(key)
im.treePop()
end
end
end
return M
|
local x = {...}
local emes = x[1]
local win = window:new("Error",nil,18)
do
local font = love.graphics.getFont()
if font:getWidth(emes)+6 > win.width then
win.width = font:getWidth(emes)+6
end
win:setBackgroundColor(250,250,250)
win.callbacks.draw = function()
love.graphics.setColor(0,0,0,255)
love.graphics.print(emes,2,3)
end
end
win:setVisible(true) |
--
-- Please see the readme.txt file included with this distribution for
-- attribution and copyright information.
--
control = nil;
freeadjustment = 0;
slots = {};
mod_lock = 0;
function registerControl(ctrl)
control = ctrl;
end
function updateControl()
if control then
if adjustmentedit then
control.label.setValue("Adjusting");
else
control.label.setValue("Modifier");
if freeadjustment > 0 then
control.label.setValue("(+" .. freeadjustment .. ")");
elseif freeadjustment < 0 then
control.label.setValue("(" .. freeadjustment .. ")");
end
control.modifier.setValue(getSum());
control.base.resetCounters();
for i = 1, #slots do
control.base.addCounter();
end
if hoverslot and hoverslot ~= 0 and slots[hoverslot] then
control.label.setValue(slots[hoverslot].description);
end
end
if math.abs(control.modifier.getValue()) > 999 then
control.modifier.setFont("modcollectorlabel");
else
control.modifier.setFont("modcollector");
end
end
end
function isEmpty()
if freeadjustment == 0 and #slots == 0 then
return true;
end
return false;
end
function getSum()
local total = freeadjustment;
for i = 1, #slots do
total = total + slots[i].number;
end
return total;
end
function getDescription(forcebonus)
local str = "";
if not forcebonus and #slots == 1 and freeadjustment == 0 then
str = slots[1].description;
else
for i = 1, #slots do
if i ~= 1 then
str = str .. ", ";
end
str = str .. slots[i].description;
if slots[i].number > 0 then
str = str .. " +" .. slots[i].number;
else
str = str .. " " .. slots[i].number;
end
end
if freeadjustment ~= 0 then
if #slots > 0 then
str = str .. ", ";
end
if freeadjustment > 0 then
str = str .. "+" .. freeadjustment;
else
str = str .. freeadjustment;
end
end
end
return str;
end
function addSlot(description, number)
if #slots < 6 then
table.insert(slots, { ['description'] = description, ['number'] = number });
end
updateControl();
end
function removeSlot(number)
table.remove(slots, number);
updateControl();
end
function adjustFreeAdjustment(amount)
freeadjustment = freeadjustment + amount;
updateControl();
end
function setFreeAdjustment(amount)
freeadjustment = amount;
updateControl();
end
function setAdjustmentEdit(state)
if state then
control.modifier.setValue(freeadjustment);
else
setFreeAdjustment(control.modifier.getValue());
end
adjustmentedit = state;
updateControl();
end
function reset()
if control and control.modifier.hasFocus() then
control.modifier.setFocus(false);
end
freeadjustment = 0;
slots = {};
updateControl();
end
function hoverDisplay(n)
hoverslot = n;
updateControl();
end
function applyToRoll(draginfo)
if isEmpty() then
--[[ do nothing ]]
elseif draginfo.getNumberData() == 0 and draginfo.getDescription() == "" then
draginfo.setDescription(getDescription());
draginfo.setNumberData(getSum());
else
-- Add the modifier descriptions to the description text
local moddesc = getDescription(true);
if moddesc ~= "" then
local desc = draginfo.getDescription() .. " (" .. moddesc .. ")";
draginfo.setDescription(desc);
end
-- Add the modifier total to the number data
draginfo.setNumberData(draginfo.getNumberData() + getSum());
end
-- Check the modifier lock count to handle multi-rolls
-- that should all be affected by modifier stack
setLockCount(getLockCount() - 1);
if getLockCount() == 0 then
reset();
end
end
-- Get/Set a modifier lock count
-- Used to keep the modifier stack from being cleared when making multiple rolls (i.e. full attack)
function setLockCount(v)
if v >= 0 then
mod_lock = v;
else
mod_lock = 0;
end
end
function getLockCount()
return mod_lock;
end
-- Hot key handling
function checkHotkey(keyinfo)
if keyinfo.getType() == "number" or keyinfo.getType() == "modifierstack" then
addSlot(keyinfo.getDescription(), keyinfo.getNumberData());
return true;
end
end
function onInit()
Interface.onHotkeyActivated = checkHotkey;
end
|
config = {}
config.webhookDrop = ''
config.webhookSend = ''
config.webhookEquip = ''
config.webhookUnEquip = ''
config.webhookColor = 16431885
config.webhookIcon = 'https://i.imgur.com/5ydYKZg.png'
config.webhookBottom = 'BRZ - '
config.imageServer = 'https://cdn.brz.gg/gtav/vrp'
|
function GM:UpdateAnimation( ply, velocity, maxseqgroundspeed )
local len = velocity:Length()
local movement = 1.0
if ( len > 0.2 ) then
movement = ( len / maxseqgroundspeed )
end
local rate = math.min( movement, 2 )
-- if we're under water we want to constantly be swimming..
if ( ply:WaterLevel() >= 2 ) then
rate = math.max( rate, 0.5 )
elseif ( !ply:IsOnGround() && len >= 1000 ) then
rate = 0.1
end
ply:SetPlaybackRate( rate )
if ( ply:InVehicle() ) then
local Vehicle = ply:GetVehicle()
-- We only need to do this clientside..
if ( CLIENT ) then
--
-- This is used for the 'rollercoaster' arms
--
local Velocity = Vehicle:GetVelocity()
local fwd = Vehicle:GetUp()
local dp = fwd:Dot( Vector( 0, 0, 1 ) )
local dp2 = fwd:Dot( Velocity )
ply:SetPoseParameter( "vertical_velocity", ( dp < 0 and dp or 0 ) + dp2 * 0.005 )
-- Pass the vehicles steer param down to the player
local steer = Vehicle:GetPoseParameter( "vehicle_steer" )
steer = steer * 2 - 1 -- convert from 0..1 to -1..1
if ( Vehicle:GetClass() == "prop_vehicle_prisoner_pod" ) then steer = 0 ply:SetPoseParameter( "aim_yaw", math.NormalizeAngle( ply:GetAimVector():Angle().y - Vehicle:GetAngles().y - 90 ) ) end
ply:SetPoseParameter( "vehicle_steer", steer )
end
end
if ( CLIENT ) then
GAMEMODE:GrabEarAnimation( ply )
GAMEMODE:MouthMoveAnimation( ply )
end
end
|
local time = 0
love = {
timer = {
getTime = function()
return time
end,
setTime = function(ts)
time = ts
end
}
}
|
require 'nn'
local Zero, parent = torch.class('nn.Zero', 'nn.Module')
function Zero:__init()
parent.__init(self)
end
function Zero:updateOutput(input)
self.output:resizeAs(input)
self.output:zero()
return self.output
end
function Zero:updateGradInput(input, gradOutput)
self.gradInput:resizeAs(input)
self.gradInput:zero()
return self.gradInput
end
|
Foo.aaa();
local test = Foo.new(333);
test:abc(1,2,3);
--test:aaa();
test:constmethod();
ret = test:constretmethod();
print("constretmethod: "..ret);
test.testProp = 123;
print("testProp: "..test.testProp);
func()
print("ONE: "..Foo.ONE);
print("TWO: "..Foo.TWO);
print("THREE: "..Foo.THREE);
local ptrtest = test:ptrTest();
test:ptrArgTest(test);
test = nil;
collectgarbage();
local arr = Array.new();
arr[0] = 123;
print("arr[0]: "..arr[0]);
arr:test();
local testb = STestB.new();
print("set testb.b");
testb.b = 123;
print("testb.b: "..testb.b);
print("set testb.a.a");
testb.a.a = 456;
print("testb.a.a: "..testb.a.a);
print("STestB.TypeId: "..STestB.TypeId());
print("testb.TypeId: "..testb.TypeId());
print("testa.TypeId: "..STestA.TypeId());
print("testb.a.TypeId: "..testb.a.TypeId());
intTest(123, 456, 789, 101112);
|
Ryan.Globals = {
Color = {
Purple = 49,
Red = 6
},
Controls = {
Horn = 86,
Duck = 73,
Sprint = 21
},
CyrillicAlphabet = {
["A"] = "A", ["a"] = "a", ["Б"] = "B", ["б"] = "b",
["В"] = "V", ["в"] = "v", ["Г"] = "G", ["г"] = "g",
["Д"] = "D", ["д"] = "d", ["Е"] = "E", ["e"] = "e",
["Ё"] = "Yo", ["ё"] = "yo", ["Ж"] = "Zh", ["ж"] = "zh",
["З"] = "Z", ["з"] = "z", ["И"] = "I", ["и"] = "i",
["Й"] = "J", ["й"] = "j", ["К"] = "K", ["к"] = "k",
["Л"] = "L", ["л"] = "l", ["М"] = "M", ["м"] = "m",
["Н"] = "N", ["н"] = "n", ["О"] = "O", ["о"] = "o",
["П"] = "P", ["п"] = "p", ["Р"] = "R", ["р"] = "r",
["С"] = "S", ["с"] = "s", ["Т"] = "T", ["т"] = "t",
["У"] = "U", ["у"] = "u", ["Ф"] = "F", ["ф"] = "f",
["Х"] = "H", ["х"] = "h", ["Ц"] = "Ts", ["ц"] = "ts",
["Ч"] = "Ch", ["ч"] = "ch", ["Ш"] = "Sh", ["ш"] = "sh",
["Щ"] = "Shch", ["щ"] = "shch", ["Ъ"] = "'", ["ъ"] = "'",
["Ы"] = "Y", ["ы"] = "y", ["Ь"] = "'", ["ь"] = "'",
["Э"] = "E", ["э"] = "e", ["Ю"] = "Yu", ["ю"] = "yu",
["Я"] = "Ya", ["я"] = "ya"
},
ActionFigures = {
{3514, 3754, 35}, {3799, 4473, 7}, {3306, 5194, 18}, {2937, 4620, 48}, {2725, 4142, 44},
{2487, 3759, 43}, {1886, 3913, 33}, {1702, 3290, 48}, {1390, 3608, 34}, {1298, 4306, 37},
{1714, 4791, 41}, {2416, 4994, 46}, {2221, 5612, 55}, {1540, 6323, 24}, {1310, 6545, 5},
{457, 5573, 781}, {178, 6394, 31}, {-312, 6314, 32}, {-689, 5829, 17}, {-552, 5330, 75},
{-263, 4729, 138}, {-1121, 4977, 186}, {-2169, 5192, 17}, {-2186, 4250, 48}, {-2172, 3441, 31},
{-1649, 3018, 32}, {-1281, 2550, 18}, {-1514, 1517, 111}, {-1895, 2043, 142}, {-2558, 2316, 33},
{-3244, 996, 13}, {-2959, 386, 14}, {-3020, 41, 10}, {-2238, 249, 176}, {-1807, 427, 132},
{-1502, 813, 181}, {-770, 877, 204}, {-507, 393, 97}, {-487, -55, 39}, {-294, -343, 10},
{-180, -632, 49}, {-108, -857, 39}, {-710, -906, 19}, {-909, -1149, 2}, {-1213, -960, 1},
{-1051, -523, 36},{-989, -102, 40}, {-1024, 190, 62}, {-1462, 182, 55}, {-1720, -234, 55},
{-1547, -449, 40}, {-1905, -710, 8}, {-1648, -1095, 13}, {-1351, -1547, 4}, {-887, -2097, 9},
{-929, -2939, 13}, {153, -3078, 7}, {483, -3111, 6}, {-56, -2521, 7}, {368, -2114, 17},
{875, -2165, 32}, {1244, -2573, 43}, {1498, -2134, 76}, {1207, -1480, 34}, {679, -1523, 9},
{379, -1510, 29}, {-44, -1749, 29}, {-66, -1453, 32}, {173, -1209, 30}, {657, -1047, 22},
{462, -766, 27}, {171, -564, 22}, {621, -410, -1}, {1136, -667, 57}, {988, -138, 73},
{1667, 0, 166}, {2500, -390, 95}, {2549, 385, 108}, {2618, 1692, 31}, {1414, 1162, 114},
{693, 1201, 345}, {660, 549, 130}, {219, 97, 97}, {-141, 234, 99}, {87, 812, 211},
{-91, 939, 233}, {-441, 1596, 358}, {-58, 1939, 190}, {-601, 2088, 132}, {-300, 2847, 55},
{63, 3683, 39}, {543, 3074, 40}, {387, 2570, 44}, {852, 2166, 52}, {1408, 2157, 98},
{1189, 2641, 38}, {1848, 2700, 63}, {2635, 2931, 44}, {2399, 3063, 54}, {2394, 3062, 52}
},
SignalJammers = {
{-3096, 783, 33}, {-2273, 325, 195}, {-1280, 304, 91}, {-1310, -445, 108}, {-1226, -866, 82},
{-1648, -1125, 29}, {-686, -1381, 24}, {-265, -1897, 54}, {-988, -2647, 89}, {-250, -2390, 124},
{554, -2244, 74}, {978, -2881, 33}, {1586, -2245, 130}, {1110, -1542, 55}, {405, -1387, 75},
{-1, -1018, 95}, {-182, -589, 210}, {-541, -213, 82}, {-682, 228, 154}, {-421, 1142, 339},
{-296, 2839, 68}, {753, 2596, 133}, {1234, 1869, 92}, {760, 1263, 444}, {677, 556, 153},
{220, 224, 168}, {485, -109, 136}, {781, -705, 47}, {1641, -33, 178}, {2442, -383, 112},
{2580, 444, 115}, {2721, 1519, 85}, {2103, 1754, 138}, {1709, 2658, 60}, {1859, 3730, 116},
{2767, 3468, 67}, {3544, 3686, 60}, {2895, 4332, 101}, {3296, 5159, 29}, {2793, 5984, 366},
{1595, 6431, 32}, {-119, 6217, 62}, {449, 5595, 793}, {1736, 4821, 60}, {732, 4099, 37},
{-492, 4428, 86}, {-1018, 4855, 301}, {-2206, 4299, 54}, {-2367, 3233, 103}, {-1870, 2069, 154}
},
PlayingCards = {
{-1028, -2747, 14}, {-74, -2005, 18}, {202, -1645, 29}, {120, -1298, 29}, {11, -1102, 29},
{-539, -1279, 27}, {-1205, -1560, 4}, {-1288, -1119, 7}, {-1841, -1235, 13}, {-1155, -528, 31},
{-1167, -234, 37}, {-971, 104, 55}, {-1513, -105, 54}, {-3048, 585, 7}, {-3150, 1115, 20},
{-1829, 798, 138}, {-430, 1214, 325}, {-409, 585, 125}, {-103, 368, 112}, {253, 215, 106},
{-168, -298, 40}, {183, -686, 43}, {1131, -983, 46}, {1159, -317, 69}, {548, -190, 54},
{1487, 1128, 114}, {730, 2514, 73}, {188, 3075, 43}, {-288, 2545, 75}, {-1103, 2714, 19},
{-2306, 3388, 31}, {-1583, 5204, 4}, {-749, 5599, 41}, {-283, 6225, 31}, {99, 6620, 32},
{1876, 6410, 46}, {2938, 5325, 101}, {3688, 4569, 25}, {2694, 4324, 45}, {2120, 4784, 40},
{1707, 4920, 42}, {727, 4189, 41}, {-524, 4193, 193}, {79, 3704, 41}, {900, 3557, 33},
{1690, 3588, 35}, {1991, 3045, 47}, {2747, 3465, 55}, {2341, 2571, 47}, {2565, 297, 108},
{1325, -1652, 52}, {989, -1801, 31}, {827, -2159, 29}, {810, -2979, 6}
},
PTFX = {
{"Trail (White)", "scr_rcbarry2", "scr_exp_clown_trails", 500},
{"Trail (Color)", "scr_powerplay", "sp_powerplay_beast_appear_trails", 500},
{"Electrical Fire (Silent)", "core", "ent_dst_elec_fire_sp", 200},
{"Electrical Fire (Noisy)", "core", "ent_dst_elec_crackle", 500},
{"Electrical Malfunction", "cut_exile1", "cs_ex1_elec_malfunction", 500},
{"Chandelier", "cut_family4", "cs_fam4_shot_chandelier", 100},
{"Firework Trail (Short)", "scr_rcpaparazzo1", "scr_mich4_firework_sparkle_spawn", 500},
{"Firework Trail (Long)", "scr_indep_fireworks", "scr_indep_firework_sparkle_spawn", 500},
{"Firework Burst", "scr_indep_fireworks", "scr_indep_firework_trailburst_spawn", 500},
{"Firework Trailburst", "scr_rcpaparazzo1", "scr_mich4_firework_trailburst_spawn", 500},
{"Firework Fountain", "scr_indep_fireworks", "scr_indep_firework_trail_spawn", 500},
{"Beast Vanish", "scr_powerplay", "scr_powerplay_beast_vanish", 1000},
{"Beast Appear", "scr_powerplay", "scr_powerplay_beast_appear", 1000},
{"Alien Teleport", "scr_rcbarry1", "scr_alien_teleport", 750},
{"Alien Disintegrate", "scr_rcbarry1", "scr_alien_disintegrate", 500},
{"Take Zone", "scr_ie_tw", "scr_impexp_tw_take_zone", 500},
{"Jackhammer (Quiet)", "core", "ent_dst_bread", 50},
{"Jackhammer (Loud)", "core", "bul_paper", 50},
{"Vehicle Backfire", "core", "veh_backfire", 250},
{"Tire Flash", "scr_carsteal4", "scr_carsteal5_car_muzzle_flash", 50},
{"Tire Air", "scr_carsteal4", "scr_carsteal5_tyre_spiked", 150},
{"Tire Sparks", "scr_carsteal4", "scr_carsteal4_tyre_spikes", 50},
{"Car Sparks", "core", "bang_carmetal", 250},
{"Stungun Sparks", "core", "bul_stungun_metal", 500},
{"Plane Sparks", "cut_exile1", "cs_ex1_plane_break_L", 325},
{"Plane Debris", "scr_solomon3", "scr_trev4_747_engine_debris", 1000},
{"Foundry Sparks", "core", "sp_foundry_sparks", 500},
{"Foundry Steam", "core", "ent_amb_foundry_steam_spawn", 500},
{"Oil", "core", "ent_sht_oil", 3500},
{"Trash", "core", "ent_dst_hobo_trolley", 250},
{"Money Trail", "scr_exec_ambient_fm", "scr_ped_foot_banknotes", 125},
{"Gumball Machine", "core", "ent_dst_gen_gobstop", 500},
{"Camera Flash", "scr_bike_business", "scr_bike_cfid_camera_flash", 200},
{"Black Smoke", "scr_fbi4", "exp_fbi4_doors_post", 250},
{"Musket", "wpn_musket", "muz_musket_ng", 500},
{"Torpedo", "veh_stromberg", "exp_underwater_torpedo", 500},
{"Molotov", "core", "exp_grd_molotov_lod", 500},
{"EMP", "scr_xs_dr", "scr_xs_dr_emp", 350},
{"Petrol Fire", "scr_finale1", "scr_fin_fire_petrol_trev", 2500},
{"Petrol Explosion", "core", "exp_grd_petrol_pump", 300},
{"Inflate", "core", "ent_dst_inflate_lilo", 300},
{"Inflatable", "core", "ent_dst_inflatable", 500},
{"Water Splash (Short)", "core", "ent_anim_bm_water_scp", 200},
{"Water Splash (Long)", "cut_family5", "cs_fam5_michael_pool_splash", 500},
{"Mop Squeeze", "scr_agencyheist", "scr_fbi_mop_squeeze", 100},
{"Flame (Real)", "core", "ent_sht_flame", 7500}
},
CrashToSingleplayerEvents = {
{-1386010354, player_id, player_id, player_id, -788905164},
{962740265, player_id, player_id, player_id, -788905164},
{-1386010354, player_id, 0, 23243, 5332, 3324, 845546543, 3437435, player_id},
{962740265, player_id, 23243, 5332, 3324, player_id},
{962740265, -72614, 63007, 59027, -12012, -26996, 33398, player_id},
{-1386010354, -72614, 63007, 59027, -12012, -26996, 33398, player_id},
{-1386010354, -72614, 63007, 59027, -12012, -26996, 33398, player_id},
{-1386010354, -72614, 63007, 59027, -12012, -26996, 33398, player_id},
{962740265, player_id, player_id, 30583, player_id, player_id, player_id, player_id, -328966, 10128444},
{-1386010354, pid, pid, 30583, pid, pid, pid, pid, -328966, 10128444},
{-1386010354, player_id, player_id, player_id, -788905164},
{962740265, player_id, player_id, player_id, -788905164},
{962740265, player_id, 95398, 98426, -24591, 47901, -64814},
{962740265, player_id, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647},
{-1386010354, player_id, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647, 2147483647},
{677240627, player_id, -1774405356},{962740265, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{962740265, player_id, player_id, 1001, player_id},
{-1386010354, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{-1386010354, player_id, player_id, 1001, player_id},
{-2113023004, player_id, math.random(115831, 9999449)},
{-2113023004, player_id, math.random(115831, 9999449), math.random(-1, 1)},
{-2113023004, player_id, math.random(115831, 9999449), math.random(-1, 1), math.random(-1, 3)},
{-2113023004, player_id, math.random(115831, 9999449), math.random(-1, 1), math.random(-1, 3), math.random(-1, 101)},
{-2113023004, player_id, math.random(115831, 9999449), math.random(-1, 1), math.random(-1, 3), math.random(-1, 101), math.random(-1, 3)},
{-2113023004, player_id, math.random(115831, 9999449), math.random(-1, 1), math.random(-1, 3), math.random(-1, 101), math.random(-1, 3), math.random(-1, 1)},
{677240627, player_id, math.random(-1996063584, 1999997397)},
{677240627, player_id, 22963134},
{677240627, player_id, math.random(-1996063584, 1999997397), math.random(-1, 385999)},
{677240627, player_id, math.random(-1996063584, 1999997397), math.random(-1, 385999), math.random(-1, 166000)},
{677240627, player_id, math.random(-1996063584, 1999997397), math.random(-1, 385999), math.random(-1, 166000), math.random(-1, 1351433445)},
{677240627, player_id, math.random(-1996063584, 1999997397), math.random(-1, 385999), math.random(-1, 166000), math.random(-1, 1351433445), math.random(-1, 1951345490)},
{677240627, player_id, math.random(-1996063584, 1999997397), math.random(-1, 385999), math.random(-1, 166000), math.random(-1, 1351433445), math.random(-1, 1951345490), math.random(-1, 116)},
{677240627, player_id, math.random(-1996063584, 1999997397), math.random(-1, 385999), math.random(-1, 166000), math.random(-1, 1351433445), math.random(-1, 1951345490), math.random(-1, 116), math.random(-1, 1)},
{677240627, player_id, math.random(-1996063584, 1999997397), math.random(-1, 385999), math.random(-1, 166000), math.random(-1, 1351433445), math.random(-1, 1951345490), math.random(-1, 116), math.random(-1, 1), math.random(-1, 1)},
{603406648, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{603406648, player_id, player_id, 1001, player_id},
{704979198, player_id, math.random(-1, 1)},
{704979198, player_id, math.random(-1, 1), math.random(-2, 0)},
{704979198, player_id, math.random(-1, 1), math.random(-2, 0), math.random(3, 5)},
{704979198, player_id, math.random(-1, 1), math.random(-2, 0), math.random(3, 5), math.random(172, 174)},
{704979198, player_id, math.random(-1, 1), math.random(-2, 0), math.random(3, 5), math.random(172, 174), math.random(20, 510)},
{704979198, player_id, math.random(-1, 1), math.random(-2, 0), math.random(3, 5), math.random(172, 174), math.random(20, 510), math.random(62, 64)},
{704979198, player_id, math.random(-1, 1), math.random(-2, 0), math.random(3, 5), math.random(172, 174), math.random(20, 510), math.random(62, 64), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1)},
{704979198, player_id, math.random(-1, 1), math.random(-2, 0), math.random(3, 5), math.random(172, 174), math.random(20, 510), math.random(62, 64), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1)},
{704979198, player_id, math.random(-1, 1), math.random(-2, 0), math.random(3, 5), math.random(172, 174), math.random(20, 510), math.random(62, 64), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1), math.random(-1, 1)},
{-1715193475, player_id, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{1258808115, player_id, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{2112408256, player_id, math.random(-1986324736, 1747413822)},
{2112408256, player_id, 77777776},
{2112408256, player_id, math.random(-1986324736, 1747413822), math.random(-1986324736, 1777712108)},
{2112408256, player_id, 77777776, 77777776},
{2112408256, player_id, math.random(-1986324736, 1747413822), math.random(-1986324736, 1777712108), math.random(-1673857408, 1780088064)},
{2112408256, player_id, 77777776, 77777776, 77777776},
{2112408256, player_id, math.random(-1986324736, 1747413822), math.random(-1986324736, 1777712108), math.random(-1673857408, 1780088064), math.random(-2588888790, 2100146067)},
{998716537, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{998716537, player_id, player_id, 1001, player_id},
{163598572, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{163598572, player_id, player_id, 1001, player_id},
{-1970125962, player_id, math.random(-1, 50)},
{-1970125962, player_id, math.random(-1, 50), math.random(-1, 50)},
{-1056683619, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{-1056683619, player_id, player_id, 1001, player_id},
{436475575, player_id, 20},
{1757755807, player_id, 62, 2},
{-1767058336, player_id, 3},
{-1013679841, player_id, player_id, 111},
{-1501164935, player_id, 0},
{998716537, player_id, 0},
{163598572, player_id, 0},
{924535804, player_id, 0},
{69874647, player_id, 0},
{-1782442696, player_id, 420, 69},
{1445703181, player_id, 28, 4294967295, 4294967295},
{-1386010354, player_id, 4294894682, -4294904289, -4294908269, 4294955284, 4294940300, -4294933898},
{962740265, player_id, 4294894682, -4294904289, -4294908269, 4294955284, 4294940300, -4294933898},
{-1501164935, player_id, player_id, math.random(-2147483647, 2147483647), player_id},
{-1501164935, player_id, player_id, 1001, player_id}
},
CrashToDesktopMethods = {
"Yo Momma",
"Vegetation",
"Invalid Objects",
"Invalid Peds"
},
InvalidObjects = {
386259036, 450174759, 1567950121, 1734157390,
1759812941, 2040219850, -1231365640, 1727217687,
3613262246, -993438434, -990984874, -818431457,
-681705050, -568850501, 3301528862, 3303982422,
3476535839, 3726116795
},
SafeCrashDistance = 666.9,
SafeCrashDuration = 10000,
SafeCrashCoords = {x = 4500, y = -4400, z = 0},
VehicleAttachBones = {
{"Center", nil},
{"Hood", "bonnet"},
{"Windshield", "windscreen"},
{"License Plate", "numberplate"},
{"Exhaust", "exhaust"},
{"Trunk", "boot"}
},
ForcefieldModes = {
"Off",
"Push",
"Pull",
"Spin",
"Up",
"Down",
"Smash",
"Chaos",
"Explode"
},
GodFingerModes = {
"Off",
"Default",
"Push",
"Pull",
"Smash",
"Chaos",
"Explode"
},
CrosshairModes = {
"Off",
"When Pointing",
"Always"
},
FireFingerModes = {
"Off",
"When Pointing",
"Always"
},
AntihermitModes = {
"Off",
"Teleport Outside",
"Kick",
"Crash"
},
NPCScenarios = {
"Off",
"Musician",
"Human Statue",
"Paparazzi",
"Janitor",
"Nude",
"Delete"
},
BedSoundCoords = {
{x = -73.31681060791, y = -820.26013183594, z = 326.17517089844},
{x = 2784.536, y = 5994.213, z = 354.275},
{x = -983.292, y = -2636.995, z = 89.524},
{x = 1747.518, y = 4814.711, z = 41.666},
{x = 1625.209, y = -76.936, z = 166.651},
{x = 751.179, y = 1245.13, z = 353.832},
{x = -1644.193, y = -1114.271, z = 13.029},
{x = 462.795, y = 5602.036, z = 781.400},
{x = -125.284, y = 6204.561, z = 40.164},
{x = 2099.765, y = 1766.219, z = 102.698}
},
BeachPeds = {
3349113128, 3105934379, 1077785853, 2021631368,
2217202584, 3243462130, 3523131524, 600300561,
3886638041, 3105523388, 2114544056, 3394697810,
3269663242, 808859815
},
PolicePedTypes = {
6, 27, 29
},
PoliceVehicles = {
1127131465, -1647941228, 2046537925, -1627000575,
1912215274, -1973172295, -1536924937, -1779120616,
456714581, -34623805, 353883353, 741586030,
-488123221, -1205689942, -1683328900, 1922257928
},
Haulers = {
1518533038, 387748548, 371926404, -1649536104, 177270108
}
} |
local typedefs = require "kong.db.schema.typedefs"
return {
name = "jwt-claims-advanced",
fields = {
{ protocols = typedefs.protocols_http },
{
config = {
type = "record",
fields = {
-- These 3 params 100% match the JWT plugin for how
-- the JWT is found in the incoming request, and used
-- from this plugin in the same way...
{
uri_param_names = {
type = "set",
elements = { type = "string" },
default = { "jwt" },
},
},
{
header_names = {
type = "set",
elements = { type = "string" },
default = { "authorization" },
},
},
{
cookie_names = {
type = "set",
elements = { type = "string" },
default = {}
},
},
-- These params are the new ones for this plugin...
{
continue_on_error = {
type = "boolean",
default = true
},
},
{
claims = {
type = "array",
default = {},
elements = {
type = "record",
fields = {
{
-- Path to the claim in the JWT payload
-- Example: custom.path.to.item
path = {
type = "string",
--required: true,
},
},
{
-- Example: X-MyHeader
output_header = {
type = "string",
},
},
-- This claim (array/table) must contain the value specified with the "contains" param
{
contains = {
type = "string",
},
},
-- This claim (array/table) must NOT contain the value specified with the "does_not_contain" param
{
does_not_contain = {
type = "string",
},
},
-- This claim (array/table) must contain at least ONE of the values specified with the "contains_one_of" param
{
contains_one_of = {
type = "array",
elements = {
type = "string",
},
default = {},
},
},
-- This claim (array/table) must NOT contain ANY of the values specified with the "contains_none_of" param
{
contains_none_of = {
type = "array",
elements = {
type = "string",
},
default = {},
},
},
-- This claim must match the value specified with the "equals" param
{
equals = {
type = "string",
},
},
-- This claim must NOT match the value specified with the "does_not_equal" param
{
does_not_equal = {
type = "string",
},
},
-- This claim must match at least ONE of the values specified with the "equals_one_of" param
{
equals_one_of = {
type = "array",
elements = {
type = "string",
},
default = {},
},
},
-- This claim must NOT match ANY of the values specified with the "equals_none_of" param
{
equals_none_of = {
type = "array",
elements = {
type = "string",
},
default = {},
},
},
},
entity_checks = {
{
at_least_one_of = { "output_header", "contains", "does_not_contain", "contains_one_of", "contains_none_of", "equals", "does_not_equal", "equals_one_of", "equals_none_of" },
},
},
},
},
},
},
},
},
}
}
|
-- P40 - [练习 1.33]
-- 递归版本
function filtered_accumulate(filter, combiner, null_value, term, a, next, b)
if a > b then
return null_value
elseif filter(a) then
return combiner(term(a), filtered_accumulate(filter, combiner, null_value, term, next(a), next, b))
else
return filtered_accumulate(filter, combiner, null_value, term, next(a), next, b)
end
end
-- 迭代版本
function filtered_accumulate_2(filter, combiner, null_value, term, a, next, b)
function iter(a, ret)
if a > b then
return ret
elseif filter(a) then
return iter(next(a), combiner(term(a), ret))
else
return iter(next(a), ret)
end
end
return iter(a, null_value)
end
-------------
-- 判断是否素数
function prime(n)
function square(x)
return x * x
end
function remainder(n, b)
return n % b
end
function smallest_divisor(n)
return find_divisor(n, 2)
end
function find_divisor(n, test_divisor)
if square(test_divisor) > n then
return n
elseif divides(test_divisor, n) then
return test_divisor
else
return find_divisor(n, test_divisor + 1)
end
end
function divides(a, b)
return remainder(b, a) == 0
end
return smallest_divisor(n) == n
end
-- 求 gcd
function gcd(a, b)
function remainder(a, b)
return a % b
end
if b == 0 then
return a
else
return gcd(b, remainder(a, b))
end
end
function identity(x)
return x
end
function inc(n)
return n + 1
end
function sum_combiner(a, b)
return a + b
end
function product_combiner(a, b)
return a * b
end
-------------
-- a) 求出 [a, b] 之间所有素数之和
function sum_prime(a, b)
return filtered_accumulate(prime, sum_combiner, 0, identity, a, inc, b)
end
-- b) 求小于 n 的所有与 n 互素的正整数之积
function product_coprime(n)
function filter(i)
return gcd(i, n) == 1
end
return filtered_accumulate_2(filter, product_combiner, 1, identity, 1, inc, n - 1)
end
-----------
function unit_test()
assert(sum_prime(2, 10) == 2 + 3 + 5 + 7)
assert(sum_prime(2, 20) == 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19)
assert(product_coprime(10) == 1 * 3 * 7 * 9)
assert(product_coprime(20) == 1 * 3 * 7 * 9 * 11 * 13 * 17 * 19)
end
unit_test()
|
ITEM.name = "Traffic Cone"
ITEM.desc = "A plastic old traffic cone"
ITEM.model = "models/props_junk/TrafficCone001a.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.money = {1, 4} |
local M = {};
local mod = require "mod";
mod.name = "Ants";
mod.dir = "Ants/";
mod.screenWidth = 640;
mod.screenHeight = 480;
local function InitAll()
ScreenInit(mod.screenWidth, mod.screenHeight);
PrimitiveInit();
TextureInit(IKDM_MEDIUM, 256);
SpriteInit(IKDM_MEDIUM, 256);
TtfInit(IKDM_SMALL, 32);
FontInit(IKDM_SMALL, 32);
AudioInit(IKDM_MEDIUM, 32, IKDM_SMALL, 32, AU_FREQ_DEFAULT,
AU_CHANNELS_DEFAULT, 1024);
KeyboardInit();
MouseInit();
GameControllerInit();
end;
M.InitAll = InitAll;
return M; |
-- Minetest: builtin/client/init.lua
local scriptpath = core.get_builtin_path()
local clientpath = scriptpath.."client"..DIR_DELIM
local commonpath = scriptpath.."common"..DIR_DELIM
dofile(clientpath .. "register.lua")
dofile(commonpath .. "after.lua")
dofile(commonpath .. "chatcommands.lua")
dofile(clientpath .. "chatcommands.lua")
dofile(commonpath .. "vector.lua")
dofile(clientpath .. "death_formspec.lua")
|
-- Version 1 by folk, zx64
-- To the extent possible under law, the authors have waived all copyright and related or neighboring rights to lib-reset.lua.
-- http://creativecommons.org/publicdomain/zero/1.0/
-- In laymans terms: "do whatever you want with this file and its content"
-- Credits: folk, zx64
--[[
USAGE DESCRIPTION
Somewhere in the control scope of your addon:
local function reset(event)
if not event or (not event.all and event.addon ~= "myaddon") then return end
reinitializeAllMyStuffFromScratchLikeItsANewGameOrWhatever()
for _, force in pairs(game.forces) do
for name, tech in pairs(force.technologies) do
if tech.valid and name == "mytech" and tech.researched then
enableTurtlesAllTheWayDown()
end
end
end
end
require("lib-reset")(reset)
And then, ingame, players will be able to execute from the console:
To reset your addon specifically: /reset myaddon
To reset all addons registered with the library: /reset
--]]
local MAJOR, MINOR, register = "lib-reset", 1, true
local eventId
if remote.interfaces[MAJOR] then
local newId = remote.call(MAJOR, "getEventId")
if type(newId) ~= "nil" then eventId = newId
else error("Previous version of lib-reset did not pass on the registered event ID.") end
local version = remote.call(MAJOR, "version")
if type(version) == "number" and version <= MINOR then register = false
else
local cmd = remote.call(MAJOR, "registeredCommand")
if commands and type(cmd) == "string" then _G.commands.remove_command(cmd) end
remote.remove_interface(MAJOR)
print("More recent version of lib-reset has been detected.") --stdout print in case someone notices
end
end
if register then
local usedCommand
local notification = "%s ran a /reset addons command."
if type(eventId) ~= "number" then eventId = script.generate_event_name() end
local function runReset(input)
if type(input.parameter) == "string" then input.addon = input.parameter
else input.all = true end
script.raise_event(eventId, input)
if game and game.print then
if type(input) == "table" and input.player_index then game.print({"", notification:format(game.players[input.player_index].name)})
else game.print({"", "Someone ran a /reset addons command."}) end
end
end
remote.add_interface(MAJOR, {version=function() return MINOR end,registeredCommand=function() return usedCommand end, getEventId=function() return eventId end})
if commands then
for _, c in next, {"reset", "resetmod", "resetmods", "resetaddon", "resetaddons", "rstmds", "rstadd"} do
if not commands.commands[c] and not commands.game_commands[c] then
usedCommand = c
commands.add_command(c, "", runReset)
break
end
end
end
end
return function(f) script.on_event(eventId, f) end
|
--[[ ============================================================================================================
Author: Rook
Date: March 9, 2015
Called when Shock is cast.
Additional parameters: keys.DelayBeforeDamage
================================================================================================================= ]]
LinkLuaModifier("modifier_invoker_retro_shock_cast_range_calculator", "heroes/hero_invoker/invoker_retro_shock.lua", LUA_MODIFIER_MOTION_NONE)
modifier_invoker_retro_shock_cast_range_calculator = class({})
function modifier_invoker_retro_shock_cast_range_calculator:IsHidden() return true end
function modifier_invoker_retro_shock_cast_range_calculator:IsPurgable() return false end
function modifier_invoker_retro_shock_cast_range_calculator:RemoveOnDeath() return false end
function modifier_invoker_retro_shock_cast_range_calculator:OnCreated()
self:GetAbility().hModifier = self
if IsServer() then
local hParent = self:GetParent()
if hParent:HasScepter() then
self:SetStackCount((hParent.iWexLevel+1)*self:GetAbility():GetSpecialValueFor('radius_level_wex')+self:GetAbility():GetSpecialValueFor('radius_base'))
else
self:SetStackCount((hParent.iWexLevel)*self:GetAbility():GetSpecialValueFor('radius_level_wex')+self:GetAbility():GetSpecialValueFor('radius_base'))
end
end
self:StartIntervalThink(0.04)
end
function modifier_invoker_retro_shock_cast_range_calculator:OnIntervalThink()
local hParent = self:GetParent()
if IsServer() and hParent.iWexLevel then
if hParent:HasScepter() then
self:SetStackCount((hParent.iWexLevel+1)*self:GetAbility():GetSpecialValueFor('radius_level_wex')+self:GetAbility():GetSpecialValueFor('radius_base'))
else
self:SetStackCount((hParent.iWexLevel)*self:GetAbility():GetSpecialValueFor('radius_level_wex')+self:GetAbility():GetSpecialValueFor('radius_base'))
end
end
end
invoker_retro_shock = class({})
function invoker_retro_shock:GetIntrinsicModifierName() return 'modifier_invoker_retro_shock_cast_range_calculator' end
function invoker_retro_shock:GetCastRange() return self.hModifier:GetStackCount() end
function invoker_retro_shock:OnSpellStart()
keys = {caster = self:GetCaster(), ability = self, DelayBeforeDamage = self:GetSpecialValueFor('delay_before_damage')}
local caster_origin = keys.caster:GetAbsOrigin()
local iWexLevel = keys.caster.iWexLevel
if keys.caster:HasScepter() then iWexLevel = iWexLevel+1 end
local damage = keys.ability:GetSpecialValueFor("damage_level_wex")*iWexLevel
local radius = keys.ability:GetSpecialValueFor("radius_base")+keys.ability:GetSpecialValueFor("radius_level_wex")*iWexLevel
keys.caster:EmitSound("retro_dota.shock_on_spell_start")
local nearby_enemy_units = FindUnitsInRadius(keys.caster:GetTeam(), caster_origin, nil, radius, DOTA_UNIT_TARGET_TEAM_ENEMY,
DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false)
--Display particle effects in the AoE and for each affected enemy.
local shock_particle_effect = ParticleManager:CreateParticle("particles/units/heroes/hero_invoker/invoker_retro_shock_ground.vpcf", PATTACH_ABSORIGIN, keys.caster)
ParticleManager:SetParticleControl(shock_particle_effect, 1, Vector(radius*1.12, 0, 0))
-- print(radius)
for i, individual_unit in ipairs(nearby_enemy_units) do
local shock_particle_effect_unit = ParticleManager:CreateParticle("particles/units/heroes/hero_invoker/invoker_retro_shock_lightning_bolt.vpcf", PATTACH_ABSORIGIN_FOLLOW, individual_unit)
ParticleManager:SetParticleControlEnt(shock_particle_effect_unit, 1, keys.caster, PATTACH_ABSORIGIN_FOLLOW, "follow_origin", caster_origin, false)
local shock_particle_effect_unit_2 = ParticleManager:CreateParticle("particles/units/heroes/hero_invoker/invoker_retro_shock_lightning_bolt.vpcf", PATTACH_ABSORIGIN_FOLLOW, individual_unit)
ParticleManager:SetParticleControlEnt(shock_particle_effect_unit_2, 1, individual_unit, PATTACH_ABSORIGIN_FOLLOW, "follow_origin", individual_unit:GetAbsOrigin(), false)
individual_unit:EmitSound("Hero_razor.lightning")
end
--Dispel and damage the affected units after a delay.
Timers:CreateTimer({
endTime = keys.DelayBeforeDamage,
callback = function()
for i, individual_unit in ipairs(nearby_enemy_units) do
--Purge(bool RemovePositiveBuffs, bool RemoveDebuffs, bool BuffsCreatedThisFrameOnly, bool RemoveStuns, bool RemoveExceptions)
individual_unit:Purge(true, false, false, false, false)
ApplyDamageTestDummy({victim = individual_unit, attacker = keys.caster, damage = damage, damage_type = DAMAGE_TYPE_MAGICAL,})
end
end
})
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.