content
stringlengths
5
1.05M
local common = require "common" local Terrain = {} Terrain.__index = Terrain function Terrain.new(args) local terrain = {} setmetatable(terrain, Terrain) terrain.blocks = {} local block = { x = 0, y = 0.5, width = 256, height = 1, } terrain.blocks[block] = true game.draws.scene[terrain] = Terrain.draw game.names.terrain = terrain return terrain end function Terrain:destroy() game.names.terrain = nil game.draws.scene[self] = nil self.body:destroy() end function Terrain:draw() love.graphics.setColor(255, 255, 255, 255) for block, _ in pairs(self.blocks) do -- love.graphics.rectangle("fill", block.x - 0.5 * block.width, block.y - 0.5 * block.height, block.width, block.height) end end return Terrain
local world = {} local net = api_require("network") local packets = api_require("packets") local event = api_require("event") function world:broadcast(component) local chatPacket = packets.newChatMessagePacket(component, "chat") for k, player in pairs(self.players) do net.writePacket(player.socket, chatPacket) end end function world:moveEntity(entity, x, y, z) entity.x = x entity.y = y entity.z = z event.send("entity_move", entity, x, y, z) if not entity.lastX then entity.lastX = 0 entity.lastY = 0 entity.lastZ = 0 end local dx,dy,dz = entity.x-entity.lastX, entity.y-entity.lastY, entity.z-entity.lastZ local dist = math.sqrt(dx*dx + dy*dy + dz*dz) if dist > 0.5 then entity.lastX = entity.x entity.lastY = entity.y entity.lastZ = entity.z local movePacket = packets.newEntityTeleportPacket(entity) for k, player in pairs(self.players) do if player.entityId ~= entity.id then net.writePacket(player.socket, movePacket) end end end end function world:rotateEntity(entity, yaw, pitch) entity.yaw = yaw entity.pitch = pitch event.send("entity_rotate", entity, yaw, pitch) local movePacket = packets.newEntityTeleportPacket(entity) for k, player in pairs(self.players) do if player.entityId ~= entity.id then net.writePacket(player.socket, movePacket) end end end function world:addPlayer(player) local ss = net.stringStream() net.writeVarInt(ss, 0) -- add player net.writeVarInt(ss, 1) net.writeUUID(ss, player.uuid) net.writeString(ss, player.name) net.writeVarInt(ss, 0) -- 0 properties net.writeVarInt(ss, player.gamemode) net.writeVarInt(ss, -1) -- unknown ping net.writeBoolean(ss, false) -- no display name local addPacket = { id = 0x34, -- player info data = ss.str } local spawnPacket = packets.newSpawnPlayerPacket(player) for k, player in pairs(self.players) do net.writePacket(player.socket, addPacket) net.writePacket(player.socket, spawnPacket) end self.players[player.uuid] = player end function world:setBlock(location, id) local x,y,z = location[1], location[2], location[3] local name = x..","..y..","..z if self.changedBlocks[name] then self.changedBlocks[name].newId = id else self.changedBlocks[name] = { x = location[1], y = location[2], z = location[3], newId = id } end local changePacket = packets.newBlockChangePacket(location, id) for k, player in pairs(self.players) do net.writePacket(player.socket, changePacket) end end function world:setRaining(raining) local reason = (raining and 2) or 1 local packet = packets.newGameStatePacket(reason, 0) for k, player in pairs(self.players) do net.writePacket(player.socket, packet) end end return world
local old = workspace.CameraSystemOld local new = workspace.CameraSystem for i,v in pairs(old.Cameras.StaticCams:GetChildren()) do v.Parent = new.Cameras.Static v.Name = v.Namer.Value v.Namer:Destroy() v.Camera.Name = "Cam" end for i,v in pairs(old.Cameras.MovingCams:GetChildren()) do v.Parent = new.Cameras.Moving v.Name = v.Namer.Value v.Namer:Destroy() for a,b in pairs(v:GetChildren()) do if b:IsA("BasePart") then b.Name = string.sub(b.Name,4) end end end local default = old.Cameras.DefaultCam.Camera default.Name = "DefaultCam" default.Parent = new.Cameras
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerScriptService = game:GetService("ServerScriptService") local replicatedRequire = require(ReplicatedStorage:WaitForChild("Nevermore")) local nevermoreServerRequire = require(ServerScriptService:WaitForChild("Nevermore")) local requiredModule = replicatedRequire("ComponentBase") local nevermoreRequire = require(ReplicatedStorage:WaitForChild(Nevermore)) local module = { NevermoreRequire = nevermoreRequire } return module
-- https://wowpedia.fandom.com/wiki/LanguageID local Util = require("Util/Util") local parser = require("Util/wowtoolsparser") local dbc_patch = require("Projects/DBC/DBC_patch") local OUTPUT = "out/page/LanguageID.txt" local wpIcon = { [8] = "{{ClassIcon|Demon Hunter}}", -- Demonic [10] = "{{Alliance}}{{Horde}}", -- blood elf, void elf [42] = "{{Alliance}}{{Horde}}", -- 7.0.3 cross faction communication [178] = "[[File:ClassIcon priest.png|16px|link=Voidform]]", -- Shath'Yar } local allianceIcon = { [2] = true, -- Darnassian [6] = true, -- Dwarvish [7] = true, -- Common [13] = true, -- Gnomish [35] = true, -- Draenei [37] = true, -- Gnomish Binary [42] = true, -- Pandaren } local hordeIcon = { [1] = true, -- Orcish [3] = true, -- Taurahe [10] = true, -- Thalassian [14] = true, -- Zandali [33] = true, -- Forsaken [38] = true, -- Goblin Binary [40] = true, -- Goblin [181] = true, -- Shalassian [285] = true, -- Vulpera } local wpLink = { [1] = "Orcish (language)", [7] = "Common (language)", [9] = "Titan (language)", [13] = "Gnomish (language)", [33] = "Gutterspeak", [35] = "Draenei (language)", [36] = "Zombie (language)", [40] = "Goblin (language)", [42] = "Pandaren (language)", [43] = "Pandaren (language)", [44] = "Pandaren (language)", [168] = "Sprite (language)", [180] = "Moonkin Stone (PTR)", [285] = "Vulpera (language)", } local function main(options) options = Util:GetFlavorOptions(options) options.initial = false local patchData = dbc_patch:GetPatchData("languages", options) local fs = "|-\n| %d || %s || %s || %s\n" print("writing to "..OUTPUT) local file = io.open(OUTPUT, "w") file:write('{| class="sortable darktable zebra col1-center col2-center"\n! ID !! !! Name !! Patch\n') Util:ReadCSV("languages", parser, options, function(_, ID, l) local icon if wpIcon[ID] then icon = wpIcon[ID] else if allianceIcon[ID] then icon = "Alliance" elseif hordeIcon[ID] then icon = "Horde" end icon = icon and string.format("{{%s}}", icon) or "" end local name if wpLink[ID] then name = string.format("[[%s|%s]]", wpLink[ID], l.Name_lang) else name = string.format("[[%s]]", l.Name_lang) end local patch = patchData[ID] and Util:GetPatchVersion(patchData[ID]) or "" if patch == Util.PtrVersion then patch = patch.." {{Test-inline}}" end file:write(fs:format(ID, icon or "", name, patch)) end) file:write("|}\n") file:close() end main() -- ["ptr", "mainline", "classic"] print("done")
function emptyFunc() end function nickFormat(p) if p:sub(1,1) == "*" then return p else return string.gsub(p:lower(), '%a', function(k) return string.upper(k) end, 1) end end function nickHashtag(data, doNotNormalize) local nickname = data:gmatch('(.-)#[0-9]+$')() or data local tag = data:gmatch('#([0-9]+)$')() or '0000' nickname = doNotNormalize and nickname or nickname:lower():gsub('%a', string.upper, 1) return nickname, tag end function nickLength(p) local cont = 0 local tier = {["_"]=3, M=3, m=3, W=3, w=3, i=1, l=1} for i=1, #p do cont = cont + (tier[p:sub(i,i)] or 2) end return cont end function nickMinifier(p) local l = 21 if nickLength(p) > l then local tier = {["_"]=3, M=3, m=3, W=3, w=3, i=1, l=1} local cont = 0 for i=1, #p do cont = cont + (tier[p:sub(i,i)] or 2) if cont >= l-1 then return p:sub(1,i).."." end end return p:sub(1,9).."." else return p end end function whichNick(p) if tfm.get.room.playerList[nickFormat(p)] then return nickFormat(p) else p = nickHashtag(p) local found = {} for i, v in pairs(tfm.get.room.playerList) do if nickHashtag(i) == p then table.insert(found, i) end end if #found == 1 then return found[1] end end end function isAdm(p) return ADM[p] end function roomOwner() local n = tfm.get.room.name:match("#unotfm%d+(.*)") if n and #n > 3 then local arg = split(n, " ") arg = split(arg[1], "-") arg = split(arg[1], "#") return #arg[1] >= 3 and nickFormat(arg[1]) end end function split(t,s) -- retorna uma table com a string dividida -- -- String t = texto a ser dividido -- -- String s = símbolo de separação (opcional) local a={} for i,v in string.gmatch(t,string.format("[^%s]+",s or "%s")) do table.insert(a,i) end return a end function explosion(id, x, y, vezes, vel) -- faz uma mini explosão de partículas -- -- Number id = id das partículas -- -- Number x = coordenada x do centro -- -- Number y = coordenada y do centro -- -- Number vezes = número de partículas -- -- Number vel = velocidade máxima for i=1, vezes do tfm.exec.displayParticle(id, x, y, math.random(-vel,vel)/10, math.random(-vel,vel)/10, 0, 0) end end --[[ function translate(p, k, a, b, c, d, e) -- Retorna o texto correspondente à comunidade do jogador fornecido, requer tabela LANG -- -- String p = nome de um jogador -- -- String k = chave de tradução -- -- Return = String local cmm = "en" cmm = PLAYER[p] and PLAYER[p].community or "auto" cmm = cmm == "auto" and tfm.get.room.playerList[p] and tfm.get.room.playerList[p].community or cmm --if tfm.get.room.playerList[p] and tfm.get.room.playerList[p].community then -- cmm = tfm.get.room.playerList[p].community --end return a and string.format(LANG[cmm] and LANG[cmm][k] or LANG.en[k] or ("$" .. k), a, b, c, d, e) or (LANG[cmm] and LANG[cmm][k] or LANG.en[k] or ("$" .. k)) end ]]-- LANGT = {en=1, br=2, fr=3, ru=4, es=5, cn=6, pl=7, hu=8, tr=9} function translate(p, k, a, b, c, d, e) if not k then return "#ERROR" end if not LANG[k] then return "$"..k end local cmm = PLAYER[p] and PLAYER[p].community or "auto" cmm = cmm == "auto" and tfm.get.room.playerList[p] and tfm.get.room.playerList[p].community or cmm cmm = LANGT[cmm] or 1 cmm = (not LANG[k][cmm] or LANG[k][cmm] == "") and 1 or cmm return a and string.format(LANG[k][cmm], a, b, c, d, e) or LANG[k][cmm] end function translatedChatMessage(k, p, a, b, c, d, e) -- Mostra o texto traduzido no chat, requer função translate() -- -- String k = chave de tradução -- -- String p = nome de um jogador, se nil será exibido para todos if p then tfm.exec.chatMessage(translate(p, k, a, b, c, d, e), p) else for i in pairs(tfm.get.room.playerList) do tfm.exec.chatMessage(translate(i, k), i) end end end EVENT_MAP = { [1] = {map={"@7312582", "@7578073"}, day=15, rate=0.04, pityTimer=15}, [2] = {map={"@7894773"}, day=2, rate=0.07, pityTimer=8}, [5] = {map={"@7432492"}, day=1, rate=0.07, pityTimer=8}, [10] = {map={"@7279009"}, day=31, rate=0.07, pityTimer=8}, [12] = {map={"@7322204", "@7366545"}, day=25, rate=0.07, pityTimer=8}, } if not CONFIG.eventRoom then table.insert(EVENT_MAP[2].map, "@7312582") table.insert(EVENT_MAP[2].map, "@7578073") table.insert(EVENT_MAP[5].map, "@7312582") table.insert(EVENT_MAP[5].map, "@7578073") table.insert(EVENT_MAP[10].map, "@7312582") table.insert(EVENT_MAP[10].map, "@7578073") table.insert(EVENT_MAP[12].map, "@7312582") table.insert(EVENT_MAP[12].map, "@7578073") end function updateEventMap() local month = tonumber(os.date("%m")) local event = EVENT_MAP[month] or EVENT_MAP[1] CONFIG.mapEvent = event.map CONFIG.eventRate = event.rate CONFIG.pityTimer = event.pityTimer CONFIG.dayEvent = event.day end function newMap() updateEventMap() local map = MAP[math.random(#MAP)] print(CONFIG.ranked) print(CONFIG.eventRoom) print(tonumber(os.date("%d"))) if CONFIG.ranked and CONFIG.eventRoom and tonumber(os.date("%d")) == 15 then map = {"@7312582", "@7578073"} elseif CONFIG.ranked and CONFIG.eventRoom and CONFIG.dayEvent == tonumber(os.date("%d")) then map = CONFIG.mapEvent elseif tfm.get.room.uniquePlayers >= 6 and CONFIG.ranked and not CONFIG.noRules then if CONFIG.mapEvent and (math.random() < CONFIG.eventRate or CONFIG.actualTimer >= CONFIG.pityTimer) then CONFIG.actualTimer = 0 map = CONFIG.mapEvent else CONFIG.actualTimer = CONFIG.actualTimer + 1 end end if type(map) == "table" then map = map[math.random(#map)] end tfm.exec.newGame(map) end function validMap() if tfm.get.room.currentMap:sub(1,1)=="@" and tfm.get.room.xmlMapInfo then local str = string.match(tfm.get.room.xmlMapInfo.xml, 'Chair="(.-)"') if str then return split(str) end end end function quote(p, key, add) local find = false for i, v in pairs(ROUND.chair) do if v.owner == p and v.mode ~= "DELETED" then find = true break end end if CONFIG.ranked and find then for i, v in pairs(tfm.get.room.playerList) do tfm.exec.chatMessage(string.format("<v>[%s] <n>%s", p, string.format(translate(i, key), add)), i) end end end function quoteFake(p, msg) for i, v in pairs(tfm.get.room.playerList) do tfm.exec.chatMessage(string.format("<v>[%s] <n>%s", p, msg), i) end end function allChairs() if ROUND and ROUND.chair then local p = 0 local cont = 0 for i, v in pairs(ROUND.gameMode) do if BOT[nickFormat(i)] then p = p + 1 end end for i, v in pairs(tfm.get.room.playerList) do if i:sub(1,1) ~= "*" then p = p + 1 end end for i, v in pairs(ROUND.chair) do if v.mode == "BUSY" then cont = cont + 1 end end if cont > 1 and cont == #ROUND.chair or p == cont then return true end end end function colorNick(p) local color = 0 if p == OWNER then color = 0xFFB677 elseif isAdm(p) then color = 0x77C6FF elseif BANNED[p] then color = 0xFF7777 end tfm.exec.setNameColor(p, color) end function countRules(rules) local cont = 0 for i, v in pairs(rules) do if not RULE[i].notCount then cont = cont + 1 end end return cont end function validRoom() if ROUND.chair then local cont = 0 for i, v in pairs(ROUND.chair) do if v.mode ~= "DELETED" then cont = cont + 1 end end if cont >= 4 and tfm.get.room.uniquePlayers >= cont and CONFIG.ranked or RANKED then return true end end end
local ui = 0 local inside = false local last_check = false local refreshTimer = 0 local Shops = nil local Selling = nil local Buying = nil local currentType function OnPackageStart() ui = CreateWebUI(0, 0, 0, 0, 5, 60) LoadWebFile(ui, "http://asset/kuz_Essentials/shops/gui/shops.html") SetWebAlignment(ui, 0.0, 0.0) SetWebAnchors(ui, 0.0, 0.0, 1.0, 1.0) SetWebVisibility(ui, WEB_HIDDEN) Delay(10000, function () refreshTimer = CreateTimer(CheckInShop, 500) Shops = Shop.Shops Selling = Shop.Selling Buying = Shop.Buying end) end AddEvent("OnPackageStart", OnPackageStart) function CheckInShop() local x,y,z = GetPlayerLocation() local got = false local i = 1 for _ in pairs(Shops) do if GetDistance3D(x,y,z,Shops[i].x, Shops[i].y, Shops[i].z) <= 200 then inside = true got = true CallEvent("KNotify:SendPress", "Press [E] to open shop") currentType = Shops[i].type end i = i + 1 end if last_check and not inside then CallEvent("KNotify:HidePress") end if not got then inside = false end if not inside then currentType = 0 end last_check = inside end local cooldown = false function OnKeyPress(key) if key == "E" and inside and currentType ~= 0 and not cooldown then cooldown = true CallRemoteEvent("Kuzkay:ShopOpenShopMenu", currentType) Delay(500, function() cooldown = false end) end end AddEvent("OnKeyPress", OnKeyPress)
local winW,winH = love.graphics.getWidth(), love.graphics.getHeight() local plyrW = 40 local lTargs = { {x = 375, y = 400}, {x = 400, y = 450}, } local rTargs = { {x = 425, y = 400}, {x = 400, y = 450} } return { tileString = [[ -------------------------------- -------------------------------- -------------------------------- --####--------------------####-- -#---##------------------##---#- ##----####################----## ###----##################----### ####----################----#### #####----##############----##### ######----############----###### #######----##########----####### ########----########----######## #########----######----######### ##########----####----########## ###########----##----########### ############--------############ #############------############# ##############----############## ###############--############### ###############--############### ################################ ################################ ################################ ################################ ]], -- Player.x (number) playerX = 400 - plyrW/2, -- Player.y (number) playerY = 390, -- Enemies (table of tables) enemies = { {type = "enemy", mode = "straight", x = 50, y = 100, w = 12.5, h = 12.5, control = ai.new(lTargs)}, {type = "enemy", mode = "straight", x = 725, y = 100, w = 12.5, h = 12.5, control = ai.new(rTargs)}, } }
class("GuildQuitCommand", pm.SimpleCommand).execute = function (slot0, slot1) pg.ConnectionMgr.GetInstance():Send(60018, { id = slot1:getBody() }, 60019, function (slot0) if slot0.result == 0 then getProxy(GuildProxy).exitGuild(slot1) slot0:sendNotification(GAME.GUILD_QUIT_DONE) slot2 = getProxy(PlayerProxy) slot3 = slot2:getData() slot3:setGuildWaitTime(pg.TimeMgr.GetInstance():GetServerTime() + 86400) slot2:updatePlayer(slot3) pg.TipsMgr.GetInstance():ShowTips(i18n("guild_quit_sucess")) else pg.TipsMgr.GetInstance():ShowTips(errorTip("guild_quit_erro", slot0.result)) end end) end return class("GuildQuitCommand", pm.SimpleCommand)
local mod = get_mod("ExecLua") local pl = require'pl.import_into'() --- Disable the F2 console that was intended for hosted servers. mod:hook_origin("RconUI", "_update_input", function() end) mod.simple_ui = get_mod("SimpleUI") mod:dofile("scripts/mods/"..mod:get_name().."/snippets") mod.exec_window_size = {1200, 1750} mod.exec_window_position = { 0, 0 } mod.lines = pl.List() mod.textboxes = pl.List{} mod.exec_window_was_destroyed = false mod.do_exec = function() mod:pcall(function() local context = {} context.mod = mod context.pl = pl setmetatable(context, { __index = _G }) local exec_text = mod.textboxes:map(function(textbox) return textbox.text end):join('\n') local exec = loadstring(exec_text) if exec then setfenv(exec, context) exec() end end) end mod.create_exec_window = function() local screen_width = UIResolution() mod.exec_window = mod.simple_ui:create_window("presets", mod.exec_window_position, mod.exec_window_size) mod.exec_window.position = mod.exec_window_position mod.exec_window:create_title("presets_title", "Execute Lua", 40) local presets_close_button = mod.exec_window:create_close_button("presets_close_button") presets_close_button.anchor = "top_right" mod.textboxes = pl.List{} local start_y = 65 for i = 1, 100 do local textbox = mod.exec_window:create_textbox(i.."_label", {0, start_y+i*31}, {1000, 30}, "middle_top" ) textbox.text = mod.lines[i] or "" mod.textboxes:append(textbox) end local execute_button = mod.exec_window:create_button("execute_button", {0, 50}, {150, 40}, "middle_top", "Execute") execute_button.on_click = function() mod.do_exec() end mod.exec_window.before_destroy = function(window) mod.exec_window_was_destroyed = true end mod.exec_window.on_hover_enter = function(window) window:focus() end mod.exec_window:init() mod.exec_window.transparent = false mod.exec_window.theme.color[1] = 255 -- accounts for a scaling issue in SimpleUI on 1440p local exec_window_width = mod.exec_window.size[1] mod.exec_window_position[2] = -900 mod.exec_window_position[1] = screen_width/2 - exec_window_width/2 end mod.destroy_exec_window = function() if mod.exec_window then mod.exec_window:destroy() mod.exec_window = nil end end mod.set_lines = function(lines) mod.lines = lines for i, textbox in ipairs( mod.textboxes ) do textbox.text = mod.lines[i] or "" end end mod:hook("ChatGui", "update", function(func, self, ...) mod:pcall(function() if Keyboard.pressed(Keyboard.button_index("f2")) then if mod.exec_window then mod.destroy_exec_window() mod.destroy_snippets_window() else self:block_input() mod.create_exec_window() mod.create_snippets_window() end end if mod.exec_window_was_destroyed then mod.exec_window_was_destroyed = false self:unblock_input() end -- mostly VMF code for pasting into chat if Keyboard.pressed(Keyboard.button_index("v")) and Keyboard.button(Keyboard.button_index("left ctrl")) == 1 then local newly_pasted = "" -- remove carriage returns local clipboard_data = tostring(Clipboard.get()):gsub("\r", "") -- remove invalid characters if Utf8.valid(clipboard_data) then newly_pasted = newly_pasted .. clipboard_data else local valid_data = "" clipboard_data:gsub(".", function(c) if Utf8.valid(c) then valid_data = valid_data .. c end end) newly_pasted = newly_pasted .. valid_data end mod.pasted = newly_pasted mod.set_lines(pl.stringx.splitlines(newly_pasted)) end end) return func(self, ...) end) mod.on_game_state_changed = function(status, state) if status == "enter" and state == "StateIngame" then mod.load_snippets() end end mod:command("refresh_snippets", "Refresh snippets.", function() mod.load_snippets() end)
--- === cp.apple.finalcutpro.export.SaveSheet === --- --- Save Sheet local require = require local axutils = require("cp.ui.axutils") local GoToPrompt = require("cp.apple.finalcutpro.export.GoToPrompt") local prop = require("cp.prop") local ReplaceAlert = require("cp.apple.finalcutpro.export.ReplaceAlert") local TextField = require("cp.ui.TextField") local SaveSheet = {} --- cp.apple.finalcutpro.export.SaveSheet.matches(element) -> boolean --- Function --- Checks to see if an element matches what we think it should be. --- --- Parameters: --- * element - An `axuielementObject` to check. --- --- Returns: --- * `true` if matches otherwise `false` function SaveSheet.matches(element) if element then return element:attributeValue("AXRole") == "AXSheet" end return false end --- cp.apple.finalcutpro.export.SaveSheet.new(app) -> SaveSheet --- Function --- Creates a new SaveSheet object. --- --- Parameters: --- * app - The `cp.apple.finalcutpro` object. --- --- Returns: --- * A new SaveSheet object. function SaveSheet.new(parent) local o = {_parent = parent} return prop.extend(o, SaveSheet) end --- cp.apple.finalcutpro.export.SaveSheet:parent() -> object --- Method --- Returns the Parent object. --- --- Parameters: --- * None --- --- Returns: --- * The parent object. function SaveSheet:parent() return self._parent end --- cp.apple.finalcutpro.export.SaveSheet:app() -> App --- Method --- Returns the App instance representing Final Cut Pro. --- --- Parameters: --- * None --- --- Returns: --- * App function SaveSheet:app() return self:parent():app() end --- cp.apple.finalcutpro.export.SaveSheet:UI() -> axuielementObject --- Method --- Returns the Save Sheet Accessibility Object --- --- Parameters: --- * None --- --- Returns: --- * An `axuielementObject` or `nil` function SaveSheet:UI() return axutils.cache(self, "_ui", function() return axutils.childMatching(self:parent():UI(), SaveSheet.matches) end, SaveSheet.matches) end --- cp.apple.finalcutpro.export.SaveSheet <cp.prop: boolean; read-only> --- Field --- Is the Save Sheet showing? SaveSheet.isShowing = prop.new(function(self) return self:UI() ~= nil or self:replaceAlert():isShowing() end):bind(SaveSheet) --- cp.apple.finalcutpro.export.SaveSheet:hide() -> none --- Method --- Hides the Save Sheet --- --- Parameters: --- * None --- --- Returns: --- * None function SaveSheet:hide() self:pressCancel() end --- cp.apple.finalcutpro.export.SaveSheet:pressCancel() -> cp.apple.finalcutpro.export.SaveSheet --- Method --- Presses the Cancel Button. --- --- Parameters: --- * None --- --- Returns: --- * The `cp.apple.finalcutpro.export.SaveSheet` object for method chaining. function SaveSheet:pressCancel() local ui = self:UI() if ui then local btn = ui:cancelButton() if btn then btn:doPress() end end return self end --- cp.apple.finalcutpro.export.SaveSheet:pressSave() -> cp.apple.finalcutpro.export.SaveSheet --- Method --- Presses the Save Button. --- --- Parameters: --- * None --- --- Returns: --- * The `cp.apple.finalcutpro.export.SaveSheet` object for method chaining. function SaveSheet:pressSave() local ui = self:UI() if ui then local btn = ui:defaultButton() if btn and btn:enabled() then btn:doPress() end end return self end --- cp.apple.finalcutpro.export.SaveSheet:getTitle() -> string | nil --- Method --- The title of the Save Sheet window or `nil`. --- --- Parameters: --- * None --- --- Returns: --- * The title of the Save Sheet window as a string or `nil`. function SaveSheet:getTitle() local ui = self:UI() return ui and ui:title() end --- cp.apple.finalcutpro.export.SaveSheet:filename() -> TextField --- Method --- Returns the Save Sheet Filename Text Field. --- --- Parameters: --- * None --- --- Returns: --- * The title of the Save Sheet window as a string or `nil`. function SaveSheet:filename() if not self._filename then self._filename = TextField(self, function() return axutils.childWithRole(self:UI(), "AXTextField") end) end return self._filename end --- cp.apple.finalcutpro.export.SaveSheet:setPath(path) -> cp.apple.finalcutpro.export.SaveSheet --- Method --- Sets the path. --- --- Parameters: --- * path - The path as a string. --- --- Returns: --- * The `cp.apple.finalcutpro.export.SaveSheet` object for method chaining. function SaveSheet:setPath(path) if self:isShowing() then -------------------------------------------------------------------------------- -- Display the 'Go To' prompt: -------------------------------------------------------------------------------- self:goToPrompt():show():setValue(path):pressDefault() end return self end --- cp.apple.finalcutpro.export.SaveSheet:setPath() -> ReplaceAlert --- Method --- Gets the Replace Alert object. --- --- Parameters: --- * None --- --- Returns: --- * A `ReplaceAlert` object. function SaveSheet:replaceAlert() if not self._replaceAlert then self._replaceAlert = ReplaceAlert.new(self) end return self._replaceAlert end --- cp.apple.finalcutpro.export.SaveSheet:goToPrompt() -> GoToPrompt --- Method --- Gets the Go To Prompt object. --- --- Parameters: --- * None --- --- Returns: --- * A `GoToPrompt` object. function SaveSheet:goToPrompt() if not self._goToPrompt then self._goToPrompt = GoToPrompt.new(self) end return self._goToPrompt end return SaveSheet
return {'unster','unsters','unstertje'}
-- wifi related wifi_ip = "192.168.1.69" wifi_netmask ="255.255.255.0" wifi_gateway ="192.168.1.1" wifi_ssid = "ssid" wifi_pwd = "password" -- mqtt mqtt_host = "192.168.1.99" mqtt_port = 8883 mqtt_user = "test" mqtt_password = "testtest" mqtt_keepalive = 120 mqtt_topic_out = "node-out"
---@class CS.FairyGUI.ShapeHitTest ---@field public shape CS.FairyGUI.DisplayObject ---@type CS.FairyGUI.ShapeHitTest CS.FairyGUI.ShapeHitTest = { } ---@return CS.FairyGUI.ShapeHitTest ---@param obj CS.FairyGUI.DisplayObject function CS.FairyGUI.ShapeHitTest.New(obj) end ---@return boolean ---@param contentRect CS.UnityEngine.Rect ---@param localPoint CS.UnityEngine.Vector2 function CS.FairyGUI.ShapeHitTest:HitTest(contentRect, localPoint) end return CS.FairyGUI.ShapeHitTest
--[[ /////// ////////////////// /////// PROJECT: MTA iLife - German Fun Reallife Gamemode /////// VERSION: 1.7.2 /////// DEVELOPERS: See DEVELOPERS.md in the top folder /////// LICENSE: See LICENSE.md in the top folder /////// ///////////////// ]] -- ####################################### -- ## Project: MTA iLife ## -- ## Name: ContainerJob.lua ## -- ## Author: Noneatme ## -- ## Version: 1.0 ## -- ## License: See top Folder ## -- ####################################### -- FUNCTIONS / METHODS -- local cFunc = {} -- Local Functions local cSetting = {} -- Local Settings ContainerJob = {} ContainerJob.__index = ContainerJob addEvent("onServerContainerJobCrateAbgeb", true) --[[ ]] -- /////////////////////////////// -- ///// New ////// -- ///// Returns: Object ////// -- /////////////////////////////// function ContainerJob:New(...) local obj = setmetatable({}, {__index = self}) if obj.Constructor then obj:Constructor(...) end return obj end -- /////////////////////////////// -- ///// Abgeben ////// -- ///// Returns: void ////// -- /////////////////////////////// function ContainerJob:Abgeben(uPlayer) if not(self.abgegeben[getPlayerName(uPlayer)]) then if not(self.container[getPlayerName(uPlayer)]) then self.container[getPlayerName(uPlayer)] = 0 end self.container[getPlayerName(uPlayer)] = self.container[getPlayerName(uPlayer)]+1 if(self.container[getPlayerName(uPlayer)] < self.maxContainer) then uPlayer:incrementStatistics("Job", "Geld_erarbeitet", self.geld) uPlayer:incrementStatistics("Job", "Container_verladen", 1) uPlayer:checkJobAchievements() uPlayer:addMoney(self.geld) self.abgegeben[getPlayerName(uPlayer)] = true setTimer(function() self.abgegeben[getPlayerName(uPlayer)] = false end, self.refreshTime, 1) uPlayer:showInfoBox("sucess", "+ $"..self.geld.."\nFalls keine Container vorhanden sind, musst du auf die neue Lieferung warten.") else uPlayer:showInfoBox("error", "Du hast dein Maximum von "..self.maxContainer.." Container pro Tag erreicht.") end else uPlayer:showInfoBox("error", "Bitte warte 25 Sekunden nachdem du einen Container abgegeben hast!") end end -- /////////////////////////////// -- ///// Constructor ////// -- ///// Returns: void ////// -- /////////////////////////////// function ContainerJob:Constructor(...) -- Klassenvariablen -- self.refreshTime = 25000 -- Sicherheit self.geld = 142*getEventMultiplicator() -- Geld in $ self.maxContainer = 75 -- Max. Container / Tag self.abgegeben = {} self.container = {} self.kran1 = new(CJob, 6, "Kranfuehrer - Hafen", "2640.9885253906|-2338.4719238281|13.6328125") self.kran2 = new(CJob, 7, "Kranfuehrer - Bahnhof", "1938.9680175781|-1966.7340087891|13.546875") self.kran3 = new(CJob, 8, "Kranfuehrer - Krankenhaus", "1254.3884277344|-1262.6640625|13.278339385986") -- Methoden -- self.abgebFunc = function(...) self:Abgeben(client, ...) end -- Events -- addEventHandler("onServerContainerJobCrateAbgeb", getRootElement(), self.abgebFunc) --logger:OutputInfo("[CALLING] ContainerJob: Constructor") end -- EVENT HANDLER --
Config.Jobs.tailor = { BlipInfos = { Sprite = 366, Color = 4 }, Vehicles = { Truck = { Spawner = 1, Hash = "youga2", Trailer = "none", HasCaution = true } }, Zones = { CloakRoom = { Pos = {x = 706.73, y = -960.90, z = 29.39}, Size = {x = 3.0, y = 3.0, z = 1.0}, Color = {r = 204, g = 204, b = 0}, Marker = 1, Blip = true, Name = _U("dd_dress_locker"), Type = "cloakroom", Hint = _U("cloak_change"), GPS = {x = 740.80, y = -970.06, z = 23.46} }, Wool = { Pos = {x = 1978.92, y = 5171.70, z = 46.63}, Size = {x = 3.0, y = 3.0, z = 1.0}, Color = {r = 204, g = 204, b = 0}, Marker = 1, Blip = true, Name = _U("dd_wool"), Type = "work", Item = { { name = _U("dd_wool"), db_name = "wool", time = 3000, max = 20, add = 1, remove = 1, requires = "nothing", requires_name = "Nothing", drop = 100 } }, Hint = _U("dd_pickup"), GPS = {x = 715.95, y = -959.63, z = 29.39} }, Fabric = { Pos = {x = 715.95, y = -959.63, z = 29.39}, Size = {x = 3.0, y = 3.0, z = 1.0}, Color = {r = 204, g = 204, b = 0}, Marker = 1, Blip = false, Name = _U("dd_fabric"), Type = "work", Item = { { name = _U("dd_fabric"), db_name = "fabric", time = 5000, max = 20, add = 1, remove = 1, requires = "wool", requires_name = _U("dd_wool"), drop = 100 } }, Hint = _U("dd_makefabric"), GPS = {x = 712.92, y = -970.58, z = 29.39} }, Clothe = { Pos = {x = 712.92, y = -970.58, z = 29.39}, Size = {x = 3.0, y = 3.0, z = 1.0}, Color = {r = 204, g = 204, b = 0}, Marker = 1, Blip = false, Name = _U("dd_clothing"), Type = "work", Item = { { name = _U("dd_clothing"), db_name = "clothe", time = 4000, max = 20, add = 1, remove = 1, requires = "fabric", requires_name = _U("dd_fabric"), drop = 100 } }, Hint = _U("dd_makeclothing"), GPS = {x = 429.59, y = -807.34, z = 28.49} }, VehicleSpawner = { Pos = {x = 740.80, y = -970.06, z = 23.46}, Size = {x = 3.0, y = 3.0, z = 1.0}, Color = {r = 204, g = 204, b = 0}, Marker = 1, Blip = false, Name = _U("spawn_veh"), Type = "vehspawner", Spawner = 1, Hint = _U("spawn_veh_button"), Caution = 300, GPS = {x = 1978.92, y = 5171.70, z = 46.63} }, VehicleSpawnPoint = { Pos = {x = 747.31, y = -966.23, z = 23.70}, Size = {x = 3.0, y = 3.0, z = 1.0}, Marker = -1, Blip = false, Name = _U("service_vh"), Type = "vehspawnpt", Spawner = 1, Heading = 270.1, GPS = 0 }, VehicleDeletePoint = { Pos = {x = 693.79, y = -963.01, z = 22.82}, Size = {x = 3.0, y = 3.0, z = 1.0}, Color = {r = 255, g = 0, b = 0}, Marker = 1, Blip = false, Name = _U("return_vh"), Type = "vehdelete", Hint = _U("return_vh_button"), Spawner = 1, Caution = 350, GPS = 0, Teleport = 0 }, Delivery = { Pos = {x = 429.59, y = -807.34, z = 28.49}, Color = {r = 204, g = 204, b = 0}, Size = {x = 5.0, y = 5.0, z = 3.0}, Marker = 1, Blip = true, Name = _U("delivery_point"), Type = "delivery", Spawner = 1, Item = { { name = _U("delivery"), time = 500, remove = 1, max = 20, -- if not present, probably an error at itemQtty >= item.max in esx_jobs_sv.lua price = 19, requires = "clothe", requires_name = _U("dd_clothing"), drop = 100 } }, Hint = _U("dd_deliver_clothes"), GPS = {x = 1978.92, y = 5171.70, z = 46.63} } } }
local config = {} -- If do not specify a value the default value is false! -- Show Banner config.showBanner = false config.bannerMessage = "NGINX Lua exporter | MOHSEN MOTTAGHI | 2021" -- metric config config.metricProtocol = false config.metricMethod = false -- This is a beta feature config.metricBandwith = false -- Custom key value -- ٍExample: config.labels = { {"Key_1", "Value_1"}, {"Key_2", "Value_2"} } config.labels = {} return config
if vim.g.save_clipboard_on_exit ~= nil then return end vim.g.save_clipboard_on_exit = 1 local groupname = "save_clipboard_on_exit" vim.api.nvim_create_augroup(groupname, { clear = true }) vim.api.nvim_create_autocmd({ "VimLeave"}, { group = groupname, pattern = "*", callback = function() require('save_clipboard_on_exit').save() end, once = false, })
return { base00 = "#fafafa", base01 = "#f0f0f1", base02 = "#e5e5e6", base03 = "#a0a1a7", base04 = "#696c77", base05 = "#383a42", base06 = "#202227", base07 = "#090a0b", base08 = "#ca1243", base09 = "#d75f00", base0A = "#c18401", base0B = "#50a14f", base0C = "#0184bc", base0D = "#4078f2", base0E = "#a626a4", base0F = "#986801", }
local exports = {} local function html_page(metadata, content) local page = [[ <section class="post"> <h1>]] .. metadata.title .. [[</h1> ]] .. content .. [[ </section> ]] return page end exports.html_page = html_page return exports
local Enemy = require('modules/Enemy') local Knight = class('Knight', Enemy) local SwordBad = require('modules/SwordBad') function Knight:initialize( options ) Enemy.initialize( self, options ) self.health = 3 self.speed = 40 self.dir = 'right' self.sword = SwordBad:new( {x=self.x, y=self.y, owner=self} ) self.state = 'idle' self.state_times = { idle = 1, walk = 4, hurt = 0.4 } self.box = 1 self.boy = 1 local g = anim8.newGrid(self.frameWidth, self.frameHeight, self.image:getWidth(), self.image:getHeight(), 0, 64) self.animations = { idleright = anim8.newAnimation(g(1,1), 1), idleleft = anim8.newAnimation(g(1,2), 1), idledown = anim8.newAnimation(g(1,3), 1), idleup = anim8.newAnimation(g(1,4), 1), walkright = anim8.newAnimation(g('1-2',1), 0.1), walkleft = anim8.newAnimation(g('1-2',2), 0.1), walkdown = anim8.newAnimation(g('1-2',3), 0.1), walkup = anim8.newAnimation(g('1-2',4), 0.1), hurtright = anim8.newAnimation(g(5,1, 1,1), 0.1), hurtleft = anim8.newAnimation(g(5,2, 1,2), 0.1), hurtdown = anim8.newAnimation(g(5,3, 1,3), 0.1), hurtup = anim8.newAnimation(g(5,4, 1,4), 0.1), } self:changeState(self.state) self:worldAdd() end function Knight:update( dt ) Enemy.update(self, dt) world:remove(self.sword) self.sword = SwordBad:new( {x=self.x, y=self.y, owner=self} ) self:changeDirection() --state dependent if self.state == 'idle' then elseif self.state == 'walk' then self:moveTowardsObject( dt, self.target ) elseif self.state == 'hurt' then end --state independent if self.state_timer > 0 then self.state_timer = self.state_timer - dt if self.state_timer <= 0 then if self.state == 'idle' then self:changeState('walk') elseif self.state == 'walk' then self:changeState('idle') elseif self.state == 'hurt' then if self.health <= 0 then world:remove(self.sword) room:removeObject( 'enemy', self ) end self:changeState('walk') end end end end function Knight:draw( ) if self.dir == 'up' then self.sword:draw() end self:drawStateDir( ) if self.dir ~= 'up' then self.sword:draw() end end function Knight:swordCollision( other ) if self.state ~= 'hurt' and self.health > 0 then local dirx = self:ox() - other:ox() local diry = self:oy() - other:oy() local mag = math.sqrt( dirx^2 + diry^2 ) local uv = 1/mag local x, y, cols, len = world:move(self, self.x+self.box+(16*uv*dirx), self.y+self.boy+(16*uv*diry), self.filter ) self.x = x - self.box self.y = y - self.boy end end function Knight:changeDirection() local dx, dy = self.target.x - self.x, self.target.y - self.y if math.abs(dx) > math.abs(dy) then if dx < 0 then self.dir = 'left' else self.dir = 'right' end else if dy < 0 then self.dir = 'up' else self.dir = 'down' end end end return Knight
--------------------------------------------------------------------------------------------- -- Requirement summary: -- [Policies] "pre_DataConsent" policies assigned to the application and "priority" value -- -- Description: -- Providing to HMI app`s non-default priority value of "pre_DataConsent" if "pre_DataConsent" policies assigned to the application -- 1. Used preconditions: -- SDL and HMI are running -- Overwrite preloaded PT with non-default(NORMAL) priopity of "pre_DataConsent" -- Close default connection -- Connect device -- -- 2. Performed steps -- Register app-> "pre_DataConsent" policies are assigned to the application -- Activate app -- -- Expected result: -- PoliciesManager must not provide to HMI the app`s priority value --------------------------------------------------------------------------------------------- --[[ General configuration parameters ]] config.deviceMAC = "12ca17b49af2289436f303e0166030a21e525d266e209267433801a8fd4071a0" --[[ Required Shared libraries ]] local commonFunctions = require ('user_modules/shared_testcases/commonFunctions') local commonSteps = require('user_modules/shared_testcases/commonSteps') local commonTestCases = require('user_modules/shared_testcases/commonTestCases') local commonPreconditions = require('user_modules/shared_testcases/commonPreconditions') local testCasesForPolicyTable = require('user_modules/shared_testcases/testCasesForPolicyTable') --[[ General Precondition before ATF start ]] commonSteps:DeleteLogsFileAndPolicyTable() testCasesForPolicyTable.Delete_Policy_table_snapshot() commonPreconditions:Connecttest_without_ExitBySDLDisconnect_WithoutOpenConnectionRegisterApp("connecttest_connect_device.lua") commonPreconditions:BackupFile("sdl_preloaded_pt.json") testCasesForPolicyTable:Precondition_updatePolicy_By_overwriting_preloaded_pt("files/PriorityNormal_preloaded_pt.json") --TODO(istoimenova): shall be removed when issue: "ATF does not stop HB timers by closing session and connection" is fixed config.defaultProtocolVersion = 2 --[[ General Settings for configuration ]] Test = require('user_modules/connecttest_connect_device') require('cardinalities') local mobile_session = require('mobile_session') require('user_modules/AppTypes') function Test:Precondition_Close_default_connection() self.mobileConnection:Close() commonTestCases:DelayedExp(3000) end function Test:Precondition_Connect_device() commonTestCases:DelayedExp(2000) self:connectMobile() EXPECT_HMICALL("BasicCommunication.UpdateDeviceList", { deviceList = { { id = config.deviceMAC, name = "127.0.0.1", transportType = "WIFI" } } } ):Do(function(_,data) self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {}) end) end --[[ Test ]] commonFunctions:newTestCasesGroup("Test") function Test:TestStep1_Priority_NORMAL_OnAppRegistered() commonTestCases:DelayedExp(3000) self.mobileSession = mobile_session.MobileSession(self, self.mobileConnection) self.mobileSession:StartService(7) :Do(function() local correlationId = self.mobileSession:SendRPC("RegisterAppInterface", config.application1.registerAppInterfaceParams) EXPECT_HMINOTIFICATION("BasicCommunication.OnAppRegistered", {priority = nil }) :Do(function(_,data) self.HMIAppID = data.params.application.appID end) self.mobileSession:ExpectResponse(correlationId, { success = true, resultCode = "SUCCESS" }) self.mobileSession:ExpectNotification("OnHMIStatus", {hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN"}) end) end function Test:TestStep2_Priority_NORMAL_ActivateApp() local RequestId = self.hmiConnection:SendRequest("SDL.ActivateApp", { appID = self.applications["Test Application"]}) EXPECT_HMIRESPONSE(RequestId, {result = { code = 0, method ="SDL.ActivateApp", priority = nil }}) :Do(function(_,data) if data.result.priority ~= nil then commonFunctions:userPrint(31, "Error: wrong behavior of SDL - priority should be NORMAL") end EXPECT_NOTIFICATION("OnHMIStatus", {}):Times(0) EXPECT_HMICALL("BasicCommunication.ActivateApp"):Times(0) end) end function Test:Precondition_Check_priority_pre_DataConsent() local app_group_table = commonFunctions:get_data_policy_sql(config.pathToSDL.."/storage/policy.sqlite", "select functional_group_id from app_group where application_id = '"..config.application1.registerAppInterfaceParams.appID.."'") local app_group for _,value in pairs(app_group_table) do app_group = value end -- 129372391 - BaseBeforeDataConsent if(app_group ~= "129372391") then self:FailTestCase("Application is not assigned to pre_DataConsent. Real: "..app_group) end local priority_id_table = commonFunctions:get_data_policy_sql(config.pathToSDL.."/storage/policy.sqlite", "select priority_value from application where id = '"..config.application1.registerAppInterfaceParams.appID.."'") local priority_id for _, value in pairs(priority_id_table) do priority_id = value end if(priority_id ~= "NORMAL") then self:FailTestCase("Priority for pre_DataConsent is not NORMAL. Real: "..priority_id) end local is_predata_table = commonFunctions:get_data_policy_sql(config.pathToSDL.."/storage/policy.sqlite", "select is_predata from application where id = '"..config.application1.registerAppInterfaceParams.appID.."'") local is_predata for _,value in pairs(is_predata_table) do is_predata = value end if(is_predata ~= "1") then self:FailTestCase("Application is not assigned to pre_DataConsent, is_predata = "..priority_id) end end --[[ Postconditions ]] commonFunctions:newTestCasesGroup("Postconditions") testCasesForPolicyTable:Restore_preloaded_pt() function Test.Postcondition_SDLStop() StopSDL() end return Test
function love.conf(t) t.window.title = 'Tetris' t.window.width = 330 t.window.height = 480 end
-- -- Register autocrafter for tubetool -- local definition = { name = 'autocrafter', nodes = { "pipeworks:autocrafter", }, group = 'autocrafter', protection_bypass_read = "interact", } function definition:copy(node, pos, player) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() -- get and store recipe inventory data local recipe = {} for slot = 1, inv:get_size("recipe") do local stack = inv:get_stack("recipe", slot) table.insert(recipe, stack:get_name()) end -- return data required for replicating this autocrafter configuration return { description = meta:get_string("infotext"), recipe = recipe, enabled = meta:get_int("enabled"), } end function definition:paste(node, pos, player, data) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() -- restore recipe data, trigger_stack is used to trigger autocrafter internal recipe cleanup local trigger_stack, trigger_index for index = 1, #data.recipe do local stack = ItemStack(data.recipe[index]) if data.recipe[index] ~= "" then stack:set_count(1) trigger_stack = stack trigger_index = index else stack:set_count(0) end inv:set_stack("recipe", index, stack) end --meta:set_int("enabled", data.enabled or 0) -- attempt to update autocrafter internal data, no API available -- on/off goes backwards and tells current state that will be toggled: on to turn off, off to turn on local nodedef = minetest.registered_nodes[node.name] if trigger_stack then nodedef.allow_metadata_inventory_put(pos, "recipe", trigger_index, trigger_stack, player) else nodedef.allow_metadata_inventory_take(pos, "output", 1, inv:get_stack("output", 1), player) end nodedef.on_receive_fields(pos, "", { [data.enabled == 0 and "on" or "off"] = 1 }, player) end return definition
pg = pg or {} pg.commander_home_style = { { id = 1, name = "1" }, { id = 2, name = "2" }, { id = 3, name = "3" }, all = { 1, 2, 3 } } return
EXIT_TO = nil local function Control(x,y,w,h) local self = {} self.x = x-w/2 self.y = y-h/2 self.w = w self.h = h self.sub_w = w/2 -- subdivimos la barra en 500 segmentos local max_segment = 500 self.segment = w/max_segment self.current_segments = 250 -- segmentos por click ganados cuantos segmentos de empuje extra ganas local segpcg = 5 -- creamos un contador que espera un tiempo antes de -- emepezar a restar segmentos self.contador = Chrono() -- segmentos base perdidos por segundo una -- vez iniciado el contador local segbps = 20 local aceleracion = 80 --aumentamos a +60 en un segundo self.iniciado_bajada = false self.lock = false function self.restartCounter() segbps = 20 self.iniciado_bajada = false self.contador.iniciar() self.lock = false end -- reresa el minimo x, y el maximo function self.getRange() local minx = self.x + self.sub_w-40 local maxx = minx + 80 return minx, maxx end function self.addSegment() -- cada que das click, la cantidad de segmenos que subes -- es un 75% mayor que el anterior if not self.lock then segpcg = segpcg + segpcg*0.75 segpcg = math.min(segpcg,40) flux.to(self,0.1, {current_segments=math.min(self.current_segments+segpcg,max_segment)} ):ease('linear'):oncomplete(self.restartCounter) self.lock = true end end function self.update(dt) if self.contador.hanPasado(0.3) and not self.iniciado_bajada then self.iniciado_bajada = true -- reiniciar los segmentos por click ganados segpcg = 2 --print('han pasado 0.7 en espera') end if self.iniciado_bajada then if self.current_segments > 0 then -- pierde n segmentos por segundo self.current_segments = self.current_segments - segbps*dt segbps = segbps + aceleracion*dt segbps = math.min(segbps, 120) end end self.sub_w = self.segment * self.current_segments self.sub_w = math.max(math.min(self.sub_w, self.w-2),5) end function self.draw() love.graphics.setColor(0.75,0.75,0.75,1) love.graphics.rectangle('fill',self.x+self.sub_w-40,self.y+1,80,self.h-2,9,9,5) love.graphics.setColor(0,0,0,1) love.graphics.rectangle('line',self.x-36,self.y,self.w+73,self.h,10,10,5) end return self end local function Target(x,y,w,h, min, max) local self = {} self.x = x self.y = y self.w = w self.h = h local easing_list = {'expoout','sineout','quadout','elasticout'} local state_battle = -1 local is_in_range = true local detener = false local tween = nil function self.detenerMovimientos() detener = true tween:stop() end function self.move(time, destino,tipo, espera) tween = flux.to(self,time,{x=destino}):ease(tipo):delay(espera):oncomplete(self.getNewTargetPoint) end function self.getNewTargetPoint() if not detener then local half = (max-min)*0.3 local quint = (max-min)/5 local dt = love.math.random(quint,half) local time = 1.2-love.math.random() local espera = love.math.random(5,7) local easing = love.math.random(1,4) print('hay que mover...',dt) local dir = 1 state_battle = 0 if love.math.random(1,2) == 2 then dir = -1 state_battle = 1 end if self.x+dt*dir < min then self.move(time,self.x-dt*dir,easing_list[easing], espera) return end if self.x+dt*dir > max then --target mover otro lado self.move(time,self.x-dt*dir,easing_list[easing], espera) return end self.move(time,self.x+dt*dir,easing_list[easing], espera) --solo muevelo return end --love.math.random() end function self.start() local half = (max-min)*0.45 local quint = (max-min)/5 local dt = love.math.random(quint,half) local time = love.math.random(1,2) local espera = 0 local easing = 4 local dir = 1 state_battle = 0 if love.math.random(1,2) == 2 then dir = -1 state_battle = 1 end if self.x+dt*dir < min then --target mover otro lado --, easing_list[easing] self.move(time,self.x-dt*dir,easing_list[easing], espera) return end if self.x+dt*dir > max then --target mover otro lado self.move(time,self.x-dt*dir,easing_list[easing], espera) return end self.move(time,self.x+dt*dir,easing_list[easing], espera) --solo muevelo return end function self.isInRange(min, max) local minx = self.x-self.w*0.5 local maxx = minx+self.w is_in_range = (minx >= min) and (maxx <= max) return is_in_range end function self.draw() love.graphics.setColor(1,1,1) if state_battle == -1 then love.graphics.setColor(1,1,1) love.graphics.setFont(FONT_SCROLL_SMALL ) --love.graphics.printf(DIAL[LANG].gui_battle_gonna,0,self.y-100,1920,'center') love.graphics.setFont(FONT) end --love.graphics.rectangle('fill', self.x-self.w*0.5, self.y-self.h*0.5, self.w, self.h) love.graphics.setColor(1,0,0) if is_in_range then love.graphics.setColor(0,0.5,0.1) end love.graphics.circle('fill', self.x, self.y, self.w/2, 12) end return self end function AvanceBatalla(tiempo) local self = {} self.x = (1920/2)- 400 self.y = 1080*0.5 self.w = 800 self.h = 30 self.sub_w = 400 local tween = nil function self.ganar(x) self.sub_w = self.sub_w + x self.sub_w = math.min(self.sub_w, 800) end function self.perder(x) self.sub_w = self.sub_w - x self.sub_w = math.max(self.sub_w, 0) end function self.esVictorioso() return self.sub_w > 780 end function self.esDerrotado() return self.sub_w < 30 end function self.draw() love.graphics.setColor(0.3,0,0) love.graphics.rectangle('fill',self.x+1,self.y+1,800,self.h-2,9,9,5) love.graphics.setColor(0,1,1,1) if self.sub_w > 5 then love.graphics.rectangle('fill',self.x+1,self.y+1,self.sub_w-2,self.h-2,9,9,5) end love.graphics.setColor(0,0,0,1) love.graphics.rectangle('line',self.x,self.y,self.w,self.h,10,10,5) end return self end function Main() local self = Escena() local background = nil local newbutton = nil local go_back_button = nil local target = nil local control = nil local estado_batalla = nil self.size = 64 local STATE = 0 -- No gastarted local tribu_id = 0 local kings_list = {} local rey_img = nil local start_dialog = nil local function goToHub() MSC_ATACK:stop() TRIBUS[tribu_id] = 1 --ganamos if STATE == 3 then MSC_DERROTA:stop() TRIBUS[tribu_id] = 2 -- perdimos end local sim_scene = love.filesystem.load("scenes/juego.lua")() SCENA_MANAGER.replace(sim_scene) end local function irAIniciarElJuego() flux.to(self,0.5,{size=0}):ease("expoout"):oncomplete(target.start) control.contador.iniciar() start_dialog.showAll() STATE = 1 end function self.load(settings) tribu_id = settings[1] kings_list = KINGS_IMG_LIST rey_img = KING_IMG newbutton = Boton('',1920/2,1080*0.75, love.graphics.getWidth()*0.35,love.graphics.getHeight()*0.25, love.graphics.newImage("/rcs/gui/start.png"), love.graphics.newImage("/rcs/gui/hover_start.png")) go_back_button = Boton('',1920/2,1080*0.43, love.graphics.getWidth()*0.35,love.graphics.getHeight()*0.25, love.graphics.newImage("/rcs/gui/back.png"), love.graphics.newImage("/rcs/gui/hover_back.png")) background = MINIGAME_BG_IMA -- pon lo a la mitad horizonta, a 40% vertical, 40x20 px, rango de 25% a 75% horizontal target = Target(1920/2,1080*0.6,40,20,1920*0.25,1920*0.75) control = Control(1920/2,1080*0.6,1920*0.5+40,48) estado_batalla = AvanceBatalla(500) MSC_ATACK:play() start_dialog = DialogBox(nil,DIAL[LANG].gui_atk_inst,700,0.5,0.06) start_dialog.start() end function self.draw() love.graphics.clear(0.6,0.6,0.6) love.graphics.setColor(1,1,1) love.graphics.push() local x, y = getMouseOnCanvas() globalX, globalY = love.graphics.inverseTransformPoint(x,y) love.graphics.draw(background) love.graphics.setColor(1,1,1,0.8) love.graphics.draw(kings_list[tribu_id], 1920*0.86-(kings_list[tribu_id]:getWidth()/2)*0.85,0,0,0.85,0.85 ) love.graphics.draw(rey_img,rey_img:getWidth()*0.75,0,0,-0.75,0.75) love.graphics.setColor(1,1,1) control.draw() target.draw() love.graphics.setColor(1,1,1) estado_batalla.draw() if STATE == 0 then newbutton.setPointerPos(globalX, globalY) newbutton.draw() end start_dialog.draw() love.graphics.setColor(0,0,0) if STATE == 3 or STATE == 4 then if start_dialog.is_over then go_back_button.setPointerPos(globalX, globalY) go_back_button.draw() end end love.graphics.pop() end function self.update(dt) start_dialog.update(dt) if STATE == 1 then control.update(dt) local min_x, max_y = control.getRange() if target.isInRange(min_x, max_y) then estado_batalla.ganar(80*dt) else estado_batalla.perder(75*dt) end end if estado_batalla.esVictorioso() and STATE == 1 then target.detenerMovimientos() STATE = 4 start_dialog = DialogBox(nil,DIAL[LANG].gui_atk_is_susses,550,0.5,0.08,0.5,0.06 ) start_dialog.start() end if estado_batalla.esDerrotado() and STATE == 1 then target.detenerMovimientos() MSC_ATACK:stop() MSC_DERROTA:play() STATE = 3 start_dialog = DialogBox(nil,DIAL[LANG].gui_atk_is_fail,550,0.5,0.08,0.5,0.06 ) start_dialog.start() end --]] end function self.mousepressed(x, y, button) if STATE == 1 then control.addSegment() end if newbutton.isPointerInside() and STATE == 0 then --loadNewGame() irAIniciarElJuego() end if STATE == 3 or STATE == 4 then if go_back_button.isPointerInside() then goToHub() end end --[[ if creditbutton.isPointerInside() then loadCreditos() end if exitbutton.isPointerInside() then love.event.quit() end --]] end function self.keyreleased( key, scancode ) end function self.keypressed(key,scancode) end function self.mousemoved(x, y, dx, dy, istouch) end function self.mousereleased(x, y, buttom) if STATE == 1 then end end return self end return Main()
object_tangible_collection_col_dust_durni_08 = object_tangible_collection_shared_col_dust_durni_08:new { gameObjectType = 8211,} ObjectTemplates:addTemplate(object_tangible_collection_col_dust_durni_08, "object/tangible/collection/col_dust_durni_08.iff")
package("cppzmq") set_kind("library", {headeronly = true}) set_homepage("http://www.zeromq.org/") set_description("Header-only C++ binding for libzmq") set_license("MIT") add_urls("https://github.com/zeromq/cppzmq/archive/refs/tags/$(version).tar.gz", "https://github.com/zeromq/cppzmq.git") add_versions("v4.8.1", "7a23639a45f3a0049e11a188e29aaedd10b2f4845f0000cf3e22d6774ebde0af") add_deps("cmake", "zeromq") on_install("windows", "macosx", "linux", function (package) import("package.tools.cmake").install(package, {"-DCPPZMQ_BUILD_TESTS=OFF"}) end) on_test(function (package) assert(package:check_cxxsnippets([[ void test() { zmq::context_t ctx; zmq::socket_t sock(ctx, zmq::socket_type::push); sock.bind("inproc://test"); sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait); } ]], {configs = {languages = "c++14"}, includes = "zmq.hpp"})) end)
-- Rank System [On Score File] (v1.0) -- Copyright (c) 2022, Jericho Crosby <jericho.crosby227@gmail.com> local Event = {} function Event:OnScore() local t = self.credits.event_score[self.gt] self:UpdateCR({ t[1], t[2] }) end return Event
-- -- Copyright (c) 2016, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. -- -- extracts features from an image using a trained model -- require 'torch' require 'paths' if #arg < 2 then io.stderr:write('Usage: th extract-features.lua [MODEL] [FILE]...\n') os.exit(1) end for _, f in ipairs(arg) do if not paths.filep(f) then io.stderr:write('file not found: ' .. f .. '\n') os.exit(1) end end require 'cudnn' require 'cunn' require 'image' local t = require '../datasets/transforms' -- Load the model local model = torch.load(arg[1]) -- Remove the fully connected layer assert(torch.type(model:get(#model.modules)) == 'nn.Linear') model:remove(#model.modules) -- The model was trained with this input normalization local meanstd = { mean = { 0.485, 0.456, 0.406 }, std = { 0.229, 0.224, 0.225 }, } local transform = t.Compose{ t.Scale(256), t.ColorNormalize(meanstd), t.CenterCrop(224), } local features for i=2,#arg do -- load the image as a RGB float tensor with values 0..1 local img = image.load(arg[i], 3, 'float') -- Scale, normalize, and crop the image img = transform(img) -- View as mini-batch of size 1 img = img:view(1, table.unpack(img:size():totable())) -- Get the output of the layer before the (removed) fully connected layer local output = model:forward(img:cuda()):squeeze(1) if not features then features = torch.FloatTensor(#arg - 1, output:size(1)):zero() end features[i - 1]:copy(output) end torch.save('features.t7', features) print('saved features to features.t7')
push([[ ----------------------------------------------------------- --- /client/gui/progressbar_class.lua --- --- Part of openFrame project --- --- Written by 50p. Additional changes by Orange. --- --- Lately edited in revision number 13 by Orange --- --- Licensed under BSD licence --- ----------------------------------------------------------- -- Class: ProgressBar Class -- Class which allows to easily add progressbars to windows/screen. ProgressBar = { }; ProgressBar.__index = ProgressBar; -- Function: ProgressBar:Create -- Creates a progressbar -- -- Required Arguments: -- x - (float/integer) Space from left side of screen/window -- y - (float/integer) Space from top side of screen/window -- width - (float/integer) Width of the progressbar -- height - (float/integer) Height of the progressbar -- -- Optional arguments: -- text - (string) Text of the progressbar's caption -- relative - (bool) Are the x/y/width/height values relative? -- parent - (GUI) Parent of the progressbar -- -- Returns: -- The result is a progressbar object function ProgressBar:Create( x, y, width, height, text, relative, parent ) local progbar = { gui = false, lbl = false, onclick = { }, onmouseenter = { }, onmouseleave = { }, cursorovergui = false, _dragable = false }; for i, f in pairs( GUISharedFuncs ) do if ( ( i ~= "__index" ) and ( i ~= "Dragable" ) and ( i ~= "Font" ) and ( i ~= "Text" ) and ( i ~= "Size" ) ) then progbar[ i ] = f; end end if type( text ) == "boolean" then relative = text; end progbar.gui = guiCreateProgressBar( x, y, width, height, ( type( relative ) == "boolean" ) and relative or false, parent ); if( progbar.gui ) then if type( text ) == "string" then progbar.lbl = Label:Create( 0, 0, width, height, text or "", ( type( relative ) == "boolean" ) and relative or false, progbar.gui ); progbar.lbl:VerticalAlign( "center" ); progbar.lbl:HorizontalAlign( "center" ); progbar.lbl:Color( 255, 255, 0 ); end setmetatable( progbar, self ); self.__index = self; addEventHandler( "onClientGUIClick", ( type( progbar.lbl ) == "table" ) and progbar.lbl.gui or progbar.gui, function( mouseBtn, state, x, y ) if type( progbar.onclick ) == "table" then for i, f in pairs( progbar.onclick ) do f( progbar, mouseBtn, state, x, y ); end end end, false ); addEventHandler( "onClientMouseEnter", ( type( progbar.lbl ) == "table" ) and progbar.lbl.gui or progbar.gui, function( x, y ) GUICollection.guiMouseIsOver = progbar; if type( progbar.onmouseenter ) == "table" then for _, f in pairs( progbar.onmouseenter ) do if type( f ) == "function" then f( progbar, x, y ); end end end end, false ) addEventHandler( "onClientMouseLeave", ( type( progbar.lbl ) == "table" ) and progbar.lbl.gui or progbar.gui, function( x, y ) GUICollection.guiMouseIsOver = false; if type( progbar.onmouseleave ) == "table" then for _, f in pairs( progbar.onmouseleave ) do if type( f ) == "function" then f( progbar, x, y ); end end end end, false ) return progbar; end return false; end -- Function: ProgressBar:Font -- Returns or sets the font -- -- Optional arguments: -- newfont - (string) The new font name -- -- Returns: -- If tried to set, true or false. If tried to get it, returns current font. function ProgressBar:Font( newfont ) if ( type( self ) ~= "table" ) then outputDebugString( "calling method incorrectly ( object.method() )! use object:method()", 1 ); return false end if type( newfont ) == "string" then if type( self.lbl ) == "table" then return self.lbl:Font( newfont ); end outputDebugString( "this progressbar doesn't have a label!", 0 ); return false; end return guiGetFont( self.gui ) end -- Function: ProgressBar:LabelColor -- Returns or sets the color of progressbar's label. -- -- Optional arguments: -- r - (integer) Value of red color -- g - (integer) Value of green color -- b - (integer) Value of blue color -- -- Returns: -- If tried to set, true or false. If tried to get, three integers with values. function ProgressBar:LabelColor( r, g, b ) if ( type( self ) ~= "table" ) then outputDebugString( "calling method incorrectly ( object.method() )! use object:method()", 1 ); return false end if ( ( type( r ) == "number" ) and ( type( g ) == "number" ) and ( type( b ) == "number" ) ) then if type( self.lbl ) == "table" then return self.lbl:Color( r, g, b ); end outputDebugString( "this progressbar doesn't have a label!", 0 ); return false; end return guiGetText( self.gui ); end -- Function: ProgressBar:Progress -- Returns or sets the progress -- -- Optional arguments: -- progress - (integer) Current progress displayed on progressbar -- -- Returns: -- If tried to set, true or false. If tried to get it, returns current progress. function ProgressBar:Progress( progress ) if ( type( self ) ~= "table" ) then outputDebugString( "calling method incorrectly ( object.method() )! use object:method()", 1 ); return false end if ( type( progress ) == "number" ) then return guiProgressBarSetProgress( self.gui, progress ); end return guiProgressBarGetProgress( self.gui ); end -- Function: ProgressBar:Text -- Returns or sets the progressbar's text -- -- Optional arguments: -- text - (string) Progressbar's text to set -- -- Returns: -- If tried to set, true or false. If tried to get it, returns current text. function ProgressBar:Text( value ) if ( type( self ) ~= "table" ) then outputDebugString( "calling method incorrectly ( object.method() )! use object:method()", 1 ); return false end if type( value ) == "string" then if type( self.lbl ) == "table" then return self.lbl:Text( value ); end outputDebugString( "this progressbar doesn't have a label!", 0 ); return false; end return guiGetText( self.gui ); end -- Function: ProgressBar:Size -- Returns or sets the progressbar's size -- -- Optional arguments: -- width - (string) New width to set -- height - (string) New height to set -- relative - (bool) Is width and height relative? -- -- Returns: -- If tried to set, true or false. If tried to get it, returns current size. function ProgressBar:Size( width, height, relative ) if ( type( self ) ~= "table" ) then outputDebugString( "calling method incorrectly ( object.method() )! use object:method()", 1 ); return false end if ( type( width ) == "number" ) and ( type( height ) == "number" ) then local temp = guiSetSize( self.gui, width, height, ( type( relative ) == "boolean" ) and relative or false ); if temp then if type( self.lbl ) == "table" then self.lbl:Size( 1, 1, true ); end return temp; end end return guiGetSize( self.gui, ( type( width ) == "boolean" ) and width or false ) end ]])
local Modules = game:GetService("Players").LocalPlayer.PlayerGui.AvatarEditorInGame.Modules local ApplyNavigateBack = require(Modules.NotLApp.Actions.ApplyNavigateBack) return function(bypassNavigationLock) return function(store) store:dispatch(ApplyNavigateBack(bypassNavigationLock)) end end
local AceEvent = LibStub:GetLibrary("AceEvent-3.0"); local helper = LibStub:NewLibrary("ZoneHelper-1.0", 1); local zoneIDToUiMapID = {}; local listeners = {}; local previousSubZone = GetMinimapZoneText(); local previousZone = GetRealZoneText(); local function updateListeners() local subZone = GetMinimapZoneText(); local zone = GetRealZoneText(); if previousSubZone == subZone and previousZone == zone then return end for _, listener in ipairs(listeners) do listener({ previousSubZone = previousSubZone, previousZone = previousZone, subZone = subZone, zone = zone }); end previousSubZone = subZone; previousZone = zone; end function helper:OnZoneChanged(listener) tinsert(listeners, listener); end -- TODO: Remove this code once Questie adds UiMapIDs to their objects. :( function helper:GetUIMapID(zoneID) return zoneIDToUiMapID[zoneID]; end AceEvent.RegisterEvent(helper, "ZONE_CHANGED", updateListeners); AceEvent.RegisterEvent(helper, "ZONE_CHANGED_INDOORS", updateListeners); AceEvent.RegisterEvent(helper, "ZONE_CHANGED_NEW_AREA", updateListeners); zoneIDToUiMapID = { [1] = 1426, [3] = 1418, [4] = 1419, [8] = 1435, [10] = 1431, [11] = 1437, [12] = 1429, [14] = 1411, [15] = 1445, [16] = 1447, [17] = 1413, [28] = 1422, [33] = 1434, [36] = 1416, [38] = 1432, [40] = 1436, [41] = 1430, [44] = 1433, [45] = 1417, [46] = 1428, [47] = 1425, [51] = 1427, [85] = 1420, [130] = 1421, [139] = 1423, [141] = 1438, [148] = 1439, [215] = 1412, [267] = 1424, [331] = 1440, [357] = 1444, [361] = 1448, [400] = 1441, [405] = 1443, [406] = 1442, [440] = 1446, [490] = 1449, [493] = 1450, [618] = 1452, [1377] = 1451, [1497] = 1458, [1519] = 1453, [1537] = 1455, [1637] = 1454, [1638] = 1456, [1657] = 1457, [2597] = 1459, [3277] = 1460, [3358] = 1461 };
-- I use this function to remove an entire category from a table based on the category name. function RemoveItemFromTable(tbl, keyname, keyvalue) for i,v in ipairs(tbl) do if (v[keyname] == keyvalue) then -- If the current table category name is the one we are looking for then -- remove the category from the table. table.remove(tbl, i); break; end end end -- Calls the function RemoveItemFromTable and tells it to look in the ItemSpawnerManager -- table's itemCategories Table for a category called RandomHazmatSuit RemoveItemFromTable(ItemSpawnerManager.itemCategories, "category", "RandomAmmo") -- Here we created the new RandomHazmatSuit category that will replace the one we removed local newItem = { category = "RandomAmmo", classes = { { category = "12GaugeAA12Mags", percent = 1 }, { category = "12GaugeShells", percent = 4 }, { category = "9mmMagazine", percent = 2 }, { category = "RandomAccessory", percent = 3 }, { category = "RandomChemlight", percent = 2 }, { category = "RandomSmokeGrenade", percent = 2 }, { category = "RandomExtendedMagazines", percent = 3 }, { class = "545x30", percent = 2 }, { class = "57x50", percent = 2 }, { class = "762x5", percent = 2 }, { class = "9mmx10_makarov", percent = 2 }, { class = "9mmx15_m9a1", percent = 2 }, { class = "9mmx19_ap85", percent = 1 }, { class = "acp_45x20", percent = 2 }, { class = "acp_45x30", percent = 2 }, { class = "10mmx15", percent = 2 }, { class = "10mmx30", percent = 2 }, { class = "22x10_ruger", percent = 2 }, { class = "acp_45x10_hk", percent = 2 }, { class = "acp_45x7", percent = 3 }, { class = "762x30", percent = 3 }, { class = "Arrowx8", percent = 2.5 }, --{ class = "CupidArrowx8", percent = 2.5 }, vday { class = "Boltx5_0000", percent = 2 }, { class = "M40x5", percent = 0.99 }, { class = "556x100", percent = 0.01 }, { class = "Pile_10mm", percent = 2 }, { class = "Pile_22", percent = 2 }, { class = "Pile_545x39", percent = 2 }, { class = "Pile_57x28", percent = 2 }, { class = "Pile_223", percent = 3 }, { class = "Pile_308", percent = 3 }, { class = "Pile_357", percent = 3 }, { class = "Pile_45ACP", percent = 3 }, { class = "Pile_556x45", percent = 3 }, { class = "Pile_762x39", percent = 2 }, { class = "Pile_762x51", percent = 2 }, { class = "Pile_9mm", percent = 3.5 }, { class = "Pile_Flare", percent = 3.5 }, { class = "Pile_TranquilizerDart", percent = 3 }, { class = "STANAGx30", percent = 2 }, { class = "556x30_ak5d", percent = 2 }, { class = "762x20_Akval", percent = 2 }, { class = "9x19_mac10", percent = 2 }, { class = "Pile_40mmGrenade", percent = 0.3 }, }, } -- Here we are adding the new RandomHazmatSuit category we created to the ItemSpawnManager's itemCategories Table table.insert(ItemSpawnerManager.itemCategories, newItem) local newerItem = { category = "RandomExtendedMagazines", classes = { { class = "9x19_mac10_32", percent = 3 }, { class = "762x30_Akval", percent = 5 }, { class = "556x40_ak5d", percent = 5 }, { class = "762x40", percent = 5 }, { class = "acp_45x30_cx8", percent = 5 }, { class = "STANAGx40", percent = 5 }, { class = "M40X7", percent = 5 }, { class = "acp_45x40", percent = 5 }, { class = "acp_45x15_hk", percent = 5 }, { class = "acp_45x14", percent = 5 }, { class = "762x7", percent = 5 }, { class = "556x150", percent = 3 }, { class = "545x40", percent = 5 }, { class = "357x20", percent = 5 }, { class = "57x60", percent = 5 }, { class = "22x15_ruger", percent = 5 }, { class = "9mmx20_makarov", percent = 5 }, { class = "10mmx40", percent = 5 }, { class = "9mmx25_m9a1", percent = 5 }, { class = "9mmx25_ap85", percent = 5 }, { class = "10mmx30_vector", percent = 4 }, }, } -- Here we are adding the new RandomHazmatSuit category we created to the ItemSpawnManager's itemCategories Table table.insert(ItemSpawnerManager.itemCategories, newerItem)
local PANEL = {} local paintFunctions = {} paintFunctions[0] = function(this, w, h) surface.SetDrawColor(0, 0, 0, 50) surface.DrawRect(0, 0, w, h) end paintFunctions[1] = function(this, w, h) end function PANEL:Init() if (IsValid(nut.gui.squads)) then nut.gui.squads:Remove() end nut.gui.squads = self self:SetSize(128, ScrH) self:SetPos(ScrW() * 0.1, ScrH() / 2) self.teams = {} self.slots = {} self.i = {} local list = self:Add("DListLayout") list:Dock(TOP) list:SetTall(28) list.Think = function(this) for k, v in ipairs(team.GetPlayers(LocalPlayer():Team())) do if !(v == LocalPlayer()) then if (!IsValid(v.nutSquadSlot) or v.nutSquadSlot:GetParent() != this) then if (IsValid(v.nutPlayerSlot)) then v.nutPlayerSlot:SetParent(this) else self:addPlayer(v, this) end end end end end end function PANEL:Think() if ((self.nextUpdate or 0) < CurTime()) then local visible, amount for k, v in pairs(self.slots) do if (IsValid(v)) then v:update() end end self.nextUpdate = CurTime() + 0.1 end end function PANEL:addPlayer(client, parent) if (!client:getChar() or !IsValid(parent)) then return end local slot = parent:Add("DPanel") slot:Dock(TOP) slot:SetTall(64) slot:DockMargin(0, 0, 0, 1) slot.character = client:getChar() client.nutSquadSlot = slot slot.model = slot:Add("nutSpawnIcon") slot.model:SetModel(client:GetModel(), client:GetSkin()) slot.model:SetSize(64, 64) timer.Simple(0, function() if (!IsValid(slot)) then return end local entity = slot.model.Entity if (IsValid(entity)) then for k, v in ipairs(client:GetBodyGroups()) do entity:SetBodygroup(v.id, client:GetBodygroup(v.id)) end for k, v in ipairs(client:GetMaterials()) do entity:SetSubMaterial(k - 1, client:GetSubMaterial(k - 1)) end end end) slot.name = slot:Add("DLabel") slot.name:SetText(client:Name()) slot.name:Dock(TOP) slot.name:DockMargin(65, 0, 48, 0) slot.name:SetTall(18) slot.name:SetFont("nutGenericFont") slot.name:SetTextColor(color_white) slot.name:SetExpensiveShadow(1, color_black) local oldTeam = client:Team() function slot:update() if (!IsValid(client) or !client:getChar() or !self.character or self.character != client:getChar() or oldTeam != client:Team()) then self:Remove() local i = 0 for k, v in ipairs(parent:GetChildren()) do if (IsValid(v.model) and v != self) then i = i + 1 v.Paint = paintFunctions[i % 2] end end return end local name = client:Name() local model = client:GetModel() local skin = client:GetSkin() if (self.lastName != name) then self.name:SetText(name) self.lastName = name end local entity = self.model.Entity if (!IsValid(entity)) then return end if (self.lastModel != model or self.lastSkin != skin) then self.model:SetModel(client:GetModel(), client:GetSkin()) self.model:SetToolTip(L("sbOptions", client:steamName())) self.lastModel = model self.lastSkin = skin end timer.Simple(0, function() if (!IsValid(entity) or !IsValid(client)) then return end for k, v in ipairs(client:GetBodyGroups()) do entity:SetBodygroup(v.id, client:GetBodygroup(v.id)) end end) end self.slots[#self.slots + 1] = slot parent:SetVisible(true) parent:SizeToChildren(false, true) parent:InvalidateLayout(true) local i = 0 for k, v in ipairs(parent:GetChildren()) do if (IsValid(v.model)) then i = i + 1 v.Paint = paintFunctions[i % 2] end end return slot end function PANEL:Paint(w, h) nut.util.drawBlur(self, 10) surface.SetDrawColor(30, 30, 30, 100) surface.DrawRect(0, 0, w, h) surface.SetDrawColor(0, 0, 0, 150) surface.DrawOutlinedRect(0, 0, w, h) end vgui.Register("nutSquad", PANEL, "EditablePanel")
--mappers.lua function newMapper (num_prg_banks, num_chr_banks) local m = {} m.num_prg_banks = num_prg_banks or 1 m.num_chr_banks = num_chr_banks or 1 m.cpuMapRead = crd or function (addr) return false end m.cpuMapWrite = cwr or function (addr) return false end m.ppuMapRead = prd or function (addr) return false end m.ppuMapWrite = pwr or function (addr) return false end m.mirrorMode = 0 return m end local function newMapper_000 (num_prg_banks, num_chr_banks) local m = newMapper(num_prg_banks, num_chr_banks) m.cpuMapRead = function(addr) -- if PRGROM is 16KB -- CPU Address Bus PRG ROM -- 0x8000 -> 0xBFFF: Map 0x0000 -> 0x3FFF -- 0xC000 -> 0xFFFF: Mirror 0x0000 -> 0x3FFF -- if PRGROM is 32KB -- CPU Address Bus PRG ROM -- 0x8000 -> 0xFFFF: Map 0x0000 -> 0x7FFF if addr >= 0x8000 and addr <= 0xFFFF then local foo = 0x3FFF if m.num_prg_banks > 1 then foo = 0x7FFF end mAddr = bit.band(addr, foo) return mAddr else return false end end m.ppuMapRead = function(addr) if addr >= 0x0000 and addr <= 0x1FFF then return addr else end end m.cpuMapWrite = function(addr) if addr >= 0x8000 and addr <= 0xFFFF then local foo = 0x3FFF if m.num_prg_banks > 1 then foo = 0x7FFF end mAddr = bit.band(addr, foo) return mAddr else return false end end m.ppuMapWrite = function(addr) if addr >= 0x0000 and addr <= 0x1FFF then return false end end return m end MAPPER_CONSTRUCTORS = {} MAPPER_CONSTRUCTORS[0] = newMapper_000
-- GuildRaidSnapShot Mod -- Copyright (c) 2005-2014 Sigma Star Systems -- Released under the MIT License. See LICENSE.txt for full license GuildRaidSnapShot_SnapShots = {}; GuildRaidSnapShot_Loot = {}; GuildRaidSnapShot_Notes = {}; GuildRaidSnapShot_Adj = {}; GRSS_Calendar = {}; GRSS_Alts = {}; GRSS_MainOnly = {}; GRSS_Divide = {}; GRSS_Systems = {}; GRSS_Full_DKP = {}; GRSS_Bosses_Old = {"Lucifron","Magmadar","Gehennas","Garr","Baron Geddon","Shazzrah","Sulfuron Harbinger","Golemagg the Incinerator","Ragnaros","Doom Lord Kazzak","Azuregos","Lethon","Emeriss","Onyxia","Taerar","Ysondre","Razorgore the Untamed","Vaelastrasz the Corrupt","Flamegor","Ebonroc","Firemaw","Chromaggus","Broodlord Lashlayer","Nefarian","Prophet Skeram","Lord Kri","Battleguard Sartura","Princess Huhuran","Fankriss the Unyielding","Viscidus","Ouro","C'Thun","Emperor Vek'nilash","Emperor Vek'lor","Anub'Rekhan","Grand Widow Faerlina","Maexxna","Feugen","Gluth","Gothik the Harvester","Grobbulus","Heigan the Unclean","Highlord Mograine","Instructor Razuvious","Lady Blaumeux","Loatheb","Noth the Plaguebringer","Patchwerk","Sapphiron","Sir Zeliek","Stalagg","Thaddius","Thane Korth'azz","Ossirian the Unscarred","Moam","Kurinnaxx","General Rajaxx","Buru the Gorger","Ayamiss the Hunter","Bloodlord Mandokir","Gahz'ranka","Gri'lek","Hakkar","Hazza'rah","High Priest Thekal","High Priest Venoxis","High Priestess Arlokk","High Priestess Jeklik","High Priestess Mar'li","Jin'do the Hexxer","Renataki","Wushoolay","The Crone","Hyakiss the Lurker","Julianne","Maiden of Virtue","Moroes","Netherspite","Nightbane","Prince Malchezaar","Rokad the Ravager","Romulo","Shade of Aran","Shadikith the Glider","Terestian Illhoof","The Big Bad Wolf","The Curator","Gruul the Dragonkiller","Magtheridon","High King Maulgar","Fathom-Lord Karathress","Hydross the Unstable","Lady Vashj","Leotheras the Blind","Morogrim Tidewalker","The Lurker Below","Al'ar","High Astromancer Solarian","Kael'thas Sunstrider","Void Reaver","Doomwalker","Attumen the Huntsman","Illidan Stormrage","Gathios the Shatterer","High Nethermancer Zerevor","Lady Malande","Veras Darkshadow","Essence of Anger","Gurtogg Bloodboil","Illidari Council","Teron Gorefiend","High Warlord Naj'entus","Mother Shahraz","Shade of Akama","Supremus","Anetheron","Archimonde","Azgalor","Kaz'rogal","Rage Winterchill","Nalorakk","Akil'zon","Jan'alai","Halazzi","Hex Lord Malacrass","Zul'jin","Kalecgos","Sathrovarr the Corruptor","Brutallus","Felmyst","Lady Sacrolash","Grand Warlock Alythess","M'uru","Entropius","Kil'jaeden","Kel'Thuzad","Sartharion","Archavon the Stone Watcher","Malygos","Flame Leviathan","Razorscale","XT-002 Deconstructor","Ignis the Furnace Master","Assembly of Iron","Kologarn","Auriaya","Mimiron","Hodir","Thorim","Freva","General Vezax","Yogg-Saron","Algalon the Observer","Emalon the Storm Watcher","Icehowl","Lord Jaraxxus","Fjola Lightbane","Anub'arak","Koralon the Flame Watcher","Lord Marrowgar","Lady Deathwhisper","Deathbringer Saurfang","Festergut","Rotface","Professor Putricide","Blood-Queen Lana'thal","Valithria Dreamwalker","Sindragosa","The Lich King","Prince Keleseth", -- Cata Bosses "Argaloth","Halfus Wyrmbreaker","Theralion","Cho'gall","Magmaw","Omnitron Defense System","Maloriak","Atramedes","Chimaeron","Nefarian","Al'Akir","Sinestra","Shannox","Lord Rhyolith","Beth'tilac","Alysrazor","Baelroc","Majordomo Staghelm","Ragnaros","Volcanus","Morchok","Warlord Zon'ozz","Yor'sahj the Unsleeping","Hagara the Stormbinder","Ultraxion","Warmaster Blackhorn","Deathwing", -- MOP Bosses "Imperial Vizier Zor'lok","Blade Lord Ta'yak","Garalon","Wind Lord Mel'jarak","Amber-Shaper Un-sok","Grand Empress Shek'zeer", "Jade Guardian","Feng the Accursed","Gara'jal the Spiritbinder","The Spirit Kings","Elegon","Jan-xi", "Sha of Anger","Salyis's Warband", "Tsulong","Lei Shi","Sha of Fear", "Jin'rokh the Breaker","Horridon","Tortos","Megaera","Ji-Kun","Durumu the Forgotten","Primordius","Dark Animus","Iron Qon","Twin Consorts","Lei Shen","Ra-den", "Immerseus","The Fallen Protectors","Amalgam of Corruption","Sha of Pride","Galakras","Iron Juggernaut","Earthbreaker Haromm","General Nazgrim","Malkorok","Thok the Bloodthirsty","Siegecrafter Blackfuse","Garrosh Hellscream", }; GRSS_Bosses = { -- WOD Bosses "Kargath Bladefist", "The Butcher", "Brackenspore", "Tectus", "Pol", "Ko'ragh", "Imperator Mar'gok", "Gruul","Oregorger", "Blast Furnace", "Hans'gar", "Flamebender Ka'graz", "Kromog", "Beastlord Darmac","Operator Thogar","Admiral Gar'an","Blackhand", "Siegemaster Mar'tak", "Kormrok","Killrogg Deadeye","Gurtogg Bloodboil","Gorefiend","Shadow-Lord Iskar","Socrethar the Eternal","Tyrant Velhari","Fel Lord Zakuun","Xhul'horac","Mannoroth","Archimonde", --[[ (TESTING) uncomment for testing the mobs outside shattrath and orgrimmar "Dreadfang Lurker","Timber Worg","Ironspine Petrifier","Talrendis Scout","Weakened Mosshoof Stag" --]] }; GRSS_FastBossLookup = {}; --This gets initialized with the mod GRSS_Ignore = {"Onyxian","Onyxia's Elite Guard","Maexxna Spiderling","Patchwerk Golem","Hakkari","Son of Hakkar"," slain by ","Nightbane .+",".+the Crone","Netherspite Infernal","Ember of Al'ar","Sartharion Twilight Whelp","Sartharion Twilight Egg"}; GRSS_Yells = {}; GRSS_LootIgnore = {"Hakkari Bijou","Alabaster Idol","Amber Idol","Azure Idol","Jasper Idol","Lambent Idol","Obsidian Idol","Onyx Idol","Vermillion Idol","Lava Core","Fiery Core","Large .+ Shard","Small .+ Shard","Nexus Crystal","Wartorn .+ Scrap","Badge of Justice","Cosmic Infuser","^Devastation$","Infinity Blade","Phaseshift Bulwark","Warp Slicer","Staff of Disintegration","Netherstrand Longbow","Nether Spike","Bundle of Nether Spikes","Emblem of Heroism","Emblem of Valor","Abyss Crystal","Emblem of Conquest","Emblem of Triumph","Emblem of Frost","Maelstrom Crystal"}; -- GRSS_Yells = Bosses that when they die trigger a snapshot GRSS_Yells["Majordomo Executus"] = "Impossible!.+I submit!"; GRSS_Yells["Attumen the Huntsman"] = "Always knew.+the hunted"; GRSS_Yells["Freya"] = "His hold on me dissipates"; GRSS_Yells["Thorim"] = "Stay your arms!"; GRSS_Yells["Hodir"] = "I am released from his grasp"; GRSS_Yells["Mimiron"] = "I allowed my mind to be corrupted"; GRSS_Yells["Garrosh Hellscream"] = "That was just a taste of what the future brings. FOR THE HORDE!"; GRSS_Yells["King Varian Wrynn"] = "GLORY TO THE ALLIANCE!"; GRSS_Yells["High Overlord Saurfang"] = "The Alliance falter. Onward to the Lich King!"; GRSS_Yells["Muradin Bronzebeard"] = "Don't say I didn't warn ya, scoundrels! Onward, brothers and sisters!"; GRSS_Yells["Valithria Dreamwalker"] = "I am renewed!.+to rest!"; GRSS_Yells["Elementium Monstrosity"] = "IMPOSSIBLE"; GRSS_Yells["Omnitron"] = "Defense systems obliterated. Powering down."; GRSS_Yells["Al'Akir"] = "The Conclave of Wind has dissipated.+"; GRSS_Yells["Lorewalker Cho"] = "A secret passage has opened beneath the platform, this way!"; GRSS_Yells["Elder Asani"] = "The Sha...must be...stopped."; --GRSS_Yells["Chops"] = "this is a test"; -- GRSS_Yell_Redirects = Bosses that if they yell something from above, the snapshot gets recorded not as the name of the mob, but as the assignment -- For example, in Garrosh Hellscream yells "That was just a test of what the future brings. FOR THE HORDE", the snapshot will be recorded as "Faction Champions" GRSS_Yell_Redirect = {}; GRSS_Yell_Redirect["Garrosh Hellscream"] = "Faction Champions"; GRSS_Yell_Redirect["King Varian Wrynn"] = "Faction Champions"; GRSS_Yell_Redirect["High Overlord Saurfang"] = "Gunship Battle"; GRSS_Yell_Redirect["Muradin Bronzebeard"] = "Gunship Battle"; GRSS_Yell_Redirect["Elementium Monstrosity"] = "Twilight Ascendants"; GRSS_Yell_Redirect["Omnitron"] = "Omnitron Defense System"; GRSS_Yell_Redirect["Al'Akir"] = "Conclave of Wind"; GRSS_Yell_Redirect["Lorewalker Cho"] = "The Spirit Kings"; GRSS_Yell_Redirect["Elder Asani"] = "Protectors of the Endless"; --GRSS_Yell_Redirect["Chops"] = "Faction Champions Test"; -- GRSS_BossRedirects = When a specific boss dies, the snapshot is recorded as something else -- In this case, if "Jade Guardian" dies, the snapshot is recorded as "The Stone Guard" -- This is useful for bosses that are linked together and share health. GRSS_Boss_Redirect = {}; GRSS_Boss_Redirect["Jade Guardian"] = "The Stone Guard"; GRSS_Boss_Redirect["Jan-xi"] = "Will of the Emperor"; GRSS_Boss_Redirect["Amalgam of Corruption"] = "Norushen"; GRSS_Boss_Redirect["Earthbreaker Haromm"] = "Kor'kron Dark Shaman"; GRSS_Boss_Redirect["Gurtogg Bloodboil"] = "Hellfire High Council"; GRSS_Boss_Redirect["Siegemaster Mar'tak"] = "Hellfire Assault"; GRSS_Boss_Redirect["Pol"] = "Twin Ogron"; GRSS_Boss_Redirect["Admiral Gar'an"] = "Iron Maidens"; --GRSS_Boss_Redirect["Weakened Mosshoof Stag"] = "Test Redirect"; -- GRSS_BossEmote = events that aren't yells or anything, but something represent "world emotes" -- For the "Chess" event example from Burning Crusade's Karazhan, when the Chess events ends, there -- is a world-emote like "The doors of the Gamesman's Hall shake...". This is how it triggers when the event happens GRSS_BossEmote = {}; GRSS_BossEmote["Chess"] = "doors of the Gamesman's Hall"; -- GRSS_ZoneIgnore is probably no longer necessary, since GRSS already checks if you're in a PVP (Arena or Battleground) GRSS_ZoneIgnore = {"Arathi Basin","Alterac Valley","Eye of the Storm","Warsong Gulch"}; GRSS_Auto = 1; GRSS_LootCap = 1; GRSS_Bidding = 0; GRSS_Rolling = 0; GRSS_BidRolls = nil; GRSS_HighBid = 0; GRSS_HighBidder = ""; GRSS_CurrentSort = "total"; GRSS_BidStyle = "Silent Auction"; GRSS_CurrentItem = ""; GRSS_ItemHistory = {}; GRSS_TakeScreenshots = 0; GRSS_CurrentLootDate = ""; GRSS_CurrentLootIndex = 0; GRSS_LastCommand = {}; GRSS_ItemPrices = {}; GRSS_RaidFilter = "All"; GRSS_ClassFilter = "All"; GRSS_ItemQueue = {}; GRSS_ItemBoxOpen = 0; GRSS_Old_Bosses_On = false; GRSS_WipeCauser = "Unknown"; GRSS_LastWipeTime = 0; GRSS_LastSnapshot = 0; GRSSNewVersionPrinted = nil; GRSS_PopupPoints = 0; GRSS_PopupLootDate = ""; GRSS_PopupLootIndex = ""; GRSS_WaitListRequest = {}; --This is functioning as a Queue of WaitingList requests GRSS_WaitListRequestBoxOpen = 0; GRSS_NumberedSystems = {}; GRSS_Loot = {}; GRSS_WaitingList = {}; GRSS_RaidSignups = {}; GRSS_InviteType = "Waiting List"; GRSS_RollNumber = 1000; GRSS_RaidPointsPopup = 1; GRSS_AutoWipe = 1; GRSS_PendingSnapShotName = "" GRSS_CurrentCalendarIndex = 1; GRSS_LootPromptInCombat = 0; GRSS_LastSnapShotName = ""; GRSS_Redistribute_SnapShot = ""; GRSS_Redistribute_SnapShot_ExpireTime = 0; GRSS_DoingParty = 1; GRSS_NextTime = nil; GRSS_Period = 60; GRSS_ReadyForTimer = false; GRSS_Prefix = "GRSS: "; GRSS_Guild = {}; GRSS_DKP = {}; GRSS_Bids = {}; GRSSCurrentSystem = ""; GRSSCurrentAction = "DKP Standings"; GRSSHelpMsg = { "!help = This help menu", "!dkp = Your current DKP", "!dkp name [name2 name3...] = the DKP for the player 'name' (and name2 and name3) (i.e. !dkp Joe Fred)", "!items = Your item history", "!items name = Item history for player 'name' (i.e. !items Joe)", "!bid X = Bid X points on the current item", "!request = Put in a request for the item", "!dkpclass class [class2 class3...] = the current standings for the 'class' (and 'class2' and 'class3') (i.e. !dkpclass mage warlock)", "!dkpraid X = the current standings for DKP System X for current raid members (to get the list of appropriate Systems, just type !dkpraid)", "!dkpall X = the current standings for DKP System X (to get the list of appropriate Systems, just type !dkpall)", "!price itemname = the price of the item 'itemname' (parts of names work too, i.e. '!price felheart' will retrieve the prices of all items with 'felheart' in the name)", "!waitlist = Add me to the Waiting List", "!waitlistwho = Show a list of who's on the waiting list", }; local GRSSVersion = "2.033"; local GRSSUsage = { "Type |c00ffff00/grss <snapshotname>|r to take a snapshot (ex: |c00ffff00/grss Kel'Thuzad|r)", "|c00ffff00/grss loot|r to open a loot prompt to manually record an item being received", "|c00ffff00/grss adj|r to record an adjustment", "|c00ffff00/grss reset|r to delete all your snapshots", "|c00ffff00/grss show|r to bring up the DKP standings/bidding/rolling screen", "|c00ffff00/grss invite|r to bring up the Waiting List/Auto-Invite screen", "|c00ffff00/grss starttimer|r start Periodic Snapshots", "|c00ffff00/grss stoptimer|r to disable Periodic Snapshots", "|c00ffff00/grss noauto|r to disable auto-snapshot", "|c00ffff00/grss yesauto|r to enable auto-snapshot", "|c00ffff00/grss nosnapshotpopup|r to disable snapshot points popup asking how many points a snapshot is worth", "|c00ffff00/grss yessnapshotpopup|r to enable snapshots points popup asking how many points a snapshot is worth", "|c00ffff00/grss yesscreenshot|r to make snapshots also take a screenshot", "|c00ffff00/grss noscreenshot|r to make snapshots NOT take a screenshot", "|c00ffff00/grss yesloot|r to make Loot received (Blue and better) prompt for points spent", "|c00ffff00/grss noloot|r to disable the loot prompt when items are received", "|c00ffff00/grss yeswipe|r to enable the snapshot prompt when a wipe occurs", "|c00ffff00/grss nowipe|r to disable the snapshot prompt when a wipe occurs", "|c00ffff00/grss yeslootcombat|r allows the loot prompt to pop up in combat", "|c00ffff00/grss nolootcombat|r forces the loot prompt to wait until out of combat (recommended unless you're having problems)", "|c00ffff00/grss yesold|r enables old bosses to trigger a snapshot", "|c00ffff00/grss noold|r disables old bosses triggering a snapshot", "==========================================", "Members can also send you tells like the following for information (you can even send yourself a tell for this info, too)", }; local GRSS_Colors={ --[[ ["ff9d9d9d"] = "grey", ["ffffffff"] = "white", ["ff00ff00"] = "green", ["ff0070dd"] = "rare",--]] ["ffa335ee"] = "epic", ["ffff8000"] = "legendary" }; local GRSS_ChatFrame_OnEvent_Original = nil; function GRSS_IsWhisperGRSSWhisper(e,t,w) if string.find(w,"^!dkp") or string.find(w,"^!items") or string.find(w,"^!info") or string.find(w,"^!commands") or string.find(w,"^!price") or string.find(w,"^!waitlist") then return true; else return false; end end function GRSS_IsOutgoingWhisperGRSSWhisper(e,t,w) if string.find(w,"^"..GRSS_Prefix) then return true; else return false; end end function GRSS_SetItemRef(link,text,button) if GRSSCurrentAction ~= "DKP Standings" and GRSS_Bidding~=1 and GRSS_Rolling~=1 then GRSSItemName:SetText(text); end end function GRSS_EnableOldBosses() GRSS_Old_Bosses_On = true; GRSS_FastBossLookup = {}; for i,v in pairs(GRSS_Bosses) do GRSS_FastBossLookup[v] = v; end for i,v in pairs(GRSS_Bosses_Old) do GRSS_FastBossLookup[v] = v; end end function GRSS_DisableOldBosses() GRSS_Old_Bosses_On = false; GRSS_FastBossLookup = {}; for i,v in pairs(GRSS_Bosses) do GRSS_FastBossLookup[v] = v; end end -- ****************************************************************** -- ************************** ENTRY POINT *************************** -- ****************************************************************** function GuildRaidSnapShot_OnLoad(this) SlashCmdList["GuildRaidSnapShot"] = GuildRaidSnapShot_SlashHandler; SLASH_GuildRaidSnapShot1 = "/grss"; SLASH_GuildRaidSnapShot1 = "/GRSS"; if GRSS_Old_Bosses_On == true then GRSS_EnableOldBosses(); else GRSS_DisableOldBosses(); end this:RegisterEvent("PLAYER_REGEN_ENABLED"); this:RegisterEvent("PLAYER_REGEN_DISABLED"); this:RegisterEvent("PLAYER_DEAD"); this:RegisterEvent("CHAT_MSG_COMBAT_FRIENDLY_DEATH"); this:RegisterEvent("CHAT_MSG_COMBAT_HOSTILE_DEATH"); this:RegisterEvent("PLAYER_TARGET_CHANGED"); this:RegisterEvent("CHAT_MSG_LOOT"); this:RegisterEvent("CHAT_MSG_MONSTER_YELL"); --this:RegisterEvent("CHAT_MSG_YELL"); this:RegisterEvent("CHAT_MSG_RAID_BOSS_EMOTE"); this:RegisterEvent("PLAYER_GUILD_UPDATE"); this:RegisterEvent("GUILD_ROSTER_UPDATE"); this:RegisterEvent("CHAT_MSG_WHISPER"); this:RegisterEvent("CHAT_MSG_SYSTEM"); this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED"); this:RegisterEvent("LOOT_OPENED"); this:RegisterEvent("RAID_ROSTER_UPDATE"); this:RegisterEvent("VARIABLES_LOADED"); this:RegisterEvent("CALENDAR_OPEN_EVENT"); this:RegisterEvent("CALENDAR_UPDATE_EVENT"); this:RegisterEvent("CALENDAR_UPDATE_EVENT_LIST"); this:RegisterEvent("CALENDAR_NEW_EVENT"); -- -- this:RegisterEvent("ADDON_LOADED"); DEFAULT_CHAT_FRAME:AddMessage("GuildRaidSnapShot (By DKPSystem.com) Version "..GRSSVersion.." loaded. "); DEFAULT_CHAT_FRAME:AddMessage("Type |c00ffff00/grss|r to get a list of options for GuildRaidSnapShot"); ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER",GRSS_IsWhisperGRSSWhisper); -- incoming whispers ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER_INFORM",GRSS_IsOutgoingWhisperGRSSWhisper); --outgoing whispers hooksecurefunc("SetItemRef",GRSS_SetItemRef); StaticPopupDialogs["GRSS_ITEMPOINTS"] = { text = "How many points did |c00ffff00%s|r spend on %s", button1 = "OK", button2 = "Cancel", OnAccept = function(self) points = self.editBox:GetText() GRSSRecordItemPointsOnly(points); end, OnShow = function(self) GRSS_ItemBoxOpen = 1; self.editBox:SetText(GRSS_PopupPoints); end, OnHide = function(self) if table.getn(GRSS_ItemQueue) > 0 then GRSS_NextItemPopup(); else GRSS_ItemBoxOpen = 0; end end, timeout = 0, whileDead = 1, hideOnEscape = 1, hasEditBox = 1, enterClicksFirstButton = 1, }; StaticPopupDialogs["GRSS_RAIDPOINTS"] = { text = "How many points should be awarded for the attendees in the snapshot called |c00ffff00%s|r?. Enter |c00ff0000zs|r if you want to award points based on the following loot (items awarded for the next 10 minutes)", button1 = "OK", button2 = "Cancel", OnAccept = function(self) points = self.editBox:GetText() GRSSSetSnapshotPoints(points); end, OnShow = function(self) GRSS_SnapshotBoxOpen = 1; self.editBox:SetText(GRSS_LastSnapShotPoints); end, OnHide = function(self) end, timeout = 0, whileDead = 1, hideOnEscape = 1, hasEditBox = 1, enterClicksFirstButton = 1, }; StaticPopupDialogs["GRSS_WAITINGLIST"] = { text = "Name of person(s) to add to waiting list? If adding more than one, seperate by a space", button1 = "OK", button2 = "Cancel", OnAccept = function(self) name = self.editBox:GetText(); GRSS_AddNameToWaitingList(name); end, OnShow = function(self) self.editBox:SetText("") end, timeout = 0, whileDead = 1, hideOnEscape = 1, hasEditBox = 1, enterClicksFirstButton = 1, }; StaticPopupDialogs["GRSS_RAIDCHECK"] = { text = "There are %s recorded right now. Would you like to keep this data (and apply any expenditures to the current standings) or would you like to purge all the data. You should ONLY purge if you've already uploaded your snapshots.", button1 = "Purge", button2 = "Keep", OnAccept = function(self) GuildRaidSnapShot_SnapShots = {}; GuildRaidSnapShot_Loot = {}; GuildRaidSnapShot_Adj = {}; GRSSPrint("Snapshots Purged"); end, OnCancel = function(self) GRSS_RecalcSpentLoot(); end, timeout = 0, whileDead = 1, }; StaticPopupDialogs["GRSS_TIMERCHECK"] = { text = "The timer is currently running to take snapshots. The next snapshot is set to be taken in |c00ffff00%s minutes|r. Continue the periodic snapshots, or Stop the Timer?", button1 = "Continue", button2 = "Stop Timer", OnAccept = function(self) GRSS_ReadyForTimer = true; local mins = GRSS_NextTime - GetTime(); if mins > 0 then mins = math.floor(mins / 60); GRSSPrint("The next snapshot wlll be in "..mins.." minutes"); end end, OnCancel = function(self) GRSS_NextTime = nil; GRSS_ReadyForTimer = true; GRSSPrint("Snapshot Timer Stopped"); end, timeout = 0 }; StaticPopupDialogs["GRSS_STARTTIMER"] = { text = "How many minutes between snapshots?", button1 = "OK", button2 = "Cancel", OnAccept = function(self) mins = self.editBox:GetText(); if tonumber(mins) == nil then GRSSPrint(mins.." isn't exactly a number, is it?"); else GRSS_StartTimer(mins); end end, OnShow = function(self) self.editBox:SetText(GRSS_Period); end, timeout = 0, whileDead = 1, hideOnEscape = 1, hasEditBox = 1, enterClicksFirstButton = 1, }; StaticPopupDialogs["GRSS_WIPE"] = { text = "Was this a wipe? If so, and if you want to take a snapshot, enter the name of the snapshot and click 'Record Wipe', otherwise, click Cancel", button1 = "Record Wipe", button2 = "Cancel", OnAccept = function(self) name = self.editBox:GetText() GRSS_TakeSnapShot(name); end, OnShow = function(self) self.editBox:SetText("Wipe on "..GRSS_WipeCauser); end, timeout = 0, whileDead = 1, hideOnEscape = 1, hasEditBox = 1, enterClicksFirstButton = 1, }; StaticPopupDialogs["GRSS_AUTOWAITLIST"] = { text = "|c00ffff00%s|r is requesting to be added to the Wait List. Accept or Deny?", button1 = "Accept", button2 = "Deny", OnAccept = function(self) local last = table.getn(GRSS_WaitListRequest); local name = GRSS_WaitListRequest[last]; GRSS_AddNameToWaitingList(name); GRSS_SendWhisper("You've been added to the waiting list","WHISPER",nil,name); end, OnCancel = function(self) local last = table.getn(GRSS_WaitListRequest); local name = GRSS_WaitListRequest[last]; GRSS_SendWhisper("Your request to be added to the waiting list has been denied","WHISPER",nil,name); end, OnHide = function(self) table.remove(GRSS_WaitListRequest); if table.getn(GRSS_WaitListRequest) > 0 then GRSS_NextWaitListRequest(); else GRSS_WaitListRequestBoxOpen = 0; end end, onShow = function(self) GRSS_WaitListRequestBoxOpen = 1; end, timeout = 0, whileDead = 1, }; end function GRSS_GetCalendar() local curmonth,curyear; _,curmonth,_,curyear = CalendarGetDate(); if(GRSS_Calendar == nil) then GRSS_Calendar = {}; end local keepers = {} for m = -1,1 do for d=1,31 do local numevents = CalendarGetNumDayEvents(0,d); --GRSSPrint("Num Events:"..numevents); if numevents > 0 then for e=1,numevents do local title, hour, minute, caltype,_,eventtype = CalendarGetDayEvent(m,d,e); if eventtype > 0 then if caltype=="GUILD" or caltype=="GUILD_EVENT" or caltype=="PLAYER" then month = curmonth + m; year = curyear; if(month < 0) then year = year - 1; month = 12; elseif(month > 12) then year = year + 1; month = 1; end local found = GRSS_FindEvent(title,year,month,d,hour,minute); if found == nil then local event = { title = title, monthoffset = m, month = month, year = year, day = d, eventindex = e, hour = hour, minute = minute, eventtype = eventtype } table.insert(GRSS_Calendar,event); found = table.getn(GRSS_Calendar); end keepers[found] = found; end end end end end end for i,v in pairs(GRSS_Calendar) do if keepers[i]==nil then GRSS_Calendar[i] = nil; end end end function GRSS_FindEvent(title,year,month,day,hour,minute) for i,e in pairs(GRSS_Calendar) do if(e.title == title and e.month==month and e.day==day and e.hour==hour and e.minute==minute and e.year==year) then return i; end end return nil; end function GRSS_StoreEventDetails() local title, desc, creator,eventtype,_,maxsize,_,_,month,day,year,hour,minute = CalendarGetEventInfo(); local i = GRSS_FindEvent(title,year,month,day,hour,minute); if i ~= nil then GRSS_Calendar[i].description = desc; GRSS_Calendar[i].creator = creator; GRSS_Calendar[i].maxsize = maxsize; local numinvites = CalendarEventGetNumInvites(); local invites = {} for ii = 1,numinvites do local name,level,className,_,inviteStatus,modStatus = CalendarEventGetInvite(ii); local _,s_month, s_day, s_year, s_hour, s_minute = CalendarEventGetInviteResponseTime(ii); local signuptime; if s_year==0 then signuptime = month.."/"..day.."/"..year.." "..hour..":"..minute; else signuptime = s_month.."/"..s_day.."/"..s_year.." "..s_hour..":"..s_minute; end local inv = { name = name, level = level, class = className, status = inviteStatus, signuptime = signuptime, }; table.insert(invites,inv); end GRSS_Calendar[i].invites = invites; end end function GRSS_StartTimer(mins) GRSS_Period = mins; GRSS_NextTime = GetTime() + (GRSS_Period*60); GRSS_TakeSnapShot("Periodic Snapshot"); GRSSPrint("Periodic Snapshots Started. Next Snapshot will be in "..mins.." minutes"); end function GRSS_StopTimer() GRSS_Period = nil; GRSS_NextTime = nil; GRSSPrint("Periodic Snapshots Halted"); end function GRSS_Timer_OnUpdate() if GRSS_ReadyForTimer and GRSS_Period and GRSS_NextTime then local now = GetTime(); if now > GRSS_NextTime then GRSS_TakeSnapShot("Periodic Snapshot"); GRSSPrint("Next snapshot will be in "..GRSS_Period.." minutes"); GRSS_NextTime = GetTime() + (GRSS_Period*60); --GRSS_TimerNotify = {}; end end --GRSSPrint("update"); if type(GRSS_GeneralTimer)=="function" then local now = GetTime(); if now > GRSS_GeneralTimeout then GRSSPrint("Timeout"); GRSS_GeneralTimer(); GRSS_GeneralTimer = nil; GRSS_GeneralTimeout = nil; end end end function GRSS_StartGeneralTimer(seconds,fun) GRSS_GeneralTimer = fun; GRSS_GeneralTimeout = GetTime() + seconds; end function GRSS_NextItemPopup() if table.getn(GRSS_ItemQueue) > 0 then local i = table.getn(GRSS_ItemQueue); local item, name, points; GRSS_PopupLootDate = GRSS_ItemQueue[i].date; GRSS_PopupLootIndex = GRSS_ItemQueue[i].index; item = GRSS_ItemQueue[i].item; name = GRSS_ItemQueue[i].name; GRSS_PopupPoints = GRSS_ItemQueue[i].points; table.remove(GRSS_ItemQueue,i); StaticPopup_Show("GRSS_ITEMPOINTS",name,item); end end function GRSS_EnqueueItem(date,index,name,item,points) local temp = {}; temp.date = date; temp.index = index; temp.name = name; temp.item = item; temp.points = points; table.insert(GRSS_ItemQueue,1,temp); end function GRSSLootSave() local system = UIDropDownMenu_GetText(GRSSLootSystemDropDown); local player = GRSSLootPlayer:GetText(); local points = GRSSLootPoints:GetText(); local item = GRSSLootItem:GetText(); GRSSLootClear(); GRSSRecordItem(system,player,item,points); end function GRSSRecordItemPointsOnly(points) local lootrec = GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex]; local playername = lootrec.player; local sys = lootrec.system; local hardpoints = GRSSPlayerPointCost(playername,sys,points); GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].points = points; GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].hardpoints = hardpoints; GRSS_RecordCurrentPlayerReceivedItem(points); if GRSS_Redistributing() then GRSSObamaPoints(hardpoints) end end function GRSSAdjSave() local system = UIDropDownMenu_GetText(GRSSAdjSystemDropDown); local player = GRSSAdjPlayer:GetText(); local points = GRSSAdjPoints:GetText(); local desc = GRSSAdjDesc:GetText(); local adjtype = ""; if GRSS_Divide[system] then adjtype = GRSS_GetAdjType(); end GRSSAdjClear(); GRSSRecordAdj(system,player,item,points,adjtype,desc); end function GRSSRecordItem(system,player,item,points) local lootdate = date("%Y-%m-%d"); if(GuildRaidSnapShot_Loot[lootdate] == nil) then GuildRaidSnapShot_Loot[lootdate] = {}; end local iteminfo = {}; iteminfo.player = player; iteminfo.item = item; iteminfo.RealmName = GetRealmName(); iteminfo.date = date("%Y-%m-%d %H:%M:%S"); iteminfo.system = system; iteminfo.points = points; iteminfo.hardpoints = GRSSPlayerPointCost(player,system,points); if GRSS_Redistributing() then GRSSObamaPoints(iteminfo.hardpoints); end table.insert(GuildRaidSnapShot_Loot[lootdate],iteminfo); if points ~= nil then GRSSAddPoints(player,system,"spent",iteminfo.hardpoints); end return lootdate; end function GRSSRecordAdj(system,player,item,points,adjtype,desc) local lootdate = date("%Y-%m-%d"); if(GuildRaidSnapShot_Adj[lootdate] == nil) then GuildRaidSnapShot_Adj[lootdate] = {}; end local adjinfo = {}; adjinfo.player = player; adjinfo.item = item; adjinfo.RealmName = GetRealmName(); adjinfo.date = date("%Y-%m-%d %H:%M:%S"); adjinfo.system = system; adjinfo.points = points; adjinfo.adjtype = adjtype; adjinfo.description = desc; table.insert(GuildRaidSnapShot_Adj[lootdate],adjinfo); if points ~= nil then if GRSS_Divide[system] then GRSSAddPoints(player,system,adjtype,points); else GRSSAddPoints(player,system,"adj",points); end end return lootdate; end function GRSSLootClear() getglobal("GRSSLootPlayer"):SetText(""); getglobal("GRSSLootPoints"):SetText(""); getglobal("GRSSLootItem"):SetText(""); end function GRSSAdjClear() getglobal("GRSSAdjPlayer"):SetText(""); getglobal("GRSSAdjPoints"):SetText(""); getglobal("GRSSAdjDesc"):SetText(""); end function GRSS_RecalcSpentLoot() if GuildRaidSnapShot_Loot then for ld,daytable in pairs(GuildRaidSnapShot_Loot) do for lootindex,loottable in pairs(daytable) do if loottable.system == nil or GRSS_Systems[loottable.system]==nil then loottable.system = GRSSCurrentSystem end --points = GRSSPlayerPointCost(loottable.player,loottable.system,loottable.points); points = loottable.hardpoints; if tonumber(points) == nil then points = loottable.points; end if tonumber(points) ~= nil then GRSSAddPoints(loottable.player,loottable.system,"spent",points); end end end end if GuildRaidSnapShot_Adj then for ld,daytable in pairs(GuildRaidSnapShot_Adj) do if daytable then for adjindex,adjtable in pairs(daytable) do if adjtable.system == nil or GRSS_Systems[adjtable.system]==nil then adjtable.system = GRSSCurrentSystem end points = adjtable.points; if tonumber(points) ~= nil then if GRSS_Divide[adjtable.system] then adjtype = adjtable.adjtype; else adjtype = "adj"; end GRSSAddPoints(adjtable.player,adjtable.system,adjtype,points); end end end end end if GuildRaidSnapShot_SnapShots then for snapshot in pairs(GuildRaidSnapShot_SnapShots) do GRSSAddSnapshotPoints(snapshot); end GRSSChangeSystem(GRSSCurrentSystem); end end function GRSSSetSnapshotPoints(points) if string.lower(points)=="zs" or string.lower(points)=="sz" then GRSSPrint("All Items received for the next 15 minutes will get redistributed and associated with this snapshot"); GRSS_Redistribute_SnapShot = GRSS_LastSnapShotName; GRSS_Redistribute_SnapShot_ExpireTime = GetTime() + 15*60; -- Expire in 15 minutes GuildRaidSnapShot_SnapShots[GRSS_LastSnapShotName].redistribute = 1; GuildRaidSnapShot_SnapShots[GRSS_LastSnapShotName].points = 0; else GuildRaidSnapShot_SnapShots[GRSS_LastSnapShotName].points = points; end GRSSAddSnapshotPoints(GRSS_LastSnapShotName); end -- This works for the whole snapshot function GRSSAddSnapshotPoints(snapshotname) local points = GRSSNumNilZero(GuildRaidSnapShot_SnapShots[snapshotname].points); local sys = GuildRaidSnapShot_SnapShots[snapshotname].system; local players = GRSS_ParsePlayers(GuildRaidSnapShot_SnapShots[snapshotname].Raid); if GuildRaidSnapShot_SnapShots[snapshotname].redistribute then points = points/table.getn(players); end for _,mem in pairs(players) do GRSSAddPoints(mem,sys,"earned",points); end end -- Obama = Redistribution, get it? OLZOLZOLZ -- This works only for newly added items, to adjust the previous value of a snapshot when an item is received and redistributed function GRSSObamaPoints(totalpoints) local snapshotname = GRSS_Redistribute_SnapShot; local curpoints = GuildRaidSnapShot_SnapShots[snapshotname].points; local sys = GuildRaidSnapShot_SnapShots[snapshotname].system; local players = GRSS_ParsePlayers(GuildRaidSnapShot_SnapShots[snapshotname].Raid); local newpoints = curpoints + totalpoints; GuildRaidSnapShot_SnapShots[snapshotname].points = newpoints; local toadd = totalpoints / table.getn(players); for _,mem in pairs(players) do GRSSAddPoints(mem,sys,"earned",toadd); end end -- Returns the snapshot name if we are redistributing, else, returns nil function GRSS_Redistributing() if GRSS_Redistribute_SnapShot_ExpireTime > 0 and GetTime() < GRSS_Redistribute_SnapShot_ExpireTime then return GRSS_Redistribute_SnapShot; else return nil; end end function GRSSTrim (s) return (string.gsub(s, "^%s*(.-)%s*$", "%1")) end function GRSS_ParsePlayers(str) local retarr = {}; local pzarr = { strsplit(",",str) }; -- Players with Zones for _,pz in pairs(pzarr) do local p,z = strsplit(":",pz); if(z~="Offline") then table.insert(retarr,GRSSTrim(p)); end end return retarr; end function GRSS_PendingSnapshotCheck() local items = 0; local snapshots = 0; local adjustments = 0; for _ in pairs(GuildRaidSnapShot_SnapShots) do snapshots = snapshots + 1; end for i,v in pairs(GuildRaidSnapShot_Adj) do adjustments = adjustments + table.getn(v); end for i,v in pairs(GuildRaidSnapShot_Loot) do items = items + table.getn(v); end if snapshots > 0 or items > 0 or adjustments > 0 then local msg = items.." items, "..snapshots.." snapshots, and "..adjustments.." adjustments"; StaticPopup_Show("GRSS_RAIDCHECK",msg); end end function GRSS_TimerRunningCheck() if GRSS_NextTime then local mins = math.floor((GRSS_NextTime - GetTime())/60); if mins < 0 then mins = 0 end GRSSPrint("timercheck"); StaticPopup_Show("GRSS_TIMERCHECK",mins); else GRSS_ReadyForTimer = true; end end -- function GRSS_RecordCurrentPlayerReceivedItem(pointstr) playername = string.lower(GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].player); normalplayername = GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].player; points = GRSSPlayerPointCost(playername,GRSSCurrentSystem,pointstr); if tonumber(points) ~= nil and tonumber(points) ~= 0 then points = tonumber(points); GRSSAddPoints(normalplayername,GRSSCurrentSystem,"spent",points); temp = "Today: "..normalplayername.." <-- "..GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].item.." for "..points; if GRSS_ItemHistory[string.upper(playername)] ~= nil then table.insert(GRSS_ItemHistory[string.upper(playername)],temp); else GRSS_ItemHistory[string.upper(playername)] = {}; GRSS_ItemHistory[string.upper(playername)][0] = temp; end GRSSScrollBar_Update(); end end function GRSS_GetItemPoints(item) for i,v in pairs(GRSS_ItemPrices[GRSSCurrentSystem]) do if string.lower(item)==string.lower(v.name) then return v.points; end end return ""; end --Sorts the Temp table GRSS_DKP function GRSSSortBy(sort) GRSS_CurrentSort = sort; table.sort(GRSS_DKP, function(a,b) if sort=="spent" then if GRSSCurrentAction == "DKP Standings" then return GRSSNum(a.spent) > GRSSNum(b.spent); elseif GRSSCurrentAction == "Rolls" or GRSSCurrentAction=="DKP+Roll" then return GRSSNum(a.roll) > GRSSNum(b.roll); elseif GRSSCurrentAction == "Bids" or GRSSCurrentAction == "Bid+Roll" then return GRSSNum(a.bid) > GRSSNum(b.bid); end elseif sort=="bidroll" or (GRSSCurrentAction=="Bid+Roll" and sort=="adj") then return GRSSNumNilZero(a.roll) + GRSSNumNilZero(a.bid) > GRSSNumNilZero(b.roll) + GRSSNumNilZero(b.bid); elseif sort=="rankid" then return GRSSNum(a.rankid) < GRSSNum(b.rankid); elseif a[sort]==b[sort] then return GRSSNum(a.total) > GRSSNum(b.total); elseif sort=="name" or sort=="class" then return (string.lower(a[sort]) < string.lower(b[sort])) else return (GRSSNum(a[sort]) > GRSSNum(b[sort])) end end ); GRSSScrollBar_Update(); end --Sorts the Full table generated by the downloader: GRSS_Full_DKP function GRSSSortByFull(sort,sys) table.sort(GRSS_Full_DKP[sys], function(a,b) if sort=="spent" then if GRSSCurrentAction == "DKP Standings" then return GRSSNum(a.spent) > GRSSNum(b.spent); elseif GRSSCurrentAction == "Rolls" then return GRSSNum(a.roll) > GRSSNum(b.roll); elseif GRSSCurrentAction == "Bids" then return GRSSNum(a.bid) > GRSSNum(b.bid); end elseif a[sort]==b[sort] then return GRSSNum(a.earned) + GRSSNum(a.adj) - GRSSNum(a.spent) > GRSSNum(b.earned) + GRSSNum(b.adj) - GRSSNum(b.spent); elseif sort=="name" or sort=="class" then return (string.lower(a[sort]) < string.lower(b[sort])) else return (GRSSNum(a[sort]) > GRSSNum(b[sort])) end end ); end function GRSSChangeSystem(sys) if sys ~= nil and GRSS_Full_DKP[sys]~=nil then local inc = 1; local i,v; local top = table.getn(GRSS_Full_DKP[sys]); GRSS_DKP = {}; local RaidTable = GRSS_RaidTable(); if GRSS_RaidFilter == "Raid Only" and GRSS_MainOnly[sys] then for name,v in pairs(RaidTable) do if GRSS_Alts[string.lower(name)] then RaidTable[string.upper(GRSS_Alts[string.lower(name)])] = 1; end end end if(GRSS_RaidFilter == "" or GRSS_RaidFilter == nil) then GRSS_RaidFilter = "All"; end for i=1,top do if GRSS_RaidFilter == "All" or RaidTable[string.upper(GRSS_Full_DKP[sys][i].name)]==1 then if GRSS_ClassFilter == "All" or string.upper(GRSS_Full_DKP[sys][i].class) == string.upper(GRSS_ClassFilter) then GRSS_DKP[inc] = {}; GRSS_DKP[inc].name = GRSS_Full_DKP[sys][i].name; GRSS_DKP[inc].class = GRSS_Full_DKP[sys][i].class; GRSS_DKP[inc].earned = GRSS_Full_DKP[sys][i].earned; GRSS_DKP[inc].spent = GRSS_Full_DKP[sys][i].spent; GRSS_DKP[inc].adj = GRSS_Full_DKP[sys][i].adj; if GRSS_Divide and GRSS_Divide[sys] then GRSS_DKP[inc].total = GRSS_DKP[inc].earned/GRSSNumNilOne(GRSS_DKP[inc].spent); else GRSS_DKP[inc].total = GRSS_DKP[inc].earned + GRSS_DKP[inc].adj - GRSS_DKP[inc].spent end GRSS_DKP[inc].bid = "" GRSS_DKP[inc].roll = "" GRSS_DKP[inc].rank = GRSS_Full_DKP[sys][i].rank; GRSS_DKP[inc].rankid = GRSS_Full_DKP[sys][i].rankid; inc = inc + 1; end end end GRSSScrollBar_Update(); GRSSSortBy("total"); GRSSScrollBar:Show(); if table.getn(GRSS_NumberedSystems)==0 then for mysys in pairs(GRSS_Systems) do table.insert(GRSS_NumberedSystems,mysys); end end end end function GRSSGenerateBids() GRSS_Bids = {}; local temp = {}; local n = 24; local m = table.getn(GRSS_DKP); for i=1,n do temp = {}; temp.name = GRSS_DKP[math.random(m)].name; temp.bid = math.random(1000); table.insert(GRSS_Bids,temp); end GRSSBidsScrollBar_Update(); end function GRSSNum(v) v = tonumber(v); if v == nil then v = -9999999 end return v; end function GRSSNumNilOne(v) v = tonumber(v); if v==nil or v==0 then v = 1; end return v; end function GRSSNumNilZero(v) v = tonumber(v); if v == nil then v = 0 end return v; end function GRSSScrollBar_Update() local line; -- 1 through 10 of our window to scroll local lineplusoffset; -- an index into our data calculated from the scroll offset local earned,sent,adj; FauxScrollFrame_Update(GRSSScrollBar,table.getn(GRSS_DKP),10,16); for line=1,10 do lineplusoffset = line + FauxScrollFrame_GetOffset(GRSSScrollBar); if lineplusoffset <= table.getn(GRSS_DKP) then earned = ""; spent = ""; adj = ""; total = GRSS_DKP[lineplusoffset].total; -- Default Val for that if GRSSCurrentAction == "DKP Standings" then spent = GRSS_DKP[lineplusoffset].spent; earned = GRSS_DKP[lineplusoffset].earned; adj = GRSS_DKP[lineplusoffset].adj; elseif GRSSCurrentAction == "Rolls" then spent = GRSS_DKP[lineplusoffset].roll; elseif GRSSCurrentAction == "Bids" then spent = GRSS_DKP[lineplusoffset].bid; elseif GRSSCurrentAction == "Bid+Roll" then earned = GRSS_DKP[lineplusoffset].roll; spent = GRSS_DKP[lineplusoffset].bid; adj = GRSSNumNilZero(earned) + GRSSNumNilZero(spent); if adj==0 then adj = ""; end elseif GRSSCurrentAction == "DKP+Roll" then earned = GRSS_DKP[lineplusoffset].roll; if GRSSNumNilZero(earned) > 0 then adj = GRSSNumNilZero(earned) + total; end end getglobal("GRSSRow"..line.."FieldPlayer"):SetText(GRSS_DKP[lineplusoffset].name); getglobal("GRSSRow"..line.."FieldClass"):SetText(GRSS_DKP[lineplusoffset].class); getglobal("GRSSRow"..line.."FieldRank"):SetText(GRSS_DKP[lineplusoffset].rank); getglobal("GRSSRow"..line.."FieldEarned"):SetText(earned); getglobal("GRSSRow"..line.."FieldSpent"):SetText(spent); getglobal("GRSSRow"..line.."FieldAdj"):SetText(adj); if tonumber(GRSS_DKP[lineplusoffset].total) ~= nil then getglobal("GRSSRow"..line.."FieldDKP"):SetText(string.format("%.2f",GRSS_DKP[lineplusoffset].total)); else getglobal("GRSSRow"..line.."FieldDKP"):SetText(GRSS_DKP[lineplusoffset].total); end getglobal("GRSSRow"..line.."FieldPlayer"):Show(); getglobal("GRSSRow"..line.."FieldClass"):Show(); getglobal("GRSSRow"..line.."FieldRank"):Show(); getglobal("GRSSRow"..line.."FieldEarned"):Show(); getglobal("GRSSRow"..line.."FieldSpent"):Show(); getglobal("GRSSRow"..line.."FieldAdj"):Show(); getglobal("GRSSRow"..line.."FieldDKP"):Show(); getglobal("GRSSRow"..line.."FieldHighlight"):Show(); else getglobal("GRSSRow"..line.."FieldPlayer"):Hide(); getglobal("GRSSRow"..line.."FieldClass"):Hide(); getglobal("GRSSRow"..line.."FieldRank"):Hide(); getglobal("GRSSRow"..line.."FieldEarned"):Hide(); getglobal("GRSSRow"..line.."FieldSpent"):Hide(); getglobal("GRSSRow"..line.."FieldAdj"):Hide(); getglobal("GRSSRow"..line.."FieldDKP"):Hide(); getglobal("GRSSRow"..line.."FieldHighlight"):Hide(); end end end function GRSSBidsScrollBar_Update() local line; -- 1 through 10 of our window to scroll local lineplusoffset; -- an index into our data calculated from the scroll offset local earned,sent,adj; FauxScrollFrame_Update(GRSSBidsScrollBar,table.getn(GRSS_Bids),23,16); for line=1,23 do lineplusoffset = line + FauxScrollFrame_GetOffset(GRSSBidsScrollBar); if lineplusoffset <= table.getn(GRSS_Bids) then getglobal("GRSSBidsRow"..line.."FieldPlayer"):SetText(GRSS_Bids[lineplusoffset].name); getglobal("GRSSBidsRow"..line.."FieldBid"):SetText(GRSS_Bids[lineplusoffset].bid); getglobal("GRSSBidsRow"..line.."FieldBidType"):SetText(GRSS_Bids[lineplusoffset].bidtype); getglobal("GRSSBidsRow"..line.."FieldPlayer"):Show(); getglobal("GRSSBidsRow"..line.."FieldBid"):Show(); getglobal("GRSSBidsRow"..line.."FieldBidType"):Show(); getglobal("GRSSBidsRow"..line.."Delete"):Show(); getglobal("GRSSBidsRow"..line.."FieldHighlight"):Show(); else getglobal("GRSSBidsRow"..line.."FieldPlayer"):Hide(); getglobal("GRSSBidsRow"..line.."FieldBid"):Hide(); getglobal("GRSSBidsRow"..line.."FieldBidType"):Hide(); getglobal("GRSSBidsRow"..line.."FieldHighlight"):Hide(); getglobal("GRSSBidsRow"..line.."Delete"):Hide(); end end end function nn(v) if v == nil then return "nil" else return v; end end function GuildRaidSnapShot_OnEvent(this,event,...) local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = ...; if(event == "CHAT_MSG_MONSTER_YELL" --[[or event == "CHAT_MSG_YELL"--]]) then if GRSS_Auto==1 and GRSS_Yells[arg2] ~= nil then if string.find(arg1,GRSS_Yells[arg2]) ~= nil then if GRSS_Yell_Redirect[arg2] ~= nil then arg2 = GRSS_Yell_Redirect[arg2]; end if InCombatLockdown() then GRSS_PendingSnapShotName = arg2; else GRSS_TakeSnapShot(arg2); end end end elseif(event == "CHAT_MSG_RAID_BOSS_EMOTE") then if GRSS_Auto == 1 then for i,v in ipairs(GRSS_BossEmote) do if string.find(arg1,v) then if InCombatLockdown() then GRSS_PendingSnapShotName = i; else GRSS_TakeSnapShot(i); end end end end elseif(event == "PLAYER_REGEN_ENABLED") then if GRSS_PendingSnapShotName ~= "" then GRSS_TakeSnapShot(GRSS_PendingSnapShotName); GRSS_PendingSnapShotName = ""; end if table.getn(GRSS_ItemQueue) > 0 then GRSS_NextItemPopup(); end if table.getn(GRSS_WaitListRequest)>0 then GRSS_NextWaitListRequest() end elseif(event=="PLAYER_DEAD" or event=="CHAT_MSG_COMBAT_FRIENDLY_DEATH") then GRSS_WipeCheck(); elseif(event=="COMBAT_LOG_EVENT_UNFILTERED") then if(arg2=="PARTY_KILL" or arg2=="UNIT_DIED") then if not IsActiveBattlefieldArena() then local bossname = arg9; if GRSS_FastBossLookup[bossname] ~= nil and GRSS_Auto == 1 then if GRSS_Boss_Redirect[bossname] ~= nil then bossname = GRSS_Boss_Redirect[bossname]; end if InCombatLockdown() then GRSS_PendingSnapShotName = bossname; else GRSS_TakeSnapShot(bossname); end end end end elseif(event=="PLAYER_TARGET_CHANGED") then local name = UnitName("target"); if name ~= nil and GRSS_FastBossLookup[name]~= nil then GRSS_WipeCauser = name; end elseif(event == "PLAYER_GUILD_UPDATE") then GuildRoster(); elseif(event == "VARIABLES_LOADED") then GRSSInviteScrollBar_Update(); GRSS_PendingSnapshotCheck(); GRSS_TimerRunningCheck(); elseif(event == "CALENDAR_OPEN_EVENT" or event=="CALENDAR_UPDATE_EVENT" or event=="CALENDAR_UPDATE_EVENT_LIST" or event=="CALENDAR_NEW_EVENT") then GRSS_GetCalendar(); GRSS_StoreEventDetails(); elseif(event == "GUILD_ROSTER_UPDATE") then GRSS_TakeGuildOnly(); elseif(event == "CHAT_MSG_LOOT") then GRSS_CaptureLoot(arg1); elseif(event == "RAID_ROSTER_UPDATE") then GRSS_RaidChange(arg1,arg2); elseif(event == "LOOT_OPENED") then GRSS_GetLoot(); elseif(event == "CHAT_MSG_WHISPER") then GRSS_ProcessWhisper(arg2,arg1,this.language); elseif(event == "CHAT_MSG_SYSTEM") then if GRSS_Rolling==1 or GRSS_BidRolls then local name, roll; for name, roll in string.gmatch(arg1, "(.+) rolls (%d+) %(1%-"..GRSS_RollNumber.."%)") do GRSS_RecordRoll(name, roll); if GRSS_BidRolls==1 then GRSSSortBy("bidroll"); else GRSSSortBy("roll"); end end end elseif(event == "ADDON_LOADED") then UIDropDownMenu_SetText(GRSSRollNumberDropDown,"1-"..GRSSNumNilZero(GRSS_RollNumber)); end end function GRSS_IsZoneIgnored() local zone = GetRealZoneText(); for i,v in pairs(GRSS_ZoneIgnore) do if v == zone then return 1; end end return nil; end function GRSS_WipeCheck() if GRSS_Auto and GRSS_AutoWipe==1 and not IsActiveBattlefieldArena() and not GRSS_IsZoneIgnored() then local num = GetNumRaidMembers(); local is_dead,online,dead,alive,name; dead = 0; if num>1 then for i = 1, num do name,_,_,_,_,_,_,online,is_dead = GetRaidRosterInfo(i); if is_dead or not online then dead = dead + 1 end end end if (dead/num) >= 0.7 then if(GetTime() > GRSS_LastWipeTime+120) then GRSS_LastWipeTime = GetTime(); StaticPopup_Show("GRSS_WIPE"); end end end end function GRSS_RecordRoll(name,roll) local itemname = GRSSItemName:GetText() for i,v in pairs(GRSS_DKP) do if string.lower(v.name)==string.lower(name) or (GRSS_MainOnly[GRSSCurrentSystem] and GRSS_Alts[string.lower(name)]==string.lower(v.name)) then if GRSS_DKP[i].roll == "" or GRSS_DKP[i].roll == nil then GRSS_DKP[i].roll = roll; GRSS_SendWhisper("Your roll of "..roll.." for "..itemname.." has been recorded","WHISPER",nil,name); end return; end end temp = {}; temp.name = name; temp.class = "?"; temp.spent = ""; temp.earned = ""; temp.adj = ""; temp.roll = roll; temp.total = "?"; GRSS_SendWhisper("Your roll of "..roll.." for "..itemname.." has been recorded","WHISPER",nil,name); table.insert(GRSS_DKP,1,temp); --GRSSScrollBar_Update(); end function GRSS_SendWhisper(msg,msgtype,lang,to) SendChatMessage(GRSS_Prefix..msg,msgtype,lang,to); end -- Will search S for the regular expressions and return the result of the first successful search, or nil if none is found -- Allows for a briefer way rather than doing if string.find, then return, elseif string.find.... function GRSS_MultiRegex(s,...) for i,v in ipairs({...}) do if(string.find(s,v)) then return string.find(s,v); end end return nil; end function GRSS_ProcessWhisper(from,msg,lang) temp = {}; if(string.find(msg,"^!waitlistwho") or string.find(msg,"^!whowaitlist")) then local _,waitlist = GRSS_WaitCommaList(); GRSS_SendWhisper("Waiting List: "..waitlist,"WHISPER",lang,from); elseif(string.find(msg,"^!waitlist")) then if not GRSS_IsNameQueuedOnWaitList(from) then GRSS_QueueWaitListRequest(from) end if GRSS_IsNameOnWaitingList(from) then GRSS_SendWhisper("You're already on the waiting list","WHISPER",lang,from); elseif InCombatLockdown() then GRSS_SendWhisper("Your request to be added to the waiting list has been received, but I am currently in combat. When I am out of combat, I will be able to respond to your request","WHISPER",lang,from); elseif GRSS_WaitListRequestBoxOpen==0 then GRSS_NextWaitListRequest() end elseif(string.find(msg,"^!bid") or string.find(msg,"^!req")) then if GRSS_Bidding == 1 or GRSS_BidRolls==1 then local bidtype; local amtsrch = "%s+(%d*)"; s,e,bidtype,amt = GRSS_MultiRegex(msg, "^!bid(main)"..amtsrch, "^!bid(off)"..amtsrch, "^!bid(alt)"..amtsrch, "^!(bid)"..amtsrch ); if bidtype=="main" then bidtype = "Main"; elseif bidtype=="off" then bidtype = "Offspec"; elseif bidtype=="alt" then bidtype = "Alt"; else bidtype = ""; end name = GRSSExtractPlayerName(from); temp.name = name; if GRSS_BidStyle=="Requests" and GRSS_BidRolls==nil then amt = "R"; else if amt=="" then amt = "blank"; else amt = GRSSNumNilZero(amt); end end temp.bid = amt; temp.bidtype = bidtype; table.insert(GRSS_Bids,temp); GRSSBidsScrollBar_Update(); if GRSS_BidRolls==1 then GRSS_SendWhisper("Your bid of "..amt.." has been recorded. Remember to also /roll "..GRSS_RollNumber.." if you haven't yet","WHISPER",lang,from); elseif GRSS_BidStyle=="Silent Non-Auction" then GRSS_SendWhisper("Your bid of "..amt.." has been recorded","WHISPER",lang,from); elseif GRSS_BidStyle=="Requests" then GRSS_SendWhisper("Your request has been recorded","WHISPER",lang,from); elseif GRSS_BidStyle=="Silent Auction" or GRSS_BidStyle=="Open Auction" then if tonumber(amt)~=nil and tonumber(amt) > GRSS_HighBid then GRSS_SendWhisper("You are now the high bidder with "..amt,"WHISPER",lang,from); GRSS_HighBid = tonumber(amt); if GRSS_HighBidder ~= name and GRSS_HighBidder ~= "" then GRSS_SendWhisper("You are no longer the high bidder. The high bid is now "..GRSS_HighBid..".","WHISPER",nil,GRSS_HighBidder); end GRSS_HighBidder = name; if GRSS_BidStyle=="Silent Auction" then SendChatMessage("The high bid is now "..amt,"RAID"); else SendChatMessage(GRSS_HighBidder.." is now the high bidder with "..amt,"RAID"); end elseif tonumber(amt)~=nil and tonumber(amt) < GRSS_HighBid then GRSS_SendWhisper(amt.." is too low","WHISPER",lang,from); elseif tonumber(amt)~=nil and tonumber(amt) == GRSS_HighBid then GRSS_SendWhisper("Your bid of "..amt.." ties you with the high bidder", "WHISPER", lang, from); else GRSS_SendWhisper("Your bid was not understood. Please specify a number. (ie: !bid 365)","WHISPER",lang,from); end end local found=false; for i,v in pairs(GRSS_DKP) do if string.lower(v.name)==string.lower(name) or (GRSS_MainOnly[GRSSCurrentSystem] and GRSS_Alts[string.lower(name)]==string.lower(v.name)) then if tonumber(GRSS_DKP[i].bid)==nil or (tonumber(amt) ~= nil and tonumber(GRSS_DKP[i].bid) < tonumber(amt)) then GRSS_DKP[i].bid = amt; end found=true end end if found==false then temp = {}; temp.name = name; temp.class = "?"; temp.spent = ""; temp.earned = ""; temp.adj = ""; temp.bid = amt; temp.total = "?"; table.insert(GRSS_DKP,1,temp); end if GRSS_BidRolls==1 then GRSSSortBy("bidroll"); else GRSSSortBy("bid"); end GRSSScrollBar_Update(); else GRSS_SendWhisper("Sorry, bids are not being received right now", "WHISPER", lang, from); end elseif(string.find(msg,"^!dkpclass")) then s,e,class = string.find(msg,"^!dkpclass%s+(.+)"); if class==nil or class == "" then GRSS_SendWhisper("You need to specify a class (i.e. !dkpclass mage)", "WHISPER", lang, from); else found = false; local classes = {}; for w in string.gmatch(string.upper(class),"(%a+)") do classes[w]=w; end if string.find(string.lower(class),"death%s*knight") then classes["DEATH KNIGHT"]="DEATH KNIGHT"; end for sys in pairs(GRSS_Systems) do GRSSSortByFull("total",sys); for i,v in pairs(GRSS_Full_DKP[sys]) do if classes[string.upper(v.class)] then local total; if GRSS_Divide[sys] == nil then total = tonumber(v.earned) + tonumber(v.adj) - tonumber(v.spent) else total = GRSSNumNilZero(v.earned) / GRSSNumNilOne(v.spent); end GRSS_SendWhisper("("..sys..") "..v.name.."("..v.class.."): "..total,"WHISPER",lang,from); found=true; end end end if found==false then GRSS_SendWhisper("Sorry, no players were found with the class "..class,"WHISPER",lang,from); end end elseif(string.find(msg,"^!dkpraid")) then s,e,sysid = string.find(msg,"^!dkpraid%s+(.+)%s*"); if sysid==nil or sys=="" or GRSS_NumberedSystems[GRSSNumNilZero(sysid)]==nil then GRSS_SendWhisper("You'll need to specify one of the following DKP Systems in the following form...","WHISPER",lang,from); for sysid,sys in pairs(GRSS_NumberedSystems) do GRSS_SendWhisper("For "..sys..": !dkpraid "..sysid,"WHISPER",lang,from); end else sys = GRSS_NumberedSystems[GRSSNumNilZero(sysid)]; GRSSSortByFull("total",sys); RaidTable = GRSS_RaidTable(); GRSS_SendWhisper("Sending DKP for "..sys.." (only showing Raid Members)","WHISPER",lang,from); for i,v in pairs(GRSS_Full_DKP[sys]) do if RaidTable[string.upper(v.name)]==1 then local total = GRSSNumNilZero(v.earned) + GRSSNumNilZero(v.adj) - GRSSNumNilZero(v.spent) GRSS_SendWhisper(v.name.."("..v.class.."): "..total,"WHISPER",lang,from); found=true; end end end elseif(string.find(msg,"^!dkpall")) then s,e,sysid = string.find(msg,"^!dkpall%s+(.+)%s*"); if sysid==nil or sys=="" or GRSS_NumberedSystems[GRSSNumNilZero(sysid)]==nil then GRSS_SendWhisper("You'll need to specify one of the following DKP Systems in the following form...","WHISPER",lang,from); for sysid,sys in pairs(GRSS_NumberedSystems) do GRSS_SendWhisper("For "..sys..": !dkpall "..sysid,"WHISPER",lang,from); end else local count = 0; sys = GRSS_NumberedSystems[GRSSNumNilZero(sysid)]; GRSSSortByFull("total",sys); GRSS_SendWhisper("Sending DKP for "..sys.." (Only showing top 40)","WHISPER",lang,from); for i,v in pairs(GRSS_Full_DKP[sys]) do if count < 40 then local total; if GRSS_Divide[sys] == nil then total = GRSSNumNilZero(v.earned) + GRSSNumNilZero(v.adj) - GRSSNumNilZero(v.spent) else total = GRSSNumNilZero(v.earned) / GRSSNumNilOne(v.spent); end --local total = GRSSNumNilZero(v.earned) + GRSSNumNilZero(v.adj) - GRSSNumNilZero(v.spent) GRSS_SendWhisper(v.name.."("..v.class.."): "..total,"WHISPER",lang,from); found=true; count = count + 1 end end end elseif(string.find(msg,"^!dkp")) then s,e,name = string.find(msg,"^!dkp%s*(.*)"); if name == "" then name = from; end name = GRSSExtractPlayerName(name); tosend = GRSSGetPlayerDKP(name); for i,v in pairs(tosend) do GRSS_SendWhisper(v, "WHISPER", lang, from); end if table.getn(tosend)==0 then GRSS_SendWhisper("No player named "..name.." found", "WHISPER", lang, from); end elseif(string.find(msg,"^!items")) then s,e,name = string.find(msg,"^!items%s*(.*)%s*"); if name == "" then playername = string.upper(from); else playername = string.upper(name); end playername = GRSSExtractPlayerName(playername); if GRSS_ItemHistory[playername] ~= nil then for i,v in pairs(GRSS_ItemHistory[playername]) do GRSS_SendWhisper(v,"WHISPER",lang,from); end else GRSS_SendWhisper("There is no item history for "..playername,"WHISPER",lang,from); end elseif(string.find(msg,"^!price%s")) then s,e,itemraw = string.find(msg,"^!price%s+(.*)%s*"); s,e,color,item = string.find(itemraw, "|c(%x+)|Hitem:%d+:%d+:%d+:%d+|h%[(.-)%]|h|r"); if not s then item = itemraw end found = false; for sys in pairs(GRSS_Systems) do for i,v in pairs(GRSS_ItemPrices[sys]) do if string.find(string.lower(v.name),string.lower(item)) then if GRSSNumNilZero(v.points) > 0 then GRSS_SendWhisper("("..sys..") "..v.name..": "..v.points.." points","WHISPER",lang,from); found = true; end end end end if found == false then GRSS_SendWhisper("Sorry no item by the name of '"..item.." was found","WHISPER",lang,from); end elseif(string.find(msg,"^!help") or string.find(msg,"^!%?") or string.find(msg,"^!info") or string.find(msg,"^!commands")) then if string.upper(from) == string.upper(UnitName("player")) then for i,v in pairs(GRSSHelpMsg) do GRSSPrint(v); end else for i,v in pairs(GRSSHelpMsg) do GRSS_SendWhisper(v,"WHISPER",lang,from); end end end end function GRSSExtractPlayerName(playername) s,_,name = string.find(playername, "(.*)-.*"); if not(s) then return playername; else return name; end end function GRSSFindPlayerSystemIndex_NoAltCheck(playername,sys) playername = string.lower(playername); if GRSS_Full_DKP[sys]==nil then GRSS_Full_DKP[sys] = {}; end for i,v in pairs(GRSS_Full_DKP[sys]) do if(string.lower(v.name)==playername) then return i; end end return -1; end function GRSSFindPlayerSystemIndex(playername,sys) FoundIndex = GRSSFindPlayerSystemIndex_NoAltCheck(playername,sys); if FoundIndex==-1 and GRSS_MainOnly[sys]==1 and GRSS_Alts[playername] then local newplayername = string.lower(GRSS_Alts[playername]); FoundIndex = GRSSFindPlayerSystemIndex_NoAltCheck(newplayername,sys); end return FoundIndex; end function GRSSLookupPlayerDKP(playername,sys) local i = GRSSFindPlayerSystemIndex(playername,sys); if i == -1 then return 0; else local v = GRSS_Full_DKP[sys][i]; if(string.lower(v.name)==playername) then local total; if(GRSS_Divide[sys] == nil) then total = GRSSNumNilZero(v.earned) + GRSSNumNilZero(v.adj) - GRSSNumNilZero(v.spent); else if(v.spent == 0) then v.spent = 1; end total = GRSSNumNilZero(v.earned) / GRSSNumNilZero(v.spent); end return total; end end end function GRSSAddPoints(playername,sys,pointtype,points) if sys==nil then sys = GRSSCurrentSystem end if sys==nil then return; end local i = GRSSFindPlayerSystemIndex(playername,sys); if i == -1 then local temp = {}; temp.name = playername; temp.class = "?"; temp.spent = 0; temp.earned = 0; temp.adj = 0; temp.rank = "?"; temp.rankid = 0; table.insert(GRSS_Full_DKP[sys],temp); i = GRSSFindPlayerSystemIndex(playername,sys); end if GRSS_Full_DKP[sys][i] == nil then GRSSPrint("Player '"..playername.."' not found in list '"..sys.."' even after attempting to create. Please report this to DKPSystem.com."); else GRSS_Full_DKP[sys][i][pointtype] = GRSSNumNilZero(GRSS_Full_DKP[sys][i][pointtype]) + GRSSNumNilZero(points); if GRSSCurrentSystem == sys then GRSSChangeSystem(sys); end end end function GRSSPlayerPointCost(playername,sys,pointstr) playername = string.lower(playername); if pointstr==nil then return 0; elseif tonumber(pointstr) then --if the points entered are a number, just return that number return tonumber(pointstr); else --if it's entered as a percentage, fetch the current DKP, and return the corresponding percentage local matches = {string.match(pointstr,"^([%d%.]+)%%$")}; if matches then local percent = GRSSNumNilZero(matches[1])/100; local current = GRSSLookupPlayerDKP(playername,sys); return current * percent; else return 0; end end end function GRSSGetPlayerDKP(players) local dkp = {}; for sys in pairs(GRSS_Systems) do for i,v in pairs(GRSS_Full_DKP[sys]) do for name in string.gmatch(players,"([%S,]+)") do if string.lower(v.name)==string.lower(name) then local total; if GRSS_Divide[sys] == nil then total = GRSSNumNilZero(v.earned) + GRSSNumNilZero(v.adj) - GRSSNumNilZero(v.spent) else total = GRSSNumNilZero(v.earned) / GRSSNumNilOne(v.spent); end --total = GRSSNumNilZero(v.earned) + GRSSNumNilZero(v.adj) - GRSSNumNilZero(v.spent); table.insert(dkp,"("..sys..") "..name.."("..v.class.."): "..total); end end end end return dkp; end function GRSS_CompareVersions() if not GRSSNewVersionPrinted then if GRSSNewestVersion then if GRSSNewestVersion~=GRSSVersion then GRSSNewVersionPrinted = true; GRSSPrint("|c00ff0000There is a newer version of the GuildRaidSnapShot mod ("..GRSSNewestVersion..") available. Please download the newest version from www.dkpsystem.com or run the included GetGRSSDKP.exe program (Windows Only)|r"); end end end end function GuildRaidSnapShot_SlashHandler(msg) local newboss; msglower = string.lower(msg); if msglower=="" or msglower=="help" or msglower=="?" then for i,v in pairs(GRSSUsage) do DEFAULT_CHAT_FRAME:AddMessage(v); end for i,v in pairs(GRSSHelpMsg) do local tellcolor = "|c00ffff00"; local endcolor = "|r"; v = string.gsub(v,"^(.+) = (.+)",tellcolor.."%1"..endcolor.." = %2"); DEFAULT_CHAT_FRAME:AddMessage(v); end elseif msglower=="reset" or msglower=="purge" then GuildRaidSnapShot_SnapShots = {}; GuildRaidSnapShot_Loot = {}; GuildRaidSnapShot_Adj = {}; GRSSPrint(GRSSRed("Snapshots Purged")); elseif msglower == "noauto" then GRSS_Auto = 0; GRSSModePrint("Auto Snapshots",false); elseif msglower == "yesauto" then GRSS_Auto = 1; GRSSModePrint("Auto Snapshots",true); elseif msglower == "yesloot" then GRSS_LootCap = 1; GRSSModePrint("Loot point prompts",true); elseif msglower == "noloot" then GRSS_LootCap = 0; GRSSModePrint("Loot point prompts",false); elseif msglower == "yessnapshotpopup" or msglower == "yessnapshotpopups" or msglower == "yessnapshotpoints" then GRSS_RaidPointsPopup = 1; GRSSModePrint("Raid Snapshot Point Prompts",true); elseif msglower == "nosnapshotpopup" or msglower == "nosnapshotpopups" or msglower == "nosnapshotpoints" then GRSS_RaidPointsPopup = 0; GRSSModePrint("Raid Snapshot Point Prompts",false); elseif msglower == "yeslootcombat" then GRSS_LootPromptInCombat = 1; GRSSModePrint("Loot Prompts In Combat",true); elseif msglower == "nolootcombat" then GRSS_LootPromptInCombat = 0; GRSSModePrint("Loot Prompts In Combat",false); elseif msglower == "yesold" then GRSS_EnableOldBosses(); GRSSModePrint("Old Bosses",true); elseif msglower == "noold" then GRSS_DisableOldBosses(); GRSSModePrint("Old Bosses",false); elseif msglower == "show" then GRSS:Show(); GRSS_CompareVersions(); elseif msglower == "loot" or msglower == "item" then GRSSLoot:Show(); elseif msglower=="adj" or msglower=="adjustment" then GRSSAdjShowHideType() GRSSAdj:Show(); elseif msglower == "invite" or msglower=="waitlist" or msglower=="wait" then GRSSInvite:Show(); elseif msglower == "starttimer" then StaticPopup_Show("GRSS_STARTTIMER"); elseif msglower == "stoptimer" then GRSS_StopTimer(); elseif msglower == "yesscreenshot" then GRSSModePrint("Screenshots with snapshots",true); GRSS_TakeScreenshots = 1 elseif msglower == "noscreenshot" then GRSS_TakeScreenshots = nil GRSSModePrint("Screenshots with snapshots",false); elseif msglower == "yeswipe" then GRSS_AutoWipe = 1; GRSSModePrint("Wipe Detection",true); elseif msglower == "nowipe" then GRSS_AutoWipe = 0; GRSSModePrint("Wipe Detection",false); elseif msglower == "noparty" then GRSS_DoingParty = 0; GRSSModePrint("Party mode",false); elseif msglower == "yesparty" then GRSS_DoingParty = 1; GRSSModePrint("Party mode",true); elseif GetNumGroupMembers() > 0 and (IsInRaid() or GRSS_DoingParty == 1) then GRSS_TakeSnapShot(msg); else GRSSPrint("You're not in a raid"); end end function GRSSOn() return GRSSGreen("On"); end function GRSSOff() return GRSSRed("Off"); end function GRSSModePrint(ModeText,tf) local On; if tf==true then On = GRSSOn(); else On = GRSSOff(); end GRSSPrint(GRSSYellow(ModeText)..": "..On); end function GRSSColor(msg,color) return "|c00"..color..msg.."|r"; end function GRSSRed(msg) return GRSSColor(msg,"ff0000"); end function GRSSGreen(msg) return GRSSColor(msg,"00ff00"); end function GRSSBlue(msg) return GRSSColor(msg,"0000ff"); end function GRSSYellow(msg) return GRSSColor(msg,"ffff00"); end function GRSS_CaptureLoot(msg) if GetNumGroupMembers()>0 then local s, e, player, link = string.find(msg, "([^%s]+) receives loot: (.+)%."); if(player == nil) then s, e, link = string.find(msg, "You receive loot: (.+)%."); if(link ~= nil) then player = UnitName("player"); end end --GRSS_Auto = link; if(link and player) then local s, e, color, item = string.find(link, "|c(%x+)|Hitem[:%d%-]+|h%[(.-)%]|h|r"); if(color and item and GRSS_Colors[color]) then -- Checking to see if the item listed is one we should ignore for i,v in pairs(GRSS_LootIgnore) do if string.find(item,v) then return; end end local lootdate = GRSSRecordItem(GRSSCurrentSystem,player,item,nil); --loot search if GRSS_LootCap == 1 then GRSS_CurrentLootDate = lootdate; lootindex = table.getn(GuildRaidSnapShot_Loot[lootdate]); if GRSS_HighBid==0 or GRSS_Highbid == nil then points = GRSS_GetItemPoints(GuildRaidSnapShot_Loot[lootdate][lootindex].item); else points = GRSS_HighBid; end GRSS_EnqueueItem(lootdate,lootindex,player,link,points); if GRSS_ItemBoxOpen==0 and (not(InCombatLockdown()) or GRSS_LootPromptInCombat==1) then GRSS_NextItemPopup(); end end end end end end function GRSS_TakeSnapShot(name) local SnapShotName = name.." "..date("%Y-%m-%d %H:%M:%S"); GRSS_LastSnapShotName = SnapShotName; if GRSS_LastSnapshot == nil then GRSS_LastSnapshot = 0 end if GuildRaidSnapShot_SnapShots[SnapShotName]==nil and GetTime() > GRSS_LastSnapshot+4 then GRSS_LastSnapshot = GetTime(); GuildRaidSnapShot_SnapShots[SnapShotName] = {}; GuildRaidSnapShot_SnapShots[SnapShotName].RealmName = GetRealmName(); GuildRaidSnapShot_SnapShots[SnapShotName].system = GRSSCurrentSystem; GuildRaidSnapShot_SnapShots[SnapShotName].points = 0; local OnlineRaid,RaidList = GRSS_RaidCommaList(); GuildRaidSnapShot_SnapShots[SnapShotName]["Raid"] = RaidList; local OnlineGuild,GuildList = GRSS_GuildCommaList(); GuildRaidSnapShot_SnapShots[SnapShotName]["Guild"] = GuildList; local OnlineWaitingList,WaitingList = GRSS_WaitCommaList(); GuildRaidSnapShot_SnapShots[SnapShotName]["WaitList"] = WaitingList; GRSSPrint("SnapShot Taken: "..SnapShotName.." (Guild: "..OnlineGuild.." | Raid: "..OnlineRaid.." | Waiting List: "..OnlineWaitingList..")"); if GRSS_TakeScreenshots==1 then Screenshot(); end GRSS_LastSnapShotPoints = GRSS_BossPoints(name,GRSSCurrentSystem); if(GRSS_RaidPointsPopup==1) then StaticPopup_Show("GRSS_RAIDPOINTS",name); end end end function GRSS_BossPoints(bossname,sys) if GRSS_Dests then for i,b in pairs(GRSS_Dests) do if string.lower(b.boss)==string.lower(bossname) then return b.points; end end end return ""; end function GRSS_PlayerRank(player) end function GRSS_BossRatio(bossname,sys,player) local rank = GRSS_PlayerRank(player); for i,b in pairs(GRSS_Dests) do if string.lower(b.boss)==string.lower(bossname) then if b.ratios[sys] then if b.ratios[sys][rank] then return b.ratios[sys][rank]; end end end end return 1; end function GRSS_TakeGuildOnly() local members="", level,class,online,rank,notes; GRSS_Guild = {}; local n = GetNumGuildMembers(); local NumOnline = 0; for i = 1, n do MemName,rank,_,level,class,_,notes,_,_,online = GetGuildRosterInfo(i); if notes == nil then notes = ""; end GRSS_Guild[MemName] = level .. ";" .. class..";"..rank..";;;"..notes; end end function GRSS_TakeGuildNotes() local members="", notes,num; num =0; GuildRoster(); GRSS_Guild = {}; local n = GetNumGuildMembers(true); local NumOnline = 0; GuildRaidSnapShot_Notes = {}; for i = 1, n do MemName,_,_,_,_,_,notes = GetGuildRosterInfo(i); if notes ~= "" then num = num + 1; GuildRaidSnapShot_Notes[MemName] = notes; end end GRSSPrint("Guild notes Snapshot Taken: "..num.." Guild Notes Captured"); end function GRSS_RaidCommaList() local members=""; local NumOnline=0; local zone=""; local con; local n = GetNumGroupMembers(); if GetNumGroupMembers()>1 then for i = 1, n do MemName,_,_,_,_,_,zone,Online = GetRaidRosterInfo(i); if Online then if zone==nil then zone = "" end else zone = "Offline"; end members = members..MemName..":"..zone; if i ~= n then members = members .. ", " end NumOnline=NumOnline+1; end if GRSS_TakeScreenshots==1 then if InCombatLockdown() then GRSSPrint("You're currently in combat, so I can't open the raid window for this snapshot"); else ToggleFriendsFrame(1); ToggleFriendsFrame(4); end end end return NumOnline,members end function GRSS_GuildCommaList() local members=""; local online; local zone=""; GuildRoster(); local n,_ = GetNumGuildMembers(); local NumOnline = 0; for i = 1, n do MemName,_,_,_,_,zone,_,_,online = GetGuildRosterInfo(i); if zone==nil then zone = "" end if online then MemName = GRSS_FixName(MemName); members = members..MemName .. ":" .. zone; if i ~= n then members = members .. ", " end NumOnline = NumOnline + 1; end end return NumOnline,members; end function GRSS_FixName(Name) local name = ""; for i in string.gmatch(Name, "[^-]*") do return i; end end function GRSS_WaitCommaList() local num = table.getn(GRSS_WaitingList); local waitlist = ""; for i = 1, num do waitlist = waitlist..GRSS_WaitingList[i] if i<num then waitlist = waitlist..", "; end end return num,waitlist; end function GRSS_RaidTable() local members={}; local NumOnline=0; local con; local n = GetNumGroupMembers(); if GetNumGroupMembers()>1 then for i = 1, n do MemName,_,_,_,_,_,_,Online = GetRaidRosterInfo(i); if Online==1 then members[string.upper(MemName)]=1; end end end return members; end function GRSS_GuildTable() local members={}; local online; GuildRoster(); local n = GetNumGuildMembers(false); local NumOnline = 0; for i = 1, n do MemName,_,_,_,_,_,_,_,online = GetGuildRosterInfo(i); if online==1 then members[string.upper(MemName)]=1; end end return members; end function GRSSSystemDropDown_OnLoad(this) GRSS_Initialize_Data(); GRSSChangeSystem(GRSSCurrentSystem); UIDropDownMenu_Initialize(this, GRSSSystemDropDown_Initialize); if GRSS_Systems[GRSSCurrentSystem]~=nil then UIDropDownMenu_SetText(GRSSSystemDropDown,GRSSCurrentSystem); else UIDropDownMenu_SetText(GRSSSystemDropDown,"Select System"); end UIDropDownMenu_SetWidth(GRSSSystemDropDown,130); end function GRSSLootSystemDropDown_OnLoad(this) --GRSS_Initialize_Data(); UIDropDownMenu_Initialize(this, GRSSLootSystemDropDown_Initialize); if GRSS_Systems[GRSSCurrentSystem]~=nil then UIDropDownMenu_SetText(GRSSLootSystemDropDown,GRSSCurrentSystem); else UIDropDownMenu_SetText(GRSSLootSystemDropDown,"Select System"); end UIDropDownMenu_SetWidth(GRSSLootSystemDropDown,130); end function GRSSAdjSystemDropDown_OnLoad(this) --GRSS_Initialize_Data(); UIDropDownMenu_Initialize(this, GRSSAdjSystemDropDown_Initialize); if GRSS_Systems[GRSSCurrentSystem]~=nil then UIDropDownMenu_SetText(GRSSAdjSystemDropDown,GRSSCurrentSystem); else UIDropDownMenu_SetText(GRSSAdjSystemDropDown,"Select System"); end UIDropDownMenu_SetWidth(GRSSAdjSystemDropDown,130); end function GRSSActionDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSActionDropDown_Initialize); UIDropDownMenu_SetText(GRSSActionDropDown,"DKP Standings"); UIDropDownMenu_SetWidth(GRSSActionDropDown,110); end function GRSSBidStyleDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSBidStyleDropDown_Initialize); if GRSS_BidStyle == "" then UIDropDownMenu_SetText(GRSSBidStyleDropDown,"Bidding Style"); else UIDropDownMenu_SetText(GRSSBidStyleDropDown,GRSS_BidStyle); end UIDropDownMenu_SetWidth(GRSSBidStyleDropDown,110); end function GRSSBidStyleDropDown_Initialize() local Actions = {"Silent Auction","Silent Non-Auction","Open Auction","Requests"}; local info = {}; info.notCheckable = nil; info.keepShownOnClick = nil; info.func = GRSS_ChangeBidStyle; for i,v in pairs(Actions) do info.text = v; info.value = v; UIDropDownMenu_AddButton(info); end end function GRSS_ChangeBidStyle(this) UIDropDownMenu_SetText(GRSSBidStyleDropDown,this.value); GRSS_BidStyle = this.value; end function GRSSSpamDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSSpamDropDown_Initialize); UIDropDownMenu_SetText(GRSSSpamDropDown,"Spam Chat"); UIDropDownMenu_SetWidth(GRSSSpamDropDown,110); end function GRSSAdjTypeDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSAdjTypeDropDown_Initialize); UIDropDownMenu_SetText(GRSSAdjTypeDropDown,"EP(Earned)"); UIDropDownMenu_SetWidth(GRSSAdjTypeDropDown,90); end function GRSSSpamDropDown_Initialize() local Actions = {"RAID","PARTY","GUILD","SAY","OFFICER"}; local info = {}; info.notCheckable = nil; info.keepShownOnClick = nil; info.func = GRSS_ChangeSpam; for i,v in pairs(Actions) do info.text = v; info.value = v; UIDropDownMenu_AddButton(info); end end function GRSSAdjTypeDropDown_Initialize() local Actions = {"EP(Earned)","GP(Spent)"}; local info = {}; info.notCheckable = nil; info.keepShownOnClick = nil; info.func = GRSS_SetAdjType; for i,v in pairs(Actions) do info.text = v; info.value = v; UIDropDownMenu_AddButton(info); end end function GRSS_GetAdjType() local adjtype = UIDropDownMenu_GetText(GRSSAdjTypeDropDown); if string.find(adjtype,"EP") then adjtype = "earned"; elseif string.find(adjtype,"GP") then adjtype = "spent"; else adjtype = "adj"; end return adjtype; end function GRSS_SetAdjType(this) UIDropDownMenu_SetText(GRSSAdjTypeDropDown,this.value); local s,e,adjtype = string.find(this.value,"^(%w+)%("); end function GRSS_ChangeSpam(this) local place = this.value; SendChatMessage("The following are for the DKP System: "..GRSSCurrentSystem,place); if table.getn(GRSS_DKP) > 40 then SendChatMessage("Only showing the top 40",place); end local count=0; for i,v in pairs(GRSS_DKP) do if count < 40 then GRSS_SendWhisper(v.name..": "..v.total,place); count = count + 1; end end end function GRSSRaidFilterDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSRaidFilterDropDown_Initialize); if GRSS_Spam == "" then UIDropDownMenu_SetText(GRSSRaidFilterDropDown,"All"); else UIDropDownMenu_SetText(GRSSRaidFilterDropDown,GRSS_RaidFilter); end UIDropDownMenu_SetWidth(GRSSRaidFilterDropDown,90); end function GRSSRaidFilterDropDown_Initialize() local Actions = {"All","Raid Only"}; local info = {}; info.notCheckable = nil; info.keepShownOnClick = nil; info.func = GRSS_ChangeRaidFilter; for i,v in pairs(Actions) do info.text = v; info.value = v; UIDropDownMenu_AddButton(info); end end function GRSS_ChangeRaidFilter(this) UIDropDownMenu_SetText(GRSSRaidFilterDropDown,this.value); GRSS_RaidFilter = this.value; GRSSChangeSystem(GRSSCurrentSystem); end function GRSSClassFilterDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSClassFilterDropDown_Initialize); if GRSS_BidStyle == "" then UIDropDownMenu_SetText(GRSSClassFilterDropDown,"All"); else UIDropDownMenu_SetText(GRSSClassFilterDropDown,GRSS_ClassFilter); end UIDropDownMenu_SetWidth(GRSSClassFilterDropDown,90); end function GRSSClassFilterDropDown_Initialize() local Actions = {"All","Druid","Hunter","Mage","Monk","Paladin","Priest","Rogue","Shaman","Warlock","Warrior","Death Knight"}; local info = {}; info.notCheckable = nil; info.keepShownOnClick = nil; info.func = GRSS_ChangeClassFilter; for i,v in pairs(Actions) do info.text = v; info.value = v; UIDropDownMenu_AddButton(info); end end function GRSS_ChangeClassFilter(this) UIDropDownMenu_SetText(GRSSClassFilterDropDown,this.value); GRSS_ClassFilter = this.value; GRSSChangeSystem(GRSSCurrentSystem); end function GRSSRollNumberDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSRollNumberDropDown_Initialize); UIDropDownMenu_SetText(GRSSRollNumberDropDown,"1-"..GRSSNumNilZero(GRSS_RollNumber)); UIDropDownMenu_SetWidth(GRSSRollNumberDropDown,110); end function GRSSRollNumberDropDown_Initialize() local Actions = {"1-100","1-1000","1-1337"}; local info = {}; info.notCheckable = nil; info.keepShownOnClick = nil; info.func = GRSS_ChangeRollNumber; for i,v in pairs(Actions) do info.text = v; info.value = v; UIDropDownMenu_AddButton(info); end end function GRSS_ChangeRollNumber(this) UIDropDownMenu_SetText(GRSSRollNumberDropDown,this.value); local s,e,num = string.find(this.value,"1%-(%d+)") GRSS_RollNumber = num; end function GRSSSystemDropDown_OnClick(this) GRSSCurrentSystem = this.value; UIDropDownMenu_SetText(GRSSSystemDropDown,this.value); this.isChecked=true; GRSSChangeSystem(GRSSCurrentSystem); end function GRSSLootSystemDropDown_OnClick(this) GRSSLootCurrentSystem = this.value; UIDropDownMenu_SetText(GRSSLootSystemDropDown,this.value); this.isChecked=true; end function GRSSAdjSystemDropDown_OnClick(this) UIDropDownMenu_SetText(GRSSAdjSystemDropDown,this.value); GRSSAdjShowHideType() this.isChecked=true; end function GRSSAdjShowHideType() local system = UIDropDownMenu_GetText(GRSSAdjSystemDropDown); if GRSS_Divide[system] then GRSSAdjTypeDropDown:Show(); else GRSSAdjTypeDropDown:Hide(); end end function GRSS_DeleteBid(line) lineplusoffset = line + FauxScrollFrame_GetOffset(GRSSBidsScrollBar); amount = GRSS_Bids[lineplusoffset].bid; name = GRSS_Bids[lineplusoffset].name; table.remove(GRSS_Bids,lineplusoffset); playerhigh = 0; totalhigh = 0; highbidder = ""; for i,v in pairs(GRSS_Bids) do if string.lower(v.name)==string.lower(name) then if tonumber(v.bid)~=nil and tonumber(v.bid) > playerhigh then playerhigh = tonumber(v.bid); end end if tonumber(v.bid)~=nil and tonumber(v.bid) > totalhigh then totalhigh = tonumber(v.bid); highbidder = v.name; end end if GRSS_HighBid ~= totalhigh and GRSS_Bidding==1 then GRSS_HighBid = totalhigh; GRSS_HighBidder = highbidder; if GRSS_BidStyle=="Silent Auction" then SendChatMessage("The high bid has been changed to "..GRSS_HighBid,"RAID"); elseif GRSS_BidStyle=="Open Auction" then SendChatMessage(highbidder.." is now the high bidder with "..totalhigh,"RAID"); end end for i,v in pairs(GRSS_DKP) do if string.lower(v.name)==string.lower(name) then GRSS_DKP[i].bid = playerhigh; end end GRSSBidsScrollBar_Update(); GRSSScrollBar_Update(); end function GRSSActionDropDown_Initialize() local Actions = {"DKP Standings","Rolls","Bids","Bid+Roll","DKP+Roll"}; local info = {}; info.notCheckable = nil; info.keepShownOnClick = nil; info.func = GRSS_DoAction; for i,v in pairs(Actions) do info.text = v; info.value = v; UIDropDownMenu_AddButton(info); end end function GRSSSetHeaders(earned,spent,adj,total) GRSSHeaderEarnedText:SetText(earned); GRSSHeaderSpentText:SetText(spent); GRSSHeaderAdjText:SetText(adj); GRSSHeaderDKPText:SetText(total); end function GRSSShowHeaders(t) if t=="DKP Standings" then GRSSSetHeaders("Earned","Spent","Adj","Total"); elseif t=="Bids" then GRSSSetHeaders("","Bid","","DKP"); elseif t=="Rolls" then GRSSSetHeaders("","Roll","","DKP"); elseif t=="Bid+Roll" then GRSSSetHeaders("Roll","Bid","Bid+Roll","DKP"); elseif t=="DKP+Roll" then GRSSSetHeaders("Roll","","DKP+Roll","DKP"); end end function GRSS_ActionShow(...) local hide = {"GRSSBids","GRSSToggleBids","GRSSClearBids","GRSSBidStyleDropDown","GRSSToggleRolls","GRSSClearRolls","GRSSRollNumberDropDown","GRSSRaidFilterDropDown","GRSSClassFilterDropDown","GRSSSpamDropDown","GRSSLootDropDown","GRSSItemName"}; for i,v in pairs(hide) do getglobal(v):Hide(); end for i,v in pairs({...}) do getglobal(v):Show(); end end function GRSS_ToggleRolls() local itemname = GRSSItemName:GetText() if GRSS_Rolling == 1 then GRSSToggleRolls:SetText("Start Rolls"); GRSSRollNumberDropDown:Show(); GRSS_Rolling = 0; GRSS_EnableFunctionalButtons(1); SendChatMessage("Rolling Ended on "..itemname..". No more rolls will be recorded", "RAID"); SendChatMessage("Rolling Ended on "..itemname..". No more rolls will be recorded", "RAID_WARNING"); else GRSSToggleRolls:SetText("Stop Rolls"); GRSSRollNumberDropDown:Hide(); GRSS_Rolling = 1; GRSS_EnableFunctionalButtons(0); SendChatMessage("Rolling Started on "..itemname..". If you are interested /random "..GRSS_RollNumber..". Rolls with anything but "..GRSS_RollNumber.." will be ignored.", "RAID"); SendChatMessage("Rolling Started on "..itemname..". If you are interested /random "..GRSS_RollNumber..".", "RAID_WARNING"); end end function GRSS_EnableFunctionalButtons(tf) if tf == 1 then GRSSClearBids:Enable(); GRSSClearRolls:Enable(); GRSSSystemDropDown:Show(); GRSSActionDropDown:Show(); GRSSItemName:Show(); GRSSLootDropDown:Show(); else GRSSClearBids:Disable(); GRSSClearRolls:Disable(); GRSSBidStyleDropDown:Hide(); GRSSSystemDropDown:Hide(); GRSSActionDropDown:Hide(); GRSSItemName:Hide(); GRSSLootDropDown:Hide(); end end function GRSS_ToggleBids() local player = UnitName("player"); local itemname = GRSSItemName:GetText() if GRSS_Bidding == 1 then GRSSToggleBids:SetText("Start Bids"); GRSS_Bidding = nil; GRSS_BidRolls = nil; GRSS_EnableFunctionalButtons(1); if GRSSCurrentAction == "Bid+Roll" then GRSSRollNumberDropDown:Show(); else GRSSBidStyleDropDown:Show(); end msg = "Bidding Ended for "..itemname..". No more bids will be recorded" else GRSSToggleBids:SetText("Stop Bids"); GRSS_Bidding = 1; GRSS_EnableFunctionalButtons(0); GRSS_HighBid = 0; if GRSSCurrentAction == "Bid+Roll" then GRSS_BidRolls = 1; msg = "Bidding and Rolling started for "..itemname.."! Type /random "..GRSS_RollNumber.." to register your roll. Then to bid: '/w "..player.." !bid X' where X is the amount to bid."; GRSSRollNumberDropDown:Hide(); else if GRSS_BidStyle=="Requests" then msg = "Taking requests for "..itemname..". To request item: /w "..player.." !req"; else msg = "Bidding Started for "..itemname.."! To bid: '/w "..player.." !bid X' where X is the amount you wish to bid"; end GRSSBidStyleDropDown:Hide(); end end SendChatMessage(msg, "RAID"); SendChatMessage(msg, "RAID_WARNING"); end function GRSS_ClearBids() GRSS_Bids = {}; for i,v in pairs(GRSS_DKP) do GRSS_DKP[i].bid = "" GRSS_DKP[i].roll = "" end GRSSBidsScrollBar_Update(); GRSSScrollBar_Update(); end function GRSS_ClearRolls() GRSS_ClearBids(); end function GRSS_DoAction(this) GRSSCurrentAction = this.value; UIDropDownMenu_SetText(GRSSActionDropDown,this.value); if this.value == "DKP Standings" then GRSS_ActionShow("GRSSRaidFilterDropDown","GRSSClassFilterDropDown","GRSSSpamDropDown"); elseif this.value == "Rolls" then GRSS_ActionShow("GRSSToggleRolls","GRSSClearRolls","GRSSRollNumberDropDown","GRSSItemName","GRSSLootDropDown"); elseif this.value == "DKP+Roll" then GRSS_ActionShow("GRSSToggleRolls","GRSSClearRolls","GRSSRollNumberDropDown","GRSSItemName","GRSSLootDropDown"); elseif this.value == "Bids" or this.value=="Requests" then GRSS_ActionShow("GRSSBids","GRSSToggleBids","GRSSClearBids","GRSSBidStyleDropDown","GRSSItemName","GRSSLootDropDown"); elseif this.value == "Bid+Roll" then GRSS_ActionShow("GRSSBids","GRSSToggleBids","GRSSClearBids","GRSSRollNumberDropDown","GRSSItemName","GRSSLootDropDown"); end GRSSShowHeaders(this.value); --[[ if this.value == "DKP Standings" then DKP = true; elseif this.value == "Rolls" or this.value == "DKP+Roll" then Rolls = true; elseif this.value == "Bids" or this.value == "Bid+Roll" then Bids = true; end if Rolls or Bids then GRSSItemName:Show(); else GRSSItemName:Hide(); end GRSSShowHeaders(this.value); GRSSShowDKP(DKP); GRSSShowRolls(Rolls); GRSSShowBids(Bids); if this.value=="Bid+Roll" then GRSSRollNumberDropDown:Show(); GRSSBidStyleDropDown:Hide(); end --]] GRSSScrollBar_Update(); end function GRSSSystemDropDown_Initialize() local info = {}; if (not GRSS_Systems) then GRSS_Systems = {}; end; for index, sys in pairs(GRSS_Systems) do info.text = sys; info.value = sys; info.func = GRSSSystemDropDown_OnClick; info.notCheckable = nil; info.keepShownOnClick = nil; UIDropDownMenu_AddButton(info); end end function GRSSLootSystemDropDown_Initialize() local info = {}; if (not GRSS_Systems) then GRSS_Systems = {}; end; for index, sys in pairs(GRSS_Systems) do info.text = sys; info.value = sys; info.func = GRSSLootSystemDropDown_OnClick; info.notCheckable = nil; info.keepShownOnClick = nil; UIDropDownMenu_AddButton(info); end end function GRSSAdjSystemDropDown_Initialize() local info = {}; if (not GRSS_Systems) then GRSS_Systems = {}; end; for index, sys in pairs(GRSS_Systems) do info.text = sys; info.value = sys; info.func = GRSSAdjSystemDropDown_OnClick; info.notCheckable = nil; info.keepShownOnClick = nil; UIDropDownMenu_AddButton(info); end end function GRSSLootDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSLootDropDown_Initialize); end function GRSSLootDropDown_Initialize() local info = {}; if (not GRSS_Loot) then GRSS_Loot = {}; end; for link in pairs(GRSS_Loot) do info.text = link; info.value = link; info.func = GRSSLootDropDownSelect; info.notCheckable = nil; info.keepShownOnClick = nil; UIDropDownMenu_AddButton(info); end end function GRSSLootDropDown_OnClick() ToggleDropDownMenu(1, nil, GRSSLootDropDown, "GRSSItemName", 0, 0); end function GRSSLootDropDownSelect(this) GRSSItemName:SetText(this.value); end function GRSS_GetLoot() GRSS_Loot = {}; for i = 1, GetNumLootItems() do if LootSlotHasItem(i) then local link = GetLootSlotLink(i); if link ~= nil then local s, e, color, item = string.find(link, "|c(%x+)|Hitem[:%d%-]+|h%[(.-)%]|h|r"); if(color and item and GRSS_Colors[color]) then GRSS_Loot[link]=link; end end end end UIDropDownMenu_Initialize(GRSSLootDropDown, GRSSLootDropDown_Initialize); end -- Begin the Waiting List/Invite Code function GRSSInviteDropDown_OnLoad(this) UIDropDownMenu_Initialize(this, GRSSInviteDropDown_Initialize); UIDropDownMenu_SetText(GRSSInviteDropDown,"Waiting List"); UIDropDownMenu_SetWidth(GRSSInviteDropDown,110); end function GRSSInviteDropDown_Initialize() local Actions = {"Waiting List","Signup Invites"}; local info = {}; info.notCheckable = nil; info.keepShownOnClick = nil; info.func = GRSS_ChangeInvite; for i,v in pairs(Actions) do info.text = v; info.value = v; UIDropDownMenu_AddButton(info); end end function GRSS_ChangeInvite(this) UIDropDownMenu_SetText(GRSSInviteDropDown,this.value); GRSS_InviteType = this.value; if GRSS_InviteType == "Waiting List" then GRSSInviteWaitingList:Show(); else GRSSInviteWaitingList:Hide(); end GRSSInviteScrollBar_Update(); end function GRSSInviteScrollBar_Update() local line; -- 1 through 10 of our window to scroll local lineplusoffset; -- an index into our data calculated from the scroll offset if GRSS_InviteType == "Waiting List" then FauxScrollFrame_Update(GRSSInviteScrollBar,table.getn(GRSS_WaitingList),10,16); for line=1,10 do lineplusoffset = line + FauxScrollFrame_GetOffset(GRSSInviteScrollBar); if lineplusoffset <= table.getn(GRSS_WaitingList) then getglobal("GRSSInviteRow"..line.."FieldItem"):SetText(GRSS_WaitingList[lineplusoffset]); getglobal("GRSSInviteRow"..line.."FieldItem"):Show(); getglobal("GRSSInviteRow"..line.."Invite"):Show(); getglobal("GRSSInviteRow"..line.."FieldHighlight"):Show(); getglobal("GRSSInviteRow"..line.."Delete"):Show(); else getglobal("GRSSInviteRow"..line.."FieldItem"):Hide(); getglobal("GRSSInviteRow"..line.."FieldHighlight"):Hide(); getglobal("GRSSInviteRow"..line.."Invite"):Hide(); getglobal("GRSSInviteRow"..line.."Delete"):Hide(); end end else FauxScrollFrame_Update(GRSSInviteScrollBar,table.getn(GRSS_RaidSignups),10,16); for line=1,10 do lineplusoffset = line + FauxScrollFrame_GetOffset(GRSSInviteScrollBar); if lineplusoffset <= table.getn(GRSS_RaidSignups) then getglobal("GRSSInviteRow"..line.."FieldItem"):SetText(GRSS_RaidSignups[lineplusoffset].name); getglobal("GRSSInviteRow"..line.."FieldItem"):Show(); getglobal("GRSSInviteRow"..line.."Invite"):Show(); getglobal("GRSSInviteRow"..line.."FieldHighlight"):Show(); getglobal("GRSSInviteRow"..line.."Delete"):Hide(); else getglobal("GRSSInviteRow"..line.."FieldItem"):Hide(); getglobal("GRSSInviteRow"..line.."FieldHighlight"):Hide(); getglobal("GRSSInviteRow"..line.."Invite"):Hide(); getglobal("GRSSInviteRow"..line.."Delete"):Hide(); end end end end function GRSS_InviteLine(n) if GRSS_InviteType == "Waiting List" then local lineplusoffset = n + FauxScrollFrame_GetOffset(GRSSInviteScrollBar); local name = GRSS_WaitingList[lineplusoffset]; InviteUnit(name); else local RaidTable = GRSS_RaidTable(); local lineplusoffset = n + FauxScrollFrame_GetOffset(GRSSInviteScrollBar); for i,v in pairs(GRSS_RaidSignups[lineplusoffset].waiting) do GRSS_AddNameToWaitingList(v); end for i,v in pairs(GRSS_RaidSignups[lineplusoffset].pending) do GRSS_AddNameToWaitingList(v); end for i,v in pairs(GRSS_RaidSignups[lineplusoffset].approved) do InviteUnit(v); end end end function GRSS_DeleteInviteLine(n) if GRSS_InviteType == "Waiting List" then local lineplusoffset = n + FauxScrollFrame_GetOffset(GRSSInviteScrollBar); local name = GRSS_WaitingList[lineplusoffset]; GRSS_RemoveFromWaitingList(name); end end function GRSS_RaidChange(arg1,arg2) local i=1; local RaidTable = GRSS_RaidTable(); while i <= table.getn(GRSS_WaitingList) do if RaidTable[string.upper(GRSS_WaitingList[i])]==1 then table.remove(GRSS_WaitingList,i) else i = i + 1 end end GRSSInviteScrollBar_Update(); end function GRSS_RemoveFromWaitingList(name) local i = 1; while i <= table.getn(GRSS_WaitingList) do v = GRSS_WaitingList[i]; if string.upper(v)==string.upper(name) then table.remove(GRSS_WaitingList,i); else i = i + 1 end end GRSSInviteScrollBar_Update(); end function GRSS_IsNameOnWaitingList(name) for i,v in pairs(GRSS_WaitingList) do if string.upper(name)==string.upper(v) then return true; end end return false; end function GRSS_AddToWaitingList() StaticPopup_Show("GRSS_WAITINGLIST"); end function GRSS_AddNameToWaitingList(name) for n in string.gmatch(name,"([^;,%s]+)") do if not GRSS_IsNameOnWaitingList(n) then table.insert(GRSS_WaitingList,n); end end GRSSInviteScrollBar_Update(); end function GRSS_IsNameQueuedOnWaitList(name) for i,v in pairs(GRSS_WaitListRequest) do if string.upper(name)==string.upper(v) then return true; end end return false; end function GRSS_QueueWaitListRequest(name) table.insert(GRSS_WaitListRequest,1,name); end function GRSS_NextWaitListRequest() local n = table.getn(GRSS_WaitListRequest); if n > 0 then local name = GRSS_WaitListRequest[n]; StaticPopup_Show("GRSS_AUTOWAITLIST",name); end end function GRSSPrint(msg) DEFAULT_CHAT_FRAME:AddMessage("GRSS: "..msg); end
--[[ Copyright © 2020, Dean James (Xurion of Bismarck) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of Empy Pop Tracker 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 Dean James (Xurion of Bismarck) 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. ]] return { name = 'Kukulkan', collectable = 2932, --Kukulkan's Fang collectable_target_count = 50, pops = { { id = 1466, --Mucid Ahriman Eyeball type = 'key item', dropped_from = { name = 'Arimaspi, Forced (K-6)', pops = { { id = 2913, --Clouded Lens type = 'item', dropped_from = { name = 'Deep Eye (K-6/K-7)' } } } } }, { id = 1464, --Tattered Hippogryph Wing type = 'key item', dropped_from = { name = 'Alkonost, Forced (H-6)', pops = { { id = 2912, --Giant Bugard Tusk type = 'item', dropped_from = { name = 'Ypotryll (I-7)' } } } } }, { id = 1465, --Cracked Wivre Horn type = 'key item', dropped_from = { name = 'Keratyrannos, Forced (G-6)', pops = { { id = 2910, --Armored Dragonhorn type = 'item', dropped_from = { name = 'Mesa Wivre (G-6)' } } } } } } }
local utils = require 'utils' local Floorspaces = {} Floorspaces.__index = Floorspaces function Floorspaces:init() self.primary = false self.active = false self.objects = {} end function Floorspaces:setPrimary( fs ) assert( not self.primary, "You can only have one primary floorspace!" ) fs.isPrimary = true self.primary = fs fs.isActive = true self.active = fs end function Floorspaces:getPrimary() return self.primary or false end function Floorspaces:setActive( fs ) if self.active then self.active.isActive = false end fs.isActive = true self.active = fs end function Floorspaces:getActive() return self.active or false end function Floorspaces:addObject( fs ) if not utils.contains( self.objects, fs ) then table.insert( self.objects, fs ) end end return Floorspaces
return { hand_right = { { {-12, 37}, {-12, 31}, {-7, 35}, {-5, 35}, {-12, 37}, {-16, 29}, {-13, 19}, {-15, 23}, {-16, 39}, }, { {-10, 36}, {5, 36}, {0, 35}, {-4, 34}, {-11, 36}, {-7, 36}, {-14, 19}, {-10, 36}, {-11, 37}, }, { {-11, 37}, {-16, 25}, {-10, 33}, {-10, 35}, {-11, 45}, {-12, 23}, {-18, 41}, {-11, 36}, {-15, 20}, }, { {10, 37}, {8, 36}, {9, 35}, {0, 0}, {-4, 45}, {-17, 37}, {18, 45}, {-10, 36}, {-15, 22}, }, { {-13, 37}, {-12, 38}, {-13, 42}, {0, 46}, {4, 35}, {-2, 34}, {-7, 34}, {-1, 37}, {-8, 46}, }, { {-3, 36}, {-3, 36}, {-6, 41}, {-6, 45}, {-11, 24}, {-12, 22}, {-13, 26}, {-8, 39}, {-17, 30}, }, { {-16, 29}, {11, 37}, {11, 34}, {11, 36}, {-15, 21}, {5, 28}, {-11, 29}, {-16, 27}, {0, 0}, }, { {-13, 46}, {-13, 28}, {-12, 27}, {-12, 28}, {-16, 28}, {-16, 28}, {-15, 28}, {-17, 29}, {0, 0}, }, { {4, 36}, {-1, 35}, {-6, 34}, {3, 36}, {-2, 34}, {-6, 34}, {-7, 16}, {-2, 22}, {-3, 35}, }, { {-14, 23}, {-13, 21}, {-14, 22}, {-13, 38}, {-14, 35}, {-14, 36}, {-11, 18}, {-14, 22}, {-13, 36}, }, { {-8, 14}, {-7, 16}, {-2, 20}, {-2, 22}, {-3, 33}, {-3, 35}, {-7, 13}, {-2, 18}, {-2, 31}, }, { {-12, 16}, {-10, 19}, {-14, 20}, {-14, 22}, {-13, 33}, {-13, 35}, {-12, 14}, {-15, 18}, {-14, 31}, }, { {-13, 32}, {-14, 33}, {10, 36}, {10, 35}, {10, 36}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, }, { {-15, 17}, {-15, 36}, {-14, 35}, {-14, 33}, {-14, 34}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, }, }, hand_left = { { {8, 37}, {-10, 37}, {-1, 36}, {1, 35}, {8, 37}, {6, 37}, {13, 20}, {8, 37}, {10, 38}, }, { {10, 37}, {7, 31}, {5, 35}, {2, 36}, {10, 37}, {16, 31}, {12, 20}, {14, 24}, {14, 38}, }, { {9, 37}, {15, 27}, {8, 36}, {9, 34}, {3, 46}, {15, 38}, {-19, 46}, {9, 37}, {14, 23}, }, { {-11, 37}, {-10, 36}, {-10, 37}, {0, 0}, {9, 46}, {11, 24}, {16, 41}, {11, 37}, {14, 22}, }, { {2, 37}, {3, 37}, {5, 42}, {5, 46}, {11, 26}, {11, 24}, {12, 28}, {8, 40}, {16, 30}, }, { {11, 37}, {11, 37}, {11, 42}, {-1, 47}, {-5, 37}, {1, 36}, {6, 35}, {0, 38}, {7, 46}, }, { {12, 46}, {11, 30}, {11, 28}, {11, 29}, {14, 31}, {13, 31}, {13, 31}, {15, 31}, {0, 0}, }, { {15, 29}, {-12, 38}, {-12, 36}, {-11, 37}, {15, 22}, {-7, 28}, {8, 29}, {14, 27}, {0, 0}, }, { {12, 24}, {12, 22}, {12, 23}, {12, 39}, {12, 36}, {12, 37}, {10, 20}, {12, 23}, {10, 36}, }, { {-5, 37}, {1, 36}, {5, 35}, {-4, 37}, {1, 36}, {5, 35}, {7, 19}, {1, 23}, {2, 36}, }, { {10, 18}, {10, 20}, {12, 21}, {12, 23}, {11, 34}, {11, 36}, {10, 16}, {12, 19}, {12, 32}, }, { {6, 17}, {7, 19}, {1, 21}, {1, 23}, {2, 34}, {2, 36}, {6, 15}, {1, 19}, {1, 32}, }, { {13, 18}, {14, 36}, {13, 35}, {13, 34}, {13, 35}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, }, { {11, 33}, {12, 34}, {-11, 38}, {-11, 36}, {-11, 37}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, }, }, }
--[[ Turbo Unit test Copyright 2013 John Abrahamsen Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ]] local turbo = require "turbo" require "turbo.3rdparty.middleclass" describe("turbo.httputil Namespace", function() describe("HTTPParser Class", function() local raw_headers = "GET /test/test.gif?param1=something&param2=somethingelse&param2=somethingelseelse HTTP/1.1\r\n".. "Host: somehost.no\r\n".. "Connection: keep-alive\r\n".. "Cache-Control: max-age=0\r\n".. "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11\r\n".. "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n".. "Accept-Encoding: gzip,deflate,sdch\r\n".. "Accept-Language: en-US,en;q=0.8\r\n".. "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\n\r\n" local badheaders = "BAD! /test/test.gif?param1=something&param2=somethingelse&param2=somethingelseelse HTTP/1.1\r\n".. "Host: somehost.no\r\n".. "Connection: keep-alive\r\n".. "Cache-Control: max-age=0\r\n".. "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11\r\n".. "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n".. "Accept-Encoding: gzip,deflate,sdch\r\n".. "Accept-Language: en-US,en;q=0.8\r\n".. "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\n\r\n" local badheaders2 = "BAD! /test/test.gif?param1=something&param2=somethingelse&param2=somethingelseelse HTTP/1.1\r\n".. "Host: somehost.no\r\n".. "Connection: keep-alive\0 Attr:Here\0Scraps\r\n".. "Cache-Control: max-age=0\r\n".. "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11\r\n".. "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n".. "Accept-Encoding: gzip,deflate,sdch\r\n".. "Accept-Language: en-US,en;q=0.8\r\n".. "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\n\r\n" it("should parse valid headers correctly", function() local headers = turbo.httputil.HTTPParser( raw_headers, turbo.httputil.hdr_t["HTTP_REQUEST"]) assert.truthy(instanceOf(turbo.httputil.HTTPParser, headers)) end) it("should throw on bad headers", function() assert.has_error(function() local header = turbo.httputil.HTTPParser( badheaders, turbo.httputil.hdr_t["HTTP_REQUEST"]) end) assert.has_error(function() local header = turbo.httputil.HTTPParser( badheaders2, turbo.httputil.hdr_t["HTTP_REQUEST"]) end) end) it("should parse request header correctly", function() local headers = turbo.httputil.HTTPParser( raw_headers, turbo.httputil.hdr_t["HTTP_REQUEST"]) assert.equal(headers:get("Host"), "somehost.no") assert.equal(headers:get("Connection"), "keep-alive") assert.equal(headers:get("Cache-Control"), "max-age=0") assert.equal(headers:get("User-Agent"), "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11") assert.equal(headers:get("Accept"), "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") assert.equal(headers:get("Accept-Encoding"), "gzip,deflate,sdch") assert.equal(headers:get("Accept-Language"), "en-US,en;q=0.8") assert.equal(headers:get("Accept-Charset"), "ISO-8859-1,utf-8;q=0.7,*;q=0.3") assert.equal(headers:get_method(), "GET") assert.equal(headers:get_url(), "/test/test.gif?param1=something&param2=somethingelse&param2=somethingelseelse") assert.equal(headers:get_url_field(turbo.httputil.UF.PATH), "/test/test.gif") assert.equal(headers:get_version(), "HTTP/1.1") assert.equal(headers:get_argument("param1")[1], "something") assert.equal(headers:get_argument("param2")[1], "somethingelse") assert.equal(headers:get_argument("param2")[2], "somethingelseelse") assert.equal(type(headers:get_arguments()), "table") end) it("should parse URLs correctly", function() local header = turbo.httputil.HTTPParser() header:parse_url("https://www.somedomain.org:8888/test/me.html?andmyparams#fragment") assert.equal(header:get_url_field(turbo.httputil.UF.PATH), "/test/me.html") assert.equal(header:get_url_field(turbo.httputil.UF.SCHEMA), "https") assert.equal(header:get_url_field(turbo.httputil.UF.HOST), "www.somedomain.org") assert.equal(header:get_url_field(turbo.httputil.UF.PORT), "8888") assert.equal(header:get_url_field(turbo.httputil.UF.QUERY), "andmyparams") assert.equal(header:get_url_field(turbo.httputil.UF.FRAGMENT), "fragment") end) end) describe("HTTPHeaders class", function() it("should assemble headers correctly", function() local headers = turbo.httputil.HTTPHeaders:new() assert.truthy(instanceOf(turbo.httputil.HTTPHeaders, headers)) headers:set_status_code(304) headers:set_version("HTTP/1.1") headers:add("Date", "Wed, 08 May 2013 15:00:22 GMT") headers:add("Server", "Turbo/1.0") headers:add("Accept-Ranges", "bytes") headers:add("Connection", "keep-alive") headers:add("Age", "0") local expected = "HTTP/1.1 304 Not Modified\r\nDate: Wed, 08 May 2013 15:00:22 GMT\r\nServer: Turbo/1.0\r\nAccept-Ranges: bytes\r\nConnection: keep-alive\r\nAge: 0\r\n" assert.equal(headers:__tostring(), expected) assert.equal(headers:__tostring():len(), 137) end) it("should allow settings and getting of notable values", function() local h = turbo.httputil.HTTPHeaders:new() h:set_status_code(200) assert.equal(h:get_status_code(), 200) h:set_method("GET") assert.equal(h:get_method(), "GET") h:set_uri("/someplace/here") assert.equal(h:get_uri(), "/someplace/here") h:set_version("HTTP/1.1") assert.equal(h:get_version(), "HTTP/1.1") h:add("My-Field", "Some value") assert.equal(h:get("My-Field"), "Some value") h:remove("My-Field") assert.equal(h:get("My-Field"), nil) end) it("should fail on setting of bad values", function() local h = turbo.httputil.HTTPHeaders:new() assert.has_error(function() h:set_status_code("FAIL") end) assert.has_error(function() h:set_method(123) end) assert.has_error(function() h:set_uri() end) assert.has_error(function() h:set_content_length("nisse") end) assert.has_error(function() h:set_version({"HI"}) end) assert.has_error(function() h:add("Hacks", "Another\r\nField: Here") end) assert.has_error(function() h:set("Hacks", "Another\r\nField: Here") end) end) it("should parse formdata", function() local data = "username=user782400&mmm=ddd&arr=1&arr=2" local tbl = turbo.httputil.parse_post_arguments(data) assert.equal(type(tbl), "table") assert.equal(tbl.username, "user782400") assert.equal(tbl.mmm, "ddd") assert.equal(tbl.arr[1], "1") assert.equal(tbl.arr[2], "2") end) end) end)
-- Copyright (C) Kong Inc. local access = require "kong.plugins.hmac-auth.access" local HMACAuthHandler = { PRIORITY = 1000, VERSION = "2.3.0", } function HMACAuthHandler:access(conf) access.execute(conf) end return HMACAuthHandler
require 'lfs' -- Ensure the test is launched within the specs/ folder assert(string.match(lfs.currentdir(), "specs")~=nil, "You must run this test in specs folder") local initial_dir = lfs.currentdir() -- Go to specs folder while (not string.match(lfs.currentdir(), "/specs$")) do lfs.chdir("..") end local specs_dir = lfs.currentdir() lfs.chdir("..")-- one more directory and it is lib root -- Include Dataframe lib dofile("init.lua") -- Go back into initial dir lfs.chdir(initial_dir) describe("Loading data process", function() describe("for #CSV files",function() local df = Dataframe(specs_dir.."/data/full.csv") it("Loads the shape of the file",function() assert.are.same(df:shape(),{rows=4, cols=4}) end) it("Loads integer-only columns in integer column",function() for idx, val in ipairs({1, 2, 3, 4}) do assert.are.same(df:get_column('Col A'):get(idx), val) end end) it("Loads float-only columns in float column",function() for idx, val in ipairs({.2,.3,.4,.5}) do assert.are.same(df:get_column('Col B'):get(idx), val) end end) it("Loads string-only columns in string column",function() assert.are.same(df:get_column('Col D'), {'A','B',0/0,'D'}) end) it("Loads mixed numerical columns in mixed column",function() assert.is.equal(df:get_column('Col C')[1], 0.1) assert.is.nan(df:get_column('Col C')[2]) assert.is.equal(df:get_column('Col C')[3], 9999999999) assert.is.equal(df:get_column('Col C')[4], -222) end) it("Updates the columns names and escapes blank spaces",function() assert.are.same(df.column_order,{'Col A','Col B','Col C','Col D'}) assert.has.no_error(function() df:get_column('Col A') end) assert.has.no_error(function() df:get_column('Col B') end) assert.has.no_error(function() df:get_column('Col C') end) assert.has.no_error(function() df:get_column('Col D') end) end) it("Updates the number of rows",function() assert.is.equal(df:size(1),4) end) it("Fills numerical missing values with NaN values",function() local _,tot_na = df:count_na() assert.is.equal(tot_na,2,"There are two missing vales in full.csv") end) it("Infers data schema",function() assert.are.same(df:get_schema(), {['Col A']='integer', ['Col B']='double', ['Col C']='double', ['Col D']='string'}) end) it("Keeps the original column order",function() assert.are.same(df.column_order, {[1] = "Col A", [2] = "Col B", [3] = "Col C", [4] = "Col D"}) end) it("Loads a CSV without header",function() local df_iris = Dataframe() df_iris:load_csv{path=specs_dir.."/data/iris-no-header.csv",header=false} assert.are.same(df_iris:shape(),{rows=150,cols=5}) assert.are.same(df_iris.column_order, {[1] = "Column no. 1", [2] = "Column no. 2", [3] = "Column no. 3", [4] = "Column no. 4", [5] = "Column no. 5"}) end) it("Loads in bulk mode",function() local csv_file = specs_dir.."/data/iris-label.csv" local df_bulk = Dataframe():bulk_load_csv{path=csv_file,nthreads=4} local df_classic = Dataframe():load_csv{path=csv_file} assert.is_true(df_bulk == df_classic) end) end) describe("for lua tables",function() local df = Dataframe() it("Loads a simple table",function() df:load_table{data=Df_Dict({ ['first_column']={3,4,5}, ['second_column']={10,11,12} })} for idx,val in ipairs({3,4,5}) do assert.are.same(df:get_column("first_column")[idx], val) end for idx,val in ipairs({10,11,12}) do assert.are.same(df:get_column("second_column")[idx], val) end end) it("Generate an error if the column inserted are not the same size",function() assert.has.error(function() df:load_table{data=Df_Dict({ ['first_column']={3,5}, ['second_column']={10,11,12} })} end) end) it("Duplicate to all rows the only value given for a column",function() df:load_table{data=Df_Dict({ ['first_column']=3, ['second_column']={10,11,12} })} assert.are.same(df:get_column("first_column"), {3,3,3}) assert.are.same(df:get_column("second_column"), {10,11,12}) end) it("Updates the columns names and escapes blank spaces",function() df:load_table{data=Df_Dict({ [' first_column']={3,5,8}, ['second_column ']={10,11,12} }),column_order=Df_Array('first_column ',' second_column')} assert.are.same(df.column_order,{'first_column','second_column'}) assert.has.no_error(function() df:get_column('first_column') end) assert.has.no_error(function() df:get_column('second_column') end) end) it("Updates the number of rows",function() df:load_table{data=Df_Dict({ ['first_column']={3,5,8}, ['second_column']={10,11,12} })} assert.is.equal(df:size(1),3) end) it("Fills numerical missing values with NaN values",function() df:load_table{data=Df_Dict{ ['first_column']={3,nil,8}, ['second_column']={10,11,12} }} local _, tot_na = df:count_na() assert.is.equal(tot_na, 1) assert.is.nan(df["$first_column"][2]) end) it("Infers data schema",function() df:load_table{data=Df_Dict({ ['first_column']={3,9,8}, ['second_column']={10,11,12}, ['third_column']={'first','second','third'} })} assert.are.same(df:get_schema(), {['first_column']='integer', ['second_column']='integer', ['third_column']='string'}) end) it("Keeps the provided column order",function() local a = Dataframe() local column_order = { [1] = 'firstColumn', [2] = 'secondColumn', [3] = 'thirdColumn' } local data = { ['firstColumn']={1,2,3}, ['secondColumn']={"2","1","3"}, ['thirdColumn']={"2","a","3"} } a:load_table{data=Df_Dict(data), column_order = Df_Array(column_order)} assert.are.same(a.column_order, column_order) column_order[2] = nil assert.has.error(function() a:load_table{data=data, column_order = column_order} end) end) end) end)
--[[ Description: Utility functions used for nn performance evaluation. ]] require 'nn' do local testerPool = {} function testerPool.getMSE(mNet, teInput, teTarget) local criterion = nn.MSECriterion() local tePred = mNet:forward(teInput) local err = criterion:forward(tePred, teTarget) return err end function testerPool.getMAE(mNet, teInput, teTarget) local criterion = nn.AbsCriterion() local tePred = mNet:forward(teInput) local err = criterion:forward(tePred, teTarget) return err end return testerPool end
GamepadSupport = TestApp:extend { numGamepads = 1, colors = { {0, 255, 0}, {255, 0, 0}, {0, 0, 255}, {255, 255, 0} }, analog = false, onRun = function (self) local gp = the.gamepads[1] self:add(Text:new { x = 10, y = 10, width = 800, text = 'Name: ' .. gp.name .. '\n' .. gp.numAxes .. ' axes, ' .. gp.numBalls .. ' balls, ' .. gp.numButtons .. ' buttons, ' .. gp.numHats .. ' hats' }) self.controlLabel = self:add(Text:new{ x = 4, y = 200, width = 400, height = 400 }) self.square = self:add(Fill:new{ x = 300, y = 300, width = 50, height = 50, fill = {255, 255, 255} }) self:add(Text:new { x = 10, y = 540, width = 450, font = 14, text = 'Gamepads must be connected at startup in order to be used. Move the square ' .. 'with either the left analog stick or control pad. Press the M key to toggle ' .. 'between analog and digital movement.' }) end, onUpdate = function (self, elapsed) local gp = the.gamepads[1] if the.keys:justPressed('m') then self.analog = not self.analog end self.square.velocity.x = 0 self.square.velocity.y = 0 if self.analog then self.square.velocity.x = gp.axes[1] * 400 self.square.velocity.y = gp.axes[2] * 400 else if gp:pressed('up') then self.square.velocity.y = -200 elseif gp:pressed('down') then self.square.velocity.y = 200 end if gp:pressed('left') then self.square.velocity.x = -200 elseif gp:pressed('right') then self.square.velocity.x = 200 end end for i = 1, #self.colors do if gp:pressed(i) then self.square.fill = self.colors[i] end end end }
-------------------------------- --- CVARS -------------------------------- local CVars = {} MR.CL.CVars = CVars -- Set propertie cvars to default function CVars:SetPropertiesToDefaults(ply) ply:ConCommand("internal_mr_detail " .. MR.CVars:GetDefaultDetail()) ply:ConCommand("internal_mr_offsetx " .. MR.CVars:GetDefaultOffsetX()) ply:ConCommand("internal_mr_offsety " .. MR.CVars:GetDefaultOffsetY()) ply:ConCommand("internal_mr_scalex " .. MR.CVars:GetDefaultScaleX()) ply:ConCommand("internal_mr_scaley " .. MR.CVars:GetDefaultScaleY()) ply:ConCommand("internal_mr_rotation " .. MR.CVars:GetDefaultRotation()) ply:ConCommand("internal_mr_alpha " .. MR.CVars:GetDefaultAlpha()) end
-- Script by Shadow Mario -- Customized for Simplicity by Kevin Kuntz function onCreate() makeAnimationList(); makeOffsets(); makeAnimatedLuaSprite('tricky', 'characters/tricky', 1100, 100); addAnimationByPrefix('tricky', 'idle', 'tricky idle', 24, false); addAnimationByPrefix('tricky', 'singLEFT', 'tricky right', 24, false); addAnimationByPrefix('tricky', 'singDOWN', 'tricky down', 24, false); addAnimationByPrefix('tricky', 'singUP', 'tricky up', 24, false); addAnimationByPrefix('tricky', 'singRIGHT', 'tricky left', 24, false); scaleLuaSprite('tricky', 1.8, 1.8) updateHitbox('tricky') setProperty('tricky.flipX', true); addLuaSprite('tricky', false); playAnimation('tricky', 0, true); end animationsList = {} holdTimers = {tricky = -1.0}; noteDatas = {tricky = 0}; function makeAnimationList() animationsList[0] = 'idle'; animationsList[1] = 'singLEFT'; animationsList[2] = 'singDOWN'; animationsList[3] = 'singUP'; animationsList[4] = 'singRIGHT'; end offsetstricky = {}; function makeOffsets() offsetstricky[0] = {x = 0, y = 0}; --idle offsetstricky[1] = {x = 0, y = 0}; --left offsetstricky[2] = {x = -28, y = 0}; --down offsetstricky[3] = {x = -47, y = 20}; --up offsetstricky[4] = {x = -44, y = 0}; --right end function goodNoteHit(id, direction, noteType, isSustainNote) if noteType == 'Tricky Sing' then if not isSustainNote then noteDatas.tricky = direction; end characterToPlay = 'tricky' animToPlay = noteDatas.tricky; holdTimers.tricky = 0; playAnimation(characterToPlay, animToPlay, true); end end function onUpdate(elapsed) holdCap = stepCrochet * 0.004; if holdTimers.tricky >= 0 then holdTimers.tricky = holdTimers.tricky + elapsed; if holdTimers.tricky >= holdCap then playAnimation('tricky', 0, false); holdTimers.tricky = -1; end end end function onCountdownTick(counter) beatHitDance(counter); end function onBeatHit() beatHitDance(curBeat); end function beatHitDance(counter) if counter % 2 == 0 then if holdTimers.tricky < 0 then playAnimation('tricky', 0, false); end end end function playAnimation(character, animId, forced) -- 0 = idle -- 1 = singLEFT -- 2 = singDOWN -- 3 = singUP -- 4 = singRIGHT animName = animationsList[animId]; --debugPrint(animName); if character == 'tricky' then objectPlayAnimation('tricky', animName, forced); -- this part is easily broke if you use objectPlayAnim (I have no idea why its like this) setProperty('tricky.offset.x', offsetstricky[animId].x); setProperty('tricky.offset.y', offsetstricky[animId].y); end end
ys = ys or {} slot1 = require("Mgr/Pool/PoolUtil") slot2 = singletonClass("BattlePopNumManager") ys.Battle.BattlePopNumManager = slot2 slot2.__name = "BattlePopNumManager" slot2.CONTAINER_HP = "HPTextContainer" slot2.CONTAINER_SCORE = "ScoreTextContainer" slot2.POP_SCORE = "score" slot2.POP_MISS = "miss" slot2.POP_HEAL = "heal" slot2.POP_COMMON = "common" slot2.POP_UNBREAK = "unbreak" slot2.POP_NORMAL = "normal" slot2.POP_EXPLO = "explo" slot2.POP_PIERCE = "pierce" slot2.POP_CT_NORMAL = "critical_normal" slot2.POP_CT_EXPLO = "critical_explo" slot2.POP_CT_PIERCE = "critical_pierce" slot2.FontIndex = { slot2.POP_NORMAL, slot2.POP_PIERCE, slot2.POP_EXPLO, slot2.POP_UNBREAK } slot2.CTFontIndex = { slot2.POP_CT_NORMAL, slot2.POP_CT_PIERCE, slot2.POP_CT_EXPLO, slot2.POP_UNBREAK } slot2.Ctor = function (slot0) return end slot2.Init = function (slot0, slot1, slot2) slot0._allPool = {} slot0._activeList = {} slot0._allPool[slot0.POP_COMMON] = slot0:generateTempPool(slot0.POP_COMMON, slot2, slot1, 10) slot0._allPool[slot0.POP_MISS] = slot0:generateTempPool(slot0.POP_MISS, slot2, slot1, 10) slot0._allPool[slot0.POP_UNBREAK] = slot0:generateTempPool(slot0.POP_UNBREAK, slot2, slot1, 10) slot0._allPool[slot0.POP_HEAL] = slot0:generateTempPool(slot0.POP_HEAL, slot2, slot1, 0) slot0._allPool[slot0.POP_NORMAL] = slot0:generateTempPool(slot0.POP_NORMAL, slot2, slot1, 0) slot0._allPool[slot0.POP_EXPLO] = slot0:generateTempPool(slot0.POP_EXPLO, slot2, slot1, 0) slot0._allPool[slot0.POP_PIERCE] = slot0:generateTempPool(slot0.POP_PIERCE, slot2, slot1, 0) slot0._allPool[slot0.POP_CT_NORMAL] = slot0:generateTempPool(slot0.POP_CT_NORMAL, slot2, slot1, 0) slot0._allPool[slot0.POP_CT_EXPLO] = slot0:generateTempPool(slot0.POP_CT_EXPLO, slot2, slot1, 0) slot0._allPool[slot0.POP_CT_PIERCE] = slot0:generateTempPool(slot0.POP_CT_PIERCE, slot2, slot1, 0) slot0._allPool[slot0.POP_SCORE] = slot0:generateTempPool(slot0.POP_SCORE, slot2, slot1, 5) end slot2.InitialPoolRoot = function (slot0, slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_COMMON], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_MISS], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_UNBREAK], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_HEAL], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_NORMAL], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_EXPLO], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_PIERCE], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_CT_NORMAL], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_CT_EXPLO], slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_CT_PIERCE], slot1) end slot2.InitialScorePoolRoot = function (slot0, slot1) slot0:resetPopParent(slot0._allPool[slot0.POP_SCORE], slot1) end slot2.Clear = function (slot0) for slot4, slot5 in pairs(slot0._allPool) do slot5:Dispose() end slot0._allPool = {} slot0._activeList = {} end slot2.Update = function (slot0) for slot4, slot5 in pairs(slot0._activeList) do slot4:Update() end end slot2.UnloadPopNum = function (slot0, slot1) slot0._activeList[slot1] = nil end slot2.GetPop = function (slot0, slot1, slot2, slot3, slot4, slot5) slot6, slot7 = slot0.getType(slot1, slot2, slot3, slot5) slot9 = slot0._allPool[slot6].GetObject(slot8) if slot6 ~= slot0.POP_MISS then slot9:SetText(slot4) end slot9:SetScale(slot7) slot0._activeList[slot9] = 1 return slot9 end slot2.GetScorePop = function (slot0, slot1) slot3 = slot0._allPool[slot0.POP_SCORE].GetObject(slot2) slot3:SetText(slot1) slot0._activeList[slot3] = 1 return slot3 end slot2.getType = function (slot0, slot1, slot2, slot3) slot4 = 1 slot5 = nil if slot0 and not slot2 then slot5 = slot0.POP_HEAL elseif slot2 then slot5 = slot0.POP_MISS elseif slot3 then slot7 = slot3[2] slot5 = (not slot1 or slot0.CTFontIndex[slot3[1]]) and slot0.FontIndex[slot3[1]] slot4 = slot3[2] else return (not slot1 or slot0.POP_CT_EXPLO) and slot0.POP_COMMON, slot4 end end slot2.generatePool = function (slot0, slot1, slot2, slot3, slot4) return pg.LuaObPool.New(slot0.Battle.BattlePopNum, { template = slot3:Find(slot1).gameObject, parentTF = slot2, mgr = slot0 }, slot4) end slot2.generateTempPool = function (slot0, slot1, slot2, slot3, slot4) return pg.LuaObPool.New(slot0.Battle.BattlePopNum, { template = slot3.transform:Find(slot1).gameObject, parentTF = slot2, mgr = slot0 }, slot4) end slot2.resetPopParent = function (slot0, slot1, slot2) slot1:UpdateInfo("parentTF", slot2) for slot6, slot7 in ipairs(slot1.list) do slot7:SetParent(slot2) end end return
object_mobile_cww8_droid_crafted = object_mobile_shared_cww8_droid_crafted:new { } ObjectTemplates:addTemplate(object_mobile_cww8_droid_crafted, "object/mobile/cww8_droid_crafted.iff")
local log = require("telescope.log") local LinkedList = require('telescope.algos.linked_list') --[[ OK, new idea. We can do linked list here. To convert at the end to quickfix, just run the list. ... start node end node if past loop of must have scores, then we can just add to end node and shift end node to current node. etc. always inserts a row, because we clear everything before? can also optimize by keeping worst acceptable score around. --]] local EntryManager = {} EntryManager.__index = EntryManager function EntryManager:new(max_results, set_entry, info, id) log.trace("Creating entry_manager...") info = info or {} info.looped = 0 info.inserted = 0 info.find_loop = 0 -- state contains list of -- { entry, score } -- Stored directly in a table, accessed as [1], [2] set_entry = set_entry or function() end return setmetatable({ id = id, linked_states = LinkedList:new { track_at = max_results }, info = info, max_results = max_results, set_entry = set_entry, worst_acceptable_score = math.huge, }, self) end function EntryManager:num_results() return self.linked_states.size end function EntryManager:get_container(index) local count = 0 for val in self.linked_states:iter() do count = count + 1 if count == index then return val end end return {} end function EntryManager:get_entry(index) return self:get_container(index)[1] end function EntryManager:get_score(index) return self:get_container(index)[2] end function EntryManager:get_ordinal(index) return self:get_entry(index).ordinal end function EntryManager:find_entry(entry) local info = self.info local count = 0 for container in self.linked_states:iter() do count = count + 1 if container[1] == entry then info.find_loop = info.find_loop + count return count end end info.find_loop = info.find_loop + count return nil end function EntryManager:_update_score_from_tracked() local linked = self.linked_states if linked.tracked then self.worst_acceptable_score = math.min(self.worst_acceptable_score, linked.tracked[2]) end end function EntryManager:_insert_container_before(picker, index, linked_node, new_container) self.linked_states:place_before(index, linked_node, new_container) self.set_entry(picker, index, new_container[1], new_container[2], true) self:_update_score_from_tracked() end function EntryManager:_insert_container_after(picker, index, linked_node, new_container) self.linked_states:place_after(index, linked_node, new_container) self.set_entry(picker, index, new_container[1], new_container[2], true) self:_update_score_from_tracked() end function EntryManager:_append_container(picker, new_container, should_update) self.linked_states:append(new_container) self.worst_acceptable_score = math.min(self.worst_acceptable_score, new_container[2]) if should_update then self.set_entry(picker, self.linked_states.size, new_container[1], new_container[2]) end end function EntryManager:add_entry(picker, score, entry) if picker and picker.id then if picker.request_number ~= self.id then error("ADDING ENTRY TOO LATE!") return end end score = score or 0 local max_res = self.max_results local worst_score = self.worst_acceptable_score local size = self.linked_states.size local info = self.info info.maxed = info.maxed or 0 local new_container = { entry, score, } -- Short circuit for bad scores -- they never need to be displayed. -- Just save them and we'll deal with them later. if score >= worst_score then return self.linked_states:append(new_container) end -- Short circuit for first entry. if size == 0 then self.linked_states:prepend(new_container) self.set_entry(picker, 1, entry, score) return end for index, container, node in self.linked_states:ipairs() do info.looped = info.looped + 1 if container[2] > score then -- print("Inserting: ", picker, index, node, new_container) return self:_insert_container_before(picker, index, node, new_container) end -- Don't add results that are too bad. if index >= max_res then info.maxed = info.maxed + 1 return self:_append_container(picker, new_container, false) end end if self.linked_states.size >= max_res then self.worst_acceptable_score = math.min(self.worst_acceptable_score, score) end return self:_insert_container_after(picker, size + 1, self.linked_states.tail, new_container) end function EntryManager:iter() return coroutine.wrap(function() for val in self.linked_states:iter() do coroutine.yield(val[1]) end end) end return EntryManager
local cfg = {} -- define each group with a set of permissions -- _config property: --- title (optional): group display name --- gtype (optional): used to have only one group with the same gtype per player (example: a job gtype to only have one job) --- onspawn (optional): function(player) (called when the player spawn with the group) --- onjoin (optional): function(player) (called when the player join the group) --- onleave (optional): function(player) (called when the player leave the group) --- (you have direct access to vRP and vRPclient, the tunnel to client, in the config callbacks) cfg.groups = { ["superadmin"] = { _config = { onspawn = function(player) -- når du spawner med ranket end, onleave = function(player) -- når man får ranket taget fra sig end, onjoin = function(player) -- når man joiner ranket end }, "*" }, -- the group user is auto added to all logged players ["user"] = { "player.phone", "player.calladmin", "police.askid", "police.store_weapons", "police.seizable" -- can be seized }, } -- Ranks som user_id 1 skal have cfg.userOne = { "superadmin" } -- group selectors -- _config --- x,y,z, blipid, blipcolor, permissions (optional) cfg.selectors = { ["Job Selector"] = { _config = {x = 1854.21, y = 3685.51, z = 34.2671, blipid = 351, blipcolor = 47}, "police", "taxi", "repair", "citizen", "superadmin" } } return cfg
local LineWrap = class('LineWrap') return LineWrap
return { uiEffect = "", name = "闪耀登场", cd = 0, painting = 1, id = 12260, picture = "0", castCV = "", desc = "", effect_list = {} }
local hi = require('utils.hi') local li = require('utils.li') local colors = require('colors') local vars = require('vars') -- highlights hi('OctoBlue', colors.columbia_blue) hi('OctoGreen', colors.mint_green) hi('OctoRed', colors.brink_pink) hi('OctoYellow', colors.gold) hi('OctoNormalFront', colors.text0) hi('OctoGrey', colors.biloba_flower) hi('OctoPurple', colors.mauve) hi('OctoBubbleDelimiterBlue', colors.columbia_blue) hi('OctoBubbleDelimiterYellow', colors.gold) hi('OctoBubbleDelimiterRed', colors.brink_pink) hi('OctoBubbleDelimiterGreen', colors.mint_green) hi('OctoBubbleBlue', colors.columbia_blue, nil, 'reverse') hi('OctoBubbleYellow', colors.gold, nil, 'reverse') hi('OctoBubblePurple', colors.mauve, nil, 'reverse') hi('OctoBubbleRed', colors.brink_pink, nil, 'reverse') hi('OctoBubbleGreen', colors.mint_green, nil, 'reverse') hi('OctoFilePanelCounter', colors.aquamarine) hi('OctoFilePanelTitle', colors.secondary) hi('OctoViewer', colors.columbia_blue, nil, 'reverse') li('OctoTimelineMarker', 'Identifier') li('OctoTimelineItemHeading', 'Comment') li('OctoStatusUntracked', 'OctoGreen') li('OctoDate', 'Comment') li('OctoStatusRenamed', 'OctoBlue') li('OctoVertSplit', 'VertSplit') li('OctoStateDismissed', 'OctoStateClosed') li('OctoStateClosed', 'OctoRed') li('OctoStateCommented', 'Normal') li('OctoCursorLine', 'CursorLine') li('OctoStateApproved', 'OctoStateOpen') li('OctoStateOpen', 'OctoGreen') li('OctoStatePending', 'OctoYellow') li('OctoSignColumn', 'Normal') li('OctoNormal', 'Normal') li('OctoDiffstatNeutral', 'OctoGrey') li('OctoDiffstatDeletions', 'OctoRed') li('OctoStatusLine', 'StatusLine') li('OctoStatusLineNC', 'StatusLineNC') li('OctoFailingTest', 'OctoRed') li('OctoPassingTest', 'OctoGreen') li('OctoReactionViewer', 'OctoViewer') li('OctoReaction', 'OctoBubble') li('OctoBubble', 'NormalFloat') li('OctoUserViewer', 'OctoViewer') li('OctoUser', 'OctoBubble') li('OctoEndOfBuffer', 'EndOfBuffer') li('OctoMissingDetails', 'Comment') li('OctoIssueId', 'Question') li('OctoDetailsLabel', 'Title') li('OctoStatusDeleted', 'OctoRed') li('OctoSymbol', 'Comment') li('OctoStatusUnknown', 'OctoYellow') li('OctoEmpty', 'Comment') li('OctoStatusTypeChange', 'OctoBlue') li('OctoStatusCopied', 'OctoBlue') li('OctoStatusUnmerged', 'OctoBlue') li('OctoDiffstatAdditions', 'OctoGreen') li('OctoStateMerged', 'OctoPurple') li('OctoStateChangesRequested', 'OctoStateClosed') li('OctoStateSubmitted', 'OctoBubbleGreen') li('OctoIssueTitle', 'PreProc') li('OctoStatusModified', 'OctoBlue') li('OctoStatusAdded', 'OctoGreen') li('OctoFilePanelPath', 'Comment') li('OctoFilePanelFileName', 'NormalFront') li('OctoStatusBroken', 'OctoRed') li('OctoDetailsValue', 'Identifier') li('OctoFloat', 'NormalFloat') li('OctoEditable', 'NormalFloat') li('OctoDirty', 'OctoRed') require('octo').setup(vim.tbl_extend('error', { default_remote = { 'upstream', 'origin' }, timeline_indent = '2', snippet_context_lines = 4, file_panel = { size = 10, use_icons = true } }, vars.octo.symbols))
--------------------------------- -- TO CHANGE -- OBJECT_DISTANCE_COPY = 300 --------------------------------- OBJECT = nil Y_ROTATION_FIXED = nil local function GetNearestObject() local x, y, z = GetPlayerLocation(GetPlayerId()) local nearest_obj_distance = OBJECT_DISTANCE_COPY local nearest_obj = nil for _, obj in pairs(GetStreamedObjects()) do local ox, oy, oz = GetObjectLocation(obj) local distance = GetDistance3D(x, y, z, ox, oy, oz) if obj ~= OBJECT and distance < nearest_obj_distance then SetObjectOutline(obj, true) if nearest_obj ~= nil then SetObjectOutline(nearest_obj, false) end nearest_obj = obj nearest_obj_distance = distance else SetObjectOutline(obj, false) end end return nearest_obj end local function OnGameTick() local playerData = GetPlayerPropertyValue(GetPlayerId(),"player") if playerData ~= nil and playerData.team == PLAYER_TEAM_PROP then GetNearestObject() if IsValidObject(OBJECT) then local w,d,height = GetObjectSize(OBJECT) -- I've written them here to avoid bugs but we can probably come up with something better SetControllerOrientedMovement(true) GetPlayerActor(GetPlayerId()):SetActorHiddenInGame(true) GetObjectActor(OBJECT):SetActorEnableCollision(false) local x,yRotation,z if Y_ROTATION_FIXED == nil then x,yRotation,z = VectorToRotation(GetCameraForwardVector(), GetCameraRightVector(), 0) CallRemoteEvent("Move",OBJECT,-yRotation,height) else CallRemoteEvent("Move",OBJECT,-Y_ROTATION_FIXED,height) end end end end AddEvent("OnGameTick", OnGameTick) local function OnKeyPress(key) -- Fix the rotation if key == "Left Ctrl" then if Y_ROTATION_FIXED == nil then local x,yRotation,z = VectorToRotation(GetCameraForwardVector(), GetCameraRightVector(), 0) Y_ROTATION_FIXED = yRotation else Y_ROTATION_FIXED = nil end end -- Take an object if key == "Left Mouse Button" then local playerData = GetPlayerPropertyValue(GetPlayerId(),"player") AddPlayerChat(tostring(playerData.team)) if playerData ~= nil and playerData.team == PLAYER_TEAM_PROP then local objectId = GetNearestObject() if objectId ~= nil then -- If the targeted object is a player return if(GetObjectPropertyValue(objectId,"player") ~= nil)then return end if OBJECT == nil then -- First time create object CallRemoteEvent("AddPlayerObject", objectId) else -- Next time update model object CallRemoteEvent("UpdatePlayerObject", OBJECT,objectId) end end end end if key == "F" then CallRemoteEvent("ResetPlayerObject") OBJECT = nil end if key == "Num 1" then CallRemoteEvent("ChangeTeam", PLAYER_TEAM_PROP) OBJECT = nil end if key == "Num 2" then CallRemoteEvent("ChangeTeam", PLAYER_TEAM_HUNTER) OBJECT = nil end end AddEvent("OnKeyPress", OnKeyPress) local function updatePlayerObject(object) -- Delay to prevent object not already created by server Delay(50, function() OBJECT = object if OBJECT ~= nil and IsValidObject(OBJECT) then local w,h,d = GetObjectSize(OBJECT) GetObjectActor(OBJECT):SetActorEnableCollision(false) -- Match the player scale to the object -- The constants 83.33, 77.74, 200 are precalculated coefficients -- These are coefficients that I obtained by trying to match the player's mesh with a certain object. GetPlayerActor(GetPlayerId()):SetActorScale3D(FVector(h/83.33,w/77.74,d/200)) else -- Reset player model GetPlayerActor(GetPlayerId()):SetActorScale3D(FVector(1,1,1)) SetControllerOrientedMovement(false) end end) end AddRemoteEvent("UpdatePlayerObject", updatePlayerObject) -- playerId = player to hide local function hidePlayerProp(playerId) GetPlayerActor(playerId):SetActorScale3D(FVector(0.001,0.001,0.001)) TogglePlayerTag(playerId, 'name', false) TogglePlayerTag(playerId, 'health', false) TogglePlayerTag(playerId, 'armor', false) TogglePlayerTag(playerId, 'voice', false) end AddRemoteEvent("HidePlayerProp", hidePlayerProp) -- playerId = player to show local function showPlayerProp(playerId) GetPlayerActor(playerId):SetActorHiddenInGame(false) GetPlayerActor(playerId):SetActorScale3D(FVector(1,1,1)) TogglePlayerTag(playerId, 'name', true) TogglePlayerTag(playerId, 'health', true) TogglePlayerTag(playerId, 'armor', true) TogglePlayerTag(playerId, 'voice', true) end AddRemoteEvent("ShowPlayerProp", showPlayerProp) AddEvent("OnPlayerDeath",function() OBJECT = nil end)
function GM:RequestPurchaseUpgrade(upgrade_key, tier_desired) net.Start("yawd.upgrades.purchase") net.WriteUInt(upgrade_key, 32) net.WriteUInt(tier_desired, 8) net.SendToServer() DebugMessage(string.format("Requested to purchase upgrade %d:%d", upgrade_key, tier_desired)) end function GM:RequestSellUpgrade(upgrade_key, tier_desired) net.Start("yawd.upgrades.sell") net.WriteUInt(upgrade_key, 32) net.WriteUInt(tier_desired, 8) net.SendToServer() DebugMessage(string.format("Requested to sell upgrade %d to tier %d", upgrade_key, tier_desired)) end net.Receive("yawd.upgrades.menu", function() GAMEMODE:CreateUpgradesMenu() end) net.Receive("yawd.upgrades.owned", function() local num = net.ReadUInt(32) local upgrades = {} for i = 1, num do upgrades[i] = { upgrade = GAMEMODE:GetUpgrade(net.ReadUInt(32)), tier = net.ReadUInt(8), } end GAMEMODE:PlayerSetUpgrades(LocalPlayer(), upgrades) GAMEMODE:RefreshUpgradesMenu() DebugMessage("Received owned player upgrades from server") end)
require 'nn' local Sampler, parent = torch.class('nn.Sampler', 'nn.Module') function Sampler:__init(gpuid) parent.__init(self) self.gradInput = {} self.on_cuda = false if gpuid>0 then self.on_cuda = true end end function Sampler:updateOutput(input) self.eps = self.eps or input[1].new() if self.on_cuda == true then self.eps:resizeAs(input[1]):copy(torch.randn(input[1]:size()):cuda()) else self.eps:resizeAs(input[1]):copy(torch.randn(input[1]:size())) end self.output = self.output or self.output.new() self.output:resizeAs(input[2]):copy(input[2]) self.output:mul(0.5):exp():cmul(self.eps) self.output:add(input[1]) return self.output end function Sampler:updateGradInput(input, gradOutput) self.gradInput[1] = self.gradInput[1] or input[1].new() self.gradInput[1]:resizeAs(gradOutput):copy(gradOutput) self.gradInput[2] = self.gradInput[2] or input[2].new() self.gradInput[2]:resizeAs(gradOutput):copy(input[2]) self.gradInput[2]:mul(0.5):exp():mul(0.5):cmul(self.eps) self.gradInput[2]:cmul(gradOutput) return self.gradInput end
#!/usr/bin/lua5.1 --[[-- @package MoonZaphire @filename lib/init.lua @version 3.0 @autor Díaz Urbaneja Víctor Eduardo Diex <victor.vector008@gmail.com> @date 01.02.2021 16:47:50 -04 ]] json = require 'json' print("| 'json' loaded successfully.") utils = require 'utils' print("| 'utils' loaded successfully.") -- Load the GResource file local Res = Gio.Resource.load("data/com.github.diazvictor.MoonZaphire.gresource") Gio.resources_register(Res) print("| 'Resources' loaded successfully.")
object_intangible_buy_back_buy_back_container = object_intangible_buy_back_shared_buy_back_container:new { } ObjectTemplates:addTemplate(object_intangible_buy_back_buy_back_container, "object/intangible/buy_back/buy_back_container.iff")
local fs = require('be.fs') current_build_script_path = nil build_scripts = { env = { } } register_template_dir(fs.compose_path(limp_dir, 'build', 'templates')) local n = 0 local function search_relative (path, parent_path) local build_script = fs.compose_path(parent_path, path, 'build.lua') if fs.exists(build_script) then local contents = fs.get_file_contents(build_script) local fn = load(contents, '@' .. build_script .. '.lua', 'bt', build_scripts.env) n = n + 1 build_scripts[n] = function () current_build_script_path = build_script fn() current_build_script_path = nil end end end function build_scripts.try (path) search_relative(path, root_dir) end function build_scripts.search (path) local abs_path = fs.compose_path(root_dir, path) local dirs = table.pack(fs.get_dirs(abs_path)) for i = 1, #dirs do search_relative(dirs[i], abs_path) end end function build_scripts.execute () for i = 1, n do build_scripts[i]() end end
------------------------------------------------- -- Bluetooth Widget for Awesome Window Manager -- Shows the bluetooth status using the bluetoothctl command -- Better with Blueman Manager ------------------------------------------------- local awful = require('awful') local naughty = require('naughty') local watch = require('awful.widget.watch') local wibox = require('wibox') local clickable_container = require('widget.material.clickable-container') local gears = require('gears') local dpi = require('beautiful').xresources.apply_dpi local HOME = os.getenv('HOME') local PATH_TO_ICONS = HOME .. '/.config/awesome/widget/bluetooth/icons/' local checker local widget = wibox.widget { { id = 'icon', image = PATH_TO_ICONS .. 'bluetooth-off' .. '.svg', widget = wibox.widget.imagebox, resize = true }, layout = wibox.layout.align.horizontal } local widget_button = clickable_container(wibox.container.margin(widget, dpi(7), dpi(7), dpi(7), dpi(7))) widget_button:buttons( gears.table.join( awful.button( {}, 1, nil, function() awful.spawn('blueman-manager') end ) ) ) -- Alternative to naughty.notify - tooltip. You can compare both and choose the preferred one awful.tooltip( { objects = {widget_button}, mode = 'outside', align = 'right', timer_function = function() if checker ~= nil then return 'Bluetooth is on' else return 'Bluetooth is off' end end, preferred_positions = {'right', 'left', 'top', 'bottom'} } ) -- To use colors from beautiful theme put -- following lines in rc.lua before require("battery"): --beautiful.tooltip_fg = beautiful.fg_normal --beautiful.tooltip_bg = beautiful.bg_normal local last_bluetooth_check = os.time() watch( 'bluetoothctl --monitor list', 5, function(_, stdout) -- Check if there bluetooth checker = stdout:match('Controller') -- If 'Controller' string is detected on stdout local widgetIconName if (checker ~= nil) then widgetIconName = 'bluetooth' else widgetIconName = 'bluetooth-off' end widget.icon:set_image(PATH_TO_ICONS .. widgetIconName .. '.svg') collectgarbage('collect') end, widget ) return widget_button
Locales['en'] = { ['item_removed'] = 'You have pack the following items: %s', ['item_received'] = 'You have received the following items: %s', ['limit_harvest'] = 'You can\'t pick %s anymore, your inventory is full.', ['item_transformed'] = 'Received from pack products: %s', ['limit_transform'] = 'You can\'t pack %s anymore, you have to empty your bags first.', ['not_enough_transform'] = 'You don\'t have enough %s to pack even more', ['item_sold'] = 'You have sold the following items: %s', ['limit_sell'] = 'You can\'t sell %s anymore, you have to check your bag first.', ['item_sell'] = 'Received from sales of products: %s', ['not_enough_sell'] = 'You don\'t have enough %s to sell any more', ['required_cops'] = 'Currently there are not enough cops online, %s of the %s are online', ['black_money'] = 'Dirty Money', ['money'] = 'Cash', ['bank'] = 'Bank', ['and'] = 'and', ['press_harvest'] = 'Press ~INPUT_CONTEXT~ to pick ~y~%s~', ['press_transform'] = 'Press ~INPUT_CONTEXT~ to pack ~y~%s~.', ['press_sell'] = 'Press ~INPUT_CONTEXT~ to sell ~y~%s~.', ['process_in_vehicle'] = 'Your not allowed to sit in a vehicle, we have stopped your processes', ['blip_sell'] = '%s sale', ['blip_transform'] = '%s pack', ['blip_harvest'] = '%s farm' }
module("luci.controller.linkmeter.lm", package.seeall) function index() local root = node() root.target = alias("lm") entry({"lm"}, template("linkmeter/index"), nil, 10) end
util.AddNetworkString("ghomes_dlc1_use_suitcase2") util.AddNetworkString("ghomes_dlc1_use_suitcase3") util.AddNetworkString("ghomes_dlc1_alarm_lockpicked") util.AddNetworkString("ghomes_dlc1_ask_where_to_spawn") local function canSpawnHere(vec, ply) local tr = { start = vec, endpos = vec, filter = ply } local hullTrace = util.TraceEntity(tr, ply) return not hullTrace.Hit end local vector100000 = Vector(0, 0, -100000) -- tries to find a place to spawn, returns false if fail, the vector if it doesn't fails local function randomSpawn(id, ply) local vec local min = ghomes.list[id].boxes[1] local max = ghomes.list[id].boxes[2] local tries = 0 while (tries < 50) do vec = Vector(math.Rand(min[1], max[1]), math.Rand(min[2], max[2]), math.Rand(min[3], max[3])) local result = util.QuickTrace(vec, vector100000) vec = result.HitPos tries = tries + 1 if util.IsInWorld(vec) and canSpawnHere(vec, ply) and vec:IsInHouse(id) then break end end if (tries == 50) then DarkRP.notify(ply, 1, 4, "Couldn't find any room to spawn you in your property") return false end return vec end function ghomes.dlcs.dlc1.canPlayerSpawnInHouse(ply, houseid) local house = ghomes.list[houseid] if ply:isCP() or ply:isArrested() then return false end if not house then return false end if house.nextAllowedSpawn and house.nextAllowedSpawn >= os.time() then return false end return (house.owner == ply and house.spawnHere) or (house.spawnHereFriends and table.HasValue(house.friends, ply:SteamID())) end function ghomes.dlcs.dlc1.randomSpawn(ply, houseid) if ghomes.dlcs.dlc1.canPlayerSpawnInHouse(ply, houseid) then local result = randomSpawn(houseid, ply) if result ~= false then timer.Simple(0, function() ply:SetPos(result) end) -- workaround because the hook system is a mess DarkRP.notify(ply, 0, 4, ghomes.welcomehome) return true elseif ghomes.debug then MsgC(ghomes.rgb, Format("Couldn't find any place to spawn the player %s at the house %i", ply:Nick(), houseid)) return false end else ply.ghomes_remember_spawn_choice = false end end function ghomes.dlcs.dlc1.generateSpawnableHouses(ply) local list = {} for k, v in ipairs(ghomes.list) do if ghomes.dlcs.dlc1.canPlayerSpawnInHouse(ply, k) then table.insert(list, k) end end return list end hook.Add("PlayerSpawn", "ghomes_dlc1_spawnoverride", function(ply) if ply.ghomes_choosed_next_spawn ~= 0 then ghomes.dlcs.dlc1.randomSpawn(ply, ply.ghomes_choosed_next_spawn) end end) hook.Add("PlayerDeath","ghomes_dlc1_spawnoverride",function (ply) if ply.ghomes_remember_spawn_choice then return end local list = ghomes.dlcs.dlc1.generateSpawnableHouses(ply) if (#list == 0) then return end net.Start("ghomes_dlc1_ask_where_to_spawn") net.WriteUInt(#list,8) for k, v in ipairs(list) do net.WriteUInt(v, 9) end net.Send(ply) end) --"246589.12546-425463{{ user_id }}64565513699.14--426158" is the hash we need to remember net.Receive("ghomes_dlc1_ask_where_to_spawn",function (len, ply) local houseid = net.ReadUInt(9) local save = net.ReadBool() if ghomes.dlcs.dlc1.canPlayerSpawnInHouse(ply, houseid) == false then return end -- cheater ply.ghomes_remember_spawn_choice = save ply.ghomes_choosed_next_spawn = houseid end) -- duplicator.DoGeneric -- duplicator.CopyEntTable function ghomes.dlcs.dlc1.saveentities(ply) if not IsValid(ply) then return end if not ply:IsPlayer() then return end for k, house in ipairs(ghomes.list) do house.savedEntities = {} if house.owner == ply and house.saveEntities then for entry, ent in pairs(ents.GetAll()) do if ent:IsInHouse(k) and (not ent.Getowning_ent or ent:Getowning_ent() == ply) and table.HasValue(ghomes.dlcs.dlc1.ent_save_list, ent:GetClass()) then table.insert(house.savedEntities, {ent:GetClass(), duplicator.CopyEntTable(ent)}) ent:Remove() -- dont let them duplicate the entities end end ghomes.savehouse(k) end end end function ghomes.dlcs.dlc1.restoreentities(ply) if not IsValid(ply) then return end if not ply:IsPlayer() then return end for k, v in ipairs(ghomes.list) do if v.owner == ply and v.saveEntities and v.savedEntities then for entry, enttable in pairs(v.savedEntities) do local ent = ents.Create(enttable[1]) if ( not IsValid( ent ) ) then error(Format("tried to create the entity %s but it failed",enttable[0] )) end duplicator.DoGeneric(ent, enttable[2]) if ent.Setowning_ent then ent:Setowning_ent(ply) end ent:Spawn() ent:Activate() for k2, v2 in pairs(DarkRPEntities) do -- scan for registered darkrp entities that possible have a limit and register the one that just got spawned if v2.ent == enttable[1] then ply:addCustomEntity(v2) ent.DarkRPItem = v2 ent.allowed = v2.allowed ent.SID = ply.SID break end end end end end end hook.Add("PlayerDisconnected", "ghomes_save_entities", ghomes.dlcs.dlc1.saveentities) net.Receive("ghomes_dlc1_use_suitcase2", function(len, ply) local id = net.ReadUInt(7) local house = ghomes.list[id] if house.owner ~= ply then return end house.spawnHere = net.ReadBool() house.spawnHereFriends = net.ReadBool() house.saveEntities = net.ReadBool() local alarmrequest = net.ReadBool() if alarmrequest and not house.alarmProtected then if ply:getDarkRPVar("money") >= ghomes.alarmprice then ply:addMoney(-ghomes.alarmprice) house.alarmProtected = true end -- else cheater elseif not alarmrequest then house.alarmProtected = false end ghomes.savehouse(id) end) net.Receive("ghomes_dlc1_use_suitcase3", function(len, ply) local id = net.ReadUInt(7) local house = ghomes.list[id] if house.owner ~= ply then return end net.Start("ghomes_dlc1_use_suitcase3") net.WriteUInt(id, 7) net.WriteBool(tobool(house.spawnHere)) net.WriteBool(tobool(house.spawnHereFriends)) net.WriteBool(tobool(house.saveEntities)) net.WriteBool(tobool(house.alarmProtected)) net.Send(ply) end) hook.Add("onLockpickCompleted","ghomes_dlc_alarm", function(ply, success, ent) if not success then return end for k, v in ipairs(ghomes.list) do if table.HasValue(v.doors,ent) then v.nextAllowedSpawn = os.time() + ghomes.cooldownspawnafterrobbery if v.alarmProtected then net.Start("ghomes_dlc1_alarm_lockpicked") net.WriteUInt(k, 7) net.Broadcast() if v.owner then DarkRP.notify(v.owner, 1, 4, Format(ghomes.beingrobbed, v.name)) end end return end end end) hook.Add("PlayerDeath", "ghomes don't respawn if killed in house", function(victim, _, attacker ) if victim == attacker then return end for k, v in ipairs(ghomes.list) do if v.owner == victim and victim:IsInHouse(k) then v.nextAllowedSpawn = os.time() + ghomes.cooldownspawnafterrobbery return end end end)
-- turtlewidget.lua turtles = {} turtles[1] = turtlelib.new() Widgets["turtle"] = WidgetLib2.addRender("turtle", function (o) turtles[1]:render() end) t = turtles[1] print2(getFunction(render)) function render() WidgetLib.renderAll() --renderGreets2() --renderskythings() --trace2() end showError()
local Chara = require("core.Chara") local Map = require("core.Map") local Internal = require("core.Internal") local Item = require("core.Item") local common = require_relative("../common.lua") return { root = "core.talk.unique.tam", nodes = { __start = function() local flag = Internal.get_quest_flag("cat_house") if flag == 1000 then return "quest_completed" elseif flag == 0 then return "quest_ask" elseif flag == 1 then return "quest_waiting" elseif flag == 2 then return "quest_finish" end return "__IGNORED__" end, quest_completed = { text = { {"complete"}, }, }, quest_ask = { text = { {"quest.dialog"}, }, choices = { {"quest_yes", "quest.choices.yes"}, {"quest_no", "quest.choices.no"} }, default_choice = "quest_no" }, quest_yes = { text = { {"quest.yes"}, }, on_finish = function() Internal.set_quest_flag("cat_house", 1) Map.set_feat(23, 22, 231, 11, 3) end }, quest_no = { text = { {"quest.no"}, }, }, quest_waiting = { text = { {"quest.waiting"} } }, quest_finish = { text = { function() local item = Item.create(Chara.player().position, "core.material_kit", 0) item:change_material("core.dragon_scale") Item.create(Chara.player().position, "core.gold_piece", 25500) Item.create(Chara.player().position, "core.platinum_coin", 4) common.quest_completed() end, {"quest.end"}, }, on_finish = function() Internal.set_quest_flag("cat_house", 1000) end } } }
GROUPS_BLUE = {{1, 1}, {2, 2}, {3, 4}} GROUPS_BLUE_EARLY_ACTIVATION = {1, 2, 3} -- GROUP IDS THAT ARE GOING TO BE ACTIVATED AT SCRIPT START (FOR BLUE TEAM) GROUPS_RED = {{1, 1}, {2, 2}, {3, 4}} GROUPS_RED_EARLY_ACTIVATION = {1, 2} -- GROUP IDS THAT ARE GOING TO BE ACTIVATED AT SCRIPT START (FOR RED TEAM) randomGroups = false autoActivateNext = false msgTimer = 60 -- We specify the time that the target's asignment message will remain visible. The current target's message can be always recall via the F10 menu by selecting Target Report option. blueWinMsg = 'BLUE WON' -- Here we can Specify the Blue and Red Win messages. redWinMsg = 'RED WON' RED_OPERATIONS = {} -- ---------- LEAVE EMPTY ---------- BLUE_OPERATIONS = {} -- ---------- LEAVE EMPTY ---------- -- ------------------POINT COSTS FOR OBJECTS------------------ aircraftPoints = 1 -- How many points are going to be awarded to the team that shot down the aircraft aircraftCost = 2 -- How many points are going to be withdrewed by the team who lost the aircraft heliPoints = 1 -- How many points are going to be awarded to the team that shot down the heli heliCost = 1 -- How many points are going to be withdrewed by the team who lost the heli shipPoints = 5 -- How many points are going to be awarded to the team that destroyed the ship unitPoints = 0.3 -- How many points are going to be awarded to the team that destroyed the unit printScoreEvery = 180 -- How much time between its cycle to show message (in seconds) printScoreFor = 20 -- How much time will the message show up (in seconds) missionLength = 150 -- How many minutes until mission end BLUE_OPERATIONS[1] = { Name = {'BT_1'}, isMapObj = {false}, showMark = {false}, Briefing = "BLUE TARGET 1", Extras = {}, Points = 2 } BLUE_OPERATIONS[2] = { Name = {'BT_2A', 'BT_2B'}, isMapObj = {true, false}, showMark = {false, false}, Briefing = "BLUE TARGET 2", Extras = {'BT_2_AD', 'BT_2_DEC'}, Points = 2 } BLUE_OPERATIONS[3] = { Name = {'BT_3'}, isMapObj = {false}, showMark = {true}, Briefing = "BLUE TARGET 3", Extras = {}, Points = 2 } BLUE_OPERATIONS[4] = { Name = {'BT_4'}, isMapObj = {false}, showMark = {false}, Briefing = "BLUE TARGET 4", Extras = {}, Points = 2 } -- ************************** RED TARGET LIST ************************** RED_OPERATIONS[1] = { Name = {'RT_1A', 'RT_1B'}, isMapObj = {false, "polygon"}, showMark = {false, true}, Briefing = "RED TARGET 1", Extras = {}, Points = 2 } RED_OPERATIONS[2] = { Name = {'RT_2'}, isMapObj = {false}, showMark = {true}, Briefing = "RED TARGET 2", Extras = {}, Points = 2 } RED_OPERATIONS[3] = { Name = {'RT_3'}, isMapObj = {false}, showMark = {false}, Briefing = "RED TARGET 3", Extras = {}, Points = 2 } RED_OPERATIONS[4] = { Name = {'RT_4'}, isMapObj = {false}, showMark = {false}, Briefing = "RED TARGET 4", Extras = {}, Points = 2 }
return {'ayrton','ayrtons'}
local Grid = require 'grid' local Object = require 'base-class' local Segment = require 'segment' local U = require 'util' local function randomChoice(chances) local rnd, cur = math.random(), 0 for i,chance in ipairs(chances) do cur = cur + chance if rnd < cur then return i end end return #chances end local function normalizedChances(chances) local sum, c = 0, {} for i=1,#chances do sum = sum + chances[i] end local scale = 1 / sum for i=1,#chances do c[i] = chances[i] * scale end return c end ------------------------------------------------------------------------ local Map = Object:extend() function Map.set(self, limit, branchChance, dirChances, rooms, spawns) self.limit = limit self.branchChancePerStep = branchChance or 0 self.dirChances = normalizedChances(dirChances or {}) self.rooms = rooms or {} local roomChances = {} for i,r in ipairs(self.rooms) do roomChances[i] = r.chance end self.roomChances = normalizedChances(roomChances) self.spawns = spawns or {} end local function Walker(w, x, y, dir) return { x = x or w.x, y = y or w.y, dir = dir or w.dir, dirChances = w.dirChances, rooms = w.rooms, roomChances = w.roomChances, exits = w.exits } end local directions = { {1, 0}, {0, 1}, {-1, 0}, {0, -1} } local nineDirections = { {-1,-1}, {0,-1}, {1,-1}, {-1,0}, {0,0}, {1,0}, {-1,1}, {0,1}, {1,1} } local function rotate(dir, x, y) local fx, fy = unpack(directions[dir+1]) local rx, ry = -fy, fx return x*fx + y*rx, x*fy + y*ry end local function addFloor(self, col, row) local wasFloor = self.floor:at(col, row, true) if not wasFloor then self.floorCount = self.floorCount + 1 end end local function addRoom(self, room, walker) local floor = self.floor for _,t in ipairs(room) do local tx, ty = rotate(walker.dir, unpack(t)) addFloor(self, walker.x + tx, walker.y + ty) end end local function addRandomRoom(self, walker) local room = walker.rooms[randomChoice(walker.roomChances)] addRoom(self, room, walker) walker.exits = room.exits end local function exitRandomly(walker) local turn = randomChoice(walker.dirChances) - 1 local oldDir = walker.dir if walker.absoluteDirections then walker.dir = turn else walker.dir = (walker.dir + turn) % 4 end -- Choose exit in the new direction. local exit = walker.exits[(walker.dir - oldDir) % 4 + 1] -- But the room was oriented in the old direction. local ex, ey = rotate(oldDir, unpack(exit)) walker.x, walker.y = walker.x + ex, walker.y + ey end local function stepWalkers(self) local branch = false if math.random() < self.branchChancePerStep then branch = self.walkers[math.random(#self.walkers)] end for _,w in ipairs(self.walkers) do addRandomRoom(self, w) if w == branch then table.insert(self.walkers, Walker(w)) end exitRandomly(w) end end function generateWalls(self, tilemap) tilemap:reset() self.floor:foreach(function(floor, col, row) for _,dir in ipairs(nineDirections) do local x, y = unpack(dir) x, y = col + x, row + y if not (self.floor:at(x, y) or tilemap:at(x, y)) then tilemap:at(x, y, tilemap:random()) end end end) end local function generateSpawns(self, tilemap) local spawns = {} for _,spawn in ipairs(self.spawns) do for i=1,spawn[1] do table.insert(spawns, {unpack(spawn, 2)}) end end U.shuffle(spawns) local env = getfenv(0) for _,spawn in ipairs(spawns) do local Spawn, r, dest = unpack(spawn) local x, y = tilemap:randomFloor(r) if x then local obj = Spawn(x, y) if env[dest] then table.insert(env[dest], obj) else env[dest] = obj end end end end function Map.generate(self, wallTilemap, col, row) local unit = wallTilemap.unit col, row = col or 0, row or 0 local x, y = col * unit, row * unit self.walkers = {Walker(self, col, row, 0)} self.floor = Grid(unit) self.floorCount = 0 if self.limit > 0 then for dCol = -1,1 do for dRow = -1,1 do addFloor(self, col + dCol, row + dRow) end end end while(self.floorCount < self.limit) do stepWalkers(self) end generateWalls(self, wallTilemap) local tiles = {} self.floor:foreach(function(_, col, row) local x, y = self.floor:toPixel(col, row) table.insert(tiles, {x, y}) end) wallTilemap.floors = tiles wallTilemap:removeNear(x, y, 5) local rx, ry = wallTilemap:farthestFloor(x, y) if rx then table.insert(rescues, Segment(rx, ry)) end generateSpawns(self, wallTilemap) self.walkers = nil self.floor = nil end return Map
pg = pg or {} pg.enemy_data_statistics_247 = { [13100312] = { cannon = 0, battle_unit_type = 35, rarity = 1, speed_growth = 0, pilot_ai_template_id = 20001, air = 0, luck = 0, dodge = 0, wave_fx = "danchuanlanghuaxiao2", cannon_growth = 0, speed = 15, reload_growth = 0, dodge_growth = 0, id = 13100312, star = 1, hit = 8, antisub_growth = 0, air_growth = 0, reload = 150, base = 70, durability = 280, armor_growth = 0, torpedo_growth = 864, luck_growth = 0, hit_growth = 120, armor = 0, torpedo = 70, durability_growth = 2550, antisub = 0, antiaircraft = 0, antiaircraft_growth = 0, appear_fx = { "appearsmall" }, equipment_list = { 1000862 } }, [13100313] = { cannon = 60, battle_unit_type = 15, rarity = 1, speed_growth = 0, pilot_ai_template_id = 80000, air = 0, luck = 0, dodge = 0, cannon_growth = 0, speed = 30, reload = 150, reload_growth = 0, dodge_growth = 0, id = 13100313, star = 1, hit = 81, antisub_growth = 0, air_growth = 0, torpedo = 120, base = 422, durability = 80, armor_growth = 0, torpedo_growth = 900, luck_growth = 0, hit_growth = 1200, armor = 0, durability_growth = 2550, antiaircraft = 0, antisub = 0, antiaircraft_growth = 0, specific_fx_scale = { dianliu_DD = 1.5 }, appear_fx = { "appearsmall", "dianliu_DD" }, equipment_list = { 1000867 } }, [13100314] = { cannon = 22, reload = 150, speed_growth = 0, cannon_growth = 626, rarity = 4, air = 0, torpedo = 94, dodge = 22, durability_growth = 21600, antiaircraft = 72, luck = 0, reload_growth = 0, dodge_growth = 360, hit_growth = 280, star = 4, hit = 25, antisub_growth = 0, air_growth = 0, battle_unit_type = 50, base = 273, durability = 3060, armor_growth = 0, torpedo_growth = 5200, luck_growth = 0, speed = 36, armor = 0, id = 13100314, antiaircraft_growth = 3000, antisub = 0, equipment_list = { 1001103, 1001108, 1001113 } }, [13100315] = { cannon = 38, reload = 150, speed_growth = 0, cannon_growth = 936, rarity = 4, air = 0, torpedo = 76, dodge = 11, durability_growth = 30400, antiaircraft = 156, luck = 0, reload_growth = 0, dodge_growth = 162, hit_growth = 210, star = 4, hit = 14, antisub_growth = 0, air_growth = 0, battle_unit_type = 55, base = 274, durability = 3570, armor_growth = 0, torpedo_growth = 3366, luck_growth = 0, speed = 25, armor = 0, id = 13100315, antiaircraft_growth = 3744, antisub = 0, equipment_list = { 1001118, 1001123, 1001128, 1001133 } }, [13100316] = { cannon = 54, reload = 150, speed_growth = 0, cannon_growth = 1500, rarity = 4, air = 0, torpedo = 58, dodge = 11, durability_growth = 41600, antiaircraft = 88, luck = 0, reload_growth = 0, dodge_growth = 136, hit_growth = 280, star = 4, hit = 25, antisub_growth = 0, air_growth = 0, battle_unit_type = 60, base = 275, durability = 4420, armor_growth = 0, torpedo_growth = 2800, luck_growth = 0, speed = 18, armor = 0, id = 13100316, antiaircraft_growth = 3380, antisub = 0, equipment_list = { 1001138, 1001143, 1001148, 1001153 } }, [13100317] = { cannon = 78, reload = 150, speed_growth = 0, cannon_growth = 3400, rarity = 3, air = 0, torpedo = 0, dodge = 11, durability_growth = 65600, antiaircraft = 106, luck = 0, reload_growth = 0, dodge_growth = 136, hit_growth = 280, star = 4, hit = 25, antisub_growth = 0, air_growth = 0, battle_unit_type = 65, base = 276, durability = 6630, armor_growth = 0, torpedo_growth = 0, luck_growth = 0, speed = 14, armor = 0, id = 13100317, antiaircraft_growth = 4680, antisub = 0, equipment_list = { 1001158, 1001163, 1001168, 1001173 }, buff_list = { { ID = 50510, LV = 3 } } }, [13100318] = { cannon = 36, reload = 150, speed_growth = 0, cannon_growth = 0, rarity = 3, air = 86, torpedo = 0, dodge = 9, durability_growth = 58880, antiaircraft = 134, luck = 0, reload_growth = 0, dodge_growth = 96, hit_growth = 280, star = 4, hit = 25, antisub_growth = 0, air_growth = 4127, battle_unit_type = 70, base = 277, durability = 5780, armor_growth = 0, torpedo_growth = 0, luck_growth = 0, speed = 16, armor = 0, id = 13100318, antiaircraft_growth = 5280, antisub = 0, equipment_list = { 1001178, 1001183, 1001188, 1001193 } }, [13100319] = { cannon = 45, reload = 150, speed_growth = 0, cannon_growth = 640, rarity = 4, air = 0, torpedo = 135, dodge = 28, durability_growth = 23600, antiaircraft = 125, luck = 0, reload_growth = 0, dodge_growth = 450, hit_growth = 350, star = 4, hit = 30, antisub_growth = 0, air_growth = 0, battle_unit_type = 50, base = 423, durability = 4340, armor_growth = 0, torpedo_growth = 5200, luck_growth = 0, speed = 36, armor = 0, id = 13100319, antiaircraft_growth = 3000, antisub = 0, equipment_list = { 1002103, 1002108, 1002113 } }, [13100320] = { cannon = 74, reload = 150, speed_growth = 0, cannon_growth = 936, rarity = 4, air = 0, torpedo = 112, dodge = 11, durability_growth = 33600, antiaircraft = 255, luck = 0, reload_growth = 0, dodge_growth = 162, hit_growth = 210, star = 4, hit = 14, antisub_growth = 0, air_growth = 0, battle_unit_type = 55, base = 424, durability = 5270, armor_growth = 0, torpedo_growth = 3366, luck_growth = 0, speed = 24, armor = 0, id = 13100320, antiaircraft_growth = 3744, antisub = 0, equipment_list = { 1002118, 1002123, 1002128, 1002133 } }, [13100321] = { cannon = 102, reload = 150, speed_growth = 0, cannon_growth = 1750, rarity = 4, air = 0, torpedo = 84, dodge = 17, durability_growth = 43200, antiaircraft = 192, luck = 0, reload_growth = 0, dodge_growth = 170, hit_growth = 350, star = 4, hit = 30, antisub_growth = 0, air_growth = 0, battle_unit_type = 60, base = 425, durability = 6040, armor_growth = 0, torpedo_growth = 3200, luck_growth = 0, speed = 18, armor = 0, id = 13100321, antiaircraft_growth = 3880, antisub = 0, equipment_list = { 1002138, 1002143, 1002148, 1002153 } }, [13100322] = { cannon = 120, reload = 150, speed_growth = 0, cannon_growth = 3600, rarity = 3, air = 0, torpedo = 0, dodge = 17, durability_growth = 68000, antiaircraft = 212, luck = 0, reload_growth = 0, dodge_growth = 170, hit_growth = 350, star = 4, hit = 30, antisub_growth = 0, air_growth = 0, battle_unit_type = 65, base = 426, durability = 9010, armor_growth = 0, torpedo_growth = 0, luck_growth = 0, speed = 14, armor = 0, id = 13100322, antiaircraft_growth = 4680, antisub = 0, equipment_list = { 1002158, 1002163, 1002168, 1002173 }, buff_list = { { ID = 50510, LV = 3 } } }, [13100323] = { cannon = 86, reload = 150, speed_growth = 0, cannon_growth = 0, rarity = 3, air = 145, torpedo = 0, dodge = 15, durability_growth = 59600, antiaircraft = 230, luck = 0, reload_growth = 0, dodge_growth = 120, hit_growth = 350, star = 4, hit = 30, antisub_growth = 0, air_growth = 4500, battle_unit_type = 70, base = 427, durability = 7820, armor_growth = 0, torpedo_growth = 0, luck_growth = 0, speed = 16, armor = 0, id = 13100323, antiaircraft_growth = 5280, antisub = 0, equipment_list = { 1002178, 1002183, 1002188, 1002193 } }, [13100324] = { cannon = 80, reload = 150, speed_growth = 0, cannon_growth = 1600, rarity = 3, air = 0, torpedo = 125, dodge = 14, durability_growth = 193600, antiaircraft = 200, luck = 15, reload_growth = 0, dodge_growth = 198, hit_growth = 210, star = 4, hit = 16, antisub_growth = 0, air_growth = 0, battle_unit_type = 90, base = 274, durability = 9220, armor_growth = 0, torpedo_growth = 2000, luck_growth = 0, speed = 20, armor = 0, id = 13100324, antiaircraft_growth = 3600, antisub = 0, equipment_list = { 1000682, 1000687, 1000692, 1000697, 1000702, 1000707 } }, [13100325] = { cannon = 94, reload = 150, speed_growth = 0, cannon_growth = 1700, rarity = 3, air = 0, torpedo = 75, dodge = 12, durability_growth = 228800, antiaircraft = 155, luck = 15, reload_growth = 0, dodge_growth = 170, hit_growth = 210, star = 4, hit = 16, antisub_growth = 0, air_growth = 0, battle_unit_type = 90, base = 275, durability = 11030, armor_growth = 0, torpedo_growth = 1500, luck_growth = 0, speed = 20, armor = 0, id = 13100325, antiaircraft_growth = 3200, antisub = 0, equipment_list = { 1000742, 1000747, 1000752, 1000757, 1000762, 1000767, 1000772 } }, [13100326] = { cannon = 140, reload = 150, speed_growth = 0, cannon_growth = 2500, rarity = 3, air = 0, torpedo = 0, dodge = 11, durability_growth = 326400, antiaircraft = 175, luck = 15, reload_growth = 0, dodge_growth = 156, hit_growth = 210, star = 4, hit = 16, antisub_growth = 0, air_growth = 0, battle_unit_type = 90, base = 276, durability = 16730, armor_growth = 0, torpedo_growth = 0, luck_growth = 0, speed = 20, armor = 0, id = 13100326, antiaircraft_growth = 3600, antisub = 0, equipment_list = { 1000777, 1000782, 1000787, 1000792, 1000797 }, buff_list = { { ID = 50500, LV = 3 } } }, [13100327] = { cannon = 80, reload = 150, speed_growth = 0, cannon_growth = 1600, rarity = 3, air = 0, torpedo = 125, dodge = 14, durability_growth = 211200, antiaircraft = 200, luck = 15, reload_growth = 0, dodge_growth = 198, hit_growth = 210, star = 4, hit = 16, antisub_growth = 0, air_growth = 0, battle_unit_type = 90, base = 274, durability = 10060, armor_growth = 0, torpedo_growth = 2000, luck_growth = 0, speed = 20, armor = 0, id = 13100327, antiaircraft_growth = 3600, antisub = 0, equipment_list = { 1000682, 1000687, 1000692, 1000697, 1000702, 1000707 } } } return
class_C("PathTrackerFactory").getPathTrackerByConfig = function (slot0, slot1, slot2) if slot1.type == ClassLoader:aquireClass("GameConfig").PathType.LINE then return ClassLoader:aquireInstance("PathTrackerLine", slot1, slot2) elseif slot1.type == slot3.PathType.BEZIER then return ClassLoader:aquireInstance("PathTrackerCubicBezier", slot1, slot2) elseif slot1.type == slot3.PathType.CIRCLE then return ClassLoader:aquireInstance("PathTrackerCircle", slot1, slot2) elseif slot1.type == slot3.PathType.DELAY then return ClassLoader:aquireInstance("PathTrackerDelay", slot1, slot2) elseif slot1.type == slot3.PathType.SPIRAL then return ClassLoader:aquireInstance("PathTrackerSpiral", slot1, slot2) end end return class_C("PathTrackerFactory")
local tables = require("__flib__/table") local function is_supported(plugin, search) for _, v in pairs(plugin.requires) do if not search.provides[v] then return false end end return true end return function(plugins_table) return { enabled_plugins = function(search) return tables.filter(plugins_table, function(value) return is_supported(value, search) end) end, is_supported = is_supported, is_supported_key = function(plugin_id, search) return is_supported(plugins_table[plugin_id], search) end } end
ys = ys or {} slot1 = class("AutoPilotHiveRelativeStay", ys.Battle.IPilot) ys.Battle.AutoPilotHiveRelativeStay = slot1 slot1.__name = "AutoPilotHiveRelativeStay" slot1.Ctor = function (slot0, ...) slot0.super.Ctor(slot0, ...) end slot1.SetParameter = function (slot0, slot1, slot2) slot0.super.SetParameter(slot0, slot1, slot2) slot0._distX = slot1.x slot0._distZ = slot1.z end slot1.GetDirection = function (slot0, slot1) if not slot0._pilot:GetHiveUnit():IsAlive() then slot0._pilot:OnHiveUnitDead() return Vector3.zero end slot5 = Vector3(slot2:GetPosition().x + slot0._distX, slot1.y, slot2.GetPosition().z + slot0._distZ) - slot1 if slot0:IsExpired() then slot0:Finish() end if slot5.magnitude < 0.4 then return Vector3.zero else slot5.y = 0 return slot5:SetNormalize() end end return
require("iupcdaux") -- utility module used in some samples dlg = iupcdaux.new_dialog(w, h) cnv = dlg[1] -- retrieve the IUP canvas function DrawText(canvas, x, y, text, align) canvas:TextAlignment(align) canvas:Mark(x, y) canvas:Text(x, y, text) xmin, xmax, ymin, ymax = canvas:GetTextBox(x, y, text) canvas:Rect(xmin, xmax, ymin, ymax) end text_aligment = { cd.NORTH, cd.SOUTH, cd.EAST, cd.WEST, cd.NORTH_EAST, cd.NORTH_WEST, cd.SOUTH_EAST, cd.SOUTH_WEST, cd.CENTER, cd.BASE_LEFT, cd.BASE_CENTER, cd.BASE_RIGHT } text_aligment_str = { "NORTH", "SOUTH", "EAST", "WEST", "NORTH EAST", "NORTH WEST", "SOUTH EAST", "SOUTH WEST", "CENTER", "BASE LEFT", "BASE CENTER", "BASE RIGHT" } -- custom function used in action callback -- from the iupcdaux module function cnv:Draw(canvas) canvas:MarkSize(40) canvas:Font("Courier", cd.PLAIN, 12) i = 1 while (i <= 12) do DrawText(canvas, 100, 35*i + 30, text_aligment_str[i], text_aligment[i]) i = i + 1 end end --tmpCanvas = cd.CreateCanvas(cd.PS, "cdalign.ps") --tmpCanvas:Clear() --cnv:Draw(tmpCanvas) --tmpCanvas:Kill() dlg:show() iup.MainLoop()
TOOL.Category = "C_GM13B_GUI_DEV" TOOL.Name = "#Tool.spawn_companion_doll.name" TOOL.Command = nil TOOL.ConfigName = "" TOOL.Information = { { name = "left" }, } if CLIENT then language.Add("Tool.spawn_companion_doll.name", "Spawn the companion doll") language.Add("Tool.spawn_companion_doll.desc", "Spawns the companion doll") language.Add("Tool.spawn_companion_doll.left", "Spawn obj") end local function spawn_companion_doll(pos) if SERVER then local pos2 = Vector(math.Round(pos.x, 2), math.Round(pos.y, 2), math.Round(pos.z, 2)) local convertedProp = ents.Create("prop_physics") convertedProp:SetName("converted_prop_gm13_" .. "models/maxofs2d/companion_doll.mdl") convertedProp:SetNWBool("ritualprop", true) convertedProp:SetModel("models/maxofs2d/companion_doll.mdl") convertedProp:SetPos(pos2 + Vector(0,0,10)) convertedProp:SetAngles(Angle(0,0,0)) convertedProp.gm13_final_pos = Vector(2284.38, 3557.02, -85.69) convertedProp:Spawn() convertedProp:PhysicsInit(SOLID_VPHYSICS) convertedProp:SetMoveType(MOVETYPE_VPHYSICS) convertedProp:SetSolid(SOLID_VPHYSICS) local physObj = convertedProp:GetPhysicsObject() if IsValid(physObj) then physObj:Wake() end GM13.Ent:SetInvulnerable(convertedProp, true) GM13.Ent:BlockToolgun(convertedProp, true) GM13.Ent:BlockContextMenu(convertedProp, true) end end function TOOL:LeftClick(trace) spawn_companion_doll(trace.HitPos) return true end function TOOL.BuildCPanel(pnl) pnl:AddControl("Header",{Text = "#Tool.spawn_companion_doll.name", Description = "#Tool.spawn_companion_doll.desc"}) end
local concord = require("lib.concord") return concord.component( function(e, topping, stairsDown) e.topping = topping e.stairsDown = stairsDown end )
local timer_seconds = THEME:GetMetric(Var "LoadingScreen","TimerSeconds"); local t = Def.ActorFrame {}; -- Fade t[#t+1] = Def.ActorFrame { InitCommand=cmd(Center); Def.Quad { InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); OnCommand=cmd(diffuse,Color.Black;diffusealpha,0;linear,0.5;diffusealpha,0.25; sleep,timer_seconds/2; linear,timer_seconds/2-0.5;diffusealpha,1); }; -- Warning Fade Def.Quad { InitCommand=cmd(y,16;scaletoclipped,SCREEN_WIDTH,148); OnCommand=cmd(diffuse,Color.Black;diffusealpha,0.5; linear,timer_seconds;zoomtoheight,148*0.75); } }; -- t[#t+1] = Def.ActorFrame { InitCommand=cmd(Center;y,SCREEN_CENTER_Y-24); -- Underline Def.Quad { InitCommand=cmd(y,16;zoomto,256,1); OnCommand=cmd(diffuse,color("#ffd400");shadowlength,1;shadowcolor,BoostColor(color("#ffd40077"),0.25);linear,0.25;zoomtowidth,256;fadeleft,0.25;faderight,0.25); }; LoadFont("Common Bold") .. { Text="Continue?"; OnCommand=cmd(skewx,-0.125;diffuse,color("#ffd400");shadowlength,2;shadowcolor,BoostColor(color("#ffd40077"),0.25)); }; }; -- return t
------------------------------------------------------------------------- -- ConsolePort Russian translate by Demorto (Demorto#2660) Version 1.8.1 -- ------------------------------------------------------------------------- if not (GetLocale() == "ruRU") then return end local _, db = ... db.TUTORIAL = { BIND = { HEADER = 'Управление', SIDEBAR = 'Кнопки', MENUHEADER = 'Геймпад', TOOLTIPHEADER = 'Комбинации', TOOLTIPCLICK = '<Нажать для изменения>', PROFILEPRESET = ' профиль', DEFAULT = 'Нажми сюда, что бы изменить назначение кнопок.', CATCHER = 'Нажми кнопку на своем геймпаде.', COMBO = '|T%s:20:20:0:0|tЛевый клик: изменить или добавить\n|T%s:20:20:0:0|tПравый клик: очистить назначение', SWAPPER = 'Нажмите на комбинацию кнопок или сначала назначьте кнопки.', IMPORT = 'Назначения кнопок были импортированы из %s.', IMPORTADV = 'Импортировать профиль из внешнего источника.', IMPORTADVEXT = 'Новые назначение кнопок были импортированы.', IMPORTINVALID = 'Ошибка: Не правильные данные назначения кнопок.\nВы можете импортировать произвольные пофили во вкладке "Дополнительно".', EXPORTADV = 'Экспортирование назначений кнопок для %s.', EXPORTADVCURRENT = 'Экспортировать ваши текущие назначения кнопок.', RESET = 'Загружены настройки по умолчанию.', IMPORTBUTTON = 'Импорт', IMPORTEXPORT = 'Импорт / Экспорт', REMOVEBUTTON = 'Очистить', MAINCATEGORY = ' |cFFFF6600Геймпад|r ', NOTASSIGNED = '|cFF575757Не назначена|r', SPELL = 'Заклинание', ITEM = 'Предмет', MOUNT = 'Транспорт', CRITTER = 'Питомец', MACRO = '|cFF575757 (Макрос)', EQSET = '|cFF575757 (Комплект экипировки)|r', BATTLEPET = '|cFF575757 (Питомец)|r', LEFTCLICK = '|cFF757575Левый клик / Передвижение|r', RIGHTCLICK = '|cFF757575Правый клик / Мышь|r', SHIFT = '|cFF757575Модификатор 1 / Shift|r', CTRL = '|cFF757575Модификатор 2 / Ctrl|r', T1 = 'Триггер 1', T2 = 'Триггер 2', T3 = 'Триггер 3', T4 = 'Триггер 4', }, MOUSE = { STARTED_MOVING = 'движении', TARGET_CHANGED = 'смене цели', DIRECT_SPELL_CAST = 'применении заклинания', NPC_INTERACTION = 'взаимодействии с NPC', QUEST_AUTOCOMPLETE = 'появлении квестового окна', LOOTING = 'подборе добычи', JUMPING = 'прыжке', CENTERCURSOR = 'достижении курсором центра экрана', }, UICTRL = { VIRTUALCURSOR = 'Виртуальный курсор |cFF757575- назначить команды кнопкам мыши|r', ACTIONBARHEADER = 'Вид горячих клавиш |cFF757575- только для стандартных панелей|r', HEADER = 'Интерфейс', SIDEBAR = 'Интерфейс', ADDONLISTHEADER = 'Аддоны:', FRAMELISTHEADER = 'Фреймы:', FRAMELISTFORMAT = 'Фреймы в |cffffe00a%s|r:', NEWFRAME = 'Добавить фрейм вручную', MOUSEOVERVALID = 'Добавить |cffffffff%s|r в |cffffaaaa%s|r', MOUSEOVERINVALID = 'Добавить фрейм под мышью', TUTORIALFRAME = 'Тут можно добавить поддержку виртуального курсора\nлюбому аддону или фрейму.', TUTORIALFRAMEMO = 'Наведите на фрейм\nдля регистрации его имени.', HIDEFRAMELIST = 'Вернуться к настройкам интерфейса', ADDADDON = 'Введите имя аддона или модуля:', ADDFRAME = 'Введите имя фрейма для добавления его в аддон |cffffe00a%s|r:', REMOVEADDON = 'Вы хотите удалить поддержку виртуальным курсором аддона |cffffe00a%s|r?', REMOVEFRAME = 'Вы хотите удалить поддержку виртуальным курсором фрейма |cffffe00a%s|r из аддона |cffffe00a%s|r?', ADD = 'Добавить', CANCEL = 'отменить', REMOVE = 'Удалить', SHOWALLADDONS = 'Показать все аддоны и фреймы', ENABLECURSOR = 'Включить виртуальный курсор', }, CONFIG = { GENERALHEADER = 'Общие настройки', CONTROLLERBUTTON = 'Геймпад', IBFULLHEADER = 'Взаимодействия (полное)', IBLITEHEADER = 'Взаимодействия (частичное)', TARGETAIHEADER = 'Умное взаимодействие', MOUSEHEADER = 'Спрятать курсор при...', TRIGGERHEADER = 'Настройки триггера', CAMERAHEADER = 'Настройка камеры', TARGETHEADER = 'Выделить следующую цель', ----------------------------------------------------------- INTERACT_HELPFUL = '|cff75ff75союзники|r', INTERACT_HARMFUL = '|cffff7575противники|r', INTERACT_NOTARGET = '|cffffffffнет цели|r', INTERACT_TARGET = '|cffffffffлюбая цель|r', INTERACT_ORIGINAL = 'Исходное действие: |cffffffff%s|r\n%s', INTERACT_CURRENT_A = 'Расчетное поведение:\nВзаимодействие: %s\nСтандартное действие: %s', INTERACT_CURRENT_B = 'Расчетное поведение:\nВзаимодействие: %s или %s\nСтандартное действие: %s', ----------------------------------------------------------- INTERACTCATCHER = 'Нажмите здесь, чтобы назначить.', INTERACTASSIGNED = '|T%s:50:50:0:0|t', INTERACTASSIGNED_B = '|T%s:40:40:0:0|t', INTERACTCHECK = 'Включить', IBFULLDESC = 'Если нет эффекта от использования,\nто кнопка начинает взаимодействовать\nс существами.\n\nКурсор используется для\nвзаимодействия с обьектами.', IBLITEDESC = 'Позволяет одной из кнопок взаимодействовать\nс поверженными противниками и дружескими NPC\nвне боя.\n\nКурсор не используется.', MOUSEOVERMODE = 'Взаимодействовать с указателем мыши', INTERACTNPC = 'Взаимодействие с NPC', INTERACTCACHE = 'Включить умное взаимодействие', INTERACTSCRAPE = 'Включить индикаторы NPC', INTERACTNAMEONLY = 'Показывать только имя', ----------------------------------------------------------- TRIGGERHELP = 'Эти настройки изменят отображение подсказок для ваших триггеров и модификаторов.\nИзмененить модификаторы можно в вашей програме настройки геймпада (WoWmapper, Steam, и тд).', IBFULLHELP = 'Использование одной из кнопок для взаимодействия с обьектами и существами.\nЕсли нет цели к которой можно применить действие привязанное к кнопке, то она начнет взаимодействовать с миром.\n\nНапример:\n|cffff7575Вредоносное|r заклинание будет наложено на враждебную цель, но во всех других случаях кнопка будет взаимодействовать с миром.\n|cff75ff75Целительное|r заклинание будет применено к дружественной цели, но в других условиях кнопка будет взаимодействовать.\nМакрос требует наличие цели, но взаимодействует в других случаях.', IBLITEHELP = 'Использование одной из кнопок для сбора добычи с последней цели, если вы находитесь рядом.\nКнопка которую вы назначите тут будет использована для сбора добычи только если...\n • вы вне боя или уже выбрали существо,\n • существо является вашей последней целью,\n • у существа есть ваша добыча.\n\nОпция с полным взаимодействием так же включает эту функцию.', TARGETAIHELP = 'Умное взаимодействие: Запоминает NPC с которыми вы контактируете и взаимодействует с ними.\n\nС включенными индикаторами NPC: Позволяет вам все время взаимодействовать со всеми NPC.\n\nТолько имя: Скрывает полоски жизни у дружеских целей, но показывает у враждебных во время боя.', HIGHLIGHTHELP = 'Предпросмотр следующей цели перед тем, как переключиться на нее.\nЕсли вам необходимо надежное переключение цели, то установите |cff75ff75Всегда ключено|r.', IBFULLREC = '|TInterface\\Buttons\\AdventureGuideMicrobuttonAlert:32:32:-4:0|t|cFFFFFFFFРекомендуемые настройки:|r\n Для лучшего поведения,\n выберите кнопку\n с вредоносным заклинанием\n которое применяется к цели.', HIGHLIGHTHELP = 'Предварительный просмотр вашей следующей цели.\nЕсли вам нужен точный выбор цели, установите значение |cff75ff75Всегда включен|r.', ----------------------------------------------------------- MOUSEHANDLE = 'Управление', MOUSEDRIFTING = 'взаимодействии с краем экрана', TURNMOVE = 'Поворот вокруг себя когда отображается курсор', DOUBLEMODTAP = 'Двойное нажатие|T%s:32:32:0:0|tили|T%s:32:32:0:0|t переключает курсор', LOOKAROUND = 'Зажать |T%s:32:32:0:0|t для вращения камеры', DISABLEMOUSE = 'Отключить автоматическое поведение мыши', INVERTPITCH = 'Инвертировать движение камеры', TARGETING = 'Выбор цели', RAIDCURSORDIRECT = 'Выбирать цель рейд-курсором', TARGETALGORITHM = 'Использовать новый алготитм выбора цели', CONVENIENCE = 'Удобные функции', AUTOEXTRA = 'Добавление квестовых вещей в круговую панель', AUTOLOOT = 'Автоматический сбор добычи в бою', AUTOSELL = 'Автоматическая продажа хлама', DISABLEBINDHELP = 'Отключить помощь при размещении способностей', FIXES = 'Разные исправления', DISABLEHOLDREPEAT = 'Отключить перемещение по зажатию', SKIPCALIBRATION = 'Пропускать калибровку', ----------------------------------------------------------- CONTROLLER = 'Сменить геймпад', BINDRESET = 'Настроить геймпад', FULLRESET = 'Сбросить все настройки', CONFIRMRESET = 'Вы уверены?', SHOWSLASH = 'Команды', ----------------------------------------------------------- TARGETSCAN = 'При сканировании (по умолчанию)', TARGETNONE = 'Когда цель не существует', TARGETALWAYS = 'Всегда включено', ----------------------------------------------------------- SAVE = 'Сохранить настройки', APPLY = 'Применить', CANCEL = 'Отмена', DEFAULT = 'По умолчанию', DEFAULTHEADER = 'Сбросить настройки', DEFAULTTHIS = 'Сбросить настройки', DEFAULTALL = 'Сбросить все настройки', ----------------------------------------------------------- FASTCAM = 'Быстрое приближение и отдаление', DYNPITCH = 'Динамическая камера', TARGETFOCUS = 'Сфокусироваться на враждебной цели', TARGETFOCUSNPC = 'Сфокусироваться на цели', TARGETYAW = 'Вращение при нацеливании заклинания', OVERSHOULDER = 'Камера над плечом', LEFT = 'Слева', RIGHT = 'Справа', ----------------------------------------------------------- LINK_WM = 'WoWmapper на GitHub', LINK_CP = 'Сайт аддона ConsolePort', LINK_DISCORD = 'Канал Discord', LINK_PATREON = 'Страница Patreon', }, HINTS = { DISABLE = 'Отключить подсказки на экране', UTILITY_RING_BIND = 'Зажать %s для открытия круговой панели.', UTILITY_RING_DOUBLE = 'Нажать %s дважды для переключения круговой панели.', UTILITY_RING_REMOVE = 'Нажать %s для удаления выбранного предмета.', UTILITY_RING_NEWBIND = '%s был добавлен на вашу круговую панель%s', HELPER_ACTIONBAR = 'Нажмите комбинацию кнопок\nдля добавления этого на вашу панель команд.', HELPER_EQUIP_BAG = 'Нажмите на слот ниже, чтобы одеть эту сумку.', HELPER_INVALID_OCCUA = '%s занята %s.\nСначала вам нужно привязать эту комбинацию к панели команд.', HELPER_INVALID_OCCUB = '%s занята.\nСначала вам нужно привязать эту комбинацию к панели команд.', HELPER_INVALID_FREE = '%s ни с чем не связан.\nСначала вам нужно привязать эту комбинацию к панели команд.', HELPER_INVALID_ERROR = '%s не привязана ни к чему.\nСначала привяжите эту комбинацию к панели действий.', }, SETUP = { LAYOUT = 'Настройка: Выберите тип геймпада', HEADER = 'Настройка: Настройте геймпад', CONTINUECLICK = 'Нажмите сюда, что бы продолжить', LOADWOWMAPPER = 'Я использую WoWmapper', SKIPGUIDE = 'Пропустить эту кнопку', HEADLINE = 'Настройка геймпада не закончена.\nНажмите запрошенную кнопку на геймпаде.\nНе используйте клавиши клавиатуры при настройке.', OVERRIDE = '|cFFFF6600%s|r привязана к |cFFFF6600%s|r на клавиатуре.\n|cFF757575Связь кнопок будет востановлена при отключении ConsolePort.|r\nНажмите |T%s:20:20:0:0|t что бы продолжить.', OVERRIDE_C = '|cFFFF6600%s|r уже настроена для |cFFFF6600%s|r\nНажмите |T%s:20:20:0:0|t что бы продолжить.', NOEXISTFIX = 'что-то еще', NEWMODIFIER = 'Вы сменили модификатор.\nИнтерфейс необходимо перезагрузить, чтобы продолжить.', RESERVED = 'Это назначение (%s) привязано к %s.\nВам не надо настраивать стики геймпада.', INVALID = 'Неверное назначение.\nВы нажимали правильную кнопку?', COMBAT = 'Вы в бою!', EMPTY = '<Пусто>', SUCCESS = '|T%s:16:16:0:0|t удачно привязана к %s.', CONTINUE = 'Нажмите |T%s:20:20:0:0|t еще раз, что бы продолжить.', CONFIRM = 'Нажмите |T%s:20:20:0:0|t еще раз, что бы подтвердить.', CONTROLLER = 'Выберите нужный набор, нажав кнопку геймпада.', CALIB_SKIP_WARNING = '|cFFFF1111ПРЕДУПРЕЖДЕНИЕ:|r Если вы пропустите этот процесс, ваш контроллер не будет функционировать должным образом.\nВы можете открыть мастер настройки используя команду: |cFFFFFFFF/cp recalibrate|r', WTFTEXT = 'Что это?', AHATEXT = '|cFF888888World of Warcraft изначально не поддерживает геймпад. \nЧтобы решить эту проблему, контроллер должен эмулировать ввод мыши и клавиатуры.|r\n\n%s', DISCLAIMER = 'Приминение програм для настройки геймпада является законным и не нарушает условий использования.', NOINSTRUCTIONS = 'Для этого геймпада пока нет инструкций для использования.', }, SLASH = { ACCEPT = 'Да (Рекомендовано)', ALLOW = 'Всегда разрешать', CANCEL = 'Отмена', ----------------------------------------------------------- COMBAT = 'Ошибка! Нельзя сбросить настройки в бою!', CVAR_APPLIED = 'Новое значение применили к: |cffffe00a%s|r > %s\nИзменения вступят в силу после перезагрузки интерфейса (|cffffe00a/reload|r).', CVAR_PRINTOUT = 'Текущее значение для |cffffe00a%s|r это:\n%s', CVAR_MISMATCH = 'Ошибка! Несоответствие типов в переменной |cffffe00a%s|r.\nДолжен быть тип: |cffffe00a%s|r', CVAR_NOEXISTS = 'Ошибка! Переменная |cffffe00a%s|r не зарегистрирована.\nВведите |cffffe00a/cp cvar|r что бы увидеть весь список.', CVAR_PRINTING = 'Список cvars...', CVAR_WARNING = '|cFFFF1111ПРЕДУПРЕЖДЕНИЕ:|r Редактирование переменных может привести к ошибкам. Действуйте с осторожностью!', CVAR_WARNING_NULL = '|cFFFF1111ПРЕДУПРЕЖДЕНИЕ:|r Переменная настроек была обнулена.\nЕсли появились ошибки верните все как было и перезагрузите интерфейс (|cffffe00a/reload|r).', ACTIONBAR_SHOW = 'Изменить панель команд геймпада', ACTIONBAR_NOEXISTS = 'Для этой команды ConsolePortBar должен быть включен.', TYPE = '|cffffe00a(ID)|r Изменить тип геймпада', DEBUG_HEADER = 'Отладочная информация:', DEBUG_OUTPUT = 'Отладочная информация | |cffffe00a/cp debug discord|r для отправки в |cffffe00a#support|r канал', CONFIG = 'Открыть панель настроек', RECALIBRATE = 'Перенастроить геймпад', CALIBRATE = 'Перенастройка', RESET = 'Полный сброс настроек аддона (необратимо)', BINDS = 'Открыть меню назначений кнопок', EDITBINDS = 'Редактировать назначения', CVARLIST = '(Расширенный) Список переменных', CONFIG_COMBAT = 'Конфигурация вашего геймпада будет показана при выходе из боя.', ----------------------------------------------------------- WARNINGBINDINGUI = '|cffffe00a[ConsolePort]|r\n|cFFFF1111ПРЕДУПРЕЖДЕНИЕ:|r Вы можете настраивать назначение клавиш клавиатуры только с этой панели.\n\nИзменение назначений клавиш клавиатуры при использовании вашего геймпада не рекомендуется.\n\nЛюбые изменения, которые вы сделаете тут, также сохранят и загрузят настройку вашего геймпада, которая может перезаписать назначение клавиш клавиатуры.\n\nВы хотите отредактировать назначение кнопок геймпада, перенастроить его или продолжить в любом случае?', WARNINGSAVEBINDINGS = '|cffffe00a[ConsolePort]|r\n|cFFFF1111ПРЕДУПРЕЖДЕНИЕ:|r Была сделана попытка сохранить и загрузить ваши настройки управления. Вызвано из:\n\n%s\nв модуле интерфейса %s.\n\nВаша калибровка геймпада перезапишет любые конфликтующие назначения, они не будут восстановлены при отключении ConsolePort.', WARNINGCOMBATLOGIN = '|cffffe00a[ConsolePort]|r\n|cFFFF1111ПРЕДУПРЕЖДЕНИЕ:|r Вы перезагрузили свой интерфейс в бою.\nВыйдите из боя для завершения инициализации.', ADVANCED_DATA = '|cffffe00a[ConsolePort]|r\n|cFFFF1111ПРЕДУПРЕЖДЕНИЕ:|r Вы собираетесь применить изменения к следующим настройкам:\n\n%s\nЭто приведет к перезагрузке вашего интерфейса. Любые изменения, внесенные вами на других вкладках конфигурации, будут не будут применены.', ADVANCED_EXPORT = '|cffffe00a[ConsolePort]|r\nЭто ваши данные экспорта:\n\n%s\nНажмите Ctrl+A для выбора и Ctrl+C для копирования.', ADVANCED_IMPORT_A = '|cffffe00a[ConsolePort]|r\nВставьте данные своего профиля:', ADVANCED_IMPORT_B = '|cffffe00a[ConsolePort]|r\nВы собираетесь загрузить настройки для:\n\n%s\nВы сможете просмотреть эти параметры перед применением.', NEWCONTROLLER = '|cffffe00a[ConsolePort]|r\nВы загрузили новый профиль геймпада. Хотите загрузить назначения кнопок по умолчанию для этого геймпада?', NEWCHARACTER = '|cffffe00a[ConsolePort]|r\nХотите загрузить назначения кнопок по умолчанию для этого геймпада?', NOBINDINGS = '|cffffe00a[ConsolePort]|r\nУ вас нет назначений кнопок для этой специализации. Хотите загрузить назначения по умолчанию?', CALIBRATIONUPDATE = '|cffffe00a[ConsolePort]|r\nВаши текущие настройки не соответствует настройкам WoWmapper. Хотите их обновить?', WMUPDATE = '|cffffe00a[ConsolePort]|r\nВы недавно изменили настройки WoWmapper. Чтобы эти изменения вступили в силу необходимо перезагрузить интерфейс.\nСделать это сейчас?', EXTERNALLINK = '|cffffe00a[ConsolePort]|r\nСсылка на %s.\nНажмите Ctrl+A для выбора и Ctrl+C для копирования.', }, ERRORS = { FOCUSUNIT = '|cFFFF1111ПРИМЕЧАНИЕ:|rПока курсор интерфейса включен, вы не можете использовать |cFFAAAAFF'..SET_FOCUS..'|r из выпадающих меню с помощью обычной мыши. Используйте курсор интерфейса или персональное назначение кнопки.', NPCMODULE = '|cFFFF1111ПРИМЕЧАНИЕ:|r ConsolePort: Квесты и Разговоры были заменены на отдельный аддон |cff69ccf0Immersion|r. Пожалуйста загрузите |cff69ccf0Immersion|r отдельно.\nhttps://www.curseforge.com/wow/addons/immersion', }, } db.TOOLTIP = { COMPARE = 'Сравнить', QUEST_TRACKER = 'Сделать текущим заданием', USE_NOCOMBAT = 'Использовать (Вне боя)', BUY = 'Купить', USE = 'Использовать', EQUIP = 'Одеть', SELL = 'Продать', QUEST_DETAILS = 'Показать детали задания', PICKUP = 'Взять', PICKUP_ITEM = 'Взять', CANCEL = 'Отмена', STACK_BUY = 'Купить другое количество', STACK_SPLIT = 'Разделить', ADD_TO_EXTRA = 'Быстрое назначение', FLYOUT = '%s использовать %s Отменить', MAP_CANVAS_ZOOM_IN = 'Приблизить', MAP_CANVAS_ZOOM_OUT = 'Отдалить', UTILITY_RELEASE = '|T%s:24:24:0:0|t Отпустить для использования', UTILITY_REMOVE = '|T%s:24:24:0:0|t Удалить', } db.CUSTOMBINDS = { -- Headers ----------------------------------------------------------- CP_MOUSE = 'Эмуляция мыши', CP_UTILITY = 'Утилиты', CP_CAMERA = 'Камера', CP_TARGETING = 'Выбор цели', CP_PAGER = 'Набор действий (Зажать)', -- Bindings ----------------------------------------------------------- CP_TOGGLEADDON = 'Включить/Выключить ConsolePort', CP_UTILITYBELT = 'Круговая панель', CP_PETRING = 'Панель питомца', CP_RAIDCURSOR = 'Переключение на рейд-курсор', CP_RAIDCURSOR_F = 'Фокус по рейд-курсору', CP_RAIDCURSOR_T = 'Цель по рейд-курсору', CP_EM_FRAMES = 'Цель по фрейму (Зажать)', CP_EM_PLATES = 'Цель по табличке с именем (Зажать)', CP_EM_NEAREST = 'Ближайшая цель или по табличке с именем (Зажать)', CP_TOGGLEMOUSE = 'Переключить обзор мышью', CP_FOCUSCAST = FOCUS_CAST_KEY_TEXT .. ' (Зажать)', CP_PAGE2 = BINDING_NAME_ACTIONPAGE2 .. ' (Зажать)', CP_PAGE3 = BINDING_NAME_ACTIONPAGE3 .. ' (Зажать)', CP_PAGE4 = BINDING_NAME_ACTIONPAGE4 .. ' (Зажать)', CP_PAGE5 = BINDING_NAME_ACTIONPAGE5 .. ' (Зажать)', CP_PAGE6 = BINDING_NAME_ACTIONPAGE6 .. ' (Зажать)', CP_CAMZOOMIN = BINDING_NAME_CAMERAZOOMIN .. ' (x5)', CP_CAMZOOMOUT = BINDING_NAME_CAMERAZOOMOUT .. ' (x5)', CP_ZOOMIN_HOLD = BINDING_NAME_CAMERAZOOMIN .. ' (Зажать)', CP_ZOOMOUT_HOLD = BINDING_NAME_CAMERAZOOMOUT .. ' (Зажать)', CP_CAMLOOKBEHIND = 'Посмотреть назад', -- Strings in case controller has no texture for the binding XML ----------------------------------------------------------- CP_X_CENTER = '|c75757575Guide |caaee5555(отключена)|r', CP_T5 = '|c75757575Экстра 1 |caaee5555(отключена)|r', CP_T6 = '|c75757575Экстра 2 |caaee5555(отключена)|r', CP_T7 = '|c75757575Экстра 3 |caaee5555(отключена)|r', CP_T8 = '|c75757575Экстра 4 |caaee5555(отключена)|r', -- Headers ----------------------------------------------------------- CAMERAORSELECTORMOVE = 'Левая кнопка мыши', TURNORACTION = 'Правая кнопка мыши', } db.ACTIONBAR = { EYE_HEADER = '|cff1eff00Панель команд ConsolePort|r: %s', EYE_LOCKED = '|c75757575Заблокированно|r', EYE_UNLOCKED = '|cffffe00aРазблокированно|r', EYE_LEFTCLICK = '%s Показать/скрыть измененные действия. (Левый клик)', EYE_RIGHTCLICK = '%s Переключить отображение обложки. (Правый клик)', EYE_LEFTCLICK_SHIFT = '%s%s Заблокировать/Разблокировать панель. (Shift+Левый клик)', EYE_LEFTCLICK_CTRL = '%s%s Сбросить позицию. (Ctrl+Левый клик)', EYE_SCROLL = 'Колесо мыши: Изменить масштаб.', EYE_SCROLL_SHIFT = 'Shift + Колесо мыши: Изменить ширину.', ----------------------------------------------------------- CFG_LOCK = 'Заблокировать панель', CFG_LOCKPET = 'Заблокировать панель питомца', CFG_DISABLEPET = 'Отключить панель питомца', CFG_DISABLEDND = 'Отключить перетаскивание', CFG_HIDEINCOMBAT = 'Скрыть в бою', CFG_DISABLERETICLE = 'При отжатии не произносить\nзаклинания по области', CFG_HIDEPETINCOMBAT = 'Скрыть панель питомца в бою', CFG_HIDEOUTOFCOMBAT = 'Скрыть вне боя', CFG_SHOWALLBUTTONS = 'Показывать все кнопки', CFG_WATCHBAR_OFF = 'Отключить полосу опыта', CFG_WATCHBAR_ALPHA = 'Держать полосу опыта видимой', CFG_WATCHBAR_EXP = 'Скрыть полосу опыта', CFG_WATCHBAR_AP = 'Скрыть опыт артефакта', CFG_QUICKMENU = 'Показать быстрое меню', CFG_MOUSE_ENABLE = 'Ширина/масштаб на колесе мыши', CFG_ART_UNDERLAY = 'Оформление для класса', CFG_ART_TINT = 'Цветовое оформление', CFG_COLOR_RAINBOW = 'Мне нравится радуга', CFG_DISABLE_ICONS = 'Скрыть иконки кнопок', CFG_DISABLE_MINIS = 'Отключить иконку модификатора', CFG_CAST_DEFAULT = 'Показать стандартный индикатор\nпроизношения заклинания', CFG_CAST_NOHOOK = 'Отключить модификацию индикатора\nпроизношения заклинаний', CFG_VALID_ENTRIES = "Правильный:\n%s", CFG_COLOR_TOOLTIP = '|cFFFF0000%s|r |cFF00FF00%s|r |cFF0000FF%s|r |cFFFFFFFF%s|r\nЛевый клик: сменить цвет.\nПравый клик: сбросить цвет.', ----------------------------------------------------------- } db.HEADERS = { CP_LEFT = 'Крестовина', CP_RIGHT = 'Кнопки действия', CP_CENTER = 'Центральные кнопки', CP_TRIG = 'Триггеры', CP_EXTRA = 'экстра', }
local Migration = ActiveRecord.Migration.new(20181007030216) function Migration:change() ActiveRecord.define_model('users', function(t) t:string { 'steam_id', null = false } t:string { 'name', null = false } end) ActiveRecord.define_model('logs', function(t) t:text 'body' t:string 'action' t:string 'object' t:string 'subject' end) add_index { 'users', 'steam_id' } end return Migration
local function InsecureAddition() local A = identity(100); local B = identity(200); assert(not issecure(), "expected state to be insecure"); assert(not debug.issecurelocal(1, 1), "expected 'A' to be insecure"); assert(not debug.issecurelocal(1, 2), "expected 'B' to be insecure"); local C = A + B; assert(not debug.issecurelocal(1, 3), "expected 'C' to be insecure"); end local function InsecureSubtraction() local A = identity(100); local B = identity(200); assert(not issecure(), "expected state to be insecure"); assert(not debug.issecurelocal(1, 1), "expected 'A' to be insecure"); assert(not debug.issecurelocal(1, 2), "expected 'B' to be insecure"); local C = A - B; assert(not debug.issecurelocal(1, 3), "expected 'C' to be insecure"); end local function InsecureDivision() local A = identity(100); local B = identity(200); assert(not issecure(), "expected state to be insecure"); assert(not debug.issecurelocal(1, 1), "expected 'A' to be insecure"); assert(not debug.issecurelocal(1, 2), "expected 'B' to be insecure"); local C = A / B; assert(not debug.issecurelocal(1, 3), "expected 'C' to be insecure"); end local function InsecureMultiplication() local A = identity(100); local B = identity(200); assert(not issecure(), "expected state to be insecure"); assert(not debug.issecurelocal(1, 1), "expected 'A' to be insecure"); assert(not debug.issecurelocal(1, 2), "expected 'B' to be insecure"); local C = A * B; assert(not debug.issecurelocal(1, 3), "expected 'C' to be insecure"); end local function InsecureModulo() local A = identity(100); local B = identity(200); assert(not issecure(), "expected state to be insecure"); assert(not debug.issecurelocal(1, 1), "expected 'A' to be insecure"); assert(not debug.issecurelocal(1, 2), "expected 'B' to be insecure"); local C = A % B; assert(not debug.issecurelocal(1, 3), "expected 'C' to be insecure"); end local function InsecurePow() local A = identity(100); local B = identity(200); assert(not issecure(), "expected state to be insecure"); assert(not debug.issecurelocal(1, 1), "expected 'A' to be insecure"); assert(not debug.issecurelocal(1, 2), "expected 'B' to be insecure"); local C = A ^ B; assert(not debug.issecurelocal(1, 3), "expected 'C' to be insecure"); end local function InsecureUnaryMinus() local A = identity(100); assert(not issecure(), "expected state to be insecure"); assert(not debug.issecurelocal(1, 1), "expected 'A' to be insecure"); local B = -A; assert(not debug.issecurelocal(1, 2), "expected 'B' to be insecure"); end insecurecall_checked(InsecureAddition); insecurecall_checked(InsecureSubtraction); insecurecall_checked(InsecureDivision); insecurecall_checked(InsecureMultiplication); insecurecall_checked(InsecureModulo); insecurecall_checked(InsecurePow); insecurecall_checked(InsecureUnaryMinus);
GameObject = {} function GameObject:new() local gameObject = {} setmetatable(gameObject, self) self.__index = self gameObject.Position = { x = 0, y = 0, z = 0 } gameObject.Rotation = { x = 0, y = 0, z = 0, w = 0 } gameObject.Scale = { x = 0, y = 0, z = 0 } gameObject.Type = 'TILE' gameObject.ColourCode = 'NONE' gameObject.Switches = 0 return gameObject end
libkb = {} ins = require('plugins.inspect') function libkb.scandir(directory) local i, t, popen = 0, {}, io.popen local pfile = popen('ls -a "'..directory..'"') for filename in pfile:lines() do if not libkb.check(filename,{'.','..'}) then i = i + 1 t[i] = filename end end pfile:close() return t end function libkb.check(str,t) for _, v in pairs(t) do if v == str then return true end end return t[str] ~= nil end function split(text,del) ret = {} layout = "[^DEL]+" layout = layout:gsub('DEL',del) for i in text:gmatch(layout) do ret[#ret+1]=i end return ret end function libkb.fix_names(msg) user_text = split(msg.text,' ') table.remove(user_text,1) table.remove(user_text,1) user_text = table.concat(user_text,' ') msg.toho = msg.peer_id msg.userid = msg.from_id msg.text_split = split(msg.text,' ') msg.user_text = user_text return msg end function libkb.apisay(...) args = ... vkapi('messages.send',{message=args[1],peer_id=args[2]}) end return libkb
local playsession = { {"GunaS", {31974}}, {"trnila", {179494}}, {"Fudster", {71856}}, {"TiTaN", {161280}}, {"Shadow04", {66455}}, {"Impatient", {133515}}, {"Creator_Zhang", {105950}}, {"Jeremykyle", {93473}}, {"liushuo418", {3808}}, {"Grino98", {2057}} } return playsession
-- Yet another way to make text messages longer and more complicated, without any particular reason local lookuptable = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "'0", "'1", "'2", "'3", "'4", "'5", "'6", "'7", "'8", "'9", " " } function fromME(text) assert(type(text) == "string", "Argument #1: String expected") local output = "" local splits = text:split(" ") for i, v in ipairs(splits) do local num = tonumber(v, 16) if num and num <= #lookuptable then output = lookuptable[num]..output end end print(L.nick ..": ".. output) end function toME(text) assert(type(text) == "string", "Argument #1: String expected") text = string.lower(text) local output = "" for c in text:gmatch(".") do local chr = string.byte(c) if c >= 'a' and c <= 'z' then chr = string.format("%X", chr - 0x60) elseif c >= '0' and c <= '9' then chr = string.format("%X", chr - 0x30 + 0x1B) elseif c == ' ' then chr = '25' end if type(chr) == "string" then output = chr .. " X " ..output end end print(L.nick ..": ".. output) end
local playsession = { {"Gerkiz", {202277}}, {"snoetje", {366120}}, {"mewmew", {169149}}, {"jobaxter", {123859}}, {"dzentak", {891982}}, {"Ardordo", {553558}}, {"vad7ik", {453743}}, {"everLord", {483888}}, {"Mullacs", {886156}}, {"a.l.f.a", {123439}}, {"RebuffedBrute44", {850917}}, {"GummiVulture", {12288}}, {"adieclay", {460868}}, {"whollyspokes", {721196}}, {"Corlin", {146914}}, {"l_Diego_l", {70466}}, {"stinkypower96", {100089}}, {"dasocks", {813170}}, {"Nikkichu", {164243}}, {"Hiero", {551323}}, {"helpower2", {37745}}, {"datadrian", {659953}}, {"Piewdennis", {8580}}, {"maxxcz", {763451}}, {"pY4x3g", {37079}}, {"Creator_Zhang", {29914}}, {"clemeh", {139010}}, {"Bouhkan", {231567}}, {"Fakeshka", {51646}}, {"Gwaihir", {7915}}, {"Paulot", {703373}}, {"matthew1206", {489966}}, {"foggyliziouz", {559381}}, {"tmoneyfizzle", {3558}}, {"RedPandaRam", {58785}}, {"LordDanielthe", {2419}}, {"MrTea", {3156}}, {"dog80", {69565}}, {"BlackstorM96", {1435}}, {"Lazeroth", {6867}}, {"mzore", {637816}}, {"pigwithtach", {3069}}, {"Aeropagus", {204}}, {"Arhimedis", {4558}}, {"Connor15_", {456673}}, {"Dinnopum", {509614}}, {"lone-pine", {537236}}, {"alexbw", {400615}}, {"makuli", {409028}}, {"elMoskvin", {11085}}, {"m4a2000", {188420}}, {"Catbert", {2000}}, {"storz676", {2747}}, {"R26", {21023}}, {"pickles28", {39849}}, {"ClassAction", {297994}}, {"Hugoo", {7995}}, {"ZTX", {341701}}, {"Serennie", {117444}}, {"edensg", {8585}}, {"MooLer", {267759}}, {"scotty2586", {325044}}, {"Specks", {8852}}, {"War_Kittehs", {231110}}, {"Xolas", {162620}}, {"epic_leaf", {24831}}, {"danyal_knights", {175227}}, {"Auzzy08", {7199}}, {"aledeludx", {210}}, {"gamerkidgp2014", {42540}}, {"realDonaldTrump", {63532}}, {"thislsamerica", {6225}} } return playsession
return { no_consumer = true, -- this plugin is available only on APIs. fields = { key = { required = true, type = "string", default = "" }, alg = { required = false, type = "string", default = "HS256" }, headers = { required = false, type = "array", default = {} }, dialect = { required = false, type = "string", default = "http://example.com/claims/" }, issuer = { required = false, type = "string", default = "example.com/plugins/up-jwt-builder" }, audience = { required = false, type = "string" }, expiration = { required = false, type = "number"} } }
-- Description: Defines the event handlers for when event effects entities -- Constructs and returns the EntityHandlers object return function() local CreationHandlers = {} local DestructionHandlers = {} local EntityHandlers = { Creation = CreationHandlers, Destruction = DestructionHandlers } -- OnEntityBuilt( LuaEntity, Event ) :: void -- Called by when either a player or bot builds an entity function CreationHandlers.OnEntityBuilt(entity, event) local handler = SE.NodeHandlersRegistry.GetEntityHandler(entity) if (handler ~= nil) then SE.Logger.Trace("Entity Handler: Adding network node " .. handler.HandlerName) local newNode = SE.NetworksManager.AddNode(handler.NewNode(entity)) EntityHandlers.OnPasteSettingsWithNode(entity, newNode, event) end end -- OnBuiltByPlayer( Event ) :: void -- Called when player builds something. -- Event fields: -- - created_entity :: LuaEntity -- - player_index :: uint -- - item :: string (optional) -- - tags :: dictionary string -> Any (optional) function CreationHandlers.OnBuiltByPlayer(event) CreationHandlers.OnEntityBuilt(event.created_entity, event) end -- OnBuiltByBot( Event ) :: void -- Called when a construction robot builds an entity. -- Event fields: -- - robot :: LuaEntity -- - created_entity :: LuaEntity -- - item :: string (optional) -- - tags :: dictionary string -> Any (optional) function CreationHandlers.OnBuiltByBot(event) CreationHandlers.OnEntityBuilt(event.created_entity, event) end -- OnUnMarked( Event ) :: void -- Called when the deconstruction of an entity is canceled. -- Event fields: -- - entity :: LuaEntity -- - player_index :: uint (optional) function CreationHandlers.OnUnMarked(event) CreationHandlers.OnEntityBuilt(event.entity, event) end -- OnEntityRemoved( LuaEntity ) :: void -- Called when an entity is, or will be, removed from the game function DestructionHandlers.OnEntityRemoved(entity) local handler = SE.NodeHandlersRegistry.GetEntityHandler(entity) if (handler ~= nil) then SE.NetworksManager.RemoveNodeByEntity(entity) end end -- OnMinedByPlayer( Event ) :: void -- Called after the results of an entity being mined are collected just before the entity is destroyed. After this event any items in the buffer will be transferred into the player as if they came from mining the entity. -- Event fields: -- - player_index :: uint -- - entity :: LuaEntity -- - buffer :: LuaInventory: The temporary inventory that holds the result of mining the entity. -- Note: The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it. function DestructionHandlers.OnMinedByPlayer(event) DestructionHandlers.OnEntityRemoved(event.entity) end -- OnMinedByBot( Event ) :: void -- Called after the results of an entity being mined are collected just before the entity is destroyed. After this event any items in the buffer will be transferred into the robot as if they came from mining the entity. -- Event fields: -- - robot :: LuaEntity -- - entity :: LuaEntity -- - buffer :: LuaInventory: The temporary inventory that holds the result of mining the entity. -- Note: The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it. function DestructionHandlers.OnMinedByBot(event) DestructionHandlers.OnEntityRemoved(event.entity) end -- OnKilled( Event ) -- Called when an entity dies. -- Event fields: -- - entity :: LuaEntity -- - cause :: LuaEntity (optional) -- - force :: LuaForce (optional) function DestructionHandlers.OnKilled(event) DestructionHandlers.OnEntityRemoved(event.entity) end local thingy = function() end -- OnMarked( Event ) :: void -- Called when an entity is marked for deconstruction with the Deconstruction planner or via script. -- Event fields: -- - entity :: LuaEntity -- - player_index :: uint (optional) function DestructionHandlers.OnMarked(event) DestructionHandlers.OnEntityRemoved(event.entity) end -- OnPasteSettings( Event ) -- Called after entity copy-paste is done. -- Event fields: -- - player_index :: uint -- - source :: LuaEntity: The source entity settings have been copied from. -- - destination :: LuaEntity: The destination entity settings have been copied to. function EntityHandlers.OnPasteSettings(event) local player = Player.load(event).get() local destEntity = event.destination local handler = SE.NodeHandlersRegistry.GetEntityHandler(destEntity) if (handler ~= nil) then local destNode = SE.NetworksManager.GetNodeForEntity(destEntity) if (destNode ~= nil) then handler.OnPasteSettings(destNode, event.source) end end end -- OnPasteSettingsWithNode( LuaEntity, Node, Event ) -- Called after entity copy-paste is done. -- Event fields: -- - entity :: LuaEntity: The source entity settings have been copied from. -- - newNode :: Node: New node where the parameters will have to be pasted. -- - event :: Event: Event, containing the potential information of a tag in the blueprint. function EntityHandlers.OnPasteSettingsWithNode(entity, newNode, event) local handler = SE.NodeHandlersRegistry.GetEntityHandler(entity) if (handler ~= nil) then if (event.tags ~= nil) then handler.OnPasteSettingsWithNode(newNode, event.tags) end end end function EntityHandlers.OnPreEntitySettingsPasted(event) local player = Player.load(event).get() end function EntityHandlers.OnPlayerSetupBlueprint(event) local player = game.players[event.player_index] local mapping = event.mapping.get() local bp = player.blueprint_to_setup if bp.valid_for_read == false then local cursor = player.cursor_stack if cursor and cursor.valid_for_read and cursor.name == "blueprint" then bp = cursor --return end end if bp == nil or bp.valid_for_read == false then return end for index, ent in pairs(mapping) do local tags = EntityHandlers.EntityToBlueprintTags(ent) if tags ~= nil then for tag, value in pairs(tags) do bp.set_blueprint_entity_tag(index, tag, value) end end end end function EntityHandlers.OnPlayerConfiguredBlueprint(event) local player = Player.load(event).get() end function EntityHandlers.EntityToBlueprintTags(copyEntity, fromTable) local tags = nil local handler = SE.NodeHandlersRegistry.GetEntityHandler(copyEntity) if (handler ~= nil) then tags = SE.NetworksManager.GetNodeForEntity(copyEntity) end return tags end -- RegisterWithGame() :: void -- Registers event listeners with the game. function EntityHandlers.RegisterWithGame() script.on_event(defines.events.on_entity_settings_pasted, EntityHandlers.OnPasteSettings) script.on_event(defines.events.on_pre_entity_settings_pasted, EntityHandlers.OnPreEntitySettingsPasted) script.on_event(defines.events.on_player_setup_blueprint, EntityHandlers.OnPlayerSetupBlueprint) script.on_event(defines.events.on_player_configured_blueprint, EntityHandlers.OnPlayerConfiguredBlueprint) -- Creation script.on_event(defines.events.on_built_entity, EntityHandlers.Creation.OnBuiltByPlayer) script.on_event(defines.events.on_robot_built_entity, EntityHandlers.Creation.OnBuiltByBot) script.on_event(defines.events.on_cancelled_deconstruction, EntityHandlers.Creation.OnUnMarked) -- Destruction script.on_event(defines.events.on_marked_for_deconstruction, EntityHandlers.Destruction.OnMarked) script.on_event(defines.events.on_player_mined_entity, EntityHandlers.Destruction.OnMinedByPlayer) script.on_event(defines.events.on_entity_died, EntityHandlers.Destruction.OnKilled) end return EntityHandlers end
local default_jumps = CreateConVar("multijump_default_jumps", "1", FCVAR_ARCHIVE, "The amount of extra jumps players should get") local default_power = CreateConVar("multijump_default_power", "1", FCVAR_ARCHIVE, "Multiplier for the jump-power when multi jumping") local max_fall_distance = CreateConVar("multijump_max_fall_distance", "0", FCVAR_ARCHIVE, "The maximum distance a player can fall before multi jump is disabled") local can_jump_while_falling = CreateConVar("multijump_can_jump_while_falling", "1", FCVAR_ARCHIVE, "Whether the player should be able to multi-jump if they didn't jump to begin with") hook.Add("OnEntityCreated", "MultiJumpOnEntityCreated", function(ply) if ply:IsPlayer() then ply:SetJumpLevel(0) if can_jump_while_falling:GetBool() then ply:SetJumped(-1) else ply:SetJumped(0) end ply:SetMaxJumpLevel(default_jumps:GetInt()) ply:SetExtraJumpPower(default_power:GetInt()) ply:SetMaxJumpDistance(max_fall_distance:GetInt()) ply:SetJumpLocation(vector_origin) end end) cvars.AddChangeCallback("multijump_default_jumps", function(_, _, new) new = tonumber(new) for _, v in pairs(player.GetAll()) do v:SetMaxJumpLevel(new) end end) cvars.AddChangeCallback("multijump_default_power", function(_, _, new) new = tonumber(new) for _, v in pairs(player.GetAll()) do v:SetExtraJumpPower(new) end end) cvars.AddChangeCallback("multijump_max_fall_distance", function(_, _, new) new = tonumber(new) for _, v in pairs(player.GetAll()) do v:SetMaxJumpDistance(new) end end) cvars.AddChangeCallback("multijump_can_jump_while_falling", function(_, _, new) new = tonumber(new) for _, v in pairs(player.GetAll()) do if new == 1 then v:SetJumped(-1) else v:SetJumped(0) end end end)
-- -- JOINT STATE controllers -- -- Setup FollowJointState controller -- -- Intended to be run via config script. -- require "motion_core" controller = controller or {} -- load controller ros:import("sweetie_bot_controller_joint_space") depl:loadComponent("controller/joint_state_head", "sweetie_bot::motion::controller::FollowJointState") controller.joint_state_head = depl:getPeer("controller/joint_state_head") -- get ROS parameteres ans services config.get_peer_rosparams(controller.joint_state_head) -- register controller resource_control.register_controller(controller.joint_state_head) -- timer depl:connect(timer.controller.port, "controller/joint_state_head.sync", rtt.Variable("ConnPolicy")) -- data flow: controller <-> aggregator_ref depl:connect("controller/joint_state_head.out_joints_ref_fixed", "aggregator_ref.in_joints", rtt.Variable("ConnPolicy")) depl:connect("controller/joint_state_head.in_joints_sorted", "aggregator_ref.out_joints_sorted", rtt.Variable("ConnPolicy")) -- ROS redirect depl:stream("controller/joint_state_head.in_joints_ref", ros:topicBuffer("~controller/joint_state_head/in_joints_ref",10)) depl:stream("controller/joint_state_head.out_joints_src_reset", ros:topic("~controller/joint_state_head/out_joints_src_reset")) -- connect to RobotModel depl:connectServices("controller/joint_state_head", "aggregator_ref") -- advertise actionlib interface controller.joint_state_head:loadService("actionlib") controller.joint_state_head:provides("actionlib"):connect("~controller/joint_state_head") -- advertise ROS operation controller.joint_state_head:loadService("rosservice") controller.joint_state_head:provides("rosservice"):connect("rosSetOperational", config.node_fullname .. "/controller/joint_state_head/set_operational", "std_srvs/SetBool") -- prepare to start assert(controller.joint_state_head:configure(), "ERROR: Unable to configure controller/joint_state_head.")
-- Displays detailed information about unit caps when the user -- mouses over the units menu dofilepath("data:ui/newui/Styles/HWRM_Style/HWRMDefines.lua") --UnitCapInfoPopupWidth = 225 UnitCapInfoPopupWidth = 235 MAXHEIGHT = 325 UnitCapInfoPopup= { maxColor = {255,0,0,255}, -- color for max pop reached availColor = {0,255,0,255}, -- color for pop available --size = {32, 71, 100, 200}, autosize = 1, RootElementSettings = { autosize = 1, --backgroundColor = {255,128,0,255}, Layout = { pad_LT = { l = 8, t = 0, lr = "px", tr = "px" }, }, Anchor_Binds = { pivotX = "Taskbar_LeftButtonsTopRight", pivotY = "Taskbar_LeftButtonsTopRight", }, }, soundOnShow = "SFX_RecallMenuONOFF", soundOnHide = "SFX_RecallMenuONOFF", onShow = "UI_SetButtonPressed('NewTaskbar', 'btnFleet', 1); UI_HideScreen('BuildQueueMenu'); UI_HideScreen('EventsScreen'); UI_HideScreen('BountiesScreen'); UI_HideScreen('BentusiScreen'); UI_HideScreen('ProgressScreen'); UI_HideScreen('MusicScreen'); UI_HideScreen('RulesScreen');", onHide = "UI_SetButtonPressed('NewTaskbar', 'btnFleet', 0)", stylesheet = "HW2StyleSheet", -- Flags pixelUVCoords = 1, -- Enter pixel coords for texture coords arrangetype = "vert", clickThrough = 1, ; { type = "Frame", name = "MainFrame", autosize = 1, giveParentMouseInput = 1, autoarrange = 1, arrangetype = "vert", ; -- Frame to hold all unit caps { type = "Frame", name = "frmItems", autosize = 1, giveParentMouseInput = 1, arrangetype = "vert", }, }, -------------------- CLONES --------------------------- -- Tab spacer frame to clone { type = "Frame", name = "frmTabSpacer", size = {10, 1}, --size = {1, 1}, giveParentMouseInput = 1, }, -- Title to clone { type = "TextLabel", name = "lblNameToClone", autosize=1, ignored = 1, --position = {4,0}, Layout = { --pos_XY = { x = 0.0, y = 0.0, xr = "par", yr = "par" }, size_WH = { w = 1, h = STD_LABEL_HEIGHT, wr = "px", hr = "scr" }, }, --size = {UnitCapInfoPopupWidth-16, 15}, Text = { textStyle = "IGHeading2", --minShrink = 0.25, }, giveParentMouseInput = 1, dropShadow = 1, visible = 0, }, -- Unit cap item to clone { type = "Frame", name = "frmItemToClone", autosize = 1, giveParentMouseInput = 1, visible = 0, arrangetype = "horiz", Layout = { size_WH = { w = 1, h = 1, wr = "1", hr = "px" }, }, ; { type = "Frame", name = "frmName", autosize=1, arrangetype = "horiz", ; }, { type = "TextLabel", name = "lblUnitCap", autosize=1, --backgroundColor = { 0, 255, 0, 200 }, Layout = { min_WH = { w = 85, wr = "px" }, pad_LT = { l = 8, t = 1, lr = "px", tr = "px" }, }, Text = { textStyle = "IGHeading2", hAlign = "Right", --vAlign = "Middle", text = "<c %06x>%d</c>\/%d", minShrink = 0.25, --offset = {-6,0}, }, giveParentMouseInput = 1, dropShadow = 1, }, }, }
--[[ ================================================================= Description: All strings (English) used by MailTips. ================================================================= --]] -- Strings used within MailTips MT_STARTUP_MESSAGE = MT_NAME.." ("..C_GREEN..MT_VERSION..C_CLOSE..") loaded."; MT_ENCLOSED_ITEMS = "Enclosed items"; MT_VENDORVALUE = "Vendor value";
AddCSLuaFile() local VehicleName = "NYPD Unmarked 98 Crown Vic" local EMV = {} EMV.Siren = 3 EMV.Skin = 1 EMV.Color = Color(63,67,95) ---CUSTOM COLORS--- local B = "BLUE" local R = "RED" local A = "AMBER" local W = "WHITE" local G = "GREEN" local DR = "D_RED" local CW = "C_WHITE" local SW = "S_WHITE" -------------------- local PA = "A" local PB = "B" local PCA = "CA" local PTT = "TT" EMV.BodyGroups = { { 0, 0 }, -- car { 1, 4 }, -- pushbar { 2, 0 }, -- camera { 3, 6 }, -- lightbar { 4, 1 }, -- rainguard { 5, 0 }, -- trim { 6, 2 }, -- grille { 7, 0 }, -- spotlight_l { 8, 0 }, -- spotlight_r { 9, 0 }, -- runners { 10, 0 }, -- extmirrorlights { 11, 0 }, -- mirrorlights { 12, 0 }, -- dashlights { 13, 0 }, -- grillelights { 14, 0 }, -- rwlights { 15, 0 }, -- platelights { 16, 0 }, -- windowbars { 17, 0 }, -- antenna { 18, 0 }, -- wheels { 19, 0 }, -- clamped1 } EMV.Auto = { { ID = "Pringles Viper Dual 2", Scale = 1, Pos = Vector( 7, 22.1, 61.6 ), Ang = Angle( 0, 90, 0), Color1 = R, Color2 = W }, { ID = "Pringles Viper Dual 2", Scale = 1, Pos = Vector( 0, 42, 51), Ang = Angle( 180, 270, 0), Color1 = W, Color2 = R }, { ID = "Whelen Ion", Scale = 1., Pos = Vector( 11, 120, 33 ), Ang = Angle( 0, 0, 0), Color1 = R, Phase = PA }, { ID = "Whelen Ion", Scale = 1, Pos = Vector( -10, 120, 33 ), Ang = Angle( 0, 0, 0), Color1 = R, Phase = PB }, { ID = "Pringles Viper Dual 2", Scale = 1, Pos = Vector( 10, -68.8, 51.5 ), Ang = Angle( 180, 90, 0) }, { ID = "Pringles Viper Dual 2", Scale = 1, Pos = Vector( -10, -68.8, 51.5 ), Ang = Angle( 180, 90, 0), Color1 = B, Color2 = R, }, { ID = "FH3 CVPI Rear Hideaway", Scale = 1, Pos = Vector( 0, 17.8, -7.5), Ang = Angle( 0, 0, 0), Color1 = W, Color2 = W }, { ID = "FH3 CVPI Wig-Wags", Scale = .98, Pos = Vector( 0, 10, -3 ), Ang = Angle( 0, 0, 0) }, { ID = "CVPIFH3 FlashTail", Scale = 1, Pos = Vector( 0, 17.2, -7 ), Ang = Angle( 0, 0, 0) }, } EMV.Sequences = { Sequences = { { Name = "CODE 1", Stage = "M1", Components = {}, Disconnect = {} }, { Name = "CODE 2", Stage = "M2", Components = {}, Disconnect = {} }, { Name = "CODE 3", Stage = "M3", Components = {}, Disconnect = {} } }, Traffic = { { Name = "LEFT", Stage = "L", Components = {}, Disconnect = {} }, { Name = "DIVERGE", Stage = "D", Components = {}, Disconnect = {} }, { Name = "RIGHT", Stage = "R", Components = {}, Disconnect = {} } } } local V = { Name = VehicleName, Class = "prop_vehicle_jeep", Category = "Emergency Vehicles", Author = "Officer Pringle", Model = "models/sentry/cvpi_new.mdl", KeyValues = { vehiclescript = "scripts/vehicles/sentry/cvpi_new.txt" }, IsEMV = true, EMV = EMV, HasPhoton = true, Photon = "PHOTON_INHERIT" } list.Set( "Vehicles", VehicleName, V ) if EMVU then EMVU:OverwriteIndex( VehicleName, EMV ) end
-- // ---------------------------------------------------------------------------------------------- -- // Author: Sparrow -- // DateCreated: 01/24/2019 2:27:04 PM -- // ---------------------------------------------------------------------------------------------- include("Cheat_Menu_Panel_Functions"); local m_CheatPanelState:number = 0; function AttachPanelToWorldTracker() if (m_IsLoading) then return; end if (not m_IsAttached) then local worldTrackerPanel:table = ContextPtr:LookUpControl("/InGame/WorldTracker/PanelStack"); if (worldTrackerPanel ~= nil) then Controls.CheatPanel:ChangeParent(worldTrackerPanel); worldTrackerPanel:AddChildAtIndex(Controls.CheatPanel, 1); worldTrackerPanel:CalculateSize(); worldTrackerPanel:ReprocessAnchoring(); m_IsAttached = true; end end end -- // ---------------------------------------------------------------------------------------------- -- // Attach Panel To WorldTracker -- // ---------------------------------------------------------------------------------------------- function OnLoadGameViewStateDone() AttachPanelToWorldTracker(); end -- // ---------------------------------------------------------------------------------------------- -- // Panel Control and Checkbox Attach -- // ---------------------------------------------------------------------------------------------- function UpdateCheatPanel(hideCheatPanel:boolean) m_hideCheatPanel = hideCheatPanel; Controls.CheatPanel:SetHide(m_hideCheatPanel); Controls.ToggleCheatPanel:SetCheck(not m_hideCheatPanel); end function InitDropdown() local parent = ContextPtr:LookUpControl("/InGame/WorldTracker/CivicsCheckButton", Controls.PanelStack ); if parent == nil then return end; Controls.CheatPanelStack:ChangeParent(parent); parent.ReprocessAnchoring(); Events.LoadGameViewStateDone.Remove(InitDropdown); end function OnPanelTitleClicked() if(m_CheatPanelState == 0) then UI.PlaySound("Tech_Tray_Slide_Open"); Controls.CheatPanel:SetSizeY(225); Controls.ButtonStackMIN:SetHide(false); Controls.ButtonSep:SetHide(false); m_CheatPanelState = 1; else UI.PlaySound("Tech_Tray_Slide_Closed"); Controls.CheatPanel:SetSizeY(25); Controls.ButtonStackMIN:SetHide(true); Controls.ButtonSep:SetHide(true); m_CheatPanelState = 0; end end function KeyHandler( key:number ) if key == Keys.VK_ESCAPE then Hide(); return true; end return false; end function OnInputHandler( pInputStruct:table ) local uiMsg = pInputStruct:GetMessageType(); if uiMsg == KeyEvents.KeyUp then return KeyHandler( pInputStruct:GetKey() ); end return false; end local function InitializeControls() Controls.HeaderTitle:RegisterCallback(Mouse.eLClick, OnPanelTitleClicked); --Controls.CheatButtonFreeCity:RegisterCallback(Mouse.eLClick, FreeCity); Controls.CheatButtonCityHeal:RegisterCallback(Mouse.eLClick, RestoreCityHealth); Controls.CheatButtonEra2:RegisterCallback(Mouse.eLClick, ChangeEraScoreBack); Controls.CheatButtonGov:RegisterCallback(Mouse.eLClick, ChangeGovPoints); Controls.CheatButtonEra:RegisterCallback(Mouse.eLClick, ChangeEraScore); Controls.CheatButtonGold:RegisterCallback(Mouse.eLClick, ChangeGold); Controls.CheatButtonProduction:RegisterCallback(Mouse.eLClick, CompleteProduction); Controls.CheatButtonAllTech:RegisterCallback(Mouse.eLClick, CompleteAllResearch); Controls.CheatButtonAllCivic:RegisterCallback(Mouse.eLClick, CompleteAllCivic); Controls.CheatButtonScience:RegisterCallback(Mouse.eLClick, CompleteResearch); Controls.CheatButtonCulture:RegisterCallback(Mouse.eLClick, CompleteCivic); Controls.CheatButtonDuplicate:RegisterCallback(Mouse.eLClick, OnDuplicate); Controls.CheatButtonFaith:RegisterCallback(Mouse.eLClick, ChangeFaith); Controls.CheatButtonPopulation:RegisterCallback(Mouse.eLClick, ChangePopulation); Controls.CheatButtonLoyalty:RegisterCallback(Mouse.eLClick, ChangeCityLoyalty); Controls.CheatButtonDestroy:RegisterCallback(Mouse.eLClick, DestroyCity); Controls.CheatButtonPromote:RegisterCallback(Mouse.eLClick, UnitPromote); Controls.CheatButtonUnitMV:RegisterCallback(Mouse.eLClick, UnitMovementChange); Controls.CheatButtonAddMovement:RegisterCallback(Mouse.eLClick, UnitAddMovement); Controls.CheatButtonHeal:RegisterCallback(Mouse.eLClick, UnitHealChange); Controls.CheatButtonEnvoy:RegisterCallback(Mouse.eLClick, ChangeEnvoy); Controls.CheatButtonObs:RegisterCallback(Mouse.eLClick, RevealAll); Controls.CheatButtonCorps:RegisterCallback(Mouse.eLClick, UnitFormCorps); Controls.CheatButtonArmy:RegisterCallback(Mouse.eLClick, UnitFormArmy); Controls.CheatButtonDiplo:RegisterCallback(Mouse.eLClick, ChangeDiplomaticFavor); Controls.CheatButtonCityHeal:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonEra2:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonDuplicate:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonEra:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonGold:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonProduction:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonAllTech:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonAllCivic:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonScience:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonCulture:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonFaith:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonPopulation:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonLoyalty:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonDestroy:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonPromote:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonUnitMV:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonAddMovement:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonHeal:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonEnvoy:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonObs:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); Controls.CheatButtonGov:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.CheatButtonDiplo:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.ToggleCheatPanel:RegisterCheckHandler(function() UpdateCheatPanel(not m_hideCheatPanel); end); Controls.ToggleCheatPanel:SetCheck(true); UpdateCheatPanel(true); end -- // ---------------------------------------------------------------------------------------------- -- // Init -- // ---------------------------------------------------------------------------------------------- function Initialize() m_IsLoading = true; Events.LoadGameViewStateDone.Add(OnLoadGameViewStateDone); Events.LoadGameViewStateDone.Add(InitDropdown); Events.InputActionTriggered.Add( OnInputActionTriggered ); ContextPtr:SetInputHandler( OnInputHandler, true ); InitializeControls(); if GameConfiguration.IsNetworkMultiplayer() then UpdateCheatPanel(true); Controls.ToggleCheatPanel:SetHide(true); else UpdateCheatPanel(false); end m_IsLoading = false; end Initialize();
object_tangible_quest_menagerie_terminal_37 = object_tangible_quest_shared_menagerie_terminal_37:new { } ObjectTemplates:addTemplate(object_tangible_quest_menagerie_terminal_37, "object/tangible/quest/menagerie_terminal_37.iff")
--[[-- json_string = -- JavaScript code encode.json( value -- nil, false, true, a number, a string, or json.array{...} or json.object{...} ) This function encodes any native datatype or table structure to JavaScript object notation (JSON). In order to distinguish between the empty array and the empty object, use json.array{} and json.object{} respectively. The return value of this function is additionally escaped in such way that it can be safely included in inline scripts both in HTML and XHTML (within CDATA section). --]]-- function encode.json(obj) local str = json.export(obj) str = string.gsub(str, "</", "<\\/") str = string.gsub(str, "<!%[CDATA%[", "\\u003c![CDATA[") str = string.gsub(str, "]]>", "]]\\u003e") return str end
--- -- The Walk Action takes care of moving a Character from one tile to another. -- @module Walk -- -- ------------------------------------------------ -- Required Modules -- ------------------------------------------------ local Action = require( 'src.characters.actions.Action' ) -- ------------------------------------------------ -- Module -- ------------------------------------------------ local Walk = Action:subclass( 'Walk' ) -- ------------------------------------------------ -- Public Methods -- ------------------------------------------------ function Walk:initialize( character, target ) Action.initialize( self, character, target, target:getMovementCost( character:getStance() )) end function Walk:perform() local current = self.character:getTile() assert( self.target:isPassable(), 'Target tile has to be passable!' ) assert( not self.target:hasCharacter(), 'Target tile must not be occupied by another character!' ) assert( self.target:isAdjacent( current ), 'Character has to be adjacent to the target tile!' ) self.character:move( self.target:getPosition() ) return true end return Walk
local count = 0 local function hello() count = count + 1 ngx.say("count :",count) end local _M = { hello = hello } return _M
-------------------------------------------------------------------- -- This file was automatically generated by ProjectGenerator -- which is tooling part the build system designed for GUCEF -- (Galaxy Unlimited Framework) -- For the latest info, see http://www.VanvelzenSoftware.com/ -- -- The contents of this file are placed in the public domain. Feel -- free to make use of it in any way you like. -------------------------------------------------------------------- -- -- Configuration for module: freetype project( "freetype" ) configuration( {} ) location( os.getenv( "PM4OUTPUTDIR" ) ) configuration( {} ) targetdir( os.getenv( "PM4TARGETDIR" ) ) configuration( {} ) language( "C" ) configuration( {} ) kind( "SharedLib" ) configuration( {} ) defines( { "FT2_BUILD_LIBRARY", "FT_CONFIG_OPTION_SYSTEM_ZLIB", "FT_CONFIG_OPTION_USE_ZLIB", "FT_DVEDIT_BUILD_DLL", "FT_DVEDIT_DLL_API" } ) links( { "z" } ) configuration( { LINUX } ) links( { "zlib" } ) links( { "zlib" } ) configuration( { WIN32 } ) links( { "zlib" } ) links( { "zlib" } ) configuration( { WIN64 } ) links( { "zlib" } ) links( { "zlib" } ) configuration( {} ) vpaths { ["Headers"] = { "**.h", "**.hpp", "**.hxx" } } files( { "include/ft2build.h", "include/freetype/freetype.h", "include/freetype/ftbbox.h", "include/freetype/ftbdf.h", "include/freetype/ftbitmap.h", "include/freetype/ftcache.h", "include/freetype/ftchapters.h", "include/freetype/ftcid.h", "include/freetype/fterrdef.h", "include/freetype/fterrors.h", "include/freetype/ftgasp.h", "include/freetype/ftglyph.h", "include/freetype/ftgxval.h", "include/freetype/ftgzip.h", "include/freetype/ftimage.h", "include/freetype/ftincrem.h", "include/freetype/ftlcdfil.h", "include/freetype/ftlist.h", "include/freetype/ftlzw.h", "include/freetype/ftmm.h", "include/freetype/ftmodapi.h", "include/freetype/ftmoderr.h", "include/freetype/ftotval.h", "include/freetype/ftoutln.h", "include/freetype/ftpfr.h", "include/freetype/ftrender.h", "include/freetype/ftsizes.h", "include/freetype/ftsnames.h", "include/freetype/ftstroke.h", "include/freetype/ftsynth.h", "include/freetype/ftsystem.h", "include/freetype/fttrigon.h", "include/freetype/fttypes.h", "include/freetype/ftwinfnt.h", "include/freetype/ftxf86.h", "include/freetype/t1tables.h", "include/freetype/ttnameid.h", "include/freetype/tttables.h", "include/freetype/tttags.h", "include/freetype/ttunpat.h", "include/freetype/config/ftconfig.h", "include/freetype/config/ftheader.h", "include/freetype/config/ftmodule.h", "include/freetype/config/ftoption.h", "include/freetype/config/ftstdlib.h", "include/freetype/internal/autohint.h", "include/freetype/internal/ftcalc.h", "include/freetype/internal/ftdebug.h", "include/freetype/internal/ftdriver.h", "include/freetype/internal/ftgloadr.h", "include/freetype/internal/ftmemory.h", "include/freetype/internal/ftobjs.h", "include/freetype/internal/ftrfork.h", "include/freetype/internal/ftserv.h", "include/freetype/internal/ftstream.h", "include/freetype/internal/fttrace.h", "include/freetype/internal/ftvalid.h", "include/freetype/internal/internal.h", "include/freetype/internal/pcftypes.h", "include/freetype/internal/psaux.h", "include/freetype/internal/pshints.h", "include/freetype/internal/sfnt.h", "include/freetype/internal/t1types.h", "include/freetype/internal/tttypes.h", "include/freetype/internal/services/svbdf.h", "include/freetype/internal/services/svcid.h", "include/freetype/internal/services/svgldict.h", "include/freetype/internal/services/svgxval.h", "include/freetype/internal/services/svkern.h", "include/freetype/internal/services/svmm.h", "include/freetype/internal/services/svotval.h", "include/freetype/internal/services/svpfr.h", "include/freetype/internal/services/svpostnm.h", "include/freetype/internal/services/svpscmap.h", "include/freetype/internal/services/svpsinfo.h", "include/freetype/internal/services/svsfnt.h", "include/freetype/internal/services/svttcmap.h", "include/freetype/internal/services/svtteng.h", "include/freetype/internal/services/svttglyf.h", "include/freetype/internal/services/svwinfnt.h", "include/freetype/internal/services/svxf86nm.h", "src/winfonts/fnterrs.h", "src/winfonts/winfnt.h" } ) configuration( {} ) vpaths { ["Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c", "src/winfonts/winfnt.c" } ) configuration( { "ANDROID" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "GLX" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "GTK" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "IPHONEOS" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "LINUX" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "OSX" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "SDL" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "SYMBIAN" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "UNIX" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "WIN32" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( { "WIN64" } ) vpaths { ["Platform Source"] = { "**.c", "**.cpp", "**.cs", "**.asm" } } files( { "src/autofit/autofit.c", "src/base/ftbase.c", "src/base/ftsystem.c", "src/base/ftglyph.c", "src/base/ftbitmap.c", "src/base/ftinit.c", "src/bdf/bdf.c", "src/cache/ftcache.c", "src/cff/cff.c", "src/cid/cidriver.c", "src/cid/cidobjs.c", "src/cid/cidgload.c", "src/cid/cidload.c", "src/cid/cidparse.c", "src/gxvalid/gxvalid.c", "src/gzip/ftgzip.c", "src/lzw/ftlzw.c", "src/otvalid/otvalid.c", "src/pcf/pcf.c", "src/pfr/pfr.c", "src/psaux/psaux.c", "src/pshinter/pshinter.c", "src/psnames/psnames.c", "src/raster/raster.c", "src/sfnt/sfnt.c", "src/smooth/ftsmooth.c", "src/smooth/ftgrays.c", "src/truetype/truetype.c", "src/type1/type1.c", "src/type42/type42.c" } ) configuration( {} ) includedirs( { "include", "include/freetype", "include/freetype/config", "include/freetype/internal", "include/freetype/internal/services", "src/winfonts" } ) configuration( { "LINUX" } ) includedirs( { "../zlib" } ) configuration( { "WIN32" } ) includedirs( { "../zlib" } ) configuration( { "WIN64" } ) includedirs( { "../zlib" } )
local __Scripts = LibStub:GetLibrary("ovale/Scripts") local OvaleScripts = __Scripts.OvaleScripts do local name = "sc_shaman_elemental_t19" local desc = "[7.0] Simulationcraft: Shaman_Elemental_T19" local code = [[ # Based on SimulationCraft profile "Shaman_Elemental_T19P". # class=shaman # spec=elemental # talents=2112333 Include(ovale_common) Include(ovale_trinkets_mop) Include(ovale_trinkets_wod) Include(ovale_shaman_spells) AddCheckBox(opt_interrupt L(interrupt) default specialization=elemental) AddCheckBox(opt_use_consumables L(opt_use_consumables) default specialization=elemental) AddCheckBox(opt_bloodlust SpellName(bloodlust) specialization=elemental) AddFunction ElementalInterruptActions { if CheckBoxOn(opt_interrupt) and not target.IsFriend() and target.Casting() { if target.InRange(hex) and not target.Classification(worldboss) and target.RemainingCastTime() > CastTime(hex) + GCDRemaining() and target.CreatureType(Humanoid Beast) Spell(hex) if target.Distance(less 5) and not target.Classification(worldboss) Spell(war_stomp) if target.InRange(quaking_palm) and not target.Classification(worldboss) Spell(quaking_palm) if not target.Classification(worldboss) and target.RemainingCastTime() > 2 Spell(lightning_surge_totem) if target.InRange(wind_shear) and target.IsInterruptible() Spell(wind_shear) } } AddFunction ElementalUseItemActions { Item(Trinket0Slot text=13 usable=1) Item(Trinket1Slot text=14 usable=1) } AddFunction ElementalBloodlust { if CheckBoxOn(opt_bloodlust) and DebuffExpires(burst_haste_debuff any=1) { Spell(bloodlust) Spell(heroism) } } ### actions.single_lr AddFunction ElementalSinglelrMainActions { #flame_shock,if=!ticking|dot.flame_shock.remains<=gcd if not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() Spell(flame_shock) #elemental_blast Spell(elemental_blast) #earthquake,if=buff.echoes_of_the_great_sundering.up if BuffPresent(echoes_of_the_great_sundering_buff) Spell(earthquake) #earth_shock,if=maelstrom>=117|!artifact.swelling_maelstrom.enabled&maelstrom>=92 if Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 Spell(earth_shock) #stormkeeper,if=raid_event.adds.count<3|raid_event.adds.in>50 if 0 < 3 or 600 > 50 Spell(stormkeeper) #lava_burst,if=dot.flame_shock.remains>cast_time&cooldown_react if target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and not SpellCooldown(lava_burst) > 0 Spell(lava_burst) #flame_shock,if=maelstrom>=20&buff.elemental_focus.up,target_if=refreshable if Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) Spell(flame_shock) #earth_shock,if=maelstrom>=111|!artifact.swelling_maelstrom.enabled&maelstrom>=86|equipped.smoldering_heart&equipped.the_deceivers_blood_pact&maelstrom>70&talent.aftershock.enabled if Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) Spell(earth_shock) #totem_mastery,if=buff.resonance_totem.remains<10|(buff.resonance_totem.remains<(buff.ascendance.duration+cooldown.ascendance.remains)&cooldown.ascendance.remains<15) if { TotemRemaining(totem_mastery) < 10 or TotemRemaining(totem_mastery) < BaseDuration(ascendance_elemental_buff) + SpellCooldown(ascendance_elemental) and SpellCooldown(ascendance_elemental) < 15 } and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 Spell(totem_mastery) #lightning_bolt,if=buff.power_of_the_maelstrom.up&spell_targets.chain_lightning<3,target_if=debuff.lightning_rod.down if BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and target.DebuffExpires(lightning_rod_debuff) Spell(lightning_bolt_elemental) #lightning_bolt,if=buff.power_of_the_maelstrom.up&spell_targets.chain_lightning<3 if BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 Spell(lightning_bolt_elemental) #chain_lightning,if=active_enemies>1&spell_targets.chain_lightning>1,target_if=debuff.lightning_rod.down if Enemies() > 1 and Enemies() > 1 and target.DebuffExpires(lightning_rod_debuff) Spell(chain_lightning) #chain_lightning,if=active_enemies>1&spell_targets.chain_lightning>1 if Enemies() > 1 and Enemies() > 1 Spell(chain_lightning) #lightning_bolt,target_if=debuff.lightning_rod.down if target.DebuffExpires(lightning_rod_debuff) Spell(lightning_bolt_elemental) #lightning_bolt Spell(lightning_bolt_elemental) #flame_shock,moving=1,target_if=refreshable if Speed() > 0 and target.Refreshable(flame_shock_debuff) Spell(flame_shock) #earth_shock,moving=1 if Speed() > 0 Spell(earth_shock) #flame_shock,moving=1,if=movement.distance>6 if Speed() > 0 and target.Distance() > 6 Spell(flame_shock) } AddFunction ElementalSinglelrMainPostConditions { } AddFunction ElementalSinglelrShortCdActions { unless { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or Spell(elemental_blast) or BuffPresent(echoes_of_the_great_sundering_buff) and Spell(earthquake) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) { #liquid_magma_totem,if=raid_event.adds.count<3|raid_event.adds.in>50 if 0 < 3 or 600 > 50 Spell(liquid_magma_totem) } } AddFunction ElementalSinglelrShortCdPostConditions { { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or Spell(elemental_blast) or BuffPresent(echoes_of_the_great_sundering_buff) and Spell(earthquake) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and not SpellCooldown(lava_burst) > 0 and Spell(lava_burst) or Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or { Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) } and Spell(earth_shock) or { TotemRemaining(totem_mastery) < 10 or TotemRemaining(totem_mastery) < BaseDuration(ascendance_elemental_buff) + SpellCooldown(ascendance_elemental) and SpellCooldown(ascendance_elemental) < 15 } and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and target.DebuffExpires(lightning_rod_debuff) and Spell(lightning_bolt_elemental) or BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or Enemies() > 1 and Enemies() > 1 and target.DebuffExpires(lightning_rod_debuff) and Spell(chain_lightning) or Enemies() > 1 and Enemies() > 1 and Spell(chain_lightning) or target.DebuffExpires(lightning_rod_debuff) and Spell(lightning_bolt_elemental) or Spell(lightning_bolt_elemental) or Speed() > 0 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Speed() > 0 and Spell(earth_shock) or Speed() > 0 and target.Distance() > 6 and Spell(flame_shock) } AddFunction ElementalSinglelrCdActions { } AddFunction ElementalSinglelrCdPostConditions { { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or Spell(elemental_blast) or BuffPresent(echoes_of_the_great_sundering_buff) and Spell(earthquake) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) or { 0 < 3 or 600 > 50 } and Spell(liquid_magma_totem) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and not SpellCooldown(lava_burst) > 0 and Spell(lava_burst) or Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or { Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) } and Spell(earth_shock) or { TotemRemaining(totem_mastery) < 10 or TotemRemaining(totem_mastery) < BaseDuration(ascendance_elemental_buff) + SpellCooldown(ascendance_elemental) and SpellCooldown(ascendance_elemental) < 15 } and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and target.DebuffExpires(lightning_rod_debuff) and Spell(lightning_bolt_elemental) or BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or Enemies() > 1 and Enemies() > 1 and target.DebuffExpires(lightning_rod_debuff) and Spell(chain_lightning) or Enemies() > 1 and Enemies() > 1 and Spell(chain_lightning) or target.DebuffExpires(lightning_rod_debuff) and Spell(lightning_bolt_elemental) or Spell(lightning_bolt_elemental) or Speed() > 0 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Speed() > 0 and Spell(earth_shock) or Speed() > 0 and target.Distance() > 6 and Spell(flame_shock) } ### actions.single_if AddFunction ElementalSingleifMainActions { #flame_shock,if=!ticking|dot.flame_shock.remains<=gcd if not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() Spell(flame_shock) #earthquake,if=buff.echoes_of_the_great_sundering.up&maelstrom>=86 if BuffPresent(echoes_of_the_great_sundering_buff) and Maelstrom() >= 86 Spell(earthquake) #frost_shock,if=buff.icefury.up&maelstrom>=111&!buff.ascendance.up if BuffPresent(icefury_buff) and Maelstrom() >= 111 and not BuffPresent(ascendance_elemental_buff) Spell(frost_shock) #elemental_blast Spell(elemental_blast) #earth_shock,if=maelstrom>=117|!artifact.swelling_maelstrom.enabled&maelstrom>=92 if Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 Spell(earth_shock) #stormkeeper,if=raid_event.adds.count<3|raid_event.adds.in>50 if 0 < 3 or 600 > 50 Spell(stormkeeper) #icefury,if=(raid_event.movement.in<5|maelstrom<=101&artifact.swelling_maelstrom.enabled|!artifact.swelling_maelstrom.enabled&maelstrom<=76)&!buff.ascendance.up if { 600 < 5 or Maelstrom() <= 101 and HasArtifactTrait(swelling_maelstrom) or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() <= 76 } and not BuffPresent(ascendance_elemental_buff) Spell(icefury) #lightning_bolt,if=buff.power_of_the_maelstrom.up&buff.stormkeeper.up&spell_targets.chain_lightning<3 if BuffPresent(power_of_the_maelstrom_buff) and BuffPresent(stormkeeper_buff) and Enemies() < 3 Spell(lightning_bolt_elemental) #lava_burst,if=dot.flame_shock.remains>cast_time&cooldown_react if target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and not SpellCooldown(lava_burst) > 0 Spell(lava_burst) #frost_shock,if=buff.icefury.up&((maelstrom>=20&raid_event.movement.in>buff.icefury.remains)|buff.icefury.remains<(1.5*spell_haste*buff.icefury.stack+1)) if BuffPresent(icefury_buff) and { Maelstrom() >= 20 and 600 > BuffRemaining(icefury_buff) or BuffRemaining(icefury_buff) < 1 * { 100 / { 100 + SpellHaste() } } * BuffStacks(icefury_buff) + 1 } Spell(frost_shock) #flame_shock,if=maelstrom>=20&buff.elemental_focus.up,target_if=refreshable if Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) Spell(flame_shock) #frost_shock,moving=1,if=buff.icefury.up if Speed() > 0 and BuffPresent(icefury_buff) Spell(frost_shock) #earth_shock,if=maelstrom>=111|!artifact.swelling_maelstrom.enabled&maelstrom>=86|equipped.smoldering_heart&equipped.the_deceivers_blood_pact&maelstrom>70&talent.aftershock.enabled if Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) Spell(earth_shock) #totem_mastery,if=buff.resonance_totem.remains<10 if TotemRemaining(totem_mastery) < 10 and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 Spell(totem_mastery) #earthquake,if=buff.echoes_of_the_great_sundering.up if BuffPresent(echoes_of_the_great_sundering_buff) Spell(earthquake) #lightning_bolt,if=buff.power_of_the_maelstrom.up&spell_targets.chain_lightning<3 if BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 Spell(lightning_bolt_elemental) #chain_lightning,if=active_enemies>1&spell_targets.chain_lightning>1 if Enemies() > 1 and Enemies() > 1 Spell(chain_lightning) #lightning_bolt Spell(lightning_bolt_elemental) #flame_shock,moving=1,target_if=refreshable if Speed() > 0 and target.Refreshable(flame_shock_debuff) Spell(flame_shock) #earth_shock,moving=1 if Speed() > 0 Spell(earth_shock) #flame_shock,moving=1,if=movement.distance>6 if Speed() > 0 and target.Distance() > 6 Spell(flame_shock) } AddFunction ElementalSingleifMainPostConditions { } AddFunction ElementalSingleifShortCdActions { unless { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or BuffPresent(echoes_of_the_great_sundering_buff) and Maelstrom() >= 86 and Spell(earthquake) or BuffPresent(icefury_buff) and Maelstrom() >= 111 and not BuffPresent(ascendance_elemental_buff) and Spell(frost_shock) or Spell(elemental_blast) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) or { 600 < 5 or Maelstrom() <= 101 and HasArtifactTrait(swelling_maelstrom) or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() <= 76 } and not BuffPresent(ascendance_elemental_buff) and Spell(icefury) { #liquid_magma_totem,if=raid_event.adds.count<3|raid_event.adds.in>50 if 0 < 3 or 600 > 50 Spell(liquid_magma_totem) } } AddFunction ElementalSingleifShortCdPostConditions { { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or BuffPresent(echoes_of_the_great_sundering_buff) and Maelstrom() >= 86 and Spell(earthquake) or BuffPresent(icefury_buff) and Maelstrom() >= 111 and not BuffPresent(ascendance_elemental_buff) and Spell(frost_shock) or Spell(elemental_blast) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) or { 600 < 5 or Maelstrom() <= 101 and HasArtifactTrait(swelling_maelstrom) or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() <= 76 } and not BuffPresent(ascendance_elemental_buff) and Spell(icefury) or BuffPresent(power_of_the_maelstrom_buff) and BuffPresent(stormkeeper_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and not SpellCooldown(lava_burst) > 0 and Spell(lava_burst) or BuffPresent(icefury_buff) and { Maelstrom() >= 20 and 600 > BuffRemaining(icefury_buff) or BuffRemaining(icefury_buff) < 1 * { 100 / { 100 + SpellHaste() } } * BuffStacks(icefury_buff) + 1 } and Spell(frost_shock) or Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Speed() > 0 and BuffPresent(icefury_buff) and Spell(frost_shock) or { Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) } and Spell(earth_shock) or TotemRemaining(totem_mastery) < 10 and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or BuffPresent(echoes_of_the_great_sundering_buff) and Spell(earthquake) or BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or Enemies() > 1 and Enemies() > 1 and Spell(chain_lightning) or Spell(lightning_bolt_elemental) or Speed() > 0 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Speed() > 0 and Spell(earth_shock) or Speed() > 0 and target.Distance() > 6 and Spell(flame_shock) } AddFunction ElementalSingleifCdActions { } AddFunction ElementalSingleifCdPostConditions { { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or BuffPresent(echoes_of_the_great_sundering_buff) and Maelstrom() >= 86 and Spell(earthquake) or BuffPresent(icefury_buff) and Maelstrom() >= 111 and not BuffPresent(ascendance_elemental_buff) and Spell(frost_shock) or Spell(elemental_blast) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) or { 600 < 5 or Maelstrom() <= 101 and HasArtifactTrait(swelling_maelstrom) or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() <= 76 } and not BuffPresent(ascendance_elemental_buff) and Spell(icefury) or { 0 < 3 or 600 > 50 } and Spell(liquid_magma_totem) or BuffPresent(power_of_the_maelstrom_buff) and BuffPresent(stormkeeper_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and not SpellCooldown(lava_burst) > 0 and Spell(lava_burst) or BuffPresent(icefury_buff) and { Maelstrom() >= 20 and 600 > BuffRemaining(icefury_buff) or BuffRemaining(icefury_buff) < 1 * { 100 / { 100 + SpellHaste() } } * BuffStacks(icefury_buff) + 1 } and Spell(frost_shock) or Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Speed() > 0 and BuffPresent(icefury_buff) and Spell(frost_shock) or { Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) } and Spell(earth_shock) or TotemRemaining(totem_mastery) < 10 and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or BuffPresent(echoes_of_the_great_sundering_buff) and Spell(earthquake) or BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or Enemies() > 1 and Enemies() > 1 and Spell(chain_lightning) or Spell(lightning_bolt_elemental) or Speed() > 0 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Speed() > 0 and Spell(earth_shock) or Speed() > 0 and target.Distance() > 6 and Spell(flame_shock) } ### actions.single_asc AddFunction ElementalSingleascMainActions { #flame_shock,if=!ticking|dot.flame_shock.remains<=gcd if not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() Spell(flame_shock) #flame_shock,if=maelstrom>=20&remains<=buff.ascendance.duration&cooldown.ascendance.remains+buff.ascendance.duration<=duration if Maelstrom() >= 20 and target.DebuffRemaining(flame_shock_debuff) <= BaseDuration(ascendance_elemental_buff) and SpellCooldown(ascendance_elemental) + BaseDuration(ascendance_elemental_buff) <= BaseDuration(flame_shock_debuff) Spell(flame_shock) #elemental_blast Spell(elemental_blast) #earthquake,if=buff.echoes_of_the_great_sundering.up&!buff.ascendance.up&maelstrom>=86 if BuffPresent(echoes_of_the_great_sundering_buff) and not BuffPresent(ascendance_elemental_buff) and Maelstrom() >= 86 Spell(earthquake) #earth_shock,if=maelstrom>=117|!artifact.swelling_maelstrom.enabled&maelstrom>=92 if Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 Spell(earth_shock) #stormkeeper,if=raid_event.adds.count<3|raid_event.adds.in>50 if 0 < 3 or 600 > 50 Spell(stormkeeper) #lightning_bolt,if=buff.power_of_the_maelstrom.up&buff.stormkeeper.up&spell_targets.chain_lightning<3 if BuffPresent(power_of_the_maelstrom_buff) and BuffPresent(stormkeeper_buff) and Enemies() < 3 Spell(lightning_bolt_elemental) #lava_burst,if=dot.flame_shock.remains>cast_time&(cooldown_react|buff.ascendance.up) if target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and { not SpellCooldown(lava_burst) > 0 or BuffPresent(ascendance_elemental_buff) } Spell(lava_burst) #flame_shock,if=maelstrom>=20&buff.elemental_focus.up,target_if=refreshable if Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) Spell(flame_shock) #earth_shock,if=maelstrom>=111|!artifact.swelling_maelstrom.enabled&maelstrom>=86|equipped.smoldering_heart&equipped.the_deceivers_blood_pact&maelstrom>70&talent.aftershock.enabled if Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) Spell(earth_shock) #totem_mastery,if=buff.resonance_totem.remains<10|(buff.resonance_totem.remains<(buff.ascendance.duration+cooldown.ascendance.remains)&cooldown.ascendance.remains<15) if { TotemRemaining(totem_mastery) < 10 or TotemRemaining(totem_mastery) < BaseDuration(ascendance_elemental_buff) + SpellCooldown(ascendance_elemental) and SpellCooldown(ascendance_elemental) < 15 } and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 Spell(totem_mastery) #lava_beam,if=active_enemies>1&spell_targets.lava_beam>1 if Enemies() > 1 and Enemies() > 1 Spell(lava_beam) #lightning_bolt,if=buff.power_of_the_maelstrom.up&spell_targets.chain_lightning<3 if BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 Spell(lightning_bolt_elemental) #chain_lightning,if=active_enemies>1&spell_targets.chain_lightning>1 if Enemies() > 1 and Enemies() > 1 Spell(chain_lightning) #lightning_bolt Spell(lightning_bolt_elemental) #flame_shock,moving=1,target_if=refreshable if Speed() > 0 and target.Refreshable(flame_shock_debuff) Spell(flame_shock) #earth_shock,moving=1 if Speed() > 0 Spell(earth_shock) #flame_shock,moving=1,if=movement.distance>6 if Speed() > 0 and target.Distance() > 6 Spell(flame_shock) } AddFunction ElementalSingleascMainPostConditions { } AddFunction ElementalSingleascShortCdActions { unless { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or Maelstrom() >= 20 and target.DebuffRemaining(flame_shock_debuff) <= BaseDuration(ascendance_elemental_buff) and SpellCooldown(ascendance_elemental) + BaseDuration(ascendance_elemental_buff) <= BaseDuration(flame_shock_debuff) and Spell(flame_shock) or Spell(elemental_blast) or BuffPresent(echoes_of_the_great_sundering_buff) and not BuffPresent(ascendance_elemental_buff) and Maelstrom() >= 86 and Spell(earthquake) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) { #liquid_magma_totem,if=raid_event.adds.count<3|raid_event.adds.in>50 if 0 < 3 or 600 > 50 Spell(liquid_magma_totem) } } AddFunction ElementalSingleascShortCdPostConditions { { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or Maelstrom() >= 20 and target.DebuffRemaining(flame_shock_debuff) <= BaseDuration(ascendance_elemental_buff) and SpellCooldown(ascendance_elemental) + BaseDuration(ascendance_elemental_buff) <= BaseDuration(flame_shock_debuff) and Spell(flame_shock) or Spell(elemental_blast) or BuffPresent(echoes_of_the_great_sundering_buff) and not BuffPresent(ascendance_elemental_buff) and Maelstrom() >= 86 and Spell(earthquake) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) or BuffPresent(power_of_the_maelstrom_buff) and BuffPresent(stormkeeper_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and { not SpellCooldown(lava_burst) > 0 or BuffPresent(ascendance_elemental_buff) } and Spell(lava_burst) or Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or { Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) } and Spell(earth_shock) or { TotemRemaining(totem_mastery) < 10 or TotemRemaining(totem_mastery) < BaseDuration(ascendance_elemental_buff) + SpellCooldown(ascendance_elemental) and SpellCooldown(ascendance_elemental) < 15 } and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or Enemies() > 1 and Enemies() > 1 and Spell(lava_beam) or BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or Enemies() > 1 and Enemies() > 1 and Spell(chain_lightning) or Spell(lightning_bolt_elemental) or Speed() > 0 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Speed() > 0 and Spell(earth_shock) or Speed() > 0 and target.Distance() > 6 and Spell(flame_shock) } AddFunction ElementalSingleascCdActions { #ascendance,if=dot.flame_shock.remains>buff.ascendance.duration&(time>=60|buff.bloodlust.up)&cooldown.lava_burst.remains>0&!buff.stormkeeper.up if target.DebuffRemaining(flame_shock_debuff) > BaseDuration(ascendance_elemental_buff) and { TimeInCombat() >= 60 or BuffPresent(burst_haste_buff any=1) } and SpellCooldown(lava_burst) > 0 and not BuffPresent(stormkeeper_buff) and BuffExpires(ascendance_elemental_buff) Spell(ascendance_elemental) } AddFunction ElementalSingleascCdPostConditions { { not target.DebuffPresent(flame_shock_debuff) or target.DebuffRemaining(flame_shock_debuff) <= GCD() } and Spell(flame_shock) or Maelstrom() >= 20 and target.DebuffRemaining(flame_shock_debuff) <= BaseDuration(ascendance_elemental_buff) and SpellCooldown(ascendance_elemental) + BaseDuration(ascendance_elemental_buff) <= BaseDuration(flame_shock_debuff) and Spell(flame_shock) or Spell(elemental_blast) or BuffPresent(echoes_of_the_great_sundering_buff) and not BuffPresent(ascendance_elemental_buff) and Maelstrom() >= 86 and Spell(earthquake) or { Maelstrom() >= 117 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 92 } and Spell(earth_shock) or { 0 < 3 or 600 > 50 } and Spell(stormkeeper) or { 0 < 3 or 600 > 50 } and Spell(liquid_magma_totem) or BuffPresent(power_of_the_maelstrom_buff) and BuffPresent(stormkeeper_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and { not SpellCooldown(lava_burst) > 0 or BuffPresent(ascendance_elemental_buff) } and Spell(lava_burst) or Maelstrom() >= 20 and BuffPresent(elemental_focus_buff) and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or { Maelstrom() >= 111 or not HasArtifactTrait(swelling_maelstrom) and Maelstrom() >= 86 or HasEquippedItem(smoldering_heart) and HasEquippedItem(the_deceivers_blood_pact) and Maelstrom() > 70 and Talent(aftershock_talent) } and Spell(earth_shock) or { TotemRemaining(totem_mastery) < 10 or TotemRemaining(totem_mastery) < BaseDuration(ascendance_elemental_buff) + SpellCooldown(ascendance_elemental) and SpellCooldown(ascendance_elemental) < 15 } and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or Enemies() > 1 and Enemies() > 1 and Spell(lava_beam) or BuffPresent(power_of_the_maelstrom_buff) and Enemies() < 3 and Spell(lightning_bolt_elemental) or Enemies() > 1 and Enemies() > 1 and Spell(chain_lightning) or Spell(lightning_bolt_elemental) or Speed() > 0 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Speed() > 0 and Spell(earth_shock) or Speed() > 0 and target.Distance() > 6 and Spell(flame_shock) } ### actions.precombat AddFunction ElementalPrecombatMainActions { #totem_mastery if { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 Spell(totem_mastery) #stormkeeper Spell(stormkeeper) } AddFunction ElementalPrecombatMainPostConditions { } AddFunction ElementalPrecombatShortCdActions { } AddFunction ElementalPrecombatShortCdPostConditions { { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or Spell(stormkeeper) } AddFunction ElementalPrecombatCdActions { #flask #food #augmentation #snapshot_stats #potion if CheckBoxOn(opt_use_consumables) and target.Classification(worldboss) Item(prolonged_power_potion usable=1) } AddFunction ElementalPrecombatCdPostConditions { { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or Spell(stormkeeper) } ### actions.aoe AddFunction ElementalAoeMainActions { #stormkeeper Spell(stormkeeper) #flame_shock,if=spell_targets.chain_lightning<4&maelstrom>=20,target_if=refreshable if Enemies() < 4 and Maelstrom() >= 20 and target.Refreshable(flame_shock_debuff) Spell(flame_shock) #earthquake Spell(earthquake) #lava_burst,if=dot.flame_shock.remains>cast_time&buff.lava_surge.up&!talent.lightning_rod.enabled&spell_targets.chain_lightning<4 if target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and BuffPresent(lava_surge_buff) and not Talent(lightning_rod_talent) and Enemies() < 4 Spell(lava_burst) #elemental_blast,if=!talent.lightning_rod.enabled&spell_targets.chain_lightning<5|talent.lightning_rod.enabled&spell_targets.chain_lightning<4 if not Talent(lightning_rod_talent) and Enemies() < 5 or Talent(lightning_rod_talent) and Enemies() < 4 Spell(elemental_blast) #lava_beam Spell(lava_beam) #chain_lightning,target_if=debuff.lightning_rod.down if target.DebuffExpires(lightning_rod_debuff) Spell(chain_lightning) #chain_lightning Spell(chain_lightning) #lava_burst,moving=1 if Speed() > 0 Spell(lava_burst) #flame_shock,moving=1,target_if=refreshable if Speed() > 0 and target.Refreshable(flame_shock_debuff) Spell(flame_shock) } AddFunction ElementalAoeMainPostConditions { } AddFunction ElementalAoeShortCdActions { unless Spell(stormkeeper) { #liquid_magma_totem Spell(liquid_magma_totem) } } AddFunction ElementalAoeShortCdPostConditions { Spell(stormkeeper) or Enemies() < 4 and Maelstrom() >= 20 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Spell(earthquake) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and BuffPresent(lava_surge_buff) and not Talent(lightning_rod_talent) and Enemies() < 4 and Spell(lava_burst) or { not Talent(lightning_rod_talent) and Enemies() < 5 or Talent(lightning_rod_talent) and Enemies() < 4 } and Spell(elemental_blast) or Spell(lava_beam) or target.DebuffExpires(lightning_rod_debuff) and Spell(chain_lightning) or Spell(chain_lightning) or Speed() > 0 and Spell(lava_burst) or Speed() > 0 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) } AddFunction ElementalAoeCdActions { unless Spell(stormkeeper) { #ascendance if BuffExpires(ascendance_elemental_buff) Spell(ascendance_elemental) } } AddFunction ElementalAoeCdPostConditions { Spell(stormkeeper) or Spell(liquid_magma_totem) or Enemies() < 4 and Maelstrom() >= 20 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) or Spell(earthquake) or target.DebuffRemaining(flame_shock_debuff) > CastTime(lava_burst) and BuffPresent(lava_surge_buff) and not Talent(lightning_rod_talent) and Enemies() < 4 and Spell(lava_burst) or { not Talent(lightning_rod_talent) and Enemies() < 5 or Talent(lightning_rod_talent) and Enemies() < 4 } and Spell(elemental_blast) or Spell(lava_beam) or target.DebuffExpires(lightning_rod_debuff) and Spell(chain_lightning) or Spell(chain_lightning) or Speed() > 0 and Spell(lava_burst) or Speed() > 0 and target.Refreshable(flame_shock_debuff) and Spell(flame_shock) } ### actions.default AddFunction ElementalDefaultMainActions { #totem_mastery,if=buff.resonance_totem.remains<2 if TotemRemaining(totem_mastery) < 2 and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 Spell(totem_mastery) #storm_elemental Spell(storm_elemental) #run_action_list,name=aoe,if=active_enemies>2&(spell_targets.chain_lightning>2|spell_targets.lava_beam>2) if Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } ElementalAoeMainActions() unless Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } and ElementalAoeMainPostConditions() { #run_action_list,name=single_asc,if=talent.ascendance.enabled if Talent(ascendance_talent) ElementalSingleascMainActions() unless Talent(ascendance_talent) and ElementalSingleascMainPostConditions() { #run_action_list,name=single_if,if=talent.icefury.enabled if Talent(icefury_talent) ElementalSingleifMainActions() unless Talent(icefury_talent) and ElementalSingleifMainPostConditions() { #run_action_list,name=single_lr,if=talent.lightning_rod.enabled if Talent(lightning_rod_talent) ElementalSinglelrMainActions() } } } } AddFunction ElementalDefaultMainPostConditions { Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } and ElementalAoeMainPostConditions() or Talent(ascendance_talent) and ElementalSingleascMainPostConditions() or Talent(icefury_talent) and ElementalSingleifMainPostConditions() or Talent(lightning_rod_talent) and ElementalSinglelrMainPostConditions() } AddFunction ElementalDefaultShortCdActions { unless TotemRemaining(totem_mastery) < 2 and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or Spell(storm_elemental) { #run_action_list,name=aoe,if=active_enemies>2&(spell_targets.chain_lightning>2|spell_targets.lava_beam>2) if Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } ElementalAoeShortCdActions() unless Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } and ElementalAoeShortCdPostConditions() { #run_action_list,name=single_asc,if=talent.ascendance.enabled if Talent(ascendance_talent) ElementalSingleascShortCdActions() unless Talent(ascendance_talent) and ElementalSingleascShortCdPostConditions() { #run_action_list,name=single_if,if=talent.icefury.enabled if Talent(icefury_talent) ElementalSingleifShortCdActions() unless Talent(icefury_talent) and ElementalSingleifShortCdPostConditions() { #run_action_list,name=single_lr,if=talent.lightning_rod.enabled if Talent(lightning_rod_talent) ElementalSinglelrShortCdActions() } } } } } AddFunction ElementalDefaultShortCdPostConditions { TotemRemaining(totem_mastery) < 2 and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or Spell(storm_elemental) or Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } and ElementalAoeShortCdPostConditions() or Talent(ascendance_talent) and ElementalSingleascShortCdPostConditions() or Talent(icefury_talent) and ElementalSingleifShortCdPostConditions() or Talent(lightning_rod_talent) and ElementalSinglelrShortCdPostConditions() } AddFunction ElementalDefaultCdActions { #bloodlust,if=target.health.pct<25|time>0.500 if target.HealthPercent() < 25 or TimeInCombat() > 0 ElementalBloodlust() #potion,if=cooldown.fire_elemental.remains>280|target.time_to_die<=60 if { SpellCooldown(fire_elemental) > 280 or target.TimeToDie() <= 60 } and CheckBoxOn(opt_use_consumables) and target.Classification(worldboss) Item(prolonged_power_potion usable=1) #wind_shear ElementalInterruptActions() unless TotemRemaining(totem_mastery) < 2 and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) { #fire_elemental Spell(fire_elemental) unless Spell(storm_elemental) { #elemental_mastery Spell(elemental_mastery) #use_items ElementalUseItemActions() #use_item,name=gnawed_thumb_ring,if=equipped.gnawed_thumb_ring&(talent.ascendance.enabled&!buff.ascendance.up|!talent.ascendance.enabled) if HasEquippedItem(gnawed_thumb_ring) and { Talent(ascendance_talent) and not BuffPresent(ascendance_elemental_buff) or not Talent(ascendance_talent) } ElementalUseItemActions() #blood_fury,if=!talent.ascendance.enabled|buff.ascendance.up|cooldown.ascendance.remains>50 if not Talent(ascendance_talent) or BuffPresent(ascendance_elemental_buff) or SpellCooldown(ascendance_elemental) > 50 Spell(blood_fury_apsp) #berserking,if=!talent.ascendance.enabled|buff.ascendance.up if not Talent(ascendance_talent) or BuffPresent(ascendance_elemental_buff) Spell(berserking) #run_action_list,name=aoe,if=active_enemies>2&(spell_targets.chain_lightning>2|spell_targets.lava_beam>2) if Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } ElementalAoeCdActions() unless Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } and ElementalAoeCdPostConditions() { #run_action_list,name=single_asc,if=talent.ascendance.enabled if Talent(ascendance_talent) ElementalSingleascCdActions() unless Talent(ascendance_talent) and ElementalSingleascCdPostConditions() { #run_action_list,name=single_if,if=talent.icefury.enabled if Talent(icefury_talent) ElementalSingleifCdActions() unless Talent(icefury_talent) and ElementalSingleifCdPostConditions() { #run_action_list,name=single_lr,if=talent.lightning_rod.enabled if Talent(lightning_rod_talent) ElementalSinglelrCdActions() } } } } } } AddFunction ElementalDefaultCdPostConditions { TotemRemaining(totem_mastery) < 2 and { not TotemPresent(totem_mastery) or InCombat() } and Speed() == 0 and Spell(totem_mastery) or Spell(storm_elemental) or Enemies() > 2 and { Enemies() > 2 or Enemies() > 2 } and ElementalAoeCdPostConditions() or Talent(ascendance_talent) and ElementalSingleascCdPostConditions() or Talent(icefury_talent) and ElementalSingleifCdPostConditions() or Talent(lightning_rod_talent) and ElementalSinglelrCdPostConditions() } ### Elemental icons. AddCheckBox(opt_shaman_elemental_aoe L(AOE) default specialization=elemental) AddIcon checkbox=!opt_shaman_elemental_aoe enemies=1 help=shortcd specialization=elemental { if not InCombat() ElementalPrecombatShortCdActions() unless not InCombat() and ElementalPrecombatShortCdPostConditions() { ElementalDefaultShortCdActions() } } AddIcon checkbox=opt_shaman_elemental_aoe help=shortcd specialization=elemental { if not InCombat() ElementalPrecombatShortCdActions() unless not InCombat() and ElementalPrecombatShortCdPostConditions() { ElementalDefaultShortCdActions() } } AddIcon enemies=1 help=main specialization=elemental { if not InCombat() ElementalPrecombatMainActions() unless not InCombat() and ElementalPrecombatMainPostConditions() { ElementalDefaultMainActions() } } AddIcon checkbox=opt_shaman_elemental_aoe help=aoe specialization=elemental { if not InCombat() ElementalPrecombatMainActions() unless not InCombat() and ElementalPrecombatMainPostConditions() { ElementalDefaultMainActions() } } AddIcon checkbox=!opt_shaman_elemental_aoe enemies=1 help=cd specialization=elemental { if not InCombat() ElementalPrecombatCdActions() unless not InCombat() and ElementalPrecombatCdPostConditions() { ElementalDefaultCdActions() } } AddIcon checkbox=opt_shaman_elemental_aoe help=cd specialization=elemental { if not InCombat() ElementalPrecombatCdActions() unless not InCombat() and ElementalPrecombatCdPostConditions() { ElementalDefaultCdActions() } } ### Required symbols # flame_shock # flame_shock_debuff # elemental_blast # earthquake # echoes_of_the_great_sundering_buff # earth_shock # swelling_maelstrom # stormkeeper # liquid_magma_totem # lava_burst # elemental_focus_buff # smoldering_heart # the_deceivers_blood_pact # aftershock_talent # totem_mastery # ascendance_elemental_buff # ascendance_elemental # lightning_bolt_elemental # power_of_the_maelstrom_buff # lightning_rod_debuff # chain_lightning # frost_shock # icefury_buff # icefury # stormkeeper_buff # lava_beam # prolonged_power_potion # lava_surge_buff # lightning_rod_talent # fire_elemental # storm_elemental # elemental_mastery # gnawed_thumb_ring # ascendance_talent # blood_fury_apsp # berserking # icefury_talent # bloodlust # heroism # hex # war_stomp # quaking_palm # lightning_surge_totem # wind_shear ]] OvaleScripts:RegisterScript("SHAMAN", "elemental", name, desc, code, "script") end do local name = "sc_shaman_enhancement_t19" local desc = "[7.0] Simulationcraft: Shaman_Enhancement_T19" local code = [[ # Based on SimulationCraft profile "Shaman_Enhancement_T19P". # class=shaman # spec=enhancement # talents=2002222 Include(ovale_common) Include(ovale_trinkets_mop) Include(ovale_trinkets_wod) Include(ovale_shaman_spells) AddFunction alphaWolfCheck { pet.BuffRemaining(frost_wolf_alpha_wolf_buff) < 2 and pet.BuffRemaining(fiery_wolf_alpha_wolf_buff) < 2 and pet.BuffRemaining(lightning_wolf_alpha_wolf_buff) < 2 and TotemRemaining(sprit_wolf) > 4 } AddFunction LightningCrashNotUp { not BuffPresent(lightning_crash_buff) and ArmorSetBonus(T20 2) } AddFunction akainuAS { akainuEquipped() and BuffPresent(hot_hand_buff) and not BuffPresent(frostbrand_buff) } AddFunction akainuEquipped { HasEquippedItem(137084) } AddFunction heartEquipped { HasEquippedItem(151819) } AddFunction OCPool60 { not Talent(overcharge_talent) or Talent(overcharge_talent) and Maelstrom() > 60 } AddFunction OCPool70 { not Talent(overcharge_talent) or Talent(overcharge_talent) and Maelstrom() > 70 } AddFunction furyCheck25 { not Talent(fury_of_air_talent) or Talent(fury_of_air_talent) and Maelstrom() > 25 } AddFunction furyCheck45 { not Talent(fury_of_air_talent) or Talent(fury_of_air_talent) and Maelstrom() > 45 } AddFunction furyCheck70 { not Talent(fury_of_air_talent) or Talent(fury_of_air_talent) and Maelstrom() > 70 } AddFunction furyCheck80 { not Talent(fury_of_air_talent) or Talent(fury_of_air_talent) and Maelstrom() > 80 } AddFunction hailstormCheck { Talent(hailstorm_talent) and not BuffPresent(frostbrand_buff) or not Talent(hailstorm_talent) } AddCheckBox(opt_interrupt L(interrupt) default specialization=enhancement) AddCheckBox(opt_melee_range L(not_in_melee_range) specialization=enhancement) AddCheckBox(opt_use_consumables L(opt_use_consumables) default specialization=enhancement) AddCheckBox(opt_bloodlust SpellName(bloodlust) specialization=enhancement) AddFunction EnhancementInterruptActions { if CheckBoxOn(opt_interrupt) and not target.IsFriend() and target.Casting() { if target.InRange(hex) and not target.Classification(worldboss) and target.RemainingCastTime() > CastTime(hex) + GCDRemaining() and target.CreatureType(Humanoid Beast) Spell(hex) if target.Distance(less 5) and not target.Classification(worldboss) Spell(war_stomp) if target.InRange(quaking_palm) and not target.Classification(worldboss) Spell(quaking_palm) if not target.Classification(worldboss) and target.RemainingCastTime() > 2 Spell(lightning_surge_totem) if target.Distance(less 5) and not target.Classification(worldboss) Spell(sundering) if target.InRange(wind_shear) and target.IsInterruptible() Spell(wind_shear) } } AddFunction EnhancementUseItemActions { Item(Trinket0Slot text=13 usable=1) Item(Trinket1Slot text=14 usable=1) } AddFunction EnhancementBloodlust { if CheckBoxOn(opt_bloodlust) and DebuffExpires(burst_haste_debuff any=1) { Spell(bloodlust) Spell(heroism) } } AddFunction EnhancementGetInMeleeRange { if CheckBoxOn(opt_melee_range) and not target.InRange(stormstrike) { if target.InRange(feral_lunge) Spell(feral_lunge) Texture(misc_arrowlup help=L(not_in_melee_range)) } } ### actions.precombat AddFunction EnhancementPrecombatMainActions { #lightning_shield Spell(lightning_shield) } AddFunction EnhancementPrecombatMainPostConditions { } AddFunction EnhancementPrecombatShortCdActions { } AddFunction EnhancementPrecombatShortCdPostConditions { Spell(lightning_shield) } AddFunction EnhancementPrecombatCdActions { #flask #food #augmentation #snapshot_stats #potion if CheckBoxOn(opt_use_consumables) and target.Classification(worldboss) Item(prolonged_power_potion usable=1) } AddFunction EnhancementPrecombatCdPostConditions { Spell(lightning_shield) } ### actions.opener AddFunction EnhancementOpenerMainActions { #rockbiter,if=maelstrom<15&time<gcd if Maelstrom() < 15 and TimeInCombat() < GCD() Spell(rockbiter) } AddFunction EnhancementOpenerMainPostConditions { } AddFunction EnhancementOpenerShortCdActions { } AddFunction EnhancementOpenerShortCdPostConditions { Maelstrom() < 15 and TimeInCombat() < GCD() and Spell(rockbiter) } AddFunction EnhancementOpenerCdActions { } AddFunction EnhancementOpenerCdPostConditions { Maelstrom() < 15 and TimeInCombat() < GCD() and Spell(rockbiter) } ### actions.filler AddFunction EnhancementFillerMainActions { #rockbiter,if=maelstrom<120 if Maelstrom() < 120 Spell(rockbiter) #flametongue,if=buff.flametongue.remains<4.8 if BuffRemaining(flametongue_buff) < 4 Spell(flametongue) #crash_lightning,if=(talent.crashing_storm.enabled|active_enemies>=2)&debuff.earthen_spike.up&maelstrom>=40&variable.OCPool60 if { Talent(crashing_storm_talent) or Enemies() >= 2 } and target.DebuffPresent(earthen_spike_debuff) and Maelstrom() >= 40 and OCPool60() Spell(crash_lightning) #frostbrand,if=talent.hailstorm.enabled&buff.frostbrand.remains<4.8&maelstrom>40 if Talent(hailstorm_talent) and BuffRemaining(frostbrand_buff) < 4 and Maelstrom() > 40 Spell(frostbrand) #frostbrand,if=variable.akainuEquipped&!buff.frostbrand.up&maelstrom>=75 if akainuEquipped() and not BuffPresent(frostbrand_buff) and Maelstrom() >= 75 Spell(frostbrand) #sundering Spell(sundering) #lava_lash,if=maelstrom>=50&variable.OCPool70&variable.furyCheck80 if Maelstrom() >= 50 and OCPool70() and furyCheck80() Spell(lava_lash) #rockbiter Spell(rockbiter) #crash_lightning,if=(maelstrom>=65|talent.crashing_storm.enabled|active_enemies>=2)&variable.OCPool60&variable.furyCheck45 if { Maelstrom() >= 65 or Talent(crashing_storm_talent) or Enemies() >= 2 } and OCPool60() and furyCheck45() Spell(crash_lightning) #flametongue Spell(flametongue) } AddFunction EnhancementFillerMainPostConditions { } AddFunction EnhancementFillerShortCdActions { } AddFunction EnhancementFillerShortCdPostConditions { Maelstrom() < 120 and Spell(rockbiter) or BuffRemaining(flametongue_buff) < 4 and Spell(flametongue) or { Talent(crashing_storm_talent) or Enemies() >= 2 } and target.DebuffPresent(earthen_spike_debuff) and Maelstrom() >= 40 and OCPool60() and Spell(crash_lightning) or Talent(hailstorm_talent) and BuffRemaining(frostbrand_buff) < 4 and Maelstrom() > 40 and Spell(frostbrand) or akainuEquipped() and not BuffPresent(frostbrand_buff) and Maelstrom() >= 75 and Spell(frostbrand) or Spell(sundering) or Maelstrom() >= 50 and OCPool70() and furyCheck80() and Spell(lava_lash) or Spell(rockbiter) or { Maelstrom() >= 65 or Talent(crashing_storm_talent) or Enemies() >= 2 } and OCPool60() and furyCheck45() and Spell(crash_lightning) or Spell(flametongue) } AddFunction EnhancementFillerCdActions { } AddFunction EnhancementFillerCdPostConditions { Maelstrom() < 120 and Spell(rockbiter) or BuffRemaining(flametongue_buff) < 4 and Spell(flametongue) or { Talent(crashing_storm_talent) or Enemies() >= 2 } and target.DebuffPresent(earthen_spike_debuff) and Maelstrom() >= 40 and OCPool60() and Spell(crash_lightning) or Talent(hailstorm_talent) and BuffRemaining(frostbrand_buff) < 4 and Maelstrom() > 40 and Spell(frostbrand) or akainuEquipped() and not BuffPresent(frostbrand_buff) and Maelstrom() >= 75 and Spell(frostbrand) or Spell(sundering) or Maelstrom() >= 50 and OCPool70() and furyCheck80() and Spell(lava_lash) or Spell(rockbiter) or { Maelstrom() >= 65 or Talent(crashing_storm_talent) or Enemies() >= 2 } and OCPool60() and furyCheck45() and Spell(crash_lightning) or Spell(flametongue) } ### actions.core AddFunction EnhancementCoreMainActions { #earthen_spike,if=variable.furyCheck25 if furyCheck25() Spell(earthen_spike) #crash_lightning,if=!buff.crash_lightning.up&active_enemies>=2 if not BuffPresent(crash_lightning_buff) and Enemies() >= 2 Spell(crash_lightning) #crash_lightning,if=active_enemies>=8|(active_enemies>=6&talent.crashing_storm.enabled) if Enemies() >= 8 or Enemies() >= 6 and Talent(crashing_storm_talent) Spell(crash_lightning) #windstrike Spell(windstrike) #stormstrike,if=buff.stormbringer.up&variable.furyCheck25 if BuffPresent(stormbringer_buff) and furyCheck25() Spell(stormstrike) #crash_lightning,if=active_enemies>=4|(active_enemies>=2&talent.crashing_storm.enabled) if Enemies() >= 4 or Enemies() >= 2 and Talent(crashing_storm_talent) Spell(crash_lightning) #lightning_bolt,if=talent.overcharge.enabled&variable.furyCheck45&maelstrom>=40 if Talent(overcharge_talent) and furyCheck45() and Maelstrom() >= 40 Spell(lightning_bolt_enhancement) #stormstrike,if=(!talent.overcharge.enabled&variable.furyCheck45)|(talent.overcharge.enabled&variable.furyCheck80) if not Talent(overcharge_talent) and furyCheck45() or Talent(overcharge_talent) and furyCheck80() Spell(stormstrike) #frostbrand,if=variable.akainuAS if akainuAS() Spell(frostbrand) #lava_lash,if=buff.hot_hand.react&((variable.akainuEquipped&buff.frostbrand.up)|!variable.akainuEquipped) if BuffPresent(hot_hand_buff) and { akainuEquipped() and BuffPresent(frostbrand_buff) or not akainuEquipped() } Spell(lava_lash) #sundering,if=active_enemies>=3 if Enemies() >= 3 Spell(sundering) #crash_lightning,if=active_enemies>=3|variable.LightningCrashNotUp|variable.alphaWolfCheck if Enemies() >= 3 or LightningCrashNotUp() or alphaWolfCheck() Spell(crash_lightning) } AddFunction EnhancementCoreMainPostConditions { } AddFunction EnhancementCoreShortCdActions { unless furyCheck25() and Spell(earthen_spike) or not BuffPresent(crash_lightning_buff) and Enemies() >= 2 and Spell(crash_lightning) { #windsong Spell(windsong) } } AddFunction EnhancementCoreShortCdPostConditions { furyCheck25() and Spell(earthen_spike) or not BuffPresent(crash_lightning_buff) and Enemies() >= 2 and Spell(crash_lightning) or { Enemies() >= 8 or Enemies() >= 6 and Talent(crashing_storm_talent) } and Spell(crash_lightning) or Spell(windstrike) or BuffPresent(stormbringer_buff) and furyCheck25() and Spell(stormstrike) or { Enemies() >= 4 or Enemies() >= 2 and Talent(crashing_storm_talent) } and Spell(crash_lightning) or Talent(overcharge_talent) and furyCheck45() and Maelstrom() >= 40 and Spell(lightning_bolt_enhancement) or { not Talent(overcharge_talent) and furyCheck45() or Talent(overcharge_talent) and furyCheck80() } and Spell(stormstrike) or akainuAS() and Spell(frostbrand) or BuffPresent(hot_hand_buff) and { akainuEquipped() and BuffPresent(frostbrand_buff) or not akainuEquipped() } and Spell(lava_lash) or Enemies() >= 3 and Spell(sundering) or { Enemies() >= 3 or LightningCrashNotUp() or alphaWolfCheck() } and Spell(crash_lightning) } AddFunction EnhancementCoreCdActions { } AddFunction EnhancementCoreCdPostConditions { furyCheck25() and Spell(earthen_spike) or not BuffPresent(crash_lightning_buff) and Enemies() >= 2 and Spell(crash_lightning) or Spell(windsong) or { Enemies() >= 8 or Enemies() >= 6 and Talent(crashing_storm_talent) } and Spell(crash_lightning) or Spell(windstrike) or BuffPresent(stormbringer_buff) and furyCheck25() and Spell(stormstrike) or { Enemies() >= 4 or Enemies() >= 2 and Talent(crashing_storm_talent) } and Spell(crash_lightning) or Talent(overcharge_talent) and furyCheck45() and Maelstrom() >= 40 and Spell(lightning_bolt_enhancement) or { not Talent(overcharge_talent) and furyCheck45() or Talent(overcharge_talent) and furyCheck80() } and Spell(stormstrike) or akainuAS() and Spell(frostbrand) or BuffPresent(hot_hand_buff) and { akainuEquipped() and BuffPresent(frostbrand_buff) or not akainuEquipped() } and Spell(lava_lash) or Enemies() >= 3 and Spell(sundering) or { Enemies() >= 3 or LightningCrashNotUp() or alphaWolfCheck() } and Spell(crash_lightning) } ### actions.cds AddFunction EnhancementCdsMainActions { } AddFunction EnhancementCdsMainPostConditions { } AddFunction EnhancementCdsShortCdActions { #doom_winds,if=cooldown.ascendance.remains>6|talent.boulderfist.enabled|debuff.earthen_spike.up if SpellCooldown(ascendance_enhancement) > 6 or Talent(boulderfist_talent) or target.DebuffPresent(earthen_spike_debuff) Spell(doom_winds) } AddFunction EnhancementCdsShortCdPostConditions { } AddFunction EnhancementCdsCdActions { #bloodlust,if=target.health.pct<25|time>0.500 if target.HealthPercent() < 25 or TimeInCombat() > 0 EnhancementBloodlust() #berserking,if=buff.ascendance.up|(feral_spirit.remains>5)|level<100 if BuffPresent(ascendance_enhancement_buff) or TotemRemaining(sprit_wolf) > 5 or Level() < 100 Spell(berserking) #blood_fury,if=buff.ascendance.up|(feral_spirit.remains>5)|level<100 if BuffPresent(ascendance_enhancement_buff) or TotemRemaining(sprit_wolf) > 5 or Level() < 100 Spell(blood_fury_apsp) #potion,if=buff.ascendance.up|!talent.ascendance.enabled&feral_spirit.remains>5|target.time_to_die<=60 if { BuffPresent(ascendance_enhancement_buff) or not Talent(ascendance_talent) and TotemRemaining(sprit_wolf) > 5 or target.TimeToDie() <= 60 } and CheckBoxOn(opt_use_consumables) and target.Classification(worldboss) Item(prolonged_power_potion usable=1) #feral_spirit Spell(feral_spirit) unless { SpellCooldown(ascendance_enhancement) > 6 or Talent(boulderfist_talent) or target.DebuffPresent(earthen_spike_debuff) } and Spell(doom_winds) { #ascendance,if=(cooldown.strike.remains>0)&buff.ascendance.down if SpellCooldown(stormstrike) > 0 and BuffExpires(ascendance_enhancement_buff) and BuffExpires(ascendance_enhancement_buff) Spell(ascendance_enhancement) } } AddFunction EnhancementCdsCdPostConditions { { SpellCooldown(ascendance_enhancement) > 6 or Talent(boulderfist_talent) or target.DebuffPresent(earthen_spike_debuff) } and Spell(doom_winds) } ### actions.buffs AddFunction EnhancementBuffsMainActions { #rockbiter,if=talent.landslide.enabled&!buff.landslide.up if Talent(landslide_talent) and not BuffPresent(landslide_buff) Spell(rockbiter) #fury_of_air,if=!ticking&maelstrom>22 if not target.DebuffPresent(fury_of_air_debuff) and Maelstrom() > 22 Spell(fury_of_air) #crash_lightning,if=artifact.alpha_wolf.rank&prev_gcd.1.feral_spirit if ArtifactTraitRank(alpha_wolf) and PreviousGCDSpell(feral_spirit) Spell(crash_lightning) #flametongue,if=!buff.flametongue.up if not BuffPresent(flametongue_buff) Spell(flametongue) #frostbrand,if=talent.hailstorm.enabled&!buff.frostbrand.up&variable.furyCheck45 if Talent(hailstorm_talent) and not BuffPresent(frostbrand_buff) and furyCheck45() Spell(frostbrand) #flametongue,if=buff.flametongue.remains<6+gcd&cooldown.doom_winds.remains<gcd*2 if BuffRemaining(flametongue_buff) < 6 + GCD() and SpellCooldown(doom_winds) < GCD() * 2 Spell(flametongue) #frostbrand,if=talent.hailstorm.enabled&buff.frostbrand.remains<6+gcd&cooldown.doom_winds.remains<gcd*2 if Talent(hailstorm_talent) and BuffRemaining(frostbrand_buff) < 6 + GCD() and SpellCooldown(doom_winds) < GCD() * 2 Spell(frostbrand) } AddFunction EnhancementBuffsMainPostConditions { } AddFunction EnhancementBuffsShortCdActions { } AddFunction EnhancementBuffsShortCdPostConditions { Talent(landslide_talent) and not BuffPresent(landslide_buff) and Spell(rockbiter) or not target.DebuffPresent(fury_of_air_debuff) and Maelstrom() > 22 and Spell(fury_of_air) or ArtifactTraitRank(alpha_wolf) and PreviousGCDSpell(feral_spirit) and Spell(crash_lightning) or not BuffPresent(flametongue_buff) and Spell(flametongue) or Talent(hailstorm_talent) and not BuffPresent(frostbrand_buff) and furyCheck45() and Spell(frostbrand) or BuffRemaining(flametongue_buff) < 6 + GCD() and SpellCooldown(doom_winds) < GCD() * 2 and Spell(flametongue) or Talent(hailstorm_talent) and BuffRemaining(frostbrand_buff) < 6 + GCD() and SpellCooldown(doom_winds) < GCD() * 2 and Spell(frostbrand) } AddFunction EnhancementBuffsCdActions { } AddFunction EnhancementBuffsCdPostConditions { Talent(landslide_talent) and not BuffPresent(landslide_buff) and Spell(rockbiter) or not target.DebuffPresent(fury_of_air_debuff) and Maelstrom() > 22 and Spell(fury_of_air) or ArtifactTraitRank(alpha_wolf) and PreviousGCDSpell(feral_spirit) and Spell(crash_lightning) or not BuffPresent(flametongue_buff) and Spell(flametongue) or Talent(hailstorm_talent) and not BuffPresent(frostbrand_buff) and furyCheck45() and Spell(frostbrand) or BuffRemaining(flametongue_buff) < 6 + GCD() and SpellCooldown(doom_winds) < GCD() * 2 and Spell(flametongue) or Talent(hailstorm_talent) and BuffRemaining(frostbrand_buff) < 6 + GCD() and SpellCooldown(doom_winds) < GCD() * 2 and Spell(frostbrand) } ### actions.asc AddFunction EnhancementAscMainActions { #earthen_spike Spell(earthen_spike) #windstrike Spell(windstrike) } AddFunction EnhancementAscMainPostConditions { } AddFunction EnhancementAscShortCdActions { unless Spell(earthen_spike) { #doom_winds,if=cooldown.strike.up if not SpellCooldown(stormstrike) > 0 Spell(doom_winds) } } AddFunction EnhancementAscShortCdPostConditions { Spell(earthen_spike) or Spell(windstrike) } AddFunction EnhancementAscCdActions { } AddFunction EnhancementAscCdPostConditions { Spell(earthen_spike) or not SpellCooldown(stormstrike) > 0 and Spell(doom_winds) or Spell(windstrike) } ### actions.default AddFunction EnhancementDefaultMainActions { #call_action_list,name=opener EnhancementOpenerMainActions() unless EnhancementOpenerMainPostConditions() { #call_action_list,name=asc,if=buff.ascendance.up if BuffPresent(ascendance_enhancement_buff) EnhancementAscMainActions() unless BuffPresent(ascendance_enhancement_buff) and EnhancementAscMainPostConditions() { #call_action_list,name=buffs EnhancementBuffsMainActions() unless EnhancementBuffsMainPostConditions() { #call_action_list,name=cds EnhancementCdsMainActions() unless EnhancementCdsMainPostConditions() { #call_action_list,name=core EnhancementCoreMainActions() unless EnhancementCoreMainPostConditions() { #call_action_list,name=filler EnhancementFillerMainActions() } } } } } } AddFunction EnhancementDefaultMainPostConditions { EnhancementOpenerMainPostConditions() or BuffPresent(ascendance_enhancement_buff) and EnhancementAscMainPostConditions() or EnhancementBuffsMainPostConditions() or EnhancementCdsMainPostConditions() or EnhancementCoreMainPostConditions() or EnhancementFillerMainPostConditions() } AddFunction EnhancementDefaultShortCdActions { #variable,name=hailstormCheck,value=((talent.hailstorm.enabled&!buff.frostbrand.up)|!talent.hailstorm.enabled) #variable,name=furyCheck80,value=(!talent.fury_of_air.enabled|(talent.fury_of_air.enabled&maelstrom>80)) #variable,name=furyCheck70,value=(!talent.fury_of_air.enabled|(talent.fury_of_air.enabled&maelstrom>70)) #variable,name=furyCheck45,value=(!talent.fury_of_air.enabled|(talent.fury_of_air.enabled&maelstrom>45)) #variable,name=furyCheck25,value=(!talent.fury_of_air.enabled|(talent.fury_of_air.enabled&maelstrom>25)) #variable,name=OCPool70,value=(!talent.overcharge.enabled|(talent.overcharge.enabled&maelstrom>70)) #variable,name=OCPool60,value=(!talent.overcharge.enabled|(talent.overcharge.enabled&maelstrom>60)) #variable,name=heartEquipped,value=(equipped.151819) #variable,name=akainuEquipped,value=(equipped.137084) #variable,name=akainuAS,value=(variable.akainuEquipped&buff.hot_hand.react&!buff.frostbrand.up) #variable,name=LightningCrashNotUp,value=(!buff.lightning_crash.up&set_bonus.tier20_2pc) #variable,name=alphaWolfCheck,value=((pet.frost_wolf.buff.alpha_wolf.remains<2&pet.fiery_wolf.buff.alpha_wolf.remains<2&pet.lightning_wolf.buff.alpha_wolf.remains<2)&feral_spirit.remains>4) #auto_attack EnhancementGetInMeleeRange() #call_action_list,name=opener EnhancementOpenerShortCdActions() unless EnhancementOpenerShortCdPostConditions() { #call_action_list,name=asc,if=buff.ascendance.up if BuffPresent(ascendance_enhancement_buff) EnhancementAscShortCdActions() unless BuffPresent(ascendance_enhancement_buff) and EnhancementAscShortCdPostConditions() { #call_action_list,name=buffs EnhancementBuffsShortCdActions() unless EnhancementBuffsShortCdPostConditions() { #call_action_list,name=cds EnhancementCdsShortCdActions() unless EnhancementCdsShortCdPostConditions() { #call_action_list,name=core EnhancementCoreShortCdActions() unless EnhancementCoreShortCdPostConditions() { #call_action_list,name=filler EnhancementFillerShortCdActions() } } } } } } AddFunction EnhancementDefaultShortCdPostConditions { EnhancementOpenerShortCdPostConditions() or BuffPresent(ascendance_enhancement_buff) and EnhancementAscShortCdPostConditions() or EnhancementBuffsShortCdPostConditions() or EnhancementCdsShortCdPostConditions() or EnhancementCoreShortCdPostConditions() or EnhancementFillerShortCdPostConditions() } AddFunction EnhancementDefaultCdActions { #wind_shear EnhancementInterruptActions() #use_items EnhancementUseItemActions() #call_action_list,name=opener EnhancementOpenerCdActions() unless EnhancementOpenerCdPostConditions() { #call_action_list,name=asc,if=buff.ascendance.up if BuffPresent(ascendance_enhancement_buff) EnhancementAscCdActions() unless BuffPresent(ascendance_enhancement_buff) and EnhancementAscCdPostConditions() { #call_action_list,name=buffs EnhancementBuffsCdActions() unless EnhancementBuffsCdPostConditions() { #call_action_list,name=cds EnhancementCdsCdActions() unless EnhancementCdsCdPostConditions() { #call_action_list,name=core EnhancementCoreCdActions() unless EnhancementCoreCdPostConditions() { #call_action_list,name=filler EnhancementFillerCdActions() } } } } } } AddFunction EnhancementDefaultCdPostConditions { EnhancementOpenerCdPostConditions() or BuffPresent(ascendance_enhancement_buff) and EnhancementAscCdPostConditions() or EnhancementBuffsCdPostConditions() or EnhancementCdsCdPostConditions() or EnhancementCoreCdPostConditions() or EnhancementFillerCdPostConditions() } ### Enhancement icons. AddCheckBox(opt_shaman_enhancement_aoe L(AOE) default specialization=enhancement) AddIcon checkbox=!opt_shaman_enhancement_aoe enemies=1 help=shortcd specialization=enhancement { if not InCombat() EnhancementPrecombatShortCdActions() unless not InCombat() and EnhancementPrecombatShortCdPostConditions() { EnhancementDefaultShortCdActions() } } AddIcon checkbox=opt_shaman_enhancement_aoe help=shortcd specialization=enhancement { if not InCombat() EnhancementPrecombatShortCdActions() unless not InCombat() and EnhancementPrecombatShortCdPostConditions() { EnhancementDefaultShortCdActions() } } AddIcon enemies=1 help=main specialization=enhancement { if not InCombat() EnhancementPrecombatMainActions() unless not InCombat() and EnhancementPrecombatMainPostConditions() { EnhancementDefaultMainActions() } } AddIcon checkbox=opt_shaman_enhancement_aoe help=aoe specialization=enhancement { if not InCombat() EnhancementPrecombatMainActions() unless not InCombat() and EnhancementPrecombatMainPostConditions() { EnhancementDefaultMainActions() } } AddIcon checkbox=!opt_shaman_enhancement_aoe enemies=1 help=cd specialization=enhancement { if not InCombat() EnhancementPrecombatCdActions() unless not InCombat() and EnhancementPrecombatCdPostConditions() { EnhancementDefaultCdActions() } } AddIcon checkbox=opt_shaman_enhancement_aoe help=cd specialization=enhancement { if not InCombat() EnhancementPrecombatCdActions() unless not InCombat() and EnhancementPrecombatCdPostConditions() { EnhancementDefaultCdActions() } } ### Required symbols # prolonged_power_potion # lightning_shield # rockbiter # flametongue # flametongue_buff # crash_lightning # crashing_storm_talent # earthen_spike_debuff # frostbrand # hailstorm_talent # frostbrand_buff # sundering # lava_lash # earthen_spike # crash_lightning_buff # windsong # windstrike # stormstrike # stormbringer_buff # lightning_bolt_enhancement # overcharge_talent # hot_hand_buff # berserking # ascendance_enhancement_buff # blood_fury_apsp # ascendance_talent # feral_spirit # doom_winds # ascendance_enhancement # boulderfist_talent # landslide_talent # landslide_buff # fury_of_air # fury_of_air_debuff # alpha_wolf # fury_of_air_talent # 151819 # 137084 # lightning_crash_buff # frost_wolf_alpha_wolf_buff # fiery_wolf_alpha_wolf_buff # lightning_wolf_alpha_wolf_buff # feral_lunge # bloodlust # heroism # hex # war_stomp # quaking_palm # lightning_surge_totem # wind_shear ]] OvaleScripts:RegisterScript("SHAMAN", "enhancement", name, desc, code, "script") end
--!nonstrict --// Initialization local RunService = game:GetService("RunService") local PlayerService = game:GetService("Players") local StarterPlayer = game:GetService("StarterPlayer") local ReplicatedStorage = game:GetService("ReplicatedStorage") local CollectionService = game:GetService("CollectionService") local StarterCharacterScripts = StarterPlayer:WaitForChild("StarterCharacterScripts"):: Folder local Module = {} local LibraryThreadCache: {[thread]: string} = {} local Libraries: {[string]: ModuleScript} = {} --// Functions local function Retrieve(InstanceName: string, InstanceClass: string, InstanceParent: Instance, ForceWait: boolean?): Instance if ForceWait then return InstanceParent:WaitForChild(InstanceName) end local SearchInstance = InstanceParent:FindFirstChild(InstanceName) if not SearchInstance then SearchInstance = Instance.new(InstanceClass) SearchInstance.Name = InstanceName SearchInstance.Parent = InstanceParent end return SearchInstance end function Module._BindFunction(Function: (Instance) -> (), Event: RBXScriptSignal, Existing: {Instance}): RBXScriptConnection if Existing then for _, Value in next, Existing do task.spawn(Function, Value) end end return Event:Connect(Function) end function Module._BindToTag(Tag: string, Function: (Instance) -> ()) return Module._BindFunction(Function, CollectionService:GetInstanceAddedSignal(Tag), CollectionService:GetTagged(Tag)) end function Module:LoadLibrary(Index: string) if Libraries[Index] then return require(Libraries[Index]) else assert(not RunService:IsServer(), "The library \"" .. Index .. "\" does not exist!") LibraryThreadCache[coroutine.running()] = Index return require(coroutine.yield()) end end function Module:LoadLibraryOnClient(...) if RunService:IsClient() then return self:LoadLibrary(...) end end function Module:LoadLibraryOnServer(...) if RunService:IsServer() then return self:LoadLibrary(...) end end function Module:GetLocal(InstanceClass: string, InstanceName: string): Instance return Retrieve(InstanceName, InstanceClass, (Retrieve("Local" .. InstanceClass, "Folder", script))) end function Module:WaitFor(InstanceClass: string, InstanceName: string): Instance return Retrieve(InstanceClass, "Folder", script, RunService:IsClient()):WaitForChild(InstanceName, math.huge) end function Module:Get(InstanceClass: string, InstanceName: string): Instance local SetFolder = Retrieve(InstanceClass, "Folder", script, RunService:IsClient()) local Item = SetFolder:FindFirstChild(InstanceName) if Item then return Item elseif RunService:IsClient() then return SetFolder:WaitForChild(InstanceName) else return Retrieve(InstanceName, InstanceClass, SetFolder) end end Module._BindToTag("oLibrary", function(Object) Libraries[Object.Name] = Object for Thread, WantedName in next, LibraryThreadCache do if Object.Name == WantedName then task.defer(Thread, Object) task.delay(1, function() LibraryThreadCache[Thread] = nil end) end end end) local function Initialize() if RunService:IsServer() then if script:GetAttribute("ServerHandled") then return end script:SetAttribute("ServerHandled", true) local oStarterPlayerScripts = Retrieve("StarterPlayerScripts", "Folder", script) local oStarterCharacterScripts = Retrieve("StarterCharacterScripts", "Folder", script) local function Reparent(Child, NewParent) if Child:IsA("LocalScript") and not Child.Disabled then Child:SetAttribute("EnableOnceReady", true) Child.Disabled = true end Child.Parent = Retrieve(NewParent, "Folder", script) end Module._BindToTag("oHandled", function(LuaSourceContainer: Instance) local RunsOn = LuaSourceContainer:GetAttribute("RunsOn") or "Empty" if LuaSourceContainer:IsA("LocalScript") then if RunsOn == "Player" then task.defer(Reparent, LuaSourceContainer, "StarterPlayerScripts") elseif RunsOn == "Character" then task.defer(Reparent, LuaSourceContainer, "StarterCharacterScripts") else warn(string.format([[Unknown RunsOn type "%s" on %s]], RunsOn, LuaSourceContainer:GetFullName())) end elseif LuaSourceContainer:IsA("Script") then if RunsOn == "Player" then warn(string.format([[Invalid RunsOn type "%s" on %s]], RunsOn, LuaSourceContainer:GetFullName())) elseif RunsOn == "Character" then LuaSourceContainer.Parent = StarterCharacterScripts for _, Player in next, PlayerService:GetPlayers() do if Player.Character then LuaSourceContainer:Clone().Parent = Player.Character end end else warn(string.format([[Unknown RunsOn type "%s" on %s]], RunsOn, LuaSourceContainer:GetFullName())) end elseif LuaSourceContainer:IsA("ModuleScript") then warn(string.format([[Invalid tag "oHandled" applied to %s]], LuaSourceContainer:GetFullName())) end end) Module._BindToTag("oLibrary", function(LuaSourceContainer: Instance) if LuaSourceContainer:GetAttribute("ForceReplicate") then LuaSourceContainer.Parent = Retrieve("Libraries", "Folder", script) end end) Module._BindToTag("ForceReplicate", function(LuaSourceContainer: Instance) LuaSourceContainer.Parent = Retrieve("Libraries", "Folder", script) end) Module._BindToTag("StarterPlayerScripts", function(LuaSourceContainer: Instance) if LuaSourceContainer:IsA("LocalScript") then task.defer(Reparent, LuaSourceContainer, "StarterPlayerScripts") else warn(string.format([[Invalid tag "StarterPlayerScripts" applied to %s]], LuaSourceContainer:GetFullName())) end end) Module._BindToTag("StarterCharacterScripts", function(LuaSourceContainer: Instance) if LuaSourceContainer:IsA("LocalScript") then task.defer(Reparent, LuaSourceContainer, "StarterCharacterScripts") elseif LuaSourceContainer:IsA("Script") then LuaSourceContainer.Parent = StarterCharacterScripts for _, Player in next, PlayerService:GetPlayers() do if Player.Character then LuaSourceContainer:Clone().Parent = Player.Character end end else warn(string.format([[Invalid tag "StarterCharacterScripts" applied to %s]], LuaSourceContainer:GetFullName())) end end) elseif RunService:IsClient() then if script:GetAttribute("ClientHandled") then return end script:SetAttribute("ClientHandled", true) local Player = PlayerService.LocalPlayer local PlayerScripts = Player:WaitForChild("PlayerScripts") local oStarterPlayerScripts = script:WaitForChild("StarterPlayerScripts") local oStarterCharacterScripts = script:WaitForChild("StarterCharacterScripts") local function Reparent(Child, NewParent) Child.Parent = NewParent if Child:IsA("LocalScript") and Child:GetAttribute("EnableOnceReady") then Child.Disabled = false end end if script:FindFirstAncestorWhichIsA("PlayerGui") then task.defer(Reparent, script:Clone(), PlayerScripts) task.wait() script.Disabled = true script:Destroy() return end Module._BindFunction(function(Child: Instance) task.defer(Reparent, Child, PlayerScripts) end, oStarterPlayerScripts.ChildAdded, oStarterPlayerScripts:GetChildren()) Module._BindFunction(function(Child: Instance) if Player.Character then task.defer(Reparent, Child:Clone(), Player.Character) end end, oStarterCharacterScripts.ChildAdded, oStarterCharacterScripts:GetChildren()) Module._BindFunction(function(Character: Instance) for _, Child in next, oStarterCharacterScripts:GetChildren() do task.spawn(Reparent, Child:Clone(), Character) end end, Player.CharacterAdded, {Player.Character}) end end do --/ LEGACY SUPPORT for _, SetClass in next, {"RemoteEvent", "RemoteFunction", "BindableEvent", "BindableFunction"} do local SetFolder = Retrieve(SetClass, "Folder", ReplicatedStorage) Module["GetLocal" .. SetClass] = function(self, ItemName) return Retrieve(ItemName, SetClass, SetFolder) end Module["WaitFor" .. SetClass] = function(self, ItemName) return SetFolder:WaitForChild(ItemName, math.huge) end Module["Get" .. SetClass] = function(self, ItemName) local Item = SetFolder:FindFirstChild(ItemName) if Item then return Item end if RunService:IsClient() then return SetFolder:WaitForChild(ItemName) else return self["GetLocal" .. SetClass](self, ItemName) end end end end --// Triggers task.defer(Initialize) return Module