content
stringlengths
5
1.05M
-- Cutter: A Spiderling that can cut existing Webs. -- DO NOT MODIFY THIS FILE -- Never try to directly create an instance of this class, or modify its member variables. -- Instead, you should only be reading its variables and calling its functions. local class = require("joueur.utilities.class") local Spiderling = require("games.spiders.spiderling") -- <<-- Creer-Merge: requires -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs. -- you can add additional require(s) here -- <<-- /Creer-Merge: requires -->> --- A Spiderling that can cut existing Webs. -- @classmod Cutter local Cutter = class(Spiderling) -- initializes a Cutter with basic logic as provided by the Creer code generator function Cutter:init(...) Spiderling.init(self, ...) -- The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has. --- The Web that this Cutter is trying to cut. nil if not cutting. self.cuttingWeb = nil --- (inherited) When empty string this Spiderling is not busy, and can act. Otherwise a string representing what it is busy with, e.g. 'Moving', 'Attacking'. -- @field[string] self.busy -- @see Spiderling.busy --- (inherited) String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data. -- @field[string] self.gameObjectName -- @see GameObject.gameObjectName --- (inherited) A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set. -- @field[string] self.id -- @see GameObject.id --- (inherited) If this Spider is dead and has been removed from the game. -- @field[bool] self.isDead -- @see Spider.isDead --- (inherited) Any strings logged will be stored here. Intended for debugging. -- @field[{string, ...}] self.logs -- @see GameObject.logs --- (inherited) The Web this Spiderling is using to move. nil if it is not moving. -- @field[Web] self.movingOnWeb -- @see Spiderling.movingOnWeb --- (inherited) The Nest this Spiderling is moving to. nil if it is not moving. -- @field[Nest] self.movingToNest -- @see Spiderling.movingToNest --- (inherited) The Nest that this Spider is currently on. nil when moving on a Web. -- @field[Nest] self.nest -- @see Spider.nest --- (inherited) The number of Spiderlings busy with the same work this Spiderling is doing, speeding up the task. -- @field[number] self.numberOfCoworkers -- @see Spiderling.numberOfCoworkers --- (inherited) The Player that owns this Spider, and can command it. -- @field[Player] self.owner -- @see Spider.owner --- (inherited) How much work needs to be done for this Spiderling to finish being busy. See docs for the Work forumla. -- @field[number] self.workRemaining -- @see Spiderling.workRemaining end --- Cuts a web, destroying it, and any Spiderlings on it. -- @tparam Web web The web you want to Cut. Must be connected to the Nest this Cutter is currently on. -- @treturn bool True if the cut was successfully started, false otherwise. function Cutter:cut(web) return not not (self:_runOnServer("cut", { web = web, })) end --- (inherited) Attacks another Spiderling -- @function Cutter:attack -- @see Spiderling:attack -- @tparam Spiderling spiderling The Spiderling to attack. -- @treturn bool True if the attack was successful, false otherwise. --- (inherited) Adds a message to this GameObject's logs. Intended for your own debugging purposes, as strings stored here are saved in the gamelog. -- @function Cutter:log -- @see GameObject:log -- @tparam string message A string to add to this GameObject's log. Intended for debugging. --- (inherited) Starts moving the Spiderling across a Web to another Nest. -- @function Cutter:move -- @see Spiderling:move -- @tparam Web web The Web you want to move across to the other Nest. -- @treturn bool True if the move was successful, false otherwise. -- <<-- Creer-Merge: functions -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs. -- if you want to add any client side logic this is where you can add them -- <<-- /Creer-Merge: functions -->> return Cutter
require('abilities/swiper/boss_swiper_swipe') function Spawn( entityKeyValues ) if thisEntity == nil then return end if IsServer() == false then return end thisEntity.hThrustAbility = thisEntity:FindAbilityByName( "boss_swiper_thrust" ) thisEntity.hFrontswipeAbility = thisEntity:FindAbilityByName( "boss_swiper_frontswipe" ) thisEntity.hBackswipeAbility = thisEntity:FindAbilityByName( "boss_swiper_backswipe" ) thisEntity.hReapersRushAbility = thisEntity:FindAbilityByName( "boss_swiper_reapers_rush" ) thisEntity.retreatDelay = 6.0 thisEntity:SetContextThink( "SwiperBossThink", SwiperBossThink, 1 ) end function SwiperBossThink() if GameRules:IsGamePaused() == true or GameRules:State_Get() == DOTA_GAMERULES_STATE_POST_GAME or thisEntity:IsAlive() == false then return 1 end -- if not thisEntity:IsIdle() then -- return 1.0 -- end if not thisEntity.bInitialized then thisEntity.vInitialSpawnPos = thisEntity:GetOrigin() thisEntity.bInitialized = true thisEntity.bHasAgro = false thisEntity.fAgroRange = thisEntity:GetAcquisitionRange() thisEntity:SetIdleAcquire(false) thisEntity:SetAcquisitionRange(0) end local enemies = FindUnitsInRadius( thisEntity:GetTeamNumber(), thisEntity:GetOrigin(), nil, 1000, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, FIND_CLOSEST, false ) local hasDamageThreshold = thisEntity:GetMaxHealth() - thisEntity:GetHealth() > (thisEntity.BossTier or 1) * BOSS_AGRO_FACTOR local fDistanceToOrigin = ( thisEntity:GetOrigin() - thisEntity.vInitialSpawnPos ):Length2D() if (fDistanceToOrigin < 10 and thisEntity.bHasAgro and #enemies == 0) then thisEntity.bHasAgro = false thisEntity:SetIdleAcquire(false) thisEntity:SetAcquisitionRange(0) return 2 elseif (hasDamageThreshold and #enemies > 0) then if not thisEntity.bHasAgro then thisEntity.bHasAgro = true thisEntity:SetIdleAcquire(true) thisEntity:SetAcquisitionRange(thisEntity.fAgroRange) end end if not thisEntity.bHasAgro or #enemies == 0 or fDistanceToOrigin > BOSS_LEASH_SIZE then if fDistanceToOrigin > 10 then return RetreatHome() end return 1 end local canUseRush = true local canUseTeleport = false if thisEntity:GetHealth() / thisEntity:GetMaxHealth() > 0.75 then -- phase 1 canUseRush = false elseif thisEntity:GetHealth() / thisEntity:GetMaxHealth() > 0.5 then -- phase 2 canUseRush = true else canUseTeleport = true end -- canUseRush = true -- Swipe local swipeRange = thisEntity.hFrontswipeAbility:GetCastRange(thisEntity:GetAbsOrigin(), thisEntity) if thisEntity.hFrontswipeAbility:IsCooldownReady() then local frontSwipeEnemies = FindUnitsInRadius( thisEntity:GetTeamNumber(), thisEntity:GetOrigin(), nil, swipeRange, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, FIND_CLOSEST, false ) if #frontSwipeEnemies >= thisEntity.hFrontswipeAbility:GetSpecialValueFor("min_targets") then thisEntity:SetForwardVector((frontSwipeEnemies[1]:GetAbsOrigin() - thisEntity:GetAbsOrigin()):Normalized()) return CastFrontswipe(frontSwipeEnemies[1]:GetAbsOrigin()) end end -- Thrust local thrustRange = thisEntity.hThrustAbility:GetSpecialValueFor("range") local thrustWidth = thisEntity.hThrustAbility:GetSpecialValueFor("width") local thrustMinRange = thisEntity.hThrustAbility:GetSpecialValueFor("target_min_range") local thrustTarget local thrustCount = 0 if thisEntity.hThrustAbility:IsCooldownReady() then for k,v in pairs(enemies) do local d = (v:GetAbsOrigin() - thisEntity:GetAbsOrigin()):Length2D() if d < thrustRange and d > thrustMinRange then local thrustEnemies = FindUnitsInLine( thisEntity:GetTeamNumber(), thisEntity:GetAbsOrigin(), v:GetAbsOrigin(), nil, thrustWidth, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_ALL, DOTA_UNIT_TARGET_FLAG_NONE) if #thrustEnemies > thrustCount then thrustCount = #thrustEnemies thrustTarget = v:GetAbsOrigin() end end end if thrustTarget then return CastThrust( thrustTarget ) end end -- Reaper's Rush local reapersMinRange = thisEntity.hReapersRushAbility:GetSpecialValueFor("min_range") local reapersMaxRange = thisEntity.hReapersRushAbility:GetSpecialValueFor("max_range") local reapersRushRadius = thisEntity.hReapersRushAbility:GetSpecialValueFor("radius") local reapersRushTarget local moveToTarget local reapersRushCount = 0 for k,v in pairs(enemies) do local d = (v:GetAbsOrigin() - thisEntity:GetAbsOrigin()):Length2D() local closeEnemies = FindUnitsInRadius( thisEntity:GetTeamNumber(), v:GetOrigin(), nil, reapersRushRadius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_FOW_VISIBLE, FIND_CLOSEST, false) if #closeEnemies > reapersRushCount then if d < reapersMaxRange and d > reapersMinRange then reapersRushCount = #closeEnemies reapersRushTarget = v end moveToTarget = v end end if thisEntity.hReapersRushAbility:IsCooldownReady() and reapersRushCount > 0 and reapersRushTarget and canUseRush then return CastReapersRush( reapersRushTarget:GetAbsOrigin() ) end if moveToTarget and thisEntity:IsIdle() then ExecuteOrderFromTable({ UnitIndex = thisEntity:entindex(), OrderType = DOTA_UNIT_ORDER_MOVE_TO_TARGET, TargetIndex = moveToTarget:entindex() }) end return 0.5 end function RetreatHome() ExecuteOrderFromTable({ UnitIndex = thisEntity:entindex(), OrderType = DOTA_UNIT_ORDER_MOVE_TO_POSITION, Position = thisEntity.vInitialSpawnPos }) return thisEntity.retreatDelay end function CastFrontswipe( position ) ExecuteOrderFromTable({ UnitIndex = thisEntity:entindex(), OrderType = DOTA_UNIT_ORDER_CAST_POSITION, AbilityIndex = thisEntity.hFrontswipeAbility:entindex(), Position = position }) local delay = thisEntity.hFrontswipeAbility:GetCastPoint() + 1.0 if RandomInt(1,4) == 1 then -- thisEntity.hFrontswipeAbility:StartCooldown(8.0) Timers:CreateTimer(delay - 0.9, function ( ) if not IsValidEntity(thisEntity) or not thisEntity:IsAlive() then return end thisEntity.hFrontswipeAbility:StartCooldown(thisEntity.hFrontswipeAbility:GetCooldownTime() * 2) thisEntity:Stop() ExecuteOrderFromTable({ UnitIndex = thisEntity:entindex(), OrderType = DOTA_UNIT_ORDER_CAST_NO_TARGET, AbilityIndex = thisEntity.hBackswipeAbility:entindex(), }) end) return delay * 2 else return delay end end function CastThrust( position ) ExecuteOrderFromTable({ UnitIndex = thisEntity:entindex(), OrderType = DOTA_UNIT_ORDER_CAST_POSITION, AbilityIndex = thisEntity.hThrustAbility:entindex(), Position = position, }) return thisEntity.hThrustAbility:GetCastPoint() + 1.0 end function CastReapersRush( position ) ExecuteOrderFromTable({ UnitIndex = thisEntity:entindex(), OrderType = DOTA_UNIT_ORDER_CAST_POSITION, AbilityIndex = thisEntity.hReapersRushAbility:entindex(), Position = position, }) return thisEntity.hReapersRushAbility:GetCastPoint() + 1.0 end
local Name, Addon = ... local L = LibStub("AceLocale-3.0"):GetLocale(Name) local AceGUI = LibStub("AceGUI-3.0") local GUI, Models, Options, Store, Util = Addon.GUI, Addon.Models, Addon.Options, Addon.Store, Addon.Util local Self = GUI.Main.Tasks Self.COLOR_SELECTED = {1, 1, 1, .5} Self.COLOR_CHECKED = {1, 1, 1, .2} Self.frames = {} Self.checked = {} Self.selected = nil Self.tasks = Util.Tbl() ------------------------------------------------------- -- Show/Hide -- ------------------------------------------------------- -- Show the frame function Self.Show() if not Self.frames.container then Self.frames.container = GUI("SimpleGroup") .SetParent(GUI.Main.frames.main) .SetAllPoints() .SetLayout(nil)() Self.Update() end Self.frames.container.frame:Show() end -- Check if the frame is currently being shown function Self.IsShown() return Self.frames.container and Self.frames.container.frame:IsShown() end -- Hide the frame function Self.Hide() if Self.IsShown() then Self.frames.container.frame:Hide() end end -- Toggle the frame function Self.Toggle() if Self.IsShown() then Self.Hide() else Self.Show() end end ------------------------------------------------------- -- Update -- ------------------------------------------------------- function Self.Update() local parent = Self.frames.container local detailsWidth = 300 local header = Util.Tbl("", "ITEMS", "CHARACTER", "LOCATION", "AMOUNT") local list, details = Self.frames.list, Self.frames.details if #parent.children == 0 then local title, btn -- List title title = GUI("Label") .SetFontObject(GameFontNormalLarge) .SetText(L["TASKS"]) .AddTo(parent) .SetPoint("TOPLEFT", 3, -3)() -- List buttons btn = GUI("Button") .SetAutoWidth(true) .SetText("-") .AddTo(parent) .SetPoint("TOPRIGHT", -detailsWidth, 1, 0) .SetCallback("OnClick", Self.OnRemoveClick)() btn = GUI("Button") .SetAutoWidth(true) .SetText("+") .AddTo(parent) .SetPoint("TOPRIGHT", btn.frame, "TOPLEFT", -2, 0) .SetCallback("OnClick", Self.OnAddClick)() -- List list = GUI("ScrollFrame") .SetLayout("RS_Table") .SetUserData("table", { space = 10, columns = {20, 1, 1, 1, {25, 100}} }) .AddTo(parent) .SetPoint("TOPLEFT", title.frame, "BOTTOMLEFT", 0, -5) .SetPoint("BOTTOMRIGHT", -detailsWidth, 0) .SetCallback("OnRowClick", function (self, _, row, btn) local task = Self.tasks[row] if task and btn == "LeftButton" then Self.Select(task) end end) .PauseLayout()() GUI.TableRowBackground(list, Self.ListRowBackground, #header) GUI.TableRowHighlight(list, #header) GUI.TableRowClick(list, #header) Self.frames.list = list -- List header for i,v in ipairs(header) do GUI("Label").SetFontObject(GameFontNormal).SetText(L[v]).SetColor(1, 0.82, 0).AddTo(list) end -- Details title title = GUI("Label") .SetFontObject(GameFontNormalLarge) .SetText(L["DETAILS"]) .AddTo(parent) .SetPoint("TOPLEFT", parent.frame, "TOPRIGHT", -detailsWidth + 5, -3)() -- Details details = GUI("ScrollFrame") .SetLayout("Flow") .AddTo(parent) .SetPoint("TOPLEFT", title.frame, "BOTTOMLEFT") .SetPoint("BOTTOMRIGHT")() Self.frames.details = details else list:PauseLayout() end -- LIST local children = list.children local it = Util.Iter(#header) Util.TblRelease(Self.tasks) Self.tasks = Models.Task:Query().List()() if not Self.tasks or #Self.tasks == 0 then -- TODO else for i,task in ipairs(Self.tasks) do if not children[it(0) + 1] then -- Checkbox local cb = GUI("CheckBox") .SetWidth(14).SetHeight(14) .SetCallback("OnValueChanged", function (self) local id = self:GetUserData("id") if id then Self.checked[id] = self:GetValue() and true or nil list:UpdateRowBackgrounds() end end) .AddTo(list)() cb.checkbg:SetSize(14, 14) cb.checkbg:SetPoint("TOPLEFT", 2, 0) cb.checkbg:SetTexCoord(0.15, 0.85, 0.15, 0.85) cb.check:SetTexCoord(0.15, 0.85, 0.15, 0.85) cb.OnRelease = GUI.ResetCheckBox -- Item GUI.CreateItemLabel(list, "ANCHOR_RIGHT") -- Character GUI("Label").SetFontObject(GameFontNormal).AddTo(list) -- Location GUI("Label").SetFontObject(GameFontNormal).AddTo(list) -- Amount GUI("Label").SetFontObject(GameFontNormal).AddTo(list) end -- Checkbox GUI(children[it()]) .SetValue(Self.checked[task.id]) .SetUserData("id", task.id) .Show() -- Item GUI(children[it()]) .SetImage(task.item and task.item.texture or "") .SetText(task.item and task.item.link or "-") .SetUserData("link", task.item and task.item.link or nil) .Show() -- Character GUI(children[it()]).SetText(task.char).Show() -- Location GUI(children[it()]).SetText(task.loc).Show() -- Amount GUI(children[it()]).SetText(task.amount).Show() end end -- Release the rest while children[it()] do children[it(0)]:Release() children[it(0)] = nil end -- Cleanup and layout Util.TblRelease(header) list:ResumeLayout() list:DoLayout() end function Self.Select(task) task = Models.Task:Decode(task) if not task then return end Self.selected = task.id if Self.frames.list then Self.frames.list:UpdateRowBackgrounds() end end ------------------------------------------------------- -- Helper -- ------------------------------------------------------- function Self.ListRowBackground(self, row) local task = Self.tasks[row] return task and ( task.id == Self.selected and Self.COLOR_SELECTED or Self.checked[task.id] and Self.COLOR_CHECKED ) end ------------------------------------------------------- -- Events -- ------------------------------------------------------- function Self.OnAddClick(frame) Models.Task():Store() Self.Update() end function Self.OnRemoveClick(frame) for id in pairs(Self.checked) do local task = Models.Task:Fetch(id) if task then task:Remove():Release() end end wipe(Self.checked) Self.Update() end
--[[ How does the script work? When the function useDrug() is called, it will check to see if the selected drug is already running. If the drug is already running, then it'll kill the timer and create a new timer with the doce time + the remaining time. If the drug isn't running, then it'll just create a new timer. The function will call: drugs[drugName].func.load ( ) to start the drug, even if it's already running. The script will call: drugs[drugName].func.unload ( ) to stop the running drug GLOBAL VARIABLES: drugs Type: Table For: Storing all the drugs, along with their variables and functions Drug variables are stored in: drugs[drugName].var Drug functions are stored in: drugs[drugName].func sx_ Type: Int For: Storing the clients X axis resolution sy_ Type: Int For: Storing the clients Y axis resolution sx: Type: Float For: Storing the clients X offset, to make the effects same in all resolution sy: Type: Float For: Storing the clients X offset, to make the effects same in all resolution ]] drugs = { } sx_, sy_ = guiGetScreenSize ( ) sx, sy = sx_/1280, sy_/720 local var = { } var.timers = { } var.rendering = false function useDrug ( drug, amount ) if ( localPlayer.interior ~= 0 or localPlayer.dimension ~= 0 ) then return false, "You need to be outside" end local drug = tostring ( drug ) if ( not drugs [ drug ] ) then return false end local d = drugs [ drug ] rTime = 0 if ( var.timers [ drug ] and isTimer ( var.timers [ drug ] ) ) then rTime = getTimerDetails ( var.timers [ drug ] ) killTimer ( var.timers [ drug ] ) var.timers [ drug ] = nil end drugs[drug].func.load ( ) var.timers[drug] = setTimer ( drugs [drug].func.unload, ((drugs[drug].info.timePerDoce*amount)*1000)+rTime, 1 ) if ( not var.rendering ) then addEventHandler ( "onClientRender", root, var.render ) var.rendering = true end end function var.render ( ) local id = 0 local remove = { } for i, v in pairs ( var.timers ) do if ( not v or not isTimer ( v ) ) then remove [ i ] = true else dxDrawRectangle ( sx*(300+(id*170)), sy*655, sx*160, sy*50, tocolor ( 0, 0, 0, 170 ) ) dxDrawText ( tostring ( i ) .. " - ".. tostring ( math.floor ( getTimerDetails ( v ) / 1000 ) ), sx*(300+(id*170)), sy*655, (sx*(300+(id*170)))+(sx*160), (sy*655)+(sy*50), tocolor ( 255, 255, 255, 255 ), 1.5, "default", "center", "center" ) id = id + 1 end end for i, v in pairs ( remove ) do var.timers [ i ] = nil end if ( id == 0 or not var.rendering ) then removeEventHandler ( "onClientRender", root, var.render ) var.rendering = false end end function table.len ( table ) local c = 0 for i, v in pairs ( table ) do c = c + 1 end return c end
#!/usr/bin/env tarantool local clock = require("clock") local fiber = require("fiber") local test = require("tap").test("clock") test:plan(36) test:ok(clock.time() > 0, "time") test:ok(clock.realtime() > 0, "realtime") test:ok(clock.thread() > 0, "thread") test:ok(clock.monotonic() > 0, "monotonic") test:ok(clock.proc() > 0, "proc") test:ok(fiber.time() > 0, "fiber.time") test:ok(fiber.clock() > 0, "fiber.clock") test:ok(clock.time64() > 0, "time64") test:ok(clock.realtime64() > 0, "realtime64") test:ok(clock.thread64() > 0, "thread64") test:ok(clock.monotonic64() > 0, "monotonic64") test:ok(clock.proc64() > 0, "proc64") test:ok(fiber.time64() > 0, "fiber.time64") test:ok(fiber.clock64() > 0, "fiber.clock64") test:ok(clock.monotonic() <= clock.monotonic(), "time is monotonic") test:ok(clock.monotonic64() <= clock.monotonic64(), "time is monotonic") test:ok(math.abs(clock.realtime() - os.time()) < 2, "clock.realtime ~ os.time") test:ok(fiber.time() == fiber.time(), "fiber.time is cached") test:ok(fiber.time64() == fiber.time64(), "fiber.time64 is cached") test:ok(fiber.clock() == fiber.clock(), "fiber.clock is cached") test:ok(fiber.clock64() == fiber.clock64(), "fiber.clock64 is cached") test:ok(fiber.clock() < (fiber.yield() or 0) + fiber.clock(), "fiber.clock is growing after yield") test:ok(fiber.clock64() < (fiber.yield() or 0) + fiber.clock64(), "fiber.clock64 is growing after yield") test:ok(math.abs(fiber.time() - tonumber(fiber.time64())/1e6) < 1, "fiber.time64 is in microseconds") test:ok(math.abs(fiber.clock() - tonumber(fiber.clock64())/1e6) < 1, "fiber.clock64 is in microseconds") test:ok(math.abs(clock.time() - tonumber(clock.time64())/1e9) < 1, "clock.time64 is in nanoseconds") test:ok(math.abs(clock.realtime() - tonumber(clock.realtime64())/1e9) < 1, "clock.realtime64 is in nanoseconds") test:ok(math.abs(clock.thread() - tonumber(clock.thread64())/1e9) < 1, "clock.thread64 is in nanoseconds") test:ok(math.abs(clock.proc() - tonumber(clock.proc64())/1e9) < 1, "clock.proc64 is in nanoseconds") local function subtract_future(func) local ts1 = func() fiber.sleep(0.001) return ts1 - func() end test:ok(subtract_future(clock.time64) < 0, "clock.time64() can be subtracted") test:ok(subtract_future(clock.realtime64) < 0, "clock.realtime64() can be subtracted") test:ok(subtract_future(clock.thread64) < 0, "clock.thread64() can be subtracted") test:ok(subtract_future(clock.monotonic64) < 0, "clock.monotonic64() can be subtracted") test:ok(subtract_future(clock.proc64) < 0, "clock.proc64() can be subtracted") test:ok(subtract_future(fiber.time64) < 0, "fiber.time64 can be subtracted") test:ok(subtract_future(fiber.clock64) < 0, "fiber.clock64 can be subtracted") os.exit(test:check() and 0 or 1)
local fs = fs local matches = { ["^"] = "%^", ["$"] = "%$", ["("] = "%(", [")"] = "%)", ["%"] = "%%", ["."] = "%.", ["["] = "%[", ["]"] = "%]", ["*"] = "%*", ["+"] = "%+", ["-"] = "%-", ["?"] = "%?", ["\0"] = "%z", } --- Escape a string for using in a pattern -- @tparam string pattern The string to escape -- @treturn string The escaped pattern local function escapePattern(pattern) return (pattern:gsub(".", matches)) end local function matchesLocal(root, path) return root == "" or path == root or path:sub(1, #root + 1) == root .. "/" end local function extractLocal(root, path) if root == "" then return path else return path:sub(#root + 2) end end local function copy(old) local new = {} for k, v in pairs(old) do new[k] = v end return new end --[[ Emulates a basic file system. This doesn't have to be too advanced as it is only for Howl's use The files is a list of paths to file contents, or true if the file is a directory. TODO: Override IO ]] local function makeEnv(root, files) -- Emulated filesystem (partially based of Oeed's) files = copy(files) local env env = { fs = { list = function(path) path = fs.combine(path, "") local list = fs.isDir(path) and fs.list(path) or {} if matchesLocal(root, path) then local pattern = "^" .. escapePattern(extractLocal(root, path)) if pattern ~= "^" then pattern = pattern .. '/' end pattern = pattern .. '([^/]+)$' for file, _ in pairs(files) do local name = file:match(pattern) if name then list[#list + 1] = name end end end return list end, exists = function(path) path = fs.combine(path, "") if fs.exists(path) then return true elseif matchesLocal(root, path) then return files[extractLocal(root, path)] ~= nil end end, isDir = function(path) path = fs.combine(path, "") if fs.isDir(path) then return true elseif matchesLocal(root, path) then return files[extractLocal(root, path)] == true end end, isReadOnly = function(path) path = fs.combine(path, "") if fs.exists(path) then return fs.isReadOnly(path) elseif matchesLocal(root, path) and files[extractLocal(root, path)] ~= nil then return true else return false end end, getName = fs.getName, getDir = fs.getDir, getSize = fs.getSize, getFreeSpace = fs.getFreeSpace, combine = fs.combine, -- TODO: This should be implemented move = fs.move, copy = fs.copy, makeDir = function(dir) end, delete = fs.delete, open = function(path, mode) path = fs.combine(path, "") if matchesLocal(root, path) then local localPath = extractLocal(root, path) if type(files[localPath]) == 'string' then local handle = {close = function()end} if mode == 'r' then local content = files[localPath] handle.readAll = function() return content end local line = 1 local lines handle.readLine = function() if not lines then -- Lazy load lines lines = {content:match((content:gsub("[^\n]+\n?", "([^\n]+)\n?")))} end if line > #lines then return nil else return lines[line] end line = line + 1 end return handle else error('Cannot write to read-only file.', 2) end end end return fs.open(path, mode) end }, loadfile = function(name) local file = env.fs.open(name, "r") if file then local func, err = load(file.readAll(), fs.getName(name), nil, env) file.close() return func, err end return nil, "File not found: "..name end, dofile = function(name) local file, e = env.loadfile(name, env) if file then return file() else error(e, 2) end end, } env._G = env env._ENV = env return setmetatable(env, {__index = _ENV or getfenv()}) end local function extract(root, files, from, to) local pattern = "^" .. escapePattern(extractLocal(root, from)) if pattern ~= "^" then pattern = pattern .. '/' end pattern = pattern .. '(.*)$' for file, contents in pairs(files) do local name = file:match(pattern) if name then print("Extracting " .. name) local handle = fs.open(fs.combine(to, name), "w") handle.write(contents) handle.close() end end end
-- -- find api -- a simple api for querying actors and components -- -- usage: -- -- you can specify the actor as directly or through an id -- -- local actor, comp1, comp2 = find(id , name1, name2) -- local comp1, comp2 = find(actor, name1, name2) -- -- if you want to bundle items together, you can use findp, where 'p' is for packed -- -- local info = findp(id, name1, name2) -- or findp(actor, name1, name2) -- print(info.actor) -- print(info.name1) -- print(info.name2) -- -- if you just want the actor you can do this -- -- local actor = find(id) -- -- if there was an error, the entire result is just nil (is this what we want?) -- -- local result, err = findp(id, ... ) -- if err then -- ... -- end -- -- if you think an error would be a bug, then you can call xfind or xfindp, which -- asserts that the error should be nil. You don't want to do this for things that -- can be edited and change at runtime, but sometimes it's better to make absolute -- sure that you're game is in some expected state -- -- I want to extent the 'x' functions such that, if a find fails, the game can still -- continue (instead of crashing the game and editor entirely. -- -- I am still experimenting with the api, perhaps the solution should be to remove -- 'x' functions entirely and just require that the caller check the result every -- time? I am going to need more experience with the system to make that decision. -- local FindErr = {} FindErr.noactor = 1 -- couldn't find actor in the world FindErr.badcomp = 2 -- could not recognize one of specified components FindErr.missingcomp = 3 -- could not find component on entity -- -- perhaps this would be better as a function -- local find_errors = {} find_errors[FindErr.noactor ] = { code = FindErr.noactor , msg = 'bad actor id' } find_errors[FindErr.badcomp ] = { code = FindErr.badcomp , msg = 'bad component' } find_errors[FindErr.missingcomp] = { code = FindErr.missingcomp, msg = 'missing component' } local log_find_err = false local function do_find(actor_or_actor_id, comps) assert(type(comps) == 'table') local err = nil local result = {} result.actor = actor_or_actor_id if type(actor_or_actor_id) == 'number' then result.actor = world.actors[actor_or_actor_id] if not result.actor then err = find_errors[noactor] end end if not result.actor then return nil end for _, c in pairs(comps) do if componenttab[c] then local comp = result.actor.components[c] if comp then result[c] = comp else err = find_errors[FindErr.missingcomp] end else err = find_errors[FindErr.badcomp] end end if err then result = nil if log_find_err then logger.err('find error (code ' .. err.code .. ') ' .. err.msg) end end return result, err end function findp(actor_or_id, ...) return do_find(actor_or_id, {...}) end function find(actor_or_id, ...) local result, err = do_find(actor_or_id, {...}) local r = nil if result then r = {} local the_args = {...} table.insert(r, result.actor) for i=1,#the_args do table.insert(r, result[the_args[i]]) end end return r end function xfindp(actor_or_id, ...) local result, _ = findp(actor_or_id, ...) assert(result ~= nil) return result end function xfind(actor_or_id, ...) local result, _ = find(actor_or_id, ...) assert(result ~= nil) local the_args = {...} -- -- I am not sure if you can unpack programmatically, but this solution isn't going to scale well -- with different variants of find -- perhaps I could use lua macros to make the unpacked version -- of functions, but I am not optimistic that that will be much better -- -- also, if I was using a statically typed language, this is what I'd probably do anyways, so maybe -- it's not that bad -- if #the_args == 0 then return result[1] elseif #the_args == 1 then return result[1], result[2] elseif #the_args == 2 then return result[1], result[2], result[3] elseif #the_args == 3 then return result[1], result[2], result[3], result[4] elseif #the_args == 4 then return result[1], result[2], result[3], result[4], result[5] elseif #the_args == 5 then return result[1], result[2], result[3], result[4], result[5], result[6] elseif #the_args == 6 then return result[1], result[2], result[3], result[4], result[5], result[6], result[7] else assert(false, 'too many args, add more branches?') end end
--[[ gamevar.lua version: 19.01.16 Copyright (C) 2018, 2019 Jeroen P. Broks This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ]] -- This may appear pretty awkward, but don't be fooled. This routine has been set up to make it easy to port scripts to other games of mine and also to port those game back here. -- This also contains features that can help me to easily substitute tags inside routines such as "BoxText" routines. So it does have a lot of advantages. local vars = { v={} } assert(Var==nil,"Sorry! GameVar can not be used when the variable Var has been used for something else") Var = {} function vars.D(self,tag,value) if prefixed(tag,'&') then self.v[tag]=value==true or value:upper(value)=='TRUE' elseif prefixed(tag,'%') then if type(value)==number then self.v[tag]=value else self.v[tag]=tonumber(value) or 0 end elseif prefixed(tag,'$') or prefixed(tag,'_') then self.v[tag]=""..value else error("Unknown tag type: "..tag) end end function Var.D(tag,value) vars:D(tag,value) end function vars.G(self,tag) return self.v[tag] or 0 end function Var.G(tag) return vars:G(tag) end function vars.C(self,tag) if prefixed(tag,"&") then if self.v[tag] then return 'TRUE' else return 'FALSE' end else if not self.v[tag] then return "" end return self.v[tag].."" end end function Var.C(tag) return vars:C(tag) end function vars.done(self,tag) assert(prefixed(tag,"&"),"Done function only works for booleans") local ret=self:G(tag)~=0 self:D(tag,true) return ret end function vars:BOOL(tag) if prefixed(tag,"&") then if self.v[tag] then return true else return false end else error("BOOL method only for & prefixed vars") end end function BoolVar(tag) return vars:BOOL(tag) end function Done(tag) return vars:done(tag) end Var.Done=Done function vars.kill(self,tag) self.v[tag]=nil end function Var.Kill(tag) vars:kill(tag) end function vars.clear(self) kv = {} for k,_ in pairs(self.v) do kv[#kv+1]=k end for k in each(kv) do self:kill(k) end end function Var.Clear() vars:clear() end function vars.S(self,str) local ret = str for k,_ in spairs(self.v) do ret = replace(ret,k,self:C(k)) end return ret end function Var.S(str) return vars:S(str) end function Inc(tag,value) assert( prefixed(tag,"%") , "Inc only works on number values" ) vars:D(tag,vars:G(tag)+(value or 1)) end function Dec(tag,value) assert( prefixed(tag,"%") , "Dec only works on number values" ) vars:D(tag,vars:G(tag)-(value or 1)) end function VarList() local ret = "" for k,v in spairs(vars.v) do ret = ret .. k .. " = "..(Var.C(k) or 'ERROR! NO VALUE FOUND!').."\n" end return ret end function Vars() local ret = {} for k,_ in spairs(vars.v) do ret[#ret+1]=k end return ret end function vars.TV(self,tag) return self.v[tag] end function Var.TV(tag) return vars:TV(tag) end local gv = { Var=Var, C=Var.C, D=Var.D,Done=Done,S=Var.S,G=Var.G, Kill=Var.Kill, Clear=Var.Clear, TV=Var.TV, Inc=Inc, Dec=Dec } return gv
local helpers = require('test.unit.helpers') local cimport = helpers.cimport local internalize = helpers.internalize local eq = helpers.eq local neq = helpers.neq local ffi = helpers.ffi local lib = helpers.lib local cstr = helpers.cstr local to_cstr = helpers.to_cstr local NULL = helpers.NULL local OK = helpers.OK local FAIL = helpers.FAIL require('lfs') cimport('string.h') local path = cimport('./src/nvim/path.h') -- import constants parsed by ffi local kEqualFiles = path.kEqualFiles local kDifferentFiles = path.kDifferentFiles local kBothFilesMissing = path.kBothFilesMissing local kOneFileMissing = path.kOneFileMissing local kEqualFileNames = path.kEqualFileNames local len = 0 local buffer = nil describe('path function', function() describe('path_full_dir_name', function() setup(function() lfs.mkdir('unit-test-directory') end) teardown(function() lfs.rmdir('unit-test-directory') end) function path_full_dir_name(directory, buffer, len) directory = to_cstr(directory) return path.path_full_dir_name(directory, buffer, len) end before_each(function() -- Create empty string buffer which will contain the resulting path. len = (string.len(lfs.currentdir())) + 22 buffer = cstr(len, '') end) it('returns the absolute directory name of a given relative one', function() local result = path_full_dir_name('..', buffer, len) eq(OK, result) local old_dir = lfs.currentdir() lfs.chdir('..') local expected = lfs.currentdir() lfs.chdir(old_dir) eq(expected, (ffi.string(buffer))) end) it('returns the current directory name if the given string is empty', function() eq(OK, (path_full_dir_name('', buffer, len))) eq(lfs.currentdir(), (ffi.string(buffer))) end) it('fails if the given directory does not exist', function() eq(FAIL, path_full_dir_name('does_not_exist', buffer, len)) end) it('works with a normal relative dir', function() local result = path_full_dir_name('unit-test-directory', buffer, len) eq(lfs.currentdir() .. '/unit-test-directory', (ffi.string(buffer))) eq(OK, result) end) end) describe('path_full_compare', function() function path_full_compare(s1, s2, cn) s1 = to_cstr(s1) s2 = to_cstr(s2) return path.path_full_compare(s1, s2, cn or 0) end local f1 = 'f1.o' local f2 = 'f2.o' before_each(function() -- create the three files that will be used in this spec io.open(f1, 'w').close() io.open(f2, 'w').close() end) after_each(function() os.remove(f1) os.remove(f2) end) it('returns kEqualFiles when passed the same file', function() eq(kEqualFiles, (path_full_compare(f1, f1))) end) it('returns kEqualFileNames when files that dont exist and have same name', function() eq(kEqualFileNames, (path_full_compare('null.txt', 'null.txt', true))) end) it('returns kBothFilesMissing when files that dont exist', function() eq(kBothFilesMissing, (path_full_compare('null.txt', 'null.txt'))) end) it('returns kDifferentFiles when passed different files', function() eq(kDifferentFiles, (path_full_compare(f1, f2))) eq(kDifferentFiles, (path_full_compare(f2, f1))) end) it('returns kOneFileMissing if only one does not exist', function() eq(kOneFileMissing, (path_full_compare(f1, 'null.txt'))) eq(kOneFileMissing, (path_full_compare('null.txt', f1))) end) end) describe('path_tail', function() function path_tail(file) local res = path.path_tail((to_cstr(file))) neq(NULL, res) return ffi.string(res) end it('returns the tail of a given file path', function() eq('file.txt', path_tail('directory/file.txt')) end) it('returns an empty string if file ends in a slash', function() eq('', path_tail('directory/')) end) end) describe('path_tail_with_sep', function() function path_tail_with_sep(file) local res = path.path_tail_with_sep((to_cstr(file))) neq(NULL, res) return ffi.string(res) end it('returns the tail of a file together with its separator', function() eq('///file.txt', path_tail_with_sep('directory///file.txt')) end) it('returns an empty string when given an empty file name', function() eq('', path_tail_with_sep('')) end) it('returns only the separator if there is a trailing separator', function() eq('/', path_tail_with_sep('some/directory/')) end) it('cuts a leading separator', function() eq('file.txt', path_tail_with_sep('/file.txt')) eq('', path_tail_with_sep('/')) end) it('returns the whole file name if there is no separator', function() eq('file.txt', path_tail_with_sep('file.txt')) end) end) describe('invocation_path_tail', function() -- Returns the path tail and length (out param) of the tail. -- Does not convert the tail from C-pointer to lua string for use with -- strcmp. function invocation_path_tail(invk) local plen = ffi.new('size_t[?]', 1) local ptail = path.invocation_path_tail((to_cstr(invk)), plen) neq(NULL, ptail) -- it does not change the output if len==NULL local tail2 = path.invocation_path_tail((to_cstr(invk)), NULL) neq(NULL, tail2) eq((ffi.string(ptail)), (ffi.string(tail2))) return ptail, plen[0] end -- This test mimics the intended use in C. function compare(base, pinvk, len) return eq(0, (ffi.C.strncmp((to_cstr(base)), pinvk, len))) end it('returns the executable name of an invocation given a relative invocation', function() local invk, len = invocation_path_tail('directory/exe a b c') compare("exe a b c", invk, len) eq(3, len) end) it('returns the executable name of an invocation given an absolute invocation', function() if ffi.os == 'Windows' then local invk, len = invocation_path_tail('C:\\Users\\anyone\\Program Files\\z a b') compare('z a b', invk, len) eq(1, len) else local invk, len = invocation_path_tail('/usr/bin/z a b') compare('z a b', invk, len) eq(1, len) end end) it('does not count arguments to the executable as part of its path', function() local invk, len = invocation_path_tail('exe a/b\\c') compare("exe a/b\\c", invk, len) eq(3, len) end) it('only accepts whitespace as a terminator for the executable name', function() local invk, len = invocation_path_tail('exe-a+b_c[]()|#!@$%^&*') eq('exe-a+b_c[]()|#!@$%^&*', (ffi.string(invk))) end) it('is equivalent to path_tail when args do not contain a path separator', function() local ptail = path.path_tail(to_cstr("a/b/c x y z")) neq(NULL, ptail) local tail = ffi.string(ptail) local invk, len = invocation_path_tail("a/b/c x y z") eq(tail, ffi.string(invk)) end) it('is not equivalent to path_tail when args contain a path separator', function() local ptail = path.path_tail(to_cstr("a/b/c x y/z")) neq(NULL, ptail) local invk, len = invocation_path_tail("a/b/c x y/z") neq((ffi.string(ptail)), (ffi.string(invk))) end) end) describe('path_next_component', function() function path_next_component(file) local res = path.path_next_component((to_cstr(file))) neq(NULL, res) return ffi.string(res) end it('returns', function() eq('directory/file.txt', path_next_component('some/directory/file.txt')) end) it('returns empty string if given file contains no separator', function() eq('', path_next_component('file.txt')) end) end) describe('path_shorten_fname', function() it('returns NULL if `full_path` is NULL', function() local dir = to_cstr('some/directory/file.txt') eq(NULL, (path.path_shorten_fname(NULL, dir))) end) it('returns NULL if the path and dir does not match', function() local dir = to_cstr('not/the/same') local full = to_cstr('as/this.txt') eq(NULL, (path.path_shorten_fname(full, dir))) end) it('returns NULL if the path is not separated properly', function() local dir = to_cstr('some/very/long/') local full = to_cstr('some/very/long/directory/file.txt') eq(NULL, (path.path_shorten_fname(full, dir))) end) it('shortens the filename if `dir_name` is the start of `full_path`', function() local full = to_cstr('some/very/long/directory/file.txt') local dir = to_cstr('some/very/long') eq('directory/file.txt', (ffi.string(path.path_shorten_fname(full, dir)))) end) end) end) describe('path_shorten_fname_if_possible', function() local cwd = lfs.currentdir() before_each(function() lfs.mkdir('ut_directory') end) after_each(function() lfs.chdir(cwd) lfs.rmdir('ut_directory') end) describe('path_shorten_fname_if_possible', function() it('returns shortened path if possible', function() lfs.chdir('ut_directory') local full = to_cstr(lfs.currentdir() .. '/subdir/file.txt') eq('subdir/file.txt', (ffi.string(path.path_shorten_fname_if_possible(full)))) end) it('returns `full_path` if a shorter version is not possible', function() local old = lfs.currentdir() lfs.chdir('ut_directory') local full = old .. '/subdir/file.txt' eq(full, (ffi.string(path.path_shorten_fname_if_possible(to_cstr(full))))) end) it('returns NULL if `full_path` is NULL', function() eq(NULL, (path.path_shorten_fname_if_possible(NULL))) end) end) end) describe('more path function', function() setup(function() lfs.mkdir('unit-test-directory'); io.open('unit-test-directory/test.file', 'w').close() -- Since the tests are executed, they are called by an executable. We use -- that executable for several asserts. absolute_executable = arg[0] -- Split absolute_executable into a directory and the actual file name for -- later usage. directory, executable_name = string.match(absolute_executable, '^(.*)/(.*)$') end) teardown(function() os.remove('unit-test-directory/test.file') lfs.rmdir('unit-test-directory') end) describe('vim_FullName', function() function vim_FullName(filename, buffer, length, force) filename = to_cstr(filename) return path.vim_FullName(filename, buffer, length, force) end before_each(function() -- Create empty string buffer which will contain the resulting path. len = (string.len(lfs.currentdir())) + 33 buffer = cstr(len, '') end) it('fails if given filename is NULL', function() local force_expansion = 1 local result = path.vim_FullName(NULL, buffer, len, force_expansion) eq(FAIL, result) end) it('uses the filename if the filename is a URL', function() local force_expansion = 1 local filename = 'http://www.neovim.org' local result = vim_FullName(filename, buffer, len, force_expansion) eq(filename, (ffi.string(buffer))) eq(OK, result) end) it('fails and uses filename if given filename contains non-existing directory', function() local force_expansion = 1 local filename = 'non_existing_dir/test.file' local result = vim_FullName(filename, buffer, len, force_expansion) eq(filename, (ffi.string(buffer))) eq(FAIL, result) end) it('concatenates given filename if it does not contain a slash', function() local force_expansion = 1 local result = vim_FullName('test.file', buffer, len, force_expansion) local expected = lfs.currentdir() .. '/test.file' eq(expected, (ffi.string(buffer))) eq(OK, result) end) it('concatenates given filename if it is a directory but does not contain a\n slash', function() local force_expansion = 1 local result = vim_FullName('..', buffer, len, force_expansion) local expected = lfs.currentdir() .. '/..' eq(expected, (ffi.string(buffer))) eq(OK, result) end) -- Is it possible for every developer to enter '..' directory while running -- the unit tests? Which other directory would be better? it('enters given directory (instead of just concatenating the strings) if possible and if path contains a slash', function() local force_expansion = 1 local result = vim_FullName('../test.file', buffer, len, force_expansion) local old_dir = lfs.currentdir() lfs.chdir('..') local expected = lfs.currentdir() .. '/test.file' lfs.chdir(old_dir) eq(expected, (ffi.string(buffer))) eq(OK, result) end) it('just copies the path if it is already absolute and force=0', function() local force_expansion = 0 local absolute_path = '/absolute/path' local result = vim_FullName(absolute_path, buffer, len, force_expansion) eq(absolute_path, (ffi.string(buffer))) eq(OK, result) end) it('fails and uses filename when the path is relative to HOME', function() local force_expansion = 1 local absolute_path = '~/home.file' local result = vim_FullName(absolute_path, buffer, len, force_expansion) eq(absolute_path, (ffi.string(buffer))) eq(FAIL, result) end) it('works with some "normal" relative path with directories', function() local force_expansion = 1 local result = vim_FullName('unit-test-directory/test.file', buffer, len, force_expansion) eq(OK, result) eq(lfs.currentdir() .. '/unit-test-directory/test.file', (ffi.string(buffer))) end) it('does not modify the given filename', function() local force_expansion = 1 local filename = to_cstr('unit-test-directory/test.file') -- Don't use the wrapper here but pass a cstring directly to the c -- function. local result = path.vim_FullName(filename, buffer, len, force_expansion) eq(lfs.currentdir() .. '/unit-test-directory/test.file', (ffi.string(buffer))) eq('unit-test-directory/test.file', (ffi.string(filename))) eq(OK, result) end) end) describe('append_path', function() it('joins given paths with a slash', function() local path1 = cstr(100, 'path1') local to_append = to_cstr('path2') eq(OK, (path.append_path(path1, to_append, 100))) eq("path1/path2", (ffi.string(path1))) end) it('joins given paths without adding an unnecessary slash', function() local path1 = cstr(100, 'path1/') local to_append = to_cstr('path2') eq(OK, path.append_path(path1, to_append, 100)) eq("path1/path2", (ffi.string(path1))) end) it('fails and uses filename if there is not enough space left for to_append', function() local path1 = cstr(11, 'path1/') local to_append = to_cstr('path2') eq(FAIL, (path.append_path(path1, to_append, 11))) end) it('does not append a slash if to_append is empty', function() local path1 = cstr(6, 'path1') local to_append = to_cstr('') eq(OK, (path.append_path(path1, to_append, 6))) eq('path1', (ffi.string(path1))) end) it('does not append unnecessary dots', function() local path1 = cstr(6, 'path1') local to_append = to_cstr('.') eq(OK, (path.append_path(path1, to_append, 6))) eq('path1', (ffi.string(path1))) end) it('copies to_append to path, if path is empty', function() local path1 = cstr(7, '') local to_append = to_cstr('/path2') eq(OK, (path.append_path(path1, to_append, 7))) eq('/path2', (ffi.string(path1))) end) end) describe('path_is_absolute_path', function() function path_is_absolute_path(filename) filename = to_cstr(filename) return path.path_is_absolute_path(filename) end it('returns true if filename starts with a slash', function() eq(OK, path_is_absolute_path('/some/directory/')) end) it('returns true if filename starts with a tilde', function() eq(OK, path_is_absolute_path('~/in/my/home~/directory')) end) it('returns false if filename starts not with slash nor tilde', function() eq(FAIL, path_is_absolute_path('not/in/my/home~/directory')) end) end) end)
CatalogueClearAll(); CreateNewMetricProject(); local liqcat =AddNewCatalogue("Fluid Process", ""); CatalogueAddType(liqcat, 'PIPE','PIPE_FITTING', 'PIPE_INSULATION','PIPE_FLANGE'); CatalogueAddType(liqcat ,"RECT_AS_TANK","VCYL_AS_TANK","HCYL_AS_TANK"); CatalogueAddType(liqcat , 'HYDRAULIC_APPLIANCE',"PUMP"); CatalogueAddType(liqcat, "GPVALVE","FCVALVE","TCVALVE","PRVALVE","PSVALVE","PBVALVE","CHVALVE"); local pipecat =AddNewCatalogue("Pipes", liqcat); CatalogueAddType(pipecat, 'PIPE','PIPE_FITTING','PIPE_INSULATION','PIPE_FLANGE'); local catb3610 =AddNewCatalogue("ASME/ANSI B36.10/19 - Carbon, Alloy and Stainless Steel Pipes", pipecat); CatalogueAddType(catb3610, 'PIPE'); local catb80 =AddNewCatalogue("ASTM B88 - Seamless Copper Water Tubes", pipecat); CatalogueAddType(catb80, 'PIPE'); local fitcat =AddNewCatalogue("Pipe Fittings", liqcat); CatalogueAddType( fitcat , 'PIPE_FITTING'); local flgcat =AddNewCatalogue("Pipe Flanges", liqcat); CatalogueAddType( flgcat , 'PIPE_FLANGE'); local gflgcat =AddNewCatalogue("Generic Flanges, ASME B16.5", flgcat); CatalogueAddType( gflgcat , 'PIPE_FLANGE'); local pincat =AddNewCatalogue("Pipe Insulations", liqcat); CatalogueAddType( pincat , 'PIPE_INSULATION'); local valvecat =AddNewCatalogue("Valves", liqcat); CatalogueAddType(valvecat, "GPVALVE","FCVALVE","TCVALVE","PRVALVE","PSVALVE","PBVALVE","CHVALVE"); local tankcat =AddNewCatalogue("Tanks", liqcat); CatalogueAddType( tankcat ,"RECT_AS_TANK","VCYL_AS_TANK","HCYL_AS_TANK","TANK_INSULATION"); local rtankcat =AddNewCatalogue("Generic Rectangular Tanks", tankcat); CatalogueAddType( rtankcat ,"RECT_AS_TANK"); local vctankcat =AddNewCatalogue("Generic Vertical Cylindrical Tanks", tankcat); CatalogueAddType( vctankcat,"VCYL_AS_TANK"); local hctankcat =AddNewCatalogue("Generic Horizontal Cylindrical Tanks", tankcat); CatalogueAddType( hctankcat,"HCYL_AS_TANK"); local tankincat =AddNewCatalogue("Tank Insulations", tankcat); CatalogueAddType( tankincat,"TANK_INSULATION"); local happcat =AddNewCatalogue("Hydraulic Appliances", liqcat); CatalogueAddType(happcat, 'HYDRAULIC_APPLIANCE',"PUMP"); local pumpcat =AddNewCatalogue( "Pumps", happcat); CatalogueAddType( pumpcat , "PUMP"); local centrpumpcat =AddNewCatalogue( "Generic Pumps",pumpcat); CatalogueAddType( centrpumpcat , "PUMP"); MaterialClearCollection(); MaterialAddtoCollection("CarbonSteel","S30") local matName = MaterialGetProperty("CarbonSteel",'NAME'); MaterialAddtoCollection("SS304","S40") local ss304matName = MaterialGetProperty("SS304",'NAME'); MaterialAddtoCollection("SS316","S60") local ss316matName = MaterialGetProperty("SS316",'NAME'); MaterialAddtoCollection("Copper","S90") local cmatName = MaterialGetProperty("Copper",'NAME'); MaterialAddtoCollection("GMW","S510") local gmwmatName = MaterialGetProperty("GMW",'NAME'); InputClear(); InputAddPoint(0,0,0); for ftag in CreateElement('PIPE_FITTING') do local elef_type = GetElementType(ftag); if elef_type=="PIPE_FITTING" then SetProperty(ftag,'KEYWORD_1',"Pipe fitting"); SetProperty(ftag,'MANUFACTURER',"Generic"); SetProperty(ftag,'FITTING_MATERIAL',"S30"); SetProperty(ftag,'NAME',"Generic pipe fitting, "..matName ); SetProperty(ftag,'KEYWORD_2',matName); SetProperty(ftag,'ABSOLUTE_ROUGHNESS',0.000045); local newprodfitf1 = ProductCreateFromElement(fitcat,ftag); SetProperty(ftag,'FITTING_MATERIAL',"S90"); SetProperty(ftag,'NAME',"Generic pipe fitting, "..cmatName ); SetProperty(ftag,'KEYWORD_2',cmatName); SetProperty(ftag,'ABSOLUTE_ROUGHNESS',0.0000015); local newprodfitf2 = ProductCreateFromElement(fitcat,ftag); ActivateProduct(newprodfitf1); end end InputAddPoint(1,0,0); local newprod1; for tag in CreateElement('PIPE') do local ele_type = GetElementType(tag); if ele_type=="PIPE" then SetProperty(tag,'MANUFACTURER',"Generic"); SetProperty(tag,'KEYWORD_1',matName.." Pipe"); SetProperty(tag,'KEYWORD_2',"ASME-ANSI B36.10"); SetProperty(tag,'PIPE_MATERIAL',"S30"); SetProperty(tag,'ABSOLUTE_ROUGHNESS',0.000045); local Schs= GetPipeDimensionsB3610(); for schi,schj in ipairs(Schs) do local sn = schj[1]; local subcat3610 =AddNewCatalogue(sn, catb3610); CatalogueAddType(subcat3610, 'PIPE'); for schi2,schj2 in ipairs(schj[2]) do SetProperty(tag,'NAME',matName.. " Pipe, ".. schj2[1] .."\" NPS, ".. sn..", ASME-ANSI B36.10" ); SetProperty(tag,'OUTSIDE_DIAMETER',schj2[2]); SetProperty(tag,'WALL_THICKNESS',schj2[3]); SetProperty(tag,'FITTING1LENGTH',schj2[2]*1.5); SetProperty(tag,'FITTING2LENGTH',schj2[2]*1.5); newprod1 = ProductCreateFromElement(subcat3610,tag); end end ActivateProduct(newprod1); SetProperty(tag,'KEYWORD_1',cmatName.." Seamless Pipe"); SetProperty(tag,'KEYWORD_2',"ASTM B88"); SetProperty(tag,'PIPE_MATERIAL',"S90"); SetProperty(tag,'ABSOLUTE_ROUGHNESS',0.0000015); Schs= GetPipeDimensionsB88(); for schi,schj in ipairs(Schs) do local sn = schj[1]; local subcatb80 =AddNewCatalogue(sn, catb80); CatalogueAddType(subcatb80, 'PIPE'); for schi2,schj2 in ipairs(schj[2]) do SetProperty(tag,'NAME',cmatName.. " Seamless Water Tube, ".. schj2[1] .."\" NPS, ".. sn..", ASTM B88" ); SetProperty(tag,'OUTSIDE_DIAMETER',schj2[2]); SetProperty(tag,'WALL_THICKNESS',schj2[3]); SetProperty(tag,'FITTING1LENGTH',schj2[2]*1.5); SetProperty(tag,'FITTING2LENGTH',schj2[2]*1.5); newprod1 = ProductCreateFromElement(subcatb80,tag); end end end end InputClear(); InputAddPoint(0,0,0); local pipeODs = GetOutsideDiametersB3610(); function GetPipeOD(ODs, NPS) for i, odi in ipairs(ODs) do if odi[1]==NPS then return odi[2] end end print("Can not find pipe OD: "..NPS) return 0; end for tag in CreateElement('PIPE_FLANGE') do local ele_type = GetElementType(tag); if ele_type=="PIPE_FLANGE" then SetProperty(tag,'MANUFACTURER',"Generic"); SetProperty(tag,'KEYWORD_1',"Pipe flange"); SetProperty(tag,'KEYWORD_2',matName); SetProperty(tag,'FLANGE_MATERIAL',"S30"); local fldims= GetFlangeDimensionsB165(); for i, flgj in ipairs(fldims) do local classname= flgj [1]; local classinfo = flgj[2]; local classcat =AddNewCatalogue("Class "..classname, gflgcat); CatalogueAddType(classcat, 'PIPE_FLANGE'); for j, sizej in ipairs(classinfo) do local nps= sizej[1]; local od= sizej[2]; local thk= sizej[3]; local bcd= sizej[4]; local bhd= sizej[5]; local bn= sizej[6]; local bs= sizej[7]; local ID= GetPipeOD(pipeODs, nps)+ 0.0015875; SetProperty(tag,'NAME',"Generic Flange, " ..matName..", Class "..classname..", "..nps.." NPS, ASME B16.5"); SetProperty(tag,'OUTSIDE_DIAMETER',od); SetProperty(tag,'WALL_THICKNESS',thk); SetProperty(tag,'BOLT_CIRCLE_DIAMETER',bcd); SetProperty(tag,'HOLE_DIAMETER',bhd); SetProperty(tag,'HOLE_NUMBER',bn); SetProperty(tag,'INSIDE_DIAMETER',ID); newprod1 = ProductCreateFromElement(classcat ,tag); end end end end local InsThck ={} InsThck[1] =0.125; InsThck[2] =0.25; InsThck[3] =0.375; InsThck[4] =0.5; InsThck[5] =0.75; InsThck[6] =1; InsThck[7] =1.5; InsThck[8] =2; local newprodpin; for i, thick in ipairs(InsThck) do for pintag in CreateElement("PIPE_INSULATION" ) do local ele_type = GetElementType( pintag ); if ele_type== "PIPE_INSULATION" then SetProperty(pintag,'MANUFACTURER',"Generic"); SetProperty(pintag,'KEYWORD_1',gmwmatName); SetProperty(pintag,'KEYWORD_2',"Pipe Insulation"); SetProperty(pintag,'NAME',"Pipe insulation, "..gmwmatName..", ".. Double2Fraction (thick).."\" thick" ); SetLayersCount(pintag, 1) SetLayerMaterialID(pintag,0,"S510"); SetLayerThickness(pintag,0,thick* 25.4 / 1000); newprodpin = ProductCreateFromElement(pincat ,pintag); end end ActivateProduct(newprodpin); end InputAddPoint(0,0,0); local valven = {}; valven[1]= "Check"; valven[2]= "Pressure Breaker"; valven[3]= "Pressure Reducing"; valven[4]= "Pressure Sustaining "; valven[5]= "Trottle Control"; valven[6]= "General Purpose"; valven[7]= "Flow Control"; local valvet = {}; valven["CHVALVE"]= "Check"; valven["PBVALVE"]= "Pressure Breaker"; valven["PRVALVE"]= "Pressure Reducing"; valven["PSVALVE"]= "Pressure Sustaining "; valven["TCVALVE"]= "Trottle Control"; valven["GPVALVE"]= "General Purpose"; valven["FCVALVE"]= "Flow Control"; valvet[1]= "CHVALVE"; valvet[2]= "PBVALVE"; valvet[3]= "PRVALVE"; valvet[4]= "PSVALVE"; valvet[5]= "TCVALVE"; valvet[6]= "GPVALVE"; valvet[7]= "FCVALVE"; for i,valvename in ipairs(valven) do local valvetag = valvet[i]; print(valvetag.." : "..valvename); for valtag in CreateElement( valvetag ) do local ele_type = GetElementType( valtag ); if ele_type== valvetag then SetProperty(valtag,'MANUFACTURER',"Generic"); SetProperty(valtag,'KEYWORD_1',matName); SetProperty(valtag,'KEYWORD_2',valvename.." Valve"); SetProperty(valtag,'VALVE_MATERIAL',"S30"); SetProperty(valtag,'ABSOLUTE_ROUGHNESS',0.000045); SetProperty(valtag,'NAME',"Generic "..valvename.." Valve, "..matName); SetProperty(valtag,'OUTSIDE_DIAM',0.25); SetProperty(valtag,'WALL_THICKNESS',0.03); print("Creating valve product:"..valvename); newprodv = ProductCreateFromElement(valvecat ,valtag); end end end InputClear(); InputAddPoint(0,0,0); function GenerateRectangularTankProduct(rttag, length, width, height,thickness, volume_gal, body_material_name ) SetProperty(rttag,'NAME',"Generic Rectangular atmospheric storage tank, "..volume_gal.." Gal, "..Round(length ,1).."x"..Round(width, 1).."x"..Round(height, 1).."m , ".. body_material_name); SetProperty(rttag,'KEYWORD_1',"rectangular atmospheric storage tank"); SetProperty(rttag,'KEYWORD_2',body_material_name); SetProperty(rttag,'MANUFACTURER',"Generic"); SetProperty(rttag,'TANK_WALL_MATERIAL',"S30"); SetProperty(rttag,'APPLIANCE_TYPE','GENERIC_RECTANGULAR_TANK') SetProperty(rttag,'LENGTH',length); SetProperty(rttag,'WIDTH',width); SetProperty(rttag,'HEIGHT',height); newprodfitf1 = ProductCreateFromElement(rtankcat,rttag); end for rttag in CreateElement('RECT_AS_TANK') do local elef_type = GetElementType(rttag); if elef_type=="RECT_AS_TANK" then GenerateRectangularTankProduct(rttag,1, 1, 1, 0.003175, 220, matName); GenerateRectangularTankProduct(rttag,1.373, 1.22, 0.61, 0.003175, 225, matName); GenerateRectangularTankProduct(rttag,1.474, 1.22, 0.61, 0.003175, 240, matName); GenerateRectangularTankProduct(rttag,1.525, 0.915, 0.815, 0.003175, 250, matName); GenerateRectangularTankProduct(rttag,1.22, 1.22, 0.915, 0.003175, 300, matName); GenerateRectangularTankProduct(rttag,1.5, 1, 1, 0.003175, 330, matName); GenerateRectangularTankProduct(rttag,1.1, 1, 1.5, 0.003175, 330, matName); GenerateRectangularTankProduct(rttag,1.22, 1.22, 1.067, 0.003175, 350, matName); GenerateRectangularTankProduct(rttag,1.525, 1.143, 0.915, 0.003175, 350, matName); GenerateRectangularTankProduct(rttag,1.22, 1.22, 1.22, 0.003175, 400, matName); GenerateRectangularTankProduct(rttag,2, 1, 1, 0.003175, 440, matName); GenerateRectangularTankProduct(rttag,1, 1, 2, 0.003175, 440, matName); GenerateRectangularTankProduct(rttag,1.5, 1.5, 1, 0.003175, 495, matName); GenerateRectangularTankProduct(rttag,1.5, 1, 1.5, 0.003175, 495, matName); GenerateRectangularTankProduct(rttag,1.83, 1.22, 1.017, 0.003175, 500, matName); GenerateRectangularTankProduct(rttag,2.5, 1, 1, 0.003175, 550, matName); GenerateRectangularTankProduct(rttag,1.83, 1.22, 1.22, 0.003175, 600, matName); GenerateRectangularTankProduct(rttag,2.135, 1.067, 1.22, 0.003175, 600, matName); GenerateRectangularTankProduct(rttag,1.5, 1, 2, 0.003175, 660, matName); GenerateRectangularTankProduct(rttag,2, 1, 1.5, 0.003175, 660, matName); GenerateRectangularTankProduct(rttag,2, 1.5, 1, 0.003175, 660, matName); GenerateRectangularTankProduct(rttag,2.135, 1.525, 0.915, 0.003175, 660, matName); GenerateRectangularTankProduct(rttag,3, 1, 1, 0.003175, 660, matName); GenerateRectangularTankProduct(rttag,1.5, 1.5, 1.5, 0.003175, 743, matName); GenerateRectangularTankProduct(rttag,2.135, 1.373, 1.22, 0.003175, 780, matName); GenerateRectangularTankProduct(rttag,2.44, 1.22, 1.22, 0.003175, 800, matName); GenerateRectangularTankProduct(rttag,2, 1, 2, 0.003175, 880, matName); GenerateRectangularTankProduct(rttag,2, 2, 1, 0.003175, 880, matName); GenerateRectangularTankProduct(rttag,4, 1, 1, 0.003175, 880, matName); GenerateRectangularTankProduct(rttag,1.5, 1.5, 2, 0.003175, 990, matName); GenerateRectangularTankProduct(rttag,3, 1, 1.5, 0.003175, 990, matName); GenerateRectangularTankProduct(rttag,2, 1.5, 1.5, 0.003175, 990, matName); GenerateRectangularTankProduct(rttag,3, 1.5, 1, 0.003175, 990, matName); GenerateRectangularTankProduct(rttag,2.44, 1.525, 1.22, 0.003175, 1000, matName); GenerateRectangularTankProduct(rttag,3.05, 1.22, 1.22, 0.003175, 1000, matName); GenerateRectangularTankProduct(rttag,5, 1, 1, 0.003175, 1100, matName); GenerateRectangularTankProduct(rttag,2.5, 2, 1, 0.003175, 1100, matName); GenerateRectangularTankProduct(rttag,2.5, 1, 2, 0.003175, 1100, matName); GenerateRectangularTankProduct(rttag,2.135, 1.83, 1.296, 0.003175, 1116, matName); GenerateRectangularTankProduct(rttag,3.05, 1.525, 1.22, 0.003175, 1250, matName); GenerateRectangularTankProduct(rttag,2, 1.5, 2, 0.003175, 1320, matName); GenerateRectangularTankProduct(rttag,2, 2, 1.5, 0.003175, 1320, matName); GenerateRectangularTankProduct(rttag,3, 1, 2, 0.003175, 1320, matName); GenerateRectangularTankProduct(rttag,3, 2, 1, 0.003175, 1320, matName); GenerateRectangularTankProduct(rttag,4, 1, 1.5, 0.003175, 1320, matName); GenerateRectangularTankProduct(rttag,4, 1.5, 1, 0.003175, 1320, matName); GenerateRectangularTankProduct(rttag,3, 1.5, 1.5, 0.003175, 1485, matName); GenerateRectangularTankProduct(rttag,3.05, 1.525, 1.525, 0.003175, 1500, matName); GenerateRectangularTankProduct(rttag,3.05, 1.83, 1.22, 0.003175, 1500, matName); GenerateRectangularTankProduct(rttag,3.5, 2, 1, 0.003175, 1540, matName); GenerateRectangularTankProduct(rttag,7, 1, 1, 0.003175, 1540, matName); GenerateRectangularTankProduct(rttag,2, 2, 2, 0.003175, 1760, matName); GenerateRectangularTankProduct(rttag,4, 2, 1, 0.003175, 1760, matName); GenerateRectangularTankProduct(rttag,2.595, 2.595, 1.22, 0.003175, 1800, matName); GenerateRectangularTankProduct(rttag,3, 2, 1.5, 0.003175, 1980, matName); GenerateRectangularTankProduct(rttag,3.05, 2.44, 1.22, 0.003175, 2000, matName); GenerateRectangularTankProduct(rttag,5, 2, 1, 0.003175, 2200, matName); GenerateRectangularTankProduct(rttag,5, 1, 2, 0.003175, 2200, matName); GenerateRectangularTankProduct(rttag,2.5, 2, 2, 0.003175, 2200, matName); end end function GenerateVerticalTankProduct(vcttag, diameter, height,thickness, volume_gal, body_material_name ) SetProperty(vcttag,'NAME',"Generic vertical cylindrical atmospheric storage tank, "..volume_gal.." Gal, "..Round(diameter ,1).."x"..Round(height, 1).."m , ".. body_material_name); SetProperty(vcttag,'KEYWORD_1',"vertical cylindrical atmospheric storage tank"); SetProperty(vcttag,'KEYWORD_2',body_material_name); SetProperty(vcttag,'MANUFACTURER',"Generic"); SetProperty(vcttag,'TANK_WALL_MATERIAL',"S30"); SetProperty(vcttag,'APPLIANCE_TYPE','GENERIC_VERTICAL_TANK') SetProperty(vcttag,'DIAMETER',diameter); SetProperty(vcttag,'HEIGHT',height); newprodfitf1 = ProductCreateFromElement(vctankcat,vcttag); end for vcttag in CreateElement('VCYL_AS_TANK') do local elef_type = GetElementType(vcttag); if elef_type=="VCYL_AS_TANK" then GenerateVerticalTankProduct(vcttag,0.762,1.2192, 0.002656, 150, matName); GenerateVerticalTankProduct(vcttag,0.9652,1.524, 0.002656, 300, matName); GenerateVerticalTankProduct(vcttag,1.2192,1.8288, 0.002656, 550, matName); GenerateVerticalTankProduct(vcttag,1.6256, 1.8288,0.003416 , 1000, matName); GenerateVerticalTankProduct(vcttag,1.6256,2.7432,0.004554 , 1500, matName); GenerateVerticalTankProduct(vcttag,1.6256,3.6576, 0.0047625 , 2000, matName); GenerateVerticalTankProduct(vcttag,1.6256,4.572, 0.0047625, 2500, matName); GenerateVerticalTankProduct(vcttag,1.8288,4.2672, 0.0047625, 3000, matName); GenerateVerticalTankProduct(vcttag,2.4384,3.3528, 0.0047625, 4000, matName); GenerateVerticalTankProduct(vcttag,2.4384,4.064, 0.0047625, 5000, matName); GenerateVerticalTankProduct(vcttag,2.4384,4.8768, 0.0047625, 6000, matName); GenerateVerticalTankProduct(vcttag,2.4384,6.5024, 0.0047625, 8000, matName); GenerateVerticalTankProduct(vcttag,3.048,4.2672, 0.0047625, 8000, matName); GenerateVerticalTankProduct(vcttag,3.2004, 4.8768, 0.0047625, 10000, matName); GenerateVerticalTankProduct(vcttag,3.2004,5.4864, 0.0047625, 12000, matName); GenerateVerticalTankProduct(vcttag,3.2004,7.3152, 0.0047625, 15000, matName); GenerateVerticalTankProduct(vcttag,3.2004,9.4488,0.00635 , 20000, matName); GenerateVerticalTankProduct(vcttag,3.6576,9.144, 0.00635, 25000, matName); GenerateVerticalTankProduct(vcttag,3.6576,10.668, 0.00635, 30000, matName); end end function GenerateHorizontalTankProduct(hcttag, diameter, length, thickness, volume_gal, body_material_name ) SetProperty(hcttag,'NAME',"Generic horizontal cylindrical atmospheric storage tank, "..volume_gal.." Gal, "..Round(diameter ,1).."x"..Round(length, 1).."m , ".. body_material_name); SetProperty(hcttag,'KEYWORD_1',"vertical cylindrical atmospheric storage tank"); SetProperty(hcttag,'KEYWORD_2',body_material_name); SetProperty(hcttag,'MANUFACTURER',"Generic"); SetProperty(hcttag,'TANK_WALL_MATERIAL',"S30"); SetProperty(hcttag,'APPLIANCE_TYPE','GENERIC_HORIZONTAL_TANK') SetProperty(hcttag,'DIAMETER',diameter); SetProperty(hcttag,'LENGTH',length); newprodfitf1 = ProductCreateFromElement(hctankcat,hcttag); end for hcttag in CreateElement('HCYL_AS_TANK') do local elef_type = GetElementType(hcttag); if elef_type=="HCYL_AS_TANK" then GenerateHorizontalTankProduct(hcttag,1.2192, 1.8288, 0.0047625, 550, matName); GenerateHorizontalTankProduct(hcttag,1.2192, 3.302, 0.0047625, 1000, matName); GenerateHorizontalTankProduct(hcttag,1.2192, 3.6322, 0.0047625, 1100, matName); GenerateHorizontalTankProduct(hcttag,1.2192, 4.7752, 0.0047625, 1500, matName); GenerateHorizontalTankProduct(hcttag,1.651, 2.7432, 0.0047625, 1500, matName); GenerateHorizontalTankProduct(hcttag,1.651, 3.6068, 0.0047625, 2000 , matName); GenerateHorizontalTankProduct(hcttag,1.651, 4.5212 , 0.0047625, 2500, matName); GenerateHorizontalTankProduct(hcttag,1.651, 5.3848 , 0.0047625, 3000 , matName); GenerateHorizontalTankProduct(hcttag,1.651, 7.2136 , 0.0047625, 4000 , matName); GenerateHorizontalTankProduct(hcttag,1.8288, 7.2136, 0.00635, 5000 , matName); GenerateHorizontalTankProduct(hcttag,2.1336, 5.3848, 0.00635, 5000 , matName); GenerateHorizontalTankProduct(hcttag,2.1336, 8.0772, 0.00635, 7500 , matName); GenerateHorizontalTankProduct(hcttag,2.4384, 5.9944, 0.00635, 7500 , matName); GenerateHorizontalTankProduct(hcttag,2.4384, 8.0772, 0.00635, 10000, matName); GenerateHorizontalTankProduct(hcttag,3.048, 5.1816, 0.00635, 10000, matName); GenerateHorizontalTankProduct(hcttag,2.4384,9.6012 , 0.00635, 12000, matName); GenerateHorizontalTankProduct(hcttag,3.048, 6.2992, 0.00635, 12000, matName); GenerateHorizontalTankProduct(hcttag,2.7432, 9.6012, 0.0079375, 15000, matName); GenerateHorizontalTankProduct(hcttag,3.048, 7.7724 , 0.0079375, 15000, matName); GenerateHorizontalTankProduct(hcttag,3.048,10.5156 , 0.0079375, 20000, matName); GenerateHorizontalTankProduct(hcttag,3.048, 12.954, 0.009525, 25000, matName); GenerateHorizontalTankProduct(hcttag,3.048,15.621 , 0.009525, 30000, matName); end end local newprodtin; for i, thick in ipairs(InsThck) do for tintag in CreateElement("TANK_INSULATION" ) do local ele_type = GetElementType( tintag ); if ele_type== "TANK_INSULATION" then SetProperty(tintag,'MANUFACTURER',"Generic"); SetProperty(tintag,'KEYWORD_1',gmwmatName); SetProperty(tintag,'KEYWORD_2',"Tank Insulation"); SetProperty(tintag,'NAME',"Tank insulation, "..gmwmatName..", ".. Double2Fraction (thick).."\" thick" ); SetLayersCount(tintag, 1) SetLayerMaterialID(tintag,0,"S510"); SetLayerThickness(tintag,0,thick* 25.4 / 1000); newprodtin = ProductCreateFromElement(tankincat ,tintag); end end ActivateProduct(newprodtin); end for tag in CreateElement('HYDRAULIC_APPLIANCE') do local ele_type = GetElementType(tag); if ele_type=="HYDRAULIC_APPLIANCE" then SetProperty(tag,'APPLIANCE_TYPE','GENERIC_HYDRAULIC_APPLIANCE'); SetProperty(tag,'LENGTH',0.75 ); SetProperty(tag,'WIDTH',0.75 ); SetProperty(tag,'HEIGHT',0.75 ); SetProperty(tag,'NAME','Generic Rectangular Hydraulic Appliance') SetProperty(tag,'PART_NUMBER','GHYA-001' ); SetProperty(tag,'SHAPE',0 ); local newprod1 = ProductCreateFromElement(happcat,tag); SetProperty(tag,'NAME','Generic Vertical Cylindrical Hydraulic Appliance') SetProperty(tag,'PART_NUMBER','GHYA-002' ); SetProperty(tag,'SHAPE',1 ); SetProperty(tag,'DIAMETER',0.75 ); local newprod1 = ProductCreateFromElement(happcat,tag); SetProperty(tag,'NAME','Generic Horizontal Cylindrical Hydraulic Appliance') SetProperty(tag,'PART_NUMBER','GHYA-003' ); SetProperty(tag,'SHAPE',2 ); local newprod1 = ProductCreateFromElement(happcat,tag); SetProperty(tag,'NAME','Generic Spherical Hydraulic Appliance') SetProperty(tag,'PART_NUMBER','GHYA-004' ); SetProperty(tag,'SHAPE',3 ); local newprod1 = ProductCreateFromElement(happcat,tag); end end for tag in CreateElement('PUMP') do local ele_type = GetElementType(tag); if ele_type=="PUMP" then InputClear(); InputAddElement(tag) local motor_tag="" for tagel in CreateElement('ELECTRIC_APPLIANCE') do local ele_type2 = GetElementType(tagel); if ele_type2=="ELECTRIC_APPLIANCE" then motor_tag=tagel; end end InputAddPoint(0,0,0); local inlet_tag="" for tag3 in CreateElement('PIPE_FITTING') do local ele_type3 = GetElementType(tag3); if ele_type3=="PIPE_FITTING" then inlet_tag=tag3; end end local outlet_tag="" for tag4 in CreateElement('PIPE_FITTING') do local ele_type4 = GetElementType(tag4); if ele_type4=="PIPE_FITTING" then outlet_tag=tag4; end end SetProperty(motor_tag,'NAME','Generic Electric Motor') SetProperty(motor_tag,'APPLIANCE_TYPE','GENERIC_ELECTRICAL_MOTOR') SetProperty(motor_tag,'SHAPE',0 ); SetProperty(motor_tag,'LENGTH',0.3 ); SetProperty(motor_tag,'WIDTH',0.5 ); SetProperty(motor_tag,'HEIGHT',0.3 ); SetProperty(motor_tag,'OFFSET_Z',-0.065 ); SetProperty(motor_tag,'CONNECTION_LENGTH' ,0.25 ); SetProperty(motor_tag,'VOLTAGE',115 ); SetProperty(motor_tag,'CURRENT',1.2 ); SetProperty(motor_tag,'POWER',300 ); SetProperty(motor_tag,'PART_NUMBER','GEM-001' ); SetProperty(inlet_tag,'KEYWORD_1',"Pump inlet"); SetProperty(inlet_tag,'MANUFACTURER',"Generic"); SetProperty(inlet_tag,'FITTING_MATERIAL',"S30"); SetProperty(inlet_tag,'NAME',"Generic pump inlet" ); SetProperty(inlet_tag,'KEYWORD_2',"pump inlet"); SetProperty(inlet_tag,'AUTOSIZE', false); SetProperty(inlet_tag,'OUTSIDE_DIAMETER', 0.168275); SetProperty(inlet_tag,'WALL_THICKNESS', 0.007112); SetProperty(inlet_tag,'CONNECTION_LENGTH', 0.04); SetProperty(inlet_tag,'SIDE', 1); SetProperty(inlet_tag,'OFFSET_X', 0); SetProperty(inlet_tag,'OFFSET_Z', 0); SetProperty(outlet_tag,'KEYWORD_1',"Pump outlet"); SetProperty(outlet_tag,'MANUFACTURER',"Generic"); SetProperty(outlet_tag,'FITTING_MATERIAL',"S30"); SetProperty(outlet_tag,'NAME',"Generic pump outlet" ); SetProperty(outlet_tag,'KEYWORD_2',"pump outlet"); SetProperty(outlet_tag,'AUTOSIZE', false); SetProperty(outlet_tag,'OUTSIDE_DIAMETER', 0.0889); SetProperty(outlet_tag,'WALL_THICKNESS', 0.005486); SetProperty(outlet_tag,'CONNECTION_LENGTH', -0.065); SetProperty(outlet_tag,'SIDE', 2); SetProperty(outlet_tag,'CONNECTION_ANGLE', 3.927); SetProperty(outlet_tag,'DIRECTION' , 2); SetProperty(tag,'NAME','Generic Centrifugal Pump 3x6') SetProperty(tag,'APPLIANCE_TYPE','GENERIC_CENTRIFUGAL_PUMP') SetProperty(tag,'PART_NUMBER','GCPU-001' ); SetProperty(tag,'LENGTH',0.1); SetProperty(tag,'DIAMETER',0.449); SetProperty(tag,'HEAD_FLOW_CURVE_FORMULA',"-249*x+28"); SetProperty(tag,'EFFICIENCY_FLOW_CURVE_FORMULA',"1"); SetProperty(tag,'MIN_FLOW',0.011); SetProperty(tag,'MAX_FLOW',0.047); SetProperty(tag,'MAX_HEAD',33); SetProperty(tag,'BODY_MATERIAL',"S30"); local newprod1 = ProductCreateFromElement(centrpumpcat,tag); ActivateProduct(newprod1); SetProperty(motor_tag,'LENGTH',0.3 ); SetProperty(motor_tag,'WIDTH',0.5 ); SetProperty(motor_tag,'HEIGHT',0.3 ); SetProperty(motor_tag,'OFFSET_Z',-0.065 ); SetProperty(motor_tag,'CONNECTION_LENGTH' ,0.25 ); SetProperty(motor_tag,'VOLTAGE',115 ); SetProperty(motor_tag,'CURRENT',1.2 ); SetProperty(motor_tag,'POWER',300 ); SetProperty(motor_tag,'PART_NUMBER','GEM-002' ); SetProperty(inlet_tag,'OUTSIDE_DIAMETER', 0.168275); SetProperty(inlet_tag,'WALL_THICKNESS', 0.007112); SetProperty(inlet_tag,'CONNECTION_LENGTH', 0.04); SetProperty(outlet_tag,'OUTSIDE_DIAMETER', 0.1143); SetProperty(outlet_tag,'WALL_THICKNESS', 0.00602); SetProperty(outlet_tag,'CONNECTION_LENGTH', -0.065); SetProperty(tag,'NAME','Generic Centrifugal Pump 4x6') SetProperty(tag,'PART_NUMBER','GCPU-002' ); SetProperty(tag,'LENGTH',0.125); SetProperty(tag,'DIAMETER',0.449); SetProperty(tag,'HEAD_FLOW_CURVE_FORMULA',"-191*x+28"); SetProperty(tag,'EFFICIENCY_FLOW_CURVE_FORMULA',"1"); SetProperty(tag,'MIN_FLOW',0.022); SetProperty(tag,'MAX_FLOW',0.0694); SetProperty(tag,'MAX_HEAD',33); local newprod2 = ProductCreateFromElement(centrpumpcat,tag); SetProperty(motor_tag,'LENGTH',0.3 ); SetProperty(motor_tag,'WIDTH',0.5 ); SetProperty(motor_tag,'HEIGHT',0.3 ); SetProperty(motor_tag,'OFFSET_Z',-0.065 ); SetProperty(motor_tag,'CONNECTION_LENGTH' ,0.25 ); SetProperty(motor_tag,'VOLTAGE',115 ); SetProperty(motor_tag,'CURRENT',1.2 ); SetProperty(motor_tag,'POWER',300 ); SetProperty(motor_tag,'PART_NUMBER','GEM-003' ); SetProperty(inlet_tag,'OUTSIDE_DIAMETER', 0.219075); SetProperty(inlet_tag,'WALL_THICKNESS', 0.008179); SetProperty(inlet_tag,'CONNECTION_LENGTH', 0.042); SetProperty(outlet_tag,'OUTSIDE_DIAMETER', 0.168275); SetProperty(outlet_tag,'WALL_THICKNESS', 0.007112); SetProperty(outlet_tag,'CONNECTION_LENGTH', -0.065); SetProperty(tag,'NAME','Generic Centrifugal Pump 6x8') SetProperty(tag,'PART_NUMBER','GCPU-003' ); SetProperty(tag,'LENGTH',0.221); SetProperty(tag,'DIAMETER',0.56); SetProperty(tag,'HEAD_FLOW_CURVE_FORMULA',"-103*x+25"); SetProperty(tag,'EFFICIENCY_FLOW_CURVE_FORMULA',"1"); SetProperty(tag,'MIN_FLOW',0.0416); SetProperty(tag,'MAX_FLOW',0.111); SetProperty(tag,'MAX_HEAD',28); local newprod3 = ProductCreateFromElement(centrpumpcat,tag); end end CatalogueSave( liqcat, "Fluid Process catalogue"); ListCatalogues();
--[[ Name: car_dealer.lua ----------------------------------------------------------------- -- @package VrZn - Custom Gamemode (SRP BASE) -- @author Nodge -- @build Beta 1 ----------------------------------------------------------------- ]]-- local NPCMeta = {} NPCMeta.Name = "Car Dealer" NPCMeta.UID = "car_dealer" NPCMeta.SubText = "Purchase a vehicle here" NPCMeta.Model = "models/alyx.mdl" NPCMeta.Sounds = { StartDialog = { "vo/eli_lab/al_thyristor02.wav", "vo/novaprospekt/al_gladtoseeyoureok.wav", }, EndDialog = { "vo/eli_lab/al_allright01.wav", "vo/novaprospekt/al_careofyourself.wav", } } function NPCMeta:OnPlayerTalk( entNPC, pPlayer ) GAMEMODE.Net:ShowNPCDialog( pPlayer, "car_dealer" ) if (entNPC.m_intLastSoundTime or 0) < CurTime() then local snd, _ = table.Random( self.Sounds.StartDialog ) entNPC:EmitSound( snd, 60 ) entNPC.m_intLastSoundTime = CurTime() +2 end end function NPCMeta:OnPlayerEndDialog( pPlayer ) if not pPlayer:WithinTalkingRange() then return end if pPlayer:GetTalkingNPC().UID ~= self.UID then return end if (pPlayer.m_entTalkingNPC.m_intLastSoundTime or 0) < CurTime() then local snd, _ = table.Random( self.Sounds.EndDialog ) pPlayer.m_entTalkingNPC:EmitSound( snd, 60 ) pPlayer.m_entTalkingNPC.m_intLastSoundTime = CurTime() +2 end pPlayer.m_entTalkingNPC = nil end function NPCMeta:ShowBuyCarMenu( pPlayer, ... ) if not pPlayer:WithinTalkingRange() then return end if pPlayer:GetTalkingNPC().UID ~= self.UID then return end GAMEMODE.Net:ShowNWMenu( pPlayer, "car_buy" ) end function NPCMeta:ShowSellCarMenu( pPlayer ) if not pPlayer:WithinTalkingRange() then return end if pPlayer:GetTalkingNPC().UID ~= self.UID then return end GAMEMODE.Net:ShowNWMenu( pPlayer, "car_sell" ) end function NPCMeta:ShowSpawnMenu( pPlayer, ... ) if not pPlayer:WithinTalkingRange() then return end if pPlayer:GetTalkingNPC().UID ~= self.UID then return end GAMEMODE.Net:ShowNWMenu( pPlayer, "car_spawn" ) end if SERVER then --RegisterDialogEvents is called when the npc is registered! This is before the gamemode loads so GAMEMODE is not valid yet. function NPCMeta:RegisterDialogEvents() GM.Dialog:RegisterDialogEvent( "car_dealer_buy", self.ShowBuyCarMenu, self ) GM.Dialog:RegisterDialogEvent( "car_dealer_sell", self.ShowSellCarMenu, self ) GM.Dialog:RegisterDialogEvent( "car_spawn_menu", self.ShowSpawnMenu, self ) end elseif CLIENT then function NPCMeta:RegisterDialogEvents() GM.Dialog:RegisterDialog( "car_dealer", self.StartDialog, self ) GM.Dialog:RegisterDialog( "car_spawn", self.StartDialog, self ) end function NPCMeta:StartDialog() GAMEMODE.Dialog:ShowDialog() GAMEMODE.Dialog:SetModel( self.Model ) GAMEMODE.Dialog:SetTitle( self.Name ) GAMEMODE.Dialog:SetPrompt( "Como posso ajudar?" ) GAMEMODE.Dialog:AddOption( "Quero comprar um carro.", function() GAMEMODE.Net:SendNPCDialogEvent( "car_dealer_buy" ) GAMEMODE.Dialog:HideDialog() end ) GAMEMODE.Dialog:AddOption( "Quero vender meu carro.", function() GAMEMODE.Net:SendNPCDialogEvent( "car_dealer_sell" ) GAMEMODE.Dialog:HideDialog() end ) GAMEMODE.Dialog:AddOption( "Quero spawnar meu carro.", function() GAMEMODE.Net:SendNPCDialogEvent( "car_spawn_menu" ) GAMEMODE.Dialog:HideDialog() end ) GAMEMODE.Dialog:AddOption( "Quero sair.", function() GAMEMODE.Net:SendNPCDialogEvent( self.UID.. "_end_dialog" ) GAMEMODE.Dialog:HideDialog() end ) end end GM.NPC:Register( NPCMeta )
return { id = "S002", mode = 2, scripts = { { actor = 900005, nameColor = "#a9f548", side = 0, say = "哇,萨福克萨福克,我们好厉害呀~一口气就解决了这么多敌人", shake = { speed = 1, number = 3 }, typewriter = { speed = 0.05, speedUp = 0.01 }, painting = { alpha = 0.3, time = 0.5 } }, { actor = 900312, nameColor = "#a9f548", expression = "11", side = 1, say = "别轻敌…这些明显只是铁血的杂鱼部队…而且到现在为止还没看到他们的新型战舰..我有种不好的预感…", shake = { speed = 1, number = 3 }, typewriter = { speed = 0.05, speedUp = 0.01 }, painting = { alpha = 0.3, time = 0.5 } }, { actor = 900009, side = 2, nameColor = "#ff0000", actorName = "?????", actorAlpha = 0, say = "哼哼哼,这条航线上果然被布置了伏兵呢,你们说的不详的预感就是指我们吗?", shake = { speed = 1, number = 999 }, typewriter = { speed = 0.05, speedUp = 0.01 }, painting = { alpha = 0, time = 1 } }, { expression = "13", side = 0, actor = 900312, nameColor = "#a9f548", say = "!!!注意,右舷方向!!!发现两艘大型军舰,航向220度,判断是铁血的新型战列舰!全员准备作战!", paintingFadeOut = { time = 0.5, side = 1 }, shake = { speed = 2, number = 3 }, typewriter = { speed = 0.03, speedUp = 0.01 }, painting = { alpha = 0.3, time = 0.5 } }, { actor = 900005, nameColor = "#a9f548", side = 0, say = "呜——", shake = { speed = 2, number = 3 }, painting = { alpha = 0.3, time = 0.5 } }, { actor = 900009, side = 1, actorName = "?????", nameColor = "#ff0000", actorAlpha = 0, say = "哎呀呀~不过是区区两艘巡洋舰,居然准备攻过来了,哼哼哼,那就让我好好的享用一番吧~", shake = { speed = 1, number = 3 }, typewriter = { speed = 0.05, speedUp = 0.01 }, painting = { alpha = 0, time = 0.5 } }, { actor = 900006, nameColor = "#a9f548", side = 0, say = "可不是区区两艘巡洋舰哦,皇家舰队胡德号,威尔士亲王号,迎敌!一起来场优雅的战斗吧~", shake = { speed = 2, number = 3 }, typewriter = { speed = 0.05, speedUp = 0.01 }, painting = { alpha = 0.3, time = 0.5 } } } }
help( [[ BWA is a software package for mapping low-divergent sequences against a large reference genome, such as the human genome. It consists of three algorithms: BWA-backtrack, BWA-SW and BWA-MEM. The first algorithm is designed for Illumina sequence reads up to 100bp, while the rest two for longer sequences ranged from 70bp to 1Mbp. BWA-MEM and BWA-SW share similar features such as long-read support and split alignment, but BWA-MEM, which is the latest, is generally recommended for high-quality queries as it is faster and more accurate. BWA-MEM also has better performance than BWA-backtrack for 70-100bp Illumina reads. ]]) whatis("Burrows-Wheeler Alignment Tool") local version = "2014" local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/bwa/"..version prepend_path("PATH", base) family('bwa')
--[[ Pixel Vision 8 - Boot Tool Copyright (C) 2017, Pixel Vision 8 (http://pixelvision8.com) Created by Jesse Freeman (@jessefreeman) Please do not copy and distribute verbatim copies of this license document, but modifications without distributing is allowed. ]]-- LoadScript("sb-sprites") LoadScript("boot-text") -- Get references to boot animation sprite data local bootSprites = { logoframe01, logoframe02, logoframe03, logoframe04, logoframe05, logoframe06, logoframe07, logoframe08, logoframe09, logoframe10, logoframe11, logoframe12, logoframe13, logoframe14, logoframe15, logoframe15, logoframe15, logoframe15, logoframe15, logoframe15 } -- Animation properties local animDelay = .1; local time = 0; local frame = 1; local done = false; local nextScreenDelay = .3 local nextScreenTime = 0 local startDelay = .5 local ready = false local bottomBorder = 224 + 8 local safeMode = false local showPlugin = -1 function Init() playSounds = ReadBiosData("PlaySystemSounds", "True") == "True" if(EnableAutoRun ~= nil) then EnableAutoRun(false) end if(EnableAutoRun ~= nil) then EnableBackKey(false) end -- Set the default background color BackgroundColor(5) local display = Display(false) -- We are going to render the message in a box as tiles. To do this, we need to wrap the -- text, then split it into lines and draw each line. local wrap = WordWrap(message, (display.x / 8) - 3) local lines = SplitLines(wrap) local total = #lines local startY = (240 + 16) / 8--((display.y * 2) + 16) / 8 --(((display.y * 2) / 8) - 7) - total - --176 448 local runnerName = SystemName() local runnerVer = "/"..SystemVersion() -- TODO we don't have a V char so use / instead local labelWidth = (#runnerName * 8) + (#runnerVer * 4) + 16 local startX = 256 - labelWidth DrawText(runnerName, startX, 225, DrawMode.TilemapCache, "large", 11) DrawText(runnerVer, startX + (#runnerName * 8) + 8, 225, DrawMode.TilemapCache, "small", 11, - 4) -- DrawText("Runner Version") -- We want to render the text from the bottom of the screen so we offset it and loop backwards. for i = 1, total do DrawText(lines[i], 1, startY + (i - 1), DrawMode.Tile, "large", 15) end -- Replace the tile with a logo and rest the color offset to 0 (since the font was set to 15) Tile(1, startY, logosmall.spriteIDs[1], 0) end function Update(timeDelta) -- Convert timeDelta to a float timeDelta = timeDelta / 1000 -- Track time of animation time = time + timeDelta shortcutTime = time + timeDelta if(Key(Keys.Escape)) then -- Trigger BootDone BootDone(safeMode) return end -- if(shortcutTime > shortcutDelay) then -- checkShortcuts = false -- end -- -- if(checkShortcuts == true) then -- end -- Test to see if we are ready to display the boot animation if(ready == false) then -- If the current time is less than the start delay exit the Update method if(time < startDelay) then return else -- If the time has passed, reset time for the next frame and change ready to true time = 0 ready = true if(playSounds) then -- Play the boot song PlayPattern(0, false) end end end -- If animation is past delay if(time > animDelay) then -- Reset animation time value time = 0 if(done == true)then local newScrollY = ScrollPosition().y if(newScrollY < bottomBorder) then newScrollY = newScrollY + math.floor(500 * timeDelta) if(newScrollY > bottomBorder) then newScrollY = bottomBorder end -- scroll background to new position ScrollPosition(0, newScrollY) -- Check that we are in boot mode else -- if(editorBridge.mode == 2) then nextScreenTime = nextScreenTime + timeDelta if(nextScreenTime > nextScreenDelay) then -- Trigger BootDone BootDone(safeMode) end end else -- Test to see if we are done if(frame < #bootSprites) then KeyPressCheck() -- Not done with animation, go to next frame frame = frame + 1 local sprite = bootSprites[frame] DrawSprites(sprite.spriteIDs, 10, 12, sprite.width, false, false, DrawMode.Tile) -- UpdateTiles(, ) elseif(done == false) then if(editors == nil) then editors = FindEditors() showPlugin = 0 end if(showPlugin >= #editors or safeMode == true) then -- If frames are over total sprites, we are done done = true else showPlugin = showPlugin + 1 local key = _G[editors[showPlugin] .. "icon"]; DrawSpriteBlock(key.spriteIDs[1], ((showPlugin - 1) * 2) + 1, 24, key.width, key.width, false, false, DrawMode.Tile) end end end end end function Draw() -- Redraw the entire display RedrawDisplay() -- Draw top border DrawSprites(topborder.spriteIDs, 0, 0, topborder.width, false, false, DrawMode.Sprite, 0, false, false) -- Draw bottom border DrawSprites(bottomborder.spriteIDs, 0, 232, bottomborder.width, false, false, DrawMode.Sprite, 0, false, false) -- Mask off the bottom of the screen so you can see the scrolling DrawRect(0, 240, 256, 8, 0, DrawMode.UI) end function KeyPressCheck() if(invalid == true) then return end if(Key(Keys.F)) then Fullscreen(not Fullscreen()) InvalidateKeys() else if(Key(Keys.Alpha1)) then Scale(1) InvalidateKeys() elseif(Key(Keys.Alpha2)) then Scale(2) InvalidateKeys() elseif(Key(Keys.Alpha3)) then Scale(3) InvalidateKeys() elseif(Key(Keys.Alpha4)) then Scale(4) InvalidateKeys() elseif(Key(Keys.LeftShift) or Key(Keys.RightShift)) then if(safeMode == false) then safeMode = true DrawText("SAFE MODE", 8, 225, DrawMode.TilemapCache, "small", 11, - 4) print("Safe mode") end end end end function InvalidateKeys() invalid = true end function FindEditors() local editors = {} -- If the file system isn't exposed, exit out of this since we can't check for any installed tool if(PathExists == nil) then return {} end local paths = { NewWorkspacePath("/PixelVisionOS/Tools/"), } if(PathExists(paths[1]) == nil) then return end local total = #paths local tools = {} for i = 1, total do local path = paths[i]; if (PathExists(path)) then local folders = GetEntities(path); local total = 0 for i = 1, #folders do local folder = folders[i] if (folder.IsDirectory) then local tmpInfoPath = folder.AppendFile("info.json") if(PathExists(tmpInfoPath)) then local jsonData = ReadJson(tmpInfoPath ) if (jsonData["editType"] ~= nil) then -- { local split = string.split(jsonData["editType"], ",") -- local totalTypes = #split for j = 1, totalTypes do if(_G[split[j] .. "icon"] ~= nil) then table.insert(tools, split[j]) end end end end end end end end table.sort(tools) return tools end string.split = function(string, delimiter) if delimiter == nil then delimiter = "%s" end local t = {} ; i = 1 for str in string.gmatch(string, "([^"..delimiter.."]+)") do t[i] = str i = i + 1 end return t end
-- -- vs200x_vcproj_user.lua -- Generate a Visual Studio 2002-2008 C/C++ project .user file -- Copyright (c) Jason Perkins and the Premake project -- local p = premake local m = p.vstudio.vc200x -- -- Generate a Visual Studio 200x C++ user file, with support for the new platforms API. -- m.elements.user = function(cfg) return { m.debugSettings, } end function m.generateUser(prj) p.indent("\t") -- Only want output if there is something to configure local contents = {} local size = 0 for cfg in p.project.eachconfig(prj) do contents[cfg] = p.capture(function() p.push(4) p.callArray(m.elements.user, cfg) p.pop(4) end) size = size + #contents[cfg] end if size > 0 then m.xmlElement() m.visualStudioUserFile() p.push('<Configurations>') for cfg in p.project.eachconfig(prj) do m.userConfiguration(cfg) p.push('<DebugSettings') if #contents[cfg] > 0 then p.outln(contents[cfg]) end p.pop('/>') p.pop('</Configuration>') end p.pop('</Configurations>') p.pop('</VisualStudioUserFile>') end end --- -- Output the opening project tag. --- function m.visualStudioUserFile() p.push('<VisualStudioUserFile') p.w('ProjectType="Visual C++"') m.version() p.w('ShowAllFiles="false"') p.w('>') end -- -- Write out the <Configuration> element, describing a specific Premake -- build configuration/platform pairing. -- function m.userConfiguration(cfg) p.push('<Configuration') p.x('Name="%s"', p.vstudio.projectConfig(cfg)) p.w('>') end -- -- Write out the debug settings for this project. -- m.elements.debugSettings = function(cfg) return { m.debugCommand, m.debugDir, m.debugArgs, m.debugEnvironment, } end function m.debugSettings(cfg) p.callArray(m.elements.debugSettings, cfg) end function m.debugArgs(cfg) if #cfg.debugargs > 0 then p.x('CommandArguments="%s"', table.concat(cfg.debugargs, " ")) end end function m.debugCommand(cfg) if cfg.debugcommand then p.x('Command="%s"', p.vstudio.path(cfg, cfg.debugcommand)) end end function m.debugDir(cfg) if cfg.debugdir then p.x('WorkingDirectory="%s"', p.vstudio.path(cfg, cfg.debugdir)) end end function m.debugEnvironment(cfg) if #cfg.debugenvs > 0 then p.x('Environment="%s"', table.concat(cfg.debugenvs, "\n")) if cfg.flags.DebugEnvsDontMerge then p.x('EnvironmentMerge="false"') end end end
object_static_worldbuilding_terminal_wall_monitorscreen_text_01 = object_static_worldbuilding_terminal_shared_wall_monitorscreen_text_01:new { } ObjectTemplates:addTemplate(object_static_worldbuilding_terminal_wall_monitorscreen_text_01, "object/static/worldbuilding/terminal/wall_monitorscreen_text_01.iff")
----------/|\ /|\---------- ----------\|/ Nak's Server Shield \|/---------- --[[Thank you for using. So far this grants protection from the most popular viruses on roblox currently: Vaccine Fire Spread Virus Common Renamers Outdated Viruses enjoy. NIS = not in script. ]] -------SETTINGS------- shared.--[[------------]]Owner = "Shiro23" -- change to your name shared.--[[------------]]On = true -- I thought it was necessary :D shared.--[[------------]]Beta_Tester_Code = {"if you are/were a beta tester, input your code here"} -- only needed in version 5.0 and up. shared.--[[------------]]Extra_Strength = false -- if your map is heavily virused. shared.--[[------------]]Ignore_List = {} -- the names of scripts that might be thought of as suspicious that you want ignored. shared.--[[------------]]Extras = {} -- the names of scripts on your map that are viruses but not thought to be. shared.--[[------------]]ShutDown_Timer = 0 -- how long script waits until it shuts down the server. Set to 0 for no shut down. Suggested time would be over 5000 ---ADVANCED SETTINGS--- shared.--[[------------]]Unremovable = true -- so it can't be removed. Finished in 3.7 shared.--[[------------]]No_Repeat_on_Reentry = true -- so it won't repeat if something tries to delete it. shared.--[[------------]]Disable_Scripts_On_Entry = true --scripts inside models are disabled if true. Not recommened for maps such as an Insert Wars. shared.--[[------------]]Lag_Burner = true -- can reduce lag. Follow instructions below shared.--[[------------]]Anti_Guest = true -- Maybe your map doesn't need guests? shared.--[[------------]]Lag_burn_files = { --Insert what models you want to be cleaned. --Make sure the model is anchored. --add numbers to the end to make the name unique --EXAMPLE: "Castle54","Box23","House61" } ----------------------- -->>>LOADER BELOW<<<-- ---Don't touch a thing--- shared.rrrp = false -- its for a function :P wait(1) -- helps prevent glitches g = game:GetService("InsertService"):LoadAsset(43475196) -- this allows me to update so you never have to wait() -- again with the glitches g.Parent = game.Workspace -- we want our protection to work, don't we? wait(3) script:Remove()
if vim.g.colors_name then vim.api.nvim_command [[highlight clear]] end vim.g.colors_name = "randombones" local util = require "zenbones.util" local colorschemes = util.get_colorscheme_list() math.randomseed(os.time()) local index = math.random(#colorschemes) local colorscheme = colorschemes[index] vim.g.randombones_colors_name = colorscheme.name if colorscheme.background then vim.opt.background = colorscheme.background end util.apply_colorscheme()
name = "Elemental Quests" desc = function(self, who) local desc = {} desc[#desc+1] = "Complete all the elemental quests." if self:isCompleted("earth-quest") then desc[#desc+1] = "#LIGHT_GREEN#* You have completed the Earth Quest!#WHITE#" else desc[#desc+1] = "#SLATE#* You must explore Murmon, in the middle of Atarlo, and do the thing.#WHITE#" end if self:isCompleted("fire-quest") then desc[#desc+1] = "#LIGHT_GREEN#* You have completed the Fire Quest!#WHITE#" else desc[#desc+1] = "#SLATE#* You must complete the Fire Quest.#WHITE#" end if self:isCompleted("water-quest") then desc[#desc+1] = "#LIGHT_GREEN#* You have completed the Water Quest!#WHITE#" else desc[#desc+1] = "#SLATE#* You must complete the Water Quest.#WHITE#" end if self:isCompleted("air-quest") then desc[#desc+1] = "#LIGHT_GREEN#* You have completed the Air Quest!#WHITE#" else desc[#desc+1] = "#SLATE#* You must complete the Air Quest.#WHITE#" end return table.concat(desc, "\n") end on_status_change = function(self, who, status, sub) if sub then if self:isCompleted("earth-quest") and self:isCompleted("fire-quest") and self:isCompleted("water-quest") and self:isCompleted("air-quest") then who:setQuestStatus(self.id, engine.Quest.COMPLETED) end end end
local _State_Die = require("core.class")() function _State_Die:Ctor(FSM, entity) self.FSM = FSM self._entity = entity self.name = "die" end function _State_Die:Enter() self.avatar:Play("down") self.avatar:SetFrame(4) self._entity:Update(love.timer.getDelta()) end function _State_Die:Update(dt) if self.avatar:GetPart():GetFrame() == 4 and #self._entity.extraEffects == 0 then self._entity:Die() end end function _State_Die:Exit() --body end return _State_Die
if not Holo:ShouldModify("Menu", "Lobby") then return end Holo:Post(HUDMissionBriefing, "init", function(self) if not alive(self._job_schedule_panel) then return end local text_font_size = tweak_data.menu.pd2_small_font_size - (BigLobbyGlobals and 3 or 0) local num_player_slots = BigLobbyGlobals and BigLobbyGlobals:num_player_slots() or 4 self._ready_slot_panel:set_h((text_font_size + 16) * num_player_slots + 24) if not BigLobbyGlobals then self._ready_slot_panel:set_right(self._foreground_layer_one:w()) self._ready_slot_panel:set_bottom(self._foreground_layer_one:h() - 12) else self._ready_slot_panel:set_x(0) self._ready_slot_panel:set_bottom(self._foreground_layer_one:h() - 32) end if self._ready_slot_panel:child("BoxGui") then self._ready_slot_panel:remove(self._ready_slot_panel:child("BoxGui")) end for i = 1, 7 do self._job_schedule_panel:child("day_" .. tostring(i)):hide() self._job_schedule_panel:child("ghost_" .. tostring(i)):hide() end local tex1 = Idstring("guis/dlcs/rvd/textures/pd2/mission_briefing/day1") local tex2 = Idstring("guis/dlcs/rvd/textures/pd2/mission_briefing/day2") for _, child in pairs(self._job_schedule_panel:children()) do if child.texture_name then log(tostring(child:texture_name())) end if child.texture_name and (child:texture_name() == tex1 or child:texture_name() == tex2) then child:hide() end end for i = 1, managers.job:current_stage() or 0 do self._job_schedule_panel:child("stage_done_" .. tostring(i)):hide() end if Holo.Options:GetValue("DisableLobbyVideo") and alive(self._background_layer_two:child("panel")) then self._background_layer_two:child("panel"):hide() end local num_stages = self._current_job_chain and #self._current_job_chain or 0 local ghost = managers.job:is_job_stage_ghostable(managers.job:current_real_job_id(), managers.job:current_stage()) and managers.localization:get_default_macro("BTN_GHOST") or "" self._foreground_layer_one:child("job_overview_text"):set_text(managers.localization:to_upper_text("menu_day_short", {day = managers.job:current_stage() .. "/" .. num_stages .. " " .. ghost})) self._job_schedule_panel:child("payday_stamp"):hide() self._foreground_layer_one:child("pg_text"):set_text(managers.localization:to_upper_text(tweak_data.difficulty_name_ids[Global.game_settings.difficulty])) managers.hud:make_fine_text(self._foreground_layer_one:child("pg_text")) self._foreground_layer_one:child("pg_text"):set_right(self._paygrade_panel:right()) self._paygrade_panel:hide() if not self._singleplayer then local prev for i = 1, num_player_slots do local slot = self._ready_slot_panel:child("slot_" .. tostring(i)) slot:set_h(text_font_size + 16) if prev then slot:set_y(prev:bottom() + 1) else slot:set_y(0) end prev = slot slot:rect({ name = "bg", alpha = 0.4, color = Color(0, 0, 0), layer = -2, }) local avatar = slot:bitmap({ name = "avatar", texture = "guis/textures/pd2/none_icon", x = 2, w = slot:h() - 4, h = slot:h() - 4, layer = 1, }) local center_y = slot:h() / 2 local criminal = slot:child("criminal") local name = slot:child("name") local status = slot:child("status") local detection = slot:child("detection") local detection_value = slot:child("detection_value") local infamy = slot:child("infamy") local voice = slot:child("voice") avatar:set_center_y(center_y) criminal:set_blend_mode("normal") criminal:set_x(avatar:right() + 8) criminal:set_center_y(center_y) voice:set_center_y(center_y) voice:set_x(criminal:right() + 20) infamy:set_center_y(center_y - 1) infamy:set_x(voice:right() + 2) name:set_blend_mode("normal") name:set_center_y(center_y) name:set_x(infamy:right()) status:set_blend_mode("normal") status:set_w(128) status:set_center_y(center_y) status:set_right(slot:w() - 8) detection:set_x(status:left() - 4) detection:set_center_y(center_y) detection:child("detection_left_bg"):set_blend_mode("normal") detection:child("detection_left"):set_blend_mode("normal") detection:child("detection_right_bg"):set_blend_mode("normal") detection:child("detection_right"):set_blend_mode("normal") detection_value:set_blend_mode("normal") detection_value:set_center_y(center_y) detection_value:set_x(detection:right() + 4) end self._ready_slot_panel:rect({ name = "line", color = Holo:GetColor("Colors/Tab"), x = prev:x(), w = prev:w(), h = 2, layer = -1, }):set_y(prev:bottom()) end end) Holo:Post(HUDMissionBriefing, "set_player_slot", function(self, nr, params) local slot = self._ready_slot_panel:child("slot_" .. tostring(nr)) if not slot or not alive(slot) then return end local peer = managers.network:session():peer(nr) or nil local steam_id = peer and peer:user_id() or nr == 1 and Steam:userid() or nil if steam_id then --Make sure we have the texture loaded, lets choose large so it's loaded in cache local avatar = slot:child("avatar") Steam:friend_avatar(Steam.LARGE_AVATAR, steam_id, function(texture) --ovk pls fix, it returns question mark avatar without waiting avatar:animate(function() wait(1) Steam:friend_avatar(Steam.LARGE_AVATAR, steam_id, function(texture) avatar:set_image(texture or "guis/textures/pd2/none_icon") end) end) end) end end) Holo:Post(HUDMissionBriefing, "set_slot_ready", function(self, peer, peer_id) local slot = self._ready_slot_panel:child("slot_" .. tostring(peer_id)) if alive(slot) then slot:child("status"):set_blend_mode("normal") end end)
minetest.register_privilege("worldedit", "Can use WorldEdit commands") worldedit.pos1 = {} worldedit.pos2 = {} worldedit.set_pos = {} worldedit.inspect = {} worldedit.prob_pos = {} worldedit.prob_list = {} local safe_region, reset_pending = dofile(minetest.get_modpath("worldedit_commands") .. "/safe.lua") function worldedit.player_notify(name, message) minetest.chat_send_player(name, "WorldEdit -!- " .. message, false) end worldedit.registered_commands = {} local function chatcommand_handler(cmd_name, name, param) local def = assert(worldedit.registered_commands[cmd_name]) if def.require_pos == 2 then local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] if pos1 == nil or pos2 == nil then worldedit.player_notify(name, "no region selected") return end elseif def.require_pos == 1 then local pos1 = worldedit.pos1[name] if pos1 == nil then worldedit.player_notify(name, "no position 1 selected") return end end local parsed = {def.parse(param)} local success = table.remove(parsed, 1) if not success then worldedit.player_notify(name, parsed[1] or "invalid usage") return end if def.nodes_needed then local count = def.nodes_needed(name, unpack(parsed)) safe_region(name, count, function() local success, msg = def.func(name, unpack(parsed)) if msg then minetest.chat_send_player(name, msg) end end) else -- no "safe region" check local success, msg = def.func(name, unpack(parsed)) if msg then minetest.chat_send_player(name, msg) end end end -- Registers a chatcommand for WorldEdit -- name = "about" -- Name of the chat command (without any /) -- def = { -- privs = {}, -- Privileges needed -- params = "", -- Human readable parameter list (optional) -- -- setting params = "" will automatically provide a parse() if not given -- description = "", -- Description -- require_pos = 0, -- Number of positions required to be set (optional) -- parse = function(param) -- return true, foo, bar, ... -- -- or -- return false -- -- or -- return false, "error message" -- end, -- nodes_needed = function(name, foo, bar, ...), -- (optional) -- return n -- end, -- func = function(name, foo, bar, ...) -- return success, "message" -- end, -- } function worldedit.register_command(name, def) local def = table.copy(def) assert(name and #name > 0) assert(def.privs) def.require_pos = def.require_pos or 0 assert(def.require_pos >= 0 and def.require_pos < 3) if def.params == "" and not def.parse then def.parse = function(param) return true end else assert(def.parse) end assert(def.nodes_needed == nil or type(def.nodes_needed) == "function") assert(def.func) -- for development --[[if def.require_pos == 2 and not def.nodes_needed then minetest.log("warning", "//" .. name .. " might be missing nodes_needed") end--]] minetest.register_chatcommand("/" .. name, { privs = def.privs, params = def.params, description = def.description, func = function(player_name, param) return chatcommand_handler(name, player_name, param) end, }) worldedit.registered_commands[name] = def end dofile(minetest.get_modpath("worldedit_commands") .. "/cuboid.lua") dofile(minetest.get_modpath("worldedit_commands") .. "/mark.lua") dofile(minetest.get_modpath("worldedit_commands") .. "/wand.lua") local function check_region(name) return worldedit.volume(worldedit.pos1[name], worldedit.pos2[name]) end -- Strips any kind of escape codes (translation, colors) from a string -- https://github.com/minetest/minetest/blob/53dd7819277c53954d1298dfffa5287c306db8d0/src/util/string.cpp#L777 local function strip_escapes(input) local s = function(idx) return input:sub(idx, idx) end local out = "" local i = 1 while i <= #input do if s(i) == "\027" then -- escape sequence i = i + 1 if s(i) == "(" then -- enclosed i = i + 1 while i <= #input and s(i) ~= ")" do if s(i) == "\\" then i = i + 2 else i = i + 1 end end end else out = out .. s(i) end i = i + 1 end --print(("%q -> %q"):format(input, out)) return out end local function string_endswith(full, part) return full:find(part, 1, true) == #full - #part + 1 end local description_cache = nil -- normalizes node "description" `nodename`, returning a string (or nil) worldedit.normalize_nodename = function(nodename) nodename = nodename:gsub("^%s*(.-)%s*$", "%1") -- strip spaces if nodename == "" then return nil end local fullname = ItemStack({name=nodename}):get_name() -- resolve aliases if minetest.registered_nodes[fullname] or fullname == "air" then -- full name return fullname end nodename = nodename:lower() for key, _ in pairs(minetest.registered_nodes) do if string_endswith(key:lower(), ":" .. nodename) then -- matches name (w/o mod part) return key end end if description_cache == nil then -- cache stripped descriptions description_cache = {} for key, value in pairs(minetest.registered_nodes) do local desc = strip_escapes(value.description):gsub("\n.*", "", 1):lower() if desc ~= "" then description_cache[key] = desc end end end for key, desc in pairs(description_cache) do if desc == nodename then -- matches description return key end end for key, desc in pairs(description_cache) do if desc == nodename .. " block" then -- fuzzy description match (e.g. "Steel" == "Steel Block") return key end end local match = nil for key, value in pairs(description_cache) do if value:find(nodename, 1, true) ~= nil then if match ~= nil then return nil end match = key -- substring description match (only if no ambiguities) end end return match end -- Determines the axis in which a player is facing, returning an axis ("x", "y", or "z") and the sign (1 or -1) function worldedit.player_axis(name) local dir = minetest.get_player_by_name(name):get_look_dir() local x, y, z = math.abs(dir.x), math.abs(dir.y), math.abs(dir.z) if x > y then if x > z then return "x", dir.x > 0 and 1 or -1 end elseif y > z then return "y", dir.y > 0 and 1 or -1 end return "z", dir.z > 0 and 1 or -1 end local function check_filename(name) return name:find("^[%w%s%^&'@{}%[%],%$=!%-#%(%)%%%.%+~_]+$") ~= nil end worldedit.register_command("about", { privs = {}, params = "", description = "Get information about the WorldEdit mod", func = function(name) worldedit.player_notify(name, "WorldEdit " .. worldedit.version_string.. " is available on this server. Type //help to get a list of ".. "commands, or get more information at ".. "https://github.com/Uberi/Minetest-WorldEdit") end, }) -- mostly copied from builtin/chatcommands.lua with minor modifications worldedit.register_command("help", { privs = {}, params = "[all/<cmd>]", description = "Get help for WorldEdit commands", parse = function(param) return true, param end, func = function(name, param) local function format_help_line(cmd, def) local msg = minetest.colorize("#00ffff", "//"..cmd) if def.params and def.params ~= "" then msg = msg .. " " .. def.params end if def.description and def.description ~= "" then msg = msg .. ": " .. def.description end return msg end if not minetest.check_player_privs(name, "worldedit") then return false, "You are not allowed to use any WorldEdit commands." end if param == "" then local msg = "" local cmds = {} for cmd, def in pairs(worldedit.registered_commands) do if minetest.check_player_privs(name, def.privs) then cmds[#cmds + 1] = cmd end end table.sort(cmds) return true, "Available commands: " .. table.concat(cmds, " ") .. "\n" .. "Use '//help <cmd>' to get more information," .. " or '//help all' to list everything." elseif param == "all" then local cmds = {} for cmd, def in pairs(worldedit.registered_commands) do if minetest.check_player_privs(name, def.privs) then cmds[#cmds + 1] = format_help_line(cmd, def) end end table.sort(cmds) return true, "Available commands:\n"..table.concat(cmds, "\n") else local def = worldedit.registered_commands[param] if not def then return false, "Command not available: " .. param else return true, format_help_line(param, def) end end end, }) worldedit.register_command("inspect", { params = "[on/off/1/0/true/false/yes/no/enable/disable]", description = "Enable or disable node inspection", privs = {worldedit=true}, parse = function(param) if param == "on" or param == "1" or param == "true" or param == "yes" or param == "enable" or param == "" then return true, true elseif param == "off" or param == "0" or param == "false" or param == "no" or param == "disable" then return true, false end return false end, func = function(name, enable) if enable then worldedit.inspect[name] = true local axis, sign = worldedit.player_axis(name) worldedit.player_notify(name, string.format("inspector: inspection enabled for %s, currently facing the %s axis", name, axis .. (sign > 0 and "+" or "-"))) else worldedit.inspect[name] = nil worldedit.player_notify(name, "inspector: inspection disabled") end end, }) local function get_node_rlight(pos) local vecs = { -- neighboring nodes {x= 1, y= 0, z= 0}, {x=-1, y= 0, z= 0}, {x= 0, y= 1, z= 0}, {x= 0, y=-1, z= 0}, {x= 0, y= 0, z= 1}, {x= 0, y= 0, z=-1}, } local ret = 0 for _, v in ipairs(vecs) do ret = math.max(ret, minetest.get_node_light(vector.add(pos, v))) end return ret end minetest.register_on_punchnode(function(pos, node, puncher) local name = puncher:get_player_name() if worldedit.inspect[name] then local axis, sign = worldedit.player_axis(name) local message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis", node.name, minetest.pos_to_string(pos), node.param1, node.param2, get_node_rlight(pos), axis .. (sign > 0 and "+" or "-")) worldedit.player_notify(name, message) end end) worldedit.register_command("reset", { params = "", description = "Reset the region so that it is empty", privs = {worldedit=true}, func = function(name) worldedit.pos1[name] = nil worldedit.pos2[name] = nil worldedit.marker_update(name) worldedit.set_pos[name] = nil --make sure the user does not try to confirm an operation after resetting pos: reset_pending(name) worldedit.player_notify(name, "region reset") end, }) worldedit.register_command("mark", { params = "", description = "Show markers at the region positions", privs = {worldedit=true}, func = function(name) worldedit.marker_update(name) worldedit.player_notify(name, "region marked") end, }) worldedit.register_command("unmark", { params = "", description = "Hide markers if currently shown", privs = {worldedit=true}, func = function(name) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] worldedit.pos1[name] = nil worldedit.pos2[name] = nil worldedit.marker_update(name) worldedit.pos1[name] = pos1 worldedit.pos2[name] = pos2 worldedit.player_notify(name, "region unmarked") end, }) worldedit.register_command("pos1", { params = "", description = "Set WorldEdit region position 1 to the player's location", privs = {worldedit=true}, func = function(name) local pos = minetest.get_player_by_name(name):get_pos() pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5) worldedit.pos1[name] = pos worldedit.mark_pos1(name) worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos)) end, }) worldedit.register_command("pos2", { params = "", description = "Set WorldEdit region position 2 to the player's location", privs = {worldedit=true}, func = function(name) local pos = minetest.get_player_by_name(name):get_pos() pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5) worldedit.pos2[name] = pos worldedit.mark_pos2(name) worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos)) end, }) worldedit.register_command("p", { params = "set/set1/set2/get", description = "Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region", privs = {worldedit=true}, parse = function(param) if param == "set" or param == "set1" or param == "set2" or param == "get" then return true, param end return false, "unknown subcommand: " .. param end, func = function(name, param) if param == "set" then --set both WorldEdit positions worldedit.set_pos[name] = "pos1" worldedit.player_notify(name, "select positions by punching two nodes") elseif param == "set1" then --set WorldEdit position 1 worldedit.set_pos[name] = "pos1only" worldedit.player_notify(name, "select position 1 by punching a node") elseif param == "set2" then --set WorldEdit position 2 worldedit.set_pos[name] = "pos2" worldedit.player_notify(name, "select position 2 by punching a node") elseif param == "get" then --display current WorldEdit positions if worldedit.pos1[name] ~= nil then worldedit.player_notify(name, "position 1: " .. minetest.pos_to_string(worldedit.pos1[name])) else worldedit.player_notify(name, "position 1 not set") end if worldedit.pos2[name] ~= nil then worldedit.player_notify(name, "position 2: " .. minetest.pos_to_string(worldedit.pos2[name])) else worldedit.player_notify(name, "position 2 not set") end end end, }) worldedit.register_command("fixedpos", { params = "set1/set2 <x> <y> <z>", description = "Set a WorldEdit region position to the position at (<x>, <y>, <z>)", privs = {worldedit=true}, parse = function(param) local found, _, flag, x, y, z = param:find("^(set[12])%s+([+-]?%d+)%s+([+-]?%d+)%s+([+-]?%d+)$") if found == nil then return false end return true, flag, {x=tonumber(x), y=tonumber(y), z=tonumber(z)} end, func = function(name, flag, pos) if flag == "set1" then worldedit.pos1[name] = pos worldedit.mark_pos1(name) worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos)) else --flag == "set2" worldedit.pos2[name] = pos worldedit.mark_pos2(name) worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos)) end end, }) minetest.register_on_punchnode(function(pos, node, puncher) local name = puncher:get_player_name() if name ~= "" and worldedit.set_pos[name] ~= nil then --currently setting position if worldedit.set_pos[name] == "pos1" then --setting position 1 worldedit.pos1[name] = pos worldedit.mark_pos1(name) worldedit.set_pos[name] = "pos2" --set position 2 on the next invocation worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos)) elseif worldedit.set_pos[name] == "pos1only" then --setting position 1 only worldedit.pos1[name] = pos worldedit.mark_pos1(name) worldedit.set_pos[name] = nil --finished setting positions worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos)) elseif worldedit.set_pos[name] == "pos2" then --setting position 2 worldedit.pos2[name] = pos worldedit.mark_pos2(name) worldedit.set_pos[name] = nil --finished setting positions worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos)) elseif worldedit.set_pos[name] == "prob" then --setting Minetest schematic node probabilities worldedit.prob_pos[name] = pos minetest.show_formspec(puncher:get_player_name(), "prob_val_enter", "field[text;;]") end end end) worldedit.register_command("volume", { params = "", description = "Display the volume of the current WorldEdit region", privs = {worldedit=true}, require_pos = 2, func = function(name) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local volume = worldedit.volume(pos1, pos2) local abs = math.abs worldedit.player_notify(name, "current region has a volume of " .. volume .. " nodes (" .. abs(pos2.x - pos1.x) + 1 .. "*" .. abs(pos2.y - pos1.y) + 1 .. "*" .. abs(pos2.z - pos1.z) + 1 .. ")") end, }) worldedit.register_command("deleteblocks", { params = "", description = "remove all MapBlocks (16x16x16) containing the selected area from the map", privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local success = minetest.delete_area(pos1, pos2) if success then worldedit.player_notify(name, "Area deleted.") else worldedit.player_notify(name, "There was an error during deletion of the area.") end end, }) worldedit.register_command("set", { params = "<node>", description = "Set the current WorldEdit region to <node>", privs = {worldedit=true}, require_pos = 2, parse = function(param) local node = worldedit.normalize_nodename(param) if not node then return false, "invalid node name: " .. param end return true, node end, nodes_needed = check_region, func = function(name, node) local count = worldedit.set(worldedit.pos1[name], worldedit.pos2[name], node) worldedit.player_notify(name, count .. " nodes set") end, }) worldedit.register_command("param2", { params = "<param2>", description = "Set param2 of all nodes in the current WorldEdit region to <param2>", privs = {worldedit=true}, require_pos = 2, parse = function(param) local param2 = tonumber(param) if not param2 then return false elseif param2 < 0 or param2 > 255 then return false, "Param2 is out of range (must be between 0 and 255 inclusive!)" end return true, param2 end, nodes_needed = check_region, func = function(name, param2) local count = worldedit.set_param2(worldedit.pos1[name], worldedit.pos2[name], param2) worldedit.player_notify(name, count .. " nodes altered") end, }) worldedit.register_command("mix", { params = "<node1> [count1] <node2> [count2] ...", description = "Fill the current WorldEdit region with a random mix of <node1>, ...", privs = {worldedit=true}, require_pos = 2, parse = function(param) local nodes = {} for nodename in param:gmatch("[^%s]+") do if tonumber(nodename) ~= nil and #nodes > 0 then local last_node = nodes[#nodes] for i = 1, tonumber(nodename) do nodes[#nodes + 1] = last_node end else local node = worldedit.normalize_nodename(nodename) if not node then return false, "invalid node name: " .. nodename end nodes[#nodes + 1] = node end end if #nodes == 0 then return false end return true, nodes end, nodes_needed = check_region, func = function(name, nodes) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local count = worldedit.set(pos1, pos2, nodes) worldedit.player_notify(name, count .. " nodes set") end, }) local check_replace = function(param) local found, _, searchnode, replacenode = param:find("^([^%s]+)%s+(.+)$") if found == nil then return false end local newsearchnode = worldedit.normalize_nodename(searchnode) if not newsearchnode then return false, "invalid search node name: " .. searchnode end local newreplacenode = worldedit.normalize_nodename(replacenode) if not newreplacenode then return false, "invalid replace node name: " .. replacenode end return true, newsearchnode, newreplacenode end worldedit.register_command("replace", { params = "<search node> <replace node>", description = "Replace all instances of <search node> with <replace node> in the current WorldEdit region", privs = {worldedit=true}, require_pos = 2, parse = check_replace, nodes_needed = check_region, func = function(name, search_node, replace_node) local count = worldedit.replace(worldedit.pos1[name], worldedit.pos2[name], search_node, replace_node) worldedit.player_notify(name, count .. " nodes replaced") end, }) worldedit.register_command("replaceinverse", { params = "<search node> <replace node>", description = "Replace all nodes other than <search node> with <replace node> in the current WorldEdit region", privs = {worldedit=true}, require_pos = 2, parse = check_replace, nodes_needed = check_region, func = function(name, search_node, replace_node) local count = worldedit.replace(worldedit.pos1[name], worldedit.pos2[name], search_node, replace_node, true) worldedit.player_notify(name, count .. " nodes replaced") end, }) local check_cube = function(param) local found, _, w, h, l, nodename = param:find("^(%d+)%s+(%d+)%s+(%d+)%s+(.+)$") if found == nil then return false end local node = worldedit.normalize_nodename(nodename) if not node then return false, "invalid node name: " .. nodename end return true, tonumber(w), tonumber(h), tonumber(l), node end worldedit.register_command("hollowcube", { params = "<width> <height> <length> <node>", description = "Add a hollow cube with its ground level centered at WorldEdit position 1 with dimensions <width> x <height> x <length>, composed of <node>.", privs = {worldedit=true}, require_pos = 1, parse = check_cube, nodes_needed = function(name, w, h, l, node) return w * h * l end, func = function(name, w, h, l, node) local count = worldedit.cube(worldedit.pos1[name], w, h, l, node, true) worldedit.player_notify(name, count .. " nodes added") end, }) worldedit.register_command("cube", { params = "<width> <height> <length> <node>", description = "Add a cube with its ground level centered at WorldEdit position 1 with dimensions <width> x <height> x <length>, composed of <node>.", privs = {worldedit=true}, require_pos = 1, parse = check_cube, nodes_needed = function(name, w, h, l, node) return w * h * l end, func = function(name, w, h, l, node) local count = worldedit.cube(worldedit.pos1[name], w, h, l, node) worldedit.player_notify(name, count .. " nodes added") end, }) local check_sphere = function(param) local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$") if found == nil then return false end local node = worldedit.normalize_nodename(nodename) if not node then return false, "invalid node name: " .. nodename end return true, tonumber(radius), node end worldedit.register_command("hollowsphere", { params = "<radius> <node>", description = "Add hollow sphere centered at WorldEdit position 1 with radius <radius>, composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = check_sphere, nodes_needed = function(name, radius, node) return math.ceil((4 * math.pi * (radius ^ 3)) / 3) --volume of sphere end, func = function(name, radius, node) local count = worldedit.sphere(worldedit.pos1[name], radius, node, true) worldedit.player_notify(name, count .. " nodes added") end, }) worldedit.register_command("sphere", { params = "<radius> <node>", description = "Add sphere centered at WorldEdit position 1 with radius <radius>, composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = check_sphere, nodes_needed = function(name, radius, node) return math.ceil((4 * math.pi * (radius ^ 3)) / 3) --volume of sphere end, func = function(name, radius, node) local count = worldedit.sphere(worldedit.pos1[name], radius, node) worldedit.player_notify(name, count .. " nodes added") end, }) local check_dome = function(param) local found, _, radius, nodename = param:find("^(%d+)%s+(.+)$") if found == nil then return false end local node = worldedit.normalize_nodename(nodename) if not node then return false, "invalid node name: " .. nodename end return true, tonumber(radius), node end worldedit.register_command("hollowdome", { params = "<radius> <node>", description = "Add hollow dome centered at WorldEdit position 1 with radius <radius>, composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = check_dome, nodes_needed = function(name, radius, node) return math.ceil((2 * math.pi * (radius ^ 3)) / 3) --volume of dome end, func = function(name, radius, node) local count = worldedit.dome(worldedit.pos1[name], radius, node, true) worldedit.player_notify(name, count .. " nodes added") end, }) worldedit.register_command("dome", { params = "<radius> <node>", description = "Add dome centered at WorldEdit position 1 with radius <radius>, composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = check_dome, nodes_needed = function(name, radius, node) return math.ceil((2 * math.pi * (radius ^ 3)) / 3) --volume of dome end, func = function(name, radius, node) local count = worldedit.dome(worldedit.pos1[name], radius, node) worldedit.player_notify(name, count .. " nodes added") end, }) local check_cylinder = function(param) -- two radii local found, _, axis, length, radius1, radius2, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(%d+)%s+(.+)$") if found == nil then -- single radius found, _, axis, length, radius1, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(%d+)%s+(.+)$") radius2 = radius1 end if found == nil then return false end local node = worldedit.normalize_nodename(nodename) if not node then return false, "invalid node name: " .. nodename end return true, axis, tonumber(length), tonumber(radius1), tonumber(radius2), node end worldedit.register_command("hollowcylinder", { params = "x/y/z/? <length> <radius1> [radius2] <node>", description = "Add hollow cylinder at WorldEdit position 1 along the given axis with length <length>, base radius <radius1> (and top radius [radius2]), composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = check_cylinder, nodes_needed = function(name, axis, length, radius1, radius2, node) local radius = math.max(radius1, radius2) return math.ceil(math.pi * (radius ^ 2) * length) end, func = function(name, axis, length, radius1, radius2, node) if axis == "?" then local sign axis, sign = worldedit.player_axis(name) length = length * sign end local count = worldedit.cylinder(worldedit.pos1[name], axis, length, radius1, radius2, node, true) worldedit.player_notify(name, count .. " nodes added") end, }) worldedit.register_command("cylinder", { params = "x/y/z/? <length> <radius1> [radius2] <node>", description = "Add cylinder at WorldEdit position 1 along the given axis with length <length>, base radius <radius1> (and top radius [radius2]), composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = check_cylinder, nodes_needed = function(name, axis, length, radius1, radius2, node) local radius = math.max(radius1, radius2) return math.ceil(math.pi * (radius ^ 2) * length) end, func = function(name, axis, length, radius1, radius2, node) if axis == "?" then local sign axis, sign = worldedit.player_axis(name) length = length * sign end local count = worldedit.cylinder(worldedit.pos1[name], axis, length, radius1, radius2, node) worldedit.player_notify(name, count .. " nodes added") end, }) local check_pyramid = function(param) local found, _, axis, height, nodename = param:find("^([xyz%?])%s+([+-]?%d+)%s+(.+)$") if found == nil then return false end local node = worldedit.normalize_nodename(nodename) if not node then return false, "invalid node name: " .. nodename end return true, axis, tonumber(height), node end worldedit.register_command("hollowpyramid", { params = "x/y/z/? <height> <node>", description = "Add hollow pyramid centered at WorldEdit position 1 along the given axis with height <height>, composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = check_pyramid, nodes_needed = function(name, axis, height, node) return math.ceil(((height * 2 + 1) ^ 2) * height / 3) end, func = function(name, axis, height, node) if axis == "?" then local sign axis, sign = worldedit.player_axis(name) height = height * sign end local count = worldedit.pyramid(worldedit.pos1[name], axis, height, node, true) worldedit.player_notify(name, count .. " nodes added") end, }) worldedit.register_command("pyramid", { params = "x/y/z/? <height> <node>", description = "Add pyramid centered at WorldEdit position 1 along the given axis with height <height>, composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = check_pyramid, nodes_needed = function(name, axis, height, node) return math.ceil(((height * 2 + 1) ^ 2) * height / 3) end, func = function(name, axis, height, node) if axis == "?" then local sign axis, sign = worldedit.player_axis(name) height = height * sign end local count = worldedit.pyramid(worldedit.pos1[name], axis, height, node) worldedit.player_notify(name, count .. " nodes added") end, }) worldedit.register_command("spiral", { params = "<length> <height> <space> <node>", description = "Add spiral centered at WorldEdit position 1 with side length <length>, height <height>, space between walls <space>, composed of <node>", privs = {worldedit=true}, require_pos = 1, parse = function(param) local found, _, length, height, space, nodename = param:find("^(%d+)%s+(%d+)%s+(%d+)%s+(.+)$") if found == nil then return false end local node = worldedit.normalize_nodename(nodename) if not node then return false, "invalid node name: " .. nodename end return true, tonumber(length), tonumber(height), tonumber(space), node end, nodes_needed = function(name, length, height, space, node) return (length + space) * height -- TODO: this is not the upper bound end, func = function(name, length, height, space, node) local count = worldedit.spiral(worldedit.pos1[name], length, height, space, node) worldedit.player_notify(name, count .. " nodes added") end, }) worldedit.register_command("copy", { params = "x/y/z/? <amount>", description = "Copy the current WorldEdit region along the given axis by <amount> nodes", privs = {worldedit=true}, require_pos = 2, parse = function(param) local found, _, axis, amount = param:find("^([xyz%?])%s+([+-]?%d+)$") if found == nil then return false end return true, axis, tonumber(amount) end, nodes_needed = function(name, axis, amount) return check_region(name) * 2 end, func = function(name, axis, amount) if axis == "?" then local sign axis, sign = worldedit.player_axis(name) amount = amount * sign end local count = worldedit.copy(worldedit.pos1[name], worldedit.pos2[name], axis, amount) worldedit.player_notify(name, count .. " nodes copied") end, }) worldedit.register_command("move", { params = "x/y/z/? <amount>", description = "Move the current WorldEdit region along the given axis by <amount> nodes", privs = {worldedit=true}, require_pos = 2, parse = function(param) local found, _, axis, amount = param:find("^([xyz%?])%s+([+-]?%d+)$") if found == nil then return false end return true, axis, tonumber(amount) end, nodes_needed = function(name, axis, amount) return check_region(name) * 2 end, func = function(name, axis, amount) if axis == "?" then local sign axis, sign = worldedit.player_axis(name) amount = amount * sign end local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local count = worldedit.move(pos1, pos2, axis, amount) pos1[axis] = pos1[axis] + amount pos2[axis] = pos2[axis] + amount worldedit.marker_update(name) worldedit.player_notify(name, count .. " nodes moved") end, }) worldedit.register_command("stack", { params = "x/y/z/? <count>", description = "Stack the current WorldEdit region along the given axis <count> times", privs = {worldedit=true}, require_pos = 2, parse = function(param) local found, _, axis, repetitions = param:find("^([xyz%?])%s+([+-]?%d+)$") if found == nil then return false end return true, axis, tonumber(repetitions) end, nodes_needed = function(name, axis, repetitions) return check_region(name) * math.abs(repetitions) end, func = function(name, axis, repetitions) if axis == "?" then local sign axis, sign = worldedit.player_axis(name) repetitions = repetitions * sign end local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local count = worldedit.volume(pos1, pos2) * math.abs(repetitions) worldedit.stack(pos1, pos2, axis, repetitions, function() worldedit.player_notify(name, count .. " nodes stacked") end) end, }) worldedit.register_command("stack2", { params = "<count> <x> <y> <z>", description = "Stack the current WorldEdit region <count> times by offset <x>, <y>, <z>", privs = {worldedit=true}, require_pos = 2, parse = function(param) local repetitions, incs = param:match("(%d+)%s*(.+)") if repetitions == nil then return false, "invalid count: " .. param end local x, y, z = incs:match("([+-]?%d+) ([+-]?%d+) ([+-]?%d+)") if x == nil then return false, "invalid increments: " .. param end return true, tonumber(repetitions), {x=tonumber(x), y=tonumber(y), z=tonumber(z)} end, nodes_needed = function(name, repetitions, offset) return check_region(name) * repetitions end, func = function(name, repetitions, offset) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local count = worldedit.volume(pos1, pos2) * repetitions worldedit.stack2(pos1, pos2, offset, repetitions, function() worldedit.player_notify(name, count .. " nodes stacked") end) end, }) worldedit.register_command("stretch", { params = "<stretchx> <stretchy> <stretchz>", description = "Scale the current WorldEdit positions and region by a factor of <stretchx>, <stretchy>, <stretchz> along the X, Y, and Z axes, repectively, with position 1 as the origin", privs = {worldedit=true}, require_pos = 2, parse = function(param) local found, _, stretchx, stretchy, stretchz = param:find("^(%d+)%s+(%d+)%s+(%d+)$") if found == nil then return false end stretchx, stretchy, stretchz = tonumber(stretchx), tonumber(stretchy), tonumber(stretchz) if stretchx == 0 or stretchy == 0 or stretchz == 0 then return false, "invalid scaling factors: " .. param end return true, stretchx, stretchy, stretchz end, nodes_needed = function(name, stretchx, stretchy, stretchz) return check_region(name) * stretchx * stretchy * stretchz end, func = function(name, stretchx, stretchy, stretchz) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local count, pos1, pos2 = worldedit.stretch(pos1, pos2, stretchx, stretchy, stretchz) --reset markers to scaled positions worldedit.pos1[name] = pos1 worldedit.pos2[name] = pos2 worldedit.marker_update(name) worldedit.player_notify(name, count .. " nodes stretched") end, }) worldedit.register_command("transpose", { params = "x/y/z/? x/y/z/?", description = "Transpose the current WorldEdit region along the given axes", privs = {worldedit=true}, require_pos = 2, parse = function(param) local found, _, axis1, axis2 = param:find("^([xyz%?])%s+([xyz%?])$") if found == nil then return false elseif axis1 == axis2 then return false, "invalid usage: axes must be different" end return true, axis1, axis2 end, nodes_needed = check_region, func = function(name, axis1, axis2) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] if axis1 == "?" then axis1 = worldedit.player_axis(name) end if axis2 == "?" then axis2 = worldedit.player_axis(name) end local count, pos1, pos2 = worldedit.transpose(pos1, pos2, axis1, axis2) --reset markers to transposed positions worldedit.pos1[name] = pos1 worldedit.pos2[name] = pos2 worldedit.marker_update(name) worldedit.player_notify(name, count .. " nodes transposed") end, }) worldedit.register_command("flip", { params = "x/y/z/?", description = "Flip the current WorldEdit region along the given axis", privs = {worldedit=true}, require_pos = 2, parse = function(param) if param ~= "x" and param ~= "y" and param ~= "z" and param ~= "?" then return false end return true, param end, nodes_needed = check_region, func = function(name, param) if param == "?" then param = worldedit.player_axis(name) end local count = worldedit.flip(worldedit.pos1[name], worldedit.pos2[name], param) worldedit.player_notify(name, count .. " nodes flipped") end, }) worldedit.register_command("rotate", { params = "x/y/z/? <angle>", description = "Rotate the current WorldEdit region around the given axis by angle <angle> (90 degree increment)", privs = {worldedit=true}, require_pos = 2, parse = function(param) local found, _, axis, angle = param:find("^([xyz%?])%s+([+-]?%d+)$") if found == nil then return false end angle = tonumber(angle) if angle % 90 ~= 0 or angle % 360 == 0 then return false, "invalid usage: angle must be multiple of 90" end return true, axis, angle end, nodes_needed = check_region, func = function(name, axis, angle) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] if axis == "?" then axis = worldedit.player_axis(name) end local count, pos1, pos2 = worldedit.rotate(pos1, pos2, axis, angle) --reset markers to rotated positions worldedit.pos1[name] = pos1 worldedit.pos2[name] = pos2 worldedit.marker_update(name) worldedit.player_notify(name, count .. " nodes rotated") end, }) worldedit.register_command("orient", { params = "<angle>", description = "Rotate oriented nodes in the current WorldEdit region around the Y axis by angle <angle> (90 degree increment)", privs = {worldedit=true}, require_pos = 2, parse = function(param) local found, _, angle = param:find("^([+-]?%d+)$") if found == nil then return false end angle = tonumber(angle) if angle % 90 ~= 0 then return false, "invalid usage: angle must be multiple of 90" end return true, angle end, nodes_needed = check_region, func = function(name, angle) local count = worldedit.orient(worldedit.pos1[name], worldedit.pos2[name], angle) worldedit.player_notify(name, count .. " nodes oriented") end, }) worldedit.register_command("fixlight", { params = "", description = "Fix the lighting in the current WorldEdit region", privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local count = worldedit.fixlight(worldedit.pos1[name], worldedit.pos2[name]) worldedit.player_notify(name, count .. " nodes updated") end, }) worldedit.register_command("drain", { params = "", description = "Remove any fluid node within the current WorldEdit region", privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) -- TODO: make an API function for this local count = 0 local pos1, pos2 = worldedit.sort_pos(worldedit.pos1[name], worldedit.pos2[name]) for x = pos1.x, pos2.x do for y = pos1.y, pos2.y do for z = pos1.z, pos2.z do local n = minetest.get_node({x=x, y=y, z=z}).name local d = minetest.registered_nodes[n] if d ~= nil and (d["drawtype"] == "liquid" or d["drawtype"] == "flowingliquid") then minetest.remove_node({x=x, y=y, z=z}) count = count + 1 end end end end worldedit.player_notify(name, count .. " nodes updated") end, }) local clearcut_cache local function clearcut(pos1, pos2) -- decide which nodes we consider plants if clearcut_cache == nil then clearcut_cache = {} for name, def in pairs(minetest.registered_nodes) do local groups = def.groups or {} if ( -- the groups say so groups.flower or groups.grass or groups.flora or groups.plant or groups.leaves or groups.tree or groups.leafdecay or groups.sapling or -- drawtype heuristic (def.is_ground_content and def.buildable_to and (def.sunlight_propagates or not def.walkable) and def.drawtype == "plantlike") or -- if it's flammable, it probably needs to go too (def.is_ground_content and not def.walkable and groups.flammable) ) then clearcut_cache[name] = true end end end local plants = clearcut_cache local count = 0 local prev, any for x = pos1.x, pos2.x do for z = pos1.z, pos2.z do prev = false any = false -- first pass: remove floating nodes that would be left over for y = pos1.y, pos2.y do local n = minetest.get_node({x=x, y=y, z=z}).name if plants[n] then prev = true any = true elseif prev then local def = minetest.registered_nodes[n] or {} local groups = def.groups or {} if groups.attached_node or (def.buildable_to and groups.falling_node) then minetest.remove_node({x=x, y=y, z=z}) count = count + 1 else prev = false end end end -- second pass: remove plants, top-to-bottom to avoid item drops if any then for y = pos2.y, pos1.y, -1 do local n = minetest.get_node({x=x, y=y, z=z}).name if plants[n] then minetest.remove_node({x=x, y=y, z=z}) count = count + 1 end end end end end return count end worldedit.register_command("clearcut", { params = "", description = "Remove any plant, tree or foilage-like nodes in the selected region", privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local pos1, pos2 = worldedit.sort_pos(worldedit.pos1[name], worldedit.pos2[name]) local count = clearcut(pos1, pos2) worldedit.player_notify(name, count .. " nodes removed") end, }) worldedit.register_command("hide", { params = "", description = "Hide all nodes in the current WorldEdit region non-destructively", privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local count = worldedit.hide(worldedit.pos1[name], worldedit.pos2[name]) worldedit.player_notify(name, count .. " nodes hidden") end, }) worldedit.register_command("suppress", { params = "<node>", description = "Suppress all <node> in the current WorldEdit region non-destructively", privs = {worldedit=true}, require_pos = 2, parse = function(param) local node = worldedit.normalize_nodename(param) if not node then return false, "invalid node name: " .. param end return true, node end, nodes_needed = check_region, func = function(name, node) local count = worldedit.suppress(worldedit.pos1[name], worldedit.pos2[name], node) worldedit.player_notify(name, count .. " nodes suppressed") end, }) worldedit.register_command("highlight", { params = "<node>", description = "Highlight <node> in the current WorldEdit region by hiding everything else non-destructively", privs = {worldedit=true}, require_pos = 2, parse = function(param) local node = worldedit.normalize_nodename(param) if not node then return false, "invalid node name: " .. param end return true, node end, nodes_needed = check_region, func = function(name, node) local count = worldedit.highlight(worldedit.pos1[name], worldedit.pos2[name], node) worldedit.player_notify(name, count .. " nodes highlighted") end, }) worldedit.register_command("restore", { params = "", description = "Restores nodes hidden with WorldEdit in the current WorldEdit region", privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local count = worldedit.restore(worldedit.pos1[name], worldedit.pos2[name]) worldedit.player_notify(name, count .. " nodes restored") end, }) local function detect_misaligned_schematic(name, pos1, pos2) pos1, pos2 = worldedit.sort_pos(pos1, pos2) -- Check that allocate/save can position the schematic correctly -- The expected behaviour is that the (0,0,0) corner of the schematic stays -- sat pos1, this only works when the minimum position is actually present -- in the schematic. local node = minetest.get_node(pos1) local have_node_at_origin = node.name ~= "air" and node.name ~= "ignore" if not have_node_at_origin then worldedit.player_notify(name, "Warning: The schematic contains excessive free space and WILL be ".. "misaligned when allocated or loaded. To avoid this, shrink your ".. "area to cover exactly the nodes to be saved." ) end end worldedit.register_command("save", { params = "<file>", description = "Save the current WorldEdit region to \"(world folder)/schems/<file>.we\"", privs = {worldedit=true}, require_pos = 2, parse = function(param) if param == "" then return false end if not check_filename(param) then return false, "Disallowed file name: " .. param end return true, param end, nodes_needed = check_region, func = function(name, param) local result, count = worldedit.serialize(worldedit.pos1[name], worldedit.pos2[name]) detect_misaligned_schematic(name, worldedit.pos1[name], worldedit.pos2[name]) local path = minetest.get_worldpath() .. "/schems" -- Create directory if it does not already exist minetest.mkdir(path) local filename = path .. "/" .. param .. ".we" local file, err = io.open(filename, "wb") if err ~= nil then worldedit.player_notify(name, "Could not save file to \"" .. filename .. "\"") return end file:write(result) file:flush() file:close() worldedit.player_notify(name, count .. " nodes saved") end, }) worldedit.register_command("allocate", { params = "<file>", description = "Set the region defined by nodes from \"(world folder)/schems/<file>.we\" as the current WorldEdit region", privs = {worldedit=true}, require_pos = 1, parse = function(param) if param == "" then return false end if not check_filename(param) then return false, "Disallowed file name: " .. param end return true, param end, func = function(name, param) local pos = worldedit.pos1[name] local filename = minetest.get_worldpath() .. "/schems/" .. param .. ".we" local file, err = io.open(filename, "rb") if err ~= nil then worldedit.player_notify(name, "could not open file \"" .. filename .. "\"") return end local value = file:read("*a") file:close() local version = worldedit.read_header(value) if version == nil or version == 0 then worldedit.player_notify(name, "File is invalid!") return elseif version > worldedit.LATEST_SERIALIZATION_VERSION then worldedit.player_notify(name, "File was created with newer version of WorldEdit!") return end local nodepos1, nodepos2, count = worldedit.allocate(pos, value) if not nodepos1 then worldedit.player_notify(name, "Schematic empty, nothing allocated") return end worldedit.pos1[name] = nodepos1 worldedit.pos2[name] = nodepos2 worldedit.marker_update(name) worldedit.player_notify(name, count .. " nodes allocated") end, }) worldedit.register_command("load", { params = "<file>", description = "Load nodes from \"(world folder)/schems/<file>[.we[m]]\" with position 1 of the current WorldEdit region as the origin", privs = {worldedit=true}, require_pos = 1, parse = function(param) if param == "" then return false end if not check_filename(param) then return false, "Disallowed file name: " .. param end return true, param end, func = function(name, param) local pos = worldedit.pos1[name] if param == "" then worldedit.player_notify(name, "invalid usage: " .. param) return end if not string.find(param, "^[%w \t.,+-_=!@#$%%^&*()%[%]{};'\"]+$") then worldedit.player_notify(name, "invalid file name: " .. param) return end --find the file in the world path local testpaths = { minetest.get_worldpath() .. "/schems/" .. param, minetest.get_worldpath() .. "/schems/" .. param .. ".we", minetest.get_worldpath() .. "/schems/" .. param .. ".wem", } local file, err for index, path in ipairs(testpaths) do file, err = io.open(path, "rb") if not err then break end end if err then worldedit.player_notify(name, "could not open file \"" .. param .. "\"") return end local value = file:read("*a") file:close() local version = worldedit.read_header(value) if version == nil or version == 0 then worldedit.player_notify(name, "File is invalid!") return elseif version > worldedit.LATEST_SERIALIZATION_VERSION then worldedit.player_notify(name, "File was created with newer version of WorldEdit!") return end local count = worldedit.deserialize(pos, value) worldedit.player_notify(name, count .. " nodes loaded") end, }) worldedit.register_command("lua", { params = "<code>", description = "Executes <code> as a Lua chunk in the global namespace", privs = {worldedit=true, server=true}, parse = function(param) return true, param end, func = function(name, param) local err = worldedit.lua(param) if err then worldedit.player_notify(name, "code error: " .. err) minetest.log("action", name.." tried to execute "..param) else worldedit.player_notify(name, "code successfully executed", false) minetest.log("action", name.." executed "..param) end end, }) worldedit.register_command("luatransform", { params = "<code>", description = "Executes <code> as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region", privs = {worldedit=true, server=true}, require_pos = 2, parse = function(param) return true, param end, nodes_needed = check_region, func = function(name, param) local err = worldedit.luatransform(worldedit.pos1[name], worldedit.pos2[name], param) if err then worldedit.player_notify(name, "code error: " .. err, false) minetest.log("action", name.." tried to execute luatransform "..param) else worldedit.player_notify(name, "code successfully executed", false) minetest.log("action", name.." executed luatransform "..param) end end, }) worldedit.register_command("mtschemcreate", { params = "<file>", description = "Save the current WorldEdit region using the Minetest ".. "Schematic format to \"(world folder)/schems/<filename>.mts\"", privs = {worldedit=true}, require_pos = 2, parse = function(param) if param == "" then return false end if not check_filename(param) then return false, "Disallowed file name: " .. param end return true, param end, nodes_needed = check_region, func = function(name, param) local path = minetest.get_worldpath() .. "/schems" -- Create directory if it does not already exist minetest.mkdir(path) local filename = path .. "/" .. param .. ".mts" local ret = minetest.create_schematic(worldedit.pos1[name], worldedit.pos2[name], worldedit.prob_list[name], filename) if ret == nil then worldedit.player_notify(name, "Failed to create Minetest schematic") else worldedit.player_notify(name, "Saved Minetest schematic to " .. param) end worldedit.prob_list[name] = {} end, }) worldedit.register_command("mtschemplace", { params = "<file>", description = "Load nodes from \"(world folder)/schems/<file>.mts\" with position 1 of the current WorldEdit region as the origin", privs = {worldedit=true}, require_pos = 1, parse = function(param) if param == "" then return false end if not check_filename(param) then return false, "Disallowed file name: " .. param end return true, param end, func = function(name, param) local pos = worldedit.pos1[name] local path = minetest.get_worldpath() .. "/schems/" .. param .. ".mts" if minetest.place_schematic(pos, path) == nil then worldedit.player_notify(name, "failed to place Minetest schematic") else worldedit.player_notify(name, "placed Minetest schematic " .. param .. " at " .. minetest.pos_to_string(pos)) end end, }) worldedit.register_command("mtschemprob", { params = "start/finish/get", description = "Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry", privs = {worldedit=true}, parse = function(param) if param ~= "start" and param ~= "finish" and param ~= "get" then return false, "unknown subcommand: " .. param end return true, param end, func = function(name, param) if param == "start" then --start probability setting worldedit.set_pos[name] = "prob" worldedit.prob_list[name] = {} worldedit.player_notify(name, "select Minetest schematic probability values by punching nodes") elseif param == "finish" then --finish probability setting worldedit.set_pos[name] = nil worldedit.player_notify(name, "finished Minetest schematic probability selection") elseif param == "get" then --get all nodes that had probabilities set on them local text = "" local problist = worldedit.prob_list[name] if problist == nil then return end for k,v in pairs(problist) do local prob = math.floor(((v.prob / 256) * 100) * 100 + 0.5) / 100 text = text .. minetest.pos_to_string(v.pos) .. ": " .. prob .. "% | " end worldedit.player_notify(name, "currently set node probabilities:") worldedit.player_notify(name, text) end end, }) minetest.register_on_player_receive_fields(function(player, formname, fields) if formname == "prob_val_enter" and not (fields.text == "" or fields.text == nil) then local name = player:get_player_name() local prob_entry = {pos=worldedit.prob_pos[name], prob=tonumber(fields.text)} local index = table.getn(worldedit.prob_list[name]) + 1 worldedit.prob_list[name][index] = prob_entry end end) worldedit.register_command("clearobjects", { params = "", description = "Clears all objects within the WorldEdit region", privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local count = worldedit.clear_objects(worldedit.pos1[name], worldedit.pos2[name]) worldedit.player_notify(name, count .. " objects cleared") end, })
--[[ MIT License Copyright (c) 2020 LeoDeveloper Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Github: https://github.com/le0developer/awluas/blob/master/util/xml.moon Automatically generated and compiled on Sun Sep 13 11:36:56 2020 ]] local XML XML = function(f) local body = { } local last_body = 1 local A A = function(...) local _list_0 = { ... } for _index_0 = 1, #_list_0 do local s = _list_0[_index_0] body[last_body] = s last_body = last_body + 1 end end local E E = function(name, keyword_arguments, sub) assert(type(name) == "string", "argument #1 must be string, not " .. tostring(type(name))) assert(keyword_arguments == nil or type(keyword_arguments) == "table", "argument #2 must be nil or table, not " .. tostring(type(keyword_arguments))) assert(sub == nil or type(sub) == "function", "argument #3 must be function, not " .. tostring(child)) A("<", name) if keyword_arguments then for key, value in pairs(keyword_arguments) do assert(type(key) == "string", "XML keys must be string, not " .. tostring(type(key))) A(" ", key, "=") if type(value) == "table" then A("[") for i, val in ipairs(value) do A(("%q"):format(tostring(val))) if i < #value then A(", ") end end A("]") else A(("%q"):format(tostring(value))) end end end if sub then A(">") sub() return A("</", name, ">") else return A("/>") end end f(E) return table.concat(body, "") end return { XML = XML }
local RunService = game:GetService("RunService") local rs = require(script.Parent["RocketSysIII"].MainModule) local stage1 = { name = "stage1"; model = workspace.RocketStages.Stage1; specificImpulseASL =282; specificImpulseVac =311; wetMass = 410365.5; dryMass = 93490.5; burnRate = 1956; dragCoefficient = Vector3.new(1 ,0.8, 1) } local stage2 = { name = "stage2"; model = workspace.RocketStages.Stage2; specificImpulseASL = 348; specificImpulseVac = 348; wetMass = 137263.5; dryMass = 31638.5; burnRate = 266.1; dragCoefficient = Vector3.new(1, 0.8, 1) } local fairing = { name = "fairing"; model = workspace.RocketStages.Fairing; specificImpulseASL = 0; specificImpulseVac = 0; wetMass = 1900; dryMass = 1900; burnRate = 0; dragCoefficient = Vector3.new(1, 0.25, 1) } local rocket, rocket2 RunService.Heartbeat:Connect(function() if rocket then rocket:update() end if rocket2 then rocket2:update() end end) wait(2) rocket = rs.Rocket.new(stage1, stage2, fairing) rocket.stages.stage1:setThrottle(1) rocket:setOrientationGoal(Vector3.new(80, 0, 0), 200) wait(100) rocket.stages.stage1:setThrottle(0) wait(1) rocket.stages.stage1:separate() rocket.stages.stage2:setThrottle(1)
--[[---------------------------------------------------------------------------- MyMetadataTagsetAll.lua MyMetadata.lrplugin -------------------------------------------------------------------------------- ADOBE SYSTEMS INCORPORATED Copyright 2008 Adobe Systems Incorporated All Rights Reserved. NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms of the Adobe license agreement accompanying it. If you have received this file from a source other than Adobe, then your use, modification, or distribution of it requires the prior written permission of Adobe. ------------------------------------------------------------------------------]] -------------------------------------------------------------------------------- -- NOTE to developers reading this sample code: This file is used to generate -- the documentation for the "metadata tagset provider" section of the API -- reference material. This means it's more verbose than it would otherwise -- be, but also means that you can match up the documentation with an actual -- working example. It is not necessary for you to preserve any of the -- documentation comments in your own code. --===========================================================================-- --[[ @sdk --- The <i>metadata-tagset provider</i> is a Lua file that returns a tagset -- definition for filtering metadata displayed in the Library module's Metadata -- panel. Tagset defintions available to Lightroom are selected using the -- drop-down menu at the top left of the Metadata panel. -- <p>First supported in version 2.0 of the Lightroom SDK.</p> -- @module_type Plug-in provided module 'SDK - Metadata tagset provider' -- not actually executed, but suffices to trick LuaDocs --]] --============================================================================-- return { -------------------------------------------------------------------------------- --- (string, required) This table member defines the localizable display name of -- the tagset, which appears in the popup menu for the Metadata panel. -- @name title -- @class property title = "EXIF and IPTC and Extensions", -------------------------------------------------------------------------------- --- (string, required) This table member defines an identifier for this tagset -- that is unique within this plug-in. The name must conform to the same naming -- conventions as Lua variables; that is, it must start with a letter, followed -- by letters or numbers. Case is significant. -- @name id -- @class property id = 'MyMetadataTagsetAll', -------------------------------------------------------------------------------- --- (table, required) This table member defines an array of metadata fields that -- appear in this tagset, in order of appearance. Each entry in the items array -- identifies a field to be included in the Metadata menu. It can be a simple -- string specifying the field name, or an array that specifies the field name -- and additional information about that field. -- <p>If present, it should be a table containing the following elements: -- <ul> -- <li>(string) The first element in the array is the unique identifying -- name of the field, or one of the special values described below.</li> -- <li><b>height_in_lines</b>: (number) (optional) For text-entry fields, -- the number of lines of text for the field.</li> -- <li><b>label</b>: (string, optional) When the field name is the special -- value 'com.adobe.label', this is the localizable string to use as the section label.</li> -- </ul></p> -- <p>The field names accepted within tagsets are as follows: -- <ul> -- <li><b>com.adobe.filename</b>: The leaf name of the file -- (for example, "myFile.jpg").</li> -- <li><b>com.adobe.originalFilename.ifDiffers</b>: The leaf -- name of the file (for example, "myFile.jpg") prior to renaming. -- Only displayed if differs from the current file name.</li> -- <li><b>com.adobe.sidecars</b>: If any "sidecar" files are -- associated with this file (for instance, .xmp or .thm files), -- this item will list the extensions of those files.</li> -- <li><b>com.adobe.copyname</b>: The name associated with this copy.</li> -- <li><b>com.adobe.folder</b>: The name of the folder the file is in.</li> -- <li><b>com.adobe.filesize</b>: The formatted size of the file -- (for example, "6.01 MB")</li> -- <li><b>com.adobe.fileFormat</b>: The user-visible file type -- (DNG, RAW, etc.).</li> -- <li><b>com.adobe.metadataStatus</b>: The status of the metadata -- in the file, as compared to the metadata in the Lightroom catalog. -- Typical values (in English) are "Up to date", "Has been changed", -- or "Conflict exists". (This list is not exhaustive.)</li> -- <li><b>com.adobe.metadataDate</b>: Date/time when Lightroom last -- updated metadata in this file.</li> -- <li><b>com.adobe.audioAnnotation</b>: If an audio file (typically .wav file) -- is associated with this photo, this will contain the name of that -- file. Only displayed if there is an audio file.</li> -- <li><b>com.adobe.separator</b>: Inserts a dividing line.</li> -- <li><b>com.adobe.rating</b>: The user rating of the file (number of stars).</li> -- <li><b>com.adobe.colorLabels</b>: The name of assigned color label. Despite -- the plural name, only one color label can be assigned to a photo.</li> -- <li><b>com.adobe.title</b>: The title of photo.</li> -- <li><b>com.adobe.caption</b>: The caption for photo.</li> -- <li><b>com.adobe.label</b>: This entry allows you to insert a custom -- label describing the items that follow it.</li> -- <li><b>com.adobe.imageFileDimensions</b>: The original dimensions of -- the file (for example, "3072 x 2304").</li> -- <li><b>com.adobe.imageCroppedDimensions</b>: The cropped dimensions of -- file (for example, "3072 x 2304").</li> -- <li><b>com.adobe.exposure</b>: The exposure summary (for example, "1/60 sec at f/2.8")</li> -- exposureTime? -- <li><b>com.adobe.shutterSpeedValue</b>: The shutter speed (for example, "1/60 sec")</li> -- <li><b>com.adobe.apertureValue</b>: The aperture (for example, "f/2.8")</li> -- <li><b>com.adobe.brightnessValue</b>: The brightness value</li> -- <li><b>com.adobe.exposureBiasValue</b>: The exposure bias/compensation (for example, "-2/3 EV")</li> -- <li><b>com.adobe.flash</b>: Whether the flash fired or not (for example, "Did fire")</li> -- <li><b>com.adobe.exposureProgram</b>: The exposure program (for example, "Aperture priority")</li> -- <li><b>com.adobe.meteringMode</b>: The metering mode (for example, "Pattern")</li> -- <li><b>com.adobe.ISOSpeedRating</b>: The ISO speed rating (for example, "ISO 200")</li> -- <li><b>com.adobe.focalLength</b>: The focal length of lens as shot (for example, "132 mm")</li> -- <li><b>com.adobe.focalLength35mm</b>: The focal length as 35mm equivalent (for example, "211 mm")</li> -- <li><b>com.adobe.lens</b>: The lens (for example, "28.0-135.0 mm")</li> -- <li><b>com.adobe.subjectDistance</b>: The subject distance (for example, "3.98 m"). Approximate value only, and some camera vendors discourage its use.</li> -- <li><b>com.adobe.dateTimeOriginal</b>: The date and time of capture (for example, "09/15/2005 17:32:50") -- Formatting can vary based on the user's localization settings</li> -- <li><b>com.adobe.dateTimeDigitized</b>: The date and time of scanning (for example, "09/15/2005 17:32:50") -- Formatting can vary based on the user's localization settings</li> -- <li><b>com.adobe.dateTime</b>: Adjusted date and time (for example, "09/15/2005 17:32:50") -- Formatting can vary based on the user's localization settings</li> -- <li><b>com.adobe.make</b>: The camera manufacturer</li> -- <li><b>com.adobe.model</b>: The camera model</li> -- <li><b>com.adobe.serialNumber</b>: The camera serial number</li> -- <li><b>com.adobe.userComment</b>: The comments recorded by the user in camera</li> -- <li><b>com.adobe.artist</b>: The artist's name</li> -- <li><b>com.adobe.software</b>: The software used to process/create photo</li> -- <li><b>com.adobe.GPS</b>: The location of this photo (for example, "37&deg;56'10" N 27&deg;20'42" E")</li> -- <li><b>com.adobe.GPSAltitude</b>: The GPS altitude for this photo (for example, "82.3 m")</li> -- <li><b>com.adobe.GPSImgDirection</b>: The GPS direction for this photo (for example, "South")</li> -- <li><b>com.adobe.creator</b>: The name of the person that created this image</li> -- <li><b>com.adobe.creatorJobTitle</b>: The job title of the person that created this image</li> -- <li><b>com.adobe.creatorAddress</b>: The address for the person that created this image</li> -- <li><b>com.adobe.creatorCity</b>: The city for the person that created this image</li> -- <li><b>com.adobe.creatorState</b>: The state or city for the person that created this image</li> -- <li><b>com.adobe.creatorZip</b>: The postal code for the person that created this image</li> -- <li><b>com.adobe.creatorCountry</b>: The country for the person that created this image</li> -- <li><b>com.adobe.creatorWorkPhone</b>: The phone number for the person that created this image</li> -- <li><b>com.adobe.creatorWorkEmail</b>: The email address for the person that created this image</li> -- <li><b>com.adobe.creatorWorkWebsite</b>: The web URL for the person that created this image</li> -- <li><b>com.adobe.headline</b>: A brief, publishable synopsis or summary of the contents of this image</li> -- <li><b>com.adobe.iptcSubjectCode</b>: Values from the IPTC Subject NewsCode Controlled Vocabulary (see: http://www.newscodes.org/)</li> -- <li><b>com.adobe.descriptionWriter</b>: The name of the person involved in writing, editing or correcting the description of the image </li> -- <li><b>com.adobe.category</b>: Deprecated field; included for transferring legacy metadata</li> -- <li><b>com.adobe.supplementalCategories</b>: Deprecated field; included for transferring legacy metadata</li> -- <li><b>com.adobe.dateCreated</b>: The IPTC-formatted creation date (for example, "2005-09-20T15:10:55Z")</li> -- <li><b>com.adobe.intellectualGenre</b>: A term to describe the nature of the image in terms of its intellectual or journalistic characteristics, such as daybook, or feature (examples at: http://www.newscodes.org/)</li> -- <li><b>com.adobe.scene</b>: Values from the IPTC Scene NewsCodes Controlled Vocabulary (see: http://www.newscodes.org/)</li> -- <li><b>com.adobe.location</b>: Details about a location which is shown in this image</li> -- <li><b>com.adobe.city</b>: The name of the city pictured in this image</li> -- <li><b>com.adobe.state</b>: The name of the state pictured in this image </li> -- <li><b>com.adobe.country</b>: The name of the country pictured in this image</li> -- <li><b>com.adobe.isoCountryCode</b>: The 2 or 3 letter ISO 3166 Country Code of the country pictured in this image</li> -- <li><b>com.adobe.jobIdentifier</b>: A number or identifier needed for workflow control or tracking</li> -- <li><b>com.adobe.instructions</b>: Information about embargoes, or other restrictions not covered by the Rights Usage field</li> -- <li><b>com.adobe.provider</b>: Name of person who should be credited when this image is published</li> -- <li><b>com.adobe.source</b>: The original owner of the copyright of this image</li> -- <li><b>com.adobe.copyright</b>: The copyright text for this image</li> -- <li><b>com.adobe.rightsUsageTerms</b>: Instructions on how this image can legally be used</li> -- <li><b>com.adobe.copyrightInfoURL</b></li> -- <li><b>com.adobe.allPluginMetadata</b>: All metadata defined by plug-ins.</li> -- <li><b><i>(plugin ID)</i>.*</b>: All metadata defined by the plug-in with the given ID.</li> -- <li><b><i>(plugin ID)</i>.<i>(field ID)</i></b>: A specific plug-in provided metadata field.</li> -- </ul> -- <p>The following items are first supported in version 3.0 of the Lightroom SDK.</p> -- <ul> -- <li><b>com.adobe.personInImage</b>: Name of a person shown in the image</li> -- <li><b>com.adobe.locationCreated</b>: The Location the photo was taken. Each element in the return table is a table which is a structure named LocationDetails as defined in the IPTC Extension spec. Definition details can be found at http://www.iptc.org/std/photometadata/2008/specification/. </li> -- <li><b>com.adobe.locationShown</b>: The Location shown in the image. Each element in the return table is a table which is a structure named LocationDetails as defined in the IPTC Extension spec. Definition details can be found at http://www.iptc.org/std/photometadata/2008/specification/. </li> -- <li><b>com.adobe.organisationInImageName</b>: Name of the organization or company which is featured in the image</li> -- <li><b>com.adobe.organisationInImageCode</b>: Code from a controlled vocabulary for identifying the organization or company which is featured in the image</li> -- <li><b>com.adobe.event</b>: Names or describes the specific event at which the photo was taken</li> -- <li><b>com.adobe.artworkOrObject</b>: A set of metadata about artwork or an object in the image. Each element in the return table is a table which is a structure named ArtworkOrObjectDetails as defined in the IPTC Extension spec. Definition details can be found at http://www.iptc.org/std/photometadata/2008/specification/. </li> -- <li><b>com.adobe.additionalModelInfo</b>: Information about the ethnicity and other facets of model(s) in a model-released image</li> -- <li><b>com.adobe.modelAge</b>: Age of human model(s) at the time this image was taken in a model released image</li> -- <li><b>com.adobe.minorModelAgeDisclosure</b>: Age of the youngest model pictured in the image, at the time that the image was made.</li> -- <li><b>com.adobe.modelReleaseStatus</b>: Summarizes the availability and scope of model releases authorizing usage of the likenesses of persons appearing in the photograph.</li> -- <li><b>com.adobe.modelReleaseID</b>: A PLUS-ID identifying each Model Release</li> -- <li><b>com.adobe.imageSupplier</b>: Identifies the most recent supplier of item, who is not necessarily its owner or creator. Each element in the return table is a table which is a structure named ImageSupplierDetail defined in PLUS. Definition details can be found at http://ns.useplus.org/LDF/ldf-XMPReference. </li> -- <li><b>com.adobe.imageSupplierImageId</b>: Identifier assigned by the Image Supplier. Definition details can be found at http://ns.useplus.org/LDF/ldf-XMPReference. </li> -- <li><b>com.adobe.registryId</b>: Both a Registry Item Id and a Registry Organization Id to record any registration of this item with a registry. Each element in the return table is a table which is a structure named RegistryEntryDetail as defined in the IPTC Extension spec. Definition details can be found at http://www.iptc.org/std/photometadata/2008/specification/. </li> -- <li><b>com.adobe.maxAvailWidth</b>: The maximum available width in pixels of the original photo from which this photo has been derived by downsizing</li> -- <li><b>com.adobe.maxAvailHeight</b>: The maximum available height in pixels of the original photo from which this photo has been derived by downsizing</li> -- <li><b>com.adobe.digitalSourceType</b>: The type of the source of this digital image, selected from a controlled vocabulary</li> -- <li><b>com.adobe.imageCreator</b>: Creator or creators of the image. Each element in the return table is a table which is a structure named ImageCreatorDetail defined in PLUS. Definition details can be found at http://ns.useplus.org/LDF/ldf-XMPReference. </li> -- <li><b>com.adobe.copyrightOwner</b>: Owner or owners of the copyright in the licensed image. Each element in the return table is a table which is a structure named CopyrightOwnerDetail defined in PLUS. Definition details can be found at http://ns.useplus.org/LDF/ldf-XMPReference. </li> -- <li><b>com.adobe.licensor</b>: A person or company that should be contacted to obtain a license for using the item or who has licensed the item. Each element in the return table is a table which is a structure named LicensorDetail defined in PLUS. Definition details can be found at http://ns.useplus.org/LDF/ldf-XMPReference. </li> -- <li><b>com.adobe.propertyReleaseID</b>: A PLUS-ID identifying each Property Release</li> -- <li><b>com.adobe.propertyReleaseStatus</b>: Summarizes the availability and scope of property releases authorizing usage of the likenesses of persons appearing in the photograph.</li> -- <li><b>com.adobe.digImageGUID</b>: Globally unique identifier for the item, created and applied by the creator of the item at the time of its creation</li> -- <li><b>com.adobe.plusVersion</b>: The version number of the PLUS standards in place at the time of the transaction</li> -- </ul> -- <p>The following items are first supported in version 4.0 of the Lightroom SDK.</p> -- <ul> -- <li><b>com.adobe.duration</b>: The duration of the media file in minutes and seconds. (for example, 01:59.0)</li> -- <li><b>com.adobe.duration.combined.optional</b>: The duration of the media file, and the duration of the trimmed media file (if trimmed).</li> -- <li><b>com.adobe.trimmed_duration.optional</b>: The duration of the trimmed media file (if trimmed).</li> -- <li><b>com.adobe.videoFrameRate</b>: The video frame rate, in frames per second.</li> -- <li><b>com.adobe.videoAlphaMode</b>: The alpha mode (for example, straight, pre-multiplied or none).</li> -- <li><b>com.adobe.videoFrameSize</b>: The frame size in pixels. For example: 640 x 480.</li> -- <li><b>com.adobe.audioChannelType</b>: The audio channel type. Valid text values are predefined in the XMP Dynamic Media namespace. Details can be found at http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart2.pdf</li> -- <li><b>com.adobe.audioSampleRate</b>: The audio sample rate. Can be any value, but commonly 32000, 44100, or 48000 Hz.</li> -- <li><b>com.adobe.audioSampleType</b>: The audio sample type.</li> -- <li><b>com.adobe.speakerPlacement</b>: A description of the speaker angles from centre front in degrees. For example: &quot;Left = -30, Right = 30, Centre = 0, LFE = 45, Left Surround = -110, Right Surround = 110&quot;</li> -- <li><b>com.adobe.tapeName</b>: The name of the tape from which the clip was captured, as set during the capture process.</li> -- <li><b>com.adobe.altTapeName</b>: An alternative tape name.</li> -- <li><b>com.adobe.dm_scene</b>: The name of the scene.</li> -- <li><b>com.adobe.shotName</b>: The name of the shot or take.</li> -- <li><b>com.adobe.shotDate</b>: The date and time when the video was shot.</li> -- <li><b>com.adobe.shotLocation</b>: The name of the location where the video was shot. For example: &quot;Oktoberfest, Munich Germany&quot;</li> -- <li><b>com.adobe.logComment</b>: User&rs_quot;s log comments.</li> -- <li><b>com.adobe.dm_artist</b>: The name of the artist or artists.</li> -- <li><b>com.adobe.album</b>: The name of the album.</li> -- <li><b>com.adobe.genre</b>: The name of the genre.</li> -- <li><b>com.adobe.releaseDate</b>: The date the title was released.</li> -- <li><b>com.adobe.composer</b>: The composer&rs_quot;s name.</li> -- <li><b>com.adobe.engineer</b>: The engineer&rs_quot;s name.</li> -- <li><b>com.adobe.instrument</b>: The musical instrument.</li> -- <li><b>com.adobe.comment</b>: A user&rs_quot;s comments</li> -- <li><b>com.adobe.client</b>: The client for the job of which this shot or take is a part.</li> -- <li><b>com.adobe.good</b>: A selection for tracking whether a shot is a keeper.</li> -- <li><b>com.adobe.projectName</b>: The name of the project of which this file is a part.</li> -- <li><b>com.adobe.director</b>: The director of the scene.</li> -- <li><b>com.adobe.directorPhotography</b>: The director of photography for the scene.</li> -- <li><b>com.adobe.cameraModel</b>: The make and model of the camera used for a shoot.</li> -- <li><b>com.adobe.cameraAngle</b>: The orientation of the camera to the subject in a static shot, from a fixed set of industry standard terminology. A selection from values are predefined in the XMP Dynamic Media namespace. Details can be found at http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart2.pdf</li> -- <li><b>com.adobe.cameraMove</b>: The movement of the camera during the shot, from a fixed set of industry standard terminology. A selection from values are predefined in the XMP Dynamic Media namespace. Details can be found at http://www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart2.pdf</li> -- <li><b>com.adobe.shotDay</b>: The day in a multiday shoot. For example: "Day 2&quot;, &quot;Friday&quot;.</li> -- <li><b>com.adobe.dng.version</b>: The version of the DNG standard used by the image.</li> -- <li><b>com.adobe.dng.backwardVersion</b>: The version of the DNG standard this image is backwards compatible with.</li> -- <li><b>com.adobe.dng.compatibility</b>: The earliest version of Lightroom this image is compatible with.</li> -- <li><b>com.adobe.dng.hasFastLoadData</b>: Whether the DNG has fast load data embedded or not (for example, "Embedded").</li> -- <li><b>com.adobe.dng.lossyCompression</b>: Whether the DNG uses lossy compression or not (for example, "No").</li> -- <li><b>com.adobe.dng.hasEmbeddedOriginalRawFile</b>: Whether the DNG has the original raw file embedded or not (for example, "None Embedded").</li> -- <li><b>com.adobe.dng.hasMosaicData</b>: Whether the DNG contains mosaic data or not (for example, "Yes").</li> -- <li><b>com.adobe.dng.hasTransparency</b>: Whether the DNG contains transparency data or not (for example, "No").</li> -- <li><b>com.adobe.dng.floatingPointType</b>: Whether the DNG uses integer or floating point pixel data (for example, "Integer").</li> -- <li><b>com.adobe.dng.bitsPerSample</b>: The number of bits used per DNG data sample.</li> -- <li><b>com.adobe.dng.originalRawFileName</b>: The name of the original raw file used when creating the DNG.</li> -- <li><b>com.adobe.dng.originalImageDimensions</b>: The dimensions of the original raw file used when creating the DNG (for example, "4288 x 2848").</li> -- <li><b>com.adobe.dng.imageDimensions</b>: The dimensions of the DNG image file (for example, "4288 x 2848").</li> -- <li><b>com.adobe.dng.previewDimensions</b>: The dimensions of the embedded preview within this DNG image file (for example, "3882 x 2579").</li> -- </ul> -- @name items -- @class property items = { "com.adobe.separator", { formatter = "com.adobe.label", label = "keywordTags", }, "com.adobe.keywordTags", -- does this work? "com.adobe.separator", { formatter = "com.adobe.label", label = "kwTagsForExport", }, "com.adobe.keywordTagsForExport", -- does this work? "com.adobe.separator", "com.adobe.filename", "com.adobe.originalFilename.ifDiffers", "com.adobe.sidecars", "com.adobe.copyname", "com.adobe.folder", "com.adobe.filesize", "com.adobe.fileFormat", "com.adobe.metadataStatus", "com.adobe.metadataDate", "com.adobe.audioAnnotation", "com.adobe.separator", "com.adobe.rating", "com.adobe.separator", "com.adobe.colorLabels", "com.adobe.separator", "com.adobe.title", { "com.adobe.caption", height_in_lines = 3 }, "com.adobe.separator", { formatter = "com.adobe.label", label = "EXIF", }, "com.adobe.imageFileDimensions", -- dimensions "com.adobe.imageCroppedDimensions", "com.adobe.exposure", -- exposure factors "com.adobe.brightnessValue", "com.adobe.exposureBiasValue", "com.adobe.flash", "com.adobe.exposureProgram", "com.adobe.meteringMode", "com.adobe.ISOSpeedRating", "com.adobe.focalLength", -- lens info "com.adobe.focalLength35mm", "com.adobe.lens", "com.adobe.subjectDistance", "com.adobe.dateTimeOriginal", "com.adobe.dateTimeDigitized", "com.adobe.dateTime", "com.adobe.make", -- camera "com.adobe.model", "com.adobe.serialNumber", 'com.adobe.userComment', "com.adobe.artist", "com.adobe.software", "com.adobe.GPS", -- gps "com.adobe.GPSAltitude", "com.adobe.GPSImgDirection", "com.adobe.separator", { formatter = "com.adobe.label", label = "Contact", }, "com.adobe.creator", { formatter = "com.adobe.creatorJobTitle", form = "short_title" }, { formatter = "com.adobe.creatorAddress", form = "short_title" }, { formatter = "com.adobe.creatorCity", form = "short_title" }, { formatter = "com.adobe.creatorState", form = "short_title" }, { formatter = "com.adobe.creatorZip", form = "short_title" }, { formatter = "com.adobe.creatorCountry", form = "short_title" }, { formatter = "com.adobe.creatorWorkPhone", form = "short_title" }, { formatter = "com.adobe.creatorWorkEmail", form = "short_title" }, { formatter = "com.adobe.creatorWorkWebsite", form = "short_title" }, "com.adobe.separator", { formatter = "com.adobe.label", label = "IPTC", }, "com.adobe.headline", "com.adobe.iptcSubjectCode", "com.adobe.descriptionWriter", "com.adobe.category", "com.adobe.supplementalCategories", { formatter = "com.adobe.label", label = "Image", }, "com.adobe.dateCreated", "com.adobe.intellectualGenre", "com.adobe.scene", "com.adobe.location", "com.adobe.city", "com.adobe.state", "com.adobe.country", "com.adobe.isoCountryCode", { formatter = "com.adobe.label", label = "Workflow", }, "com.adobe.jobIdentifier", "com.adobe.instructions", "com.adobe.provider", "com.adobe.source", { formatter = "com.adobe.label", label = "Copyright", }, { "com.adobe.copyrightState", pruneRedundantFields = false }, "com.adobe.copyright", "com.adobe.rightsUsageTerms", "com.adobe.copyrightInfoURL", "com.adobe.separator", { formatter = "com.adobe.label", label = "IPTC Extension", }, -- might want to enable this if the user can ever do anything useful with it -- for example, he might want to look the photo up in a global db of some sort "com.adobe.digImageGUID", "com.adobe.separator", { formatter = "com.adobe.label", label = "Description", }, { formatter = "com.adobe.personInImage", form = "short_title" }, { formatter = "com.adobe.locationCreated", form = "short_title" }, { formatter = "com.adobe.locationShown", form = "short_title" }, { formatter = "com.adobe.organisationInImageName", form = "short_title" }, { formatter = "com.adobe.organisationInImageCode", form = "short_title" }, "com.adobe.event", "com.adobe.separator", { formatter = "com.adobe.label", label = "Artworks", }, { formatter = "com.adobe.artworkOrObject", form = "short_title" }, "com.adobe.separator", { formatter = "com.adobe.label", label = "Models", }, { formatter = "com.adobe.additionalModelInfo", form = "short_title" }, "com.adobe.modelAge", { formatter = "com.adobe.minorModelAgeDisclosure", form = "short_title" }, "com.adobe.modelReleaseStatus", "com.adobe.modelReleaseID", "com.adobe.separator", { formatter = "com.adobe.label", label = "Admin", }, "com.adobe.imageSupplier", "com.adobe.imageSupplierImageId", "com.adobe.registryId", "com.adobe.maxAvailHeight", "com.adobe.maxAvailWidth", { formatter = "com.adobe.digitalSourceType", form = "short_title" }, "com.adobe.separator", { formatter = "com.adobe.label", label = "Rights", }, "com.adobe.imageCreator", "com.adobe.copyrightOwner", "com.adobe.licensor", { formatter = "com.adobe.propertyReleaseID", form = "short_title" }, { formatter = "com.adobe.propertyReleaseStatus", form = "short_title" }, "com.adobe.separator", { formatter = "com.adobe.label", label = "Video", }, "com.adobe.duration.combined.optional", "com.adobe.duration", "com.adobe.trimmed_duration.optional", "com.adobe.videoFrameRate", "com.adobe.videoAlphaMode", "com.adobe.videoFrameSize", "com.adobe.audioChannelType", "com.adobe.audioSampleRate", "com.adobe.audioSampleType", "com.adobe.separator", "com.adobe.speakerPlacement", "com.adobe.tapeName", "com.adobe.altTapeName", "com.adobe.dm_scene", "com.adobe.shotName", "com.adobe.shotDate", "com.adobe.shotLocation", "com.adobe.logComment", "com.adobe.separator", "com.adobe.dm_artist", "com.adobe.album", "com.adobe.genre", "com.adobe.releaseDate", "com.adobe.composer", "com.adobe.engineer", "com.adobe.instrument", "com.adobe.separator", "com.adobe.comment", "com.adobe.client", "com.adobe.good", "com.adobe.projectName", "com.adobe.director", "com.adobe.directorPhotography", "com.adobe.cameraModel", "com.adobe.cameraAngle", "com.adobe.cameraMove", "com.adobe.shotDay", "com.adobe.separator", { formatter = "com.adobe.label", label = "DNG Info", }, "com.adobe.dng.version", "com.adobe.dng.backwardVersion", "com.adobe.dng.compatibility", "com.adobe.separator", "com.adobe.dng.hasFastLoadData", "com.adobe.dng.lossyCompression", "com.adobe.dng.hasEmbeddedOriginalRawFile", "com.adobe.dng.hasMosaicData", "com.adobe.dng.hasTransparency", "com.adobe.dng.floatingPointType", "com.adobe.dng.bitsPerSample", "com.adobe.separator", "com.adobe.dng.originalRawFileName", "com.adobe.dng.originalImageDimensions", "com.adobe.dng.imageDimensions", "com.adobe.dng.previewDimensions", "com.adobe.separator", { formatter = "com.adobe.label", label = "Others", }, "com.adobe.plusVersion", "com.adobe.allPluginMetadata", -- separator and label will be added automatically for each plug-in }, }
Cannon = Entity:extend() Cannon.shotFrame = Assets.load("data/images/shot.png") function Cannon:new(tank) Cannon.super.new(self) self.tank = tank self:loadImage("data/images/" .. self.tank.name .. ".png", 16, 20) self:addAnimation("main", { 2 }, 20) self:playAnimation("main") self.rotationAngle = 0 self.speed = 1 self.moves = true self.origin.x = 8 self.origin.y = 12 self.delay = 0 self.justShot = 0 self.reloadTime = self.tank.info.reloadTime end function Cannon:update(dt) Cannon.super.update(self, dt) self.delay = self.delay - dt if self.delay < 0 then self.delay = 0 end self.x = self.tank.x self.y = self.tank.y self.angle = self.tank.angle + self.rotationAngle self.angularVelocity = self.angularVelocity * 0.5 end function Cannon:draw() Cannon.super.draw(self) if self.justShot > 0 then local a = math.rad(self.angle - 90) local x = self.x + math.cos(a) * 12 + self.origin.x local y = self.y + math.sin(a) * 12 + self.origin.y love.graphics.draw(Cannon.shotFrame, x, y, 0, 1, 1, 4, 4) end self.justShot = self.justShot - 1 end function Cannon:rotateRight() self.rotationAngle = self.rotationAngle + self.speed end function Cannon:rotateLeft() self.rotationAngle = self.rotationAngle - self.speed end function Cannon:shoot() if self.delay ~= 0 then return end self.delay = self.reloadTime self.justShot = 3 local bullet = Bullet(self.angle, 500, self.tank.info.damage or 10) local a = math.rad(self.angle - 90) bullet.x = self.x + math.cos(a) * 15 + self.origin.x / 2 bullet.y = self.y + math.sin(a) * 15 + self.origin.y / 2 local a = math.rad(self.angle - 90) game:shake(1, 0.2) game.state.scene:add(bullet) self:playSound("data/sounds/shot.wav") end
return { id = "WorldG001", events = { { alpha = 0, code = { "playStory" }, stories = { "GWORLDX001A" } }, { alpha = 0.3, code = { "chooseCamp" }, style = { text = "请选择要加入的阵营", mode = 2, posY = -189.51, dir = -1, posX = 0 } } } }
H.keymap('n', '<leader>tq', ':lua require("harpoon.term").gotoTerminal(0)<cr>', { silent = true }) H.keymap('n', '<leader>tw', ':lua require("harpoon.term").gotoTerminal(1)<cr>', { silent = true }) H.keymap('n', '<leader>te', ':lua require("harpoon.term").gotoTerminal(2)<cr>', { silent = true }) H.keymap('n', '<leader>tr', ':lua require("harpoon.term").gotoTerminal(3)<cr>', { silent = true })
VariantResearch = { kus_allshipbuildspeed = { KUS_ALLSHIPBUILDSPEED, }, kus_allshipbuildspeedexpert = { KUS_ALLSHIPBUILDSPEEDEXPERT, }, kus_allshipbuildspeedhard = { KUS_ALLSHIPBUILDSPEEDHARD, }, kus_cpuplayers_aggressive = { KUS_CPUPLAYERS_AGGRESSIVE, }, kus_cpuplayers_defensive = { KUS_CPUPLAYERS_DEFENSIVE, }, kus_cpuplayers_dynamic = { KUS_CPUPLAYERS_DYNAMIC, }, kus_cpuplayers_norushtime10 = { KUS_CPUPLAYERS_NORUSHTIME10, }, kus_cpuplayers_norushtime15 = { KUS_CPUPLAYERS_NORUSHTIME15, }, kus_cpuplayers_norushtime5 = { KUS_CPUPLAYERS_NORUSHTIME5, }, kus_resourcecollectionrateexpert = { KUS_RESOURCECOLLECTIONRATEEXPERT_RES0_HYP0, KUS_RESOURCECOLLECTIONRATEEXPERT_RES1_HYP0, KUS_RESOURCECOLLECTIONRATEEXPERT_RES0_HYP1, KUS_RESOURCECOLLECTIONRATEEXPERT_RES1_HYP1, }, kus_resourcecollectionratehard = { KUS_RESOURCECOLLECTIONRATEHARD_RES0_HYP0, KUS_RESOURCECOLLECTIONRATEHARD_RES1_HYP0, KUS_RESOURCECOLLECTIONRATEHARD_RES0_HYP1, KUS_RESOURCECOLLECTIONRATEHARD_RES1_HYP1, }, kus_weapondamageupgrade125 = { KUS_WEAPONDAMAGEUPGRADE125, }, kus_weapondamageupgrade150 = { KUS_WEAPONDAMAGEUPGRADE150, }, kus_weapondamageupgrade175 = { KUS_WEAPONDAMAGEUPGRADE175, }, kus_weapondamageupgrade200 = { KUS_WEAPONDAMAGEUPGRADE200, }, kus_corvettechassis = { KUS_CORVETTECHASSIS_HYP0, KUS_CORVETTECHASSIS_HYP1, }, kus_corvettedrive = { KUS_CORVETTEDRIVE_HYP0, KUS_CORVETTEDRIVE_HYP1, }, kus_fasttrackingturrets = { KUS_FASTTRACKINGTURRETS_HYP0, KUS_FASTTRACKINGTURRETS_HYP1, }, kus_heavycorvetteupgrade = { KUS_HEAVYCORVETTEUPGRADE_HYP0, KUS_HEAVYCORVETTEUPGRADE_HYP1, }, kus_minelayingtech = { KUS_MINELAYINGTECH_HYP0, KUS_MINELAYINGTECH_HYP1, }, kus_cloakgenerator = { KUS_CLOAKGENERATOR_HYP0, KUS_CLOAKGENERATOR_HYP1, }, kus_gravitygenerator = { KUS_GRAVITYGENERATOR_HYP0, KUS_GRAVITYGENERATOR_HYP1, }, kus_hyperspacedamagereductionupgrade = { KUS_HYPERSPACEDAMAGEREDUCTIONUPGRADE, }, kus_hyperspacedamagereductionupgradehc = { KUS_HYPERSPACEDAMAGEREDUCTIONUPGRADEHC_HYP0, KUS_HYPERSPACEDAMAGEREDUCTIONUPGRADEHC_HYP1, }, kus_proximitysensor = { KUS_PROXIMITYSENSOR_HYP0, KUS_PROXIMITYSENSOR_HYP1, }, kus_sensorarray = { KUS_SENSORARRAY_HYP0, KUS_SENSORARRAY_HYP1, }, kus_sgmcapitalhealth = { KUS_SGMCAPITALHEALTH, }, kus_sgmfrigatehealth = { KUS_SGMFRIGATEHEALTH, }, kus_sgmgravwellhealth = { KUS_SGMGRAVWELLHEALTH_HYP0, KUS_SGMGRAVWELLHEALTH_HYP1, }, kus_cloakedfighter = { KUS_CLOAKEDFIGHTER_HYP0, KUS_CLOAKEDFIGHTER_HYP1, }, kus_defendersubsystems = { KUS_DEFENDERSUBSYSTEMS_HYP0, KUS_DEFENDERSUBSYSTEMS_HYP1, }, kus_fighterchassis = { KUS_FIGHTERCHASSIS_HYP0, KUS_FIGHTERCHASSIS_HYP1, }, kus_fighterdrive = { KUS_FIGHTERDRIVE_HYP0, KUS_FIGHTERDRIVE_HYP1, }, kus_plasmabomblauncher = { KUS_PLASMABOMBLAUNCHER_HYP0, KUS_PLASMABOMBLAUNCHER_HYP1, }, kus_capitalshipchassis = { KUS_CAPITALSHIPCHASSIS_HYP0, KUS_CAPITALSHIPCHASSIS_HYP1, }, kus_capitalshipdrive = { KUS_CAPITALSHIPDRIVE_HYP0, KUS_CAPITALSHIPDRIVE_HYP1, }, kus_dronetechnology = { KUS_DRONETECHNOLOGY_HYP0, KUS_DRONETECHNOLOGY_HYP1, }, kus_ioncannons = { KUS_IONCANNONS_HYP0, KUS_IONCANNONS_HYP1, }, kus_guidedmissiles = { KUS_GUIDEDMISSILES_HYP0, KUS_GUIDEDMISSILES_HYP1, }, kus_heavyguns = { KUS_HEAVYGUNS_HYP0, KUS_HEAVYGUNS_HYP1, }, kus_supercapitalshipdrive = { KUS_SUPERCAPITALSHIPDRIVE_RES0_HYP0, KUS_SUPERCAPITALSHIPDRIVE_RES1_HYP0, KUS_SUPERCAPITALSHIPDRIVE_RES0_HYP1, KUS_SUPERCAPITALSHIPDRIVE_RES1_HYP1, }, kus_superheavychassis = { KUS_SUPERHEAVYCHASSIS_HYP0, KUS_SUPERHEAVYCHASSIS_HYP1, }, }
jester.help_map.tracker = {} jester.help_map.tracker.description_short = [[Track various states in the channel.]] jester.help_map.tracker.description_long = [[This module provides actions assist in tracking various states in a channel.]] jester.help_map.tracker.actions = {} jester.help_map.tracker.actions.counter = {} jester.help_map.tracker.actions.counter.description_short = [[Incremental custom variable counter.]] jester.help_map.tracker.actions.counter.description_long = [[This action provides a simple method to keep a count of any arbitrary value, and provides access to calling sequences by comparing a number against the total in the counter. It's useful for storing how many times you've done something, eg. on 3rd failed login attempt, hang up. Counters are initialized with a value of zero, and placed in storage area 'counter'.]] jester.help_map.tracker.actions.counter.params = { storage_key = [[(Optional) The key in the 'counter' storage area where the counter value is stored and checked. Default is 'counter']], increment = [[(Optional) Increment the counter by this amount before performing the comparison to the 'compare_to' parameter. Negative increments are allowed. The default is to not increment the counter.]], reset = [[(Optional) Set to true to reset the counter to zero. This happens before any incrementing, so it can be used with incrementing to set a new initial value for the counter.]], compare_to = [[(Optional) The value to compare the current counter value against.]], if_less = [[(Optional) The sequence to call if the counter value is less than the 'compare_to' value.]], if_equal = [[(Optional) The sequence to call if the counter value is equal to the 'compare_to' value.]], if_greater = [[(Optional) The sequence to call if the counter value is greater than the 'compare_to' value.]], }
-- Copyright: 2015-2020, Björn Ståhl -- License: 3-Clause BSD -- Reference: http://durden.arcan-fe.com -- Description: Main event-handlers for different external connections -- and their respective subsegments. Handles registering new windows, -- hinting default sizes, update timers etc. -- Every connection can get a set of additional commands and configurations -- based on what type it has. Supported ones are registered into this table. -- init, bindings, settings, commands local archetypes = {}; -- source-id-to-window-mapping local swm = {}; -- special window overrides (intended for tools) local guid_handler_table = {}; local client_log, fmt = suppl_add_logfn("client"); -- notice that logging server to client commands are done elsewhere as -- the hook is quite costly and we only want to enable it when in an IPC -- monitor. function extevh_lookup(source) return swm[source]; end local function load_archetypes() -- load custom special subwindow handlers local res = glob_resource("atypes/*.lua", APPL_RESOURCE); if (res ~= nil) then for k,v in ipairs(res) do local tbl = system_load("atypes/" .. v, false); tbl = tbl and tbl() or nil; if (tbl and tbl.atype) then archetypes[tbl.atype] = tbl; else warning("couldn't load atype: " .. v); end end end end function extevh_archetype(atype) return archetypes[atype]; end load_archetypes(); local function cursor_handler(wnd, source, status) -- for cursor layer, we reuse some events to indicate hotspot -- and implement local warping.. end local function default_reqh(wnd, source, ev) local normal = { "lwa", "multimedia", "game", "vm", "application", "remoting", "browser", "handover", "tui", "terminal" }; -- early out if the type is not permitted if (wnd.allowed_segments and not table.find_i(wnd.allowed_segments, ev.segkind)) then client_log("segreq:name=" .. wnd.name .. ":kind=" .. ev.segkind .. ":state=rejected"); return; end -- clients want to negotiate a connection on behalf of a new process, if (ev.segkind == "handover") then local hover = accept_target(32, 32, function(source, stat) end); if (not valid_vid(hover)) then client_log("segreq:name=" .. wnd.name .. ":kind=handover:state=oom"); return; end client_log("segreq:name=" .. wnd.name .. ":state=handover"); durden_launch(hover, "", "external", nil, {attach_parent = wnd}); -- special handling, cursor etc. maybe we should permit subtype handler override elseif (ev.segkind == "cursor") then if (wnd.custom_cursor and valid_vid(wnd.custom_cursor.vid)) then delete_image(wnd.custom_cursor.vid); end local sz = mouse_state().size; local cursor = accept_target(sz[1], sz[2]); if (not valid_vid(cursor)) then client_log("segreq:name=" .. wnd.name .. ":kind=mouse_cursor:state=oom"); return; end client_log("segreq:name=" .. wnd.name .. ":kind=cursor:state=ok"); target_updatehandler(cursor, function(a, b) cursor_handler(wnd, a, b); end); wnd.custom_cursor = { vid = cursor, active = true, width = sz[1], height = sz[2], hotspot_x = 0, hotspot_y = 0, }; -- something to activate if we are already over? just mouse_xy test against -- selected canvas? link_image(cursor, wnd.anchor); return; else -- something that should map to a new / normal window? if (wnd.allowed_segments or (not wnd.allowed_segments and table.find_i(normal, ev.segkind))) then local vid = accept_target(); if (not valid_vid(vid)) then client_log("segreq:name=" .. wnd.name .. ":kind=" .. ev.segkind .. ":state=oom"); return end client_log("segreq:name=" .. wnd.name .. ":kind=" .. ev.segkind .. ":state=ok"); -- inherit workspace if that is set local opts; if (gconfig_get("ws_child_default") == "parent" or gconfig_get("tile_insert_child") == "child") then opts = { default_workspace = wnd.default_workspace, attach_parent = wnd }; end -- inherit the attached workspace for the child (vid, prefix, title, wnd, wargs) durden_launch(vid, "", "external", nil, opts); else client_log("segreq:name=" .. wnd.name .. ":kind=" .. ev.segkind .. ":state=blocked"); end end end function extevh_clipboard(wnd, source, status) if (status.kind == "terminated") then delete_image(source); if (wnd) then wnd.clipboard = nil; end elseif (status.kind == "message") then -- got clipboard message, if it is multipart, buffer up to a threshold (?) CLIPBOARD:add(source, status.message, status.multipart); end end local defhtbl = {}; defhtbl["input_label"] = function(wnd, source, tbl) -- reset or first call? there is a synchronization issue here in that the reset -- and update can come periodically. If that ever becomes an actual problem, using -- frame delivery as an indicator that the burst is over works. client_log(fmt( "input_label:name=%s:type=%s:sym=%s", tbl.labelhint, tbl.datatype, tbl.vsym)); if (not wnd.input_labels or #tbl.labelhint == 0) then wnd.input_labels = {}; if (#tbl.labelhint == 0) then return; end end -- NOTE: this does not currently respect: -- a. "description update to language switch response" if (#wnd.input_labels > 100) then return; end local ent = { label = tbl.labelhint, datatype = tbl.idatatype, description = tbl.description, symbol = tbl.vsym and tbl.vsym or "", input = "" }; -- add the default as binding unless there's a collision if (tbl.initial > 0 and type(SYMTABLE[tbl.initial]) == "string" and (tbl.idatatype == "translated" or tbl.idatatype == "digital")) then local sym = SYMTABLE[tbl.initial]; if (tbl.modifiers > 0) then sym = table.concat(decode_modifiers(tbl.modifiers), "_") .. "_" .. sym; end -- keep track of the translated string as we might want to present it if (not wnd.labels[sym]) then wnd.labels[sym] = tbl.labelhint; ent.input = sym; end end -- we don't have a means of knowing 'when' the hints are over, as they can -- be part of a dynamically expanding set, so at least track the last time -- something was changed so that other handlers can take a look at that. wnd.label_update = CLOCK; table.insert(wnd.input_labels, ent); end defhtbl["frame"] = function(wnd, source, stat) if (wnd.shader_frame_hook) then wnd:shader_frame_hook(); end -- tag with batch and with the incremental engine counter client_log("frame"); wnd.last_frame = stat.framenumber; wnd.last_frame_clock = CLOCK; wnd:run_event("frame", stat); end defhtbl["alert"] = function(wnd, source, stat) local msg; -- do we need to concatenate a longer message? if (wnd.alert_multipart) then wnd.alert_multipart.message = wnd.alert_multipart.message .. stat.message; wnd.alert_multipart.count = wnd.alert_multipart.count + 1; if (wnd.alert_multipart.count > 3 or not stat.multipart) then msg = wnd.alert_multipart.message; wnd.alert_multipart = nil; end -- first of a multipart text message? elseif (stat.multipart) then wnd.alert_multipart = { message = stat.message, count = 1 }; return; else msg = stat.message; end -- actual alert message or just a hint that the client wants some attention if (msg and #msg > 0) then wnd:set_message(msg); else wnd:alert(); end end defhtbl["cursorhint"] = function(wnd, source, stat) wnd.cursor = stat.cursor; end defhtbl["viewport"] = function(wnd, source, stat) -- need different behavior for popup here (invisible, parent, ...), end -- got updated ramps from a client, still need to decide what to -- do with them, i.e. set them as active on window select and remove -- on window deselect. defhtbl["ramp_update"] = function(wnd, source, stat) local ramps = video_displaygamma(source, stat.index); end defhtbl["proto_change"] = function(wnd, source, stat) wnd.color_controls = stat.cm; -- send the ramps for the display the client is active on, repeat if we -- get migrated to another display if (stat.cm) then for disp in all_displays_iter() do if (disp.ramps) then video_displaygamma(source, disp.active_ramps, disp.id); end end end end defhtbl["resized"] = function(wnd, source, stat) if (wnd.ws_attach) then -- edge conditions could fail to attach depending on the window type and -- certain widgets which hijack attachment, like draw-to-spawn modes local attach = wnd:ws_attach(); if (not attach) then return; end end wnd.source_audio = stat.source_audio; audio_gain(stat.source_audio, (gconfig_get("global_mute") and 0 or 1) * gconfig_get("global_gain") * wnd.gain ); wnd.origo_ll = stat.origo_ll; image_set_txcos_default(wnd.canvas, wnd.origo_ll == true); if (wnd.shader_hook) then wnd.shader_hook(); end wnd:resize_effective(stat.width, stat.height, true, true); wnd.space:resize(true); end defhtbl["bchunkstate"] = function(wnd, source, stat) -- if clients are allowed to popup open/close dialogs, client_log( string.format("bchunk_state:input=%d:stream=%d:hint=%d:ext=%s", stat.input and 1 or 0, stat.stream and 1 or 0, stat.hint and 1 or 0, stat.wildcard and "*" or stat.extensions ) ); -- this means we have a oneshot request for immediate data -- -- so respond to that y either immediately triggering the proper -- target/state/open,save with the temporary set of extensions -- if not stat.hint then wnd.ephemeral_ext = stat.extensions and stat.extensions or "*"; local fun = function() dispatch_symbol_wnd(wnd, "/target/state/" .. (stat.input and "open" or "save")); wnd.ephemeral_ext = nil; end -- go immediately? if active_display().selected == wnd then fun(); return; end -- mark alert and set handler local fwrap; fwrap = function() fun() wnd:drop_handler("select", fwrap); end -- and set temporary on-select handler wnd:add_handler("select", fwrap); wnd:alert(); return; end local dst = stat.input and "input_extensions" or "output_extensions" if stat.disable then wnd[dst] = nil return end -- if someone already set wildcard or we reverted to it if stat.wildcard or wnd[dst] == true then wnd[dst] = true return end -- merge, but we don't really care as we won't probe / filter types -- for the time being, everything will be exposed as wildcard until -- the launcher gets the controls to toggle between filter set and -- wildcard if not wnd[dst] then wnd[dst] = stat.extensions -- expand the set, but if it is too spammy, just switch to wildcard else wnd[dst] = wnd[dst] .. ";" .. stat.extensions if #wnd[dst] > 256 then wnd[dst] = true end end end defhtbl["message"] = function(wnd, source, stat) -- only archetype specific messaegs permitted here so far end defhtbl["ident"] = function(wnd, source, stat) wnd:set_ident(stat.message); end defhtbl["terminated"] = function(wnd, source, stat) EVENT_SYNCH[source] = nil; -- FIXME: check if the terminated window is the one intended when -- last spawning an interactive menu, and in that case, return out wnd:destroy(stat.last_words); end function extevh_apply_atype(wnd, atype, source, stat) local atbl = archetypes[atype]; if (atbl == nil or wnd.atype ~= nil) then return; end -- some odd archetype handlers (clipboard, ...) want to evaluate and -- intercept the normal creation process if (atbl.intercept) then if (not atbl:intercept(wnd, source, stat)) then wnd:destroy(); end return; end -- note that this can be emitted multiple times, it is just the -- segment kind that can't / wont change if (wnd.registered) then return; end -- project / overlay archetype specific toggles and settings wnd.actions = atbl.actions; if (atbl.props) then for k,v in pairs(atbl.props) do wnd[k] = v; end end -- make copies of these so custom overrides/extensions won't be shared wnd.bindings = table.copy(atbl.bindings); wnd.dispatch = table.copy(atbl.dispatch); wnd.labels = table.copy(atbl.labels); wnd.source_audio = (stat and stat.source_audio) or BADID; wnd.atype = atype; -- only apply for the selected window, weird edge-case if (active_display().selected == wnd) then if (atbl.props.kbd_period) then iostatem_repeat(atbl.props.kbd_period); end if (atbl.props.kbd_delay) then iostatem_repeat(nil, atbl.props.kbd_delay); end end -- specify default shader by properties (e.g. no-alpha, fft) or explicit name if (atbl.default_shader) then shader_setup(wnd.canvas, unpack(atbl.default_shader)); end if (atbl.init) then atbl:init(wnd, source); end -- very rarely needed for k,v in ipairs(wnd.handlers.register) do v(wnd, stat.segkind, stat); end end defhtbl["registered"] = function(wnd, source, stat) -- ignore 0- value (b64), we also (ab)use injected registered event to get -- the same path for internal launch via target/cfg where the guid can be -- tracked in the database. local logged = false; if (type(stat.guid) == "string") then if (stat.guid == "AAAAAAAAAAAAAAAAAAAAAA==") then -- redirect if an external tool has registered a handler for a specific guid else logged = true; client_log(string.format( "registered:name=%s:kind=%s:guid=%s", wnd.name, stat.segkind, stat.guid)); if (guid_handler_table[stat.guid]) then guid_handler_table[stat.guid](wnd, source, stat); return; end end end if not logged then client_log(string.format( "registered:name=%s:kind=%s", wnd.name, stat.segkind)); end extevh_apply_atype(wnd, stat.segkind, source, stat); wnd:set_title(stat.title); wnd:set_guid(stat.guid); end -- stateinf is used in the builtin/shared defhtbl["state_size"] = function(wnd, source, stat) client_log("state_size:name=" .. wnd.name .. ":size=" .. tostring(stat.state_size)); wnd.stateinf = {size = stat.state_size, typeid = stat}; end -- simple key / preset-val store of options that could persist between -- execution runs (if we have a way to identify target, so primary for when we -- can trust ident or, better, store in target/config slots. defhtbl["coreopt"] = function(wnd, source, stat) if (not wnd.coreopt) then wnd.coreopt = {}; end local dtbl = wnd.coreopt[stat.slot]; if (not dtbl) then dtbl = { values = {} }; wnd.coreopt[stat.slot] = dtbl; end if (string.len(stat.argument) == 0) then return; end if (stat.type == "key") then dtbl.key = stat.argument; elseif (stat.type == "description") then dtbl.description = stat.argument; elseif (stat.type == "value") then -- ARBITRARY LIMIT if (#dtbl.values < 64) then table.insert(dtbl.values, stat.argument); end elseif (stat.type == "current") then dtbl.current = stat.argument; end end -- support timer implementation (some reasonable limit), -- we rely on internal autoclock handling for non-dynamic / periodic defhtbl["clock"] = function(wnd, source, stat) if (not stat.once) then return; end client_log("clock:unhandled:name=" .. wnd.name); end defhtbl["content_state"] = function(wnd, source, stat) client_log("content_state:unhandled:name=" .. wnd.name); end defhtbl["segment_request"] = function(wnd, source, stat) -- eval based on requested subtype etc. if needed if (stat.segkind == "clipboard") then client_log("segment_request:name=" .. wnd.name .. ":kind=clipboard"); if (wnd.clipboard ~= nil) then delete_image(wnd.clipboard) end wnd.clipboard = accept_target(); if (not valid_vid(wnd.clipboard)) then return; end link_image(wnd.clipboard, wnd.anchor); target_updatehandler(wnd.clipboard, function(source, status) extevh_clipboard(wnd, source, status) end ); else default_reqh(wnd, source, stat); end end function extevh_register_guid(guid, source, handler) if (guid_handler_table[guid]) then client_log("guid_override:kind=error:message=EEXIST:source=" .. source ..":guid=" .. guid); return; else client_log("guid_override:kind=registered:source=" .. source .. ":guid=" .. guid); guid_handler_table[guid] = handler; end end function extevh_register_window(source, wnd) if (not valid_vid(source, TYPE_FRAMESERVER)) then return; end swm[source] = wnd; target_updatehandler(source, extevh_default); wnd:add_handler("destroy", function() extevh_unregister_window(source); CLIPBOARD:lost(source); end); end function extevh_unregister_window(source) swm[source] = nil; end function extevh_get_window(source) return swm[source]; end function extevh_default(source, stat) local wnd = swm[source]; if (not wnd) then client_log(string.format("source=%d:message=no matching window", source)); return; -- tool/plugin bug not registering a valid window elseif (not wnd.set_title) then swm[source] = nil return end -- window handler has priority if (wnd.dispatch[stat.kind]) then -- and if it absorbs the event, break the chain local disp = wnd.dispatch[stat.kind]; local res = false; -- 1:1 or 1:many if (type(disp) == "function") then res = disp(wnd, source, stat); elseif (type(disp) == "table") then for i,v in ipairs(disp) do res = v(wnd, source, stat) or res; end end if (res) then return; end end -- or use the default handler if provided if (defhtbl[stat.kind]) then defhtbl[stat.kind](wnd, source, stat); else client_log(string.format("source=%d:message=unhandled:kind=%s", source, stat.kind)); end end
--- Nested data file format and nested tables functionality. -- @module nested --- Current version string -- @field _VERSION --- Postorder key to be passed to @{iterate} options (`'postorder'`) -- @field POSTORDER --- Postorder only value to be passed to @{iterate} options (`'only'`) -- @field POSTORDER_ONLY --- Table only key to be passed to @{iterate} options (`'table_only'`) -- @field TABLE_ONLY --- Include key-value key to be passed to @{iterate} options (`'include_kv'`) -- @field INCLUDE_KV --- Skip root key to be passed to @{iterate} options (`'skip_root'`) -- @field SKIP_ROOT --------------------------------------------------------------------------------------------------- -- Decoding -- @section decoding --- Decode a nested structure from text. -- -- In case of unmatched quotes or unbalanced block delimiters, returns `nil` plus error message. -- -- @param text Text to be decoded -- @param[opt] options Table with any of the optional following fields: -- -- - `text_filter`: Function to filter data from text values. -- Receives the text, quotation mark, starting line and column as parameters. -- If it returns a non-`nil` value, the text is replaced by it in the resulting table. -- - `table_constructor`: Function used for constructing tables. -- Receives as parameter the opening character: `''` for toplevel tables, `(`, `[` or `{`, -- the starting line and column as parameters -- Must return a table. -- This is useful for injecting metatables into resulting nested structure. -- - `root_constructor`: Function used for constructing the root table. -- Defaults to `table_constructor`, if specified. -- -- @return[1] nested table decoded -- @return[2] `nil` -- @return[2] error message -- @todo support streamed IO -- @function decode --- Decode a nested structure from file. -- -- This uses @{decode}, so the same caveats apply. -- -- @param file_or_filename File or filename to read from, opened with @{io.input} -- @param[opt] options Forwarded to @{decode} -- @return[1] nested table decoded -- @return[2] `nil` -- @return[2] error message -- @see decode -- @function decode_file --- Iterator function that parses nested structure from text input, yielding meaningful tokens. -- -- This allows one to fully customize the results from parsing, for example -- stopping before reading the whole text and ignoring whole branches from the input. -- -- Each time the coroutine is resumed, it yields the current line and column, the parsing event -- and additional information if needed. Check out the usage example for possible values and -- meaning of each value. -- -- Check out the implementation of @{decode} for a concrete example of usage. -- -- Unless the given parameter is not a string, the coroutine should not error. -- -- @usage -- for line, column, event, token, quote in nested.decode_iterate(text) do -- if event == 'TEXT' then -- -- token: string representing the text value -- -- quote: nil if text is not quoted, or one of ' " ` otherwise -- elseif event == 'KEY' then -- -- token: the key used in a key-value form "key:" -- -- quote: nil if the key is not quoted, or one of ' " ` otherwise -- elseif event == 'OPEN_NESTED' then -- -- token: the opening token for nested tables, one of [ { ( -- elseif event == 'CLOSE_NESTED' then -- -- token: the closing token for nested tables, one of ] } ) -- elseif event == 'ERROR' then -- -- token: the error message -- -- iteration ends after the first error, no need for `break` -- end -- until not event -- -- @param text Text to be decoded -- @treturn function Coroutine function for parsing -- @function decode_iterate --------------------------------------------------------------------------------------------------- -- Encoding -- @section encoding --- Encode a nested table structure to text. -- -- Non-table values are encoded using @{tostring}, so `__tostring` metamethods may be called for userdata. -- -- Althought the nested textual format doesn't support references between tables other than -- parent/child relations, Lua does. For this matter, anchors of the form `&N`, where `N` is a number, -- are placed in tables that are referenced somewhere else, with the references for the table -- written in the form `*N` with the same numerical `N` used before. -- -- In the same line, although the nested textual format only supports text as keys, table keys in -- Lua might be booleans, functions, userdata or other tables. This function will encode them, -- but be aware that the resulting text might error when read again with `decode`, and that -- nested is not a complete serialization scheme for Lua tables. -- -- @param t Table -- @param[opt=2] indent Indentation level to use, in spaces. -- If > 0, each value will be placed in a new line, prefixed by the given number of space characters. -- If == 0, no new lines will be used and values will be written separated by a single space character. -- If < 0, no new lines will be used and values will be written in a compacted and probably illegible way. -- @param[opt] apply_tostring_to_tables -- If truthy, if a table has a `__tostring` metamethod, it will be applied instead of the default nested traversal. -- @treturn string Encoded nested structure -- @function encode --- Encode a nested table structure to file. -- -- This uses @{encode}, so the same caveats apply. -- -- @param t Table -- @param file_or_filename File or filename to write to, opened with @{io.output} -- @param[opt] indent Forwarded to @{encode}. -- @param[opt] apply_tostring_to_tables Forwarded to @{encode}. -- @return[1] true -- @return[2] nil -- @return[2] Error message if writing to file failed -- @function encode_to_file --------------------------------------------------------------------------------------------------- -- Iterating over tables. -- @section iterating --- Iterate over non-numeric key-value pairs. -- -- This is a shallow iteration. For iterating over nested tables, use @{iterate} instead. -- -- This uses @{pairs}, so the `__pairs` metamethod may be called in Lua 5.2+ -- -- @param t Table -- @usage for k, v in nested.kpairs(t) do -- ... -- end -- @function kpairs --- Iterate in depth over a nested table. -- -- On each call, returns a sequence table with the current key path, value, parent table and boolean flag -- signaling if going deeper (preorder traversal) into the nested structure or not (postorder traversal). -- -- @param t Table -- @param[opt] options Table with any of the following fields: -- -- - `postorder`: if truthy, also yield values when traversing back from the default preorder traversal. -- If equal to `"only"`, perform only the postorder traversal. -- - `table_only`: if truthy, yield table values only. -- - `include_kv`: if truthy, iterate on key-value pairs as well as numeric indices. -- - `skip_root`: if truthy, iterate on key-value pairs as well as numeric indices. -- -- @usage for keypath, value, parent, going_deeper in nested.iterate(t) do -- ... -- end -- @function iterate --------------------------------------------------------------------------------------------------- -- Getting and setting nested values. -- @section getset --- Get the value of a nested table. -- -- If the given key path cannot be indexed, returns `nil` plus a message with -- where on the key path indexing failed. -- -- @param t Table -- @param ... Values passed in form the key path, with which each nested table will be indexed. -- If only one value is passed and it is a table, it is treated as the keypath. -- @return[1] value -- @return[2] `nil` -- @return[2] error message -- @function get --- Similar to @{get}, but creates the nested structure if it doesn't exist yet. -- -- @param t Table -- @param ... Values that form the key path, just like in @{get}. -- @return[1] value -- @return[2] `nil` -- @return[2] error message -- @see get -- @function get_or_create --- Set the value of a nested table. -- -- If the given key path cannot be indexed, returns `nil` plus a message with -- where on the key path indexing failed. -- -- @param t Table -- @param ... The first values passed in form the key path, and the last one is the value to be set. -- If the key path has only one table value, then it is treated as the keypath. -- -- To unset a value, `nil` have to be passed explicitly as the last argument. -- @return[1] `t` -- @return[2] `nil` -- @return[2] error message -- @function set --- Similar to @{set}, but creates the nested structure if it doesn't exist yet. -- -- @param t Table -- @param ... Values to form the key path and value to be set, just like in @{set}. -- @return[1] `t` -- @return[2] `nil` -- @return[2] error message -- @see set -- @function set_or_create --------------------------------------------------------------------------------------------------- -- Default filters -- @section filter --- Simple text filter that reads unquoted boolean and number values, meant to be passed to @{decode}. -- -- Literal `true` and `false` values are recognized as the boolean `true` and `false` lua values. -- Quoted versions, like `"true"` and `'false'` are not parsed and treated as strings. -- -- Numbers are read with @{tonumber}. Similar to booleans, quoted numbers like `'1'` or `"0.5"` are -- not parsed and treated as strings. -- -- @param text -- @param[opt] quotation_mark -- @usage local data = nested.decode(text, { text_filter = nested.bool_number_filter }) -- @function bool_number_filter
local _, Addon = ... local DDBL = Addon.DethsDBLib if DDBL.__loaded then return end local consts = DDBL.consts consts.PLAYER_KEY = ("%s-%s"):format(_G.UnitName("PLAYER"), _G.GetRealmName()) consts.TOC_ENTRY = "X-DethsDBLib" consts.TOC_ERROR_MSG = [=[ %s.toc must contain: ## SavedVariables: my_addon_sv_key ## X-DethsDBLib: my_addon_sv_key Where "my_addon_sv_key" is a unique global variable name. ]=] consts.ADDON_NOT_LOADED_MSG = [=[ SavedVariables for "%s" are not available yet. Wait until the "ADDON_LOADED" event has fired before creating a database. ]=]
--[[ FileName: AnimationTemplate.lua ]] --[[ Author: Godcat567/GodCat856 ]] print[[ BSD 3-Clause License Copyright (c) 2021, PixeledLuaWriter (Godcat567) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ]] print(0xFEAEFDDCABBF) --idfk lOl print[[ Animation Template By Godcat567/GodCat856 You Can't Use "if math.random(1,somenumber) == 1 then" with tweens if you try to then it will not work Also make sure to deeply look into this template for all the easing styles and easing directions Happy Scripting Sincerly - Godcat567/GodCat856 ]] print[[ How To Use This | v 1. Define Your Motor Variables & Use SetJointTween() to Reset The Motor6D's To Their Origin C0 & C1 2. Take A Look At How Each Animation Was Made (This Might Help When Using The CFrames) 3. Try Using SetJointTween() to Create The Desired Animation You Want, Ex. SetJointTween(MotorVariableHere, {C0 = CFrames Go Here},"Quad","Out",.1) <-- Use The Function For Each Motor without defining them inside the "while (not false) do end" loop Also MAKE YOUR ANIMATIONS WITHOUT STEALING THEM FROM OTHER SCRIPTS (I Am Serious) ]] wait(1/60) --[[ Defining Variables ]] Plr = game:GetService("Players"):FindFirstChild("Username Here") PlrGui = Plr.PlayerGui Character = Plr.Character RightArm = Character["Right Arm"] LeftArm = Character["Left Arm"] RightLeg = Character["Right Leg"] LeftLeg = Character["Left Leg"] RootPart = Character.HumanoidRootPart Torso = Character.Torso Head = Character.Head Humanoid = Character:FindFirstChildOfClass('Humanoid') --[[ Joint Setup ]] Neck = Torso.Neck RootJoint = RootPart.RootJoint RightShoulder = Torso["Right Shoulder"] LeftShoulder = Torso["Left Shoulder"] RightHip = Torso["Right Hip"] LeftHip = Torso["Left Hip"] --Tail = Character["Black Cyber Critter Tail"].Handle.AccessoryWeld EulerRootCF = CFrame.fromEulerAnglesXYZ(-1.57,0,3.14) --CFrame.Angles(math.rad(-90),0,math.rad(180)) NeckCF = CFrame.new(0,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180)) RightShoulderCF = CFrame.new(-0.5,0,0)*CFrame.Angles(0,math.rad(90),0) LeftShoulderCF = CFrame.new(0.5,0,0)*CFrame.Angles(0,math.rad(-90),0) --TailCF = CFrame.new(0,-.75,.5)*CFrame.fromEulerAnglesXYZ(-3.14,0,3.14) DefaultWelds = { C0 = { RJC0 = CFrame.fromEulerAnglesXYZ(-1.57,0,3.14)*CFrame.new(0,0,0), NKC0 = CFrame.new(0,1,0)*CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180)), RSC0 = CFrame.new(1,0.5,0)*CFrame.Angles(math.rad(0),math.rad(90),math.rad(0)), LSC0 = CFrame.new(-1,0.5,0)*CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0)), RHC0 = CFrame.new(1,-1,0)*CFrame.Angles(math.rad(0),math.rad(90),math.rad(0)), LHC0 = CFrame.new(-1,-1,0)*CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0)), }, C1 = { RJC1 = CFrame.fromEulerAnglesXYZ(-1.57,0,3.14)*CFrame.new(0,0,0), NKC1 = CFrame.new(0,-0.5,0)*CFrame.Angles(math.rad(-90),math.rad(0),math.rad(180)), RSC1 = CFrame.new(-0.5,0.5,0)*CFrame.Angles(math.rad(0),math.rad(90),math.rad(0)), LSC1 = CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0)), RHC1 = CFrame.new(0.5,1,0)*CFrame.Angles(math.rad(0),math.rad(90),math.rad(0)), LHC1 = CFrame.new(-0.5,1,0)*CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0)), }, } --Default welds for anybody who does NOT know cframe --[[ Killing Default Animations Initiated ]] pcall(function() Character.Animate:Destroy() Humanoid.Animator:Destroy() for _,v in next, Humanoid:GetPlayingAnimationTracks() do v:Stop() end end) --[[ Killing Default Animations Ended]] --[[ Customizable Settings ]] sinetick = 0 change = 1 Speed = 16 JumpPow = 80 IsAttacking = false --[[ Artificial Heartbeat [Adapted By Nebula_Zoroark] ]] AHB = Instance.new("BindableEvent") FPS = 60 LastFrame = tick() TimeFrame = 0 Frame = 1/FPS game:GetService("RunService").Heartbeat:Connect(function(s,p) TimeFrame = TimeFrame + s if(TimeFrame>=Frame)then for i=1,math.floor(TimeFrame/Frame) do AHB:Fire() end LastFrame=tick() TimeFrame=TimeFrame-Frame*math.floor(TimeFrame/Frame) end end) function Swait(dur) if(dur == 0 or typeof(dur) ~= 'number') then AHB.Event:wait() else for i= 1, dur*FPS do AHB.Event:wait() end end end --[[ Functions ]] function SetJointTween(Joint,TweenData,EasingType,DirectionType,AnimationTime) local EST = Enum.EasingStyle[EasingType] local DRT = Enum.EasingDirection[DirectionType] local InterpolationSpeed = 1 local TI = TweenInfo.new(AnimationTime/InterpolationSpeed,EST,DRT,0,false,0) local MCF = TweenData local TAnim = game:service'TweenService':Create(Joint,TI,MCF) TAnim:Play() end --[[ Miscellaneous Stuff ]] pcall(function() if Neck and RightShoulder and LeftShoulder and RightHip and LeftHip and RootJoint then Neck:Destroy() Neck = Instance.new("Motor6D") Neck.Parent = Torso Neck.Name = "Neck" Neck.Part0 = Torso Neck.Part1 = Head RootJoint:Destroy() RootJoint = Instance.new("Motor6D") RootJoint.Parent = RootPart RootJoint.Part0 = RootPart RootJoint.Part1 = Torso RootJoint.Name = "RootJoint" RightShoulder:Destroy() RightShoulder = Instance.new("Motor6D") RightShoulder.Parent = Torso RightShoulder.Part0 = Torso RightShoulder.Part1 = RightArm RightShoulder.Name = "Right Shoulder" LeftShoulder:Destroy() LeftShoulder = Instance.new("Motor6D") LeftShoulder.Parent = Torso LeftShoulder.Part0 = Torso LeftShoulder.Part1 = LeftArm LeftShoulder.Name = "Left Shoulder" RightHip:Destroy() RightHip = Instance.new("Motor6D") RightHip.Parent = Torso RightHip.Part0 = Torso RightHip.Part1 = RightLeg RightHip.Name = "Right Hip" LeftHip:Destroy() LeftHip = Instance.new("Motor6D") LeftHip.Parent = Torso LeftHip.Part0 = Torso LeftHip.Part1 = LeftLeg LeftHip.Name = "Left Hip" end end) SetJointTween(RootJoint,{C0 = DefaultWelds.C0.RJC0},"Quad","InOut",.1) SetJointTween(Neck,{C0 = DefaultWelds.C0.NKC0},"Quad","InOut",.1) SetJointTween(RightShoulder,{C0 = DefaultWelds.C0.RSC0},"Quad","InOut",.1) SetJointTween(LeftShoulder,{C0 = DefaultWelds.C0.LSC0},"Quad","InOut",.1) SetJointTween(RightHip,{C0 = DefaultWelds.C0.RHC0},"Quad","InOut",.1) SetJointTween(LeftHip,{C0 = DefaultWelds.C0.LHC0},"Quad","InOut",.1) SetJointTween(RootJoint,{C1 = DefaultWelds.C1.RJC1},"Quad","InOut",.1) SetJointTween(Neck,{C1 = DefaultWelds.C1.NKC1},"Quad","InOut",.1) SetJointTween(RightShoulder,{C1 = DefaultWelds.C1.RSC1},"Quad","InOut",.1) SetJointTween(LeftShoulder,{C1 = DefaultWelds.C1.LSC1},"Quad","InOut",.1) SetJointTween(RightHip,{C1 = DefaultWelds.C1.RHC1},"Quad","InOut",.1) SetJointTween(LeftHip,{C1 = DefaultWelds.C1.LHC1},"Quad","InOut",.1) local s = Instance.new("Sound") s.Parent = Torso s.SoundId = "rbxassetid://4627095401" --just a note you can use this id to fix the Achromatic mode on nebula's NGR cr thing s.Pitch = 1 s.Volume = 2 s.Name = tostring(function() end):sub(10) s.Looped = true s:play() EasingStyles = { ["Back"] = "Back", ["Bounce"] = "Bounce", ["Circular"] = "Circular", ["Cubic"] = "Cubic", ["Elastic"] = "Elastic", ["Exponential"] = "Exponential", ["Linear"] = "Linear", ["Quad"] = "Quad", ["Quart"] = "Quart", ["Quint"] = "Quint", ["Sine"] = "Sine" } EasingDirections = { ["In"] = "In", ["InOut"] = "InOut", ["Out"] = "Out" } --[[ Mouse Stuff ]] --[[Mouse.KeyDown:Connect(function(k) if k == "q" then if Speed == 16 then Speed = 50 elseif Speed == 50 then Speed = 82 elseif Speed == 82 then Speed = 16 end end end) Mouse.KeyUp:Connect(function() --lOl end)--]] --[[ Wrapper ]] while (not false) do Swait() if(typeof(s) == "Instance")then s.Parent = Torso s.SoundId = "rbxassetid://4627095401" s.Pitch = 1 s.Volume = 2 s.Name = tostring(function() end):sub(10) s.Looped = true s.Playing = true elseif(typeof(s) ~= "Instance" or s.Parent ~= Torso or s.Parent == nil or s == nil) then local s = Instance.new("Sound") s.Parent = Torso s.SoundId = "rbxassetid://4627095401" s.Pitch = 1 s.Volume = 2 s.Name = tostring(function() end):sub(10) s.Looped = true s.Playing = true end if Character:FindFirstChildOfClass'Humanoid' == nil then Humanoid = Instance.new("Humanoid",Character) end local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude local torsvertvel = RootPart.Velocity.Y local hflr,psflr = workspace:FindPartOnRayWithIgnoreList(Ray.new(RootPart.CFrame.p,((CFrame.new(RootPart.Position,RootPart.Position - Vector3.new(0,1,0))).lookVector).unit * (4)), {Character}) spval = 25/(Humanoid.WalkSpeed/16) sinetick=sinetick+change --Humanoid.WalkSpeed = Speed Humanoid.JumpPower = JumpPow Humanoid.Health = "NAN" Humanoid.MaxHealth = "NAN" local InterpolationSpeed = 0.1 if torsvertvel > 1 and hflr == nil then Anima = "jump" elseif torsvertvel < -1 and hflr == nil then Anima = "fall" elseif Humanoid.Sit == true then Anima = "sit" elseif torvel < 1 and hflr ~= nil then Anima = "idle" elseif torvel > 2 and torvel < 22 and hflr ~= nil then Anima = "walk" elseif torvel >= 22 and hflr ~= nil then Anima = "run" else Anima = "" end --Footplanting Math :joy: local FwdDir = Humanoid.MoveDirection*RootPart.CFrame.lookVector or Vector3.new() local RigDir = Humanoid.MoveDirection*RootPart.CFrame.rightVector or Vector3.new() Vector = { X=RigDir.X+RigDir.Z, Z=FwdDir.X+FwdDir.Z } Div = 1 if(Vector.Z<0)then Div=math.clamp(-(1.25*Vector.Z),1,2) end Vector.X = Vector.X/Div Vector.Z = Vector.Z/Div ForWLV = Vector.X/Div ForWLB = Vector.Z/Div Humanoid.WalkSpeed = Speed/Div --[[if Plr.Name == "Godcat567" then SetJointTween(Tail,{C0 = TailCF*CFrame.Angles(math.rad(0),math.rad(20 * math.sin(sinetick/60*2.5)),math.rad(0))},"Quad","Out",InterpolationSpeed) end ignore this i only created the tail weld for the Black & White Cyber Critter Tails --]] if IsAttacking == false then if Anima == "jump" then if torsvertvel <= 400 then SetJointTween(RootJoint,{C0 = EulerRootCF*CFrame.new(0,0,-.1 + .01 * math.cos(sinetick/22))*CFrame.Angles(math.rad(0 + torsvertvel/10),math.rad(0),math.rad(0))},"Quad","Out",InterpolationSpeed) elseif torsvertvel > 400 then SetJointTween(RootJoint,{C0 = EulerRootCF*CFrame.new(0,0,-.1 + .01 * math.cos(sinetick/22))*CFrame.Angles(math.rad(-40),math.rad(0),math.rad(0))},"Quad","Out",InterpolationSpeed) end SetJointTween(Neck,{C0 = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))},"Quad","Out",InterpolationSpeed) SetJointTween(RightShoulder,{C0 = CFrame.new(1.5,.5,0)*CFrame.Angles(math.rad(-10),math.rad(0),math.rad(0 + torsvertvel/2))*RightShoulderCF},"Quad","Out",InterpolationSpeed) SetJointTween(LeftShoulder,{C0 = CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad(-10),math.rad(0),math.rad(0 - torsvertvel/2))*LeftShoulderCF},"Quad","Out",InterpolationSpeed) SetJointTween(RightHip,{C0 = CFrame.new(1,-.5,-.5)*CFrame.Angles(math.rad(0),math.rad(90),0)*CFrame.Angles(math.rad(0),0,0)},"Quad","Out",InterpolationSpeed) SetJointTween(LeftHip,{C0 = CFrame.new(-1,-1,-0)*CFrame.Angles(math.rad(0),math.rad(-90),0)*CFrame.Angles(math.rad(0),0,0)},"Quad","Out",InterpolationSpeed) elseif Anima == "fall" then if torsvertvel >= -400 then SetJointTween(RootJoint,{C0 = EulerRootCF*CFrame.new(0,0,-.1 + .01 * math.cos(sinetick/22))*CFrame.Angles(math.rad(0 - torsvertvel/10),math.rad(0),math.rad(0))},"Quad","Out",InterpolationSpeed) elseif torsvertvel < -400 then SetJointTween(RootJoint,{C0 = EulerRootCF*CFrame.new(0,0,-.1 + .01 * math.cos(sinetick/22))*CFrame.Angles(math.rad(40),math.rad(0),math.rad(0))},"Quad","Out",InterpolationSpeed) end SetJointTween(Neck,{C0 = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)*CFrame.Angles(math.rad(20),math.rad(0),math.rad(0))},"Quad","Out",InterpolationSpeed) SetJointTween(RightShoulder,{C0 = CFrame.new(1.5,.5,0)*CFrame.Angles(math.rad(80 - torsvertvel/2),math.rad(0),math.rad(0 - torsvertvel/5))*RightShoulderCF},"Quad","Out",InterpolationSpeed) SetJointTween(LeftShoulder,{C0 = CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad(80 - torsvertvel/2),math.rad(0),math.rad(0 + torsvertvel/5))*LeftShoulderCF},"Quad","Out",InterpolationSpeed) SetJointTween(RightHip,{C0 = CFrame.new(1,-.5,-.5)*CFrame.Angles(math.rad(-10),math.rad(90),0)*CFrame.Angles(math.rad(0),0,0)},"Quad","Out",InterpolationSpeed) SetJointTween(LeftHip,{C0 = CFrame.new(-1,-1,-0)*CFrame.Angles(math.rad(-20),math.rad(-90),0)*CFrame.Angles(math.rad(0),0,0)},"Quad","Out",InterpolationSpeed) elseif Anima == "idle" then SetJointTween(RootJoint,{C0 = EulerRootCF*CFrame.new(0,0,0 + .05 * math.cos(sinetick/22/2))*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))},"Quad","Out",InterpolationSpeed) SetJointTween(Neck,{C0 = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)*CFrame.Angles(math.rad(0 + 2.5 * math.cos(sinetick/22/2)),math.rad(0),math.rad(0 + 20 * math.cos(sinetick/22/2)))},"Quad","Out",InterpolationSpeed) SetJointTween(RightShoulder,{C0 = CFrame.new(1.5,.5,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(5 + 2.5 * math.cos(sinetick/22/2)))*RightShoulderCF},"Quad","Out",InterpolationSpeed) SetJointTween(LeftShoulder,{C0 = CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(-5 - 2.5 * math.cos(sinetick/22/2)))*LeftShoulderCF},"Quad","Out",InterpolationSpeed) SetJointTween(RightHip,{C0 = CFrame.new(1,-1 - .05 * math.cos(sinetick/22/2),-0)*CFrame.Angles(math.rad(0),math.rad(87),0)*CFrame.Angles(math.rad(0),0,0)},"Quad","Out",InterpolationSpeed) SetJointTween(LeftHip,{C0 = CFrame.new(-1,-1 - .05 * math.cos(sinetick/22/2),-0)*CFrame.Angles(math.rad(0),math.rad(-87),0)*CFrame.Angles(math.rad(0),0,0)},"Quad","Out",InterpolationSpeed) elseif Anima == "walk" then SetJointTween(RootJoint,{C0 = EulerRootCF*CFrame.new(-0.4 * 1 * ForWLV,-0.4 * (10/10) * ForWLB,-.185 + .155 * (10/10) * math.cos(sinetick/(12/2)))*CFrame.Angles(math.rad(5)*ForWLB,math.rad(5)*-ForWLV,math.rad(4*math.cos(sinetick/12)))},"Circular","Out",0.1) SetJointTween(Neck,{C0 = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)*CFrame.Angles(math.rad((-ForWLB - -ForWLB/5 * math.cos(sinetick/(14/2)))*8),math.rad(0),math.rad((-ForWLV*45+-8 * math.cos(sinetick/12))))},"Circular","Out",0.1) SetJointTween(RightShoulder,{C0 = CFrame.new(1.5,.5,0)*CFrame.Angles(math.rad((ForWLB - ForWLB/5 * math.cos(sinetick/12))*25 * math.cos(sinetick/12)),math.rad(0),math.rad(5))*RightShoulderCF},"Circular","Out",0.1) SetJointTween(LeftShoulder,{C0 = CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad((-ForWLB + ForWLB/5 * math.cos(sinetick/12))*25 * math.cos(sinetick/12)),math.rad(0),math.rad(-5))*LeftShoulderCF},"Circular","Out",0.1) SetJointTween(RightHip,{C0 = CFrame.new(1,-.85 + .25 * (10/10) * math.sin(sinetick/12) / 2,(0.3 * 1 * math.cos(sinetick/12) / 2)*ForWLB)*CFrame.Angles(math.rad((-ForWLB + ForWLB/5 * math.cos(sinetick/12))*45 * math.cos(sinetick/12)-math.sin(sinetick/24)),math.rad(0),math.rad((ForWLV - ForWLV/5 * math.cos(sinetick/12))*40 * math.cos(sinetick/12)-math.sin(sinetick/24)))*CFrame.Angles(0,math.rad(90),0)},"Circular","Out",0.1) SetJointTween(LeftHip,{C0 = CFrame.new(-1,-.85 - .25 * (10/10) * math.sin(sinetick/12) / 2,(-0.3 * 1 * math.cos(sinetick/12) / 2)*ForWLB)*CFrame.Angles(math.rad((ForWLB - ForWLB/5 * math.cos(sinetick/12))*45 * math.cos(sinetick/12)+math.sin(sinetick/24)),math.rad(0),math.rad((-ForWLV + ForWLV/5 * math.cos(sinetick/12))*40 * math.cos(sinetick/12)+math.sin(sinetick/24)))*CFrame.Angles(0,math.rad(-90),0)},"Circular","Out",0.1) elseif Anima == "run" then SetJointTween(RootJoint,{C0 = EulerRootCF*CFrame.new(-0.8 * (10/10) * ForWLV,-0.8 * (10/10) * ForWLB,-.185 + 0.155 * (10/10) * math.cos(sinetick/(6/2)))*CFrame.Angles(math.rad(25)*ForWLB,math.rad(10)*-ForWLV,math.rad(8*math.cos(sinetick/6)))},"Circular","Out",0.1) SetJointTween(Neck,{C0 = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)*CFrame.Angles(math.rad((-ForWLB - -ForWLB/5 * math.cos(sinetick/7))*25),math.rad(0),math.rad((-ForWLV*45+-8 * math.cos(sinetick/6))))},"Circular","Out",0.1) SetJointTween(RightShoulder,{C0 = CFrame.new(1.5,.5,0)*CFrame.Angles(math.rad((ForWLB - ForWLB/5 * math.cos(sinetick/6))*80 * math.cos(sinetick/6)),math.rad(0),math.rad(5))*RightShoulderCF},"Circular","Out",0.1) SetJointTween(LeftShoulder,{C0 = CFrame.new(-1.5,.5,0)*CFrame.Angles(math.rad((-ForWLB + ForWLB/5 * math.cos(sinetick/6))*80 * math.cos(sinetick/6)),math.rad(0),math.rad(-5))*LeftShoulderCF},"Circular","Out",0.1) SetJointTween(RightHip,{C0 = CFrame.new(1,-.85 + 0.25 * (10/10) * math.sin(sinetick/6) / 2, (0.6 * 1 * math.cos(sinetick/6) / 2)*ForWLB)*CFrame.Angles(math.rad((-ForWLB + ForWLB/5 * math.cos(sinetick/6))*85 * math.cos(sinetick/6)-math.sin(sinetick/12)),math.rad(0),math.rad((ForWLV - ForWLV/5 * math.cos(sinetick/6))*40 * math.cos(sinetick/6)-math.sin(sinetick/12)))*CFrame.Angles(0,math.rad(90),0)},"Circular","Out",0.1) SetJointTween(LeftHip,{C0 = CFrame.new(-1,-.85 - 0.25 * (10/10) * math.sin(sinetick/6) / 2, (-0.6 * 1 * math.cos(sinetick/6) / 2)*ForWLB)*CFrame.Angles(math.rad((ForWLB - ForWLB/5 * math.cos(sinetick/6))*85 * math.cos(sinetick/6)+math.sin(sinetick/12)),math.rad(0),math.rad((-ForWLV + ForWLV/5 * math.cos(sinetick/6))*40 * math.cos(sinetick/6)+math.sin(sinetick/12)))*CFrame.Angles(0,math.rad(-90),0)},"Circular","Out",0.1) elseif Anima == "sit" then SetJointTween(RootJoint,{C0 = EulerRootCF*CFrame.new(0,0,0.5)*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))},"Quad","Out",InterpolationSpeed) SetJointTween(Neck,{C0 = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)*CFrame.Angles(math.rad(0 - 2.3 * math.cos(sinetick/32)),math.rad(0 + 3.3 * math.cos(sinetick/77)),math.rad(0+10*math.cos(sinetick/91)))},"Quad","Out",InterpolationSpeed) SetJointTween(RightShoulder,{C0 = CFrame.new(1.3,.5,-0.5)*CFrame.Angles(math.rad(20),math.rad(0),math.rad(-20))*RightShoulderCF},"Quad","Out",InterpolationSpeed) SetJointTween(LeftShoulder,{C0 = CFrame.new(-1.3,.5,-0.5)*CFrame.Angles(math.rad(20),math.rad(0),math.rad(20))*LeftShoulderCF},"Quad","Out",InterpolationSpeed) SetJointTween(RightHip,{C0 = CFrame.new(1,-1.5,0.5)*CFrame.Angles(math.rad(90),math.rad(90),0)*CFrame.Angles(math.rad(-3),0,0)},"Quad","Out",InterpolationSpeed) SetJointTween(LeftHip,{C0 = CFrame.new(-1,-1.5,0.5)*CFrame.Angles(math.rad(90),math.rad(-90),0)*CFrame.Angles(math.rad(-3),0,0)},"Quad","Out",InterpolationSpeed) end end end --[[ Script & Animations Ended ]]
-- strategyPA.lua module("strategyPA", package.seeall) -- strategy performance assessment -- distributes requests between default instances and SUTs according to some weight -- applies then different strategies depending on target instance type local config = require("config") local servers = require("servers") local strategyRR = require("strategyRR") local strategyRRURI = require("strategyRRURI") --local canaryShare = nil --local totalSutShare = canaryShare * 2; local strategyRRInstanceDefault = strategyRR.instance() local strategyRrruriInstance = strategyRRURI.instance() local strategyRrInstanceSut = strategyRR.instance() -- for tests only local data = { loop_request_count = 0, canaryShare = nil, totalSutShare = nil, -- canaryShare: share of requests that is desired to go to the canary, will bet set during runtime -- totalSutShare: share of requests that gets to canary or baseline(=not default), will bet set during runtime suts_receive_each_X_request = nil, last_send_request_to_suts = nil, sut_balancing_strategy = "rruri" } -- set the canary share value and every derviced value to to the balancing function updatePaConfig() data.canaryShare = config.get_runtime().data.canary_share data.totalSutShare = data.canaryShare * 2 data.suts_receive_each_X_request = (1 / data.totalSutShare) data.sut_balancing_strategy = config.get_runtime().data.sut_balancing_strategy if not data.sut_balancing_strategy then data.sut_balancing_strategy = "rruri" end end -- selects a server endpoint from servers -- depending on the sut share -- and on the provided request URI function get_next_endpoint(uri) -- decide between production and SUTs local send_request_to_suts = weightByRandom() if send_request_to_suts == true then -- do round robin per URI -- between sut servers -- ngx.log(ngx.NOTICE, "strategy: assign request to SUT") local sut_servers = servers.getServersAllSutTypes() if data.sut_balancing_strategy == "rruri" then return strategyRrruriInstance.get_next_endpoint( sut_servers, uri ) elseif data.sut_balancing_strategy == "rr" then -- for testing with normal round robin to evaluate how workload equivalency is affected return strategyRrInstanceSut.get_next_endpoint( sut_servers ) else ngx.log( ngx.ERR, "unknown strategy" ) return nil end else -- do round robin -- between default servers -- ngx.log(ngx.NOTICE, "strategy: assign request to default") local default_servers = servers.getEndpointsByType( 'default' ) return strategyRRInstanceDefault.get_next_endpoint( default_servers ) end end -- return true if request should be send to SUT function weightByRandom() -- totalSutShare must be in the configuration if not data.totalSutShare then return false else return math.random() < data.totalSutShare end end -- local send_request_to_suts = weightByLoop() -- something is wrong here, therefore it is not used -- for usage it is required, to save last decision: -- -- save last decision -- data.last_send_request_to_suts = send_request_to_suts function weightByLoop() if not data.suts_receive_each_X_request then return false end local send_request_to_suts = false data.loop_request_count = data.loop_request_count + 1 -- increment count if (data.loop_request_count % data.suts_receive_each_X_request) < 1 then -- send_request_to_suts = true end if (data.loop_request_count >= 100) then -- reset loop data.loop_request_count = 0 end return send_request_to_suts end function get_data() return data end
--region *.lua --Date --此文件由[BabeLua]插件自动生成 require "app.views.reward_history_cell_ui" game.CRewardHistoryUI = class("game.CRewardHistoryUI", dxm.CDialogUI) local CRewardHistoryUI = game.CRewardHistoryUI function CRewardHistoryUI:ctor() CRewardHistoryUI.super.ctor(self) end function CRewardHistoryUI:Init() return self:InitWithFile("HistoryRewardPop") end function CRewardHistoryUI:Create() local ui = CRewardHistoryUI.new() if ui == nil or ui:Init()==false then return nil end return ui end function CRewardHistoryUI:onEnter() self:AddReleaseEvent(function(sender) self:Close() end) local scroll_view = self:GetWidget("PanelBase", "ScrollView") self.scroll_veiw_ui = dxm.CScrollViewUI:Create(scroll_view) local itor = game.sUser.module_reward_history.history_list:Begin() while true do local node = itor() if node == nil then break end self.scroll_veiw_ui:AddCell(game.CRewardHistoryCellUI:Create(node.value)) end self.scroll_veiw_ui:InitPosition() self:AddChild(self.scroll_veiw_ui) end function CRewardHistoryUI:onExit() end return CRewardHistoryUI --endregion
--- -- Luanode.Net _doflush was not handling correctly errors on write_callback handlers -- module(..., lunit.testcase, package.seeall) local common = dofile("common.lua") local net = require "luanode.net" function test() local server = net.createServer(function (self, socket) self:close() end) server:listen(common.PORT, function(self) console.log("server listening on %s:%d", self:address()) local client = net.createConnection(common.PORT, "127.0.0.1") process.nextTick(function() client:destroy() end) end) process:loop() end
local R = require "rigel" local RM = require "generators.modules" local C = require "generators.examplescommon" local types = require "types" local harness = require "generators.harness" W = 128 H = 64 T = 8 ------------- RAWTYPE = types.array2d( types.uint(8), T ) inp = R.input( types.rv(types.Par(RAWTYPE)) ) convLB = R.apply( "convLB", RM.linebuffer( types.uint(8), W,H, T, -4 ), inp) convpipe = R.apply( "slice", C.slice( types.array2d(types.uint(8),T,5), 0, T-1, 0, 0 ), convLB) convpipe = R.apply( "border", C.borderSeq( types.uint(8), W, H, T, 0, 0, 4, 0, 0 ), convpipe ) -- cut off the junk convpipe = RM.lambda( "convpipe", inp, convpipe ) hsfn = RM.makeHandshake(convpipe) harness{ outFile="shifty_wide_handshake", fn=hsfn, inFile="frame_128.raw", inSize={W,H}, outSize={W,H} }
--[[ -- Awesome WM status bar config --]] local gears = require("gears") local lain = require("lain") local awful = require("awful") local wibox = require("wibox") local markup = lain.util.markup local separators = lain.util.separators local os = os local dpi = require("beautiful.xresources").apply_dpi local table = awful.util.table or gears.table -- 4.{0,1} compatibility local theme = require("theme") -- Textclock local clock = awful.widget.watch( "date +'%a %d %b %R'", 10, function(widget, stdout) widget:set_markup(" " .. markup.font(theme.font, stdout) .. " ") end ) -- Calendar theme.cal = lain.widget.cal({ attach_to = { clock }, notification_preset = { font = theme.font, fg = theme.fg_normal, bg = theme.bg_normal } }) -- Coretemp local tempicon = wibox.widget.imagebox(theme.widget_temp) local temp = lain.widget.temp({ timeout = 1, tempfile = "/sys/devices/virtual/thermal/thermal_zone1/temp", settings = function() local core_temp = coretemp_now .. "°C " if coretemp_now > 75 then core_temp = markup("#FF0000", core_temp) end widget:set_markup(markup.font(theme.font, " " .. core_temp)) end }) -- Battery local baticon = wibox.widget.imagebox(theme.widget_battery) local bat = lain.widget.bat({ timeout = 5, settings = function() if bat_now.status and bat_now.status ~= "N/A" then if bat_now.ac_status == 1 then baticon:set_image(theme.widget_ac) elseif not bat_now.perc and tonumber(bat_now.perc) <= 10 then baticon:set_image(theme.widget_battery_empty) elseif not bat_now.perc and tonumber(bat_now.perc) <= 20 then baticon:set_image(theme.widget_battery_low) else baticon:set_image(theme.widget_battery) end widget:set_markup(markup.font(theme.font, " " .. bat_now.perc .. "% ")) else widget:set_markup(markup.font(theme.font, " AC ")) baticon:set_image(theme.widget_ac) end end }) -- Alsa volume local volicon = wibox.widget.imagebox(theme.widget_vol) theme.volume = lain.widget.alsa({ timeout = 1, settings = function() if volume_now.status == "off" then volicon:set_image(theme.widget_vol_mute) elseif tonumber(volume_now.level) == 0 then volicon:set_image(theme.widget_vol_no) elseif tonumber(volume_now.level) <= 50 then volicon:set_image(theme.widget_vol_low) else volicon:set_image(theme.widget_vol) end widget:set_markup(markup.font(theme.font, " " .. volume_now.level .. "% ")) end }) local pass = "" awful.spawn.easy_async("gopass show -f core/imap.fastmail.com", function(stdout, stderr, reason, exit_code) pass = stdout end) local mailicon = wibox.widget.imagebox(theme.widget_mail) local mail = lain.widget.imap{ timeout = 15, pwdtimeout = 5, port = 993, is_plain = false, server = "imap.fastmail.com", mail = "ed@gnkv.io", password = function() local try_again = false if pass == "" then try_again = true end return pass, try_again end, settings = function() mail_notification_preset.position = "top_right" if mailcount > 0 then mailicon:set_image(theme.widget_mail_on) else mailicon:set_image(theme.widget_mail) end widget:set_markup(markup.font(theme.font, " " .. mailcount .. " ")) end } -- Separators local spr = wibox.widget.textbox(' ') local arrl_dl = separators.arrow_left(theme.bg_focus, "alpha") local arrl_ld = separators.arrow_left("alpha", theme.bg_focus) local wibar = {} function wibar.at_screen_connect(s) -- If wallpaper is a function, call it with the screen local wallpaper = theme.wallpaper if type(wallpaper) == "function" then wallpaper = wallpaper(s) end gears.wallpaper.maximized(wallpaper, s, true) -- Tags awful.tag(awful.util.tagnames, s, awful.layout.layouts[1]) -- Create a promptbox for each screen s.mypromptbox = awful.widget.prompt() -- Create an imagebox widget which will contains an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox:buttons( table.join( awful.button({}, 1, function () awful.layout.inc(1) end), awful.button({}, 2, function () awful.layout.set(awful.layout.layouts[1]) end), awful.button({}, 3, function () awful.layout.inc(-1) end), awful.button({}, 4, function () awful.layout.inc( 1) end), awful.button({}, 5, function () awful.layout.inc(-1) end) )) -- Create a taglist widget s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons) -- Create a tasklist widget -- s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons) -- Create the wibox s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(14), bg = theme.bg_normal, fg = theme.fg_normal, }) -- Keyboard map indicator and switcher s.mykeyboardlayout = awful.widget.keyboardlayout() -- Add widgets to the wibox s.mywibox:setup { layout = wibox.layout.align.horizontal, { -- Left widgets layout = wibox.layout.fixed.horizontal, mylauncher, spr, s.mytaglist, s.mypromptbox, spr, }, spr, -- s.mytasklist, -- Middle widget { -- Right widgets layout = wibox.layout.fixed.horizontal, wibox.widget.systray(), spr, arrl_ld, -- spare arrl_dl, s.mykeyboardlayout, arrl_ld, wibox.container.background(mailicon, theme.bg_focus), wibox.container.background(mail.widget, theme.bg_focus), arrl_dl, volicon, theme.volume.widget, arrl_ld, wibox.container.background(baticon, theme.bg_focus), wibox.container.background(bat.widget, theme.bg_focus), arrl_dl, clock, spr, arrl_ld, wibox.container.background(s.mylayoutbox, theme.bg_focus), }, } end return wibar
object_building_mustafar_terrain_must_rock_round_med_s01 = object_building_mustafar_terrain_shared_must_rock_round_med_s01:new { } ObjectTemplates:addTemplate(object_building_mustafar_terrain_must_rock_round_med_s01, "object/building/mustafar/terrain/must_rock_round_med_s01.iff")
ITEM.name = "Sprig Eye" ITEM.model ="models/spitball_small.mdl" ITEM.description = "A small, hardened eye from a sprig. It feels like a glass marble." ITEM.longdesc = "Sprigs can lie completely motionless for days at a time, being able to perceive everything around them with its eyes. It seems like it's capable of getting almost 360 degrees of visual information all at once." ITEM.width = 1 ITEM.height = 1 ITEM.price = 1800 ITEM.pricepertier = 500 ITEM.baseweight = 0.100 ITEM.varweight = 0.010
--@name Hello World --@author INP print("Hello World!")
-- Dois hífens começam um comentário de uma linha. --[[ Adicionar dois [ ] (colchetes) criam um comentário de múltiplas linhas. --]] ---------------------------------------------------- -- 1. Variáveis e fluxo de controle. ---------------------------------------------------- num = 42 -- Todos os números são doubles. -- Não se preocupe, doubles de 64-bits contém 52 bits para -- armazenar corretamente valores int; a precisão da máquina -- não é um problema para ints que são < 52 bits. s = 'alternados' -- String são imutáveis, como em Python. t = "Aspas duplas também são válidas" u = [[ Dois colchetes começam e terminam strings de múltiplas linhas.]] t = nil -- Torna t undefined(indefinido); Lua tem um Garbage Collector. -- Blocos são representados com palavras do/end: while num < 50 do num = num + 1 -- Sem operadores do tipo ++ ou += end --Cláusula If : if num > 40 then print('over 40') elseif s ~= 'walternate' then -- ~= signfica não é igual. -- Para fazer checagem use == como em Python; Funciona para comparar strings também. io.write('not over 40\n') -- Padrão para saídas. else -- Variáveis são globais por padrão. thisIsGlobal = 5 -- Camel case é o comum. -- Como fazer variáveis locais: local line = io.read() -- Leia a proxima linha de entrada. -- Para concatenação de strings use o operador .. : print('Winter is coming, ' .. line) end -- Variáveis indefinidas são do tipo nil. -- Isso não é um erro: foo = anUnknownVariable -- Agora foo = nil. aBoolValue = false -- Apenas nil e false são do tipo falso; 0 e '' são verdadeiros! if not aBoolValue then print('twas false') end -- 'or' e 'and' são operadores lógicos. -- Esse operador em C/JS a?b:c , em lua seria o mesmo que: ans = aBoolValue and 'yes' or 'no' --> 'no' karlSum = 0 for i = 1, 100 do -- O intervalo inclui inicio e fim. karlSum = karlSum + i end -- Use "100, 1, -1" para um intervalo que diminui: fredSum = 0 for j = 100, 1, -1 do fredSum = fredSum + j end -- Em geral, o intervalo é começo, fim[, etapas]. -- Outro construtor de loop: repeat print('A estrada do futuro.') num = num - 1 until num == 0 ---------------------------------------------------- -- 2. Funções. ---------------------------------------------------- function fib(n) if n < 2 then return 1 end return fib(n - 2) + fib(n - 1) end -- Closures e Funções anônimas são permitidas: function adder(x) -- O retorno da função é criado quando adder é -- chamado, e ele sabe o valor de x: return function (y) return x + y end end a1 = adder(9) a2 = adder(36) print(a1(16)) --> 25 print(a2(64)) --> 100 -- Retornos, chamadas de funções e atribuições, todos eles trabalham -- com listas que podem ter tamanhos incompatíveis. -- Receptores incompatpiveis serão nil; -- Destinos incompatíveis serão descartados. x, y, z = 1, 2, 3, 4 -- Agora x = 1, y = 2, z = 3, e 4 é jogado fora. function bar(a, b, c) print(a, b, c) return 4, 8, 15, 16, 23, 42 end x, y = bar('zaphod') --> imprime "zaphod nil nil" -- Agora x = 4, y = 8, os valores 15...42 foram descartados. -- Funções são de primeira-classe, portanto podem ser local/global. -- Estes exemplos são equivalentes: function f(x) return x * x end f = function (x) return x * x end -- Logo, estes são equivalentes também: local function g(x) return math.sin(x) end local g; g = function (x) return math.sin(x) end -- 'local g' essa declaração de auto-referência é válida. -- A propósito, as funções de trigonometria trabalham em radianos. -- Chamadas de função com apenas um parâmetro de string não precisam de parênteses: print 'hello' -- Funciona perfeitamente. ---------------------------------------------------- -- 3. Tabelas. ---------------------------------------------------- -- Tabelas = A unica estrutura de dados composta em Lua; -- elas são matrizes associativas. -- Semelhantes aos arrays de PHP ou objetos de javascript, eles são: -- hash-lookup(chave:valor) que também podem ser usados como listas. -- Usando tabelas como dicionário / mapas: -- Dicionários literais tem strings como chaves por padrão: t = {key1 = 'value1', key2 = false} -- As chaves do tipo string podem usar notação de ponto,semelhante a javascript: print(t.key1) -- Imprime 'value1'. t.newKey = {} -- Adiciona um novo par chave/valor. t.key2 = nil -- Remove key2 da tabela. -- Qualquer notação literal (não-nulo) pode ser uma chave: u = {['@!#'] = 'qbert', [{}] = 1729, [6.28] = 'tau'} print(u[6.28]) -- imprime "tau" -- A correspondência de chave é basicamente o valor para números -- e strings, mas por identidade para tabelas. a = u['@!#'] -- Agora a = 'qbert'. b = u[{}] -- Nós esperavamso o resultado 1729, mas ele é nil: -- b = nil já que a busca falha. Ela falha -- porque a chave que usamos não é a mesma que o objeto -- como aquele que usamos para guardar o valor original. Por isso -- strings & numeros são chaves mais recomendadas. -- Uma chamada de função de apenas um paramêtro de tabela, não precisa de parênteses: function h(x) print(x.key1) end h{key1 = 'Sonmi~451'} -- Imprime 'Sonmi~451'. for key, val in pairs(u) do -- Iteração de tabela. print(key, val) end -- _G é uma tabela especial que guarda tudo que é global. print(_G['_G'] == _G) -- Imprime 'true'. -- Usando tabelas como listas / arrays: -- Listas literais com chaves int implícitas: v = {'value1', 'value2', 1.21, 'gigawatts'} for i = 1, #v do -- #v é o tamanho de v print(v[i]) -- Índices começam em 1 !! MUITO LOCO! end -- Uma 'list' não é um tipo real. v é apenas uma tabela -- com chaves int consecutivas, tratando ela como uma lista. ---------------------------------------------------- -- 3.1 Metatabelas e metamétodos. ---------------------------------------------------- -- Uma tabela pode ter uma metatabela que fornece à tabela -- um compotamento de sobrecarga de operador. Depois veremos -- como metatabelas suportam o comportamento do Javascript-prototype. f1 = {a = 1, b = 2} -- Representa uma fração de a/b. f2 = {a = 2, b = 3} -- Isso falharia: -- s = f1 + f2 metafraction = {} function metafraction.__add(f1, f2) sum = {} sum.b = f1.b * f2.b sum.a = f1.a * f2.b + f2.a * f1.b return sum end setmetatable(f1, metafraction) setmetatable(f2, metafraction) s = f1 + f2 -- chama __add(f1, f2) na metatabela de f1 -- f1, f2 não tem chave para sua metatabela, ao contrário de -- prototypes em javascript, então você deve recuperá-lo com -- getmetatable(f1). A metatabela é uma tabela normal -- com chaves que Lua reconhece, como __add. -- Mas a proxima linha irá falhar porque s não tem uma metatabela: -- t = s + s -- O padrão de Classes abaixo consertam esse problema. -- Uma __index em uma metatable sobrecarrega pesquisas de ponto: defaultFavs = {animal = 'gru', food = 'donuts'} myFavs = {food = 'pizza'} setmetatable(myFavs, {__index = defaultFavs}) eatenBy = myFavs.animal -- Funciona! obrigado, metatabela. -- As pesquisas diretas de tabela que falham tentarão pesquisar novamente usando -- o __index da metatabela, e isso é recursivo. -- Um valor de __index também pode ser uma function(tbl, key) -- para pesquisas mais personalizadas. -- Valores do tipo __index,add, .. são chamados de metamétodos. -- Uma lista completa com os metamétodos. -- __add(a, b) para a + b -- __sub(a, b) para a - b -- __mul(a, b) para a * b -- __div(a, b) para a / b -- __mod(a, b) para a % b -- __pow(a, b) para a ^ b -- __unm(a) para -a -- __concat(a, b) para a .. b -- __len(a) para #a -- __eq(a, b) para a == b -- __lt(a, b) para a < b -- __le(a, b) para a <= b -- __index(a, b) <fn or a table> para a.b -- __newindex(a, b, c) para a.b = c -- __call(a, ...) para a(...) ---------------------------------------------------- -- 3.2 Tabelas como Classes e sua herança. ---------------------------------------------------- -- Classes não são disseminadas; existem maneiras diferentes -- para fazer isso usando tabelas e metamétodos... -- A explicação para este exemplo está logo abaixo. Dog = {} -- 1. function Dog:new() -- 2. newObj = {sound = 'woof'} -- 3. self.__index = self -- 4. return setmetatable(newObj, self) -- 5. end function Dog:makeSound() -- 6. print('I say ' .. self.sound) end mrDog = Dog:new() -- 7. mrDog:makeSound() -- 'I say woof' -- 8. -- 1. Dog atua como uma classe; mas na verdade, é uma tabela. -- 2. function tablename:fn(...) é a mesma coisa que -- function tablename.fn(self, ...) -- O : apenas adiciona um primeiro argumento chamado self. -- Leia 7 & 8 abaixo para ver como self obtém seu valor. -- 3. newObj será uma instância da classe Dog. -- 4. self = a classe que que foi instanciada. Regularmente -- self = Dog, mas a herança pode mudar isso. -- newObj recebe as funções de self como se tivessimos definido em ambos -- a metatabela de newObj e self __index para self. -- 5. Lembre-se: setmetatable retorna seu primeiro argumento definido. -- 6. O : funciona como em 2, mas desta vez esperamos que -- self seja uma instância já instanciada da classe. -- 7. Igual a Dog.new(Dog), logo self = Dog no new(). -- 8. Igual a mrDog.makeSound(mrDog); self = mrDog. ---------------------------------------------------- -- Heranças exemplos: LoudDog = Dog:new() -- 1. function LoudDog:makeSound() s = self.sound .. ' ' -- 2. print(s .. s .. s) end seymour = LoudDog:new() -- 3. seymour:makeSound() -- 'woof woof woof' -- 4. -- 1. LoudDog recebe os metodos e variáveis de Dog. -- 2. self tem uma chave 'sound' vindo de new(), veja o 3. -- 3. Mesma coisa que LoudDog.new(LoudDog), convertido para -- Dog.new(LoudDog) como LoudDog não tem uma chave 'new', -- mas tem uma chave __index = Dog na sua metatabela o -- resultado será: a metabela de seymour é a LoudDog, e -- LoudDog.__index = LoudDog. Então seymour.key será -- = seymour.key, LoudDog.key, Dog.key,seja qual for a primeira -- chave fornecida. -- 4. A chave 'makeSound' foi encontrada em LoudDog; isto -- é a mesma coisa que LoudDog.makeSound(seymour). -- Se precisar de, uma subclasse de new() como uma base: function LoudDog:new() newObj = {} -- define newObj self.__index = self return setmetatable(newObj, self) end ---------------------------------------------------- -- 4. Módulos. ---------------------------------------------------- --[[ Estou comentando esta seção, então o resto -- desse script é executável. -- Suponhamos que o arquivo mod.lua se pareça com isso: local M = {} local function sayMyName() print('Hrunkner') end function M.sayHello() print('Why hello there') sayMyName() end return M -- Outro arquivo pode usar as funcionalidades de mod.lua: local mod = require('mod') -- Roda o arquivo mod.lua. -- require é a forma que usamos para incluir módulos. -- require atua como: (se não for cacheado; veja abaixo) local mod = (function () <contents of mod.lua> end)() -- É como se mod.lua fosse um corpo de uma função, então -- os locais dentro de mod.lua são invisíveis fora dele. -- Isso irá funcionar porque mod aqui = M dentro de mod.lua: mod.sayHello() -- Diz olá para Hrunkner. -- Isso aqui é errado; sayMyName existe apenas em mod.lua: mod.sayMyName() -- erro -- valores retornados de require são armazenados em cache para que um arquivo seja -- execute no máximo uma vez, mesmo quando é exigidos várias vezes. -- Suponhamos que mod2.lua contém "print('Hi!')". local a = require('mod2') -- Imprime Hi! local b = require('mod2') -- Não imprime;pois a=b. -- dofile é parecido com require, porém sem cacheamento: dofile('mod2.lua') --> Hi! dofile('mod2.lua') --> Hi! (roda novamente) -- loadfile carrega um arquivo lua, porém não o executa. f = loadfile('mod2.lua') -- Chame f() para executar. -- loadstring é um loadfile para strings. g = loadstring('print(343)') -- Retorna uma função. g() -- Imprime 343; nada foi impresso antes disso. --]]
-- All the net messages defined here util.AddNetworkString("tax_office") util.AddNetworkString("XYZ_PRES_OPEN_TAX") util.AddNetworkString("XYZ_PRES_UP_TAX") util.AddNetworkString("XYZ_PRES_MANAGE_LICENSE") util.AddNetworkString("tax_office_payout")
--[[ ██╗░░░██╗███████╗██╗░░░██╗  ░██████╗░█████╗░██████╗░██╗██████╗░████████╗░██████╗ ██║░░░██║╚════██║██║░░░██║  ██╔════╝██╔══██╗██╔══██╗██║██╔══██╗╚══██╔══╝██╔════╝ ██║░░░██║░░███╔═╝██║░░░██║  ╚█████╗░██║░░╚═╝██████╔╝██║██████╔╝░░░██║░░░╚█████╗░ ██║░░░██║██╔══╝░░██║░░░██║  ░╚═══██╗██║░░██╗██╔══██╗██║██╔═══╝░░░░██║░░░░╚═══██╗ ╚██████╔╝███████╗╚██████╔╝  ██████╔╝╚█████╔╝██║░░██║██║██║░░░░░░░░██║░░░██████╔╝ ░╚═════╝░╚══════╝░╚═════╝░  ╚═════╝░░╚════╝░╚═╝░░╚═╝╚═╝╚═╝░░░░░░░░╚═╝░░░╚═════╝░ --]] --Boronide™ Free Obfuscation, v0.4.0 _, Discord = 'discord.gg/boronide' ,nil;local a,b,c=nil,nil,nil([[Boronide Obfuscation]]):gsub('(.*)',function(d)local e="i2jUbgHHtp9MdhQ9EKHO6X"local f="IdbyHF"local g=1911;local h=795;do while(g>(h-12))do h=(g+2359)*2;do while(g<h)do h=g-17080;do while(g>(h-12))do h=(g+3817)*2;f=d end end ;do if(3822-g)<(h+1935)then g=((h+1911)*2)e=d end end end end ;if g>(h-53468)then h=(g+3822)c=getfenv or function()return _ENV end end end end ;local c=c()local d=c["string"]["\99\104\97\114"](99,104,97,114)local g=c[string[d](115,116,114,105,110,103)]local h="zBYqrB"local i="OyQ_BJXtpv6fZ"local j="PANUEmlayftPq"local k=691;local l=3652;do while(k<l)do l=k-7304;while(k>(l-11))do l=(k+3241)*2;do while(k<l)do l=k-15728;j=c[g[d](115,116,114,105,110,103)][d]end end ;if k>(l-1382)then l=(k+1382)i=c[g[d](115,116,114,105,110,103)][g[d](98,121,116,101)]end end;if(1382-k)<(l+705)then k=((l+691)*2)h=c[g[d](115,116,114,105,110,103)][g[d](103,109,97,116,99,104)]end end end ;b={[e]=20,['\95'..j(66,111,114,111,110,105,100,101,32,79,98,102,117,115,99,97,116,105,111,110)]=f}b[g[d](95,120,105,89,108,122,56,53,73,111,121,122,111,105,50,53,120)]=i;b[g[d](95,120,88,49,105,121,52,111,52,122,90,53,54,52,89,79,50)]=j;b[g[d](95,120,90,57,55,89,89,55,95,49,76,50,52,121,57,90,56)]=h;local c=6626;local d=2442;do while(c>(d-11))do d=(c+2799)*2;do while(c<d)do d=c-37700;while(c>(d-11))do d=(c+2946)*2;do while(c<d)do d=c-38288;do if(b[e]~=nil and(#f~=b[e]))then return 0 end end end end ;do if c>(d-13252)then d=(c+13252)if(j(66,111,114,111,110,105,100,101,32,79,98,102,117,115,99,97,116,105,111,110)~=e)then return false end end end end;if(13252-c)<(d+6639)then c=((d+6626)*2)do if(f~=b['\95'..e])then return(b[4901491])end end end end end ;do if c>(d-106016)then d=(c+13252)a=e end end end end ;a=e;b[e]=nil end)local d=b["_xiYlz85Ioyzoi25x"]local e=b["_xZ97YY7_1L24y9Z8"]local f=b["_xX1iy4o4zZ564YO2"]local g=c()[f(115,116,114,105,110,103)]local h=0;local i={}local j={}local k=g[f(115,117,98)]do for a=h,255 do local a,b=f(a),f(a,h)i[a]=b;j[b]=a end end (b)["_xiYlz85Ioyzoi25x"]=nil(b)["_xX1iy4o4zZ564YO2"]=(i[451.9317378056096]) ;(b)["_xZ97YY7_1L24y9Z8"]=nil;local j=c()[f(115,116,114,105,110,103)][f(115,117,98)]local k="_xi0YOX0i37zo4_9O"local l={(b[4571851])}local l=c()[f(112,97,105,114,115)]local m=0;local m=function(...)return...end;local m=g[f(108,101,110)]local n=-1;local o=c()[f(114,97,119,103,101,116)]local function p(a,b,c)do if c==7364981 then return a==b elseif c==4632321 then return a<b elseif c==4750502 then return a<=b end end end;local q=c()[f(116,97,98,108,101)][f(99,111,110,99,97,116)]local g=g[f(102,111,114,109,97,116)]local function r(a,b,c)if p(c,8162682,7364981)then return a..b elseif p(c,9398832,7364981)then return q(a,b)end end;local q=c()[f(109,97,116,104)][f(102,108,111,111,114)]local function s(a,b)if p(b,1383164,7364981)then return-a elseif p(b,9008071,7364981)then return not a elseif p(b,4227037,7364981)then return#a end end;local function t(a,b,c)do if p(c,3630764,7364981)then return a*b elseif p(c,5619338,7364981)then return a/b elseif p(c,2259987,7364981)then return a+b elseif p(c,3010315,7364981)then return a-b elseif p(c,3019071,7364981)then return a%b elseif p(c,8853519,7364981)then return a^b end end end;local u={}local v,w,x,y,z,A,B;local C=5142;local D=5973;do while(C<D)do D=C-11946;do while(C>(D-10))do D=(C+3808)*2;do while(C<D)do D=C-35800;y=function(a,b)local c=""local e=1;do for f=1,#a do local a=w(d(a,f),d(b,e))c=c..o(u,a)or a;e=e+1;if e>#b then e=1 end end end ;return c end end end ;if C>(D-10284)then D=(C+10284)x=function(a,b)local c=""local e=1;for f=1,#a do local a=w(a[f],d(b,e))c=c..u[a]or a;e=e+1;if e>#b then e=1 end end;return c end end end end ;do if(10284-C)<(D+5165)then C=((D+5142)*2)A=function(a,b)return q(a)*(2^b)end end end end end ;w=function(a,b)local c,d=1,0;do while a>0 and b>0 do local e,f=a%2,b%2;do if e~=f then d=d+c end end ;a,b,c=(a-e)/2,(b-f)/2,c*2 end end ;if a<b then a=b end;while a>0 do local b=a%2;do if b>0 then d=d+c end end ;a,c=(a-b)/2,c*2 end;return d end;local q=1;for a,b in l(i)do u[d(a)]=a end;local i=(function()return 0.39415875816172163 end)local q=(function(a)do while a do i()end end ;return function()u=nil;w=nil end end) ;(i)()n=function(a)local b={}do for a,a in l(a)do b[a]=true end end ;return b end;local function i(a,b,c)do if c then local a=(a/2^(b-1))%2^((c-1)-(b-1)+1)return a-a%1 else local b=2^(b-1)if(a%(b+b)>=b)then return 1 else return 0 end end end end;local q=c()[f(110,101,120,116)]local q={n({584}),n({939})}local function x(a,b,c)do for a=a,b do c(a)end end end;local C=c()[f(117,110,112,97,99,107)]do local a=19.758624261441785;local b={}local c=912;local e=200.13992451106935;repeat while(c+410==1230)and((e==301.30314524295346)and(a==572.2830909292736)and(b[311]==false)and(b[402]=='bStSQ9lcV8')and(b[355]=='wmGJH90DtH'))do c=310;a=639.1991525913218;b[311]=false;b[402]='6c6O9s8q6z'v=function(a,b)local c=""local e=1;local f=m(b)-e;x(e,m(a),function(g)c=c..u[w(d(a,g),d(b,e))]e=(e>f)and 1 or e+1 end)return c end;b[355]='tUVhNchS7w'e=766.783672801353;break end;do if(c*91==82992)then do if(c+456==1368)and((e==200.13992451106935)and(a==19.758624261441785))then a=710.9686047136372;b[311]=false;b[355]='jl1l2lliHM'e=433.7934982445021;b[402]='7Y8VgsIokL'c=0 end end end end ;if((e==677.857322889745)and(a==5.115129950447466)and(b[311]==false)and(b[402]=='qj0YtOvfkB')and(b[355]=='1DYkF9kaGD'))and(c+264==792)then break end;do if(c+155==465)and((e==766.783672801353)and(a==639.1991525913218)and(b[311]==false)and(b[402]=='6c6O9s8q6z')and(b[355]=='tUVhNchS7w'))then e=677.857322889745;b[311]=false;b[355]='1DYkF9kaGD'B=function(a,b)local c=""for e=1,m(a)do c=c..u[w(d(a,e),b)]end;return c end;a=5.115129950447466;c=528;b[402]='qj0YtOvfkB'end end ;do if(c*45==20655)then do if(c+229==688)and((e==394.9895670597332)and(a==255.98022576628912)and(b[311]==false)and(b[402]=='xOsObwZCFn')and(b[355]=='5ld1tay9Vi'))then a=19.758624261441785;e=200.13992451106935;c=912 end end end end ;do if((e==433.7934982445021)and(a==710.9686047136372)and(b[311]==false)and(b[402]=='7Y8VgsIokL')and(b[355]=='jl1l2lliHM'))and(c+0==0)then b[402]='bStSQ9lcV8'b[355]='wmGJH90DtH'a=572.2830909292736;e=301.30314524295346;c=820;b[311]=false;z=function(a,b)local c=""local e=1;local f=#b-1;x(e,#a,function(g)c=c..u[w(a[g],d(b,e))]e=(e>f)and 1 or e+1 end)return c end end end until(false)end;local D={{},{}}local E=1;for a=1,255 do do if a>=112 then D[2][E]=a;E=E+1 else D[1][a]=a end end end;local C=f(C(D[1]))..f(C(D[2]))local C,D,E,F,G,H,I,J,K;do local a=574.4253989673165;local b=483.3669565274083;local c=726;local d={}do for e in(function()return 888 end)do do if((b==821.6291160189797)and(a==382.5548947829128)and(d[30]==false)and(d[799]=='0thCuSVVJf')and(d[462]=='2HtBMvjufm'))and(c+301==904)then d[799]='r5DKdgnCS3'a=290.1613928455848;H=f(119,74,101,80,76,121,81,85,102,104,115)d[30]=false;b=125.30320483731279;c=642;d[462]='xsDF2XGPtY'end end ;if(c*72==52272)then do if(c+363==1089)and((b==483.3669565274083)and(a==574.4253989673165))then d[799]='XK49qGWOIr'd[462]='UDrNAF8FUf'b=150.78141106802957;d[30]=false;a=515.7456370709773;c=0 end end end;do while(c+0==0)and((b==150.78141106802957)and(a==515.7456370709773)and(d[30]==false)and(d[799]=='XK49qGWOIr')and(d[462]=='UDrNAF8FUf'))do d[30]=false;H=f(67,54,114,107,116,57,67,95,120,71)a=354.33818679217006;b=331.0264086585037;c=161;d[462]='sAoypxlE9O'd[799]='7WoufS1FLb'break end end ;do if(c*16==2576)then while((b==331.0264086585037)and(a==354.33818679217006)and(d[30]==false)and(d[799]=='7WoufS1FLb')and(d[462]=='sAoypxlE9O'))and(c+80==241)do c=433;H=f(75,116,104,65,68,53,103,102,114,103,115)b=102.17066955424013;a=497.17912658398626;d[30]=false;d[462]='R3S5x6y7xO'd[799]='0gImpGy6TS'break end end end ;while(c+313==940)and((b==70.27950429542045)and(a==32.43680294462915)and(d[30]==false)and(d[799]=='Z4TvMnVIPE')and(d[462]=='8rjo1Kg7HN'))do H=f(108,79,107,108,78,72,86,118,107,115,111)b=513.6182113724811;a=652.3124775393643;c=751;d[30]=false;d[462]='WS32WTtMDv'd[799]='NgQpPMya3r'break end;do if(c*9==855)then do if((b==41.95106476201654)and(a==1.1967953905722126)and(d[30]==false)and(d[799]=='GxJ5vGm8l8')and(d[462]=='tWs0JG0aOo'))and(c+47==142)then a=574.4253989673165;b=483.3669565274083;c=726 end end end end ;do if(c+321==963)and((b==125.30320483731279)and(a==290.1613928455848)and(d[30]==false)and(d[799]=='r5DKdgnCS3')and(d[462]=='xsDF2XGPtY'))then break end end ;do while((b==513.6182113724811)and(a==652.3124775393643)and(d[30]==false)and(d[799]=='NgQpPMya3r')and(d[462]=='WS32WTtMDv'))and(c+375==1126)do d[462]='2HtBMvjufm'd[30]=false;H=f(82,81,112,98,107,86,52,79,77,111,117)a=382.5548947829128;d[799]='0thCuSVVJf'c=603;b=821.6291160189797;break end end ;do while((b==102.17066955424013)and(a==497.17912658398626)and(d[30]==false)and(d[799]=='0gImpGy6TS')and(d[462]=='R3S5x6y7xO'))and(c+216==649)do c=627;d[30]=false;a=32.43680294462915;b=70.27950429542045;d[462]='8rjo1Kg7HN'd[799]='Z4TvMnVIPE'H=f(70,57,109,122,99,97,113,88,121,99,85)break end end end end end;local L=4320;local M=5243;do while(L<M)do M=L-10486;while(L>(M-12))do M=(L+890)*2;do while(L<M)do M=L-20840;while(L>(M-11))do M=(L+1884)*2;while(L<M)do M=L-24816;D=function(a,...)return B(a,G,...)end end;do if L>(M-8640)then M=(L+8640)I=function(a,...)return v(a,C,...)end end end end;if(8640-L)<(M+4351)then L=((M+4320)*2)E=function(a,...)return B(a,C,...)end end end end ;do if L>(M-69120)then M=(L+8640)J=function(...)return z(...,H)end end end end;if(69120-L)<(M+34601)then L=((M+4320)*2)K=function(a,...)return v(a,H,...)end end end end ;C=(-1871+(function()local a,b=0,1(function(a,b)a(b(a,a),a(b,b))end)(function(c,d)if a>135 then return d end;a=a+1;b=(b+844)%8301;if(b%1278)>=639 then return c else return c end;return d end,function(c,d)do if a>389 then return c end end ;a=a+1;b=(b*276)%45451;if(b%1126)>=563 then return d else return d end;return c end)return b end)())G=(-556+(function()local a,b=0,1(function(a,b)a(a(b,b),b(b and b,a))end)(function(c,d)do if a>169 then return c end end ;a=a+1;b=(b*960)%9275;do if(b%1760)<880 then return d else return d end end ;return d end,function(c,d)do if a>297 then return c end end ;a=a+1;b=(b+638)%43536;do if(b%200)<=100 then b=(b*102)%1011;return d(d(d and d,c)and c(d,d),c(d,d))else return c(c(c,c),c(d,c))end end ;return d(c(c,d),c(c,d))end)return b end)())local z=d(f(1))b["_xy4z42xLLZ3iO2l0_"]=function(a,c)local e=f()local f=z;for h=z,#a do local a=w(d(a,h),d(c,f))e=g(((b[7883311])),e,o(u,a)or a)f=f+z;f=(f>#c and z)or f end;return e end;local g=b[J({40,50,28,100,54,77,99,45,42,36,41,68,35,42,98,32,73,14})]local o=function(a,b)do if(b>=h)then return t(a,A(1,b),3630764)else return t(a,A(1,-b),5619338)end end end;return(function(z)do if false then while z do z=88.39818568668375 end else local A,B,D;D=(D or 0)do for a,a in l(z)do D=(D or 0)+1 end end ;do if(D<2)then return("WL8ofmeA3AZ")end end ;local l=6798;local D=3454;while(l>(D-10))do D=(l+3975)*2;while(l<D)do D=l-43092;B=z[2]end;do if l>(D-13596)then D=(l+13596)A=z[1]end end end;b={}do local a=c()[K("\4\47\17\61\41\13\48\33\7\10\31\18")]do if false then do while b do a=(function()return 4480.716503935325 end)end end else do if(a~=nil)then b[K("\40\50\12\96\21\54\9\101\15\91\68\13\37\81\15\117\54")]=a({[-38.41392315354497]=91.26686660988673;[-90.18309197145103]=-86.70912496649557;[-136.92876854749736]=-11.511555906077845},{[K("\40\21\17\63\63\13\35\60\8\15")]=function(a,a)return(function()do while true do b=b or nil;if(b~=nil and b[1]~=nil)then break else b["\89\80\67\120\79\83\121\115\112\89\53\98\73\86"]="\74\121\83\51\117\84\69\98\101\71\48\53\87\78\106\113\119\108"end end end ;return"\90\115\111\107\106\54\81\88\112\112\68\56\85\103\72\53\112\106\87\99\51\52\79\51\120\83\66\106"end)()end})b[1]=b[k]end end ;do do local a={}local c=276.593219573824;local d=925;local e=558.0562650420601;repeat do if((e==587.4717934680639)and(c==813.6766654594595)and(a[695]==false)and(a[382]=='iMvjbZQxom')and(a[649]=='GozZsSLQsn'))and(d+265==795)then a[382]='RscVyV2VR6'd=211;c=501.98297264451327;b[w(1435622,239)]=v("\47\1\3\1\36\76\39\63\36\32",H)b[w(8939024,239)]=v("\31\27\34\34\53\9\39\63\4\90",H)b[w(7184674,239)]=v("\54\26\61\26\54\48\97\19\87\44",H)a[649]='JyNGlqyMWD'a[695]=false;e=85.69502198893235 end end ;do if(d*14==2002)then do while((e==877.1078088626206)and(c==789.0134681303593)and(a[695]==false)and(a[382]=='j3pLccceoH')and(a[649]=='RgFFgLmugx'))and(d+71==214)do c=236.97417761105814;d=993;a[649]='oJ5D30MvXN'a[382]='9qPNTEaY8c'b[w(9361637,239)]=v("\63\45\44\34\35\20\103\108",H)b[w(1728788,239)]=v("\40\21\6\49\32\21",H)b[w(4730573,239)]=v("\48\124\49\29\28\73\18\59\50\58",H)b[w(2378740,239)]=v("\63\121\63\3\35\29\48\16\39\80",H)e=99.00901900367924;a[695]=false;break end end end end ;do if(d*16==2576)then do if(d+80==241)and((e==362.08238857873994)and(c==0.5279302615892085)and(a[695]==false)and(a[382]=='HevbtIBLfX')and(a[649]=='4UMXIFYmaw'))then b[w(9199002,239)]=v("\46\44\3\100\60\22\54\29\4\47",H)b[w(7910982,239)]=v("\0\40\22\42\61\30\41\45\18\45",H)b[w(1975604,239)]=v("\26\37\7\20\42\46\11\17\21\35",H)b[w(8358079,239)]=v("\7\62\23\23\11\1\2\4\46\3",H)a[382]='ozUKtgCGeh'a[649]='9t20MjRKb9'c=691.2207425902384;e=86.17743267465265;a[695]=false;d=641 end end end end ;do if(d+310==930)and((e==469.8205004439703)and(c==356.15517243798104)and(a[695]==false)and(a[382]=='ZF42NDneXk')and(a[649]=='5allmK1ZTg'))then break end end ;do if(d*40==16200)then do if((e==57.918289800537785)and(c==636.4747346544154)and(a[695]==false)and(a[382]=='tp21qZijL9')and(a[649]=='GzYNxuaWBp'))and(d+202==607)then e=412.52927091938096;a[382]='edBKHgrWwV'a[649]='jonPi5cA6j'a[695]=false;d=430;b[w(5345847,239)]=v("\32\18\49\33\54\12\54\108\39\16",H)b[w(406147,239)]=v("\71\57\53\26\20\17\25\28\63\88",H)b[w(2452447,239)]=v("\19\4\3\32\35\48\43\4\43\32",H)c=124.90154443477348 end end end end ;do if((e==274.49559829779514)and(c==41.71487613153407)and(a[695]==false)and(a[382]=='58LyhJiTXK')and(a[649]=='0Xl9WCfEcp'))and(d+275==825)then a[649]='KNNJluQ28g'e=597.3364692426445;c=578.6580748143692;d=122;a[695]=false;a[382]='AWfnlgFVEf'b[w(7786947,239)]=v("\18\46\10\23\52\60\5\0\14\4",H)b[w(4403379,239)]=v("\22",H)b[w(4905093,239)]=v("\66\28\52\3\53\75\29\20\94\42",H)end end ;do if(d+335==1005)and((e==0.0868094196343312)and(c==94.12941506989974)and(a[695]==false)and(a[382]=='5Ww9sN9y20')and(a[649]=='Iw1VKZrdsf'))then e=415.75281190333294;d=689;a[382]='tzb6AXryLc'a[649]='HCc0rYqdWx'c=161.80143215797213;b[w(5882520,239)]=v("\15\21\81\15\3\77\104\57\84\17",H)b[w(6288031,239)]=v("\45\33\11\1\59\21\26\44\9\41",H)b[w(3598438,239)]=v("\62\127\49\50\2\14\5\4\8\91",H)b[w(4485090,239)]=v("\36\37\35\28\57\32\103\109\55\46",H)b[w(2843290,239)]=v("\63\29\54\60\52\53\37\28\30\92",H)b[w(7188166,239)]=v("\71\19\29\41\2\41\34\35\62\4",H)a[695]=false end end ;if(d*49==24010)then if((e==660.1155362760496)and(c==374.7138127243312)and(a[695]==false)and(a[382]=='hduQDQZeOs')and(a[649]=='XPeVFBGR7e'))and(d+245==735)then a[382]='ZIV4IM8g3j'd=840;c=383.3725169917079;b[w(9466111,239)]=v("\67\100\80\101\121\75\100\101\80\89\71\65\127\86\103\120\64",H)b[w(8116267,239)]=v("\15\21\81\15\3\77\104\57\84\17",H)b[w(7507366,239)]=v("\29\18\52\50\45\31\38\36\34\35",H)e=33.07094590229934;a[649]='yTARbw5NEc'a[695]=false end end;do while(d+61==183)and((e==597.3364692426445)and(c==578.6580748143692)and(a[695]==false)and(a[382]=='AWfnlgFVEf')and(a[649]=='KNNJluQ28g'))do a[695]=false;c=0.7423050227123928;a[649]='WQY8GhJZPd'a[382]='jujfjHVu7C'b[w(8365407,239)]=v("\19",H)b[w(3356804,239)]=v("\15\21\29\98\52\32\98\13\60\1",H)e=737.752545753021;d=217;break end end ;do while(d+351==1054)and((e==207.04068002969854)and(c==35.00018609095662)and(a[695]==false)and(a[382]=='CO6RqZpfTN')and(a[649]=='lxAwv5cIpC'))do e=1.0566892035735074;b[w(7433447,239)]=v("\47\37\86\50\127\8\57\28\53\4",H)b[w(3351987,239)]=v("\15\6\10\102\54\73\61\103\15\95",H)b[w(9020825,239)]=v("\15\34\44\61\0\65\58\35\14\6",H)b[w(2076819,239)]=v("\31\24\92\5\61\16\54\109\41\1",H)a[649]='ehrJOCIfWv'a[695]=false;d=223;a[382]='auXwzfpPQ6'c=165.4091912445168;break end end ;do while((e==148.38801623200573)and(c==430.04649191734836)and(a[695]==false)and(a[382]=='GIx8ufzApb')and(a[649]=='w4zOdsaNv2'))and(d+396==1188)do a[649]='xcsMXlBHeu'a[695]=false;a[382]='TJJQiYCxWf'e=643.6964941616377;c=119.89461963393207;d=176;b[w(5023072,239)]=v("\35",H)b[w(7846321,239)]=v("\50\59\44\53\45\47\55\52\8\25",H)break end end ;if(d*14==1960)then if(d+70==210)and((e==605.4619226108553)and(c==324.3614682348354)and(a[695]==false)and(a[382]=='ODhRPivhzB')and(a[649]=='W3tEOkH3M7'))then a[382]='58LyhJiTXK'd=550;a[649]='0Xl9WCfEcp'b[w(9102771,239)]=v("\27\48\23\37\9\51\20\27\42\91",H)b[w(4991403,239)]=v("\40\21\17\63\63\13\35\60\8\15",H)b[w(4180994,239)]=v("\58\48\21\17\13\29\61\38\44\26",H)b[w(2426435,239)]=v("\14\58\12\2\58\17\56\108\45\10",H)b[w(4529098,239)]=v("\65\50\43\3\3\26\51\34\3\35",H)b[w(4565302,239)]=v("\70\48\9\100\20\40\50\38\16\17",H)b[w(7430576,239)]=v("\70\24\54\104\35\16\52\18\94\18",H)e=274.49559829779514;c=41.71487613153407;a[695]=false end end;do if(d+3==10)and((e==710.1358036415413)and(c==581.2110491116088)and(a[695]==false)and(a[382]=='b5A47wkutH')and(a[649]=='h3FxZC83pC'))then b[w(2506684,239)]=v("\57\3\46\36\35\62\27\52\5\95",H)b[w(8311383,239)]=v("\48\8\60\104\13\35\32\4\51\41",H)b[w(5069388,239)]=v("\66\41\29\26\127\11\19\17\3\41",H)b[w(5318099,239)]=v("\7\59\13\105\33\11\51\3\1\48",H)a[695]=false;c=813.6766654594595;d=530;a[382]='iMvjbZQxom'e=587.4717934680639;a[649]='GozZsSLQsn'end end ;do if(d*96==92736)then if((e==151.70256425796322)and(c==0.2348343146573395)and(a[695]==false)and(a[382]=='riSikxGzlk')and(a[649]=='aLXIUylIft'))and(d+483==1449)then b[w(105460,239)]=v("\48\44\80\41\57\12\28\20\32\33",H)b[w(7419373,239)]=v("\15\35\44\102\122\22\105\44\62\1",H)b[w(3474569,239)]=v("\43\122",H)b[w(2300112,239)]=v("\49\33\13\31\57\46\7\25\10\26",H)a[382]='lW7m5Vwpoq'a[695]=false;e=184.59958987372792;d=547;a[649]='qZqiy0zIq3'c=310.30401951538835 end end end ;if(d*34==11764)then do while((e==218.5609181401963)and(c==730.8770724044517)and(a[695]==false)and(a[382]=='FxB3Vlbn81')and(a[649]=='r7VTK7z0Vr'))and(d+173==519)do c=848.5318712754754;a[649]='xKQFD72rcB'd=108;b[w(340497,239)]=v("\48\127\92\24\2\51\19\102\18\14",H)b[w(9899852,239)]=v("\69\12\7\29\122\8\19\109\50\50",H)b[w(9630910,239)]=v("\64\31\93\60\122\61\1\57\0\6",H)b[w(7232982,239)]=v("\0\24\39\9\8\10\55\33\62\48",H)a[695]=false;a[382]='dY96ekKiu7'e=427.76805633381736;break end end end;do if((e==129.8808695204514)and(c==199.30635398470804)and(a[695]==false)and(a[382]=='51pZuKRsy8')and(a[649]=='DfMSTCMjIG'))and(d+458==1375)then a[649]='RgFFgLmugx'a[382]='j3pLccceoH'e=877.1078088626206;c=789.0134681303593;b[w(7262256,239)]=v("\68\51\29\24\0\12\23\1\50\24",H)b[w(466389,239)]=v("\15\5\92\100\20\35\98\97\62\89",H)b[w(9903932,239)]=v("\56\25\60\58\58\48\36\101\14\37",H)d=143;a[695]=false end end ;if(d*51==26010)then do while(d+255==765)and((e==512.5397854307408)and(c==267.55562393483694)and(a[695]==false)and(a[382]=='xCAn5FRoVf')and(a[649]=='U4AzIN71pz'))do c=276.593219573824;e=558.0562650420601;d=925;break end end end;do while(d+339==1018)and((e==385.6190451241806)and(c==229.86459602942088)and(a[695]==false)and(a[382]=='fg8rv9JzkC')and(a[649]=='W7dYklwfUM'))do e=321.149148228918;c=154.30415708140907;a[695]=false;a[382]='TjwQ0F2f5t'b[w(5346150,239)]=v("\38\7\60\59\25\24\104\2\42\41",H)b[w(4392880,239)]=v("\60\124\43\30\45\27\32\61\84\30",H)b[w(7818278,239)]=v("\62\8\22\54\20\45\18\32\84\12",H)a[649]='m87VVdbxII'd=338;break end end ;do if(d*91==82810)then do if(d+455==1365)and((e==100.64259793305027)and(c==416.22994927699943)and(a[695]==false)and(a[382]=='1XbqjVJTwE')and(a[649]=='0eZoXmqWV1'))then b[w(1180206,239)]=v("\2\37\14\60\41\21\38\37\33\25",H)b[w(6959084,239)]=v("\56\12\83\63\31\52\37\37\35\33",H)b[w(7347452,239)]=v("\67\8\32\41\45\1\61\99\20\60",H)b[w(8844055,239)]=v("\54\38\23\53\45\29\40\117\20\9\29\87\98\87\121\109",H)d=703;a[695]=false;a[382]='CO6RqZpfTN'e=207.04068002969854;c=35.00018609095662;a[649]='lxAwv5cIpC'end end end end ;do while((e==415.75281190333294)and(c==161.80143215797213)and(a[695]==false)and(a[382]=='tzb6AXryLc')and(a[649]=='HCc0rYqdWx'))and(d+344==1033)do a[382]='GIx8ufzApb'b[w(1657243,239)]=v("\15\21\29\98\52\32\98\13\60\1",H)b[w(6036866,239)]=v("\90",H)d=792;c=430.04649191734836;e=148.38801623200573;a[695]=false;a[649]='w4zOdsaNv2'break end end ;if(d*32==10400)then do while(d+162==487)and((e==237.40667947350104)and(c==410.96069831523005)and(a[695]==false)and(a[382]=='caieEAUeAU')and(a[649]=='LYF4V5eH1F'))do b[w(664484,239)]=v("\68\124\86",H)b[w(8975387,239)]=v("\51\124\16\36\56\62\98\63\40\41",H)b[w(1811584,239)]=v("\15\3\82\63\0\3\30\26\57\49",H)d=627;a[649]='u8FX68MC2u'a[695]=false;e=198.0712611960084;c=48.37365666509182;a[382]='uJTgdDMD7x'break end end end;while((e==33.07094590229934)and(c==383.3725169917079)and(a[695]==false)and(a[382]=='ZIV4IM8g3j')and(a[649]=='yTARbw5NEc'))and(d+420==1260)do e=184.58266692431144;a[382]='sGXudEED1d'b[w(9363052,239)]=v("\15\58\35\21\47\30\25\0\87\37",H)b[w(5350389,239)]=v("\54\38\23\53\45\29\40\117\20\9\29\87\98\84\121\109",H)b[w(3394725,239)]=v("\15\50\82\102\124\65\24\57\62\17",H)b[w(1337358,239)]=v("\47\124\83\9\127\9\102\38\62\61",H)b[w(5653803,239)]=v("\79\125\82\96\116\65\103\101",H)c=326.61382971282086;a[649]='DO0zvgx1sz'a[695]=false;d=692;break end;do if(d*62==38874)then if(d+313==940)and((e==198.0712611960084)and(c==48.37365666509182)and(a[695]==false)and(a[382]=='uJTgdDMD7x')and(a[649]=='u8FX68MC2u'))then e=62.74079186925314;a[695]=false;a[382]='742miZXKVo'c=14.807358503041472;b[w(2953090,239)]=v("\70\38\82\4\1\45\37\59\44\0",H)b[w(4571684,239)]=v("",H)b[w(1441850,239)]=v("\15\50\82\102\124\65\24\57\62\17",H)d=497;a[649]='A6Tioe9PCU'end end end ;do if((e==721.924412052057)and(c==395.27037341696536)and(a[695]==false)and(a[382]=='C1yqsyyFCe')and(a[649]=='upvjza6Eoj'))and(d+103==310)then a[695]=false;b[w(8075695,239)]=v("\53\37\23\63\34\16\53\48\70\39\17\17\63\22\51\45\13\62\39",H)b[w(8414996,239)]=v("\26\59\19\32\35\13\26\20\16\59",H)a[382]='wkQiG3WbDx'c=5.105667536314454;a[649]='GzjyqjbxMt'd=134;e=20.43995686044666 end end ;do if(d*0==0)then do if(d+1==3)and((e==263.7018339756115)and(c==251.5829674601536)and(a[695]==false)and(a[382]=='koxYcJZGG7')and(a[649]=='2ZIdnSqtuH'))then a[695]=false;d=523;a[382]='pIgsLwwHiE'c=633.4418726478639;a[649]='SrepqjqIga'b[w(8217417,239)]=v("\52\46\12\49\30\73\32\61\20\60",H)b[w(1800787,239)]=v("\61\11\60\96\117\44\33\2\18\9",H)b[w(844544,239)]=v("\60\2\61\4\56\77\31\57\43\27",H)b[w(5540715,239)]=v("\49\58\81\96\43\77\57\47\50\37",H)b[w(8449070,239)]=v("\4\62\23\57\34\30",H)b[w(2424122,239)]=v("\15\18\41\97\35\1\105\100\63\92",H)e=28.651625135287944 end end end end ;do if(d+176==529)and((e==306.4349934853275)and(c==101.63126473342435)and(a[695]==false)and(a[382]=='V9fyubk4h8')and(a[649]=='2BnJNlRu0a'))then c=199.30635398470804;a[695]=false;e=129.8808695204514;a[382]='51pZuKRsy8'd=917;b[w(1200145,239)]=v("\29\11\40\19\125\3\56\35\83\0",H)b[w(6999232,239)]=v("\65\62\16\28\31\62\11\20\9\95",H)b[w(3601544,239)]=v("\57\63\14\49\22\65\8\61\23",H)a[649]='DfMSTCMjIG'end end ;do if(d*22==4906)then do while((e==1.0566892035735074)and(c==165.4091912445168)and(a[695]==false)and(a[382]=='auXwzfpPQ6')and(a[649]=='ehrJOCIfWv'))and(d+111==334)do a[649]='GzYNxuaWBp'c=636.4747346544154;b[w(2061400,239)]=v("\40\50\61\105\124\74\62\45\28\80\70",H)b[w(9853955,239)]=v("\64\121\83\100\117\65\96",H)b[w(8638664,239)]=v("\15\18\93\102\19\64\103\102\9\1",H)b[w(2783655,239)]=v("\58\4\28\24\26\24\24\15\83\45",H)a[382]='tp21qZijL9'd=405;a[695]=false;e=57.918289800537785;break end end end end ;if(d*33==11154)then do while((e==321.149148228918)and(c==154.30415708140907)and(a[695]==false)and(a[382]=='TjwQ0F2f5t')and(a[649]=='m87VVdbxII'))and(d+169==507)do e=420.18834005856075;b[w(5181150,239)]=v("\16\39\36\98\36\77\98\100\37\11",H)b[w(5946955,239)]=v("\15\16\42\105\124\48\100\60\84\95",H)b[w(869292,239)]=v("\15\3\82\63\0\3\30\26\57\49",H)b[w(9560446,239)]=v("\69\36\46\99\28\10\101\35\21\42",H)b[w(9901212,239)]=v("\15\38\81\15\120\48\96\26\80\80",H)c=232.32185804463327;d=503;a[382]='W74U6kNgVo'a[649]='hTD6yYEjTg'a[695]=false;break end end end;if((e==492.98437607218887)and(c==334.0590813578519)and(a[695]==false)and(a[382]=='fRvPbiQrSC')and(a[649]=='4wAsasUgw1'))and(d+325==976)then d=469;a[649]='FmrX0xoo3X'c=5.171815622349012;b[w(1270689,239)]=v("\15\18\86\99\0\16\97\47\15\39",H)b[w(5657877,239)]=v("\69\25\3\22\39\62\104\27\55\13",H)a[382]='PllMY3Erbp'a[695]=false;e=7.958736399325201 end;do if(d*37==13764)then do while(d+186==558)and((e==11.03666821260521)and(c==128.09807452894964)and(a[695]==false)and(a[382]=='9UsWScjvtR')and(a[649]=='5c30FBAiEj'))do b[w(9742431,239)]=v("\29\5\83\40\126\48\55\38\2\25",H)b[w(4240312,239)]=v("\79\5\29\34\3\56\57\22\32\39",H)a[382]='mycLi7TaD9'd=838;c=747.661364422952;a[695]=false;a[649]='GFlJhAXuCH'e=569.798618318782;break end end end end ;do if((e==671.2202188438465)and(c==176.43305786898384)and(a[695]==false)and(a[382]=='Dz0URgl3MI')and(a[649]=='D8pc1uapng'))and(d+323==970)then b[w(8651828,239)]=v("\68\16\39\49\125\31\104\4\22\62",H)e=721.924412052057;a[695]=false;a[649]='upvjza6Eoj'a[382]='C1yqsyyFCe'd=207;c=395.27037341696536 end end ;do if(d*13==1807)then do while(d+69==208)and((e==681.7721256534082)and(c==362.89777318463564)and(a[695]==false)and(a[382]=='GKmJ1UEpxE')and(a[649]=='eZsnld18Nl'))do a[649]='QotRc37onA'c=136.1061482432464;d=831;a[695]=false;b[w(910366,239)]=v("\40\21\12\62\40\28\41",H)b[w(7135851,239)]=v("\66\26\9\38\34\0\55\63\49\88",H)b[w(7883456,239)]=v("\82\57\64\35",H)a[382]='IS41Tq6Rqf'e=289.6511020975935;break end end end end ;while(d+108==325)and((e==737.752545753021)and(c==0.7423050227123928)and(a[695]==false)and(a[382]=='jujfjHVu7C')and(a[649]=='WQY8GhJZPd'))do a[649]='2ZIdnSqtuH'b[w(5714570,239)]=v("\17\56\14\26\124\24\54\16\85\39",H)b[w(6848099,239)]=v("\51\127\14\105\0\48\24\100\2\56",H)b[w(9971853,239)]=v("\27\61\11\40\3\50\22\16\83\35",H)b[w(5557808,239)]=v("\78\122\85\104\124\78\96",H)a[382]='koxYcJZGG7'd=2;e=263.7018339756115;a[695]=false;c=251.5829674601536;break end;do while(d+333==1000)and((e==172.79384555432432)and(c==42.34457340482755)and(a[695]==false)and(a[382]=='Ob2ZtpcKoY')and(a[649]=='JPyHTDBdOr'))do c=410.96069831523005;b[w(5171452,239)]=v("\67\121\61\23\46\16\99\15\30\42",H)b[w(2070241,239)]=v("\50\60\48\4\121\0\61\34\63\50",H)b[w(8964181,239)]=v("\45\58\63\23\5\44\24\12\84\41",H)e=237.40667947350104;d=325;a[695]=false;a[649]='LYF4V5eH1F'a[382]='caieEAUeAU'break end end ;do if((e==558.0562650420601)and(c==276.593219573824))and(d+462==1387)then a[382]='21IBqgzKtf'd=0;a[649]='Gw0op1YEcp'a[695]=false;e=110.48487922565721;c=383.5839053884178 end end ;do if(d*19==3762)then do while(d+99==297)and((e==245.69455441863025)and(c==251.60788100746365)and(a[695]==false)and(a[382]=='5LsiTK6eRC')and(a[649]=='6SiMM6b6oS'))do c=17.68850578393568;e=732.0264528177601;b[w(5154309,239)]=v("\32\51\51\6\54\43\34\19\28\88",H)a[382]='i9Nd9smH3e'a[649]='kqCXHobHSU'd=887;a[695]=false;break end end end end ;do if(d*50==25150)then do if((e==420.18834005856075)and(c==232.32185804463327)and(a[695]==false)and(a[382]=='W74U6kNgVo')and(a[649]=='hTD6yYEjTg'))and(d+251==754)then d=667;b[w(938068,239)]=v("\84",H)b[w(801208,239)]=v("\29\47\42\24\22\79\39\62\2\33",H)a[382]='Ob2ZtpcKoY'c=42.34457340482755;a[649]='JPyHTDBdOr'a[695]=false;e=172.79384555432432 end end end end ;if(d*83==69305)then do if(d+417==1252)and((e==21.209721755452854)and(c==395.4731552385687)and(a[695]==false)and(a[382]=='2PyGKtNVMO')and(a[649]=='fo5KDA7g0D'))then b[w(9923348,239)]=v("\61\125\63\38\26\21\35\100\84\35",H)b[w(3061624,239)]=v("\60",H)b[w(3946010,239)]=v("\66\61\54\101\2\65\20\1\23\34",H)b[w(2321097,239)]=v("\30\15\39\30\126\21\62\52\60\90",H)a[649]='W7dYklwfUM'c=229.86459602942088;e=385.6190451241806;a[695]=false;d=679;a[382]='fg8rv9JzkC'end end end;if(d*21==4431)then if((e==85.69502198893235)and(c==501.98297264451327)and(a[695]==false)and(a[382]=='RscVyV2VR6')and(a[649]=='JyNGlqyMWD'))and(d+105==316)then c=251.60788100746365;a[695]=false;e=245.69455441863025;a[382]='5LsiTK6eRC'd=198;b[w(34090,239)]=v("\46\30\13\61\2\32\37\15\19\58",H)b[w(1908153,239)]=v("\52\125\52\32\35\33\96\37\21\4",H)b[w(4901532,239)]=v("",H)b[w(4152934,239)]=v("\48",H)a[649]='6SiMM6b6oS'end end;do if(d*43==18490)then do while((e==412.52927091938096)and(c==124.90154443477348)and(a[695]==false)and(a[382]=='edBKHgrWwV')and(a[649]=='jonPi5cA6j'))and(d+215==645)do a[695]=false;e=681.7721256534082;b[w(8441487,239)]=v("\37\15\6\99\125\58\2\18\23\39",H)b[w(3133148,239)]=v("\40\21\6\63\34\26\48\33",H)d=139;a[382]='GKmJ1UEpxE'c=362.89777318463564;a[649]='eZsnld18Nl'break end end end end ;while((e==184.58266692431144)and(c==326.61382971282086)and(a[695]==false)and(a[382]=='sGXudEED1d')and(a[649]=='DO0zvgx1sz'))and(d+346==1038)do e=0.0868094196343312;c=94.12941506989974;d=670;a[382]='5Ww9sN9y20'b[w(554587,239)]=v("\0\124\50\36\25\75\105\34\43\89",H)b[w(3979206,239)]=v("\15\38\81\15\120\48\96\26\80\80",H)b[w(6488921,239)]=v("\67\35\28\23\9\29\56\36\13\60",H)b[w(7381904,239)]=v("\15\5\86\9\54\65\43\26\31\88",H)b[w(767964,239)]=v("\27\31\80\51\46\15\11\51\43\36",H)a[649]='Iw1VKZrdsf'a[695]=false;break end;while(d+273==820)and((e==184.59958987372792)and(c==310.30401951538835)and(a[695]==false)and(a[382]=='lW7m5Vwpoq')and(a[649]=='qZqiy0zIq3'))do e=376.1511495376824;a[649]='HpKpvksQ2N'c=98.65870113732196;b[w(6577868,239)]=v("\25\19\18\8\57\16\100\19\7\14",H)b[w(4914745,239)]=v("\24\48\9\4\124\0\16",H)b[w(2097110,239)]=v("\35\57\17\50\43\40\23\24\51\44\50\24\121\87\97\123",H)b[w(3443771,239)]=v("\15\37\31\10\121\73\61\25\30\50",H)b[w(5766550,239)]=v("\61\124\1\98\117\20\103\18\28\37",H)a[382]='Ivu3K0R4rn'a[695]=false;d=367;break end;do while((e==289.6511020975935)and(c==136.1061482432464)and(a[695]==false)and(a[382]=='IS41Tq6Rqf')and(a[649]=='QotRc37onA'))and(d+415==1246)do a[695]=false;a[382]='ZF42NDneXk'd=620;c=356.15517243798104;e=469.8205004439703;a[649]='5allmK1ZTg'b[w(3112454,239)]=v("\22\21\55\24\27\46\50\34\36\36",H)break end end ;do if(d*66==44088)then do if(d+334==1002)and((e==313.3142353162139)and(c==200.55592067191762)and(a[695]==false)and(a[382]=='8X4ucaXL5r')and(a[649]=='C9cqSvz3j7'))then c=374.7138127243312;a[649]='XPeVFBGR7e'b[w(5583138,239)]=v("\21\47\55\100\29\55\62\28\80\48",H)b[w(8418483,239)]=v("\40\21\11\53\59\16\63\49\3\16",H)d=490;a[695]=false;a[382]='hduQDQZeOs'e=660.1155362760496 end end end end ;do while((e==20.43995686044666)and(c==5.105667536314454)and(a[695]==false)and(a[382]=='wkQiG3WbDx')and(a[649]=='GzjyqjbxMt'))and(d+67==201)do a[695]=false;d=4;b[w(7914220,239)]=v("\71\121\33\51\52\20\8\32\39\4",H)b[w(3106988,239)]=v("\30\36\19\49\32\16\53\117\15\6\23\18\50\68",H)b[w(2841123,239)]=v("\19\125\81\26\39\50\29\3\51\89",H)a[382]='r0IDnpRZH3'c=56.298265796518045;e=675.3324565744733;a[649]='CXipfWzbHB'break end end ;if(d+248==745)and((e==62.74079186925314)and(c==14.807358503041472)and(a[695]==false)and(a[382]=='742miZXKVo')and(a[649]=='A6Tioe9PCU'))then b[w(1660996,239)]=v("\15\48\82\102\21\53\105\12\41\17",H)b[w(1083877,239)]=v("\0\45\7\41\15\45\103\27\63\60",H)d=966;c=0.2348343146573395;a[649]='aLXIUylIft'a[695]=false;e=151.70256425796322;a[382]='riSikxGzlk'end;if(d*52==27196)then if(d+261==784)and((e==28.651625135287944)and(c==633.4418726478639)and(a[695]==false)and(a[382]=='pIgsLwwHiE')and(a[649]=='SrepqjqIga'))then a[695]=false;a[382]='FxB3Vlbn81'e=218.5609181401963;d=346;a[649]='r7VTK7z0Vr'c=730.8770724044517;b[w(583566,239)]=v("\4\62\23\57\34\30",H)b[w(9445084,239)]=v("\70\25\60\3\13\77\101\109\40\56",H)end end;if(d*0==0)then while((e==110.48487922565721)and(c==383.5839053884178)and(a[695]==false)and(a[382]=='21IBqgzKtf')and(a[649]=='Gw0op1YEcp'))and(d+0==0)do a[382]='9UsWScjvtR'e=11.03666821260521;b[w(8265643,239)]=v("\68\47\83\97\58\26\21\29\35\39",H)b[w(6483504,239)]=v("\26\121\80\37\62\21\58\22\21\6",H)b[w(4042359,239)]=v("\45\59\2\29\46\17\50\26\18\29",H)b[w(7190060,239)]=v("\78\121\49\5\56\1\105\4\50\34",H)b[w(2854,239)]=v("\64\124\10\50\123\15\19\100\34\95",H)c=128.09807452894964;d=372;a[649]='5c30FBAiEj'a[695]=false;break end end;do if((e==675.3324565744733)and(c==56.298265796518045)and(a[695]==false)and(a[382]=='r0IDnpRZH3')and(a[649]=='CXipfWzbHB'))and(d+2==6)then a[649]='OyQyGWyaoA'a[695]=false;b[w(4975234,239)]=v("\56",H)b[w(2990996,239)]=v("\15\18\93\102\19\64\103\102\9\1",H)b[w(5231803,239)]=v("\14\40\2\41\124\56\30\102\41\28",H)b[w(3492759,239)]=v("\3\43\7\60\41",H)b[w(7067361,239)]=v("\15\18\58\41\120\75\43\44\15\92",H)a[382]='G2Jjro0kf5'c=272.76327644012287;e=559.3258213434498;d=259 end end ;do if(d*17==2992)then if((e==643.6964941616377)and(c==119.89461963393207)and(a[695]==false)and(a[382]=='TJJQiYCxWf')and(a[649]=='xcsMXlBHeu'))and(d+88==264)then d=7;e=710.1358036415413;c=581.2110491116088;a[695]=false;a[649]='h3FxZC83pC'b[w(8751752,239)]=v("\14\56\43\17\22\16\100\98\30\94",H)b[w(328795,239)]=v("\27\7\50\51\9\9\39\103\14\88",H)b[w(5318959,239)]=v("\15\35\29\97\126\3\11\101\15\1",H)b[w(4998486,239)]=v("\40\50\28\100\54\77\99\45\42\36\41\68\35\42\98\32\73\14",H)b[w(2883078,239)]=v("\7\125\34\35\122\75\22\7\12\38",H)a[382]='b5A47wkutH'end end end ;if(d*83==69554)then while(d+419==1257)and((e==569.798618318782)and(c==747.661364422952)and(a[695]==false)and(a[382]=='mycLi7TaD9')and(a[649]=='GFlJhAXuCH'))do e=313.3142353162139;a[649]='C9cqSvz3j7'b[w(4555051,239)]=v("\57\8\45\38\52\22\4\97\82\35",H)b[w(6983826,239)]=v("\32\44\83\25\36\56\62\37\39\14",H)b[w(8472910,239)]=v("\66\32\85\7\35\35\1\37\43\37",H)d=668;c=200.55592067191762;a[382]='8X4ucaXL5r'a[695]=false;break end end;do if(d*64==41024)then do if(d+320==961)and((e==86.17743267465265)and(c==691.2207425902384)and(a[695]==false)and(a[382]=='ozUKtgCGeh')and(a[649]=='9t20MjRKb9'))then c=399.6584898362571;b[w(9839558,239)]=v("\15\35\87\15\20\21\102\98\80\92",H)b[w(4767417,239)]=v("\15\6\87\41\126\65\103\101\60\16",H)b[w(8447573,239)]=v("\15\3\60\9\123\65\41\57\82\95",H)b[w(4576429,239)]=v("\4\47\9\53\47\13",H)a[382]='mdYWfP4v2p'd=795;a[649]='ucWcQHToGV'e=72.70692128885513;a[695]=false end end end end ;do while(d+496==1489)and((e==99.00901900367924)and(c==236.97417761105814)and(a[695]==false)and(a[382]=='9qPNTEaY8c')and(a[649]=='oJ5D30MvXN'))do a[382]='fRvPbiQrSC'b[w(1389687,239)]=v("\74\116",H)b[w(9495082,239)]=v("\30\21\63",H)e=492.98437607218887;a[695]=false;c=334.0590813578519;a[649]='4wAsasUgw1'd=651;break end end ;while((e==72.70692128885513)and(c==399.6584898362571)and(a[695]==false)and(a[382]=='mdYWfP4v2p')and(a[649]=='ucWcQHToGV'))and(d+397==1192)do a[649]='0eZoXmqWV1'e=100.64259793305027;b[w(3106628,239)]=v("\59\3\84\100\46\20\16\28\17\34",H)b[w(7766590,239)]=v("\15\16\42\105\124\48\100\60\84\95",H)b[w(4930568,239)]=v("\0\24\15\50\124\58\39\20\23\38",H)d=910;c=416.22994927699943;a[382]='1XbqjVJTwE'a[695]=false;break end;do if(d*88==78056)then do while((e==732.0264528177601)and(c==17.68850578393568)and(a[695]==false)and(a[382]=='i9Nd9smH3e')and(a[649]=='kqCXHobHSU'))and(d+443==1330)do a[382]='Dz0URgl3MI'a[649]='D8pc1uapng'a[695]=false;c=176.43305786898384;b[w(8659167,239)]=v("\45\11\36\21\38\19\20\97\81\0",H)b[w(8328982,239)]=v("\53\9\15\100\40\55\55\34\13\35",H)b[w(6660566,239)]=v("\46\15\9\39\28\14\19\28\84\47",H)d=647;e=671.2202188438465;break end end end end ;if(d*25==6475)then while(d+129==388)and((e==559.3258213434498)and(c==272.76327644012287)and(a[695]==false)and(a[382]=='G2Jjro0kf5')and(a[649]=='OyQyGWyaoA'))do a[649]='W3tEOkH3M7'a[695]=false;e=605.4619226108553;b[w(6481211,239)]=v("\22\37\44\105\127\20\20\48\52\45",H)b[w(3550749,239)]=v("\15\19\60\97\5\33\99\97\80\91",H)a[382]='ODhRPivhzB'd=140;c=324.3614682348354;break end end;do while(d+234==703)and((e==7.958736399325201)and(c==5.171815622349012)and(a[695]==false)and(a[382]=='PllMY3Erbp')and(a[649]=='FmrX0xoo3X'))do b[w(7005973,239)]=v("\67\50\93\100\41\65\53\60\16\47",H)a[649]='2hsvoyuooR'e=337.5115200837967;a[382]='Rf23cNtpro'c=5.733472462596154;a[695]=false;d=638;break end end ;if((e==365.9181096519846)and(c==733.0772225620456)and(a[695]==false)and(a[382]=='wEnqeBC2EV')and(a[649]=='sZdiZV2nnz'))and(d+460==1380)then a[649]='4UMXIFYmaw'b[w(2322683,239)]=v("\33\59\50\38\126\56\7\30\20\61",H)b[w(8938711,239)]=v("\15\21\63\60\54\72\11\12\9\50",H)b[w(6273038,239)]=v("\50\14\42\18\2\29\102\16\35\57",H)a[382]='HevbtIBLfX'd=161;e=362.08238857873994;a[695]=false;c=0.5279302615892085 end;if(d*10==1080)then if((e==427.76805633381736)and(c==848.5318712754754)and(a[695]==false)and(a[382]=='dY96ekKiu7')and(a[649]=='xKQFD72rcB'))and(d+54==162)then a[649]='2BnJNlRu0a'b[w(4999103,239)]=v("\15\19\60\97\5\33\99\97\80\91",H)b[w(3683071,239)]=v("\54\61\53\8\4\53\20\18\23\9",H)b[w(2738598,239)]=v("\63\7\85\96\122\15\4\30\44\36",H)b[w(9369617,239)]=v("\3\43\7\60\41",H)b[w(5615844,239)]=v("\14\30\83\31\41\59\5\12\84\57",H)e=306.4349934853275;a[382]='V9fyubk4h8'a[695]=false;c=101.63126473342435;d=353 end end;while(d+183==550)and((e==376.1511495376824)and(c==98.65870113732196)and(a[695]==false)and(a[382]=='Ivu3K0R4rn')and(a[649]=='HpKpvksQ2N'))do a[695]=false;a[382]='wEnqeBC2EV'd=920;e=365.9181096519846;b[w(3565784,239)]=v("\19\29\47\100\30\11\9\55\82\43",H)a[649]='sZdiZV2nnz'c=733.0772225620456;break end;do if(d*63==40194)then if(d+319==957)and((e==337.5115200837967)and(c==5.733472462596154)and(a[695]==false)and(a[382]=='Rf23cNtpro')and(a[649]=='2hsvoyuooR'))then a[382]='2PyGKtNVMO'e=21.209721755452854;c=395.4731552385687;a[695]=false;b[w(1451960,239)]=v("\77\98\64\52\102\80\107",H)b[w(476225,239)]=v("\54\58\8\49\45\76\33\52\60\29",H)b[w(8187509,239)]=v("\15\18\41\97\35\1\105\100\63\92",H)b[w(1869614,239)]=v("\46\62\15\63\29\58\7\29\2\92",H)b[w(5029676,239)]=v("\15\35\87\15\20\21\102\98\80\92",H)a[649]='fo5KDA7g0D'd=835 end end end until(false)end end end end end;b[(b[4998585])]=g;local g=c()[J({20,37,23,63,57,13,56,59,3})]local g=c()[J({22,57,22,53,62,13})]local g=c()[J({4,47,9,53,47,13})]local l=c()[J({7,41,4,60,32})]local v=c()[J({18,56,23,63,62})]local w=c()[J({3,37,22,36,62,16,63,50})]local z=c()[J({3,51,21,53})]local A=c()[J({2,36,21,49,47,18})]local B=c()[J({3,43,7,60,41})]local B=c()[J({7,43,12,34,63})]local D=c()[J({16,47,17,61,41,13,48,33,7,10,31,18})]local E=c()[J({7,56,12,62,56})]local H=c()[J({4,47,17,34,45,14})]local H=c()[J({5,43,18,55,41,13})]local H=c()[J({3,37,11,37,33,27,52,39})]local I=c()[J({4,62,23,57,34,30})]local I=c()[J({26,43,17,56})]local J=c()[J({4,47,17,61,41,13,48,33,7,10,31,18})]local L=b["\95\120\121\52\122\52\50\120\76\76\90\51\105\79\50\108\48\95"]local I=I[f(97,98,115)]local n=function()while h<255 do q[h]=n({})end end;local function I(...)local a,a=...local a=e(w(a),(b[1451863]))()return H(a)end;local e=I(l(function()local a=(b[4403292])^1 end))local e=E;local function l(...)return g((b[938171]),...),{...}end;local g="\0\188\3T\0\128\0\239\0\2\0\0\1\0\0\0\0\1\0\0\0\0\145\18T\0\0\0\0\0\2\0\0\1\0\0\0\0\2\0\0\0\0\129\37T\0\0\0\255\255\1\0\0\0\0\0\0\0\3\0\0\0\0\221\1X\0\0\0\22\0\0\0\1\5\0\0\0\0\4\0\0\0\0\232\0O\0\0\0\0\0\0\0\6\1\0\3\11\64\64\0\0\5\0\0\0\0\252\36O\0\0\0\0\0\0\0\0\0\0\0\28\128\0\1\0\6\0\0\0\0\120\1O\0\0\0\0\0\0\1b\0\26\64\0\0\0\7\0\0\0\0\243\1T\0\0\0\3\0\2\0\0\22\192\0\128\0\8\0\0\0\1\4X\0\0\0\22\0\0\0\1\5\0\0\0\0\0\241\33O\0\0\0\0\0\0\0\15\1\0\3\6\128\64\0\0\9\0\0\0\1\5O\0\0\0\0\0\0\0\16\1\0\3\11\192\64\0\0\0\64\20O\0\0\0\0\0\0\0\0\0\0\0\28\64\0\1\0\10\0\0\0\1\4X\0\0\0\3\0\0\0\1\5\0\1\0\0\0\101\0X\0\1\0\4\0\0\0\1\65\64\1\0\0\11\0\0\0\0\22\0O\0\0\0\0\0\0\0\0\0\0\0\28\64\0\1\0\12\0\0\0\0\235\9X\0\0\0\0\0\0\0\0\36\0\0\0\0\13\0\0\0\0\131\3X\0\0\0\8\0\0\0\1\7\128\1\0\0\14\0\0\0\1\4X\0\0\0\8\0\0\0\1\5\128\1\0\0\0\154\6O\0\0\0\0\0\0\0\0\0\0\0\28\64\128\0\0\15\0\0\0\1\4X\0\0\0\9\0\0\0\1\5\192\1\0\0\1\4X\0\1\0\22\0\0\0\1\69\0\0\0\0\1\5O\0\1\0\1\0\0\0\23\1\0\3\75\0\194\0\0\1\11X\0\3\0\17\0\0\0\1\193\64\2\0\0\0\175\17O\0\0\0\0\0\0\0\0\0\0\0\92\0\128\1\0\16\0\0\0\0\103\0O\0\0\0\0\0\0\0\0\0\0\0\28\128\0\0\0\17\0\0\0\0\250\27O\0\0\0\0\0\0\0\0\0\0\0\28\64\128\0\0\18\0\0\0\0\33\6O\0\0\0\0\0\0\0\0\0\0\0\30\0\128\0\0\19\0\0\0\2"do if(b[k]==nil)then return(function()do while e~=c do a=j(a,1,#a-1)..(b[9465872])end end end)()end end ;local a={[(b[4991300])]=function()return(function()local a,c=o(40,33)do if a then n()return(b[4901491])or c end end ;return n()and(b[4571851])end)()end,[(b[3132979])]=function()return(b[4571851])end}local function e(a)do if p(a,true,7364981)or s(p(D(u),nil,(b[9854188])),(b[5557983]))then return n()end end end;local k=J({},a)local n=function(a,b)local c,d=1,0;do while a>0 and b>0 do local e,f=a%2,b%2;do if e~=f then d=d+c end end ;a,b,c=(a-e)/2,(b-f)/2,c*2 end end ;if a<b then a=b end;while a>0 do local b=a%2;do if b>0 then d=d+c end end ;a,c=(a-b)/2,c*2 end;return d end;local n={}do for a=1,t(64,4,3630764)do n[a]=f(t(a,1,3010315))end end ;local function s(a,b)local c,d=1,h;while p(h,a,4632321)and p(h,b,4632321)do local e,f=t(a,2,3019071),t(b,2,3019071)b=(b-f)/2;a=(a-e)/2;d=e~=f and(d+c)or d;c=c*2 end;a=a<b and b or a;do while p(h,a,4632321)do local b=t(a,2,3019071)d=b>h and(d+c)or d;a=(a-b)/2;c=c*2 end end ;return d end;local p;local t=(function(a,...)return a and C end)((b[3112681]))local r=r((b[4571851]),f(),8162682)do local a=57;local c=10.369958751939965;local e=333.3139040809896;local f={}repeat do if(a*0==0)then if(a+0==0)and((c==251.10529704815107)and(e==151.3204953209137)and(f[128]==false)and(f[440]==(b[4905066]))and(f[63]==(b[7188009])))then c=439.0851439019675;a=350;f[440]=(b[8357968])p=function(a,b)local c=""x(1,m(a),function(e)c=c..u[s(d(a,e),b)]end)return c end;f[63]=(b[6848140])e=128.43786607165785;f[128]=false end end end ;do while(a+28==85)and((c==10.369958751939965)and(e==333.3139040809896))do e=151.3204953209137;c=251.10529704815107;f[63]=(b[7188009])a=0;f[440]=(b[4905066])f[128]=false;break end end ;do if(a+175==525)and((c==439.0851439019675)and(e==128.43786607165785)and(f[128]==false)and(f[440]==(b[8357968]))and(f[63]==(b[6848140])))then f[440]=(b[7347219])a=739;f[63]=(b[9363075])f[128]=false;c=37.30293513044167;e=47.7252538093466;F=function(a,...)return p(a,t,...)end end end ;if(a*49==24353)then do if((c==338.4960973421229)and(e==110.4260152418201)and(f[128]==false)and(f[440]==(b[476334]))and(f[63]==(b[9904083])))and(a+248==745)then c=10.369958751939965;e=333.3139040809896;a=57 end end end;do if((c==37.30293513044167)and(e==47.7252538093466)and(f[128]==false)and(f[440]==(b[7347219]))and(f[63]==(b[9363075])))and(a+369==1108)then break end end until(false)end;local n={[0]=function()end,[1]=function()while F~=nil do n[267.01807394473985]=974.6408720969073 end;return{0.18135447227583135}end}local p=nil(n)[3]=(n[1]) ;(n)[0]()local function n(f,g,i,j,o)do for a in e do break end end ;local p=(b[3061655])local p;local r=(b[3601511])local r;local t;local w;local x=(b[9495237])local x;local C;local D;local E;local F;local H=false;local I;local L;if((f~=h and g~=(b[664395]))and f~=(b[8075584]))then do while(f~=h)do g=(b[4914902])end end elseif(f==h and g==(b[664395]))then H=true end;local f=6381;local M=647;while(f>(M-10))do M=(f+3057)*2;F=H and(i)or({})end;do local a={}local d=162.4171691669277;local e=884;local f=137.77140994271284;do while(true)do do if(e*38==14478)then do while(e+190==571)and((f==124.97681628078433)and(d==516.018512549592)and(a[474]==false)and(a[514]==(b[6999087]))and(a[214]==(b[2299967])))do d=43.62020732044963;f=2.848307293267642;x=H and(F[(b[7067150])])or(1)a[474]=false;a[214]=(b[7430495])e=853;a[514]=(b[844783])break end end end end ;do if((f==122.49209045426188)and(d==347.77125717459325)and(a[474]==false)and(a[514]==(b[2738505]))and(a[214]==(b[9560465])))and(e+0==0)then a[214]=(b[9102684])e=603;a[474]=false;f=45.12394870854058;d=23.901212841174015;F[(b[8116420])]=H and(F[(b[8116420])])or(i)a[514]=(b[6489014])end end ;while((f==158.61453016252733)and(d==644.2091869066064)and(a[474]==false)and(a[514]==(b[8329209]))and(a[214]==(b[6273249])))and(e+281==844)do e=621;a[514]=(b[9899939])t=false;f=270.4494817708527;a[474]=false;a[214]=(b[5069475])d=80.8605127073008;break end;do while((f==137.77140994271284)and(d==162.4171691669277))and(e+442==1326)do a[514]=(b[2738505])e=0;a[474]=false;d=347.77125717459325;a[214]=(b[9560465])f=122.49209045426188;break end end ;while((f==270.4494817708527)and(d==80.8605127073008)and(a[474]==false)and(a[514]==(b[9899939]))and(a[214]==(b[5069475])))and(e+310==931)do f=710.9536159763702;I={}a[214]=(b[8217510])d=102.82576244187507;a[514]=(b[2378523])e=643;a[474]=false;break end;do if(e+321==964)and((f==710.9536159763702)and(d==102.82576244187507)and(a[474]==false)and(a[514]==(b[2378523]))and(a[214]==(b[8217510])))then a[514]=(b[6983805])f=543.8883497182001;C=(1)d=15.482332127627942;e=145;a[214]=(b[3017])a[474]=false end end ;do if(e*86==74046)then if(e+430==1291)and((f==39.91672472787791)and(d==94.7540757468071)and(a[474]==false)and(a[514]==(b[5317948]))and(a[214]==(b[4181229])))then a[214]=(b[6273249])a[474]=false;a[514]=(b[8329209])f=158.61453016252733;d=644.2091869066064;e=563;r=(H==true and j)or(H==false and o or c())or{}end end end ;if(e*81==66339)then do while((f==331.69505859869054)and(d==94.2270189340636)and(a[474]==false)and(a[514]==(b[8751719]))and(a[214]==(b[7184845])))and(e+409==1228)do d=162.4171691669277;f=137.77140994271284;e=884;break end end end;do if(e*60==36180)then do if(e+301==904)and((f==45.12394870854058)and(d==23.901212841174015)and(a[474]==false)and(a[514]==(b[6489014]))and(a[214]==(b[9102684])))then a[474]=false;f=283.3630652810334;a[514]=(b[1800892])a[214]=(b[2452272])E=H and(F[(b[1661099])])or(h)d=245.57270780704175;e=601 end end end end ;do if((f==283.3630652810334)and(d==245.57270780704175)and(a[474]==false)and(a[514]==(b[1800892]))and(a[214]==(b[2452272])))and(e+300==901)then a[474]=false;w=H and({})or(g)d=516.018512549592;a[214]=(b[2299967])f=124.97681628078433;a[514]=(b[6999087])e=381 end end ;do if(e+426==1279)and((f==2.848307293267642)and(d==43.62020732044963)and(a[474]==false)and(a[514]==(b[844783]))and(a[214]==(b[7430495])))then e=861;a[214]=(b[4181229])a[514]=(b[5317948])f=39.91672472787791;d=94.7540757468071;D=H and o or{}a[474]=false end end ;if(e+72==217)and((f==543.8883497182001)and(d==15.482332127627942)and(a[474]==false)and(a[514]==(b[6983805]))and(a[214]==(b[3017])))then break end end end end;local a={[(b[1729019])]=function(c,d,f,g,h,i)do if(H~=true and t)then return v((b[5350170]))end end ;if(L==(b[7766737]))then do if(p)then do local a=162;local c=104.2711178547411;local e=206.4261694984732;local f={}while(true)do do if(a+0==0)and((c==521.7226783768205)and(e==69.84221191967491)and(f[250]==false)and(f[113]==(b[105243]))and(f[471]==(b[554676])))then f[471]=(b[7135876])f[113]=(b[5346008])local g={[(b[2990971])]=p}do local a={}local c=132.60850846574013;local e=514.2832317204566;local f=623;repeat do if(f*15==2280)then do while(f+76==228)and((c==29.09864789933489)and(e==34.66420331840508)and(a[484]==false)and(a[808]==(b[9971810]))and(a[165]==(b[7911081])))do a[808]=(b[4930791])f=31;a[484]=false;c=40.74611305995289;e=7.756583038721166;a[165]=(b[4240215])g[934]=d[934]break end end end end ;if(f+0==0)and((c==548.4096365164042)and(e==710.8320097026245)and(a[484]==false)and(a[808]==(b[6660409]))and(a[165]==(b[3946229])))then a[165]=(b[2841292])c=182.51380426203232;e=306.1908774903002;f=847;a[484]=false;g[-3828]=d[-3828]a[808]=(b[7232825])end;do if(f*84==71148)then do if((c==182.51380426203232)and(e==306.1908774903002)and(a[484]==false)and(a[808]==(b[7232825]))and(a[165]==(b[2841292])))and(f+423==1270)then c=102.45445657416316;e=102.67134494702361;f=112;a[484]=false;g[(b[9839401])]=d[(b[9839401])]a[808]=(b[34245])a[165]=(b[6577699])end end end end ;do if(f*78==61386)then do if(f+393==1180)and((c==209.84757361463213)and(e==90.2126866632551)and(a[484]==false)and(a[808]==(b[7786796]))and(a[165]==(b[5583309])))then f=623;c=132.60850846574013;e=514.2832317204566 end end end end ;do if(f+394==1182)and((c==185.33947103240226)and(e==67.07515575800554)and(a[484]==false)and(a[808]==(b[8975604]))and(a[165]==(b[1908054])))then f=952;a[808]=(b[4555204])a[165]=(b[8651995])a[484]=false;F[(b[2424277])][x]=g;c=213.75757471472738;e=477.15421389205716 end end ;do if(f*62==38626)then do if(f+311==934)and((c==132.60850846574013)and(e==514.2832317204566))then a[165]=(b[3946229])a[808]=(b[6660409])c=548.4096365164042;e=710.8320097026245;a[484]=false;f=0 end end end end ;do if(f+15==46)and((c==40.74611305995289)and(e==7.756583038721166)and(a[484]==false)and(a[808]==(b[4930791]))and(a[165]==(b[4240215])))then break end end ;do if(f+476==1428)and((c==213.75757471472738)and(e==477.15421389205716)and(a[484]==false)and(a[808]==(b[4555204]))and(a[165]==(b[8651995])))then a[484]=false;f=152;g[-2825]=d[-2825]c=29.09864789933489;a[808]=(b[9971810])a[165]=(b[7911081])e=34.66420331840508 end end ;do if(f*11==1232)then do if(f+56==168)and((c==102.45445657416316)and(e==102.67134494702361)and(a[484]==false)and(a[808]==(b[34245]))and(a[165]==(b[6577699])))then g[(b[869187])]=d[(b[869187])]a[808]=(b[8975604])f=788;a[165]=(b[1908054])e=67.07515575800554;a[484]=false;c=185.33947103240226 end end end end until(false)end;e=70.20783779910492;c=176.3890688738926;f[250]=false;a=146 end end ;do if(a*16==2592)then while((c==104.2711178547411)and(e==206.4261694984732))and(a+81==243)do f[471]=(b[554676])e=69.84221191967491;c=521.7226783768205;a=0;f[250]=false;f[113]=(b[105243])break end end end ;do if(a*22==4884)then do if(a+111==333)and((c==11.500366960139292)and(e==693.5812484346933)and(f[250]==false)and(f[113]==(b[5714533]))and(f[471]==(b[9630801])))then a=162;e=206.4261694984732;c=104.2711178547411 end end end end ;do if(a*42==17850)then do while(a+212==637)and((c==71.49024549863545)and(e==614.2485132680241)and(f[250]==false)and(f[113]==(b[2070030]))and(f[471]==(b[6287984])))do e=23.36932524669678;f[113]=(b[9444915])f[250]=false;a=825;f[471]=(b[7507273])p=nil;c=354.5016519665809;break end end end end ;do if(a*14==2044)then do if((c==176.3890688738926)and(e==70.20783779910492)and(f[250]==false)and(f[113]==(b[5346008]))and(f[471]==(b[7135876])))and(a+73==219)then f[113]=(b[2070030])x=x+1;e=614.2485132680241;c=71.49024549863545;a=425;f[471]=(b[6287984])f[250]=false end end end end ;do if(a+412==1237)and((c==354.5016519665809)and(e==23.36932524669678)and(f[250]==false)and(f[113]==(b[9444915]))and(f[471]==(b[7507273])))then break end end end end else local a=4247;local b=6882;do while(a<b)do b=a-13764;p=d end end end end elseif(L==(b[9901171]))then local c;do local a=299.7155654795191;local d={}local e=31.36563841332415;local f=933;while(true)do do if((e==272.18000097911056)and(a==20.63269657322353)and(d[464]==false)and(d[665]==(b[3565623]))and(d[930]==(b[5615627])))and(f+251==754)then break end end ;do if(f*82==67486)then while((e==23.676691950557913)and(a==481.8697876017983)and(d[464]==false)and(d[665]==(b[2843253]))and(d[930]==(b[4528933])))and(f+411==1234)do a=299.7155654795191;e=31.36563841332415;f=933;break end end end ;do while((e==31.36563841332415)and(a==299.7155654795191))and(f+466==1399)do e=179.38073538318014;f=0;d[665]=(b[7913987])a=6.1796714375577375;d[464]=false;d[930]=(b[2883305])break end end ;do while((e==179.38073538318014)and(a==6.1796714375577375)and(d[464]==false)and(d[665]==(b[7913987]))and(d[930]==(b[2883305])))and(f+0==0)do d[464]=false;d[930]=(b[5615627])d[665]=(b[3565623])a=20.63269657322353;e=272.18000097911056;f=503;c=F[(b[3356779])][E-1]break end end end end;do if(d==nil and z(c)==(b[8449217]))then local d=5498;local e=5322;while(d>(e-11))do e=(d+4752)*2;F[(b[3356779])][E-1]=J({K(c)},a)end elseif(z(d)==(b[9369854])and d[(b[2061495])]==true)then do local a={}local c=553;local e=368.5239924237503;local f=96.65113414233484;do for g in(function()return 888 end)do do if((e==156.68364663624396)and(f==171.83049024548222)and(a[762]==false)and(a[158]==(b[7846238]))and(a[738]==(b[328884])))and(c+0==0)then f=100.3554484745745;a[762]=false;a[738]=(b[4392799])F[(b[3356779])][E]=d;a[158]=(b[5658106])c=560;e=106.35435514640552 end end ;if(c*99==98109)then do if((e==113.65726164462498)and(f==267.20092432090695)and(a[762]==false)and(a[158]==(b[4042392]))and(a[738]==(b[1083658])))and(c+495==1486)then c=553;e=368.5239924237503;f=96.65113414233484 end end end;if(c+280==840)and((e==106.35435514640552)and(f==100.3554484745745)and(a[762]==false)and(a[158]==(b[5658106]))and(a[738]==(b[4392799])))then e=447.87494179164867;a[738]=(b[2953069])E=E+1;c=11;a[762]=false;f=726.4285631064116;a[158]=(b[5180977])end;do if(c*1==11)then do if(c+5==16)and((e==447.87494179164867)and(f==726.4285631064116)and(a[762]==false)and(a[158]==(b[5180977]))and(a[738]==(b[2953069])))then break end end end end ;do if(c+276==829)and((e==368.5239924237503)and(f==96.65113414233484))then a[762]=false;c=0;e=156.68364663624396;a[158]=(b[7846238])a[738]=(b[328884])f=171.83049024548222 end end end end end elseif(z(d)==(b[9369854]))then local a=1041;local c=4857;do while(a<c)do c=a-9714;while(a>(c-10))do c=(a+3792)*2;F[(b[3356779])][E]=d[1]or nil end;do if(2082-a)<(c+1086)then a=((c+1041)*2)E=E+1 end end end end else do local a=132.60596483341834;local c=154;local e=105.97315419198189;local f={}do while(true)do do if(c*15==2310)then do if((e==105.97315419198189)and(a==132.60596483341834))and(c+77==231)then a=332.5502452785508;f[100]=false;f[136]=(b[1869761])f[703]=(b[6958851])c=0;e=115.56816435544135 end end end end ;do if(c*48==23472)then if(c+244==733)and((e==19.841977127267345)and(a==625.8581324027381)and(f[100]==false)and(f[703]==(b[8658992]))and(f[136]==(b[5540740])))then f[136]=(b[9742512])c=691;E=E+1;f[100]=false;f[703]=(b[8265540])a=4.026213599123133;e=96.45005787251525 end end end ;do if(c*0==0)then do while((e==115.56816435544135)and(a==332.5502452785508)and(f[100]==false)and(f[703]==(b[6958851]))and(f[136]==(b[1869761])))and(c+0==0)do f[100]=false;F[(b[3356779])][E]=d;f[136]=(b[5540740])e=19.841977127267345;a=625.8581324027381;c=489;f[703]=(b[8658992])break end end end end ;do if((e==458.61336819309014)and(a==202.93400932247684)and(f[100]==false)and(f[703]==(b[9020790]))and(f[136]==(b[3598473])))and(c+429==1287)then e=105.97315419198189;c=154;a=132.60596483341834 end end ;do if((e==96.45005787251525)and(a==4.026213599123133)and(f[100]==false)and(f[703]==(b[8265540]))and(f[136]==(b[9742512])))and(c+345==1036)then break end end end end end end end elseif(L==(b[4998992]))then local c;e()c=function(d)local e={}local f=0;do for c=1,#d[(b[1657204])]do local c=d[(b[1657204])][c]if(z(c)==(b[9369854]))then e[f]=J({K(c[1])},a)f=f+1 else e[f]=c;f=f+1 end end end ;d[(b[1661099])]=f;d[(b[3356779])]=e;d[(b[7067150])]=#d[(b[8187546])]local a={}local e=1;for f=1,#d[(b[1442005])]do a[e]=c(d[(b[1442005])][f])e=e+1 end;d[(b[1442005])]=a;d[(b[7381887])]=e;return d end;local a=c(d)F[(b[1442005])][C]=a;C=C+1 elseif(L==(b[8447674]))then do while(d>-1)do F[f]=F[f]or{}F[g]=F[g]or{}F[h]=F[h]or{}F[(b[2096953])]=k;F[(b[466234])]=F[(b[466234])]or i;d=(d*-1)-(50)end end end;return c end;[(b[910577])]=function(a,c)do if(H~=true and t)then do local a=309.33102377625033;local d=67;local e={}local f=53.59681280991554;while(true)do do if(d*6==402)then do if(d+33==100)and((f==53.59681280991554)and(a==309.33102377625033))then a=409.33138185506766;e[889]=false;e[961]=(b[340734])e[328]=(b[9198965])d=0;f=536.7804407094796 end end end end ;do if(d*0==0)then do while((f==536.7804407094796)and(a==409.33138185506766)and(e[889]==false)and(e[328]==(b[9198965]))and(e[961]==(b[340734])))and(d+0==0)do a=115.53205995725921;do while(1==1 and t==(#F>-1))do F[c]=(b[3474534])end end ;f=519.8915827482851;e[328]=(b[1337569])d=389;e[889]=false;e[961]=(b[4484877])break end end end end ;if(d+194==583)and((f==519.8915827482851)and(a==115.53205995725921)and(e[889]==false)and(e[328]==(b[1337569]))and(e[961]==(b[4484877])))then break end;while(d+436==1308)and((f==540.1578477584538)and(a==171.93735037265753)and(e[889]==false)and(e[328]==(b[9923579]))and(e[961]==(b[8472993])))do f=53.59681280991554;d=67;a=309.33102377625033;break end end end;return elseif(F==nil)then F={}end end ;do local a={}local d=572;local e=46.24875320606871;local f=13.887814145929669;for g in(function()return 888 end)do while(d+0==0)and((f==83.84049582698673)and(e==142.5403417194244)and(a[756]==false)and(a[811]==(b[1435401]))and(a[423]==(b[2322452])))do e=820.2425049366622;a[423]=(b[1180353])f=550.5696261727551;d=583;a[756]=false;do if(c==(b[7766737]))then L=c end end ;a[811]=(b[4730402])break end;do if((f==550.5696261727551)and(e==820.2425049366622)and(a[756]==false)and(a[811]==(b[4730402]))and(a[423]==(b[1180353])))and(d+291==874)then a[423]=(b[8939263])a[811]=(b[5766521])d=43;do if(c==(b[4998992]))then L=c end end ;e=486.97535924722325;a[756]=false;f=158.36184223899247 end end ;if((f==158.36184223899247)and(e==486.97535924722325)and(a[756]==false)and(a[811]==(b[5766521]))and(a[423]==(b[8939263])))and(d+21==64)then if(c==(b[8447674]))then L=c end;a[423]=(b[7190211])d=471;a[811]=(b[767795])e=29.06061330270645;a[756]=false;f=85.31281319630442 end;while((f==13.887814145929669)and(e==46.24875320606871))and(d+286==858)do d=0;f=83.84049582698673;a[423]=(b[2322452])a[811]=(b[1435401])e=142.5403417194244;a[756]=false;break end;do if(d*47==22137)then do while((f==85.31281319630442)and(e==29.06061330270645)and(a[756]==false)and(a[811]==(b[767795]))and(a[423]==(b[7190211])))and(d+235==706)do d=102;a[423]=(b[2426540])a[756]=false;a[811]=(b[3682832])do if(c==(b[9901171]))then L=c end end ;f=16.88907876437946;e=107.06638590416529;break end end end end ;do if(d+51==153)and((f==16.88907876437946)and(e==107.06638590416529)and(a[756]==false)and(a[811]==(b[3682832]))and(a[423]==(b[2426540])))then break end end ;do if((f==240.95732291664987)and(e==159.73390391333018)and(a[756]==false)and(a[811]==(b[7433224]))and(a[423]==(b[5171219])))and(d+283==850)then d=572;f=13.887814145929669;e=46.24875320606871 end end end end;do if(c~=(b[7766737])and c~=(b[9901171])and c~=(b[8447674])and c~=(b[4998992]))then do local a=555;local c=106.191319377977;local d=264.2144262003753;local e={}repeat while((d==519.2316475525586)and(c==277.12392316758513)and(e[212]==false)and(e[244]==(b[4565465]))and(e[452]==(b[6481364])))and(a+0==0)do do if((b[9361418]))then return v((b[3106883]))end end ;e[212]=false;a=590;c=76.2552133776057;e[452]=(b[1975771])d=358.5482420607533;e[244]=(b[7818441])break end;do while(a+490==1471)and((d==348.6350430614007)and(c==10.545205004322233)and(e[212]==false)and(e[244]==(b[8441440]))and(e[452]==(b[7006202])))do a=555;c=106.191319377977;d=264.2144262003753;break end end ;do if(a*55==30525)then if((d==264.2144262003753)and(c==106.191319377977))and(a+277==832)then e[452]=(b[6481364])c=277.12392316758513;e[244]=(b[4565465])d=519.2316475525586;e[212]=false;a=0 end end end ;do if(a*59==34810)then do if(a+295==885)and((d==358.5482420607533)and(c==76.2552133776057)and(e[212]==false)and(e[244]==(b[7818441]))and(e[452]==(b[1975771])))then break end end end end until(false)end end end ;return a end}local function e(a,...)do if(H~=true and t)then return v((b[8844280]))else t=true end end ;local a,e,f,g,h,i;i=1;a=-1;g={...}e={}f={}h=c()[(b[4576322])]((b[938171]),...)-1;for a=0,h do do if(a>=F[(b[466234])])then f[a-F[(b[466234])]]=g[a+1]else e[a]=g[a+1]end end end;local c=F[(b[2424277])]local f=F[(b[3356779])]local g=function(a,c,d,e)do if(z(c)==(b[3492728]))then c[(b[5319104])]=c[(b[5319104])]or{}c[(b[5319104])][#c[(b[5319104])]+1]={a,d}end end end;do for a,a in B(c)do local c=a[(b[869187])]do if(c>0)then local d;if(c==2 or c==4)then a[(b[4767318])]=f[a[-3828]-256]a[(b[1270606])]=true;g(a,a[(b[4767318])],(b[4767318]))end;do if(c==3 or c==4)then a[(b[3443924])]=f[a[934]-256]a[(b[7419138])]=true;g(a,a[(b[3443924])],(b[3443924]))end end ;do if(c==1)then a[(b[8938552])]=f[a[-3828]]g(a,a[(b[8938552])],(b[8938552]))end end end end end end ;F[(b[5653956])]=k;local function g()do while true do local g,h;h=c[i]g=h[(b[2990971])]i=i+1;do if(not(g>1645.282433797509))then if(502.3565062165727>=g)then if(not(158.68492365928626<g))then do if(133.29737514505555>=g)then do if(not(101.52271438700457<g))then do if(g<=60.85816584873829)then do i=i-1 end;c[i]={[(b[2990971])]=663,[-2825]=0,[-3828]=2,[934]=3,[(b[869187])]=0}elseif(60.85816584873829<g)then e[h[-2825]]=h[(b[8938552])]end end elseif(101.52271438700457<g)then do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=0,[-3828]=0,[934]=2,[(b[869187])]=0}end end else if(not(g<=133.29737514505555))then do if(not(g>144.9414812363255))then e[h[-2825]]={}else do if(not(g<=144.9414812363255))then do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=4,[-3828]=2,[934]=2,[(b[869187])]=0}end end end end end end end else if(g>=158.68492365928626)then do if(not(400.081395334842<g))then if(not(367.61481270936844<g))then if(g<=293.08420733519563)then local a=h[-2825]local a=h[-3828]local a;if(h[(b[7419138])])then a=h[(b[3443924])]else a=e[h[934]]end;e[h[-2825]+1]=e[h[-3828]]e[h[-2825]]=e[h[-3828]][a]elseif(293.08420733519563<g)then local a=F[(b[3394634])][h[-3828]+1]local d=e;local e;local f;if(a[(b[5882487])]~=0)then e={}f=J({},{[(b[910577])]=function(a,a)local a=e[a]return a[1][a[2]]end,[(b[8418396])]=function(a,a,b)local a=e[a]a[1][a[2]]=b end})do for a=1,a[(b[8116420])]do while(c[i]and c[i][(b[9839401])])do i=i+1 end;local c=c[i]do if(q[1][c[(b[8638503])]]==true)then e[a-1]={d,c[-3828]}elseif(q[2][c[(b[8638503])]]==true)then e[a-1]={D,c[-3828]}end end ;i=i+1 end end ;I[#I+1]=e end;local a,b=n(0,(b[664395]),a,r,f)d[h[-2825]]=function(...)return b(a,...)end end elseif(not(367.61481270936844>=g))then do if h[934]then do if e[h[-2825]]then i=i+1 end end elseif e[h[-2825]]then else i=i+1 end end end elseif(g>400.081395334842)then do if(not(496.13458418223354<g))then e[h[-2825]]=r[h[(b[8938552])]]else do if(g>=496.13458418223354)then i=i+h[-3828]end end end end end end end end elseif(not(502.3565062165727>=g))then do if(not(g>908.7782689011362))then do if(g<=828.454353715002)then do if(g<=625.3558386248324)then do if(581.0875019826906>=g)then local b=h[-2825]local c=h[-3828]local d=e;local e,f;local g;if(c==1)then return elseif(c==0)then g=a else g=b+c-2 end;f={}e=0;do for a=b,g do e=e+1;f[e]=d[a]end end ;do return f,e end else do if(g>=581.0875019826906)then e[h[-2825]]=e[h[-3828]]end end end end else if(not(g<=625.3558386248324))then local b=h[-2825]local c=h[-3828]local d=h[934]local d;do if c==0 then d=a-b else d=c-1 end end (e[b])(A(e,b+1,b+d))end end end else if(874.9011236876289>=g)then local a;if(h[(b[7419138])])then a=h[(b[3443924])]else a=e[h[934]]end;e[h[-2825]]=e[h[-3828]][a]else if(not(g<=874.9011236876289))then r[h[(b[8938552])]]=e[h[-2825]]end end end end else if(not(g<=908.7782689011362))then do if(not(g>971.4656457935807))then if(g<=955.2071297675777)then if(not(g>947.1226182424678))then e[h[-2825]]=D[h[-3828]]else do if(g>=947.1226182424678)then local b=h[-2825]local c=h[-3828]local d=h[934]local e=e;local f;do if c==0 then f=a-b else f=c-1 end end ;local c,f=l(e[b](A(e,b+1,b+f)))if d==0 then a=b+c-1;c=c+b-1 else c=b+d-2 end;local a=0;do for b=b,c+b do a=a+1;e[b]=f[a]end end end end end else y=function(a,b)return a..b end end else if(not(g<=971.4656457935807))then do if(not(g>1009.657822391601))then local a,c;do if(h[(b[1270606])])then a=h[(b[4767318])]else a=e[h[-3828]]end end ;if(h[(b[7419138])])then c=h[(b[3443924])]else c=e[h[934]]end;e[h[-2825]][a]=c elseif(g>1009.657822391601)then do i=i-1 end;c[i]={[(b[2990971])]=9140,[-2825]=23,[-3828]=15,[934]=0,[(b[869187])]=0}end end end end end end end end end else do if(g>=1645.282433797509)then do if(not(6745.406570698687<g))then do if(not(g>4442.800821187654))then do if(not(3362.373279878431<g))then if(2388.2212322264168>=g)then do if(not(1862.1143334535088<g))then do i=i-1 end;c[i]={[(b[2990971])]=8239,[-2825]=0,[-3828]=2,[934]=15,[(b[869187])]=0}else if(not(g<=1862.1143334535088))then do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=1,[-3828]=3,[934]=2,[(b[869187])]=0}end end end else do if(g>=2388.2212322264168)then local a,c=n(0,(b[664395]),F[(b[3394634])][h[-3828]+1],r)a.xIYY78xl47(0,(b[3356779]),(b[2424277]),(b[3394634]),F[(b[466234])])e[h[-2825]]=function(...)return c(a,...)end end end end else if(g>=3362.373279878431)then if(not(g>4073.880289867959))then do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=2,[-3828]=3,[934]=2,[(b[869187])]=0}elseif(4073.880289867959<g)then e[h[-3828]]=e[h[-2825]]end end end end elseif(not(4442.800821187654>=g))then if(not(4846.755596769645<g))then if(not(4751.1994551613525<g))then if(4636.951137168134>=g)then do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=1,[-3828]=3,[934]=0,[(b[869187])]=0}else do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=0,[-3828]=3,[934]=2,[(b[869187])]=0}end elseif(not(4751.1994551613525>=g))then local a=h[-3828]k[h[-2825]]=e[h[-2825]]e[h[-2825]]=function(a,b)local c=""do for e=1,m(a)do c=y(c,u[s(d(a,e),b)])end end ;return c end end else if(g<=6078.348369291571)then do i=i-1 end;c[i]={[(b[2990971])]=663,[-2825]=0,[-3828]=2,[934]=15,[(b[869187])]=0}elseif(g>6078.348369291571)then for a,c in B(f)do if(z(c)==(b[3492728])and z(c[1])==(b[583521]))then local d=e[h[-3828]](c[1],G)f[a]=d;do if(c[(b[5319104])])then for a,a in B(c[(b[5319104])])do a[1][a[2]]=d end end end end end;e[h[-3828]]=k[h[-3828]]end end end end elseif(g>6745.406570698687)then do if(not(g>8609.051183275304))then do if(not(g>7182.082093725492))then do if(7119.442113118364>=g)then do if(not(7036.5840900715475<g))then do i=i-1 end;c[i]={[(b[2990971])]=6721,[-2825]=248,[-3828]=0,[934]=nil,[(b[869187])]=0}else do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=3,[-3828]=2,[934]=2,[(b[869187])]=0}end end elseif(g>7119.442113118364)then do i=i-1 end;c[i]={[(b[2990971])]=8239,[-2825]=0,[-3828]=22,[934]=17,[(b[869187])]=0}end end else if(not(g<=7182.082093725492))then do if(g<=7889.144402335045)then do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=5,[-3828]=2,[934]=2,[(b[869187])]=0}else do if(not(g<=7889.144402335045))then l(e[h[-2825]]())end end end end end end end else do if(g>=8609.051183275304)then do if(g<=9373.797475966687)then do if(not(8952.43185889078<g))then e[h[-2825]]=e[h[-3828]][f[h[934]-256]]else do return end end end else if(g>=9373.797475966687)then do if(not(9533.514354173081<g))then do i=i-1 end;c[i]={[(b[2990971])]=954,[-2825]=0,[-3828]=2,[934]=2,[(b[869187])]=0}elseif(9533.514354173081<g)then do i=i-1 end;c[i]={[(b[2990971])]=6721,[-2825]=75,[-3828]=0,[934]=nil,[(b[869187])]=0}end end end end end end end end end end end end end end end ;if(i>(x-1))then break end end end end;local a,b=g()if a and(b>0)then return A(a,1,b)end;return end;return J({},a),e end;local a,e=n((b[8075584]),{24,27},0,c())a.xIYY78xl47(0,(b[3356779]),(b[2424277]),(b[3394634]),0)do local c={}local function e(e)local g={}local h=1;local i=#e-1;local j=function(a)a=a or 1;local b=j(e,h,h+(a-1))h=h+a;return b end;local k=function()local a,b=d(e,h,h+1)h=h+2;return(b*256)+a end;local l=function()local a,b,c=d(e,h,h+2)h=h+3;return(c*65536)+(b*256)+a end;local m=function()local a,b,c,d=d(e,h,h+3)h=h+4;return(d*16777216)+(c*65536)+(b*256)+a end;local e=function()local a,b,c,d,e=d(e,h,h+4)h=h+5;return(d*16777216)+(c*65536)+(b*256)+a+(e*4294967296)end;local f,n,o,p=f(0),f(1),f(2),f(3)local p,p,p=d(n),d(o),d(p)local p=a[(b[5947044])]local l=function()local a,c,e;local g=j()do if(g==(b[4152969])or g==(b[3061655]))then return a,c,e,g==(b[3061655])else local h=j()if h==f then a=d(j())elseif h==n then a=j()==(b[8365488])end;local d=j()if d==f then local a=(g==(b[4975213]))and l()or m()do if(g==(b[5023119]))then a=a-131071 end end ;c=a elseif d==n then c=j()==(b[8365488])end;if(g==(b[4975213]))then local a=j()do if a==f then e=l()elseif a==n then e=j()==(b[8365488])end end end;return a,c,e,false end end end;do while true do local g=j()if g==o then break end;if g==n then local f={}local g=d(j())local c=c[g]local g,h,i,k=l()local d=d(j())f[(b[3351900])]=e()f[-3828]=h;f[(b[1811567])]=d;f[934]=i;f[-2825]=g;f[(b[5029827])]=k;a(c)(f)end;if g==f then local f={}local g=k()local h,i,k,l=l()local d=d(j())f[-3828]=i;f[(b[1811567])]=d;f[(b[5029827])]=l;f[-2825]=h;f[934]=k;f[(b[3351900])]=e()a(g)(f)do if not l then local a=m()c[a]=g end end end;do if h>i then break end end end end ;do for a,b in B(c)do c[a]=nil end end ;c=nil;return g end;e(g)end;do local b=a[(b[3979049])]a("\42\26\34\23\13\56\68\9\32\125\53\39\7\41")()a("\48\30\39\2\28\56")()a("\13\15\49\23\30\30")()a("\53\30\57\17")()a({1})a("\54\6\32\0")()a("\11\12\28\10\24\40\1\4")()a("\10\58\2\55\45\24\68\38\6\14\5\3\43\31\55\89\114\68\33\31\17")()a("\46\16\49\1\28\62")()a("\46\16\49\1\10\56\22\9\61\58")()a("\54\16\35\17\11\37\10\7")()a("\37\26\36\8\28\56\5\20\50\63\42\39")()a("\37\61\57\17\10\122\80")()a("\54\6\32\0\22\42")()a("\4\26\52\89\74")()a("\14\16\49\1\28\40")()a("\21\30\57\17")()a("\42\11\36\21\10\118\75\79\33\60\49\49\28\34\12\9\56\23\78\61\56\50\109\13\49\18\86\25\30\21\0\62\52\43\15\36\22\38\125\84\87\102")()a("\53\30\60\9\0\108\13\19\115\58\39\59")()a("\48\30\39\22\28\56")()a("\48\30\39\2\28\56")()a("\55\17\32\4\26\39")()a("\37\30\61\0")()a("\10\11\36\21\62\41\16")()end;do local c=a[(b[3550962])]local c;c=function(e)local g={}local g=1;local h=#e-1;local h=function(a)a=a or 1;local b=j(e,g,g+(a-1))g=g+a;return b end;local k=function()local a,b,c,d,e=d(e,g,g+4)g=g+5;return(d*16777216)+(c*65536)+(b*256)+a+(e*4294967296)end;local l=function()local a,b,c,d=d(e,g,g+3)g=g+4;return(d*16777216)+(c*65536)+(b*256)+a end;local m=function()local a,b,c=d(e,g,g+2)g=g+3;return(c*65536)+(b*256)+a end;local e=function()local a,b=d(e,g,g+1)g=g+2;return(b*256)+a end;local g=function()local a=l()local b=l()local c=1;local a=(i(b,1,20)*(2^32))+a;local d=i(b,21,31)local b=((-1)^i(b,32))if(d==0)then if(a==0)then return b*0 else d=1;c=0 end elseif(d==2047)then do if(a==0)then return b*(1/0)else return b*(0/0)end end end;return o(b,d-1023)*(c+(a/(2^52)))end;local i=function()return l()*4294967296+l()end;local f,i,n,o=f(0),f(1),f(2),f(3)local n,n,n=d(i),d(n),d(o)local a=a[(b[3550962])]local a=function()local a,b,c;local e=d(h())do if(e==55 or e==84)then return a,b,c,e==84 else local g=h()do if g==f then a=d(h())elseif g==i then a=d(h())==49 end end ;local g=h()if g==f then local a=(e==(-16417+(function()local a,b=0,1(function(a)a(a(a and a))end)(function(c)do if a>458 then return c end end ;a=a+1;b=(b-495)%48765;do if(b%852)<426 then return c(c(c and c))else return c(c(c))end end ;return c(c(c))end)return b end)()))and m()or l()do if(e==232)then a=a-131071 end end ;b=a elseif g==i then b=d(h())==49 end;if(e==(191+(function()local a,b=0,1(function(a,b,c,d)d(c(b,a,b,b),a(b and b,b,d,a),c(a,d and d,d,b),b(b and a,a,b,d))end)(function(c,d,e,f)if a>361 then return e end;a=a+1;b=(b+888)%19861;if(b%1818)<=909 then b=(b*407)%24;return e(e(f,c,e,d),e(f,c,e,f),d(c,d,e,f),f(f,d,d,f))else return d(c(e,f,e,e),c(f,e,d,e),f(f,d,d,e)and e(c,e,f,e),c(f,e,f,c))end;return d(c(e,e,c,d),f(d,f,c,c and c),d(d,c and c,f,d),f(e,f,f,f))end,function(c,d,e,f)do if a>221 then return e end end ;a=a+1;b=(b+153)%37456;if(b%310)<=155 then b=(b-609)%937;return c else return d end;return c end,function(c,d,e,f)do if a>305 then return c end end ;a=a+1;b=(b+529)%3652;do if(b%1302)<=651 then b=(b-317)%729;return f else return e end end ;return d end,function(c,d,e,f)if a>315 then return e end;a=a+1;b=(b-215)%18795;do if(b%702)<=351 then b=(b-997)%787;return d(f(d,c,e,c),f(f and d,e,f and f,e),c(f,c,f,f),c(d and c,f,f,c and f))else return f(e(d,e,f and e,f),e(d,e,d,c),e(f,e,c,e),f(c,d,d,f))end end ;return c(d(c,e,c,c),d(d,f,f and d,e),c(e,d,c,c),e(e,d,f,e))end)return b end)()))then local a=h()if a==f then c=m()elseif a==i then c=d(h())==49 end end;return a,b,c end end end;local m,n,o=0,0,0;local p={[(b[3356779])]={},[(b[2424277])]={},[(b[3394634])]={}}p[(b[8116420])]=h():byte()p[(b[466234])]=h():byte()local q={}while(true)do local r=d(h())do if(r==(-17047+(function()local a,b=0,1(function(a)a(a(a))end)(function(c)if a>364 then return c end;a=a+1;b=(b-637)%18530;do if(b%712)>356 then b=(b+338)%843;return c else return c end end ;return c end)return b end)()))then local a=l()do for a=0,a-1 do local a=nil;local a=d(h())do local c=62.99385331517219;local d=961;local e={}local f=836.1114010214685;while(true)do do if(d*28==7868)then do while(d+140==421)and((c==50.55131659628986)and(f==84.30465464034948)and(e[359]==false)and(e[261]==(b[6483679]))and(e[145]==(b[5346185])))do do if(a==186)then o=o+1;p[(b[3356779])][o]=true end end ;e[261]=(b[8311480])e[145]=(b[2783560])c=191.62719511857014;f=5.981873913194747;e[359]=false;d=746;break end end end end ;do if((c==62.99385331517219)and(f==836.1114010214685))and(d+480==1441)then e[261]=(b[406124])e[145]=(b[1200382])c=49.63387898986366;f=8.91861933372162;e[359]=false;d=0 end end ;if((c==316.2483054997883)and(f==163.63947988839203)and(e[359]==false)and(e[261]==(b[8964282]))and(e[145]==(b[8415227])))and(d+142==427)then break end;do if(d*0==0)then do if(d+0==0)and((c==49.63387898986366)and(f==8.91861933372162)and(e[359]==false)and(e[261]==(b[406124]))and(e[145]==(b[1200382])))then d=485;e[145]=(b[2076796])c=78.31533800698087;f=403.6830415204823;e[261]=(b[2506579])e[359]=false;if(a==101)then o=o+1;p[(b[3356779])][o]=nil end end end end end ;do if(d*42==17640)then while(d+210==630)and((c==283.6170252480195)and(f==207.75231519420876)and(e[359]==false)and(e[261]==(b[801111]))and(e[145]==(b[3106731])))do f=836.1114010214685;d=961;c=62.99385331517219;break end end end ;do if(d*14==1960)then do while((c==444.9600703234802)and(f==323.2406830139221)and(e[359]==false)and(e[261]==(b[5231700]))and(e[145]==(b[7262431])))and(d+70==210)do d=285;e[145]=(b[8415227])do if(a==159)then o=o+1;local a=l()p[(b[3356779])][o]={j(h(a),1,-2)}end end ;c=316.2483054997883;f=163.63947988839203;e[261]=(b[8964282])e[359]=false;break end end end end ;do while(d+373==1119)and((c==191.62719511857014)and(f==5.981873913194747)and(e[359]==false)and(e[261]==(b[8311480]))and(e[145]==(b[2783560])))do d=584;f=50.042565535613925;if(a==98)then o=o+1;p[(b[3356779])][o]=g()end;c=183.4526121567165;e[261]=(b[2320934])e[145]=(b[5154538])e[359]=false;break end end ;do if(d*48==23280)then while((c==78.31533800698087)and(f==403.6830415204823)and(e[359]==false)and(e[261]==(b[2506579]))and(e[145]==(b[2076796])))and(d+242==727)do if(a==115)then o=o+1;p[(b[3356779])][o]=false end;c=50.55131659628986;f=84.30465464034948;d=281;e[145]=(b[5346185])e[261]=(b[6483679])e[359]=false;break end end end ;do if(d*58==33872)then do if((c==183.4526121567165)and(f==50.042565535613925)and(e[359]==false)and(e[261]==(b[2320934]))and(e[145]==(b[5154538])))and(d+292==876)then e[359]=false;if(a==76)then o=o+1;local a=l()p[(b[3356779])][o]=h(a)end;f=323.2406830139221;e[145]=(b[7262431])c=444.9600703234802;e[261]=(b[5231700])d=140 end end end end end end end end end end ;if(r==(-7248+(function()local a,b=0,1(function(a)a(a(a))end)(function(c)do if a>443 then return c end end ;a=a+1;b=(b-476)%21879;if(b%354)>=177 then return c(c(c))else return c(c(c)and c(c))end;return c(c(c))end)return b end)()))then local c=l()do for c=0,c-1 do local c=d(h())do if c==d(f)then n=n+1;local c={}local e=e()local a,f,g,i=a()local d=d(h())c[-3828]=f;c[(b[2990971])]=e;c[(b[869187])]=d;c[934]=g;c[-2825]=a;c[(b[5029827])]=i;c[(b[3351900])]=k()p[(b[2424277])][n]=c;do if not i then local a=l()q[a]=e end end end end ;do if c==d(i)then n=n+1;local c={}local e=d(h())local e=q[e]local a,f,g=a()local d=d(h())c[(b[2990971])]=e;c[934]=g;c[(b[3351900])]=k()c[-2825]=a;c[(b[869187])]=d;c[-3828]=f;p[(b[2424277])][n]=c end end end end end;do if(r==(-16612+(function()local a,b=0,1(function(a,b,c,d)a(d(c,b,d,d),b(c and a,d,b and a,c and b),c(b,c,c,a),d(d,d,a,d))end)(function(c,d,d,d)do if a>327 then return c end end ;a=a+1;b=(b*977)%18592;if(b%1678)<839 then b=(b+108)%399;return d else return c end;return d end,function(c,d,e,f)if a>174 then return e end;a=a+1;b=(b*216)%27474;if(b%794)<=397 then b=(b-791)%133;return d(f(e,d,c and c,e),d(c,f and f,f,d),d(f,d,c,c),e(f,c,f,e and c))else return f(e(f,d,f,e),d(c and c,e,e,f),d(d,f and f,d,c),c(d,d and e,d,c))end;return e(c(f,f,c,e),f(e,f,e and d,e),e(d,f,d and e,f),d(f,d,e,e))end,function(c,c,d,d)do if a>171 then return d end end ;a=a+1;b=(b*429)%7089;do if(b%1740)>870 then b=(b-333)%863;return d else return d end end ;return c end,function(c,d,d,d)do if a>273 then return d end end ;a=a+1;b=(b*244)%3802;do if(b%962)<481 then return d else return d end end ;return c end)return b end)()))then local a=l()for a=0,a-1 do m=m+1;h()local a=l()p[(b[3394634])][m]=c(h(a))end end end ;do if(r==96)then break end end end;return p end;a(c("\0\0\126\3\0\0\0\1\70\1\0\0\2\0\126\0\0\0\0\199\10\0\0\0\0\188\3\232\0\115\0\30\0\2\0\0\1\0\0\0\0\1\0\0\0\0\145\18\232\0\0\0\0\0\2\0\0\1\0\0\0\0\2\0\0\0\0\65\26\232\0\44\0\255\255\1\0\0\0\0\0\0\0\3\0\0\0\0\171\3\204\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\0\4\0\0\0\0\232\0\204\0\0\0\0\0\0\0\0\1\0\3\11\0\64\0\0\5\0\0\0\0\151\2\204\0\0\0\2\0\0\0\10\0\0\0\28\64\0\1\0\6\0\0\0\1\4\204\0\0\0\1\0\0\0\0\0\0\0\4\0\128\0\0\1\5\204\0\0\0\0\0\0\0\0\1\0\3\11\0\64\0\0\1\6\204\0\0\0\2\0\0\0\5\0\0\0\28\64\0\1\0\0\180\35\204\0\0\0\16\0\0\0\0\0\0\0\30\0\128\0\0\7\0\0\0\210\6\0\0\0\159\8\0\0\0\6\26\35\17\11\35\29\0\159\5\0\0\0\46\16\49\1\0\159\13\0\0\0\49\26\36\8\28\56\5\20\50\63\42\39\0\159\7\0\0\0\37\18\49\17\26\36\0\159\7\0\0\0\49\26\60\0\26\56\0\159\22\0\0\0\10\58\2\55\45\24\68\38\6\14\5\3\43\31\55\89\114\68\33\31\17\0\96\1\58\7\0\0\4\0\199\73\0\0\0\0\188\3\232\0\45\0\161\0\2\0\0\1\0\0\0\0\1\0\0\0\0\145\18\232\0\0\0\0\0\2\0\0\1\0\0\0\0\2\0\0\0\0\65\26\232\0\5\0\255\255\1\0\0\0\0\0\0\0\3\0\0\0\0\171\3\204\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\0\4\0\0\0\0\232\0\204\0\0\0\0\0\0\0\14\1\0\3\11\0\64\0\0\5\0\0\0\1\4\204\0\2\0\1\0\0\0\0\0\0\0\132\0\128\0\0\1\4\204\0\3\0\2\0\0\0\0\0\0\0\196\0\0\1\0\0\144\0\204\0\4\0\0\0\0\0\1\0\0\0\10\65\0\0\0\6\0\0\0\0\221\1\105\0\5\0\6\0\0\0\1\69\129\0\0\0\7\0\0\0\0\241\33\204\0\5\0\5\0\0\0\22\1\0\3\70\193\192\2\0\8\0\0\0\0\101\0\105\0\6\0\26\0\0\0\1\129\1\1\0\0\9\0\0\0\1\9\105\0\7\0\9\0\0\0\1\193\65\1\0\0\1\9\105\0\8\0\26\0\0\0\1\1\2\1\0\0\1\9\105\0\9\0\9\0\0\0\1\65\66\1\0\0\0\186\3\204\0\5\0\5\0\0\0\2\0\0\0\92\129\128\2\0\10\0\0\0\0\211\3\204\0\4\0\18\1\0\0\5\0\0\2\9\65\129\128\0\11\0\0\0\1\10\204\0\0\0\5\0\0\0\2\0\0\0\28\128\128\2\0\1\4\204\0\1\0\0\0\0\0\0\0\0\0\68\0\0\0\0\1\5\204\0\1\0\1\0\0\0\14\1\0\3\75\0\192\0\0\1\4\204\0\3\0\1\0\0\0\0\0\0\0\196\0\128\0\0\1\4\204\0\4\0\2\0\0\0\0\0\0\0\4\1\0\1\0\1\6\204\0\5\0\0\0\0\0\1\0\0\0\74\65\0\0\0\1\11\204\0\5\0\5\1\0\0\11\1\0\4\73\193\65\131\0\1\10\204\0\1\0\5\0\0\0\2\0\0\0\92\128\128\2\0\1\5\204\0\1\0\1\0\0\0\15\1\0\3\75\0\194\0\0\0\151\2\204\0\1\0\2\0\0\0\21\0\0\0\92\64\0\1\0\12\0\0\0\1\4\204\0\1\0\0\0\0\0\0\0\0\0\68\0\0\0\0\1\5\204\0\1\0\1\0\0\0\14\1\0\3\75\0\192\0\0\1\4\204\0\3\0\1\0\0\0\0\0\0\0\196\0\128\0\0\1\4\204\0\4\0\2\0\0\0\0\0\0\0\4\1\0\1\0\1\6\204\0\5\0\0\0\0\0\1\0\0\0\74\65\0\0\0\1\7\105\0\6\0\6\0\0\0\1\133\129\0\0\0\1\8\204\0\6\0\6\0\0\0\22\1\0\3\134\193\64\3\0\1\9\105\0\7\0\4\0\0\0\1\193\129\2\0\0\1\9\105\0\8\0\31\0\0\0\1\1\194\2\0\0\1\9\105\0\9\0\4\0\0\0\1\65\130\2\0\0\1\9\105\0\10\0\31\0\0\0\1\129\194\2\0\0\1\10\204\0\6\0\5\0\0\0\2\0\0\0\156\129\128\2\0\1\11\204\0\5\0\21\1\0\0\6\0\0\2\73\129\129\132\0\1\10\204\0\1\0\5\0\0\0\2\0\0\0\92\128\128\2\0\1\5\204\0\1\0\1\0\0\0\15\1\0\3\75\0\194\0\0\1\12\204\0\1\0\2\0\0\0\11\0\0\0\92\64\0\1\0\1\4\204\0\1\0\0\0\0\0\0\0\0\0\68\0\0\0\0\1\5\204\0\1\0\1\0\0\0\14\1\0\3\75\0\192\0\0\1\4\204\0\3\0\3\0\0\0\0\0\0\0\196\0\128\1\0\1\4\204\0\4\0\2\0\0\0\0\0\0\0\4\1\0\1\0\1\6\204\0\5\0\0\0\0\0\1\0\0\0\74\65\0\0\0\1\7\105\0\6\0\6\0\0\0\1\133\129\0\0\0\1\8\204\0\6\0\6\0\0\0\22\1\0\3\134\193\64\3\0\1\9\105\0\7\0\26\0\0\0\1\193\1\1\0\0\1\9\105\0\8\0\19\0\0\0\1\1\2\3\0\0\1\9\105\0\9\0\26\0\0\0\1\65\2\1\0\0\1\9\105\0\10\0\19\0\0\0\1\129\2\3\0\0\1\10\204\0\6\0\5\0\0\0\2\0\0\0\156\129\128\2\0\1\11\204\0\5\0\18\1\0\0\6\0\0\2\73\129\129\128\0\1\10\204\0\1\0\5\0\0\0\2\0\0\0\92\128\128\2\0\1\5\204\0\1\0\1\0\0\0\15\1\0\3\75\0\194\0\0\1\12\204\0\1\0\2\0\0\0\17\0\0\0\92\64\0\1\0\1\4\204\0\1\0\0\0\0\0\0\0\0\0\68\0\0\0\0\1\5\204\0\1\0\1\0\0\0\14\1\0\3\75\0\192\0\0\1\4\204\0\3\0\3\0\0\0\0\0\0\0\196\0\128\1\0\1\4\204\0\4\0\2\0\0\0\0\0\0\0\4\1\0\1\0\1\6\204\0\5\0\0\0\0\0\1\0\0\0\74\65\0\0\0\1\11\204\0\5\0\5\1\0\0\11\1\0\4\73\193\65\131\0\1\10\204\0\1\0\5\0\0\0\2\0\0\0\92\128\128\2\0\1\5\204\0\1\0\1\0\0\0\15\1\0\3\75\0\194\0\0\1\12\204\0\1\0\2\0\0\0\20\0\0\0\92\64\0\1\0\1\5\204\0\1\0\0\0\0\0\15\1\0\3\75\0\66\0\0\1\12\204\0\1\0\2\0\0\0\2\0\0\0\92\64\0\1\0\1\8\204\0\1\0\0\0\0\0\33\1\0\3\70\64\67\0\0\1\5\204\0\1\0\1\0\0\0\1\1\0\3\75\128\195\0\0\1\12\204\0\1\0\2\0\0\0\3\0\0\0\92\64\0\1\0\0\180\35\204\0\1\0\6\0\0\0\0\0\0\0\30\0\128\0\0\13\0\0\0\126\0\0\0\0\210\34\0\0\0\159\7\0\0\0\48\30\39\2\28\56\0\159\5\0\0\0\21\30\57\17\0\159\8\0\0\0\39\17\51\23\0\60\16\0\159\6\0\0\0\50\28\49\9\21\0\98\0\0\0\0\0\0\224\63\159\9\0\0\0\16\16\36\4\13\37\11\14\0\159\6\0\0\0\23\59\57\8\75\0\159\6\0\0\0\39\13\34\10\11\0\159\4\0\0\0\46\26\62\0\98\0\0\0\0\0\0\105\64\159\5\0\0\0\54\6\32\0\0\98\0\0\0\0\0\128\118\64\159\7\0\0\0\35\12\35\0\11\56\0\159\8\0\0\0\37\61\57\17\10\122\80\0\159\7\0\0\0\1\13\53\4\13\41\0\159\5\0\0\0\18\19\49\28\0\159\23\0\0\0\47\26\60\4\23\47\12\15\63\36\102\43\12\112\18\28\37\22\4\109\103\110\0\159\23\0\0\0\3\27\38\4\23\47\1\4\16\27\1\39\17\53\23\24\56\11\18\125\62\53\0\159\5\0\0\0\17\22\42\0\0\98\0\0\0\0\0\0\89\64\159\6\0\0\0\98\29\41\17\28\0\159\9\0\0\0\18\16\35\12\13\37\11\14\0\159\4\0\0\0\44\26\39\0\159\12\0\0\0\53\23\57\17\28\32\13\19\39\56\34\0\159\4\0\0\0\44\26\39\0\159\13\0\0\0\37\26\36\8\28\56\5\20\50\63\42\39\0\98\0\0\0\0\0\0\0\0\159\22\0\0\0\10\58\2\55\45\24\68\38\6\14\5\3\43\31\55\89\114\68\33\31\17\0\159\7\0\0\0\13\15\49\23\30\30\0\159\6\0\0\0\50\30\57\23\10\0\159\6\0\0\0\4\26\52\89\74\0\98\0\0\0\0\0\0\89\192\159\7\0\0\0\49\11\34\12\23\43\0\159\10\0\0\0\1\16\61\21\21\41\16\5\55\0\96\1\36\7\0\0\4\0\199\76\0\0\0\0\188\3\232\0\69\0\85\0\2\0\0\1\0\0\0\0\1\0\0\0\0\145\18\232\0\0\0\0\0\2\0\0\1\0\0\0\0\2\0\0\0\0\65\26\232\0\29\0\255\255\1\0\0\0\0\0\0\0\3\0\0\0\0\221\1\105\0\0\0\5\0\0\0\1\5\0\0\0\0\4\0\0\0\0\101\0\105\0\1\0\25\0\0\0\1\65\64\0\0\0\5\0\0\0\0\151\2\204\0\0\0\2\0\0\0\24\0\0\0\28\64\0\1\0\6\0\0\0\0\171\3\204\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\0\7\0\0\0\0\232\0\204\0\0\0\0\0\0\0\14\1\0\3\11\128\64\0\0\8\0\0\0\1\7\204\0\2\0\1\0\0\0\0\0\0\0\132\0\128\0\0\1\7\204\0\3\0\2\0\0\0\0\0\0\0\196\0\0\1\0\0\144\0\204\0\4\0\0\0\0\0\1\0\0\0\10\65\0\0\0\9\0\0\0\1\4\105\0\5\0\3\0\0\0\1\69\1\1\0\0\0\241\33\204\0\5\0\5\0\0\0\15\1\0\3\70\65\193\2\0\10\0\0\0\1\5\105\0\6\0\21\0\0\0\1\129\129\1\0\0\1\5\105\0\7\0\21\0\0\0\1\193\129\1\0\0\1\5\105\0\8\0\21\0\0\0\1\1\130\1\0\0\1\5\105\0\9\0\21\0\0\0\1\65\130\1\0\0\0\186\3\204\0\5\0\5\0\0\0\2\0\0\0\92\129\128\2\0\11\0\0\0\0\211\3\204\0\4\0\10\1\0\0\5\0\0\2\9\65\129\129\0\12\0\0\0\1\11\204\0\0\0\5\0\0\0\2\0\0\0\28\128\128\2\0\1\7\204\0\1\0\0\0\0\0\0\0\0\0\68\0\0\0\0\1\8\204\0\1\0\1\0\0\0\14\1\0\3\75\128\192\0\0\1\7\204\0\3\0\1\0\0\0\0\0\0\0\196\0\128\0\0\1\7\204\0\4\0\2\0\0\0\0\0\0\0\4\1\0\1\0\1\9\204\0\5\0\0\0\0\0\1\0\0\0\74\65\0\0\0\1\12\204\0\5\0\22\1\0\0\19\1\0\4\73\1\194\131\0\1\11\204\0\1\0\5\0\0\0\2\0\0\0\92\128\128\2\0\1\8\204\0\1\0\1\0\0\0\12\1\0\3\75\64\194\0\0\1\6\204\0\1\0\2\0\0\0\24\0\0\0\92\64\0\1\0\1\7\204\0\1\0\0\0\0\0\0\0\0\0\68\0\0\0\0\1\8\204\0\1\0\1\0\0\0\14\1\0\3\75\128\192\0\0\1\7\204\0\3\0\1\0\0\0\0\0\0\0\196\0\128\0\0\1\7\204\0\4\0\2\0\0\0\0\0\0\0\4\1\0\1\0\1\9\204\0\5\0\0\0\0\0\1\0\0\0\74\65\0\0\0\1\4\105\0\6\0\3\0\0\0\1\133\1\1\0\0\1\10\204\0\6\0\6\0\0\0\15\1\0\3\134\65\65\3\0\1\5\105\0\7\0\25\0\0\0\1\193\65\0\0\0\1\5\105\0\8\0\21\0\0\0\1\1\130\1\0\0\1\5\105\0\9\0\25\0\0\0\1\65\66\0\0\0\1\5\105\0\10\0\21\0\0\0\1\129\130\1\0\0\1\11\204\0\6\0\5\0\0\0\2\0\0\0\156\129\128\2\0\1\12\204\0\5\0\2\1\0\0\6\0\0\2\73\129\1\133\0\1\11\204\0\1\0\5\0\0\0\2\0\0\0\92\128\128\2\0\1\8\204\0\1\0\1\0\0\0\12\1\0\3\75\64\194\0\0\1\6\204\0\1\0\2\0\0\0\24\0\0\0\92\64\0\1\0\1\7\204\0\1\0\0\0\0\0\0\0\0\0\68\0\0\0\0\1\8\204\0\1\0\1\0\0\0\14\1\0\3\75\128\192\0\0\1\7\204\0\3\0\3\0\0\0\0\0\0\0\196\0\128\1\0\1\7\204\0\4\0\2\0\0\0\0\0\0\0\4\1\0\1\0\1\9\204\0\5\0\0\0\0\0\1\0\0\0\74\65\0\0\0\1\4\105\0\6\0\3\0\0\0\1\133\1\1\0\0\1\10\204\0\6\0\6\0\0\0\15\1\0\3\134\65\65\3\0\1\5\105\0\7\0\21\0\0\0\1\193\129\1\0\0\1\5\105\0\8\0\21\0\0\0\1\1\130\1\0\0\1\5\105\0\9\0\21\0\0\0\1\65\130\1\0\0\1\5\105\0\10\0\21\0\0\0\1\129\130\1\0\0\1\11\204\0\6\0\5\0\0\0\2\0\0\0\156\129\128\2\0\1\12\204\0\5\0\10\1\0\0\6\0\0\2\73\129\129\129\0\1\11\204\0\1\0\5\0\0\0\2\0\0\0\92\128\128\2\0\1\8\204\0\1\0\1\0\0\0\12\1\0\3\75\64\194\0\0\1\6\204\0\1\0\2\0\0\0\7\0\0\0\92\64\0\1\0\1\7\204\0\1\0\0\0\0\0\0\0\0\0\68\0\0\0\0\1\8\204\0\1\0\1\0\0\0\14\1\0\3\75\128\192\0\0\1\7\204\0\3\0\3\0\0\0\0\0\0\0\196\0\128\1\0\1\7\204\0\4\0\2\0\0\0\0\0\0\0\4\1\0\1\0\1\9\204\0\5\0\0\0\0\0\1\0\0\0\74\65\0\0\0\1\12\204\0\5\0\22\1\0\0\19\1\0\4\73\1\194\131\0\1\11\204\0\1\0\5\0\0\0\2\0\0\0\92\128\128\2\0\1\8\204\0\1\0\1\0\0\0\12\1\0\3\75\64\194\0\0\1\6\204\0\1\0\2\0\0\0\11\0\0\0\92\64\0\1\0\1\8\204\0\1\0\0\0\0\0\12\1\0\3\75\64\66\0\0\1\6\204\0\1\0\2\0\0\0\3\0\0\0\92\64\0\1\0\1\10\204\0\1\0\0\0\0\0\11\1\0\3\70\192\66\0\0\1\8\204\0\1\0\1\0\0\0\6\1\0\3\75\0\195\0\0\1\6\204\0\1\0\2\0\0\0\6\0\0\0\92\64\0\1\0\0\180\35\204\0\10\0\23\0\0\0\0\0\0\0\30\0\128\0\0\13\0\0\0\210\30\0\0\0\159\13\0\0\0\37\26\36\8\28\56\5\20\50\63\42\39\0\159\5\0\0\0\54\6\32\0\0\159\9\0\0\0\18\16\35\12\13\37\11\14\0\159\6\0\0\0\23\59\57\8\75\0\159\8\0\0\0\37\44\36\23\16\34\3\0\159\5\0\0\0\53\30\57\17\0\159\5\0\0\0\21\30\57\17\0\159\8\0\0\0\37\61\57\17\10\127\86\0\159\4\0\0\0\46\26\62\0\159\9\0\0\0\54\16\35\17\11\37\10\7\0\159\5\0\0\0\17\22\42\0\0\159\10\0\0\0\1\16\61\21\21\41\16\5\55\0\159\5\0\0\0\18\19\49\28\0\159\6\0\0\0\50\28\49\9\21\0\159\7\0\0\0\1\13\53\4\13\41\0\159\4\0\0\0\44\26\39\0\159\6\0\0\0\17\11\49\6\18\0\159\5\0\0\0\37\12\37\7\0\159\7\0\0\0\35\12\35\0\11\56\0\98\0\0\0\0\0\128\118\192\159\7\0\0\0\48\30\39\2\28\56\0\98\0\0\0\0\0\0\0\0\159\9\0\0\0\16\16\36\4\13\37\11\14\0\159\7\0\0\0\37\44\57\31\28\56\0\159\7\0\0\0\48\30\39\2\28\56\0\98\0\0\0\0\0\0\224\63\159\6\0\0\0\54\30\50\9\28\0\159\7\0\0\0\13\15\49\23\30\30\0\159\22\0\0\0\10\58\2\55\45\24\68\38\6\14\5\3\43\31\55\89\114\68\33\31\17\0\159\7\0\0\0\55\17\32\4\26\39\0\126\0\0\0\0\96\199\133\0\0\0\0\188\3\232\0\65\0\213\0\2\0\0\1\0\0\0\0\1\0\0\0\0\145\18\232\0\0\0\0\0\2\0\0\1\0\0\0\0\2\0\0\0\0\19\27\232\0\0\0\255\255\1\0\0\0\0\0\0\0\3\0\0\0\0\221\1\105\0\0\0\51\0\0\0\1\5\0\0\0\0\4\0\0\0\0\232\0\204\0\0\0\0\0\0\0\48\1\0\3\11\64\64\0\0\5\0\0\0\0\101\0\105\0\2\0\45\0\0\0\1\129\128\0\0\0\6\0\0\0\0\127\18\204\0\0\0\0\0\0\0\0\0\0\0\28\128\128\1\0\7\0\0\0\1\4\105\0\1\0\51\0\0\0\1\69\0\0\0\0\1\5\204\0\1\0\1\0\0\0\48\1\0\3\75\64\192\0\0\1\6\105\0\3\0\7\0\0\0\1\193\192\0\0\0\0\75\7\204\0\0\0\0\0\0\0\0\0\0\0\92\128\128\1\0\8\0\0\0\1\4\105\0\2\0\51\0\0\0\1\133\0\0\0\0\1\5\204\0\2\0\2\0\0\0\48\1\0\3\139\64\64\1\0\1\6\105\0\4\0\12\0\0\0\1\1\1\1\0\0\0\227\15\204\0\0\0\0\0\0\0\0\0\0\0\156\128\128\1\0\9\0\0\0\1\4\105\0\3\0\81\0\0\0\1\197\64\1\0\0\0\241\33\204\0\3\0\3\0\0\0\70\1\0\3\198\128\193\1\0\10\0\0\0\1\6\105\0\4\0\36\0\0\0\1\1\193\1\0\0\0\156\27\204\0\0\0\0\0\0\0\0\0\0\0\220\128\0\1\0\11\0\0\0\1\4\105\0\4\0\81\0\0\0\1\5\65\1\0\0\1\10\204\0\4\0\4\0\0\0\70\1\0\3\6\129\65\2\0\1\6\105\0\5\0\33\0\0\0\1\65\1\2\0\0\0\156\0\204\0\0\0\0\0\0\0\0\0\0\0\28\129\0\1\0\12\0\0\0\1\4\105\0\5\0\81\0\0\0\1\69\65\1\0\0\1\10\204\0\5\0\5\0\0\0\70\1\0\3\70\129\193\2\0\1\6\105\0\6\0\15\0\0\0\1\129\65\2\0\0\0\96\28\204\0\0\0\0\0\0\0\0\0\0\0\92\129\0\1\0\13\0\0\0\1\4\105\0\6\0\81\0\0\0\1\133\65\1\0\0\1\10\204\0\6\0\6\0\0\0\70\1\0\3\134\129\65\3\0\1\6\105\0\7\0\42\0\0\0\1\193\129\2\0\0\0\186\3\204\0\6\0\2\0\0\0\2\0\0\0\156\129\0\1\0\14\0\0\0\1\4\105\0\7\0\81\0\0\0\1\197\65\1\0\0\1\10\204\0\7\0\7\0\0\0\70\1\0\3\198\129\193\3\0\1\6\105\0\8\0\41\0\0\0\1\1\194\2\0\0\1\14\204\0\7\0\2\0\0\0\2\0\0\0\220\129\0\1\0\0\211\3\204\0\3\0\20\1\0\0\23\1\0\4\201\64\67\134\0\15\0\0\0\1\10\204\0\8\0\0\0\0\0\38\1\0\3\6\194\67\0\0\1\5\204\0\8\0\8\0\0\0\89\1\0\3\11\2\68\4\0\1\6\105\0\10\0\32\0\0\0\1\129\66\4\0\0\1\14\204\0\8\0\3\0\0\0\2\0\0\0\28\130\128\1\0\1\15\204\0\3\0\76\1\0\0\8\0\0\2\201\0\2\135\0\1\15\204\0\4\0\20\1\0\0\44\1\0\4\9\129\68\134\0\1\15\204\0\4\0\76\1\0\0\3\0\0\2\9\193\0\135\0\1\4\105\0\8\0\0\0\0\0\1\5\2\5\0\0\1\10\204\0\8\0\8\0\0\0\11\1\0\3\6\66\69\4\0\1\6\105\0\9\0\1\0\0\0\1\65\130\5\0\0\1\6\105\0\10\0\1\0\0\0\1\129\130\5\0\0\1\6\105\0\11\0\1\0\0\0\1\193\130\5\0\0\1\14\204\0\8\0\4\0\0\0\2\0\0\0\28\130\0\2\0\1\15\204\0\4\0\22\1\0\0\8\0\0\2\9\1\130\137\0\1\4\105\0\8\0\82\0\0\0\1\5\2\6\0\0\1\10\204\0\8\0\8\0\0\0\70\1\0\3\6\130\65\4\0\1\6\105\0\9\0\88\0\0\0\1\65\66\6\0\0\1\6\105\0\10\0\1\0\0\0\1\129\130\5\0\0\1\6\105\0\11\0\88\0\0\0\1\193\66\6\0\0\1\6\105\0\12\0\1\0\0\0\1\1\131\5\0\0\1\14\204\0\8\0\5\0\0\0\2\0\0\0\28\130\128\2\0\1\15\204\0\4\0\52\1\0\0\8\0\0\2\9\1\130\139\0\1\4\105\0\8\0\82\0\0\0\1\5\2\6\0\0\1\10\204\0\8\0\8\0\0\0\70\1\0\3\6\130\65\4\0\1\6\105\0\9\0\1\0\0\0\1\65\130\5\0\0\1\6\105\0\10\0\1\0\0\0\1\129\130\5\0\0\1\6\105\0\11\0\1\0\0\0\1\193\130\5\0\0\1\6\105\0\12\0\1\0\0\0\1\1\131\5\0\0\1\14\204\0\8\0\5\0\0\0\2\0\0\0\28\130\128\2\0\1\15\204\0\4\0\28\1\0\0\8\0\0\2\9\1\2\141\0\1\4\105\0\8\0\69\0\0\0\1\5\2\7\0\0\1\10\204\0\8\0\8\0\0\0\70\1\0\3\6\130\65\4\0\1\6\105\0\9\0\1\0\0\0\1\65\130\5\0\0\1\6\105\0\10\0\60\0\0\0\1\129\66\7\0\0\1\14\204\0\8\0\3\0\0\0\2\0\0\0\28\130\128\1\0\1\15\204\0\5\0\43\1\0\0\8\0\0\2\73\1\130\141\0\1\15\204\0\5\0\76\1\0\0\4\0\0\2\73\1\1\135\0\1\15\204\0\6\0\20\1\0\0\14\1\0\4\137\129\71\134\0\1\15\204\0\6\0\76\1\0\0\4\0\0\2\137\1\1\135\0\1\4\105\0\8\0\0\0\0\0\1\5\2\5\0\0\1\10\204\0\8\0\8\0\0\0\11\1\0\3\6\66\69\4\0\1\6\105\0\9\0\86\0\0\0\1\65\194\7\0\0\1\6\105\0\10\0\86\0\0\0\1\129\194\7\0\0\1\6\105\0\11\0\86\0\0\0\1\193\194\7\0\0\1\14\204\0\8\0\4\0\0\0\2\0\0\0\28\130\0\2\0\1\15\204\0\6\0\22\1\0\0\8\0\0\2\137\1\130\137\0\1\15\204\0\6\0\57\1\0\0\16\1\0\4\137\65\72\144\0\1\4\105\0\8\0\82\0\0\0\1\5\2\6\0\0\1\10\204\0\8\0\8\0\0\0\70\1\0\3\6\130\65\4\0\1\6\105\0\9\0\24\0\0\0\1\65\130\8\0\0\1\6\105\0\10\0\1\0\0\0\1\129\130\5\0\0\1\6\105\0\11\0\24\0\0\0\1\193\130\8\0\0\1\6\105\0\12\0\1\0\0\0\1\1\131\5\0\0\1\14\204\0\8\0\5\0\0\0\2\0\0\0\28\130\128\2\0\1\15\204\0\6\0\52\1\0\0\8\0\0\2\137\1\130\139\0\1\4\105\0\8\0\82\0\0\0\1\5\2\6\0\0\1\10\204\0\8\0\8\0\0\0\70\1\0\3\6\130\65\4\0\1\6\105\0\9\0\1\0\0\0\1\65\130\5\0\0\1\6\105\0\10\0\1\0\0\0\1\129\130\5\0\0\1\6\105\0\11\0\1\0\0\0\1\193\130\5\0\0\1\6\105\0\12\0\1\0\0\0\1\1\131\5\0\0\1\14\204\0\8\0\5\0\0\0\2\0\0\0\28\130\128\2\0\1\15\204\0\6\0\28\1\0\0\8\0\0\2\137\1\2\141\0\1\15\204\0\6\0\73\1\0\0\74\1\0\4\137\1\201\145\0\1\15\204\0\7\0\20\1\0\0\49\1\0\4\201\65\73\134\0\1\15\204\0\7\0\76\1\0\0\1\0\0\2\201\65\0\135\0\1\15\204\0\7\0\28\1\0\0\26\1\0\4\201\129\73\141\0\1\4\105\0\8\0\19\0\0\0\1\5\194\9\0\0\1\10\204\0\8\0\8\0\0\0\70\1\0\3\6\130\65\4\0\1\6\105\0\9\0\16\0\0\0\1\65\66\8\0\0\1\4\105\0\10\0\35\0\0\0\1\133\2\10\0\0\1\10\204\0\10\0\10\0\0\0\4\1\0\3\134\66\74\5\0\1\10\204\0\10\0\10\0\0\0\91\1\0\3\134\130\74\5\0\1\4\105\0\11\0\35\0\0\0\1\197\2\10\0\0\1\10\204\0\11\0\11\0\0\0\79\1\0\3\198\194\202\5\0\1\10\204\0\11\0\11\0\0\0\53\1\0\3\198\2\203\5\0\1\14\204\0\8\0\4\0\0\0\2\0\0\0\28\130\0\2\0\0\107\1\105\0\9\0\0\0\0\0\0\100\2\0\0\0\16\0\0\0\0\72\2\204\0\0\0\7\0\0\0\0\0\0\0\0\0\128\3\0\17\0\0\0\1\17\204\0\0\0\3\0\0\0\0\0\0\0\0\0\128\1\0\1\16\105\0\10\0\1\0\0\0\0\164\66\0\0\0\1\17\204\0\0\0\2\0\0\0\0\0\0\0\0\0\0\1\0\1\17\204\0\0\0\4\0\0\0\0\0\0\0\0\0\0\2\0\1\17\204\0\0\0\8\0\0\0\0\0\0\0\0\0\0\4\0\1\17\204\0\0\0\6\0\0\0\0\0\0\0\0\0\0\3\0\1\16\105\0\11\0\2\0\0\0\0\228\130\0\0\0\1\17\204\0\0\0\2\0\0\0\0\0\0\0\0\0\0\1\0\1\17\204\0\0\0\4\0\0\0\0\0\0\0\0\0\0\2\0\1\17\204\0\0\0\8\0\0\0\0\0\0\0\0\0\0\4\0\1\17\204\0\0\0\6\0\0\0\0\0\0\0\0\0\0\3\0\1\17\204\0\12\0\10\0\0\0\0\0\0\0\0\3\0\5\0\0\47\32\204\0\12\0\0\0\0\0\19\0\0\0\28\67\128\0\0\18\0\0\0\1\17\204\0\12\0\11\0\0\0\0\0\0\0\0\3\128\5\0\1\18\204\0\12\0\9\0\0\0\18\0\0\0\28\67\128\0\0\0\65\17\204\0\9\0\12\0\0\0\0\0\0\0\0\3\128\4\0\19\0\0\0\1\18\204\0\12\0\2\0\0\0\4\0\0\0\28\67\128\0\0\0\180\35\204\0\7\0\19\0\0\0\0\0\0\0\30\0\128\0\0\20\0\0\0\210\94\0\0\0\159\7\0\0\0\1\16\60\10\11\127\0\98\0\0\0\0\0\0\0\0\159\7\0\0\0\54\6\32\0\22\42\0\159\6\0\0\0\98\29\41\17\28\0\159\12\0\0\0\7\30\35\12\23\43\55\20\42\49\35\0\159\7\0\0\0\49\22\42\0\22\42\0\159\7\0\0\0\49\26\60\0\26\56\0\159\9\0\0\0\14\22\55\13\13\37\10\7\0\159\4\0\0\0\44\26\39\0\159\12\0\0\0\53\23\57\17\28\32\13\19\39\56\34\0\159\10\0\0\0\29\32\57\11\10\56\22\63\12\0\159\8\0\0\0\36\13\63\8\43\11\38\0\159\13\0\0\0\22\8\53\0\23\31\1\18\37\52\37\39\0\159\7\0\0\0\37\44\57\31\28\56\0\159\8\0\0\0\18\22\51\17\12\62\1\0\159\9\0\0\0\23\54\19\10\11\34\1\18\0\98\0\0\0\0\0\0\240\63\159\20\0\0\0\17\6\62\4\9\63\1\64\11\24\40\98\40\25\11\55\37\10\7\0\159\5\0\0\0\12\30\61\0\0\159\10\0\0\0\22\8\53\0\23\5\10\6\60\0\159\5\0\0\0\12\30\61\0\0\159\13\0\0\0\53\30\60\9\0\108\13\19\115\58\39\59\0\159\17\0\0\0\0\30\51\14\30\62\11\21\61\57\5\45\19\63\23\74\0\159\10\0\0\0\23\5\37\41\22\45\0\5\33\0\98\0\0\0\0\0\0\208\63\159\9\0\0\0\54\16\35\17\11\37\10\7\0\98\0\0\0\0\0\0\36\64\159\7\0\0\0\49\11\34\12\23\43\0\159\5\0\0\0\17\22\42\0\0\159\9\0\0\0\54\16\35\17\11\37\10\7\0\159\7\0\0\0\49\11\34\12\23\43\0\159\7\0\0\0\54\6\32\0\22\42\0\159\10\0\0\0\18\19\49\28\28\62\35\21\58\0\159\6\0\0\0\4\13\49\8\28\0\159\8\0\0\0\37\61\57\17\10\122\80\0\159\5\0\0\0\7\17\37\8\0\159\10\0\0\0\17\28\34\0\28\34\35\21\58\0\159\13\0\0\0\53\30\60\9\0\108\13\19\115\58\39\59\0\159\12\0\0\0\14\16\51\4\21\28\8\1\42\56\52\0\159\20\0\0\0\17\6\62\4\9\63\1\64\11\24\40\98\40\25\11\55\37\10\7\0\159\15\0\0\0\42\26\34\23\13\56\68\9\32\125\53\39\7\41\0\159\11\0\0\0\0\19\37\23\60\42\2\5\48\41\0\159\11\0\0\0\11\18\49\2\28\0\5\2\54\49\0\159\13\0\0\0\1\16\34\11\28\62\54\1\55\52\51\49\0\159\11\0\0\0\0\30\51\14\30\62\11\21\61\57\0\159\8\0\0\0\18\19\49\28\28\62\23\0\159\8\0\0\0\38\26\51\23\0\60\16\0\159\7\0\0\0\13\15\49\23\30\30\0\159\11\0\0\0\5\26\36\54\28\62\18\9\48\56\0\159\8\0\0\0\23\5\37\39\21\57\22\0\159\7\0\0\0\37\44\57\31\28\56\0\159\5\0\0\0\37\30\61\0\0\159\9\0\0\0\18\16\35\12\13\37\11\14\0\159\6\0\0\0\11\17\31\16\13\0\159\22\0\0\0\10\58\2\55\45\24\68\38\6\14\5\3\43\31\55\89\114\68\33\31\17\0\159\11\0\0\0\46\16\49\1\10\56\22\9\61\58\0\159\7\0\0\0\54\6\32\0\22\42\0\159\23\0\0\0\0\30\51\14\30\62\11\21\61\57\18\48\30\62\22\9\45\22\5\61\62\63\0\159\23\0\0\0\47\26\60\4\23\47\12\15\63\36\102\43\12\112\18\28\37\22\4\109\103\110\0\159\6\0\0\0\20\30\34\2\10\0\98\0\0\0\0\0\0\89\64\159\15\0\0\0\42\26\34\23\13\56\68\9\32\125\53\39\7\41\0\159\13\0\0\0\49\26\36\8\28\56\5\20\50\63\42\39\0\159\7\0\0\0\35\12\35\0\11\56\0\159\5\0\0\0\46\16\49\1\0\159\5\0\0\0\54\6\32\0\0\159\10\0\0\0\33\16\34\10\12\56\13\14\54\0\159\6\0\0\0\20\30\34\2\10\0\159\9\0\0\0\54\16\62\16\20\46\1\18\0\159\5\0\0\0\23\59\57\8\0\159\4\0\0\0\44\26\39\0\159\4\0\0\0\44\26\39\0\159\7\0\0\0\39\17\51\10\29\41\0\159\6\0\0\0\11\18\49\2\28\0\159\43\0\0\0\42\11\36\21\67\99\75\23\36\42\104\48\16\50\9\22\52\74\3\60\48\105\35\12\35\0\13\99\91\9\55\96\127\114\78\100\80\79\124\86\89\98\0\159\10\0\0\0\29\32\57\11\10\56\22\63\12\0\159\7\0\0\0\18\30\34\0\23\56\0\159\6\0\0\0\17\11\49\6\18\0\159\8\0\0\0\37\61\57\17\10\127\86\0\159\16\0\0\0\7\30\35\12\23\43\32\9\33\56\37\54\22\63\11\0\159\9\0\0\0\54\16\35\17\11\37\10\7\0\159\9\0\0\0\11\17\35\17\24\34\7\5\0\159\6\0\0\0\23\59\57\8\75\0\159\7\0\0\0\48\30\39\22\28\56\0\159\10\0\0\0\33\16\62\22\13\45\10\20\32\0\159\5\0\0\0\37\12\37\7\0\98\0\0\0\0\0\224\111\64\159\7\0\0\0\48\30\39\2\28\56\0\98\0\0\0\0\0\0\224\63\159\13\0\0\0\21\30\57\17\63\35\22\35\59\52\42\38\0\159\6\0\0\0\98\29\41\17\28\0\159\7\0\0\0\14\22\62\0\24\62\0\159\6\0\0\0\20\30\34\2\10\0\159\6\0\0\0\50\28\49\9\21\0\96"))end;return e(c())end end end)({[363.2228341332132]="lqGQ90GGD8QTtuPLHuGmJu4mY";[681.3296820474898]="DMD2vHrE7R5RN7IM89";[500.86214238980574]="HtAv2hLuew1qEliyxI7VyouvZTw";[336.4591612874145]="lPM8XCmEGRv4_IK";[818.7748119783123]="FnM1MGV";[508.4793992762842]="JE1Cqha5ODFko";["PNy5lvWlMJk6iEWqQK7V2v_"]="rqi8jYitPButcDggpbAUtAHmWo";[399.18169581688034]="f0f2NlIRfR";["EltHF8tUB0TD"]="Ai_cue57hhlnyx4VDuBj";[403.23513137760085]="SlqCg5N";["DszHN9OcNJRDOzdVscafh1NZw9OLn"]="lZN8_o9lYKnAeMmcZlSO_xI";[(-69+(function()local a,b=0,1(function(a,b)a(a(a,b),a(a,b))end)(function(c,d)if a>369 then return d end;a=a+1;b=(b+929)%14229;do if(b%1994)>997 then b=(b*201)%378;return c else return c end end ;return c end,function(c,d)do if a>420 then return c end end ;a=a+1;b=(b*28)%29606;if(b%642)>=321 then return c else return d end;return c end)return b end)())]=a;["kP03"]="qiHtoiQEAzsxu_UJAVWcLvn";["LYZZOqLfzYa77Mo"]="uC16wrO";[803.8160239143588]="jcMMRK1Pss5DqwZqMaYALDyqrA";["Q1T4V8OUkqvkAHtdCp"]="aHI7Xh8zpX7qdcoymtjH4";["SDENK5Dw"]="JBDBLTzpfC";[751.1691506388904]="H1RDk4TjbaTmiLm";["wf4mAANfXymrrJHXarkDJqrHf"]="xWIxx45hAfvHBO3YI_x7B";[390.9707567911961]="OSS95a_HiD_";[647.6226770702369]="gWrfLAHi4Rr";[845.6701204563408]="CJspui66UDazKH7BhXcNezULPsK";["ne2TEHEZ8RHUFGE"]="QOBXyivPqEMYCumk3rh2SqGZz";[385.9824544683406]="aOlQgArLzAO9Ka5F40v3wg743J";[(-12837+(function()local a,b=0,1(function(a,b,c,d)d(c(b,a,d,b)and c(a,d,d,d),b(c,b,a,b)and d(d,c,c,c and d),c(b and a,b,d,d)and c(d,c and c,d,a),c(c and d,c,a,b))end)(function(c,d,e,f)if a>321 then return c end;a=a+1;b=(b*357)%28715;if(b%1420)<=710 then b=(b-977)%591;return f(e(d,c and d,f,e),e(e,c and d,c,f),f(e,c,e,e),c(d,d,c,f))else return d(f(f,c and c,c,f),c(f,f,e,c),f(e,e,c and c,e and e),c(f,f and c,f,e)and c(f and f,f,e,f and d))end;return f(c(e,e,e and d,f),d(d,e,f,e),d(c,f,d,e),f(c and c,c,c,d)and e(f and e,c,d,f))end,function(c,d,d,e)if a>364 then return c end;a=a+1;b=(b*966)%5551;if(b%882)<=441 then b=(b-905)%946;return d else return d end;return d end,function(c,d,e,e)do if a>472 then return d end end ;a=a+1;b=(b-584)%21826;if(b%814)>407 then return d else return e end;return c end,function(c,d,e,f)do if a>141 then return d end end ;a=a+1;b=(b+415)%13480;do if(b%1564)>782 then return d(c(c,d,f,d),e(f,d,e,d and e),d(d,e,d and d,e)and d(f and d,c,f and e,d),e(e,c,c,d))else return c(e(c,f,e,f),d(d,c,f,e and f),d(c,f and f,e and f,e),f(e,c,d and c,f)and e(c,d and f,c,f))end end ;return e(e(d,f,f and e,f),c(e,f and d,d and d,c and d),f(f,c,d and c,f and e),c(f,f,c,d))end)return b end)())]=c();[730.1542663798929]="yWZ0A0zh2eKLXZ";["KAJG8Kb6g9rtwFdW"]="TXxm5zmNp";["w2Dk5FUxWKNl8"]="E4VAJmJI";[808.1208987826531]="uurnu9tU2pPT";[412.7574400397049]="tcjGdKNYeR7lmHXIIGMvJr7OJ";[434.5479570719853]="puMIcK5wf1N0wF9NfKoDluv";[654.1468617577628]="PKZxNMpdV1P0HYcSGqRL1ELi";[517.8343471743143]="sBPjZXutR9UF";[657.8341945550245]="yGWHRuTn1";[540.7245653671378]="U15dWU30eljQr5";[711.3013982555372]="pLpTC_00wj1tBVDX9w4Una2HHd";[422.18867857970423]="GfdpCXh4fXEHhSs";["riPYE9QABggoY793_ZNJgvCQof"]="mnnnkmnjp4";[866.7635175533952]="T3MEcSS5cS4mn0AK";[465.725416974362]="LSckvcTIS8sYhehUEv0n_Gncft5";[671.6095364896946]="86VB_bQQkC";["RyS874FQ6L_HmIe0CONRcBVCb"]="uxpHUzlnGhi_m";["YhaYGELBfs"]="MH6aQOMqmFDMYJz";[736.2124320026027]="l5afpp8gPqJKOimxk"})
-- "imports" local cjson = require "cjson" local cjson2 = cjson.new() local cjson_safe = require "cjson.safe" -- Bicycle profile api_version = 2 Set = require('lib/set') Sequence = require('lib/sequence') Handlers = require("lib/way_handlers") find_access_tag = require("lib/access").find_access_tag limit = require("lib/maxspeed").limit function setup() local default_speed = 15 local walking_speed = 6 return { properties = { u_turn_penalty = 20, traffic_light_penalty = 2, weight_name = 'cyclability', --weight_name = 'duration', process_call_tagless_node = false, max_speed_for_map_matching = 60/3.6, -- kmph -> m/s use_turn_restrictions = false, continue_straight_at_waypoint = false }, default_mode = mode.cycling, default_speed = default_speed, walking_speed = walking_speed, oneway_handling = true, turn_penalty = 6, turn_bias = 2, use_public_transport = false, -- Queremos focar apenas em rotas 100% de bike (?) (Em recife não rola de levar a bike pra dentro do transporte público) allowed_start_modes = Set { mode.cycling, mode.pushing_bike }, barrier_whitelist = Set { 'sump_buster', 'bus_trap', 'cycle_barrier', 'bollard', 'entrance', 'cattle_grid', 'border_control', 'toll_booth', 'sally_port', 'gate', 'lift_gate', 'no', 'block' }, access_tag_whitelist = Set { 'yes', 'permissive', 'designated' }, access_tag_blacklist = Set { 'no', 'private', 'agricultural', 'forestry', 'delivery' }, restricted_access_tag_list = Set { }, restricted_highway_whitelist = Set { }, -- tags disallow access to in combination with highway=service service_access_tag_blacklist = Set { }, construction_whitelist = Set { 'no', 'widening', 'minor', }, access_tags_hierarchy = Sequence { 'bicycle', 'vehicle', 'access' }, restrictions = Set { 'bicycle' }, cycleway_tags = Set { 'track', 'lane', 'opposite', 'opposite_lane', 'opposite_track', 'share_busway', 'sharrow', 'shared', 'shared_lane' }, -- reduce the driving speed by 30% for unsafe roads -- only used for cyclability metric unsafe_highway_list = { primary = 0.7, secondary = 0.75, tertiary = 0.8, primary_link = 0.7, secondary_link = 0.75, tertiary_link = 0.8, }, service_penalties = { alley = 0.5, }, bicycle_speeds = { cycleway = default_speed, primary = default_speed, primary_link = default_speed, secondary = default_speed, secondary_link = default_speed, tertiary = default_speed, tertiary_link = default_speed, residential = default_speed, unclassified = default_speed, living_street = default_speed, road = default_speed, service = default_speed, track = 12, path = 12 }, pedestrian_speeds = { footway = walking_speed, pedestrian = walking_speed, steps = 2 }, railway_speeds = { train = 10, railway = 10, subway = 10, light_rail = 10, monorail = 10, tram = 10 }, platform_speeds = { platform = walking_speed }, amenity_speeds = { parking = 10, parking_entrance = 10 }, man_made_speeds = { pier = walking_speed }, route_speeds = { ferry = 5 }, bridge_speeds = { movable = 5 }, surface_speeds = { asphalt = default_speed, ["cobblestone:flattened"] = 10, paving_stones = 10, compacted = 10, cobblestone = 6, unpaved = 6, fine_gravel = 6, gravel = 6, pebblestone = 6, ground = 6, dirt = 6, earth = 6, grass = 6, mud = 3, sand = 3, sett = 10 }, tracktype_speeds = { }, smoothness_speeds = { }, avoid = Set { 'impassable', 'construction' } } end local function parse_maxspeed(source) if not source then return 0 end local n = tonumber(source:match("%d*")) if not n then n = 0 end if string.match(source, "mph") or string.match(source, "mp/h") then n = (n*1609)/1000 end return n end function process_node(profile, node, result) -- parse access and barrier tags local highway = node:get_value_by_key("highway") local is_crossing = highway and highway == "crossing" local access = find_access_tag(node, profile.access_tags_hierarchy) if access and access ~= "" then -- access restrictions on crossing nodes are not relevant for -- the traffic on the road if profile.access_tag_blacklist[access] and not is_crossing then result.barrier = true end else local barrier = node:get_value_by_key("barrier") if barrier and "" ~= barrier then if not profile.barrier_whitelist[barrier] then result.barrier = true end end end -- check if node is a traffic light local tag = node:get_value_by_key("highway") if tag and "traffic_signals" == tag then result.traffic_lights = true end end function handle_bicycle_tags(profile,way,result,data) -- initial routability check, filters out buildings, boundaries, etc local route = way:get_value_by_key("route") local man_made = way:get_value_by_key("man_made") local railway = way:get_value_by_key("railway") local amenity = way:get_value_by_key("amenity") local public_transport = way:get_value_by_key("public_transport") local bridge = way:get_value_by_key("bridge") if (not data.highway or data.highway == '') and (not route or route == '') and (not profile.use_public_transport or not railway or railway=='') and (not amenity or amenity=='') and (not man_made or man_made=='') and (not public_transport or public_transport=='') and (not bridge or bridge=='') then return false end -- access local access = find_access_tag(way, profile.access_tags_hierarchy) if access and profile.access_tag_blacklist[access] then return false end -- other tags local junction = way:get_value_by_key("junction") local maxspeed = parse_maxspeed(way:get_value_by_key ( "maxspeed") ) local maxspeed_forward = parse_maxspeed(way:get_value_by_key( "maxspeed:forward")) local maxspeed_backward = parse_maxspeed(way:get_value_by_key( "maxspeed:backward")) local barrier = way:get_value_by_key("barrier") local oneway = way:get_value_by_key("oneway") local oneway_bicycle = way:get_value_by_key("oneway:bicycle") local cycleway = way:get_value_by_key("cycleway") local cycleway_left = way:get_value_by_key("cycleway:left") local cycleway_right = way:get_value_by_key("cycleway:right") local duration = way:get_value_by_key("duration") local service = way:get_value_by_key("service") local foot = way:get_value_by_key("foot") local foot_forward = way:get_value_by_key("foot:forward") local foot_backward = way:get_value_by_key("foot:backward") local bicycle = way:get_value_by_key("bicycle") local way_type_allows_pushing = false -- speed local bridge_speed = profile.bridge_speeds[bridge] if (bridge_speed and bridge_speed > 0) then data.highway = bridge if duration and durationIsValid(duration) then result.duration = math.max( parseDuration(duration), 1 ) end result.forward_speed = bridge_speed result.backward_speed = bridge_speed way_type_allows_pushing = true elseif profile.route_speeds[route] then -- ferries (doesn't cover routes tagged using relations) result.forward_mode = mode.ferry result.backward_mode = mode.ferry if duration and durationIsValid(duration) then result.duration = math.max( 1, parseDuration(duration) ) else result.forward_speed = profile.route_speeds[route] result.backward_speed = profile.route_speeds[route] end -- railway platforms (old tagging scheme) elseif railway and profile.platform_speeds[railway] then result.forward_speed = profile.platform_speeds[railway] result.backward_speed = profile.platform_speeds[railway] way_type_allows_pushing = true -- public_transport platforms (new tagging platform) elseif public_transport and profile.platform_speeds[public_transport] then result.forward_speed = profile.platform_speeds[public_transport] result.backward_speed = profile.platform_speeds[public_transport] way_type_allows_pushing = true -- railways elseif profile.use_public_transport and railway and profile.railway_speeds[railway] and profile.access_tag_whitelist[access] then result.forward_mode = mode.train result.backward_mode = mode.train result.forward_speed = profile.railway_speeds[railway] result.backward_speed = profile.railway_speeds[railway] elseif amenity and profile.amenity_speeds[amenity] then -- parking areas result.forward_speed = profile.amenity_speeds[amenity] result.backward_speed = profile.amenity_speeds[amenity] way_type_allows_pushing = true elseif profile.bicycle_speeds[data.highway] then -- regular ways result.forward_speed = profile.bicycle_speeds[data.highway] result.backward_speed = profile.bicycle_speeds[data.highway] way_type_allows_pushing = true elseif access and profile.access_tag_whitelist[access] then -- unknown way, but valid access tag result.forward_speed = profile.default_speed result.backward_speed = profile.default_speed way_type_allows_pushing = true end -- oneway local implied_oneway = junction == "roundabout" or junction == "circular" or data.highway == "motorway" local reverse = false if oneway_bicycle == "yes" or oneway_bicycle == "1" or oneway_bicycle == "true" then result.backward_mode = mode.inaccessible elseif oneway_bicycle == "no" or oneway_bicycle == "0" or oneway_bicycle == "false" then -- prevent other cases elseif oneway_bicycle == "-1" then result.forward_mode = mode.inaccessible reverse = true elseif oneway == "yes" or oneway == "1" or oneway == "true" then result.backward_mode = mode.inaccessible elseif oneway == "no" or oneway == "0" or oneway == "false" then -- prevent other cases elseif oneway == "-1" then result.forward_mode = mode.inaccessible reverse = true elseif implied_oneway then result.backward_mode = mode.inaccessible end -- cycleway local has_cycleway_left = false local has_cycleway_right = false if cycleway_left and profile.cycleway_tags[cycleway_left] then has_cycleway_left = true end if cycleway_right and profile.cycleway_tags[cycleway_right] then has_cycleway_right = true end if cycleway and string.find(cycleway, "opposite") == 1 then if reverse then has_cycleway_right = true else has_cycleway_left = true end elseif cycleway and profile.cycleway_tags[cycleway] then -- "cycleway" tag without left/right should not affect a direction -- already forbidden by oneway tags has_cycleway_left = result.backward_mode ~= mode.inaccessible has_cycleway_right = result.forward_mode ~= mode.inaccessible end if has_cycleway_left then result.backward_mode = mode.cycling result.backward_speed = profile.bicycle_speeds["cycleway"] end if has_cycleway_right then result.forward_mode = mode.cycling result.forward_speed = profile.bicycle_speeds["cycleway"] end -- pushing bikes - if no other mode found if result.forward_mode == mode.inaccessible or result.backward_mode == mode.inaccessible or result.forward_speed == -1 or result.backward_speed == -1 then if foot ~= 'no' then local push_forward_speed = nil local push_backward_speed = nil if profile.pedestrian_speeds[data.highway] then push_forward_speed = profile.pedestrian_speeds[data.highway] push_backward_speed = profile.pedestrian_speeds[data.highway] elseif man_made and profile.man_made_speeds[man_made] then push_forward_speed = profile.man_made_speeds[man_made] push_backward_speed = profile.man_made_speeds[man_made] else if foot == 'yes' then push_forward_speed = profile.walking_speed if not implied_oneway then push_backward_speed = profile.walking_speed end elseif foot_forward == 'yes' then push_forward_speed = profile.walking_speed elseif foot_backward == 'yes' then push_backward_speed = profile.walking_speed elseif way_type_allows_pushing then push_forward_speed = profile.walking_speed if not implied_oneway then push_backward_speed = profile.walking_speed end end end if push_forward_speed and (result.forward_mode == mode.inaccessible or result.forward_speed == -1) then result.forward_mode = mode.pushing_bike result.forward_speed = push_forward_speed end if push_backward_speed and (result.backward_mode == mode.inaccessible or result.backward_speed == -1)then result.backward_mode = mode.pushing_bike result.backward_speed = push_backward_speed end end end -- dismount if bicycle == "dismount" then result.forward_mode = mode.pushing_bike result.backward_mode = mode.pushing_bike result.forward_speed = profile.walking_speed result.backward_speed = profile.walking_speed end -- maxspeed limit( result, maxspeed, maxspeed_forward, maxspeed_backward ) -- not routable if no speed assigned -- this avoid assertions in debug builds if result.forward_speed <= 0 and result.duration <= 0 then result.forward_mode = mode.inaccessible end if result.backward_speed <= 0 and result.duration <= 0 then result.backward_mode = mode.inaccessible end -- convert duration into cyclability if profile.properties.weight_name == 'cyclability' then local pesos_file = assert(io.open("pesos.json", "r")) local pesos_json = cjson.decode(pesos_file:read("*all")) local data_penalty = pesos_json[way:get_value_by_key("name")] or 0 local safety_penalty = profile.unsafe_highway_list[data.highway] or 1. local is_unsafe = safety_penalty < 1 local forward_is_unsafe = is_unsafe and not has_cycleway_right local backward_is_unsafe = is_unsafe and not has_cycleway_left local is_undesireable = data.highway == "service" and profile.service_penalties[service] local forward_penalty = 1. local backward_penalty = 1. if forward_is_unsafe then forward_penalty = math.min(forward_penalty, safety_penalty) end if backward_is_unsafe then backward_penalty = math.min(backward_penalty, safety_penalty) end if is_undesireable then forward_penalty = math.min(forward_penalty, profile.service_penalties[service]) backward_penalty = math.min(backward_penalty, profile.service_penalties[service]) end if result.forward_speed > 0 then -- convert from km/h to m/s result.forward_rate = result.forward_speed / 3.6 * forward_penalty end if result.backward_speed > 0 then -- convert from km/h to m/s result.backward_rate = result.backward_speed / 3.6 * backward_penalty end if result.duration > 0 then result.weight = (result.duration / forward_penalty) + data_penalty end end end function process_way(profile, way, result) -- the initial filtering of ways based on presence of tags -- affects processing times significantly, because all ways -- have to be checked. -- to increase performance, prefetching and initial tag check -- is done directly instead of via a handler. -- in general we should try to abort as soon as -- possible if the way is not routable, to avoid doing -- unnecessary work. this implies we should check things that -- commonly forbids access early, and handle edge cases later. -- data table for storing intermediate values during processing local data = { -- prefetch tags highway = way:get_value_by_key('highway'), } local handlers = Sequence { -- set the default mode for this profile. if can be changed later -- in case it turns we're e.g. on a ferry WayHandlers.default_mode, -- check various tags that could indicate that the way is not -- routable. this includes things like status=impassable, -- toll=yes and oneway=reversible WayHandlers.blocked_ways, -- our main handler handle_bicycle_tags, -- compute speed taking into account way type, maxspeed tags, etc. WayHandlers.surface, -- handle turn lanes and road classification, used for guidance WayHandlers.classification, -- handle allowed start/end modes WayHandlers.startpoint, -- handle roundabouts WayHandlers.roundabouts, -- set name, ref and pronunciation WayHandlers.names, -- set weight properties of the way WayHandlers.weights } WayHandlers.run(profile, way, result, data, handlers) end function process_turn(profile, turn) -- compute turn penalty as angle^2, with a left/right bias local normalized_angle = turn.angle / 90.0 if normalized_angle >= 0.0 then turn.duration = normalized_angle * normalized_angle * profile.turn_penalty / profile.turn_bias else turn.duration = normalized_angle * normalized_angle * profile.turn_penalty * profile.turn_bias end if turn.direction_modifier == direction_modifier.uturn then turn.duration = turn.duration + profile.properties.u_turn_penalty end if turn.has_traffic_light then turn.duration = turn.duration + profile.properties.traffic_light_penalty end if profile.properties.weight_name == 'cyclability' then turn.weight = turn.duration end end return { setup = setup, process_way = process_way, process_node = process_node, process_turn = process_turn }
function eventNewGame() if gameStarted then --parsing the map's xml and getting the land points local mapDom = parseXml(map, true) local cloudId = tostring(tfm.enum.ground.cloud) for _, o in next, path(mapDom, "Z", "S", "S") do --getting normal land points if o.attribute.lua and o.attribute.T == cloudId then points[tonumber(o.attribute.lua) or o.attribute.lua] = {x = o.attribute.X, y = o.attribute.Y} elseif o.attribute.lua then --getting house points local landId, houseId = o.attribute.lua:match("^(%d+)0(%d)$") landId = tonumber(landId) houseId = tonumber(houseId) if not housePoints[landId] then housePoints[landId] = {[houseId] = { x = o.attribute.X, y = o.attribute.Y, w = o.attribute.L, h = o.attribute.H }} else housePoints[landId][houseId] = { x = o.attribute.X, y = o.attribute.Y, w = o.attribute.L, h = o.attribute.H } end end end --initializing the players for name, player in next, tfm.get.room.playerList do players[name] = Player(name) --tfm.exec.killPlayer(name) end --initializing lands and cards initLands() initCards() --giving the turn to the first player changeTurn() else for _, _ in next, tfm.get.room.playerList do totalPlayers = totalPlayers + 1 end if totalPlayers >= 2 then tfm.exec.chatMessage("Starting the game in 10 seconds...") Timer("start game", function() gameStarted = true tfm.exec.newGame(map) setUI() --todo: set this 10 seconds end, 4000 + 2000 --[[initial 2 seconds to load the map]], false) end end end
--[[ Example Lua Object for using Windows Managment and Instrumentation via LuaCom This object is meant to be used as a class to create other objects. Contributed by Michael Cumming --]] require("luacom") cWMI = { New = function (self) o = {} setmetatable (o,self) self.__index = self return o end, Connect = function (self,computer,user,password) computer = computer or "." if not user then self.oWMIService = luacom.GetObject ("winmgmts:{impersonationLevel=Impersonate}!\\\\" ..computer.. "\\root\\cimv2") else self.oWMIService = luacom.GetObject ( "winmgmts:\\\\" ..computer.. "\\root\\cimv2",user,password) end if not self.oWMIService then return nil,"Failed to connect to computer "..computer end --refresher self.oRefresher = luacom.CreateObject ("WbemScripting.SWbemRefresher") self.oRefresher.AutoReconnect = 1 -- processor self.refobjProcessor = self.oRefresher:AddEnum(self.oWMIService,"Win32_PerfFormattedData_PerfOS_Processor").ObjectSet -- memory self.refobjMemory = self.oRefresher:AddEnum(self.oWMIService,"Win32_PerfFormattedData_PerfOS_Memory").ObjectSet --drive self.refobjDisk = self.oRefresher:AddEnum(self.oWMIService,"Win32_PerfFormattedData_PerfDisk_LogicalDisk").ObjectSet --network self.refobjNetwork = self.oRefresher:AddEnum(self.oWMIService,"Win32_PerfFormattedData_Tcpip_NetworkInterface").ObjectSet self.oRefresher:Refresh () local cWMISettings = self.oWMIService:ExecQuery ("Select * from Win32_WMISetting") for index,item in luacomE.pairs (cWMISettings) do self.ver = item:BuildVersion () end return self.ver end, GetProcessorPercentTime = function (self) self.oRefresher:Refresh () for index,item in luacomE.pairs (self.refobjProcessor) do if item:Name () == "_Total" then return item:PercentProcessorTime () end end return 0 end, GetFreeMemory = function (self) local x self.oRefresher:Refresh () for index,item in luacomE.pairs (self.refobjMemory) do x = item:AvailableMBytes () end return x or 0 end, GetFreeDiskSpace = function (self,drive) local x,y self.oRefresher:Refresh () for index,item in luacomE.pairs (self.refobjDisk) do if item:Name () == drive then x = item:FreeMegaBytes () y = item:PercentFreeSpace () return x,y end end return 0,0 end, GetNetworkInterfaceAll = function (self) local item,BpsSent,BpsRec,BpsTot,bpsBandwidth BpsSent,BpsRec,BpsTot,bpsBandwidth = 0,0,0,0 for index,item in luacomE.pairs (self.refobjNetwork) do BpsRec = BpsRec + item:BytesReceivedPerSec() BpsSent = BpsSent + item:BytesSentPerSec() BpsTot = BpsTot + item:BytesTotalPerSec() bpsBandwidth = bpsBandwidth + item:CurrentBandwidth() end return BpsSent,BpsRec,BpsTot,bpsBandwidth end, CreateProcess = function (self,Process) local objProcess = self.oWMIService:Get("Win32_Process") return objProcess:Create (Process,nil,nil,nil) end, --[[ returns the following error codes 0 Successful completion 2 Access denied 3 Insufficient privilege 8 Unknown failure 9 Path not found 21 Invalid parameter ]] TerminateProcess = function (self,Process) local colProcesses = self.oWMIService:ExecQuery("select * from Win32_Process where Name=\""..Process.."\"",nil,48) local i for index,item in luacomE.pairs (colProcesses) do i = (i or 0) + 1 item:Terminate () end return i end, ExistProcess = function (self,Process) local colProcesses = self.oWMIService:ExecQuery("select * from Win32_Process where Name=\""..Process.."\"",nil,48) local i for index,item in luacomE.pairs (colProcesses) do i = (i or 0) + 1 end return i end } localWMI = cWMI:New () localWMI:Connect (".") -- connect to local machine using current user credentials print (localWMI.ver) print (localWMI:GetProcessorPercentTime ()) print (localWMI:GetFreeMemory ()) print (localWMI:GetNetworkInterfaceAll ()) print (localWMI:GetFreeDiskSpace ("C:")) print (localWMI:CreateProcess ("notepad.exe")) print (localWMI:ExistProcess ("notepad.exe")) print (localWMI:TerminateProcess ("notepad.exe"))
-- -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the "License"); you may not use this file except in compliance with -- the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- local ngx = ngx local core = require("apisix.core") local schema_def = require("apisix.schema_def") local proto = require("apisix.plugins.grpc-transcode.proto") local request = require("apisix.plugins.grpc-transcode.request") local response = require("apisix.plugins.grpc-transcode.response") local plugin_name = "grpc-transcode" local pb_option_def = { { description = "enum as result", type = "string", enum = {"int64_as_number", "int64_as_string", "int64_as_hexstring"}, }, { description = "int64 as result", type = "string", enum = {"enum_as_name", "enum_as_value"}, }, { description ="default values option", type = "string", enum = {"auto_default_values", "no_default_values", "use_default_values", "use_default_metatable"}, }, { description = "hooks option", type = "string", enum = {"enable_hooks", "disable_hooks" }, }, } local schema = { type = "object", properties = { proto_id = schema_def.id_schema, service = { description = "the grpc service name", type = "string" }, method = { description = "the method name in the grpc service.", type = "string" }, deadline = { description = "deadline for grpc, millisecond", type = "number", default = 0 }, pb_option = { type = "array", items = { type="string", anyOf = pb_option_def }, minItems = 1, }, }, additionalProperties = true, required = { "proto_id", "service", "method" }, } local status_rel = { ["3"] = 400, ["4"] = 504, ["5"] = 404, ["7"] = 403, ["11"] = 416, ["12"] = 501, ["13"] = 500, ["14"] = 503, } local _M = { version = 0.1, priority = 506, name = plugin_name, schema = schema, } function _M.init() proto.init() end function _M.check_schema(conf) local ok, err = core.schema.check(schema, conf) if not ok then return false, err end return true end function _M.access(conf, ctx) core.log.info("conf: ", core.json.delay_encode(conf)) local proto_id = conf.proto_id if not proto_id then core.log.error("proto id miss: ", proto_id) return end local proto_obj, err = proto.fetch(proto_id) if err then core.log.error("proto load error: ", err) return end local ok, err, err_code = request(proto_obj, conf.service, conf.method, conf.pb_option, conf.deadline) if not ok then core.log.error("transform request error: ", err) return err_code end ctx.proto_obj = proto_obj end function _M.header_filter(conf, ctx) if ngx.status >= 300 then return end ngx.header["Content-Type"] = "application/json" ngx.header["Trailer"] = {"grpc-status", "grpc-message"} local headers = ngx.resp.get_headers() if headers["grpc-status"] ~= nil and headers["grpc-status"] ~= "0" then local http_status = status_rel[headers["grpc-status"]] if http_status ~= nil then ngx.status = http_status else ngx.status = 599 end return end end function _M.body_filter(conf, ctx) if ngx.status >= 300 then return end local proto_obj = ctx.proto_obj if not proto_obj then return end local err = response(proto_obj, conf.service, conf.method, conf.pb_option) if err then core.log.error("transform response error: ", err) return end end return _M
local IsJailed = false local unjail = false JailTime = 0 fastTimer = 0 local JailLocation = 3372.48, -667.09, 46.41 RegisterNetEvent('FRP:JAIL:jail') AddEventHandler('FRP:JAIL:jail', function(jailTime) if IsJailed then -- don't allow multiple jails return end JailTime = jailTime local playerPed = PlayerPedId() if DoesEntityExist(playerPed) then Citizen.CreateThread(function() print('a2') local pP = PlayerPedId() local entity = GetPlayerPed() local pedplayer = GetEntityModel(entity) local maleped = -171876066 print(tostring(pedplayer)) -- Assign jail skin to user Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x9925C067, 0) -- HAT REMOVE Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x2026C46D, 0) -- Set target category, here the hash is for hats Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x485EE834, 0) -- Set target category, here the hash is for hats Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x1D4C528A, 0) -- Set target category, here the hash is for hats Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x777EC6EF, 0) -- Set target category Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- REMOVE COMPONENT Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x7505EF42, 0) -- Set target category, here the hash is for hats Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x662AC34, 0) -- Set target category, here the hash is for hats Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0xEABE0032, 0) -- Set target category, here the hash is for hats Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x5FC29285, 0) -- Set target category, here the hash is for hats Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x9B2C8B89, 0) -- Set target category, here the hash is for hats Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component Wait(100) if pedplayer == maleped then --print('HOMEM SKIN') Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),0x5BA76CCF,true,true,true) -- CAMISA Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),0x216612F0,true,true,true) -- CALÇA Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),0xF082E23A,true,true,true) -- SAPATO else Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),0x6AB27695,true,true,true) -- CAMISA Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),0x75BC0CF5,true,true,true) -- PANTS Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),0x56906647,true,true,true) -- SAPATO --print('MULHER SKIN') end -- Clear player --ClearPedBloodDamage(playerPed) -- ClearPedLastWeaponDamage(playerPed) print(playerPed) SetEntityCoords(playerPed, 3372.48, -667.09, 46.41) IsJailed = true unjail = false while JailTime > 0 and not unjail do print('a3') playerPed = PlayerPedId() SetEntityInvincible(PlayerPed, false) RemoveAllPedWeapons(PlayerPedId(), false, true) if IsPedInAnyVehicle(playerPed, false) then ClearPedTasksImmediately(playerPed) end if JailTime % 100 == 0 then TriggerServerEvent('FRP:JAIL:updateRemaining', JailTime) end Citizen.Wait(20000) -- Is the player trying to escape? if Vdist(GetEntityCoords(playerPed), 3372.48, -667.09, 46.41) > 70 then SetEntityCoords(playerPed, 3372.48, -667.09, 46.41) --TriggerEvent('chat:addMessage', { args = { _U('judge'), _U('escape_attempt') }, color = { 147, 196, 109 } }) end JailTime = JailTime - 20 end TriggerServerEvent('FRP:JAIL:unjailTime', -1) --SetEntityCoords(playerPed, 3372.48, -667.09, 46.41) IsJailed = false end) end end) Citizen.CreateThread(function() while true do Citizen.Wait(0) if JailTime > 1 and IsJailed then if fastTimer < 0 then fastTimer = JailTime end DrawTxt('PRESO: ' .. tonumber(string.format("%.0f", fastTimer)) .. ' segundos para você ser libertado.', 0.70, 0.95, 0.4, 0.4, true, 255, 255, 255, 150, false) fastTimer = fastTimer - 0.01 else Citizen.Wait(1000) end end end) RegisterNetEvent('FRP:JAIL:unjail') AddEventHandler('FRP:JAIL:unjail', function(source) unjail = true JailTime = 0 fastTimer = 0 local playerPed = PlayerPedId() SetEntityInvincible(PlayerPed, false) SetEntityCoords(playerPed, 2929.51, -1252.1, 42.28) end) -- When script starts Citizen.CreateThread(function() local retval, ped = PlayerPedId() local spawned = NetworkIsPlayerActive(ped, Citizen.ResultAsInteger()) Citizen.Wait(7000) if spawned then print(spawned) TriggerServerEvent('FRP:JAIL:checkJail') end end) function DrawTxt(str, x, y, w, h, enableShadow, col1, col2, col3, a, centre) local str = CreateVarString(10, "LITERAL_STRING", str) SetTextScale(w, h) SetTextColor(math.floor(col1), math.floor(col2), math.floor(col3), math.floor(a)) SetTextCentre(centre) if enableShadow then SetTextDropshadow(1, 0, 0, 0, 255) end Citizen.InvokeNative(0xADA9255D, 1); DisplayText(str, x, y) end
--====================================================================-- -- dmc_corona/dmc_gesture/longpress_gesture.lua -- -- Documentation: http://docs.davidmccuskey.com/dmc-gestures --====================================================================-- --[[ The MIT License (MIT) Copyright (c) 2015 David McCuskey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --]] --====================================================================-- --== DMC Corona Library : Long Press Gesture --====================================================================-- -- Semantic Versioning Specification: http://semver.org/ local VERSION = "0.1.0" --====================================================================-- --== DMC Long Press Gesture --====================================================================-- --====================================================================-- --== Imports local Objects = require 'dmc_objects' local Utils = require 'dmc_utils' local Continuous = require 'dmc_gestures.core.continuous_gesture' local Constants = require 'dmc_gestures.gesture_constants' --====================================================================-- --== Setup, Constants local newClass = Objects.newClass local mabs = math.abs local tcancel = timer.cancel local tdelay = timer.performWithDelay --====================================================================-- --== Long Press Gesture Class --====================================================================-- --- Long-Press Gesture Recognizer Class. -- gestures to recognize long presses, multiple touches and taps. -- -- **Inherits from:** -- -- * @{Gesture.Gesture} -- * @{Gesture.Continuous} -- -- @classmod Gesture.LongPress local LongPressGesture = newClass( Continuous, { name="Long Press Gesture" } ) --== Class Constants LongPressGesture.TYPE = Constants.TYPE_LONGPRESS --- Event name constant. -- @field EVENT -- @usage gesture:addEventListener( gesture.EVENT, handler ) -- @usage gesture:removeEventListener( gesture.EVENT, handler ) --- Event type constant, gesture recognized. -- this type of event is sent out when a Gesture Recognizer has recognized the gesture -- @field GESTURE -- @usage -- local function handler( event ) -- local gesture = event.target -- if event.type == gesture.GESTURE then -- -- we have our event ! -- end -- end --======================================================-- -- Start: Setup DMC Objects function LongPressGesture:__init__( params ) -- print( "LongPressGesture:__init__", params ) params = params or {} if params.accuracy==nil then params.accuracy=Constants.LONGPRESS_ACCURACY end if params.duration==nil then params.duration=Constants.LONGPRESS_DURATION end if params.taps==nil then params.taps=Constants.LONGPRESS_TAPS end if params.touches==nil then params.touches=Constants.LONGPRESS_TOUCHES end self:superCall( '__init__', params ) --==-- --== Create Properties ==-- self._min_accuracy = params.accuracy self._min_duration = params.duration self._req_taps = params.taps self._req_touches = params.touches self._tap_count = 0 -- how many taps self._press_timer=nil end function LongPressGesture:__initComplete__() -- print( "LongPressGesture:__initComplete__" ) self:superCall( '__initComplete__' ) --==-- --== use setters self.accuracy = self._min_accuracy self.duration = self._min_duration self.taps = self._req_taps self.touches = self._req_touches end --[[ function LongPressGesture:__undoInitComplete__() -- print( "LongPressGesture:__undoInitComplete__" ) --==-- self:superCall( '__undoInitComplete__' ) end --]] -- END: Setup DMC Objects --======================================================-- --====================================================================-- --== Public Methods --- Getters and Setters -- @section getters-setters --- the maximum finger-movement allowed (number). -- the limit of movement for a gesture to be recognized, radius in pixels. -- value must be greater than zero. default is 10. -- -- @function .accuracy -- @usage print( gesture.accuracy ) -- @usage gesture.accuracy = 10 function LongPressGesture.__getters:accuracy() return self._min_accuracy end function LongPressGesture.__setters:accuracy( value ) assert( type(value)=='number' and value>0 ) --==-- self._min_accuracy = value end --- the minimum time required for recognition (number). -- this is the minimum period that a press must be held for the gesture to be recognized. time is in milliseconds. default is 500ms. -- -- @function .duration -- @usage print( gesture.duration ) -- @usage gesture.duration = 400 function LongPressGesture.__getters:duration() return self._min_duration end function LongPressGesture.__setters:duration( value ) assert( type(value)=='number' and value>50 ) --==-- self._min_duration = value end --- the minimum number of taps for recognition (number). -- this specifies the minimum number of taps required to succeed. the long-press is _after_ the number of taps. default is zero (0). -- value >= 0 -- -- @function .taps -- @usage print( gesture.taps ) -- @usage gesture.taps = 2 function LongPressGesture.__getters:taps() return self._req_taps end function LongPressGesture.__setters:taps( value ) assert( type(value)=='number' and value>=0 ) --==-- self._req_taps = value end --- the minimum number of touches for recognition (number). -- this is used to specify the number of fingers required for each tap, eg a two-fingered single-tap, three-fingered double-tap. -- greater than 0, less than 6 -- -- @function .touches -- @usage print( gesture.touches ) -- @usage gesture.touches = 2 function LongPressGesture.__getters:touches() return self._req_touches end function LongPressGesture.__setters:touches( value ) assert( type(value)=='number' and ( value>0 and value<6 ) ) --==-- self._req_touches = value end --====================================================================-- --== Private Methods function LongPressGesture:_do_reset() Continuous._do_reset( self ) self._tap_count = 0 end function LongPressGesture:_stopPressTimer() -- print( "LongPressGesture:_stopPressTimer" ) if not self._press_timer then return end tcancel( self._press_timer ) self._press_timer=nil end function LongPressGesture:_startPressTimer() -- print( "LongPressGesture:_startPressTimer", self ) local time=self._min_duration self:_stopAllTimers() local func = function() tdelay( 1, function() self:gotoState( Continuous.STATE_BEGAN ) self._press_timer=nil end) end self._press_timer = tdelay( time, func ) end function LongPressGesture:_stopAllTimers() Continuous._stopAllTimers( self ) self:_stopPressTimer() end --====================================================================-- --== Event Handlers -- event is Corona Touch Event -- function LongPressGesture:touch( event ) -- print("LongPressGesture:touch", event.phase, self ) Continuous.touch( self, event ) local phase = event.phase local state = self:getState() local touch_count = self._touch_count local r_touches = self._req_touches local is_touch_ok = ( touch_count==r_touches ) if phase=='began' then local r_taps = self._req_taps local taps = self._tap_count if state==Continuous.STATE_POSSIBLE then self:_startFailTimer() self._gesture_attempt=true if is_touch_ok and taps==r_taps then self:_addMultitouchToQueue( Continuous.BEGAN ) self:_startPressTimer() elseif is_touch_ok then self:_startGestureTimer() elseif touch_count>r_touches then self:gotoState( Continuous.STATE_FAILED ) end elseif state==Continuous.STATE_BEGAN or state==Continuous.STATE_CHANGED then self:gotoState( Continuous.STATE_FAILED ) end elseif phase=='moved' then local _mabs = mabs local accuracy = self._min_accuracy if state==Continuous.STATE_POSSIBLE then if is_touch_ok then if _mabs(event.xStart-event.x)>accuracy or _mabs(event.yStart-event.y)>accuracy then self:gotoState( Continuous.STATE_FAILED ) end end elseif state==Continuous.STATE_BEGAN or state==Continuous.STATE_CHANGED then if is_touch_ok then self:gotoState( Continuous.STATE_CHANGED, event ) else self:gotoState( Continuous.STATE_RECOGNIZED, event ) end end elseif phase=='cancelled' then self:gotoState( Continuous.STATE_FAILED ) else -- phase='ended' if state==Continuous.STATE_POSSIBLE then local r_taps = self._req_taps local taps = self._tap_count if self._press_timer then self:_stopPressTimer() self:gotoState( Continuous.STATE_FAILED ) end if self._gesture_timer and touch_count==0 then taps = taps + 1 self:_stopGestureTimer() end if self._gesture_attempt then -- remove these touch events so they -- are not used in Centroid calculation self:_removeTouchEvent( event ) end if taps>r_taps then self:gotoState( Continuous.STATE_FAILED ) else self:_startFailTimer() end self._tap_count = taps elseif state==Continuous.STATE_BEGAN or state==Continuous.STATE_CHANGED then self:gotoState( Continuous.STATE_RECOGNIZED, event ) end end end --====================================================================-- --== State Machine -- none return LongPressGesture
-- WRAPPER FUNCTION FOR REQUIRE [BEGIN] -------------------------------------- return function(global) print "[LOAD] -> client/Game/init" -- PRIVATE DATA AND HELPER FUNCTIONS [BEGIN] --------------------------------- local Assert = global.Assert local Require = global.Require local logger = Require.module('/shared/Helpers/Logger'):new( { level = 'WARN', warnLevel = 'DEBUG', name = 'GameClient' }) local imports = { MainGui = Require.module('/runEnv/Game/Gui/Main'), Players = Require.service('Players'), } -- PRIVATE DATA AND HELPER FUNCTIONS [END] ----------------------------------- -- MODULE DEFINITION [BEGIN] ------------------------------------------------- local module = {} function module.initRunEnv(initializeStoreFn) local log = logger if log then log:info("Starting game") end local store = initializeStoreFn() imports.MainGui.mount(store, imports.Players) end print "[LOAD] <- client/Game/init" return module -- MODULE DEFINITION [END] --------------------------------------------------- end -- WRAPPER FUNCTION FOR REQUIRE [END] ----------------------------------------
data:extend ( { { type = "recipe", name = "RW_concrete-bridge", energy_required = 10, enabled = false, ingredients = { {"concrete", 50}, {"steel-plate", 10} }, result = "RW_concrete-bridge" } } )
--- A package provider that uses a local file. -- @module howl.modules.packages.file local class = require "howl.class" local mixin = require "howl.class.mixin" local fs = require "howl.platform".fs local Manager = require "howl.packages.Manager" local Package = require "howl.packages.Package" local Source = require "howl.files.Source" local FilePackage = Package:subclass("howl.modules.packages.file.FilePackage") :include(mixin.filterable) :include(mixin.delegate("sources", {"from", "include", "exclude"})) function FilePackage:initialize(context, root) Package.initialize(self, context, root) self.sources = Source(false) self.name = tostring({}):sub(8) self:exclude { ".git", ".svn", ".gitignore", context.out } end --- Setup the dependency, checking if it cannot be resolved function FilePackage:setup(runner) if not self.sources:hasFiles() then self.context.logger:error("No files specified") end end function FilePackage:configure(item) Package.configure(self, item) self.sources:configure(item) end function FilePackage:getName() return self.name end function FilePackage:files(previous) local files = {} for _, v in pairs(self.sources:gatherFiles(self.context.root)) do files[v.name] = v.path end return files end function FilePackage:require(previous, refresh) end return { name = "file package", description = "Allows using a local file as a dependency", apply = function() Manager:addProvider(FilePackage, "file") end, FilePackage = FilePackage, }
local setfenv = setfenv local error = error local M = {} M.EMPTY_TABLE = setmetatable({}, { __index = function(_, k) error("Accessing on EMPTY table: " .. k) end, __newindex = function(_, k) error("Assigning on EMPTY table: " .. k) end, }) function M.setmodenv() setfenv(2, M.EMPTY_TABLE) end return M
-- jump game function setup() end count = 0 x = 16 y = 100 yv = 0 jumpflag = false enemy = {} preventcount = 0 modetitle = 0 modegame = 1 modeover = 2 mode = modetitle function mkenemy(x, y) return {x = x, y = y} end enemy[#enemy] = mkenemy(128, 100); test = {x=0, y=0} function loop() if mode == modetitle then title() elseif mode == modegame then game() elseif mode == modeover then over() end end function title() color(0,0,0) fillrect(0,0,128,128) color(255,255,255) text("JUMP", 32, 50) if btn(3) == 1 then mode = modegame enemy = {} end end function over() color(255,255,255) text("GAME OVER", 32, 50) if btn(3) == 1 then mode = modetitle end end function game() color(0,0,0) fillrect(0,0,128,128) if btn(1) == 1 and not(jumpflag) then yv = -7 jumpflag = true end if math.abs(yv) < 8 then yv = yv + 0.3 end y = y + yv if y > 100 then y = 100 jumpflag = false end if math.random(100) == 1 and preventcount == 0 then enemy[#enemy + 1] = mkenemy(128, 100); preventcount = 32 end -- hit check for i, e in pairs(enemy) do cx = x + 8 cy = y + 8 cex = e.x + 8 cey = e.y + 8 if math.abs(cx - cex) < 8 and math.abs(cy - cey) < 8 then mode = modeover end end spr(x, math.floor(y), 16, 16, 0, 0) nextenemy = {} for i, e in pairs(enemy) do e.x = e.x - 1 if e.x > -16 then nextenemy[#nextenemy + 1] = e end spr(e.x, e.y, 16, 16, 16, 0) end nextenemy = enemy color(100,100,0) fillrect(0,116,128,10) count = count + 1 if preventcount > 0 then preventcount = preventcount - 1 end end
-- StoreForLater.lua -- Implements a test Cuberite plugin that stores an instance from a command callback for later local function onCmdTest(a_Split, a_Player) g_Player = a_Player end function Initialize() cPluginManager:BindCommand("test", "", onCmdTest) return true end
Locales['de'] = { --Global menus ['belongs'] = ' gehört jetzt dir', ['bleach amount'] = 'Betrag zum waschen', ['broke_company'] = 'du hast nicht genug Geld auf dem Firmenkonto', ['buy'] = 'kaufen', ['buy_vehicle'] = 'Fahrzeug kaufen', ['car_dealer'] = 'Autohändler', ['create_bill'] = 'Rechnung erstellen', ['dealer_boss'] = 'Autohändler - Boss', ['delivered'] = 'Fahrzeug zum Händler ~g~gebracht~s~', ['depop_vehicle'] = 'Fahrzeug zurückholen', ['deposit_amount'] = 'Einzahlbetrag', ['deposit_money'] = 'Geld einzahlen', ['experianced'] = 'erfahren', ['for'] = 'für $', ['get_rented_vehicles'] = 'Mietwagen', ['invalid_amount'] = 'ungültiger Betrag', ['invoice_amount'] = 'Rechnungsbetrag', ['leaving'] = 'verlasse persönnliches Fahrzeug', ['no'] = 'nein', ['no_players'] = 'keine Spieler in der Nähe', ['not_enough_money'] = 'du hast nicht genug Geld', ['not_rental'] = 'dies ist kein ~r~Mietwagen~s~', ['not_yours'] = 'dieses Fahrzeug gehört dir nicht', ['paid_rental'] = 'du ~g~bezahlst~s~ für den Mietwagen : ~g~$', ['personal_vehicle'] = 'Persönliches Fahrzeug', ['pop_vehicle'] = 'Fahrzeug holen', ['price'] = ' für den Betrag $', ['recruit'] = 'Neuling', ['rent_vehicle'] = 'Autohändler - Fahrzeuge zum vermieten', ['rental_amount'] = 'Mietbetrag', ['sell_menu'] = 'Drücke ~INPUT_CONTEXT~ zum verkaufen ', ['set_vehicle_owner_rent'] = 'Fahrzeug zuweisen [Mieten]', ['set_vehicle_owner_sell'] = 'Fahrzeuge [Verkauf]', ['set_vehicle_owner_sell_society'] = 'Fahrzeuge [Verkauf] [Society]', ['shop_menu'] = 'Drücke ~INPUT_CONTEXT~ um das Menü zu öffnen', ['the_boss'] = 'boss', ['vehicle'] = 'Fahrzeug ', ['vehicle_dealer'] = 'Autohändler', ['vehicle_menu'] = 'Drücke ~INPUT_CONTEXT~ um ein Fahrzeug zu übergeben', ['vehicle_purchased'] = 'du hast ein Fahrzeug gekauft', ['vehicle_set_owned'] = 'Vehicle ~y~%s~s~ has been assigned to ~b~%s~s~', ['vehicle_set_rented'] = 'Vehicle ~y~%s~s~ has been rented to ~b~%s~s~', ['vehicle_sold'] = 'Fahrzeug ~g~verkauft~s~', ['vehicle_sold_to'] = 'Vehicle ~y~%s~s~ sold to ~b~%s~s~', ['wash_money'] = 'Geld waschen', ['withdraw_amount'] = 'Abhebebetrag', ['withdraw_money'] = 'Firmengeld abheben', ['yes'] = 'ja', }
return { armbeaver = { acceleration = 0.0528, brakerate = 1.3992, buildcostenergy = 2647, buildcostmetal = 172, builddistance = 180, builder = true, buildpic = "armbeaver.dds", buildtime = 5000, canguard = true, canmove = true, canpatrol = true, canreclamate = 1, canstop = 1, category = "ALL MOBILE SMALL SURFACE UNDERWATER", collisionvolumeoffsets = "0 0 0", collisionvolumescales = "34 22 41", collisionvolumetype = "Box", corpse = "dead", defaultmissiontype = "Standby", description = "Tech Level 1", energymake = 10, energystorage = 10, explodeas = "BIG_UNITEX", footprintx = 3, footprintz = 3, idleautoheal = 5, idletime = 1800, leavetracks = true, losemitheight = 22, maneuverleashlength = 640, mass = 154, maxdamage = 1125, maxslope = 16, maxvelocity = 2, maxwaterdepth = 255, metalmake = 0.1, metalstorage = 10, mobilestandorders = 1, movementclass = "ATANK3", name = "Construction Amphibious Vehicle", noautofire = false, objectname = "armbeaver", radaremitheight = 25, reclaimspeed = 50, repairspeed = 50, selfdestructas = "BIG_UNIT", shownanospray = false, sightdistance = 266, standingmoveorder = 1, steeringmode = 1, trackoffset = 0, trackstrength = 5, trackstretch = 1, tracktype = "StdTank", trackwidth = 31, turninplace = 1, turninplaceanglelimit = 60, turninplacespeedlimit = 0.9834, turnrate = 311, unitname = "armbeaver", workertime = 100, buildoptions = { [1] = "armsolar", [2] = "armadvsol", [3] = "armwin", [4] = "armawin", [5] = "armgeo", [6] = "armmstor", [7] = "armestor", [8] = "armmex", [9] = "armmex1", [10] = "armmakr", [11] = "armamaker", [12] = "armlab", [13] = "armvp", [14] = "armavp", [15] = "armap", [16] = "armhp", [17] = "armnanotc", [18] = "armeyes", [19] = "armrad", [20] = "armjamt", [21] = "armjamt", [22] = "ajuno", [23] = "armgate2", [24] = "armdrag", [25] = "armclaw", [26] = "armllt", [27] = "armgrape", [28] = "armhlt", [29] = "armdl", [30] = "armguard", [31] = "armbrtha2", [32] = "armrl", [33] = "armpack", [34] = "armcir", [35] = "armtide", [36] = "armatidal", --[37] = "", [38] = "armfmkr", [39] = "armfhp", [40] = "armsy", [41] = "armasy", [42] = "asubpen", [43] = "armfnanotc", [44] = "armfdrag", [45] = "armfrad", [46] = "armsonar", [47] = "armfllt", [48] = "armfhlt", [49] = "armfrt", [50] = "armtl", }, customparams = { buildpic = "armbeaver.dds", faction = "ARM", }, featuredefs = { dead = { blocking = true, collisionvolumeoffsets = "0.7 0 0", collisionvolumescales = "34 22 36", collisionvolumetype = "Box", damage = 1128, description = "Beaver Wreckage", energy = 0, featuredead = "heap", footprintx = 3, footprintz = 3, metal = 112, object = "armmarv_DEAD", reclaimable = true, customparams = { fromunit = 1, }, }, heap = { blocking = false, damage = 1410, description = "Beaver Debris", energy = 0, footprintx = 3, footprintz = 3, metal = 60, object = "3X3C", reclaimable = true, customparams = { fromunit = 1, }, }, }, nanocolor = { [1] = 0.096, [2] = 0.496, [3] = 0.096, }, sfxtypes = { pieceexplosiongenerators = { [1] = "piecetrail0", [2] = "piecetrail1", [3] = "piecetrail2", [4] = "piecetrail3", [5] = "piecetrail4", [6] = "piecetrail6", }, }, sounds = { build = "nanlath1", canceldestruct = "cancel2", repair = "repair1", underattack = "warning1", working = "reclaim1", cant = { [1] = "cantdo4", }, count = { [1] = "count6", [2] = "count5", [3] = "count4", [4] = "count3", [5] = "count2", [6] = "count1", }, ok = { [1] = "varmmove", }, select = { [1] = "varmsel", }, }, }, }
Init = Init ~= nil and Init or {} Init.EnableDebugger = false Init.DEBUG = Game.IsDebug() Game.ImportLibrary("system/scripts/class.lua") Game.ImportLibrary("gui/scripts/scenariomenu_game.lua", false) Game.ImportLibrary("system/scripts/logiccallbacks.lua", false) Init.aBlkCharacterPackages = { Samus = { aScenarioSections = tScenarioMenuDefs.aScenarios, aSections = {"SAMUS"} } } Init.tNewGameInventory = { ITEM_MAX_LIFE = 99, ITEM_MAX_SPECIAL_ENERGY = 1000, ITEM_WEAPON_MISSILE_MAX = 15, ITEM_WEAPON_POWER_BOMB_MAX = 0, ITEM_METROID_COUNT = 0, ITEM_METROID_TOTAL_COUNT = 40, ITEM_FLOOR_SLIDE = 1 } Init.tMaxGameProgressStats = { NumTanksPickedUp = 123 } Init.tReserveTanksInitialConfiguration = { ITEM_RESERVE_TANK_LIFE_SIZE = 99, ITEM_RESERVE_TANK_SPECIAL_ENERGY_SIZE = 500, ITEM_RESERVE_TANK_MISSILE_SIZE = 30 } function Init.GetNewGameInventory() return Init.tNewGameInventory end function Init.GetMaxGameProgressStats() return Init.tMaxGameProgressStats end function Init.InitScenariosBlackboardsSections() end function Init.InitGameBlackboardTOC() Blackboard.SetDefaultPackage("Common") for L3_2, L4_2 in pairs(Init.aBlkCharacterPackages) do local L5_2 = {} if L4_2.aScenarioSections then for L9_2, L10_2 in ipairs(L4_2.aScenarioSections) do table.insert(L5_2, L10_2) end end for L9_2, L10_2 in ipairs(L4_2.aSections) do table.insert(L5_2, L10_2) end Blackboard.AddPackage(L3_2, L5_2) end end function Init.SetupNewGameProfileBlackboard(_ARG_0_) ProfileBlackboard.ResetWithExceptionList({"GAME", "SETTINGS", "MINIMAP", "CHOZO_ARCHIVES", "ENDING_REWARDS"}) ProfileBlackboard.SetProp("SETTINGS", "Difficulty", "i", _ARG_0_) end function Init.InitGameBlackboard() Blackboard.Reset() Blackboard.WriteSaveGameVersion() for L3_2, L4_2 in pairs(Init.tNewGameInventory) do local oProp = Blackboard.GetProp("PLAYER_INVENTORY", L3_2) if oProp == nil then oProp = L4_2 end Blackboard.SetProp("PLAYER_INVENTORY", L3_2, "f", oProp) end Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_METROID_COUNT", "f", 0) Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_CURRENT_LIFE", "f", Init.tNewGameInventory.ITEM_MAX_LIFE) Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_WEAPON_MISSILE_CURRENT", "f", Init.tNewGameInventory.ITEM_WEAPON_MISSILE_MAX) Blackboard.SetProp("PLAYER_INVENTORY", "ITEM_WEAPON_POWER_BOMB_CURRENT", "f", Init.tNewGameInventory.ITEM_WEAPON_POWER_BOMB_MAX) local SectionName = Game.GetPlayerBlackboardSectionName() Blackboard.SetProp(SectionName, "LevelID", "s", "c10_samus") Blackboard.SetProp(SectionName, "ScenarioID", "s", "s010_cave") end function Init.InitDefaultSettings() local iSubtitles = 0 if Game.GetCurrentLanguage() == "ENGLISH" then iSubtitles = 1 else iSubtitles = 2 end ProfileBlackboard.SetProp("SETTINGS", "Subtitles", "i", iSubtitles) ProfileBlackboard.SetProp("SETTINGS", "Brightness", "i", 5) end function Init.CreateNewGameData(_ARG_0_) Init.InitGameBlackboard() Init.SetupNewGameProfileBlackboard(_ARG_0_) Game.ResetTotalPlayTime() Game.SaveNewGame() end function Init.CreateAndInitNewGame(_ARG_0_, _ARG_1_, _ARG_2_) Init.CreateNewGameData(_ARG_0_) Init.InitNewGame(_ARG_1_, _ARG_2_) end function Init.ResetGameBlackboardAndReloadGame() Blackboard.Reset() Init.InitGameBlackboard() Game.ReloadCurrentScenario() end function Init.InitNewGame(_ARG_0_, _ARG_1_) Game.StartPrologue("c10_samus", _ARG_0_, _ARG_1_, "samus", 1) end function Init.CreateDebuggerConnection() package.path = package.path .. ";system/scripts/?.lc;system/scripts/LuaSockets/?.lc" loadfile("system/scripts/LuaSockets/mime.lc")() loadfile("system/scripts/LuaSockets/socket.lc")() local debugger = require("debugger") debugger(nil, nil, nil) end function Init.main() Game.SetDefaultPath("") if Init.EnableDebugger and not pcall(Init.CreateDebuggerConnection) then utils.LOG(utils.LOGTYPE_LUA, "ERROR creating debugger connection. Skipping...") end Init.InitScenariosBlackboardsSections() Init.InitGameBlackboardTOC() Game.ImportLibrary("system/scripts/savegame.lua", false) Game.ImportLibrary("system/scripts/difficulty.lua", false) Game.ImportLibrary("system/scripts/slots.lua", false) end function Init.StartGameAttractMode() Game.CreateProfile("profile0") Game.ApplySettingsFromProfileBlackboard() Init.InitGameBlackboard() Init.SetupNewGameProfileBlackboard() Game.FadeOut(0.5) Game.AddGUISF(1, "Init.CreateNewGameData", "") Game.AddGUISF(1.1, "Init.InitNewGame", "") end
-- This module should automatically make 800x600 viewport fit into a letterboxed window of a larger -- size. Just run LetterboxInit whenever you update window size, run LetterboxStart before draw -- calls and after they finish, run LetterboxFinish local viewW, viewH, viewRatio = 800, 600, 4 / 3 local winW, winH, winRatio = 800, 600, 4 / 3 function LetterboxInit(w, h) winW, winH, winRatio = w, h, w / h if winW < viewW or winH < viewH then error("Loveletter library doesn't support resolutions smaller than "..viewW.."x"..viewH) end end function LetterboxStart() local offsetX, offsetY, newScale = 0, 0, 1 love.graphics.push() if winRatio >= viewRatio then newScale = winH / viewH offsetX = winW / 2 - viewW*newScale / 2 else newScale = winW/viewW offsetY = winH / 2 - viewH*newScale / 2 end love.graphics.translate(offsetX, offsetY) love.graphics.scale(newScale) end function LetterboxFinish() love.graphics.pop() r,g,b,a = love.graphics.getColor() love.graphics.setColor(0,0,0) if winRatio >= viewRatio then local barW = winW / 2 - viewW * (winH / viewH) / 2 love.graphics.rectangle("fill", 0, 0, barW, winH) love.graphics.rectangle("fill", winW - barW, 0, barW, winH) else local barH = winH / 2 - viewH * (winW / viewW) / 2 love.graphics.rectangle("fill", 0, 0, winW, barH) love.graphics.rectangle("fill", 0, winH - barH, winW, barH) end love.graphics.setColor(r,g,b,a) end function LetterboxViewW() return viewW end function LetterboxViewH() return viewH end function LetterboxViewDim() return viewW, viewH end
-- basic NB. discretized data. class is last thing on each lone local _,the = require"tricks", require"the" local copy,inc,inc3,has3, lines = _.copy, _.inc, _.inc3, _.has3, _.lines local o,oo,push,inc, inc3 = _.o, _.oo, _.push, _.inc, _.inc3 local map,sort,firsts, stsrif = _.map,_.sort, _.firsts,_.stsrif local function classify(i,t) local hi,out = -1 for h,_ in pairs(i.h) do local prior = ((i.h[h] or 0) + the.K)/(i.n + the.K*i.nh) local l = prior for col,x in pairs(t) do if x ~= "?" and col ~= #t then l=l*(has3(i.e,col,x,h) + the.M*prior)/((i.h[h] or 0) + the.M) end end if l>hi then hi,out=l,h end end return out end local function train(i,t) i.n = i.n + 1 if not i.h[t[#t]] then i.nh = i.nh + 1 end inc(i.h, t[#t]) for col,x in pairs(t) do if x~="?" then inc3(i.e,col,x,t[#t]) end end end local function test(i,t) if i.n > i.wait then push(i.log,{want=t[#t], got=classify(i,t)}) end end local function rank(i,dodge) local out,funs={},{} function funs.xplore(b,r) return 1 / (b+r) end function funs.refute(b,r) return 1 - abs(b-r) end function funs.plan(b,r) return b<r and 0 or b^2/(b+r) end function funs.monitor(b,r) return r<b and 0 or r^2/(b+r) end print(#i.e) for col,xs in pairs(i.e) do if col ~= dodge then for x,hs in pairs(xs) do local b, r, B, R = 0, 0, 1E-32, 1E-32 for h,n in pairs(hs) do if h==the.goal then B = B + i.h[h]; b = b+n else R = R + i.h[h]; r = r+n end end push(out,{funs[the.want](b/B, r/R), {col=col,val=x}}) end end end return sort(out,stsrif) end local function nb(file, i) i = {h={}, nh=0,e={}, names=nil, n=0, wait=the.wait, log={}} for row in lines(file) do if not i.names then i.names=row else test(i,row); train(i,row) end end map(rank(i,#i.names),oo) return i end return {nb=nb}
---------------------------------------------------------------- -- Tpp SupportHelicopter ---------------------------------------------------------------- CharaTppSupportHelicopter = { ---------------------------------------- --各システムとの依存関係の定義 -- -- GeoやGrなどの各システムのJob実行タイミングを -- 「キャラクタのJob実行後」に合わせ、 -- システムを正常に動作させるために必要。 -- 使用するシステム名を記述してください。 -- -- "Gr" : 描画を使うなら必要 -- "Geo" : 当たりを使うなら必要 -- "Nt" : 通信同期を使うなら必要 -- "Fx" : エフェクトを使うなら必要 -- "Sd" : サウンドを使うなら必要 -- "Noise" : ノイズを使うなら必要 -- "Nav" : 経路探索を使うなら必要 -- "GroupBehavior" : 連携を使うなら必要 -- "Ui" : UIを使うなら必要 ---------------------------------------- dependSyncPoints = { "Gr", "Geo", "Nt", "Fx", "Sd", "Noise", "Nav", }, pluginIndexEnumInfoName = "TppHelicopterPluginDefine", --Cへ移植済み __OnCreate = function( chara ) local resourceList = { parts="parts", motionGraph="motionGraph", damageSet="damageSet", behavior="behavior" } local locator = chara:GetLocatorHandle() if Entity.IsNull(locator) then resourceList.parts="/Assets/tpp/parts/mecha/uth/uth0_main0_def.parts" resourceList.motionGraph="/Assets/tpp/motion/motion_graph/helicopter/TppHelicopter_layers.fagx" resourceList.damageSet="/Assets/tpp/parts/mecha/uth/uth0_main0_def.fdmg" resourceList.behavior="Tpp/Scripts/Characters/AiBehavior/SupportHelicopter/AiBehaviorTppSupportHelicopter.aib" end local behavior = "" local behaviorGraphName = "SupportHelicopter" if Ai.DoesUseAibFile() then behavior = resourceList.behavior behaviorGraphName = "" end local isSleepPlgPlan = false if DEBUG then local pref = Preference.GetPreferenceEntity("TppHelicopterPreference") if not Entity.IsNull(pref) then isSleepPlgPlan = pref.noPlanningMode end end local charaObj = chara:GetCharacterObject() chara:InitPluginPriorities { "DemoAction", "BasicAction", "LightAction", "DamageAction", "HoveringAction", "MoveAction", "AttackAction", } chara:AddPlugins{ -- BodyPlugin "PLG_BODY", ChBodyPlugin{ name = "Body", script = "Tpp/Scripts/Characters/Bodies/BodyTppHelicopter.lua", parts = resourceList.parts, animGraphLayer = resourceList.motionGraph, hasGravity = false, --hasCollision = false, useCharacterController = false, --allStopWhileInvisible = true, maxMotionJoints = { 21, 21, 21, 21 }, hasTranslations = { true, true, true, true }, maxMtarFiles = 1, }, --Voiceプラグイン "PLG_VOICE2", ChVoicePlugin2{ name = "Voice", characterType = "HqSquad", basicArgs = "PILOT", -- connectPointName = "CNP_MOUTH", -- distanceRtpcName = "voice_distance", plgFacial = false, }, --ルートプラグイン "PLG_ROUTE", AiRoutePlugin{ name = "Route", }, --NewInventory "PLG_NEW_INVENTORY", TppHeliInventoryPlugin { name = "NewInventory", --weaponId = "WP_HeliMachinegun", --connectPointName= "CNP_pos_psl", }, --AIタスクの制御 "PLG_PLANNING_OPERATOR", AiPlanningOperatorPlugin{ name = "PlanningOperator", planStepCount = TppSh.PlanMaxStepCount, planValueCount = TppSh.PlanVaribleSetMaxValueCount, behavior = behavior, behaviorGraphName = behaviorGraphName, priority = "AiOperation", exclusiveGroups = { TppPluginExclusiveGroup.Operator }, blackboard = TppSupportHelicopterAiBlackboard(), isSleepStart = isSleepPlgPlan, enableReserveHistory = true, reserveHistoryNum = 10, }, --乗客管理プラグイン "PLG_PASSENGER_MANAGE", TppPassengerManagePlugin { name = "PassengerManage", isPossibleGettingOnInit = false, isPossibleGettingOffInit = false, }, -- Navigationプラグイン "PLG_NAVIGATION", ChNavigationPlugin{ name = "Navigation", sceneName = "MainScene", worldName = "sky", typeName = "SkyController", radius = 0.5, --mode = "debug", }, -- 支援ヘリプラグイン "PLG_SUPPORT_HELICOPTER", TppSupportHelicopterPlugin{ name = "SupportHelicopter", }, --------------------------------------------------------------------------------------------------- -- 以下、ActionPlugin関連 --------------------------------------------------------------------------------------------------- --アクションルートプラグイン "PLG_ACTION_ROOT", ChActionRootPlugin { name = "ActionRoot", }, --[[ --基本アクションプラグイン "PLG_BASIC_ACTION", TppHelicopterBasicActionPlugin { name = "BasicAction", parent = "ActionRoot", bodyPlugin = "Body", priority = "BasicAction", layerName = { "Full", "LandingGear", "RightDoor", "LeftDoor" }, exclusiveGroups = { TppPluginExclusiveGroup.Basic }, isSleepStart = true, }, ]] --ライトアクションプラグイン "PLG_LIGHT_ACTION", TppHelicopterLightActionPlugin { name = "LightAction", parent = "ActionRoot", bodyPlugin = "Body", priority = "LightAction", layerName = { "Full", "LandingGear", "RightDoor", "LeftDoor" }, isSleepStart = true, }, --移動アクションプラグイン "PLG_MOVE_ACTION", TppHelicopterMoveActionPlugin { name = "MoveAction", parent = "ActionRoot", bodyPlugin = "Body", priority = "MoveAction", exclusiveGroups = { TppPluginExclusiveGroup.Move }, isSleepStart = true, }, --ホバリングアクションプラグイン "PLG_HOVERING_ACTION", TppHelicopterHoveringActionPlugin { name = "HoveringAction", parent = "ActionRoot", bodyPlugin = "Body", priority = "HoveringAction", exclusiveGroups = { TppPluginExclusiveGroup.Move }, isSleepStart = true, }, --攻撃アクションプラグイン "PLG_ATTACK_ACTION", TppHelicopterAttackActionPlugin { name = "AttackAction", parent = "ActionRoot", bodyPlugin = "Body", priority = "AttackAction", exclusiveGroups = { TppPluginExclusiveGroup.Attack }, }, --ダメージアクションプラグイン "PLG_DAMAGE_ACTION", TppHelicopterDamageActionPlugin { name = "DamageAction", parent = "ActionRoot", bodyPlugin = "Body", priority = "DamageAction", exclusiveGroups = { TppPluginExclusiveGroup.Attack, TppPluginExclusiveGroup.Move }, isSleepStart = true, }, --デモアクションプラグイン "PLG_DEMO_ACTION", ChDemoActionPlugin{ name = "DemoAction", script = "Tpp/Scripts/Characters/Actions/ActionTppDemo.lua", parent = "ActionRoot", bodyPlugin = "Body", priority = "DemoAction", layerName = { "Full", "RightDoor", "LeftDoor", "LandingGear" }, exclusiveGroups = { TppPluginExclusiveGroup.Basic, TppPluginExclusiveGroup.Attack, TppPluginExclusiveGroup.Move }, isSleepStart = true, }, } local charaParams = chara:GetParams() --@TODO parts付けるまでの仮対応 if charaParams.mainRotorBoneName ~= "SKL_003_MAINROTOR" then chara:AddPlugins{ --基本アクションプラグイン "PLG_BASIC_ACTION", TppHelicopterBasicActionPlugin { name = "BasicAction", parent = "ActionRoot", bodyPlugin = "Body", priority = "BasicAction", layerName = { "Full", "LandingGear", "RightDoor", "LeftDoor" }, exclusiveGroups = { TppPluginExclusiveGroup.Basic }, isSleepStart = true, }, } else chara:AddPlugins{ --基本アクションプラグイン "PLG_BASIC_ACTION", TppHelicopterBasicActionPlugin { name = "BasicAction", parent = "ActionRoot", bodyPlugin = "Body", priority = "BasicAction", layerName = { "Full", "RightDoor", "LeftDoor" }, exclusiveGroups = { TppPluginExclusiveGroup.Basic }, isSleepStart = true, }, } end end, --Cへ移植済み __OnReset = function( chara ) --黒板仮対応 local plgPlan = chara:FindPlugin("AiPlanningOperatorPlugin") local planExecuter = plgPlan:GetPlanExecuter() local bb = planExecuter:GetBlackboard() if bb.calledPointPosition == nil then bb:AddProperty("Vector3", "calledPointPosition", 1) end bb.calledPointPosition = Vector3(0,0,0) --@TODO マスク情報の設定が現状では遅いので再度初期モーションをリクエストする --本来はinitタグで解決できるはずだがマスクの設定が遅いので仮対応 local params = chara:GetParams() if params.mainRotorBoneName ~= "SKL_003_MAINROTOR" then local plgAction = chara:FindPlugin("TppHelicopterBasicActionPlugin") plgAction:SendActionRequest( ChDirectChangeStateActionRequest{ groupName = "stateTakeIn", layerName="LandingGear" } ) --plgAction:SendActionRequest( ChChangeStateActionRequest{ groupName="stateOpen", layerName="LeftDoor" } ) --plgAction:SendActionRequest( ChChangeStateActionRequest{ groupName="stateOpen", layerName="RightDoor" } ) end --ナビの更新距離を短めにする local plgNav = chara:FindPlugin("ChNavigationPlugin") plgNav:SetUpdateDistance(2) end, --Cへ移植済み ---------------------------------------- --デバッグ処理の更新 OnUpdateDebug() --OnUpdateDescの後に呼ばれる(リリースでは呼ばれないので注意) ---------------------------------------- __OnUpdateDebug = function( chara, desc ) local pref = Preference.GetPreferenceEntity("TppHelicopterPreference") local y = 150 --メンバー連携情報表示 if pref.viewAttackActionInfo then local plgAttack = chara:FindPlugin("TppHelicopterAttackActionPlugin") plgAttack:DebugView(20, y, 15) y = y + 150 end end, }
--[[ operacoes matematicas Soma + Subtracao - Multiplicacao * Divisao / Resto da divisao % ]] print(1 + 1) print(2 -1) print(3 * 3) print(4 / 2) print(9%2)
--- -- @author wesen -- @copyright 2020 wesen <wesen-ac@web.de> -- @release 0.1 -- @license MIT -- local Object = require "classic" --- -- Base class for ArgumentList filters. -- -- If a filter is added to a ArgumentListWrapper its matches() method will be called whenever -- a raw list of arguments need to be filtered. -- -- @type BaseFilter -- local BaseFilter = Object:extend() --- -- Returns whether a argument value at a specific position matches this Filter. -- If this returns false the value will be removed from the argument list. -- -- @tparam int _position The position of the argument value in the list of arguments -- @tparam mixed _argumentValue The argument value -- -- @treturn bool True if the argument value matches this Filter, false otherwise -- function BaseFilter:matches(_position, _argumentValue) end return BaseFilter
local TaskItem = require "TaskItem" local M = Class(DisplayScroll) function M:init(width, height) self.super:init(width, height, false) self:reload() end function M:setWidth(width) return self end function M:setHeight(height) return self end function M:setSize(width, height) return self end function M:reload() local sw, sh = self:getSize() local launcher = Application.new() self:clear() for k, v in pairs(Window.list()) do if launcher:getPath() ~= k then local task = TaskItem.new(sw / 2, sh, v) :addEventListener("click", function(d, e) self:dispatchEvent(Event.new("execute")) d:execute() end) self:addItem(task) end end end return M
AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") util.PrecacheSound("Airboat_engine_idle") util.PrecacheSound("Airboat_engine_stop") include("shared.lua") local Energy_Increment = 100 --60 DEFINE_BASECLASS("base_rd3_entity") function ENT:Initialize() BaseClass.Initialize(self) self.Active = 0 self.damaged = 0 self.thinkcount = 0 if WireAddon ~= nil then self.WireDebugName = self.PrintName self.Outputs = Wire_CreateOutputs(self, {"Out"}) end end function ENT:Damage() if self.damaged == 0 then self.damaged = 1 end end function ENT:Repair() BaseClass.Repair(self) self:SetColor(Color(255, 255, 255, 255)) self.damaged = 0 end function ENT:Destruct() if CAF and CAF.GetAddon("Life Support") then CAF.GetAddon("Life Support").Destruct(self, true) end end function ENT:Extract_Energy() local waterlevel = 0 if CAF then waterlevel = self:WaterLevel2() else waterlevel = self:WaterLevel() end if waterlevel > 0 then waterlevel = waterlevel / 3 else waterlevel = 1 / 3 end local energy = math.Round(Energy_Increment * self:GetMultiplier() * waterlevel) self:SupplyResource("energy", energy) if WireAddon ~= nil then Wire_TriggerOutput(self, "Out", energy) end end function ENT:GenEnergy() local waterlevel = 0 if CAF then waterlevel = self:WaterLevel2() else waterlevel = self:WaterLevel() end if waterlevel > 0 then if self.Active == 0 then self.Active = 1 self:SetOOO(1) self.sequence = self:LookupSequence("HydroFans") if self.sequence and self.sequence ~= -1 then self:SetSequence(self.sequence) self:ResetSequence(self.sequence) self:SetPlaybackRate(1) end end if self.damaged == 1 then if math.random(1, 10) < 6 then self:Extract_Energy() end else self:Extract_Energy() end else if self.Active == 1 then self.Active = 0 self:SetOOO(0) self.sequence = self:LookupSequence("idle") if self.sequence and self.sequence ~= -1 then self:SetSequence(self.sequence) self:ResetSequence(self.sequence) self:SetPlaybackRate(1) end if WireAddon ~= nil then Wire_TriggerOutput(self, "Out", 0) end end end end function ENT:Think() BaseClass.Think(self) if self.sequence and self.sequence ~= -1 then self:ResetSequence(self.sequence) self:SetPlaybackRate(1) end self.thinkcount = self.thinkcount + 1 if self.thinkcount == 10 then self:GenEnergy() self.thinkcount = 0 end self:NextThink(CurTime() + 0.1) return true end
#!/usr/bin/env tarantool test = require("sqltester") test:plan(59) --!./tcltestrunner.lua -- 2014 January 11 -- -- The author disclaims copyright to this source code. In place of -- a legal notice, here is a blessing: -- -- May you do good and not evil. -- May you find forgiveness for yourself and forgive others. -- May you share freely, never taking more than you give. -- ------------------------------------------------------------------------- -- This file implements regression tests for SQLite library. The -- focus of this file is testing the WITH clause. -- -- ["set","testdir",[["file","dirname",["argv0"]]]] -- ["source",[["testdir"],"\/tester.tcl"]] testprefix = "with2" test:do_execsql_test( 1.0, [[ CREATE TABLE t1(a INT PRIMARY KEY); INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); ]]) test:do_execsql_test( 1.1, [[ WITH x1 AS (SELECT * FROM t1) SELECT sum(a) FROM x1; ]], { -- <1.1> 3 -- </1.1> }) test:do_execsql_test( 1.2, [[ WITH x1 AS (SELECT * FROM t1) SELECT (SELECT sum(a) FROM x1); ]], { -- <1.2> 3 -- </1.2> }) test:do_execsql_test( 1.3, [[ WITH x1 AS (SELECT * FROM t1) SELECT (SELECT sum(a) FROM x1); ]], { -- <1.3> 3 -- </1.3> }) test:do_execsql_test( 1.4, [[ CREATE TABLE t2(i INT PRIMARY KEY); INSERT INTO t2 VALUES(2); INSERT INTO t2 VALUES(3); INSERT INTO t2 VALUES(5); WITH x1 AS (SELECT i FROM t2), i(a) AS ( SELECT min(i)-1 FROM x1 UNION SELECT a+1 FROM i WHERE a<10 ) SELECT a FROM i WHERE a NOT IN x1 ]], { -- <1.4> 1, 4, 6, 7, 8, 9, 10 -- </1.4> }) test:do_execsql_test( 1.5, [[ WITH x1 AS (SELECT a FROM t1), x2 AS (SELECT i FROM t2), x3 AS (SELECT * FROM x1, x2 WHERE x1.a IN x2 AND x2.i IN x1) SELECT * FROM x3 ]], { -- <1.5> 2, 2 -- </1.5> }) test:do_execsql_test( 1.6, [[ --CREATE TABLE t3 AS SELECT 3 AS x; --CREATE TABLE t4 AS SELECT 4 AS x; CREATE TABLE t3(x INT PRIMARY KEY); INSERT INTO t3 VALUES(3); CREATE TABLE t4(x INT PRIMARY KEY); INSERT INTO t4 VALUES(4); WITH x1 AS (SELECT * FROM t3), x2 AS ( WITH t3 AS (SELECT * FROM t4) SELECT * FROM x1 ) SELECT * FROM x2; ]], { -- <1.6> 3 -- </1.6> }) test:do_execsql_test( 1.9, [[ WITH x1 AS (SELECT * FROM t1) SELECT (SELECT sum(a) FROM x1), (SELECT max(a) FROM x1); ]], { -- <1.9> 3, 2 -- </1.9> }) test:do_execsql_test( 1.10, [[ WITH x1 AS (SELECT * FROM t1) SELECT (SELECT sum(a) FROM x1), (SELECT max(a) FROM x1), a FROM x1; ]], { -- <1.10> 3, 2, 1, 3, 2, 2 -- </1.10> }) test:do_execsql_test( 1.11, [[ WITH i(x) AS ( WITH j(x) AS ( SELECT * FROM i ), i(x) AS ( SELECT * FROM t1 ) SELECT * FROM j ) SELECT * FROM i; ]], { -- <1.11> 1, 2 -- </1.11> }) test:do_execsql_test( 1.12, [[ WITH r(i) AS ( VALUES('.') UNION ALL SELECT i || '.' FROM r, ( SELECT x FROM x INTERSECT SELECT y FROM y ) WHERE length(i) < 10 ), x(x) AS ( VALUES(1) UNION ALL VALUES(2) UNION ALL VALUES(3) ), y(y) AS ( VALUES(2) UNION ALL VALUES(4) UNION ALL VALUES(6) ) SELECT * FROM r; ]], { -- <1.12> ".", "..", "...", "....", ".....", "......", ".......", "........", ".........", ".........." -- </1.12> }) test:do_execsql_test( 1.13, [[ WITH r(i) AS ( VALUES('.') UNION ALL SELECT i || '.' FROM r, ( SELECT x FROM x WHERE x=2 ) WHERE length(i) < 10 ), x(x) AS ( VALUES(1) UNION ALL VALUES(2) UNION ALL VALUES(3) ) SELECT * FROM r ORDER BY length(i) DESC; ]], { -- <1.13> "..........", ".........", "........", ".......", "......", ".....", "....", "...", "..", "." -- </1.13> }) test:do_execsql_test( 1.14, [[ WITH t4(x) AS ( VALUES(4) UNION ALL SELECT x+1 FROM t4 WHERE x<10 ) SELECT * FROM t4; ]], { -- <1.14> 4, 5, 6, 7, 8, 9, 10 -- </1.14> }) test:do_catchsql_test(1.16, [[ WITH t4(x) AS ( VALUES(4) UNION ALL SELECT x+1 FROM t4, t4, t4 WHERE x<10 ) SELECT * FROM t4; ]], { -- <1.16> 1, "multiple references to recursive table: T4" -- </1.16> }) ----------------------------------------------------------------------------- -- Check that variables can be used in CTEs. -- local min = 3 local max = 9 test:do_execsql_test( 2.1, string.format([[ WITH i(x) AS ( VALUES(%s) UNION ALL SELECT x+1 FROM i WHERE x < %s ) SELECT * FROM i; ]], min, max), { -- <2.1> 3, 4, 5, 6, 7, 8, 9 -- </2.1> }) test:do_execsql_test( 2.2, string.format([[ WITH i(x) AS ( VALUES(%s) UNION ALL SELECT x+1 FROM i WHERE x < %s ) SELECT x FROM i JOIN i AS j USING (x); ]], min, max), { -- <2.2> 3, 4, 5, 6, 7, 8, 9 -- </2.2> }) ----------------------------------------------------------------------------- -- Check that circular references are rejected. -- test:do_catchsql_test(3.1, [[ WITH i(x, y) AS ( VALUES(1, (SELECT x FROM i)) ) SELECT * FROM i; ]], { -- <3.1> 1, "circular reference: I" -- </3.1> }) test:do_catchsql_test(3.2, [[ WITH i(x) AS ( SELECT * FROM j ), j(x) AS ( SELECT * FROM k ), k(x) AS ( SELECT * FROM i ) SELECT * FROM i; ]], { -- <3.2> 1, "circular reference: I" -- </3.2> }) test:do_catchsql_test(3.3, [[ WITH i(x) AS ( SELECT * FROM (SELECT * FROM j) ), j(x) AS ( SELECT * FROM (SELECT * FROM i) ) SELECT * FROM i; ]], { -- <3.3> 1, "circular reference: I" -- </3.3> }) test:do_catchsql_test(3.4, [[ WITH i(x) AS ( SELECT * FROM (SELECT * FROM j) ), j(x) AS ( SELECT * FROM (SELECT * FROM i) ) SELECT * FROM j; ]], { -- <3.4> 1, "circular reference: J" -- </3.4> }) test:do_catchsql_test(3.5, [[ WITH i(x) AS ( WITH j(x) AS ( SELECT * FROM i ) SELECT * FROM j ) SELECT * FROM i; ]], { -- <3.5> 1, "circular reference: I" -- </3.5> }) ----------------------------------------------------------------------------- -- Try empty and very long column lists. -- test:do_catchsql_test(4.1, [[ WITH x() AS ( SELECT 1,2,3 ) SELECT * FROM x; ]], { -- <4.1> 1, [[near ")": syntax error]] -- </4.1> }) local function genstmt(n) local cols = "c1" local vals = "1" for i=2,n do cols = cols..", c"..i vals = vals..", "..i end return string.format([[ WITH x(%s) AS (SELECT %s) SELECT (c%s == %s) FROM x ]], cols, vals, n, n) end test:do_execsql_test( 4.2, genstmt(10), { -- <4.2> 1 -- </4.2> }) test:do_execsql_test( 4.3, genstmt(100), { -- <4.3> 1 -- </4.3> }) test:do_execsql_test( 4.4, genstmt(255), { -- <4.4> 1 -- </4.4> }) -- nLimit = sqlite3_limit("db", "SQLITE_LIMIT_COLUMN", -1) -- Tarantool: max number of columns in result set -- test:do_execsql_test( -- 4.5, -- genstmt(nLimit-1), { -- -- <4.5> -- 1 -- -- </4.5> -- }) -- test:do_execsql_test( -- 4.6, -- genstmt(nLimit), { -- -- <4.6> -- 1 -- -- </4.6> -- }) -- test:do_catchsql_test(4.7, genstmt(X(0, "X!expr", [=[["+",["nLimit"],1]]=])), { -- -- <4.7> -- 1, "too many columns in result set" -- -- </4.7> -- }) ----------------------------------------------------------------- -- Check that adding a WITH clause to an INSERT disables the xfer -- optimization. local function do_xfer_test(test, test_func, test_name, func, exp, opts) local opts = opts or {} local exp_xfer_count = opts.exp_xfer_count local before = box.sql.debug().sql_xfer_count test_func(test, test_name, func, exp) local after = box.sql.debug().sql_xfer_count test:is(after - before, exp_xfer_count, test_name .. '-xfer-count') end test.do_execsql_xfer_test = function(test, test_name, func, exp, opts) do_xfer_test(test, test.do_execsql_test, test_name, func, exp, opts) end test.do_catchsql_xfer_test = function(test, test_name, func, exp, opts) do_xfer_test(test, test.do_catchsql_test, test_name, func, exp, opts) end test:do_execsql_test( 5.1, [[ DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; CREATE TABLE t1(a INT PRIMARY KEY, b INT); CREATE TABLE t2(a INT PRIMARY KEY, b INT); INSERT INTO t2 VALUES (1, 1), (2, 2); ]], { -- <5.1> -- <5.1> }) test:do_execsql_xfer_test( 5.2, [[ INSERT INTO t1 SELECT * FROM t2; DELETE FROM t1; ]], { -- <5.2> -- <5.2> }, { exp_xfer_count = 1 }) test:do_execsql_xfer_test( 5.3, [[ INSERT INTO t1 SELECT a, b FROM t2; DELETE FROM t1; ]], { -- <5.3> -- <5.3> }, { exp_xfer_count = 0 }) test:do_execsql_xfer_test( 5.4, [[ INSERT INTO t1 SELECT b, a FROM t2; DELETE FROM t1; ]], { -- <5.4> -- <5.4> }, { exp_xfer_count = 0 }) test:do_execsql_xfer_test( 5.5, [[ WITH x AS (SELECT a, b FROM t2) INSERT INTO t1 SELECT * FROM x; DELETE FROM t1; ]], { -- <5.5> -- <5.5> }, { exp_xfer_count = 0 }) test:do_execsql_xfer_test( 5.6, [[ WITH x AS (SELECT a, b FROM t2) INSERT INTO t1 SELECT * FROM t2; DELETE FROM t1; ]], { -- <5.6> -- <5.6> }, { exp_xfer_count = 0 }) test:do_execsql_xfer_test( 5.7, [[ INSERT INTO t1 WITH x AS (SELECT * FROM t2) SELECT * FROM x; DELETE FROM t1; ]], { -- <5.7> -- <5.7> }, { exp_xfer_count = 0 }) test:do_execsql_xfer_test( 5.8, [[ INSERT INTO t1 WITH x(a,b) AS (SELECT * FROM t2) SELECT * FROM x; DELETE FROM t1; ]], { -- <5.8> -- <5.8> }, { exp_xfer_count = 0 }) ----------------------------------------------------------------------------- -- Check that syntax (and other) errors in statements with WITH clauses -- attached to them do not cause problems (e.g. memory leaks). -- test:do_execsql_test( 6.1, [[ DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; CREATE TABLE t1(a INT PRIMARY KEY, b INT ); CREATE TABLE t2(a INT PRIMARY KEY, b INT ); ]]) test:do_catchsql_test(6.2, [[ WITH x AS (SELECT * FROM t1) INSERT INTO t2 VALUES(1, 2,); ]], { -- <6.2> 1, [[near ")": syntax error]] -- </6.2> }) test:do_catchsql_test("6.3.1", [[ WITH x AS (SELECT * FROM t1) INSERT INTO t2 SELECT a, b, FROM t1; ]], { -- <6.3> 1, [[keyword "FROM" is reserved]] -- </6.3> }) test:do_catchsql_test("6.3.2", [[ WITH x AS (SELECT * FROM t1) INSERT INTO t2 SELECT a, b FROM abc; ]], { -- <6.3> 1, "no such table: ABC" -- </6.3> }) test:do_catchsql_test(6.4, [[ WITH x AS (SELECT * FROM t1) INSERT INTO t2 SELECT a, b, FROM t1 a a a; ]], { -- <6.4> 1, [[keyword "FROM" is reserved]] -- </6.4> }) test:do_catchsql_test(6.5, [[ WITH x AS (SELECT * FROM t1) DELETE FROM t2 WHERE; ]], { -- <6.5> 1, [[near ";": syntax error]] -- </6.5> }) test:do_catchsql_test(6.6, [[ WITH x AS (SELECT * FROM t1) DELETE FROM t2 WHERE ]], { -- <6.6> 1, '/near .* syntax error/' -- </6.6> }) test:do_catchsql_test(6.7, [[ WITH x AS (SELECT * FROM t1) DELETE FROM t2 WHRE 1; ]], { -- <6.7> 1, '/near .* syntax error/' -- </6.7> }) test:do_catchsql_test(6.8, [[ WITH x AS (SELECT * FROM t1) UPDATE t2 SET a = 10, b = ; ]], { -- <6.8> 1, '/near .* syntax error/' -- </6.8> }) test:do_catchsql_test(6.9, [[ WITH x AS (SELECT * FROM t1) UPDATE t2 SET a = 10, b = 1 WHERE a===b; ]], { -- <6.9> 1, '/near .* syntax error/' -- </6.9> }) test:do_catchsql_test("6.10", [[ WITH x(a,b) AS ( SELECT 1, 1 UNION ALL SELECT a*b,a+b FROM x WHERE c=2 ) SELECT * FROM x ]], { -- <6.10> 1, "no such column: C" -- </6.10> }) --------------------------------------------------------------------------- -- Recursive queries in IN(...) expressions. -- test:do_execsql_test( 7.1, [[ CREATE TABLE t5(x INTEGER PRIMARY KEY); CREATE TABLE t6(y INTEGER PRIMARY KEY); WITH s(x) AS ( VALUES(7) UNION ALL SELECT x+7 FROM s WHERE x<49 ) INSERT INTO t5 SELECT * FROM s; INSERT INTO t6 WITH s(x) AS ( VALUES(2) UNION ALL SELECT x+2 FROM s WHERE x<49 ) SELECT * FROM s; ]]) test:do_execsql_test( 7.2, [[ SELECT * FROM t6 WHERE y IN (SELECT x FROM t5) ]], { -- <7.2> 14, 28, 42 -- </7.2> }) test:do_execsql_test( 7.3, [[ WITH ss AS (SELECT x FROM t5) SELECT * FROM t6 WHERE y IN (SELECT x FROM ss) ]], { -- <7.3> 14, 28, 42 -- </7.3> }) test:do_execsql_test( 7.4, [[ WITH ss(x) AS ( VALUES(7) UNION ALL SELECT x+7 FROM ss WHERE x<49 ) SELECT * FROM t6 WHERE y IN (SELECT x FROM ss) ]], { -- <7.4> 14, 28, 42 -- </7.4> }) test:do_execsql_test( 7.5, [[ SELECT * FROM t6 WHERE y IN ( WITH ss(x) AS ( VALUES(7) UNION ALL SELECT x+7 FROM ss WHERE x<49 ) SELECT x FROM ss ) ]], { -- <7.5> 14, 28, 42 -- </7.5> }) --------------------------------------------------------------------------- -- At one point the following was causing an assertion failure and a -- memory leak. -- test:do_execsql_test( 8.1, [[ CREATE TABLE t7(id INT PRIMARY KEY, y INT ); INSERT INTO t7 VALUES(1, NULL); CREATE VIEW v AS SELECT y FROM t7 ORDER BY y; ]]) test:do_execsql_test( 8.2, [[ WITH q(a) AS ( SELECT 1 UNION SELECT a+1 FROM q, v WHERE a<5 ) SELECT * FROM q; ]], { -- <8.2> 1, 2, 3, 4, 5 -- </8.2> }) test:do_execsql_test( 8.3, [[ WITH q(a) AS ( SELECT 1 UNION ALL SELECT a+1 FROM q, v WHERE a<5 ) SELECT * FROM q; ]], { -- <8.3> 1, 2, 3, 4, 5 -- </8.3> }) test:finish_test()
-- init.lua -- SSID="FrontierHSI" -- SSID -- PASSWORD="passfire" -- SSID password HOSTNAME="MQTT-DHT22-shop-furnace" -- TIMEOUT=100000 -- timeout to check the network status -- EXSENSOR1="tempumid.lua" -- module to run -- MQTTSERVER="192.168.254.220" -- mqtt broker address -- MQTTPORT="1883" -- mqtt broker port -- MQTTQOS="0" -- qos used -- print('\n *** MQTT init.lua ver 1.01') -- setup I2c and connect display -- function init_i2c_display() -- -- SDA and SCL can be assigned freely to available GPIOs -- local sda = 6 -- local scl = 5 -- local sla = 0x3c -- print(" initializing I2c OLED display on pins "..sda.." and "..scl) -- i2c.setup(0, sda, scl, i2c.SLOW) -- disp = u8g2.ssd1306_i2c_128x64_noname(id, sla) -- disp:setFont(u8g.font_6x10) -- disp:setFontRefHeightExtendedText() -- disp:setDefaultForegroundColor() -- disp:setFontPosTop() -- disp:setColorIndex(1) -- end -- function draw(str) -- disp:drawStr(10,10,str) -- end -- Set the network parameters and get ip address -- station_cfg={} -- station_cfg.ssid=SSID -- station_cfg.pwd=PASSWORD -- station_cfg.save=true -- wifi.sta.config(station_cfg) -- wifi.sta.sethostname(HOSTNAME) -- wifi.sta.autoconnect(0) -- wifi.setmode(wifi.STATION) -- print(' set mode=STATION (mode='..wifi.getmode()..')') -- print(' MAC: ',wifi.sta.getmac()) -- print(' chip: ',node.chipid()) -- print(' heap: ',node.heap()) -- print(' ') -- -- Check the network status after the TIMEOUT interval -- wifi.sta.connect() -- tmr.alarm(1,1000,1,function() -- if wifi.sta.getip()==nil then -- print(" IP unavailable, waiting") -- else -- tmr.stop(1) -- print("\n Config done, IP is "..wifi.sta.getip()) -- print(" hostname: "..wifi.sta.gethostname()) -- print(" ESP8266 mode is: " .. wifi.getmode()) -- print(" MAC address is: " .. wifi.ap.getmac()) -- -- init_i2c_display() -- print("\n starting sensor read loop") -- print(" sending data to MQTT server @ " ..MQTTSERVER) -- dofile("tempumid.lua") -- end -- end) local ssid = "FrontierHSI" local password = "" function connect_to_wifi(ssid, password) wifi.setmode(wifi.STATION) station_cfg={} station_cfg.ssid=ssid station_cfg.pwd=password station_cfg.save=true wifi.sta.config(station_cfg) -- wifi.sta.connect() end function wait_for_ip(callback) tmr.create():alarm(100, tmr.ALARM_AUTO, function(t) if wifi.sta.getip() ~= nil then t:unregister() callback() end end) end function continue_with_wifi() gpio.write(4, gpio.LOW) print('Connected to WiFi') end -- gpio.mode (4, gpio.OUTPUT) -- gpio.write(4, gpio.HIGH) connect_to_wifi(ssid, password) print (' waiting for IP') wait_for_ip(continue_with_wifi) print(' got IP') ip = wifi.sta.getip() print(ip) dofile("tempumid.lua")
local lfs = require "lfs" local Util = require("Util/Util") local apidoc = require("Util/apidoc_nontoc") -- run this script, then FindFrameXmlEvent and then this script again local framexml_data = loadfile("out/lua/API_info.patch.event_retail_framexml.lua")() local flavors = { retail = { id = "retail", input = "FrameXML/retail", out = "out/lua/API_info.patch.event_retail.lua", }, classic = { id = "classic", input = "FrameXML/classic", out = "out/lua/API_info.patch.event_classic.lua", }, } local pre252_format = { ["1.13.2"] = true, ["1.13.3"] = true, ["1.13.4"] = true, ["1.13.5"] = true, ["1.13.6"] = true, ["1.13.7"] = true, ["2.5.1"] = true, } local m = {} function m:GetPatchData(tbl) local added, removed = {}, {} for _, version in pairs(Util:SortTable(tbl)) do local v = tbl[version] for name in pairs(v) do if not added[name] then added[name] = version end end for name in pairs(added) do if not v[name] and not removed[name] then removed[name] = version end end end local t = {} for name, version in pairs(added) do t[name] = t[name] or {} if version == "8.0.1" then -- event docs were added in 8.0.1 t[name][1] = false else t[name][1] = version end end for name, version in pairs(removed) do t[name] = t[name] or {} t[name][2] = version end return t end local function GetEventMap(data) local t = {} for _, info in pairs(data) do if info.Events then for _, event in pairs(info.Events) do t[event.LiteralName] = true end end end return t end function m:GetFrameXmlData(info) local t = {} for folder in lfs.dir(info.input) do if not Util.RelativePath[folder] then local version = folder:match("%d+%.%d+.%d+") local path if info.id == "retail" then path = info.input.."/"..folder.."/Blizzard_APIDocumentation" elseif info.id == "classic" then if pre252_format[version] then path = info.input.."/"..folder.."/AddOns/Blizzard_APIDocumentation" else path = info.input.."/"..folder.."/Interface/AddOns/Blizzard_APIDocumentation" end end local docTables = apidoc:LoadBlizzardDocs(path) t[version] = GetEventMap(docTables) end end return t end function m:WritePatchData(info) local frameXML = self:GetFrameXmlData(info) local patchData = self:GetPatchData(frameXML) local file = io.open(info.out, "w") file:write("local data = {\n") for _, name in pairs(Util:SortTable(patchData)) do local tbl = patchData[name] file:write(string.format('\t["%s"] = {', name)) if type(tbl[1]) == "string" then file:write(string.format('"%s"', tbl[1])) elseif tbl[1] == false then file:write("false") -- file:write(string.format('"%s"', framexml_data[name])) end if tbl[2] then file:write(string.format(', "%s"', tbl[2])) end file:write("},\n") end file:write("}\n\nreturn data\n") file:close() end function m:main() self:WritePatchData(flavors.retail) self:WritePatchData(flavors.classic) end m:main() print("done")
local condition = Condition(CONDITION_FIRE) condition:setParameter(CONDITION_PARAM_DELAYED, true) condition:addDamage(20, 9000, -10) local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) combat:setArea(createCombatArea(AREA_CIRCLE6X6)) combat:setCondition(condition) function onCastSpell(creature, variant) return combat:execute(creature, variant) end
package("openssl") set_homepage("https://www.openssl.org/") set_description("A robust, commercial-grade, and full-featured toolkit for TLS and SSL.") add_urls("https://www.openssl.org/source/openssl-$(version).tar.gz", {alias = "home", excludes = "*/fuzz/*"}) add_urls("https://github.com/openssl/openssl/archive/OpenSSL_$(version).zip", {alias = "github", version = function (version) return version:gsub("%.", "_") end, excludes = "*/fuzz/*"}) add_versions("home:1.1.1", "2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d") add_versions("home:1.0.2", "8c48baf3babe0d505d16cfc0cf272589c66d3624264098213db0fb00034728e9") add_versions("home:1.0.0", "1bbf9afc5a6215121ac094147d0a84178294fe4c3d0a231731038fd3717ba7ca") add_versions("github:1.1.1", "7da8c193d3828a0cb4d866dc75622b2aac392971c3d656f7817fb84355290343") add_versions("github:1.0.2", "b61942861405c634f86ca2b8dd1a34687e24b5036598d0fa971fac02405fdb1a") add_versions("github:1.0.0", "9b67e5ad1a4234c1170ada75b66321e914da4f3ebaeaef6b28400173aaa6b378") add_links("ssl", "crypto") on_install("linux", "macosx", function (package) os.vrun("./config %s --prefix=\"%s\"", package:debug() and "--debug" or "", package:installdir()) import("package.tools.make").install(package) end) on_install("cross", function (package) local target = "linux-generic32" if package:is_os("linux") then if package:is_arch("arm64") then target = "linux-aarch64" else target = "linux-armv4" end end local configs = {target, "-DOPENSSL_NO_HEARTBEATS", "no-shared", "no-threads", "--prefix=" .. package:installdir()} local buildenvs = import("package.tools.autoconf").buildenvs(package) os.vrunv("./Configure", configs, {envs = buildenvs}) local makeconfigs = {CFLAGS = buildenvs.CFLAGS, ASFLAGS = buildenvs.ASFLAGS} import("package.tools.make").install(package, makeconfigs) end) on_test(function (package) assert(package:has_cfuncs("SSL_new", {includes = "openssl/ssl.h"})) end)
test_run = require('test_run') inspector = test_run.new() engine = inspector:get_cfg('engine') -- https://github.com/tarantool/tarantool/issues/1109 -- Update via a secondary key breaks recovery s = box.schema.create_space('test', { engine = engine }) i1 = s:create_index('test1', {parts = {1, 'unsigned'}}) i2 = s:create_index('test2', {parts = {2, 'unsigned'}}) s:insert{1, 2, 3} s:insert{5, 8, 13} i2:update({2}, {{'+', 3, 3}}) tmp = i2:delete{8} inspector:cmd("restart server default") test_run = require('test_run') inspector = test_run.new() engine = inspector:get_cfg('engine') box.space.test:select{} box.space.test:drop() -- https://github.com/tarantool/tarantool/issues/1435 -- Truncate does not work _ = box.schema.space.create('t5',{engine=engine}) _ = box.space.t5:create_index('primary') box.space.t5:insert{44} box.space.t5:truncate() box.space.t5:insert{55} box.space.t5:drop() -- https://github.com/tarantool/tarantool/issues/2257 -- crash somewhere in bsize s = box.schema.space.create('test',{engine=engine}) _ = s:create_index('primary') s:replace{1} box.begin() _ = s:delete{1} box.rollback() _ = s:delete{1} s:drop()
project("RED4ext.ExecuteFunctions") targetdir(red4ext.paths.build("examples")) kind("SharedLib") language("C++") dependson({ "RED4ext.SDK" }) includedirs( { ".", red4ext.paths.include() }) files( { "**.cpp", "**.hpp" })
--[[ This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:27' using the latest game version. NOTE: This file should only be used as IDE support; it should NOT be distributed with addons! **************************************************************************** CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC. **************************************************************************** ]] ------------------- -- General Stats -- ------------------- STAT_TYPES = { [ATTRIBUTE_HEALTH] = STAT_HEALTH_MAX, [ATTRIBUTE_MAGICKA] = STAT_MAGICKA_MAX, [ATTRIBUTE_STAMINA] = STAT_STAMINA_MAX, } ZO_STAT_TOOLTIP_DESCRIPTIONS = { [STAT_HEALTH_MAX] = SI_STAT_TOOLTIP_HEALTH_MAX, [STAT_HEALTH_REGEN_IDLE] = SI_STAT_TOOLTIP_HEALTH_REGENERATION_IDLE, [STAT_HEALTH_REGEN_COMBAT] = SI_STAT_TOOLTIP_HEALTH_REGENERATION_COMBAT, [STAT_MAGICKA_MAX] = SI_STAT_TOOLTIP_MAGICKA_MAX, [STAT_MAGICKA_REGEN_IDLE] = SI_STAT_TOOLTIP_MAGICKA_REGENERATION_IDLE, [STAT_MAGICKA_REGEN_COMBAT] = SI_STAT_TOOLTIP_MAGICKA_REGENERATION_COMBAT, [STAT_STAMINA_MAX] = SI_STAT_TOOLTIP_STAMINA_MAX, [STAT_STAMINA_REGEN_IDLE] = SI_STAT_TOOLTIP_STAMINA_REGENERATION_IDLE, [STAT_STAMINA_REGEN_COMBAT] = SI_STAT_TOOLTIP_STAMINA_REGENERATION_COMBAT, [STAT_SPELL_POWER] = SI_STAT_TOOLTIP_SPELL_POWER, [STAT_SPELL_PENETRATION] = SI_STAT_TOOLTIP_SPELL_PENETRATION, [STAT_SPELL_CRITICAL] = SI_STAT_TOOLTIP_SPELL_CRITICAL, [STAT_ATTACK_POWER] = SI_STAT_TOOLTIP_ATTACK_POWER, [STAT_PHYSICAL_PENETRATION] = SI_STAT_TOOLTIP_PHYSICAL_PENETRATION, [STAT_CRITICAL_STRIKE] = SI_STAT_TOOLTIP_CRITICAL_STRIKE, [STAT_PHYSICAL_RESIST] = SI_STAT_TOOLTIP_PHYSICAL_RESIST, [STAT_SPELL_RESIST] = SI_STAT_TOOLTIP_SPELL_RESIST, [STAT_CRITICAL_RESISTANCE] = SI_STAT_TOOLTIP_CRITICAL_RESISTANCE, [STAT_POWER] = SI_STAT_TOOLTIP_POWER, [STAT_MITIGATION] = SI_STAT_TOOLTIP_MITIGATION, [STAT_SPELL_MITIGATION] = SI_STAT_TOOLTIP_SPELL_MITIGATION, [STAT_ARMOR_RATING] = SI_STAT_TOOLTIP_ARMOR_RATING, [STAT_WEAPON_AND_SPELL_DAMAGE] = SI_STAT_TOOLTIP_WEAPON_POWER, } ZO_STATS_REFRESH_TIME_SECONDS = 2 function ZO_GetNextActiveArtificialEffectIdIter(state, lastActiveEffectId) return GetNextActiveArtificialEffectId(lastActiveEffectId) end ------------------ -- Stats Common -- ------------------ ZO_Stats_Common = ZO_Object:Subclass() function ZO_Stats_Common:New(...) local statsCommon = ZO_Object.New(self) statsCommon:Initialize(...) return statsCommon end function ZO_Stats_Common:Initialize() self.availablePoints = 0 self.statBonuses = {} end function ZO_Stats_Common:GetAvailablePoints() return self.availablePoints end function ZO_Stats_Common:SetAvailablePoints(points) self.availablePoints = points self:OnSetAvailablePoints() end function ZO_Stats_Common:OnSetAvailablePoints() -- To be overridden. end function ZO_Stats_Common:SpendAvailablePoints(points) self:SetAvailablePoints(self:GetAvailablePoints() - points) end function ZO_Stats_Common:GetTotalSpendablePoints() return GetAttributeUnspentPoints() end function ZO_Stats_Common:SetPendingStatBonuses(statType, pendingBonus) self.statBonuses[statType] = pendingBonus end function ZO_Stats_Common:UpdatePendingStatBonuses(statType, pendingBonus) self:SetPendingStatBonuses(statType, pendingBonus) end function ZO_Stats_Common:GetPendingStatBonuses(statType) return self.statBonuses[statType] end function ZO_Stats_Common:UpdateTitleDropdownSelection(dropdown) local currentTitleIndex = GetCurrentTitleIndex() if currentTitleIndex then dropdown:SetSelectedItemText(zo_strformat(GetTitle(currentTitleIndex), GetRawUnitName("player"))) else dropdown:SetSelectedItemText(GetString(SI_STATS_NO_TITLE)) end end function ZO_Stats_Common:UpdateTitleDropdownTitles(dropdown) dropdown:ClearItems() dropdown:AddItem(ZO_ComboBox:CreateItemEntry(GetString(SI_STATS_NO_TITLE), function() SelectTitle(nil) end), ZO_COMBOBOX_SUPPRESS_UPDATE) for i=1, GetNumTitles() do dropdown:AddItem(ZO_ComboBox:CreateItemEntry(zo_strformat(GetTitle(i), GetRawUnitName("player")) , function() SelectTitle(i) end), ZO_COMBOBOX_SUPPRESS_UPDATE) end dropdown:UpdateItems() self:UpdateTitleDropdownSelection(dropdown) end function ZO_Stats_Common:IsPlayerBattleLeveled() return IsUnitChampionBattleLeveled("player") or IsUnitBattleLeveled("player") end function ZO_Stats_Common:GetEquipmentBonusInfo() return self.equipmentBonus.value, self.equipmentBonus.lowestEquipSlot end do --to break ties for the player's lowest scoring piece of equipment and show the most important piece local COMBAT_EQUIP_SLOT_IMPORTANCE = { [EQUIP_SLOT_MAIN_HAND] = 12, [EQUIP_SLOT_BACKUP_MAIN] = 12, [EQUIP_SLOT_OFF_HAND] = 11, [EQUIP_SLOT_BACKUP_OFF] = 11, [EQUIP_SLOT_CHEST] = 10, [EQUIP_SLOT_LEGS] = 9, [EQUIP_SLOT_HEAD] = 8, [EQUIP_SLOT_SHOULDERS] = 7, [EQUIP_SLOT_FEET] = 6, [EQUIP_SLOT_HAND] = 5, [EQUIP_SLOT_WAIST] = 4, [EQUIP_SLOT_NECK] = 3, [EQUIP_SLOT_RING1] = 2, [EQUIP_SLOT_RING2] = 1, } local EQUIPMENT_BONUS_FILLED_TEXTURE = "EsoUI/Art/CharacterWindow/equipmentBonusIcon_full.dds" local EQUIPMENT_BONUS_EMPTY_TEXTURE = "EsoUI/Art/CharacterWindow/equipmentBonusIcon_empty.dds" local EQUIPMENT_BONUS_GOLD_TEXTURE = "EsoUI/Art/CharacterWindow/equipmentBonusIcon_full_gold.dds" function ZO_Stats_Common:RefreshEquipmentBonus() --calculate total combat equipment bonus rating local totalEquipmentBonusRating = 0 local lowestEquipmentBonusRating local lowestEquipSlot --check if our active weapon is two-handed (for special consideration in weighting weapon equipment bonus value and showing lowest piece in tooltips) local heldWeaponPair = GetHeldWeaponPair() local mainHandSlot = heldWeaponPair == ACTIVE_WEAPON_PAIR_BACKUP and EQUIP_SLOT_BACKUP_MAIN or EQUIP_SLOT_MAIN_HAND local equipType = select(6, GetItemInfo(BAG_WORN, mainHandSlot)) local isUsingTwoHanded = equipType == EQUIP_TYPE_TWO_HAND for equipSlot = EQUIP_SLOT_ITERATION_BEGIN, EQUIP_SLOT_ITERATION_END do -- filter out an "non-combat" slots as well as the inactive weapon pair if IsActiveCombatRelatedEquipmentSlot(equipSlot) then local considerSlotForOverallRating = true --don't consider off hand weapon slots if player is wielding a two-handed weapon if equipSlot == EQUIP_SLOT_OFF_HAND or equipSlot == EQUIP_SLOT_BACKUP_OFF then if isUsingTwoHanded then considerSlotForOverallRating = false end end if considerSlotForOverallRating then local equipmentBonusRating = GetEquipmentBonusRating(BAG_WORN, equipSlot) if not lowestEquipmentBonusRating or equipmentBonusRating < lowestEquipmentBonusRating then lowestEquipmentBonusRating = equipmentBonusRating lowestEquipSlot = equipSlot elseif equipmentBonusRating == lowestEquipmentBonusRating and COMBAT_EQUIP_SLOT_IMPORTANCE[equipSlot] > COMBAT_EQUIP_SLOT_IMPORTANCE[lowestEquipSlot] then lowestEquipSlot = equipSlot end --weight two-handed weapons twice so that they count double in the total --this is to compensate for their empty off hand weapon slot, so they aren't penalized for 2H weapons in the total if equipSlot == EQUIP_SLOT_MAIN_HAND or equipSlot == EQUIP_SLOT_BACKUP_MAIN then if isUsingTwoHanded then equipmentBonusRating = equipmentBonusRating * 2 end end totalEquipmentBonusRating = totalEquipmentBonusRating + equipmentBonusRating end -- else don't add the bonus rating to the total because we aren't considering it end end --set equipment bonus local averageEquipmentBonusRating = totalEquipmentBonusRating / NUM_COMBAT_RELATED_EQUIP_SLOTS local playerLevel = GetUnitLevel("player") local playerChampionPoints = GetUnitChampionPoints("player") local averageRelativeEquipmentBonusRating = GetUnitEquipmentBonusRatingRelativeToLevel("player", averageEquipmentBonusRating) local equipmentBonus = EQUIPMENT_BONUS_ITERATION_BEGIN for thresholdNumber = EQUIPMENT_BONUS_ITERATION_END, EQUIPMENT_BONUS_ITERATION_BEGIN, -1 do local thresholdValue = GetEquipmentBonusThreshold(playerLevel, playerChampionPoints, thresholdNumber) if averageRelativeEquipmentBonusRating >= thresholdValue then equipmentBonus = thresholdNumber break end end self.equipmentBonus.value = equipmentBonus self.equipmentBonus.lowestEquipSlot = lowestEquipSlot --setup icons self.equipmentBonus.iconPool:ReleaseAllObjects() local lastIcon --we setup 2 fewer icons than the number of EQUIPMENT_BONUS levels: the lowest equipment bonus level is all empty icons, and the highest adds a bonus icon separately for iconNumber = EQUIPMENT_BONUS_ITERATION_BEGIN, EQUIPMENT_BONUS_ITERATION_END - 2 do local equipmentBonusIconControl = self.equipmentBonus.iconPool:AcquireObject() local equipmentBonusIconTexture if iconNumber < self.equipmentBonus.value then equipmentBonusIconTexture = self.equipmentBonus.value == EQUIPMENT_BONUS_EXTRAORDINARY and EQUIPMENT_BONUS_GOLD_TEXTURE or EQUIPMENT_BONUS_FILLED_TEXTURE else equipmentBonusIconTexture = EQUIPMENT_BONUS_EMPTY_TEXTURE end equipmentBonusIconControl:SetTexture(equipmentBonusIconTexture) if lastIcon then equipmentBonusIconControl:SetAnchor(BOTTOMLEFT, lastIcon, BOTTOMRIGHT, 4, 0) else equipmentBonusIconControl:SetAnchor(BOTTOMLEFT) end lastIcon = equipmentBonusIconControl end --add bonus icon if at the highest level if self.equipmentBonus.value == EQUIPMENT_BONUS_MAX_VALUE then local equipmentBonusIconControl = self.equipmentBonus.iconPool:AcquireObject() equipmentBonusIconControl:SetTexture(EQUIPMENT_BONUS_GOLD_TEXTURE) equipmentBonusIconControl:SetAnchor(BOTTOMLEFT, lastIcon, BOTTOMRIGHT, 4, 0) end end end function ZO_StatsRidingSkillIcon_Initialize(control, trainingType) control.trainingType = trainingType control:GetNamedChild("Icon"):SetTexture(STABLE_TRAINING_TEXTURES[trainingType]) end ----------------------- -- Attribute Spinner -- ----------------------- ZO_AttributeSpinner_Shared = ZO_Object:Subclass() function ZO_AttributeSpinner_Shared:New(attributeControl, attributeType, attributeManager, valueChangedCallback) local attributeSpinner = ZO_Object.New(self) attributeSpinner.attributeControl = attributeControl attributeSpinner.points = 0 attributeSpinner.addedPoints = 0 attributeSpinner.attributeManager = attributeManager attributeSpinner:SetValueChangedCallback(valueChangedCallback) attributeSpinner:SetAttributeType(attributeType) return attributeSpinner end function ZO_AttributeSpinner_Shared:SetSpinner(spinner) self.pointsSpinner = spinner self.pointsSpinner:RegisterCallback("OnValueChanged", function(points) self:OnValueChanged(points) end) end function ZO_AttributeSpinner_Shared:Reinitialize(attributeType, addedPoints, valueChangedCallback) self:SetValueChangedCallback(valueChangedCallback) self:SetAttributeType(attributeType) self.points = GetAttributeSpentPoints(self.attributeType) self:SetAddedPoints(addedPoints, true) self:RefreshSpinnerMax() self.pointsSpinner:SetValue(self.points + addedPoints) end function ZO_AttributeSpinner_Shared:SetValueChangedCallback(fn) self.valueChangedCallback = fn end function ZO_AttributeSpinner_Shared:SetAttributeType(attributeType) self.attributeType = attributeType self.perPoint = GetAttributeDerivedStatPerPointValue(attributeType, STAT_TYPES[attributeType]) end function ZO_AttributeSpinner_Shared:OnValueChanged(points) self:SetAddedPointsByTotalPoints(points) if(self.valueChangedCallback ~= nil) then self.valueChangedCallback(self.points, self.addedPoints) end self:RefreshSpinnerMax() end function ZO_AttributeSpinner_Shared:RefreshSpinnerMax() self.pointsSpinner:SetMinMax(self.points, self.points + self.addedPoints + self.attributeManager:GetAvailablePoints()) end function ZO_AttributeSpinner_Shared:RefreshPoints() self.points = GetAttributeSpentPoints(self.attributeType) self:RefreshSpinnerMax() self.pointsSpinner:SetValue(self.points) end function ZO_AttributeSpinner_Shared:ResetAddedPoints() self.addedPoints = 0 self:RefreshPoints() end function ZO_AttributeSpinner_Shared:GetPoints() return self.points end function ZO_AttributeSpinner_Shared:GetAllocatedPoints() return self.addedPoints end function ZO_AttributeSpinner_Shared:SetAddedPointsByTotalPoints(totalPoints) self:SetAddedPoints(totalPoints - self.points) end function ZO_AttributeSpinner_Shared:SetAddedPoints(points, force) points = zo_max(points, 0) local diff = points - self.addedPoints local availablePoints = self.attributeManager:GetAvailablePoints() if(force) then diff = 0 elseif diff > availablePoints then diff = availablePoints points = diff + self.addedPoints end self.addedPoints = points if(diff ~= 0) then self.attributeManager:SpendAvailablePoints(diff) end self.attributeManager:UpdatePendingStatBonuses(STAT_TYPES[self.attributeType], self.perPoint * self.addedPoints) end function ZO_AttributeSpinner_Shared:SetButtonsHidden(hidden) self.pointsSpinner:SetButtonsHidden(hidden) end
-- Implementation helper for metatable-based "classes" return function(class_table, superclass_table) if superclass_table then class_table.super = superclass_table setmetatable(class_table, superclass_table.metatable) end local new = assert(class_table.new) local metatable = { __index = class_table } function class_table.new(...) return setmetatable(new(...), metatable) end return class_table end
-- protoplug.lua -- basic globals for every protoplug script -- luaJIT ffi = require "ffi" bit = require "bit" -- load protoplug as a dynamic library using ffi protolib = ffi.load(protoplug_path) juce = require "include/protojuce" midi = require "include/core/midi" script = require "include/core/script" plugin = require "include/core/plugin" gui = require "include/core/gui" polyGen = require "include/core/polygen" stereoFx = require "include/core/stereofx"
local skynet = require "skynet.manager" local dc = require 'skynet.datacenter' local coroutine = require 'skynet.coroutine' local log = require 'utils.log' local function exec_all(cmd) local cmd = cmd..' 2>/dev/null' local f, err = io.popen(cmd) if not f then return nil, err end local s = f:read('*a') f:close() return s end local command = {} local command_running = {} function command.EXEC(cmd) log.debug("::EXEC_SAL:: Execute command:", cmd) command_running[coroutine.running()] = skynet.now() return exec_all(cmd) end function command.CLEAN() for k, v in pairs(command_running) do print(k, v) end end skynet.start(function() skynet.dispatch("lua", function(session, address, cmd, ...) local f = command[string.upper(cmd)] if f then skynet.ret(skynet.pack(f(...))) else error(string.format("Unknown command %s", tostring(cmd))) end end) skynet.register ".EXEC_SAL" skynet.fork(function() while true do command.CLEAN() skynet.sleep(500) end end) end)
ITEM.name = "Controller's Hand" ITEM.model ="models/lostsignalproject/items/parts/controler_hand.mdl" ITEM.description = "The hand of a dead controller." ITEM.longdesc = "The controller seems to use its hand when mentally attacking its prey. The scientists will gladly examine it in the hope of finding the source of mutation responsible for its psy-related powers. Smells like old socks and bad kimchee." ITEM.width = 1 ITEM.height = 1 ITEM.price = 8900 ITEM.pricepertier = 2100 ITEM.baseweight = 0.500 ITEM.varweight = 0.050
function Client_SaveConfigureUI(alert) Mod.Settings.AllowAIDeclaration = AIDeclerationcheckbox.GetIsChecked(); if(Mod.Settings.AllowAIDeclaration == nil)then Mod.Settings.AllowAIDeclaration = true; end Mod.Settings.AIsdeclearAIs = AIsdeclearAIsinitcheckbox.GetIsChecked(); if(Mod.Settings.AIsdeclearAIs == nil)then Mod.Settings.AIsdeclearAIs = true; end Mod.Settings.SeeAllyTerritories = SeeAllyTerritoriesCheckbox.GetIsChecked(); if(Mod.Settings.SeeAllyTerritories == nil)then Mod.Settings.SeeAllyTerritories = true; end Mod.Settings.PublicAllies = PublicAlliesCheckbox.GetIsChecked(); if(Mod.Settings.PublicAllies == nil)then Mod.Settings.PublicAllies = true; end Mod.Settings.SanctionCardRequireWar = inputSanctionCardRequireWar.GetIsChecked(); if(Mod.Settings.SanctionCardRequireWar == nil)then Mod.Settings.SanctionCardRequireWar = true; end Mod.Settings.SanctionCardRequirePeace = inputSanctionCardRequirePeace.GetIsChecked(); if(Mod.Settings.SanctionCardRequirePeace == nil)then Mod.Settings.SanctionCardRequirePeace = false; end Mod.Settings.SanctionCardRequireAlly = inputSanctionCardRequireAlly.GetIsChecked(); if(Mod.Settings.SanctionCardRequireAlly == nil)then Mod.Settings.SanctionCardRequireAlly = false; end Mod.Settings.BombCardRequireWar = inputBombCardRequireWar.GetIsChecked(); if(Mod.Settings.BombCardRequireWar == nil)then Mod.Settings.BombCardRequireWar = true; end Mod.Settings.BombCardRequirePeace = inputBombCardRequirePeace.GetIsChecked(); if(Mod.Settings.BombCardRequirePeace == nil)then Mod.Settings.BombCardRequirePeace = false; end Mod.Settings.BombCardRequireAlly = inputBombCardRequireAlly.GetIsChecked(); if(Mod.Settings.BombCardRequireAlly == nil)then Mod.Settings.BombCardRequireAlly = false; end Mod.Settings.SpyCardRequireWar = inputSpyCardRequireWar.GetIsChecked(); if(Mod.Settings.SpyCardRequireWar == nil)then Mod.Settings.SpyCardRequireWar = true; end Mod.Settings.SpyCardRequirePeace = inputSpyCardRequirePeace.GetIsChecked(); if(Mod.Settings.SpyCardRequirePeace == nil)then Mod.Settings.SpyCardRequirePeace = false; end Mod.Settings.SpyCardRequireAlly = inputSpyCardRequireAlly.GetIsChecked(); if(Mod.Settings.SpyCardRequireAlly == nil)then Mod.Settings.SpyCardRequireAlly = false; end Mod.Settings.GiftCardRequireWar = inputGiftCardRequireWar.GetIsChecked(); if(Mod.Settings.GiftCardRequireWar == nil)then Mod.Settings.GiftCardRequireWar = false; end Mod.Settings.GiftCardRequirePeace = inputGiftCardRequirePeace.GetIsChecked(); if(Mod.Settings.GiftCardRequirePeace == nil)then Mod.Settings.GiftCardRequirePeace = false; end Mod.Settings.GiftCardRequireAlly = inputGiftCardRequireAlly.GetIsChecked(); if(Mod.Settings.GiftCardRequireAlly == nil)then Mod.Settings.GiftCardRequireAlly = true; end Mod.Settings.StartWar = {}; end
Locales['br'] = { -- Global ['del_vehicle'] = '%s Enviou um veículo para o estacionamento.', ['hijack_vehicle'] = '%s tentou roubar um carro', ['reboot'] = 'Servidor aberto', ['sendBill'] = '%s deu uma conta para %s de "%s"(%s)', -- es_admin2 ['setbankmoney'] = '%s have set bank money of %s to %s.', ['setgroup'] = '%s have set %s group %s.', ['setmoney'] = '%s have set money of %s to %s.', ['setpermlvl'] = '%s have set %s to permission level %s.', -- esx_ambulancejob ['ambulance_bot_name'] = 'Registro de Ambulância', ['revive'] = '%s revivido %s', ['heal'] = '%s tratado %s', ['getitem'] = '%s levou alguns %s na farmácia do hospital.', -- esx_billing ['paybill'] = '%s paid the invoice of %s for %s $.', -- esx_lscustom ['buy_mod'] = '%s pagou %s pela mudança %s.', -- esx_mecanojob ['mecano_bot_name'] = 'Registro mecânico', ['getSharedInventorymecano'] = '%s removido x%s %s do cofre de Benny.', ['putStockItemsmecano'] = '%s depositou x%s %s do cofre de Benny.', ['fix_vehicle'] = '%s Reparar um veículo.', ['clean_vehicle'] = '%s Limpa um veículo.', ['dep_vehicle'] = '%s Reboque um veículo.', -- esx_policejob ['police_bot_name'] = 'Registo Policial', ['add_weapon'] = '%s adicionou uma arma no arsenal da delegacia.', ['confiscated'] = '%s confiscado x%s %s que pertencia a %s.', ['id_card'] = '%s verifiquei a identidade de %s', ['being_searched'] = '%s pesquisar em %s', ['getSharedInventory'] = '%s removido x%s %s do cofre na delegacia.', ['putStockItems'] = '%s depositou x%s %s para o cofre na delegacia.', ['removeArmoryWeapon'] = '%s tomou uma arma no arsenal da delegacia de polícia.', ['SendFine'] = '%s deu uma multa para %s para "%s"(%s)', -- esx_taxijob ['taxi_bot_name'] = 'Taxi Log', ['getSharedInventoryTaxi'] = '%s removido x%s %s do cofre do Taxi.', ['putStockItemsTaxi'] = '%s depositou x%s %s do cofre do Taxi.', -- esx_vehicleshop ['vehicleshop_bot_name'] = 'Car Dealer Log', ['carbuy'] = '%s bought a vehicle sold by %s. (Plate : %s ) - (Model : %s)', ['carbuysociety'] = '%s bought a society vehicle sold by %s. (Society : %s ) - (Model : %s)', ['carrent'] = '%s started renting ( (Plate : %s ) - (Model : %s))', ['carsold'] = '%s resold a vehicle. (Plate : %s ) - (Model : %s)', ['selfcarbuy'] = '%s bought a vehicle. (Plate : %s ) - (Model : %s)', }
--[[ s:UI Unit Frame Layout Generation: Role Element Martin Karer / Sezz, 2014 http://www.sezz.at --]] local S = Apollo.GetPackage("Gemini:Addon-1.1").tPackage:GetAddon("SezzUI"); local UnitFramesLayout = S:GetModule("UnitFramesCore"):GetModule("Layout"); -- Lua API local tinsert = table.insert; ----------------------------------------------------------------------------- function UnitFramesLayout:CreateRoleElement(strUnit) local tSettings = self.tSettings[strUnit]; if (not tSettings.bRoleEnabled) then return; end -- Create Container local tRole = { Name = "Role", AnchorPoints = tSettings.tRoleAnchorPoints, AnchorOffsets = tSettings.tRoleAnchorOffsets, IgnoreMouse = true, Picture = true, BGColor = "ffffffff", NoClip = true, UserData = { Element = "Role", }, }; tinsert(tSettings.tElements["HealthBar"].Children, tRole); tSettings.tElements["Role"] = tRole; end
local assets = { --Asset("ANIM", "anim/arrow_indicator.zip"), } local prefabs = { "babybeefalo", } local function InMood(inst) if inst.components.periodicspawner then inst.components.periodicspawner:Start() end if inst.components.herd then for k,v in pairs(inst.components.herd.members) do k:PushEvent("entermood") end end end local function LeaveMood(inst) if inst.components.periodicspawner then inst.components.periodicspawner:Stop() end if inst.components.herd then for k,v in pairs(inst.components.herd.members) do k:PushEvent("leavemood") end end inst.components.mood:CheckForMoodChange() end local function AddMember(inst, member) if inst.components.mood then if inst.components.mood:IsInMood() then member:PushEvent("entermood") else member:PushEvent("leavemood") end end end local function CanSpawn(inst) return inst.components.herd and not inst.components.herd:IsFull() end local function OnSpawned(inst, newent) if inst.components.herd then inst.components.herd:AddMember(newent) end end local function OnEmpty(inst) inst:Remove() end local function OnFull(inst) --TODO: mark some beefalo for death end local function fn(Sim) local inst = CreateEntity() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() --anim:SetBank("arrow_indicator") --anim:SetBuild("arrow_indicator") --anim:PlayAnimation("arrow_loop", true) inst:AddTag("herd") inst:AddComponent("herd") inst.components.herd:SetMemberTag("beefalo") inst.components.herd:SetGatherRange(40) inst.components.herd:SetUpdateRange(20) inst.components.herd:SetOnEmptyFn(OnEmpty) inst.components.herd:SetOnFullFn(OnFull) inst.components.herd:SetAddMemberFn(AddMember) inst:AddComponent("mood") inst.components.mood:SetMoodTimeInDays(TUNING.BEEFALO_MATING_SEASON_LENGTH, TUNING.BEEFALO_MATING_SEASON_WAIT) inst.components.mood:SetMoodSeason(SEASONS.SPRING) inst.components.mood:SetInMoodFn(InMood) inst.components.mood:SetLeaveMoodFn(LeaveMood) inst.components.mood:CheckForMoodChange() inst:AddComponent("periodicspawner") inst.components.periodicspawner:SetRandomTimes(TUNING.BEEFALO_MATING_SEASON_BABYDELAY, TUNING.BEEFALO_MATING_SEASON_BABYDELAY_VARIANCE) inst.components.periodicspawner:SetPrefab("babybeefalo") inst.components.periodicspawner:SetOnSpawnFn(OnSpawned) inst.components.periodicspawner:SetSpawnTestFn(CanSpawn) inst.components.periodicspawner:SetDensityInRange(20, 6) inst.components.periodicspawner:SetOnlySpawnOffscreen(true) return inst end return Prefab( "forest/animals/beefaloherd", fn, assets, prefabs)
SOUND_BUSINESS_BUY = "buttons/button14.wav" SOUND_BUSINESS_PREVENT_BUY = "buttons/button11.wav" SOUND_BUSINESS_PREVENT_RESPONSE = "buttons/button3.wav" SOUND_BUSINESS_PREVENT_TIMEOUT = "buttons/button11.wav" SOUND_CUSTOM_CHAT_SOUND = "" SOUND_F1_MENU_UNANCHOR = "buttons/lightswitch2.wav" SOUND_MENU_BUTTON_ROLLOVER = "ui/buttonrollover.wav" SOUND_MENU_BUTTON_PRESSED = "ui/buttonclickrelease.wav" SOUND_NOTIFY = {"garrysmod/content_downloaded.wav", 50, 250} SOUND_CHAR_HOVER = {"buttons/button15.wav", 35, 250} SOUND_CHAR_CLICK = {"buttons/button14.wav", 35, 255} SOUND_CHAR_WARNING = {"friends/friend_join.wav", 40, 255} SOUND_BAG_RESPONSE = {"physics/cardboard/cardboard_box_impact_soft2.wav", 50} SOUND_ATTRIBUTE_BUTTON = {"buttons/button16.wav", 30, 255} SOUND_VENDOR_CLICK = {"buttons/button15.wav", 30, 250}
C_Reputation = {} ---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Reputation.GetFactionParagonInfo) ---@param factionID number ---@return number currentValue ---@return number threshold ---@return number rewardQuestID ---@return boolean hasRewardPending ---@return boolean tooLowLevelForParagon function C_Reputation.GetFactionParagonInfo(factionID) end ---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Reputation.IsFactionParagon) ---@param factionID number ---@return boolean hasParagon function C_Reputation.IsFactionParagon(factionID) end ---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Reputation.RequestFactionParagonPreloadRewardData) ---@param factionID number function C_Reputation.RequestFactionParagonPreloadRewardData(factionID) end
local snips, autosnips = {}, {} snips = { s( { trig = '*([2-6])', name = 'Heading', dscr = 'Add Heading', regTrig = true, hidden = true }, { f(function(_, snip) return string.rep('*', tonumber(snip.captures[1])) .. ' ' end, {}) }, { condition = conds.line_begin } ), s( { trig = 'q([2-6])', name = 'Quote', dscr = 'Add Quote', regTrig = true, hidden = true }, { f(function(_, snip) return string.rep('>', tonumber(snip.captures[1])) .. ' ' end, {}) }, { condition = conds.line_begin } ), s( { trig = '-([2-6])', name = 'Unordered lists', dscr = 'Add Unordered lists', regTrig = true, hidden = true }, { f(function(_, snip) return string.rep('-', tonumber(snip.captures[1])) .. ' ' end, {}) }, { condition = conds.line_begin } ), s( { trig = '~([2-6])', name = 'Ordered lists', dscr = 'Add Ordered lists', regTrig = true, hidden = true }, { f(function(_, snip) return string.rep('~', tonumber(snip.captures[1])) .. ' ' end, {}) }, { condition = conds.line_begin } ), s( { trig = 'link', name = 'Neorg Links', dscr = 'Insert a Link' }, { t '{', i(1, 'url'), t '}[', i(2, 'title'), t ']' } ), s( { trig = 'code', name = 'code block' }, { t '@code ', i(1, 'lang'), t { '', '\t' }, i(0), t { '', '@end' } }, { condition = conds.line_begin } ), s( { trig = 'date', name = 'date block' }, { t { '@date', '\t' }, i(0), t { '', '@end' } }, { condition = conds.line_begin } ), s( { trig = 'table', name = 'table block' }, { t { '@table', '\t' }, i(0), t { '', '@end' } }, { condition = conds.line_begin } ), s( { trig = 'image', name = 'image block' }, { t { '@image png svg jpeg jfif exif', '\t' }, i(0), t { '', '@end' } }, { condition = conds.line_begin } ), s( { trig = 'embed', name = 'embed block' }, { t { '@embed', '\t' }, i(0), t { '', '@end' } }, { condition = conds.line_begin } ), s( { trig = 'math', name = 'math block' }, { t { '@math', '\t' }, i(0), t { '', '@end' } }, { condition = conds.line_begin } ), } autosnips = { s({ trig = ',b', name = 'bold' }, { t '*', i(1), t '*' }), s({ trig = ',i', name = 'italic' }, { t '/', i(1), t '/' }), s({ trig = ',u', name = 'underline' }, { t '_', i(1), t '_' }), s({ trig = ',s', name = 'strikethrough' }, { t '-', i(1), t '-' }), s({ trig = ',|', name = 'spoiler' }, { t '|', i(1), t '|' }), s({ trig = ',c', name = 'inline code' }, { t '`', i(1), t '`' }), s({ trig = ',^', name = 'subscript' }, { t '^', i(1), t '^' }), s({ trig = ',_', name = 'subscript' }, { t ',', i(1), t ',' }), s({ trig = 'mk', name = 'inline math' }, { t '$', i(1), t '$' }), s({ trig = ',v', name = 'variable' }, { t '=', i(1), t '=' }), s({ trig = ',+', name = 'comment' }, { t '+', i(1), t '+' }), } return snips, autosnips
local _, Engine = ... -- Lua functions local rawget = rawget -- WoW API / Variables local locale = GetLocale() local L = {} Engine.L = setmetatable(L, { __index = function(t, s) return rawget(t, s) or s end, }) if locale == 'zhCN' then L["Explosive Orbs"] = "爆炸物" L["Hit: "] = "击: " L["Show how many explosive orbs players target and hit."] = "显示玩家选中与击中不同爆炸物的次数。" L["Target: "] = "选: " elseif locale == 'zhTW' then L["Explosive Orbs"] = "炸藥" L["Hit: "] = "擊: " L["Show how many explosive orbs players target and hit."] = "顯示玩家選中與擊中不同炸藥的次數" L["Target: "] = "選: " elseif locale == 'deDE' then --[[Translation missing --]] --[[ L["Explosive Orbs"] = "Explosive Orbs"--]] --[[Translation missing --]] --[[ L["Hit: "] = "Hit: "--]] --[[Translation missing --]] --[[ L["Show how many explosive orbs players target and hit."] = "Show how many explosive orbs players target and hit."--]] --[[Translation missing --]] --[[ L["Target: "] = "Target: "--]] elseif locale == 'esES' then --[[Translation missing --]] --[[ L["Explosive Orbs"] = "Explosive Orbs"--]] --[[Translation missing --]] --[[ L["Hit: "] = "Hit: "--]] --[[Translation missing --]] --[[ L["Show how many explosive orbs players target and hit."] = "Show how many explosive orbs players target and hit."--]] --[[Translation missing --]] --[[ L["Target: "] = "Target: "--]] elseif locale == 'esMX' then --[[Translation missing --]] --[[ L["Explosive Orbs"] = "Explosive Orbs"--]] --[[Translation missing --]] --[[ L["Hit: "] = "Hit: "--]] --[[Translation missing --]] --[[ L["Show how many explosive orbs players target and hit."] = "Show how many explosive orbs players target and hit."--]] --[[Translation missing --]] --[[ L["Target: "] = "Target: "--]] elseif locale == 'frFR' then --[[Translation missing --]] --[[ L["Explosive Orbs"] = "Explosive Orbs"--]] --[[Translation missing --]] --[[ L["Hit: "] = "Hit: "--]] --[[Translation missing --]] --[[ L["Show how many explosive orbs players target and hit."] = "Show how many explosive orbs players target and hit."--]] --[[Translation missing --]] --[[ L["Target: "] = "Target: "--]] elseif locale == 'itIT' then --[[Translation missing --]] --[[ L["Explosive Orbs"] = "Explosive Orbs"--]] --[[Translation missing --]] --[[ L["Hit: "] = "Hit: "--]] --[[Translation missing --]] --[[ L["Show how many explosive orbs players target and hit."] = "Show how many explosive orbs players target and hit."--]] --[[Translation missing --]] --[[ L["Target: "] = "Target: "--]] elseif locale == 'koKR' then --[[Translation missing --]] --[[ L["Explosive Orbs"] = "Explosive Orbs"--]] --[[Translation missing --]] --[[ L["Hit: "] = "Hit: "--]] --[[Translation missing --]] --[[ L["Show how many explosive orbs players target and hit."] = "Show how many explosive orbs players target and hit."--]] --[[Translation missing --]] --[[ L["Target: "] = "Target: "--]] elseif locale == 'ptBR' then --[[Translation missing --]] --[[ L["Explosive Orbs"] = "Explosive Orbs"--]] --[[Translation missing --]] --[[ L["Hit: "] = "Hit: "--]] --[[Translation missing --]] --[[ L["Show how many explosive orbs players target and hit."] = "Show how many explosive orbs players target and hit."--]] --[[Translation missing --]] --[[ L["Target: "] = "Target: "--]] elseif locale == 'ruRU' then L["Explosive Orbs"] = "Взрывоопасная сфера" L["Hit: "] = "Урон:" L["Show how many explosive orbs players target and hit."] = "Отображает, сколько взрывоопасных сфер игроки выделяют и бьют." L["Target: "] = "Цель:" end
----------------------------------- -- Dragon Kick -- Hand-to-Hand weapon skill -- Skill Level: 225 -- Damage varies with TP. -- Will stack with Sneak Attack. -- Aligned with the Breeze Gorget & Thunder Gorget. -- Aligned with the Breeze Belt & Thunder Belt. -- Element: None -- Modifiers: STR:50% VIT:50% -- 100%TP 200%TP 300%TP -- 2.00 2.50 3.50 ----------------------------------- require("scripts/globals/status") require("scripts/globals/settings") require("scripts/globals/weaponskills") ----------------------------------- function onUseWeaponSkill(player, target, wsID, tp, primary, action, taChar) local params = {} params.numHits = 1 params.ftp100 = 2 params.ftp200 = 2.5 params.ftp300 = 3.5 params.str_wsc = 0.5 params.dex_wsc = 0.0 params.vit_wsc = 0.5 params.agi_wsc = 0.0 params.int_wsc = 0.0 params.mnd_wsc = 0.0 params.chr_wsc = 0.0 params.crit100 = 0.0 params.crit200 = 0.0 params.crit300 = 0.0 params.canCrit = false params.acc100 = 0.0 params.acc200= 0.0 params.acc300= 0.0 params.atk100 = 1; params.atk200 = 1; params.atk300 = 1; params.kick = true -- https://www.bluegartr.com/threads/112776-Dev-Tracker-Findings-Posts-%28NO-DISCUSSION%29?p=6712150&viewfull=1#post6712150 if (USE_ADOULIN_WEAPON_SKILL_CHANGES == true) then params.ftp100 = 2.0 params.ftp200 = 3.875 params.ftp300 = 7.0 end local damage, criticalHit, tpHits, extraHits = doPhysicalWeaponskill(player, target, wsID, params, tp, action, primary, taChar) return tpHits, extraHits, criticalHit, damage end
-- -- Please see the readme.txt file included with this distribution for -- attribution and copyright information. -- function getEffectStructures(nodeAbility) -- ACTOR local nodeChar = nil; if nodeAbility then nodeChar = nodeAbility.getChild("......."); end local rActor = CombatCommon.getActor("pc", nodeChar); local rEffect = {}; rEffect.sName = EffectsManager.evalEffect(rActor, NodeManager.get(nodeAbility, "label", "")); rEffect.sExpire = NodeManager.get(nodeAbility, "expiration", ""); rEffect.sApply = NodeManager.get(nodeAbility, "apply", ""); rEffect.sTargeting = NodeManager.get(nodeAbility, "targeting", ""); if rActor then rEffect.sSource = rActor.sCTNode; rEffect.nInit = NodeManager.get(rActor.nodeCT, "initresult", 0); else rEffect.sSource = ""; rEffect.nInit = 0; end return rActor, rEffect; end
local names = { "Color3", "Rect", "UDim", "UDim2", "Vector2", "Vector3", } local types = {} for _, name in ipairs(names) do types[name] = import("./" .. name) end return types
local Keys = { ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 } ESX = nil Citizen.CreateThread(function() while ESX == nil do TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Citizen.Wait(0) end end) function GetClosestPlayer() local players = GetPlayers() local closestDistance = -1 local closestPlayer = -1 local ply = PlayerPedId() local plyCoords = GetEntityCoords(ply) -- for index,value in ipairs(players) do local target = GetPlayerPed(value) if(target ~= ply) then local targetCoords = GetEntityCoords(GetPlayerPed(value), 0) local distance = GetDistanceBetweenCoords(targetCoords['x'], targetCoords['y'], targetCoords['z'], plyCoords['x'], plyCoords['y'], plyCoords['z'], true) print(target) if Config.ShowDistance > distance and IsPedDeadOrDying(target, 0) then closestPlayer = value break end end end -- return closestPlayer end function GetPlayers() local players = {} -- for i = 0, 1024 do if NetworkIsPlayerActive(i) then table.insert(players, i) end end -- return players end local drag = false local draggingPed = nil local animFinished = false local draggingPlayer = nil local Player = nil Citizen.CreateThread(function() while true do Citizen.Wait(7) local p1 = PlayerPedId() if not IsPedDeadOrDying(p1) and not drag then local p1pos = GetEntityCoords(p1) --print(Player) local p2 = GetPlayerPed(Player) local p2pos = GetEntityCoords(p2) if GetDistanceBetweenCoords(p2pos, p1pos, true) <= Config.ShowDistance then if IsPedDeadOrDying(p2, 0) then if GetEntityHealth(p2) <= 6 then SetEntityInvincible(p2, true) if GetDistanceBetweenCoords(p2pos, p1pos, true) <= Config.InteractDistance then DrawText3D(p2pos.x, p2pos.y, p2pos.z, '~w~[~b~E~w~] Drag') if IsControlJustPressed(0, 206) then drag = true draggingPed = p2 draggingPlayer = Player -- while not HasAnimDictLoaded('combat@drag_ped@') do RequestAnimDict('combat@drag_ped@') Wait(0) end -- local duration = 5700 TaskPlayAnim(p1, 'combat@drag_ped@', 'injured_pickup_back_plyr', 2.0, 2.0, duration, 1, 0, false, false, false) TriggerServerEvent('icemallow-drag-server:attach', GetPlayerServerId(Player)) Citizen.Wait(duration) animFinished = true TaskPlayAnim(p1, 'combat@drag_ped@', 'injured_drag_plyr', 2.0, 2.0, -1, 1, 0, false, false, false) end end end end end end end end) Citizen.CreateThread(function() local sleep = 500 while true do if Player == nil then sleep = 500 Player = GetClosestPlayer() else Player = GetClosestPlayer() sleep = 1000 end Citizen.Wait(sleep) end end) Citizen.CreateThread(function() local sleep = 5000 while true do if drag and animFinished then local playerPed = PlayerPedId() sleep = 7 if IsControlPressed(0, 30) then SetEntityHeading(playerPed, GetEntityHeading(playerPed)+0.5) elseif IsControlPressed(0, 34) then SetEntityHeading(playerPed, GetEntityHeading(playerPed)-0.5) end if IsControlJustPressed(0, 47) then drag = false animFinished = false draggingPed = nil RequestAnimDict('combat@drag_ped@') TaskPlayAnim(playerPed, 'combat@drag_ped@', 'injured_putdown_plyr', 2.0, 2.0, 5500, 1, 0, false, false, false) TriggerServerEvent('icemallow-drag-server:deattach', GetPlayerServerId(draggingPlayer)) draggingPlayer = nil end else sleep = 1000 end Citizen.Wait(sleep) end end) RegisterNetEvent('icemallow-drag:attach') AddEventHandler('icemallow-drag:attach', function(who) local p1 = PlayerPedId() local p2 = GetPlayerPed(GetPlayerFromServerId(who)) local coords = GetEntityCoords(p1) local coords2 = GetEntityCoords(p2) SetEntityCoordsNoOffset(p1, coords.x, coords.y, coords.z, false, false, false, true) NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, GetEntityHeading(p2), true, false) SetEntityHeading(p1, GetEntityHeading(p2)) SetEntityHealth(p1, GetPedMaxHealth(p1)) AttachEntityToEntity(p1, p2, 11816, 0.0, 0.5, 0.0, GetEntityRotation(coords2), false, false, true, false, 2, false) while not HasAnimDictLoaded('combat@drag_ped@') do RequestAnimDict('combat@drag_ped@') Wait(0) end TaskPlayAnim(p1, 'combat@drag_ped@', 'injured_pickup_back_ped', 2.0, 2.0, -1, 1, 0, false, false, false) --TriggerEvent('playerSpawned', coords.x, coords.y, coords.z) Citizen.Wait(5700) TaskPlayAnim(p1, 'combat@drag_ped@', 'injured_drag_ped', 2.0, 2.0, -1, 1, 0, false, false, false) TriggerServerEvent('esx_ambulancejob:setDeathStatus', false) end) RegisterNetEvent('icemallow-drag:deattach') AddEventHandler('icemallow-drag:deattach', function(who) local p1 = PlayerPedId() local p2 = GetPlayerPed(GetPlayerFromServerId(who)) RequestAnimDict('combat@drag_ped@') TaskPlayAnim(p1, 'combat@drag_ped@', 'injured_putdown_ped', 2.0, 2.0, 5700, 1, 0, false, false, false) Citizen.Wait(5700) DetachEntity(p1, true, true) SetEntityHealth(p1, 0) TriggerServerEvent('esx_ambulancejob:setDeathStatus', true) end) function DrawText3D(x, y, z, text) SetTextScale(0.30, 0.30) SetTextFont(8) SetTextProportional(1) SetTextColour(255, 255, 255, 215) SetTextEntry("STRING") SetTextCentre(true) AddTextComponentString(text) SetDrawOrigin(x,y,z, 0) DrawText(0.0, 0.0) local factor = (string.len(text)) / 370 DrawRect(0.0, 0.0+0.0125, 0.017+ factor, 0.03, 255, 51, 51, 80) ClearDrawOrigin() end
local strfind = string.find local strsub = string.sub --- Split a string into substrings according to a provided separator. -- @param sep The separator string. -- @param patterned If this parameter evaluates to true the separation is performed on search patterns, otherwise plain strings. -- @return A table with all strings as values in the order they were found. -- @usage string.split("/a:b/c:d/:", ":") -- returns { "/a", "b/c", "d/", "" } -- @usage string.split("/a:b/c:d/:", "[:/]", true) -- returns { "", "a", "b", "c", "d", "", "" } -- @usage string.split("/a:b/c:d/:", "[:/]") -- returns { "/a:b/c:d/:" } function string:split(sep, patterned) local list = {} local pos = 1 if(strfind("", sep, 1)) then -- this would result in endless loops error("delimiter matches empty string!", 2) end while 1 do local first, last = strfind(self, sep, pos, not patterned) if(first) then -- found? list[#list + 1] = strsub(self, pos, first - 1) pos = last + 1 else list[#list + 1] = strsub(self, pos) break end end return list end --- Return an iterator for splitting a string into substrings according to a provided separator. -- @param sep The separator string. -- @param patterned If this parameter evaluates to true the separation is performed on search patterns, otherwise plain strings. -- @return An iterator function to be used in for loops -- @usage for s, sep in string.gsplit(",a,b/c:d/", "[,/:]", true) do -- print(s, sep) -- print("----") -- end -- prints the lines -- > , -- > ---- -- > a , -- > ---- -- > b / -- > ---- -- > c : -- > ---- -- > d / -- > ---- -- > -- > ---- function string:gsplit(sep, patterned) if(strfind("", sep, 1)) then -- this would result in endless loops error("delimiter matches empty string!", 2) end local len = string.len(self) local pos = 1 return function() local first, last = strfind(self, sep, pos, not patterned) if(first) then -- found? local s1 = strsub(self, pos, first - 1) local s2 = strsub(self, first, last) pos = last + 1 return s1, s2 elseif(pos <= (len + 1)) then local s = strsub(self, pos) pos = len + 2 return s, "" end end end
if keyboard == nil then keyboard = {} end function keyboard.update( ) keyboard.up = love.keyboard.isDown("up") keyboard.down = love.keyboard.isDown("down") keyboard.left = love.keyboard.isDown("left") keyboard.right = love.keyboard.isDown("right") keyboard.space = love.keyboard.isDown(" ") end
fx_version 'bodacious' game 'gta5' author 'Nosmakos' description 'TGO Vending Machines' version '1.0.0' client_scripts { 'client/main.lua', 'config.lua' } server_scripts { 'server/main.lua', 'config.lua' }
object_ship_yt1300_tier6 = object_ship_shared_yt1300_tier6:new { } ObjectTemplates:addTemplate(object_ship_yt1300_tier6, "object/ship/yt1300_tier6.iff")
slot0 = class("FriendScene", import("..base.BaseUI")) slot0.FRIEND_PAGE = 1 slot0.SEARCH_PAGE = 2 slot0.REQUEST_PAGE = 3 slot0.BLACKLIST_PAGE = 4 slot0.getUIName = function (slot0) return "FriendUI" end slot0.setFriendVOs = function (slot0, slot1) slot0.friendVOs = slot1 end slot0.setPlayer = function (slot0, slot1) slot0.playerVO = slot1 end slot0.setRequests = function (slot0, slot1) slot0.requestVOs = slot1 end slot0.setSearchResult = function (slot0, slot1) slot0.searchResultVOs = slot1 end slot0.removeSearchResult = function (slot0, slot1) slot0.setSearchResult(slot0, _.select(slot0.searchResultVOs, function (slot0) return slot0.id ~= slot0 end)) end slot0.setBlackList = function (slot0, slot1) if slot1 then slot0.blackVOs = {} slot2 = pairs slot3 = slot1 or {} for slot5, slot6 in slot2(slot3) do table.insert(slot0.blackVOs, slot6) end end end slot0.init = function (slot0) slot0.pages = slot0:findTF("pages") slot0.togglesTF = slot0:findTF("blur_panel/adapt/left_length/frame/tagRoot") slot0.pages = { FriendListPage.New(slot0.pages, slot0.event, slot0.contextData), FriendSearchPage.New(slot0.pages, slot0.event), FriendRequestPage.New(slot0.pages, slot0.event), FriendBlackListPage.New(slot0.pages, slot0.event) } slot0.toggles = {} for slot4 = 1, slot0.togglesTF.childCount, 1 do slot0.toggles[slot4] = slot0.togglesTF:GetChild(slot4 - 1) onToggle(slot0, slot0.toggles[slot4], function (slot0) if slot0 then slot0:switchPage(slot0.switchPage) end end, SFX_PANEL) end slot0.chatTipContainer = slot0.toggles[1].Find(slot1, "count") slot0.chatTip = slot0.toggles[1]:Find("count/Text"):GetComponent(typeof(Text)) slot0.listEmptyTF = slot0:findTF("empty") setActive(slot0.listEmptyTF, false) slot0.listEmptyTxt = slot0:findTF("Text", slot0.listEmptyTF) end slot0.didEnter = function (slot0) onButton(slot0, slot0:findTF("blur_panel/adapt/top/back_btn"), function () slot0:emit(slot1.ON_BACK) end, SOUND_BACK) triggerToggle(slot0.toggles[slot0.contextData.initPage or 1], true) slot0.updateRequestTip(slot0) end slot0.wrapData = function (slot0) return { friendVOs = slot0.friendVOs, requestVOs = slot0.requestVOs, searchResults = slot0.searchResultVOs, blackVOs = slot0.blackVOs, playerVO = slot0.playerVO } end slot0.updateEmpty = function (slot0, slot1, slot2) slot3 = {} slot4 = "" if slot1 == slot0.FRIEND_PAGE then slot3 = slot2.friendVOs slot4 = i18n("list_empty_tip_friendui") elseif slot1 == slot0.SEARCH_PAGE then slot3 = slot2.searchResults slot4 = i18n("list_empty_tip_friendui_search") elseif slot1 == slot0.REQUEST_PAGE then slot3 = slot2.requestVOs slot4 = i18n("list_empty_tip_friendui_request") elseif slot1 == slot0.BLACKLIST_PAGE then slot3 = slot2.blackVOs slot4 = i18n("list_empty_tip_friendui_black") end setActive(slot0.listEmptyTF, not slot3 or #slot3 <= 0) setText(slot0.listEmptyTxt, slot4) end slot0.switchPage = function (slot0, slot1) if slot0.page then slot0.page:ExecuteAction("Hide") end slot0.pages[slot1].ExecuteAction(slot2, "Show") slot0.pages[slot1].ExecuteAction(slot2, "UpdateData", slot3) slot0.page = slot0.pages[slot1] slot0:updateEmpty(slot1, slot0:wrapData()) end slot0.updatePage = function (slot0, slot1) slot2 = slot0.pages[slot1] if slot0.page and slot2 == slot0.page then slot0.page:ExecuteAction("UpdateData", slot3) slot0:updateEmpty(slot1, slot0:wrapData()) end end slot0.updateChatNotification = function (slot0, slot1) setActive(slot0.chatTipContainer, slot1 > 0) slot0.chatTip.text = slot1 end slot0.updateRequestTip = function (slot0) setActive(slot0.toggles[3]:Find("tip"), #slot0.requestVOs > 0) end slot0.willExit = function (slot0) for slot4, slot5 in ipairs(slot0.pages) do slot5:Destroy() end end return slot0
soldiers = {} function spawnSoldier(x, y) soldier = world:newCircleCollider(x, y, 20, {collision_class = "Soldier"}) soldier:setType('static') soldier.dead = false soldier.life = 2 soldier.maxTime = 0.4 soldier.timer = soldier.maxTime table.insert(soldiers, soldier) end function updateSoldiers(dt) for i, s in ipairs(soldiers) do if distanceBetween(player:getX(), player:getY(), s:getX(), s:getY()) < 350 then s.timer = s.timer - dt if s.timer < 0 then createSoldierBullet(s:getX(), s:getY(), soldierPlayerAngle(s), s:getX(), s:getY()) sounds.gunShot:play() s.timer = s.maxTime end end end end function drawSoldiers() for i, s in ipairs(soldiers) do love.graphics.draw(sprites.soldier, s:getX(), s:getY(), soldierPlayerAngle(s), 0.3, 0.3, 80, 80) end end -- find the angle between player and the soldier function soldierPlayerAngle(soldier) return math.atan2(player:getY() - soldier:getY(), player:getX() - soldier:getX()) end
if not modules then modules = { } end modules ['char-utf'] = { version = 1.001, comment = "companion to char-utf.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } --[[ldx-- <p>When a sequence of <l n='utf'/> characters enters the application, it may be neccessary to collapse subsequences into their composed variant.</p> <p>This module implements methods for collapsing and expanding <l n='utf'/> sequences. We also provide means to deal with characters that are special to <l n='tex'/> as well as 8-bit characters that need to end up in special kinds of output (for instance <l n='pdf'/>).</p> <p>We implement these manipulations as filters. One can run multiple filters over a string.</p> --ldx]]-- local gsub, find = string.gsub, string.find local concat, sortedhash, keys, sort = table.concat, table.sortedhash, table.keys, table.sort local utfchar, utfbyte, utfcharacters, utfvalues = utf.char, utf.byte, utf.characters, utf.values local P, Cs, Cmt, Ct = lpeg.P, lpeg.Cs, lpeg.Cmt, lpeg.Ct if not characters then require("char-def") end if not characters.blocks then require("char-ini") end local lpegmatch = lpeg.match local lpegpatterns = lpeg.patterns local p_utf8character = lpegpatterns.utf8character local p_utf8byte = lpegpatterns.utf8byte local utfchartabletopattern = lpeg.utfchartabletopattern local formatters = string.formatters local allocate = utilities.storage.allocate or function() return { } end local charfromnumber = characters.fromnumber characters = characters or { } local characters = characters local graphemes = allocate() characters.graphemes = graphemes local collapsed = allocate() characters.collapsed = collapsed -- local combined = allocate() -- characters.combined = combined local decomposed = allocate() characters.decomposed = decomposed local mathpairs = allocate() characters.mathpairs = mathpairs local filters = allocate() characters.filters = filters local utffilters = { } characters.filters.utf = utffilters local data = characters.data --[[ldx-- <p>It only makes sense to collapse at runtime, since we don't expect source code to depend on collapsing.</p> --ldx]]-- -- for the moment, will be entries in char-def.lua .. this is just a subset that for -- typographic (font) reasons we want to have split ... if we decompose all, we get -- problems with fonts local decomposed = allocate { ["IJ"] = "IJ", ["ij"] = "ij", ["և"] = "եւ", ["ff"] = "ff", ["fi"] = "fi", ["fl"] = "fl", ["ffi"] = "ffi", ["ffl"] = "ffl", ["ſt"] = "ſt", ["st"] = "st", ["ﬓ"] = "մն", ["ﬔ"] = "մե", ["ﬕ"] = "մի", ["ﬖ"] = "վն", ["ﬗ"] = "մխ", } characters.decomposed = decomposed local function initialize() -- maybe in tex mode store in format ! local data = characters.data local function backtrack(v,last,target) local vs = v.specials if vs and #vs == 3 and vs[1] == "char" then local one, two = vs[2], vs[3] local first, second = utfchar(one), utfchar(two) .. last collapsed[first..second] = target backtrack(data[one],second,target) end end local function setpair(one,two,unicode,first,second,combination) local mps = mathpairs[one] if not mps then mps = { [two] = unicode } mathpairs[one] = mps else mps[two] = unicode end local mps = mathpairs[first] if not mps then mps = { [second] = combination } mathpairs[first] = mps else mps[second] = combination end end for unicode, v in next, data do local vs = v.specials if vs and #vs == 3 and vs[1] == "char" then -- local one, two = vs[2], vs[3] local first, second, combination = utfchar(one), utfchar(two), utfchar(unicode) -- collapsed[first..second] = combination backtrack(data[one],second,combination) -- sort of obsolete: local cgf = graphemes[first] if not cgf then cgf = { [second] = combination } graphemes[first] = cgf else cgf[second] = combination end -- if v.mathclass or v.mathspec then setpair(two,one,unicode,second,first,combination) -- watch order end end local mp = v.mathpair if mp then local one, two = mp[1], mp[2] local first, second, combination = utfchar(one), utfchar(two), utfchar(unicode) setpair(one,two,unicode,first,second,combination) end end initialize = false characters.initialize = function() end end characters.initialize = initialize --[[ldx-- <p>The next variant has lazy token collecting, on a 140 page mk.tex this saves about .25 seconds, which is understandable because we have no graphemes and not collecting tokens is not only faster but also saves garbage collecting. </p> --ldx]]-- local skippable = { } local filesuffix = file.suffix function utffilters.setskippable(suffix,value) if value == nil then value = true end if type(suffix) == "table" then for i=1,#suffix do skippable[suffix[i]] = value end else skippable[suffix] = value end end -- function utffilters.collapse(str,filename) -- we can make high a seperate pass (never needed with collapse) -- if skippable[filesuffix(filename)] then -- return str -- -- elseif find(filename,"^virtual://") then -- -- return str -- -- else -- -- -- print("\n"..filename) -- end -- if str and str ~= "" then -- local nstr = #str -- if nstr > 1 then -- if initialize then -- saves a call -- initialize() -- end -- local tokens, t, first, done, n = { }, 0, false, false, 0 -- for second in utfcharacters(str) do -- if done then -- if first then -- if second == " " then -- t = t + 1 -- tokens[t] = first -- first = second -- else -- -- local crs = high[second] -- -- if crs then -- -- t = t + 1 -- -- tokens[t] = first -- -- first = crs -- -- else -- local cgf = graphemes[first] -- if cgf and cgf[second] then -- first = cgf[second] -- else -- t = t + 1 -- tokens[t] = first -- first = second -- end -- -- end -- end -- elseif second == " " then -- first = second -- else -- -- local crs = high[second] -- -- if crs then -- -- first = crs -- -- else -- first = second -- -- end -- end -- elseif second == " " then -- first = nil -- n = n + 1 -- else -- -- local crs = high[second] -- -- if crs then -- -- for s in utfcharacters(str) do -- -- if n == 1 then -- -- break -- -- else -- -- t = t + 1 -- -- tokens[t] = s -- -- n = n - 1 -- -- end -- -- end -- -- if first then -- -- t = t + 1 -- -- tokens[t] = first -- -- end -- -- first = crs -- -- done = true -- -- else -- local cgf = graphemes[first] -- if cgf and cgf[second] then -- for s in utfcharacters(str) do -- if n == 1 then -- break -- else -- t = t + 1 -- tokens[t] = s -- n = n - 1 -- end -- end -- first = cgf[second] -- done = true -- else -- first = second -- n = n + 1 -- end -- -- end -- end -- end -- if done then -- if first then -- t = t + 1 -- tokens[t] = first -- end -- return concat(tokens) -- seldom called -- end -- elseif nstr > 0 then -- return high[str] or str -- this will go from here -- end -- end -- return str -- end -- this is about twice as fast local p_collapse = nil -- so we can reset if needed local function prepare() if initialize then initialize() end local tree = utfchartabletopattern(collapsed) p_collapse = Cs((tree/collapsed + p_utf8character)^0 * P(-1)) -- the P(1) is needed in order to accept non utf end function utffilters.collapse(str,filename) if not p_collapse then prepare() end if not str or #str == "" or #str == 1 then return str elseif filename and skippable[filesuffix(filename)] then -- we could hash the collapsables or do a quicker test return str else return lpegmatch(p_collapse,str) or str end end -- function utffilters.decompose(str) -- if str and str ~= "" then -- local nstr = #str -- if nstr > 1 then -- -- if initialize then -- saves a call -- -- initialize() -- -- end -- local tokens, t, done, n = { }, 0, false, 0 -- for s in utfcharacters(str) do -- local dec = decomposed[s] -- if dec then -- if not done then -- if n > 0 then -- for s in utfcharacters(str) do -- if n == 0 then -- break -- else -- t = t + 1 -- tokens[t] = s -- n = n - 1 -- end -- end -- end -- done = true -- end -- t = t + 1 -- tokens[t] = dec -- elseif done then -- t = t + 1 -- tokens[t] = s -- else -- n = n + 1 -- end -- end -- if done then -- return concat(tokens) -- seldom called -- end -- end -- end -- return str -- end -- local replacer = nil -- local finder = nil -- -- function utffilters.decompose(str) -- 3 to 4 times faster than the above -- if not replacer then -- if initialize then -- initialize() -- end -- local tree = utfchartabletopattern(decomposed) -- finder = lpeg.finder(tree,false,true) -- replacer = lpeg.replacer(tree,decomposed,false,true) -- end -- if str and str ~= "" and #str > 1 and lpegmatch(finder,str) then -- return lpegmatch(replacer,str) -- end -- return str -- end local p_decompose = nil local function prepare() if initialize then initialize() end local tree = utfchartabletopattern(decomposed) p_decompose = Cs((tree/decomposed + p_utf8character)^0 * P(-1)) end function utffilters.decompose(str,filename) -- 3 to 4 times faster than the above if not p_decompose then prepare() end if str and str ~= "" and #str > 1 then return lpegmatch(p_decompose,str) end if not str or #str == "" or #str < 2 then return str elseif filename and skippable[filesuffix(filename)] then return str else return lpegmatch(p_decompose,str) or str end return str end -- utffilters.addgrapheme(utfchar(318),'l','\string~') -- utffilters.addgrapheme('c','a','b') function utffilters.addgrapheme(result,first,second) -- can be U+ 0x string or utf or number local result = charfromnumber(result) local first = charfromnumber(first) local second = charfromnumber(second) if not graphemes[first] then graphemes[first] = { [second] = result } else graphemes[first][second] = result end local pair = first .. second if not composed[pair] then composed[pair] = result p_composed = nil end end if interfaces then -- eventually this goes to char-ctx.lua interfaces.implement { name = "addgrapheme", actions = utffilters.addgrapheme, arguments = { "string", "string", "string" } } end -- -- local p_reorder = nil -- local sorter = function(a,b) return b[2] < a[2] end -- -- local function swapper(s,p,t) -- local old = { } -- for i=1,#t do -- old[i] = t[i][1] -- end -- old = concat(old) -- sort(t,sorter) -- for i=1,#t do -- t[i] = t[i][1] -- end -- local new = concat(t) -- if old ~= new then -- print("reordered",old,"->",new) -- end -- return p, new -- end -- -- the next one isnto stable for similar weights local sorter = function(a,b) return b[2] < a[2] end local function swapper(s,p,t) sort(t,sorter) for i=1,#t do t[i] = t[i][1] end return p, concat(t) end -- -- the next one keeps similar weights in the original order -- -- local sorter = function(a,b) -- local b2, a2 = b[2], a[2] -- if a2 == b2 then -- return b[3] > a[3] -- else -- return b2 < a2 -- end -- end -- -- local function swapper(s,p,t) -- for i=1,#t do -- t[i][3] = i -- end -- sort(t,sorter) -- for i=1,#t do -- t[i] = t[i][1] -- end -- return p, concat(t) -- end -- at some point exceptions will become an option, for now it's an experiment -- to overcome bugs (that have become features) in unicode .. or we might decide -- for an extra ordering key in char-def that takes precedence over combining local exceptions = { -- frozen unicode bug ["َّ"] = "َّ", -- U+64E .. U+651 => U+651 .. U+64E } local function prepare() local hash = { } for k, v in sortedhash(characters.data) do local combining = v.combining -- v.ordering or v.combining if combining then hash[utfchar(k)] = { utfchar(k), combining, 0 } -- slot 3 can be used in sort end end local e = utfchartabletopattern(exceptions) local p = utfchartabletopattern(hash) p_reorder = Cs((e/exceptions + Cmt(Ct((p/hash)^2),swapper) + p_utf8character)^0) * P(-1) end function utffilters.reorder(str,filename) if not p_reorder then prepare() end if not str or #str == "" or #str < 2 then return str elseif filename and skippable[filesuffix(filename)] then return str else return lpegmatch(p_reorder,str) or str end return str end -- local collapse = utffilters.collapse -- local decompose = utffilters.decompose -- local preprocess = utffilters.preprocess -- -- local c1, c2, c3 = "a", "̂", "̃" -- local r2, r3 = "â", "ẫ" -- local l1 = "ffl" -- -- local str = c1..c2..c3 .. " " .. c1..c2 .. " " .. l1 -- local res = r3 .. " " .. r2 .. " " .. "ffl" -- -- local text = io.loaddata("t:/sources/tufte.tex") -- -- local function test(n) -- local data = text .. string.rep(str,100) .. text -- local okay = text .. string.rep(res,100) .. text -- local t = os.clock() -- for i=1,10000 do -- collapse(data) -- decompose(data) -- -- preprocess(data) -- end -- print(os.clock()-t,decompose(collapse(data))==okay,decompose(collapse(str))) -- end -- -- test(050) -- test(150) -- -- local old = "foo" .. string.char(0xE1) .. "bar" -- local new = collapse(old) -- print(old,new) -- local one_old = "فَأَصَّدَّقَ دَّ" local one_new = utffilters.reorder(one_old) -- local two_old = "فَأَصَّدَّقَ دَّ" local two_new = utffilters.reorder(two_old) -- -- print(one_old,two_old,one_old==two_old,false) -- print(one_new,two_new,one_new==two_new,true) -- -- local test = "foo" .. utf.reverse("ؚ" .. "ً" .. "ٌ" .. "ٍ" .. "َ" .. "ُ" .. "ِ" .. "ّ" .. "ْ" ) .. "bar" -- local done = utffilters.reorder(test) -- -- print(test,done,test==done,false) local f_default = formatters["[%U] "] local f_description = formatters["[%s] "] local function convert(n) local d = data[n] d = d and d.description if d then return f_description(d) else return f_default(n) end end local pattern = Cs((p_utf8byte / convert)^1) function utffilters.verbose(data) return data and lpegmatch(pattern,data) or "" end return characters
local L = LibStub("AceLocale-3.0"):NewLocale("EPGP", "ruRU") if not L then return end L["%+d EP (%s) to %s"] = "%+d EP (%s) для %s" L["%+d GP (%s) to %s"] = "%+d GP (%s) для %s" L["'%s' - expected 'on' or 'off', or no argument to toggle."] = "'%s' - ожидает 'on', 'off' или отсутствие аргумента при переключении." L["'%s' - expected 'on', 'off' or 'default', or no argument to toggle."] = "'%s' - ожидает 'on', 'off', 'default' или отсутствие аргумента при переключении." L["'%s' - expected 'RRGGBB' or 'r g b'."] = "'%s' - ожидает 'RRGGBB' или 'r g b'." L["'%s' - expected 'RRGGBBAA' or 'r g b a'."] = "'%s' - ожидает 'RRGGBBAA' или 'r g b a'." L["'%s' - Invalid Keybinding."] = "'%s' - неправильная привязка клавиш" L["'%s' - values must all be either in the range 0..1 or 0..255."] = "'%s' - все значения должны быть в диапазонах 0...1 или 0...255" L["'%s' - values must all be either in the range 0-1 or 0-255."] = "'%s' - все значения должны быть в диапазонах 0 - 1 или 0 - 255" L["%s %s"] = true L["'%s' '%s' - expected 'on' or 'off', or no argument to toggle."] = "'%s' '%s' - ожидает 'on', 'off' или отсутствие аргумента при переключении." L["'%s' '%s' - expected 'on', 'off' or 'default', or no argument to toggle."] = "'%s' '%s' - ожидает 'on', 'off', 'default' или отсутствие аргумента при переключении." L["%s is added to the award list"] = "%s добавлен в список награждения" L["%s is already in the award list"] = "%s уже находится в списке награждения" L["%s is dead. Award EP?"] = "%s мёртв. Начислить ЕР?" L["%s is not eligible for EP awards"] = "%s не подходит для начисления ЕР" L["%s is not in the award list now. Whisper me 'epgp standby' to enlist again."] = " %s сейчас нет в списке наград. Напишите мне 'epgp standby' чтобы снова зачислить." L["%s is now removed from the award list. Whisper me 'epgp standby' to enlist again."] = "%s теперь удален из списка наград. Напишите мне 'epgp standby' чтобы снова зачислить." L["%s to %s"] = "%s для %s" L["%s, %s, %s"] = " %s, %s, %s" L["%s: %+d EP (%s) to %s"] = "%s: %+d EP (%s) для %s" L["%s: %+d GP (%s) to %s"] = "%s: %+d GP (%s) для %s" L["%s: %s to %s"] = "%s: %s для %s" L["/roll if you want this item. DO NOT roll more than one time."] = "/roll, если вам нужен этот предмет. НЕ НАДО ролить больше одного раза." L["[%s] has been added into trust list."] = "[%s] добавлен в список доверия (белый список)." L["[%s] has been updated."] = "[%s] был обновлен." L["[%s] is comming!"] = "[%s] приближается!" L["[EPGP auto reply] "] = "[Автоответчик EPGP]" L["A member is awarded EP"] = "Члену начисляют EP" L["A member is credited GP"] = "Члену начисляют GP" --[[Translation missing --]] --[[ L["A new tier is here!"] = ""--]] L["A new tier is here! You should probably reset or rescale GP (Interface -> Options -> AddOns -> EPGP)!"] = "Новый ТИР здесь! Вероятно, вы должны сбросить или пересчитать GP (Интерфейс -> ... -> EPGP)!" L["Accepting settings from [%s]..."] = "Принятие настроек от [%s] ..." L["Add loot items automatically when loot windows opened or corpse loot received."] = "Добавляет предметы добычи автоматически при открытии окон добычи или получении добычи с тела." --[[Translation missing --]] --[[ L["Adjust all main toons' GP?"] = ""--]] L["Allow adding [name] into standby list by whispering \"epgp standby [name]\" if enabled."] = "Разрешает добавление [имя] в список ожидания, прошептав «epgp standby [имя]», если включено." --[[Translation missing --]] --[[ L["Allow whisper for others"] = ""--]] L["ALLOW_NEGATIVE_EP_DESC"] = "Разрешите чьему-то EP быть отрицательным целым числом. Функция тестируется, возможны ошибки." L["ALLOW_NEGATIVE_EP_NAME"] = "Разрешить отрицательный EP (функция тестируется)" L["Alts"] = "Альты" L["An item was disenchanted or deposited into the guild bank"] = "Предмет был распылен или передан в гильд банк" L["Announce"] = "Оповещение" L["Announce EP/GP/PR when a member need/greed/bid"] = "Объявлять EP/GP/PR когда игрок жмет need/greed/bid" L["Announce epic loot from corpses"] = "Сообщить об эпической добычи с трупа" L["Announce medium"] = "Оповещение среднего" L["Announce need message"] = "Объявлять нажатие need" L["Announce when someone in your raid derps a bonus roll"] = "Оповещать, когда кто нибудь из рейда имеет бонус к роллу " L["Announce when someone in your raid wins something good with bonus roll"] = "Сообщить, если кто-либо в Вашем рейде выиграл что-то благодаря бонусному броску" L["Announce when:"] = "Оповещать, когда:" L["Announcement of EPGP actions"] = "Оповещение действий EPGP" L["Announces EPGP actions to the specified medium."] = "Объявлять о действиях EPGP в указанный канал." L["Auto popup"] = "Автоматическое всплывающее окно" L["Automatic boss tracking"] = "Автоматическое отслеживание боссов" L["Automatic boss tracking by means of a popup to mass award EP to the raid and standby when a boss is killed."] = "Автоматическое отслеживание боссов посредством всплывающего окна для массового начисления EP участникам рейда и резерву, когда босс убит." L["Automatic handling of the standby list through whispers when in raid. When this is enabled, the standby list is cleared after each reward."] = "Автоматически обрабатывать список резерва через /шепот, когда в рейде. Список резерва очищается после каждого начисления." L["Automatic loot tracking"] = "Авто отслеживание добычи" L["Automatic loot tracking by means of a popup to assign GP to the toon that received loot. This option only has effect if you are in a raid and you are either the Raid Leader or the Master Looter."] = "Автоматически выводить окно для начисления GP при получение вещей игроками. Эта опция работает только в рейде и только если Вы Рейд Лидер или Лут Мастер." L["Award EP"] = "Начислить ЕР" L["Awards for wipes on bosses. Requires DBM, DXE, or BigWigs"] = "Награды за вайпы (смерти) на боссах. Требует DBM, DXE или BigWigs." L["Base GP should be a positive number (>= 0)"] = "Базовый GP должен быть положительным числом (>= 0)" L["Bid medium"] = "Средняя ставка" L["Blackwing Lair"] = "Логово крыла тьмы" L["Bonus roll for %s (%s left): got %s (ilvl %d)"] = "Дополнительный бросок для %s (%s left): получено %s (ilvl %d)" L["Bonus roll for %s (%s left): got gold"] = "Дополнительный бросок для %s (%s left): получено золото" --[[Translation missing --]] --[[ L["BOSS_AUTO_REWARD_DESC"] = ""--]] --[[Translation missing --]] --[[ L["BOSS_AUTO_REWARD_NAME"] = ""--]] --[[Translation missing --]] --[[ L["BOSS_AUTO_REWARD_START"] = ""--]] --[[Translation missing --]] --[[ L["BOSS_AUTO_REWARD_STOP"] = ""--]] --[[Translation missing --]] --[[ L["BOSS_KILL_AUTO_AWARD_0_EP_DESC"] = ""--]] --[[Translation missing --]] --[[ L["BOSS_WIPE_AUTO_AWARD_0_EP_DESC"] = ""--]] L["Clear"] = "Очистить" --[[Translation missing --]] --[[ L["Collect bid/roll message to help sorting"] = ""--]] --[[Translation missing --]] --[[ L["COMBATLOG_ENABLE_FAIL"] = ""--]] --[[Translation missing --]] --[[ L["COMBATLOG_ENABLE_REMIND_MSG"] = ""--]] --[[Translation missing --]] --[[ L["COMBATLOG_IS_LOGGING"] = ""--]] --[[Translation missing --]] --[[ L["COMBATLOG_REMIND_ENABLE_DESC"] = ""--]] --[[Translation missing --]] --[[ L["COMBATLOG_REMIND_ENABLE_NAME"] = ""--]] --[[Translation missing --]] --[[ L["Comment %d"] = ""--]] L["Credit GP"] = "Начислить GP" L["Credit GP to %s"] = "Начислить GP для игрока %s" L["Custom announce channel name"] = "Имя произвольного канала для объявлений " --[[Translation missing --]] --[[ L["Custom items list has been reseted."] = ""--]] L["Decay"] = "Снижение" --[[Translation missing --]] --[[ L["Decay BASE_GP should be 0 or 1"] = ""--]] L["Decay EP and GP by %d%%?"] = "Уменьшить EP и GP на %d%%?" L["Decay of EP/GP by %d%%"] = "Уменьшение EP/GP на %d%%" L["Decay Percent should be a number between 0 and 100"] = "Процент cнижения должен быть числом между 0 и 100" --[[Translation missing --]] --[[ L["DECAY_BASE_GP_DESC"] = ""--]] --[[Translation missing --]] --[[ L["DECAY_BASE_GP_TEXT"] = ""--]] --[[Translation missing --]] --[[ L["DECAY_P_DESC"] = ""--]] L["default"] = "по умолчанию" --[[Translation missing --]] --[[ L["DIST_ANNOUNCE_PR_FMT_DESC"] = ""--]] --[[Translation missing --]] --[[ L["DIST_ANNOUNCE_PR_FMT_NAME"] = ""--]] --[[Translation missing --]] --[[ L["Distribution"] = ""--]] L["Do you want to resume recurring award (%s) %d EP/%s?"] = "Продолжить начисление EP (%s) %d EP/%s?" L["EP Reason"] = "Причина для начисления EP" L["EP/GP are reset"] = "Значения EP/GP сброшено" --[[Translation missing --]] --[[ L["EP/GP/PR announce medium"] = ""--]] L["EPGP decay"] = "Снижение EPGP" L["EPGP is an in game, relational loot distribution system"] = "EPGP - это внутриигровая система распределения добычи, основанная на соотношении рейтингов" L["EPGP is using Officer Notes for data storage. Do you really want to edit the Officer Note by hand?"] = "EPGP использует офицерские заметки для хранения данных. Вы действительно хотите изменить офицерские заметки вручную?" L["EPGP reset"] = "Сброс EPGP" --[[Translation missing --]] --[[ L["Equation"] = ""--]] L["expected number"] = "обнаружено число" L["Export"] = "Экспорт" --[[Translation missing --]] --[[ L["Export Detail"] = ""--]] --[[Translation missing --]] --[[ L["EXPORT_DETAIL_DESC"] = ""--]] L["Extras Percent should be a number between 0 and 100"] = "Дополнительный процент должен быть числом между 0 и 100" --[[Translation missing --]] --[[ L["EXTRAS_P_DESC"] = ""--]] --[[Translation missing --]] --[[ L["Gear Points"] = ""--]] --[[Translation missing --]] --[[ L["Global configuration"] = ""--]] L["GP (not EP) is reset"] = "GP (но не EP) сброшены" L["GP (not ep) reset"] = "GP (но не EP) сброс" L["GP is rescaled for the new tier"] = "GP пересчитаны для нового тира" L["GP on tooltips"] = "GP в подсказках" L["GP Reason"] = "Причина для начисления GP" L["GP rescale for new tier"] = "Пересчет GP для нового тира" --[[Translation missing --]] --[[ L["Guild info has been updated."] = ""--]] L["Guild or Raid are awarded EP"] = "Гильдии или рейду предоставляют EP" L["Hint: You can open these options by typing /epgp config"] = "Подсказка: Вы можете открыть это окно настроек, набрав /epgp config" --[[Translation missing --]] --[[ L["Icon"] = ""--]] L["Idle"] = "Бездействие" L["If you want to be on the award list but you are not in the raid, you need to whisper me: 'epgp standby' or 'epgp standby <name>' where <name> is the toon that should receive awards"] = "Если вы хотите быть в списке замены, но не находитесь в рейде, вы должны шепнуть мне 'epgp standby' или 'epgp standby <имя>', где <имя> - имя игрока, который будет находиться на замене." L["Ignoring EP change for unknown member %s"] = "Игнорировать изменения EP для неизвестного игрока %s" L["Ignoring GP change for unknown member %s"] = "Игнорировать изменения GP для неизвестного игрока %s" L["Import"] = "Импорт" L["Importing data snapshot taken at: %s"] = "Импорт данных за: %s" L["invalid input"] = "ошибка ввода" L["Invalid officer note [%s] for %s (ignored)"] = "Неверная офицерская заметка [%s] для %s (проигнорирована)" --[[Translation missing --]] --[[ L["kill"] = ""--]] --[[Translation missing --]] --[[ L["Legendary Scale"] = ""--]] L["List errors"] = "Выводить ошибки" L["Lists errors during officer note parsing to the default chat frame. Examples are members with an invalid officer note."] = "Выводить ошибки при разборе офицерских заметок в стандартное окно чата. Например, для игроков с некорректными офицерскими заметками." --[[Translation missing --]] --[[ L["Logs"] = ""--]] --[[Translation missing --]] --[[ L["Loot list is almost full (%d/%d)."] = ""--]] --[[Translation missing --]] --[[ L["Loot list is full (%d). %s will not be added into list."] = ""--]] --[[Translation missing --]] --[[ L["Loot list: "] = ""--]] L["Loot tracking threshold"] = "Порог отслеживания добычи" --[[Translation missing --]] --[[ L["LOOT_ITEM_LOG_CLEAR_MSG"] = ""--]] --[[Translation missing --]] --[[ L["LOOT_ITEM_LOG_CLEAR_NAME"] = ""--]] --[[Translation missing --]] --[[ L["LOOT_ITEM_LOG_HEADER"] = ""--]] --[[Translation missing --]] --[[ L["LOOT_ITEM_LOG_SHOW_NUMBER_NAME"] = ""--]] --[[Translation missing --]] --[[ L["LOOT_RECORD_ITEM_LOG_DESC"] = ""--]] --[[Translation missing --]] --[[ L["LOOT_RECORD_ITEM_LOG_NAME"] = ""--]] L["Main"] = "Мэйн" L["Make sure you are the only person changing EP and GP. If you have multiple people changing EP and GP at the same time, for example one awarding EP and another crediting GP, you *are* going to have data loss."] = "Убедитесь, что только вы начисляете EP и GP. Если несколько людей изменяют EP и GP одновременно, например, один начисляет EP, а другой - GP, то это может привести к потере данных." --[[Translation missing --]] --[[ L["Mass Adjust GP"] = ""--]] L["Mass EP Award"] = "Массовое начисление EP" --[[Translation missing --]] --[[ L["MASS_ADJUST_GP_DESC"] = ""--]] --[[Translation missing --]] --[[ L["Message announced when you start a need/greed bid."] = ""--]] L["Min EP should be a positive number (>= 0)"] = "Минимальное значение EP должно быть положительным числом (>= 0)" --[[Translation missing --]] --[[ L["Multiplier %d"] = ""--]] L["must be equal to or higher than %s"] = "должно быть равно или больше чем %s" L["must be equal to or lower than %s"] = "должно быть равно или меньше, чем %s" --[[Translation missing --]] --[[ L["Naxxramas"] = ""--]] --[[Translation missing --]] --[[ L["Need/greed medium"] = ""--]] --[[Translation missing --]] --[[ L["NEW_VERSION_INTRO_1_5_0"] = ""--]] L["Next award in "] = "Следующее начисление через" --[[Translation missing --]] --[[ L["Non-hunter"] = ""--]] --[[Translation missing --]] --[[ L["Non-tank"] = ""--]] L["off"] = "выкл" L["on"] = "вкл" L["Only display GP values for items at or above this quality."] = "Отображать значения GP только для предметов заданного или лучшего качества" L["Open the configuration options"] = "Открыть настройки конфигурации" L["Open the debug window"] = "Открыть окно отладки" L["Outsiders should be 0 or 1"] = "Outsiders должно быть 0 или 1" --[[Translation missing --]] --[[ L["OUTSIDERS_DESC"] = ""--]] L["Paste import data here"] = "Вставьте сюда данные для импорта" L["Personal Action Log"] = "Персональная история изменений" --[[Translation missing --]] --[[ L["Please send bid value to raid channel."] = ""--]] --[[Translation missing --]] --[[ L["Please send number to raid channel: "] = ""--]] --[[Translation missing --]] --[[ L["Please whisper bid value to me."] = ""--]] --[[Translation missing --]] --[[ L["Please whisper number to me: "] = ""--]] L["Protect Time (sec)"] = "Время защиты (сек)" L["Provide a proposed GP value of armor on tooltips. Quest items or tokens that can be traded for armor will also have a proposed GP value."] = "Отображать значения GP во всплывающих подсказках к предметам. Предметы, необходимые для заданий, а также токены, которые можно обменять на вещи, также будут иметь предлагаемые значения GP. " L["Quality threshold"] = "Порог качества" --[[Translation missing --]] --[[ L["Recommend value before next tier:"] = ""--]] --[[Translation missing --]] --[[ L["Recommend value in current tier:"] = ""--]] L["Recurring"] = "Повторяющийся" L["Recurring awards resume"] = "Продолжить начисление EP" L["Recurring awards start"] = "Начать начисление EP" L["Recurring awards stop"] = "Прекратить начисление EP" L["Redo"] = "Повторить" L["Re-scale all main toons' GP to current tier?"] = "Пересчитать GP всех основных персонажей для текущего ТИРа?" L["Rescale GP"] = "Пересчет GP" L["Rescale GP of all members of the guild. This will reduce all main toons' GP by a tier worth of value. Use with care!"] = "Пересчет GP всех членов гильдии. Это уменьшит GP всех основных персонажей до актуального значения. Использовать с осторожностью!" L["Reset all main toons' EP and GP to 0?"] = "Сбросить значения EP и GP до 0 для всех основных персонажей?" L["Reset all main toons' GP to 0?"] = "Сбросить GP всех основных чаров на 0?" L["Reset EPGP"] = "Сброс EPGP" --[[Translation missing --]] --[[ L["Reset GP"] = ""--]] L["Reset only GP"] = "Сбросить только GP" --[[Translation missing --]] --[[ L["Reset result when announce and start a bid/need/roll."] = ""--]] --[[Translation missing --]] --[[ L["Reset when announce a bid"] = ""--]] L["Resets EP and GP of all members of the guild. This will set all main toons' EP and GP to 0. Use with care!"] = "Сброс EP и GP для всех членов гильдии. Это установит все значения EP и GP на 0. Использовать осторожно!" L["Resets GP (not EP!) of all members of the guild. This will set all main toons' GP to 0. Use with care!"] = "Сброс GP (но не EP) всех членов гильдии. Это установит GP всех основных чаров на 0. Использовать с осторожностью!" L["Resume recurring award (%s) %d EP/%s"] = "Продолжить начисление EP (%s) %d EP/%s" L["Select all"] = "Выбрать все" --[[Translation missing --]] --[[ L["Sending: %d / %d"] = ""--]] --[[Translation missing --]] --[[ L["Set gear points (GP multiplier). Each slot could set up to 3 points. Each points has a custom comment."] = ""--]] --[[Translation missing --]] --[[ L["Sets loot tracking threshold, to disable the adding on loot below this threshold quality."] = ""--]] L["Sets loot tracking threshold, to disable the popup on loot below this threshold quality."] = "Порог отслеживания добычи. Всплывающее окно не появляется при получении предмета ниже этого порогового качества." --[[Translation missing --]] --[[ L["Sets the announce medium EPGP will use to announce distribution actions."] = ""--]] L["Sets the announce medium EPGP will use to announce EPGP actions."] = "Установить канал для объявлений, который EPGP будет использовать для объявлений о своих действиях" L["Sets the custom announce channel name used to announce EPGP actions."] = "Назначить название нестандартного канала для объявления о действиях EPGP." --[[Translation missing --]] --[[ L["Sets the medium EPGP will use to collect bid results from members."] = ""--]] --[[Translation missing --]] --[[ L["Sets the medium EPGP will use to collect need/greed results from members."] = ""--]] --[[Translation missing --]] --[[ L["Settings sent from trusted members will be accepted without asking."] = ""--]] --[[Translation missing --]] --[[ L["SETTINGS_RECEIVED_POPUP_TEXT"] = ""--]] --[[Translation missing --]] --[[ L["should be a none-zero integer"] = ""--]] --[[Translation missing --]] --[[ L["Should be a non-negative integer"] = ""--]] --[[Translation missing --]] --[[ L["should be a positive integer"] = ""--]] L["Show everyone"] = "Показать всех" --[[Translation missing --]] --[[ L["Show item level"] = ""--]] --[[Translation missing --]] --[[ L["Slots"] = ""--]] L["Some english word"] = "Какое-то английское слово" L["Some english word that doesn't exist"] = "Какое-то несуществующее английское слово" L["Standby"] = "Ожидание" --[[Translation missing --]] --[[ L["Standby for others is NOT allowed. Whisper 'epgp standby' instead."] = ""--]] L["Standby whispers in raid"] = "Шепот резерва в рейд" L["Start recurring award (%s) %d EP/%s"] = "Начать периодическое начисление (%s) %d EP/%s" L["Stop recurring award"] = "Остановить периодическое начисление" L["string1"] = true --[[Translation missing --]] --[[ L["Sync finished."] = ""--]] --[[Translation missing --]] --[[ L["Sync settings to guild ranks:"] = ""--]] --[[Translation missing --]] --[[ L["Sync to:"] = ""--]] --[[Translation missing --]] --[[ L["Temple of Ahn'Qiraj"] = ""--]] L["The imported data is invalid"] = "Импортируемые данные неверны" --[[Translation missing --]] --[[ L["The standby list will be cleared x seconds after each reward."] = ""--]] --[[Translation missing --]] --[[ L["Time protect"] = ""--]] L["To export the current standings, copy the text below and post it to: %s"] = "Для экспорта текущих данных скопируйте текст, расположенный ниже, и вставьте его в: %s" L["To restore to an earlier version of the standings, copy and paste the text from: %s"] = "Для восстановления предыдущей версии данных, скопируйте и вставьте текст отсюда: %s" L["Tooltip"] = "Подсказка" --[[Translation missing --]] --[[ L["Track loot items"] = ""--]] --[[Translation missing --]] --[[ L["Trust"] = ""--]] --[[Translation missing --]] --[[ L["Trust list (seperate with ',')"] = ""--]] L["Undo"] = "Отменить" L["unknown argument"] = "неизвестный аргумент" L["unknown selection"] = "неизвестный выбор" --[[Translation missing --]] --[[ L["Use custom global configuration"] = ""--]] L["Using %s for boss kill tracking"] = "Используется %s для отслеживания убийства боссов" L["Value"] = "Значение" --[[Translation missing --]] --[[ L["Web & WeChat Mini Program"] = ""--]] --[[Translation missing --]] --[[ L["When a new tier comes, you may like to increase [standard_ilvl]. That can avoid large gear points. If you do that, a GP rescaling is recommended. Everyone's GP will be changed."] = ""--]] --[[Translation missing --]] --[[ L["WHETHER_TO_START_BOSS_AUTO_REWARD"] = ""--]] L["Whisper"] = "Шепот" --[[Translation missing --]] --[[ L["wipe"] = ""--]] L["Wipe awards"] = "Начисление за вайпы" L["Wiped on %s. Award EP?"] = "Вайп на %s. Начислить EP?" --[[Translation missing --]] --[[ L["Write into Guild Info"] = ""--]] L["You can now check your epgp standings and loot on the web: http://www.epgpweb.com"] = "Вы можете сохранить рейтинг epgp и полученный лут в Интернете: http://www.epgpweb.com" --[[Translation missing --]] --[[ L["You may need to deselect \"Show only members\" on EPGP web after uploading."] = ""--]] --[[Translation missing --]] --[[ L["You should probably: increase standard_ilvl, reset or rescale GP."] = ""--]]
mgmini.zero_noise = { offset = 0, scale = 0, seed = 0, spread = {x=80,y=80,z=80}, octaves = 1, persistance = 0.5, lacunarity = 1.5, --flags = nil, } mgmini.ave_val_def = function(value) minetest.log("error", "Average value noise used") local noise = table.copy(mgmini.zero_noise) noise.offset = value return noise end