content
stringlengths 5
1.05M
|
|---|
heroOfTatRanchersWifeConvoTemplate = ConvoTemplate:new {
initialScreen = "",
templateType = "Lua",
luaClassHandler = "heroOfTatRanchersWifeConvoHandler",
screens = {}
}
intro = ConvoScreen:new {
id = "intro",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_82bd1b20", -- Who are you?! More of those thugs? I'll lock you up like I did the rest of your friends! Get out!!
stopConversation = "false",
options = {
{"@conversation/quest_hero_of_tatooine_wife:s_84ee73da", "guess_you_arent"}, -- Hold on! I'm not a thug or a pirate at all.
{"@conversation/quest_hero_of_tatooine_wife:s_f6c25472", "leave_now"}, -- Eep! Okay, bye!
}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(intro);
guess_you_arent = ConvoScreen:new {
id = "guess_you_arent",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_aebcaa68", -- Really? Wait a second. I guess you don't look like a pirate or a thug. I'm sorry. I'm so riled up I can hardly think straight. Look, I could use your help with this. My husband has left to contact the authorities. I need to go calm down or I may do something drastic. Please, go down the stairs and keep an eye on those thugs for me. It would really help me out.
stopConversation = "false",
options = {
{"@conversation/quest_hero_of_tatooine_wife:s_c5a33502", "thanks_intercom"}, -- I'll go keep an eye on them.
{"@conversation/quest_hero_of_tatooine_wife:s_e45adc31", "so_heartless"}, -- I'd rather not get into this mess.
}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(guess_you_arent);
thanks_intercom = ConvoScreen:new {
id = "thanks_intercom",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_83da2e04", -- Thank you so much! There's an intercom outside the room in which I've locked them up. They may try to coerce you into helping them. Just ignore them. I need to go relax for a minute...
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(thanks_intercom);
so_heartless = ConvoScreen:new {
id = "so_heartless",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_18dbba11", -- Ugh! You're so heartless! Get out of my house! I don't need this right now!
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(so_heartless);
leave_now = ConvoScreen:new {
id = "leave_now",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_f26b5d58", -- I'll call the authorities on you!! Leave now!
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(leave_now);
intro_hasquest = ConvoScreen:new {
id = "intro_hasquest",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_7ee07d1c", -- I need to get myself calm. Please go downstairs and keep an eye out for escaping thugs.
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(intro_hasquest);
intro_noquest = ConvoScreen:new {
id = "intro_noquest",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_b8584429", -- Being a rancer's wife is hard work. I barely get any time for myself with what all the work I have to do. Oh well. As you can see, having a successful rancher as a husband has its perks! Do you like how I decorated the place? Ack! Look at the time... I really need to get back to work. Nice meeting you!
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(intro_noquest);
intro_otherinprogress = ConvoScreen:new {
id = "intro_otherinprogress",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_c74cdffb", -- I'm sorry. I'm having issues with pirates right now. Come back a little later. Maybe you can help me then. I really need to concentrate on the situation at hand...
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(intro_otherinprogress);
intro_distract = ConvoScreen:new {
id = "intro_distract",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_3220d628", -- How are they? Are they behaving? Thank you for helping me. I completely appreciate this.
stopConversation = "false",
options = {
{"@conversation/quest_hero_of_tatooine_wife:s_f74cb815", "you_really_think_so"}, -- You know, you did a great job decorating this place.
{"@conversation/quest_hero_of_tatooine_wife:s_ea1b59c", "cant_believe_this"}, -- They're planning to break out as we speak!
}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(intro_distract);
you_really_think_so = ConvoScreen:new {
id = "you_really_think_so",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_8ad6289", -- You really think so?! I'm so glad you noticed! I hope to win a house decorating contest this coming summer. I hope to get my home in the spotlight! Do you really think I'll win?
stopConversation = "false",
options = {
{"@conversation/quest_hero_of_tatooine_wife:s_abec95a3", "so_nice_ahh"}, -- I really think so!
}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(you_really_think_so);
so_nice_ahh = ConvoScreen:new {
id = "so_nice_ahh",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_2622df9f", -- You're so nice! I--AHHH!
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(so_nice_ahh);
cant_believe_this = ConvoScreen:new {
id = "cant_believe_this",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_63f6701b", -- I can't believe this! I am awed by your honor. Thank you so much for helping us! Oh, here comes my husband now! They're going to take those nasty thugs away! Here, you really deserve this. I hope it will do you well.
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(cant_believe_this);
intro_leftprior = ConvoScreen:new {
id = "intro_leftprior",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_43f5726a", -- It's you again! What do you want? Can't you see I'm busy?!
stopConversation = "false",
options = {
{"@conversation/quest_hero_of_tatooine_wife:s_37c0824f", "so_riled_up"}, -- Wait! I want to help you.
{"@conversation/quest_hero_of_tatooine_wife:s_e83ad536", "go_away"}, -- I'm sorry to disturb you.
}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(intro_leftprior);
go_away = ConvoScreen:new {
id = "go_away",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_6422820b", -- Go away!
stopConversation = "true",
options = {}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(go_away);
so_riled_up = ConvoScreen:new {
id = "so_riled_up",
leftDialog = "@conversation/quest_hero_of_tatooine_wife:s_50587782", -- You do? I'm so riled up I can hardly think straight. My husband has left to contact the authorities. I need to go calm down or I may do something drastic. Please, go down the stairs and keep an eye on those thugs for me. It would really help me out. Will you help me?
stopConversation = "false",
options = {
{"@conversation/quest_hero_of_tatooine_wife:s_210b4c5b", "thanks_intercom"}, -- Yes, I will!
{"@conversation/quest_hero_of_tatooine_wife:s_1ecfff90", "so_heartless"}, -- No, I have other things to do.
}
}
heroOfTatRanchersWifeConvoTemplate:addScreen(so_riled_up);
addConversationTemplate("heroOfTatRanchersWifeConvoTemplate", heroOfTatRanchersWifeConvoTemplate);
|
--
-- THIS FILE HAS BEEN GENERATED AUTOMATICALLY
-- DO NOT CHANGE IT MANUALLY UNLESS YOU KNOW WHAT YOU'RE DOING
--
-- GENERATED USING @colyseus/schema 1.0.0-alpha.58
--
local schema = require 'colyseus.serialization.schema.schema'
local PrimitiveTypes = schema.define({
["int8"] = "int8",
["uint8"] = "uint8",
["int16"] = "int16",
["uint16"] = "uint16",
["int32"] = "int32",
["uint32"] = "uint32",
["int64"] = "int64",
["uint64"] = "uint64",
["float32"] = "float32",
["float64"] = "float64",
["varint_int8"] = "number",
["varint_uint8"] = "number",
["varint_int16"] = "number",
["varint_uint16"] = "number",
["varint_int32"] = "number",
["varint_uint32"] = "number",
["varint_int64"] = "number",
["varint_uint64"] = "number",
["varint_float32"] = "number",
["varint_float64"] = "number",
["str"] = "string",
["boolean"] = "boolean",
["_fields_by_index"] = { "int8", "uint8", "int16", "uint16", "int32", "uint32", "int64", "uint64", "float32", "float64", "varint_int8", "varint_uint8", "varint_int16", "varint_uint16", "varint_int32", "varint_uint32", "varint_int64", "varint_uint64", "varint_float32", "varint_float64", "str", "boolean" },
})
return PrimitiveTypes
|
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 220)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)
local disable = createConditionObject(CONDITION_PACIFIED)
setConditionParam(disable, CONDITION_PARAM_TICKS, 10000)
setCombatCondition(combat, disable)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
|
if GameHelpers.Tooltip == nil then
GameHelpers.Tooltip = {}
end
local function ReplacePlaceholders(str, character)
if character ~= nil and type(character) == "string" then
character = Ext.GetCharacter(character)
end
local output = str
for v in string.gmatch(output, "%[ExtraData.-%]") do
local key = v:gsub("%[ExtraData:", ""):gsub("%]", "")
local value = Ext.ExtraData[key] or ""
if value ~= "" and type(value) == "number" then
if value == math.floor(value) then
value = string.format("%i", math.floor(value))
else
if value <= 1.0 and value >= 0.0 then
-- Percentage display
value = value * 100
value = string.format("%i", math.floor(value))
else
value = tostring(value)
end
end
end
-- The parameter brackets will be considered for pattern matching unless we escape them with a percentage sign.
local escapedReplace = v:gsub("%[", "%%["):gsub("%]", "%%]")
output = string.gsub(output, escapedReplace, value)
end
for v in string.gmatch(output, "%[Stats:.-%]") do
local value = ""
local statFetcher = v:gsub("%[Stats:", ""):gsub("%]", "")
local props = StringHelpers.Split(statFetcher, ":")
local stat = props[1]
local property = props[2]
if stat ~= nil and property ~= nil then
value = Ext.StatGetAttribute(stat, property)
end
if value ~= nil and value ~= "" then
if type(value) == "number" then
value = string.format("%i", math.floor(value))
end
elseif value == nil then
value = ""
end
-- The parameter brackets will be considered for pattern matching unless we escape them with a percentage sign.
local escapedReplace = v:gsub("%[", "%%["):gsub("%]", "%%]")
output = string.gsub(output, escapedReplace, value)
end
for v in string.gmatch(output, "%[SkillDamage:.-%]") do
local value = ""
local skillName = v:gsub("%[SkillDamage:", ""):gsub("%]", "")
if skillName ~= nil and skillName ~= "" then
local skill = GameHelpers.Ext.CreateSkillTable(skillName)
if skill ~= nil then
if character == nil then
character = Client:GetCharacter()
end
if character ~= nil and character.Stats ~= nil then
local useDefaultSkillDamage = true
local length = #Listeners.GetTooltipSkillDamage
if length > 0 then
for i=1,length do
local callback = Listeners.GetTooltipSkillDamage[i]
local b,result = xpcall(callback, debug.traceback, skill, character.Stats)
if not b then
Ext.PrintError("[LeaderLib:ReplacePlaceholders] Error calling function for 'GetTooltipSkillDamage':\n", result)
elseif result ~= nil and result ~= "" then
value = result
useDefaultSkillDamage = false
end
end
end
if useDefaultSkillDamage then
local damageRange = Game.Math.GetSkillDamageRange(character.Stats, skill)
value = GameHelpers.Tooltip.FormatDamageRange(damageRange)
end
end
end
end
if value ~= nil then
if type(value) == "number" then
value = string.format("%i", math.floor(value))
end
local escapedReplace = v:gsub("%[", "%%["):gsub("%]", "%%]")
output = string.gsub(output, escapedReplace, value)
end
end
local length = Listeners.GetTooltipSkillParam and #Listeners.GetTooltipSkillParam or 0
if length > 0 then
local value = ""
for v in string.gmatch(output, "%[Skill:.-%]") do
local fullParam = v:gsub("%[Skill:", ""):gsub("%]", "")
local props = StringHelpers.Split(fullParam, ":")
local skillName = ""
local param = ""
if #props >= 2 then
skillName = props[1]
param = props[2]
end
if skillName ~= nil and skillName ~= "" then
local skill = GameHelpers.Ext.CreateSkillTable(skillName)
if skill ~= nil then
if character == nil then
character = Client:GetCharacter()
end
if character ~= nil and character.Stats ~= nil then
for i=1,length do
local callback = Listeners.GetTooltipSkillParam[i]
local b,result = xpcall(callback, debug.traceback, skill, character.Stats, param)
if not b then
Ext.PrintError("[LeaderLib:ReplacePlaceholders] Error calling function for 'GetTooltipSkillParam':\n", result)
elseif result ~= nil then
value = result
end
end
end
end
end
if value ~= nil and value ~= "" then
if type(value) == "number" then
value = string.format("%i", math.floor(value))
end
elseif value == nil then
value = ""
end
local escapedReplace = v:gsub("%[", "%%["):gsub("%]", "%%]")
output = string.gsub(output, escapedReplace, value)
end
end
for v in string.gmatch(output, "%[Key:.-%]") do
local key = v:gsub("%[Key:", ""):gsub("%]", "")
local translatedText,handle = Ext.GetTranslatedStringFromKey(key)
if translatedText == nil then
translatedText = ""
else
translatedText = string.gsub(translatedText, "%%", "%%%%")
translatedText = ReplacePlaceholders(translatedText, character)
end
local escapedReplace = v:gsub("%[", "%%["):gsub("%]", "%%]")
output = string.gsub(output, escapedReplace, translatedText)
end
for v in string.gmatch(output, "%[Handle:.-%]") do
local text = v:gsub("%[Handle:", ""):gsub("%]", "")
local props = StringHelpers.Split(text, ":")
if props[2] == nil then
props[2] = ""
end
local translatedText = Ext.GetTranslatedString(props[1], props[2])
if translatedText == nil then
translatedText = ""
end
local escapedReplace = v:gsub("%[", "%%["):gsub("%]", "%%]")
output = string.gsub(output, escapedReplace, translatedText)
end
return output
end
---Replace placeholder text in strings, such as ExtraData, Skill, etc.
---@param str string
---@param character EclCharacter|EsvCharacter Optional character to use for the tooltip.
---@return string
function GameHelpers.Tooltip.ReplacePlaceholders(str, character)
local status,result = xpcall(ReplacePlaceholders, debug.traceback, str, character)
if status then
return result
else
Ext.PrintError("[LeaderLib:GameHelpers.Tooltip.ReplacePlaceholders] Error replacing placeholders:")
Ext.PrintError(result)
return str
end
end
--- Formats a damage range typically returned from GameHelpers.Math.GetSkillDamageRange
---@param damageRange table<string,number[]>
---@return string
function GameHelpers.Tooltip.FormatDamageRange(damageRange)
if damageRange ~= nil then
local damageTexts = {}
local totalDamageTypes = 0
for damageType,damage in pairs(damageRange) do
local min = damage.Min or damage[1]
local max = damage.Max or damage[2]
if min ~= nil and max ~= nil then
if max == min then
table.insert(damageTexts, GameHelpers.GetDamageText(damageType, string.format("%i", max)))
else
table.insert(damageTexts, GameHelpers.GetDamageText(damageType, string.format("%i-%i", min, max)))
end
totalDamageTypes = totalDamageTypes + 1
end
end
if totalDamageTypes > 0 then
if totalDamageTypes > 1 then
return StringHelpers.Join(", ", damageTexts)
else
return damageTexts[1]
end
end
end
return ""
end
if Ext.IsClient() then
local extraPropStatusTurnsPattern = "Set (.+) for (%d+) turn%(s%).-%((%d+)%% Chance%)"
---@param tooltip TooltipData
---@param inputElements table
---@param addColor boolean|nil
function GameHelpers.Tooltip.CondensePropertiesText(tooltip, inputElements, addColor)
local entries = {}
for i,v in pairs(inputElements) do
v.Label = string.gsub(v.Label, " ", " ")
local a,b,status,turns,chance = string.find(v.Label, extraPropStatusTurnsPattern)
if status ~= nil and turns ~= nil and chance ~= nil then
local color = ""
tooltip:RemoveElement(v)
if addColor == true then
end
table.insert(entries, {Status = status, Turns = turns, Chance = chance, Color = color})
end
end
if #entries > 0 then
local finalStatusText = ""
local finalTurnsText = ""
local finalChanceText = ""
for i,v in pairs(entries) do
finalStatusText = finalStatusText .. v.Status
finalTurnsText = finalTurnsText .. v.Turns
finalChanceText = finalChanceText .. v.Chance.."%"
if i >= 1 and i < #entries then
finalStatusText = finalStatusText .. "/"
finalTurnsText = finalTurnsText .. "/"
finalChanceText = finalChanceText .. "/"
end
end
return LocalizedText.Tooltip.ExtraPropertiesOnHit:ReplacePlaceholders(finalStatusText, finalTurnsText, finalChanceText)
end
end
---@alias TooltipElementParam table<string,string|number>
---@param element TooltipElementParam
---@param attribute string
---@param fallback any|nil An optional fallback value to use. Returns an empty string by default.
---@return string|number
function GameHelpers.Tooltip.GetElementAttribute(element, attribute, fallback)
if element ~= nil and element[attribute] ~= nil then
return element[attribute]
end
return fallback or ""
end
end
|
require "rider.base"
require "rider.logging"
require "rider.config"
require "rider.httpstream"
local VERSION = "1.0.0"
return {
version = VERSION
}
|
Locales['en'] = {
['buy_license'] = 'Buy a License?',
['press_access'] = 'press ~INPUT_CONTEXT~ to access License Shop',
['not_enough_money'] = 'you do not have enough money',
['blip_license_shop'] = 'License Shop',
-- Licenses
['need_dmv'] = 'You must have a Drivers Permit',
['license_aircraft'] = 'Aircraft License',
['license_boating'] = 'Boating License',
['license_commercial'] = 'Commercial License',
['license_drivers'] = 'Drivers License',
['license_motorcycle'] = 'Motorcycle License',
['license_weapon'] = 'Weapons License',
['license_weed'] = 'Weed License',
}
|
------------------------------------------------------------------------------
-- Implementation of methods for the Config-CROWN served by this App.
--
-- The getters and setters are used by controls in the trispectorp.msdd
-- to connect the sliders, buttons and text-fields with the values
-- used in the application.
------------------------------------------------------------------------------
local app = require('src.app')
local g = require('src.globals')
local ids = require('src.ids')
local util = require('src.util')
local Fov = require('src.fov')
local convert = util.convert
local errorinfo = require('src.errorinfo')
local module = {}
module.serveFunctions = function()
------------------------------------------------------------------------------
-- Getters
------------------------------------------------------------------------------
Script.serveFunction(
'Config.getCfovLength',
function()
return g.imageConfig3D:getHeightmapLength()
end
)
Script.serveFunction(
'Config.getCfovXMax',
function()
local width, _, xOffset, _ = g.imageConfig3D:getFieldOfView()
return xOffset + width / 2
end
)
Script.serveFunction(
'Config.getCfovXMin',
function()
local width, _, xOffset, _ = g.imageConfig3D:getFieldOfView()
return xOffset - width / 2
end
)
Script.serveFunction(
'Config.getCfovZMax',
function()
local _, height, _, zOffset = g.imageConfig3D:getFieldOfView()
return zOffset + height / 2
end
)
Script.serveFunction(
'Config.getCfovZMin',
function()
local _, height, _, zOffset = g.imageConfig3D:getFieldOfView()
return zOffset - height / 2
end
)
Script.serveFunction(
'Config.getConfigValid',
function()
return g.imageConfig3D:validate()
end
)
Script.serveFunction(
'Config.getEncoderPulsesPerMm',
function()
return util.round(g.imageConfig3D:getEncoderTicksPerMm(), 3)
end
)
Script.serveFunction(
'Config.getExposure',
function()
return g.imageConfig3D:getExposureTime()
end
)
Script.serveFunction(
'Config.getFrameNumber',
function()
return g.imageNumber
end
)
Script.serveFunction(
'Config.getGFOV',
function()
return g.gfov
end
)
Script.serveFunction(
'Config.getGain',
function()
return g.imageConfig3D:getGain()
end
)
Script.serveFunction(
'Config.getImageTriggerDelay',
function()
local delay, _ = g.imageConfig3D:getImageTriggerDelay()
return delay
end
)
Script.serveFunction(
'Config.getImageTriggerDelayUnit',
function()
local _,
unit = g.imageConfig3D:getImageTriggerDelay()
if unit == 'MS' then
return 0
else
return 1
end
end
)
Script.serveFunction(
'Config.getImageTriggerMode',
function()
return convert.imageTriggerMode.toValue( g.imageConfig3D:getImageTriggerMode() )
end
)
Script.serveFunction(
'Config.getLaserThreshold',
function()
return g.imageConfig3D:getLaserThreshold()
end
)
Script.serveFunction(
'Config.getPeakSelectionMode',
function()
return convert.peakSelectionMode.toValue( g.imageConfig3D:getPeakSelectionMode() )
end
)
Script.serveFunction(
'Config.getProfileDistance',
function()
return util.round(g.imageConfig3D:getProfileDistance(), 3)
end
)
Script.serveFunction(
'Config.getProfileTriggerMode',
function()
local mode = convert.profileTriggerMode.toValue( g.imageConfig3D:getProfileTriggerMode() )
Config.setProfileTriggerMode(mode) -- fix to get the Web HMI to show the speed slider
return mode
end
)
Script.serveFunction(
'Config.getProfileTriggerModeInverted',
function()
return 1 - convert.profileTriggerMode.toValue( g.imageConfig3D:getProfileTriggerMode() )
end
)
Script.serveFunction(
'Config.getSpeed',
function()
return g.imageConfig3D:getFreeRunningSpeed()
end
)
Script.serveFunction(
'Config.getFreeRunningSpeedLimitMax',
function()
local _, max = g.imageConfig3D:getFreeRunningSpeedLimits()
return max
end
)
Script.serveFunction(
'Config.getXResolution',
function()
return util.round(g.imageConfig3D:getXResolution(), 3)
end
)
Script.serveFunction(
'Config.getXResolutionLimitMax',
function()
local _, xResMaxLimit = g.imageConfig3D:getXResolutionLimits()
return xResMaxLimit
end
)
Script.serveFunction(
'Config.getXResolutionLimitMin',
function()
local xResMinLimit, _ = g.imageConfig3D:getXResolutionLimits()
return xResMinLimit
end
)
Script.serveFunction(
'Config.isImageTriggerModeIO',
function()
return g.imageConfig3D:getImageTriggerMode() == 'IO_3'
end
)
Script.serveFunction(
'Config.isImageTriggerModeSoftware',
function()
return g.imageConfig3D:getImageTriggerMode() == 'SOFTWARE'
end
)
Script.serveFunction(
'Config.isImageTriggerModeSoftwareActive',
function()
return g.imageConfig3D:getProfileTriggerMode() == 'SOFTWARE'
end
)
Script.serveFunction(
'Config.validateConfig',
function()
local configValid = g.imageConfig3D:validate()
Script.notifyEvent('OnValidateConfig', configValid)
app.checkXResolutionLimits()
-- Print maximum movement speed from acquisition
local max = Config.getFreeRunningSpeedLimitMax()
Script.notifyEvent('OnMaxFreerunningSpeed', util.round(max, 1))
print('-----------------------------------------')
print('Max speed from acq: ' .. util.round(max / 1000, 2) .. ' m/s')
print('-----------------------------------------')
Script.notifyEvent(
'OnConfigError',
errorinfo.getErrorString3D(g.imageConfig3D)
)
return configValid
end
)
------------------------------------------------------------------------------
-- Setters
------------------------------------------------------------------------------
Script.serveFunction(
'Config.setConfig',
function()
-- Write the configuration to the device.
-- The provider will be stopped to be able to receive the configuration.
g.imageProvider:stop()
local configValid = g.imageConfig3D:validate()
if configValid then
g.imageProvider:setConfig(g.imageConfig3D)
g.imageProvider:start()
Script.notifyEvent(
'OnImageTriggerModeSoftwareActive',
Config.getImageTriggerMode() == 3
)
else
print('Invalid config')
end
end
)
Script.serveFunction(
'Config.saveConfig',
function()
-- Save the configuration to a json file
local ok = Object.save(g.imageConfig3D, g.jobPath)
if ok then
print('Saved configuration to ' .. g.jobPath)
else
print('Error: Failed saving configuration to ' .. g.jobPath)
end
end
)
Script.serveFunction(
'Config.loadConfig',
function()
if not File.exists(g.jobPath) then
print('Error: File not found: ' .. g.jobPath)
return
end
app.loadConfig(g.jobPath)
end
)
Script.serveFunction(
'Config.setProfileTriggerMode',
function(value)
local profileTriggerMode = convert.profileTriggerMode.toString(value)
g.imageConfig3D:setProfileTriggerMode(profileTriggerMode)
Script.notifyEvent( 'OnSetFreerunningMode', profileTriggerMode == 'FREE_RUNNING' )
Script.notifyEvent('OnSetEncoderMode', profileTriggerMode == 'ENCODER')
Config.validateConfig()
end
)
Script.serveFunction(
'Config.setSpeed',
function(Speed)
g.imageConfig3D:setFreeRunningSpeed(Speed)
Config.validateConfig()
end
)
Script.serveFunction(
'Config.setEncoderPulsesPerMm',
function(encoderTicksPerMm)
g.imageConfig3D:setEncoderTicksPerMm(encoderTicksPerMm)
Config.validateConfig()
end
)
Script.serveFunction(
'Config.setProfileDistance',
function(ProfileDistance)
g.imageConfig3D:setProfileDistance(ProfileDistance)
app.getCfovLengthMax()
Config.validateConfig()
app.visualize()
end
)
Script.serveFunction(
'Config.setXResolution',
function(XResolution)
g.imageConfig3D:setXResolution(util.round(XResolution, 3))
app.getCfovLengthMax()
Config.validateConfig()
end
)
Script.serveFunction(
'Config.setExposure',
function(Exposure)
g.imageConfig3D:setExposureTime(Exposure)
Config.validateConfig()
end
)
Script.serveFunction(
'Config.setGain',
function(gain)
g.imageConfig3D:setGain(gain)
end
)
Script.serveFunction(
'Config.setLaserThreshold',
function(LaserThreshold)
g.imageConfig3D:setLaserThreshold(LaserThreshold)
end
)
Script.serveFunction(
'Config.setPeakSelectionMode',
function(mode)
local s = convert.peakSelectionMode.toString(mode)
g.imageConfig3D:setPeakSelectionMode(s)
end
)
Script.serveFunction(
'Config.setImageTriggerMode',
function(mode)
local s = convert.imageTriggerMode.toString(mode)
g.imageConfig3D:setImageTriggerMode(s)
app.GUIUpdateImageTrigger()
Config.validateConfig()
end
)
Script.serveFunction(
'Config.setImageTriggerDelay',
function(delay)
local _, unit = g.imageConfig3D:getImageTriggerDelay()
g.imageConfig3D:setImageTriggerDelay(delay, unit)
end
)
Script.serveFunction(
'Config.setImageTriggerDelayUnit',
function(unitIndex)
local delay, _ = g.imageConfig3D:getImageTriggerDelay()
local unit = convert.triggerDelayUnit.toString(unitIndex)
g.imageConfig3D:setImageTriggerDelay(delay, unit)
end
)
Script.serveFunction(
'Config.setObjectTriggerPercentage',
function(newPercentage)
local line, _ = g.imageConfig3D:getObjectTriggerLine()
g.imageConfig3D:setObjectTriggerLine(line, newPercentage)
end
)
Script.serveFunction(
'Config.setObjectTriggerPoint1X',
function(value)
if g.imageConfig3D:getImageTriggerMode() == 'OBJECT' then
g.objectTriggerPoint1:setX(util.round(value, 1))
app.setObjectTriggerLine()
end
end
)
Script.serveFunction(
'Config.setObjectTriggerPoint2X',
function(value)
if g.imageConfig3D:getImageTriggerMode() == 'OBJECT' then
g.objectTriggerPoint2:setX(util.round(value, 1))
app.setObjectTriggerLine()
end
end
)
Script.serveFunction(
'Config.setObjectTriggerPoint1Z',
function(value)
if g.imageConfig3D:getImageTriggerMode() == 'OBJECT' then
g.objectTriggerPoint1:setZ(util.round(value, 1))
app.setObjectTriggerLine()
end
end
)
Script.serveFunction(
'Config.setObjectTriggerPoint2Z',
function(value)
if g.imageConfig3D:getImageTriggerMode() == 'OBJECT' then
g.objectTriggerPoint2:setZ(util.round(value, 1))
app.setObjectTriggerLine()
end
end
)
Script.serveFunction(
'Config.setForceTrigger',
function()
g.imageProvider:trigger(true)
end
)
Script.serveFunction(
'Config.setCfovZMin',
function(zMin)
Fov.setTo(Fov.copyFrom(g.imageConfig3D, {zMin = zMin}), g.imageConfig3D)
Config.validateConfig()
app.createUserFOV()
app.visualize()
end
)
Script.serveFunction(
'Config.setCfovZMax',
function(zMax)
Fov.setTo(Fov.copyFrom(g.imageConfig3D, {zMax = zMax}), g.imageConfig3D)
Config.validateConfig()
app.createUserFOV()
app.visualize()
end
)
Script.serveFunction(
'Config.setCfovXMin',
function(xMin)
Fov.setTo(Fov.copyFrom(g.imageConfig3D, {xMin = xMin}), g.imageConfig3D)
Config.validateConfig()
app.createUserFOV()
app.visualize()
end
)
Script.serveFunction(
'Config.setCfovXMax',
function(xMax)
Fov.setTo(Fov.copyFrom(g.imageConfig3D, {xMax = xMax}), g.imageConfig3D)
Config.validateConfig()
app.createUserFOV()
app.visualize()
end
)
Script.serveFunction(
'Config.setCfovLength',
function(length)
g.imageConfig3D:setHeightmapLength(length)
Config.validateConfig()
app.createUserFOV()
app.visualize()
end
)
Script.serveFunction(
'Config.setGFOV',
function(fov)
g.gfov = fov
g.viewer3D:remove(ids.guaranteedFOV)
app.createGuaranteedFOV()
g.viewer3D:present()
end
)
end
-- Serve events for usage in web HMI
module.serveEvents = function()
Script.serveEvent( 'Config.OnImageTriggerModeSoftwareActive', 'OnImageTriggerModeSoftwareActive' )
Script.serveEvent('Config.OnNewImageEvent', 'OnNewImageEvent')
Script.serveEvent('Config.OnSetEncoderMode', 'OnSetEncoderMode')
Script.serveEvent('Config.OnSetFreerunningMode', 'OnSetFreerunningMode')
Script.serveEvent('Config.OnSetTriggerModeIO', 'OnSetTriggerModeIO')
Script.serveEvent('Config.OnSetTriggerModeNone', 'OnSetTriggerModeNone')
Script.serveEvent('Config.OnSetTriggerModeObject', 'OnSetTriggerModeObject')
Script.serveEvent( 'Config.OnSetTriggerModeSoftware', 'OnSetTriggerModeSoftware' )
Script.serveEvent('Config.OnValidateConfig', 'OnValidateConfig')
Script.serveEvent('Config.OnXresMaxLimit', 'OnXresMaxLimit')
Script.serveEvent('Config.OnXresMinLimit', 'OnXresMinLimit')
Script.serveEvent('Config.OnProfileTrigger', 'OnProfileTrigger')
Script.serveEvent('Config.OnPeakSelection', 'OnPeakSelection')
Script.serveEvent('Config.OnImageTrigger', 'OnImageTrigger')
Script.serveEvent('Config.OnEncoderPulses', 'OnEncoderPulses')
Script.serveEvent('Config.OnFOVLength', 'OnFOVLength')
Script.serveEvent('Config.OnFOVLengthMax', 'OnFOVLengthMax')
Script.serveEvent('Config.OnProfileDistance', 'OnProfileDistance')
Script.serveEvent('Config.OnXResolution', 'OnXResolution')
Script.serveEvent('Config.OnExposure', 'OnExposure')
Script.serveEvent('Config.OnLaserThreshold', 'OnLaserThreshold')
Script.serveEvent('Config.OnMaxFreerunningSpeed', 'OnMaxFreerunningSpeed')
Script.serveEvent('Config.OnFOVX0', 'OnFOVX0')
Script.serveEvent('Config.OnFOVX1', 'OnFOVX1')
Script.serveEvent('Config.OnFOVZ0', 'OnFOVZ0')
Script.serveEvent('Config.OnFOVZ1', 'OnFOVZ1')
Script.serveEvent('Config.OnConfigError', 'OnConfigError')
end
return module
|
Locales ['fr'] = {
['message_title'] = '^3Verrou véhicule',
['message_locked'] = 'ouvert',
['message_unlocked'] = 'fermé',
}
|
local Druid = {}
ShadowUF:RegisterModule(Druid, "druidBar", ShadowUF.L["Druid mana bar"], true, "DRUID")
function Druid:OnEnable(frame)
frame.druidBar = frame.druidBar or ShadowUF.Units:CreateBar(frame)
frame:RegisterUnitEvent("UNIT_MAXMANA", self, "Update")
frame:RegisterUnitEvent("UNIT_MANA", self, "Update")
frame:RegisterUnitEvent("UNIT_DISPLAYPOWER", self, "PowerChanged")
frame:RegisterUpdateFunc(self, "PowerChanged")
frame:RegisterUpdateFunc(self, "Update")
end
function Druid:OnDisable(frame)
frame:UnregisterAll(self)
end
function Druid:OnLayoutApplied(frame)
if( frame.visibility.druidBar ) then
local color = ShadowUF.db.profile.powerColors.MANA
if( not ShadowUF.db.profile.units[frame.unitType].druidBar.invert ) then
frame.druidBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha)
if( not frame.druidBar.background.overrideColor ) then
frame.druidBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha)
end
else
frame.druidBar.background:SetVertexColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.alpha)
color = frame.druidBar.background.overrideColor or color
frame.druidBar:SetStatusBarColor(color.r, color.g, color.b, ShadowUF.db.profile.bars.backgroundAlpha)
end
end
end
-- While power type is mana, show the bar once it is mana hide it.
function Druid:PowerChanged(frame)
local powerType = UnitPowerType(frame.unit)
ShadowUF.Layout:SetBarVisibility(frame, "druidBar", powerType == 1 or powerType == 3)
end
function Druid:Update(frame)
frame.druidBar:SetMinMaxValues(0, UnitPowerMax(frame.unit, 0))
frame.druidBar:SetValue(UnitIsDeadOrGhost(frame.unit) and 0 or not UnitIsConnected(frame.unit) and 0 or UnitPower(frame.unit, 0))
end
|
data:extend({
{
type = "custom-input",
name = "Powered_Entities_recalculate",
key_sequence = "F10",
consuming = "script-only"
}
})
|
function constructor()
testall()
end
function testall()
systest()
arraytest()
maptest()
valuetest()
gettest()
end
function systest()
id = 'getSender'; system.setItem(id, system.getSender())
system.print(id, system.getItem(id))
id = 'getBlockheight'; system.setItem(id, system.getBlockheight())
system.print(id, system.getItem(id))
id = 'getTxhash'; system.setItem(id, system.getTxhash())
system.print(id, system.getItem(id))
id = 'getTimestamp'; system.setItem(id, system.getTimestamp())
system.print(id, system.getItem(id))
id = 'getContractID'; system.setItem(id, system.getContractID())
system.print(id, system.getItem(id))
id = 'getAmount'; system.setItem(id, system.getAmount())
system.print(id, system.getItem(id))
id = 'getCreator'; system.setItem(id, system.getCreator())
system.print(id, system.getItem(id))
id = 'getOrigin'; system.setItem(id, system.getOrigin())
system.print(id, system.getItem(id))
id = 'getPrevBlockHash'; system.setItem(id, system.getPrevBlockHash())
system.print(id, system.getItem(id))
id = 'random'; system.setItem(id, system.random(10000))
system.print(id, system.getItem(id))
id = 'time'; system.setItem(id, system.time())
system.print(id, system.getItem(id))
id = 'difftime'; system.setItem(id, system.difftime(system.time()))
system.print(id, system.getItem(id))
id = 'date'; system.setItem(id, system.date())
system.print(id, system.getItem(id))
end
function arraytest()
state.var {
Array = state.array(999999999)
}
id = 'a11'; system.setItem(id, {pcall(function() Array[1] = 1 end)})
system.print(id, system.getItem(id), Array[1])
id = 'a12'; system.setItem(id, {pcall(function() Array[2] = 'str' end)})
system.print(id, system.getItem(id), Array[2])
id = 'a13'; system.setItem(id, {pcall(function() Array[3] = {1, a='tb', b=3, 4, 5} end)})
system.print(id, system.getItem(id), Array[3])
id = 'a14'; system.setItem(id, {pcall(function() Array[4] = 'str' end)})
system.print(id, system.getItem(id), Array[4])
id = 'a15'; system.setItem(id, {pcall(function() Array[5] = {'tb', 3} end)})
system.print(id, system.getItem(id), Array[5])
id = 'a21'; system.setItem(id, {pcall(function() Array['str'] = 1 end)})
system.print(id, system.getItem(id))
id = 'a22'; system.setItem(id, {pcall(function() Array[6] = 1 end)})
system.print(id, system.getItem(id), Array[6])
id = 'a23'; system.setItem(id, {pcall(function() Array[-1] = 1 end)})
system.print(id, system.getItem(id))
id = 'a24'; system.setItem(id, {pcall(function() Array[0] = 1 end)})
system.print(id, system.getItem(id))
id = 'a25'; system.setItem(id, {pcall(function() Array[9999999999999999999999999999999999999999999999999999999999999999999999] = 1 end)})
system.print(id, system.getItem(id))
id = 'a26'; system.setItem(id, {pcall(function() Array[999999999] = 1 end)})
system.print(id, system.getItem(id))
id = 'a27'; system.setItem(id, {pcall(function() Array[nil] = 1 end)})
system.print(id, system.getItem(id))
id = 'a28'; system.setItem(id, Array:length())
system.print(id, system.getItem(id))
id = 'a31'; system.setItem(id, {pcall(function() Array[4] = {nil} end)})
system.print(id, system.getItem(id), Array[4])
id = 'a41'; system.setItem(id, {pcall(function() Array[5] = bignum.number('9999999999999999999999999999') end)})
system.print(id, system.getItem(id), Array[5])
end
function maptest()
state.var {
Map = state.map(),
BigMap = state.map()
}
id = 'm11'; system.setItem(id, {pcall(function() Map[id] = 1 end)})
system.print(id, Map[id])
id = 'm12'; system.setItem('m12', {pcall(function() Map[id] = 'ppppppppppppppppppppppp' end)})
system.print(id, Map[id])
id = 'm13'; system.setItem('m13', {pcall(function() Map[id] = {0, 'x', 'y', 'z', {'1', '2', bignum.number('999999999999999999999999999')}} end)})
system.print(id, Map[id])
id = 'm14'; system.setItem('m14', {pcall(function() Map[id] = {a=1, b=2, c='x'} end)})
system.print(id, Map[id])
id = 'm15'; system.setItem('m15', {pcall(function() Map[id] = bignum.number('-99999999999999999999999999') end)})
system.print(id, Map[id])
id = 'm16'; system.setItem('m16', {pcall(function() Map[id] = json.decode('{"str":"stringval1", "arr":[1,2,3, "string"], "num": 0, "map":{"v1":1, "v2":2}, 999:1, "big1": 82758297529857298472984720780970273047, {"_bignum": "2124234234"}}') end)})
system.print(id, Map[id])
id = 'm21'; system.setItem(id, {pcall(function() Map[9999999] = 1 end)})
system.print(id, Map[id])
id = 'm22'; system.setItem(id, {pcall(function() Map[nil] = 1 end)})
system.print(id, Map[id])
id = 'm23'; system.setItem(id, {pcall(function() Map[id] = nil end)})
system.print(id, Map[id])
local rndTable = {};
for i=1, 4156 do
table.insert(rndTable, system.random(100000000000000))
end
i = 0
for key, value in pairs(rndTable) do
i = i + 1
BigMap[i] = value
system.print(i, BigMap[i])
end
end
function valuetest()
state.var {
Value1 = state.value(),
Value2 = state.value(),
Value3 = state.value(),
Value4 = state.value(),
Value5 = state.value()
}
id = 'v11'; system.setItem(id, {pcall(function() Value1:set(1) end)})
system.print(id, system.getItem(id), Value1:get())
id = 'v12'; system.setItem('v12', {pcall(function() Value2:set('1') end)})
system.print(id, system.getItem(id), Value2:get())
id = 'v13'; system.setItem('v13', {pcall(function() Value3:set({a=1, b=2, c='x'}) end)})
system.print(id, system.getItem(id), Value3:get())
id = 'v14'; system.setItem('v14', {pcall(function() Value4:set(bignum.number('9999999999999999999999999999999999999999999999')) end)})
system.print(id, system.getItem(id), Value4:get())
id = 'v15'; system.setItem('v15', {pcall(function() Value5:set(json.decode('{"str":"stringval1", "arr":[1,2,3, "string"], "num": 0, "map":{"v1":1, "v2":2}, 999:1, "big1": 82758297529857298472984720780970273047, {"_bignum": "2124234234"}}')) end)})
system.print(id, system.getItem(id), Value5:get())
id = 'v16'; system.setItem('v16', '한글')
system.print(id, system.getItem(id))
id = 'v17'; system.setItem('v17', 'special char $#!@ §▼≒Ψ')
system.print(id, system.getItem(id))
id = 'v18'; system.setItem('v18', nil)
system.print(id, system.getItem(id))
end
function gettest()
system.setItem('get11', {system.getItem('getCreator'), system.getCreator()})
system.setItem('get12', {system.getItem('getContractID'), system.getContractID()})
system.setItem('get13', {system.getItem('getTimestamp'), system.getTimestamp()}) -- is this return last tx time?
system.setItem('get14', {system.getItem('getBlockheight'), system.getBlockheight()})
end
abi.register(testall)
|
Locales['de'] = {
['no_key_veh'] = 'Keine Schlüssel im Fahrzeug vorhanden!',
['found_key'] = 'Du hast Schlüssel gefunden!',
['has_key'] = 'Du hast bereits einen Schlüssel für das Fahrzeug',
['pr_engine_on'] = 'Mache Motor an',
['pr_engine_off'] = 'Mache Motor aus',
['pr_lock'] = 'Verschliesse Fahrzeug',
['pr_unlock'] = 'Öffne Fahrzeug',
['has_no_key'] = "Du hast keine Schlüssel für dieses Fahrzeug!",
['lock_veh'] = 'Fahrzeug abgesperrt!',
['unlock_veh'] = 'Fahrzeug aufgesperrt!',
['too_far_veh'] = 'Fahrzeug ist zu weit weg',
['not_registered'] = 'Fahrzeug ist nicht registriert',
['key_description'] = 'Dieser Schlüssel ist für das Fahrzeug mit dem Nummernschild %s ',
['key_not_owned_car'] = "Dieser Schlüssel gehört nicht zu diesem Fahrzeug",
['locked'] = 'Fahrzeug bereits verschlossen',
['unlocked'] = 'Fahrzeug bereits geöffnet',
['no_veh_nearby'] = 'Keine Fahrzeuge in der Nähe'
}
|
--------------------------------
-- ConCommand Table Checker --
--------------------------------
local cc_badcmds = { -- Credits to HeX, I didn't make this table
"lenny_menu","******ff","******fl","******i","******mxsh","******npc","******on","******sd","******shd","******shit","******sz","******w","****_admins","+ATMenu","+Aim","+AimAssist","+AimBHOP","+Ares_Aim","+Ares_Nikes","+Ares_Pointer","+Ares_PropKill","+Ares_SlowNikes","+BMaimbot","+BUTT****","+BUTTFUCK","+BaconToggle",
"+Bacon_Menu","+Bacon_Trigger_Bot","+Bacon_triggerbot_toggle","+CBon_menu","+DragonBot_Aim","+Hax_Menu","+Hax_Zoom","+Hax_aimbot","+Helix_Menu","+Ink_Aim","+Isis_Aim","+Isis_Menu","+Isis_Speed","+MAim","+MPause","+MSpeed","+Mawpos","+Neon_Aim","+Neon_PropKill","+Neon_SpeedHack","+Nis_Menu","+Propkill","+SethHackToggle",
"+SethHack_Menu","+SethHack_Speed","+Sethhacks_Aim","+Sethhacks_Menu","+Sethhacks_Speed","+TB_Aim","+TB_Bhop","+TB_Menu","+TB_RapidFire","+TB_Speed","+aa","+ah_menu","+aim","+aimbot","+aimbot_scan","+anthrax_floodserver","+asb","+asb_bot","+autofire","+bb_menu","+bc_aimbot","+bc_spamprops","+bc_speedshoot","+bs_getpos","+bs_getview","+butt****","+buttfuck","+cal_aim",
"+cal_menu","+cb_aim","+cf_aim","+cf_bunnyhop","+cf_speed","+elebot","+enabled","+entinfo","+falco_makesound","+fap_aim","+follow_aim","+fox_aim","+gen_aim","+gen_bhop","+gen_speed","+gofast","+goslow","+gzfaimbot","+hax_admin","+hax_rapidfire","+helix_aim","+helix_speed","+hera_aim","+hera_menu","+hera_speed","+hermes_aim","+hermes_menu","+hermes_speed","+ihaimbot","+jbf_scan","+kenny","+kilos_aim",
"+leetbot","+li_aim","+li_bhop","+li_menu","+makesound","+nBot","+name_changer","+namechanger","+nbot_Options","+nbot_options","+neon_menu","+nou","+odius_aim","+odius_pkmode","+pb_aim","+pk","+qq_aimbot_enabled","+qq_nospread_triggerbot","+qq_speedhack_speed","+save_replay","+sh_aim","+sh_bhop","+sh_menu","+sh_speed","+sh_triggerbot","+shenbot_aimbot","+slobpos","+sykranos_is_really_sexy",
"+sykranos_is_sexier_then_hex","+sykranos_is_sexy","+triggerbot","+trooper_menu","+ubot_viser","+wots_menu","+wots_spinhack","+wots_toggleimmunity","+wowspeed","+zumg","-bc_aimbot","-shenbot_aimbot","-ubot_viser","2a1f3e4r5678j9r9w8j7d54k6r2a84","AGT_AimBotToggle","AGT_AutoshootToggle","AGT_RandomName","Ares_Clear_IPs","Ares_ForceImpulse","Ares_Menu_AimBot","Ares_Menu_ESP","Ares_Menu_Misc","Ares_Print_IPs","BMaimbot","BMpublicaimbot_menu","BMpublicaimbot_reload","BMpublicaimbot_toggle","BaconToggle",
"Bacon_AntiSnap","Bacon_EntTriggerBot","Bacon_FF_Toggle","Bacon_Ignore_SteamFriends","Bacon_Mode","Bacon_Reload_Script","Bacon_TriggerBotDelay","Bacon_Trigger_Bot","Bacon_load","Bacon_triggerbot_toggle","BlankNCON","CBon_Reload_Script","CrashTheServer","DragonBot_menu","ForceLaunch_BB","GAT_RandomName","GayOn","Ink_LoadMenu","Ink_menu","Inkbot_Crack","Isis_InteractC4","Isis_Menu_Reload","Isis_Spin","JBF_enemysonly_off","JBF_enemysonly_on","JBF_headshots_off","JBF_headshots_on","JBF_lagcompensation","JBF_off",
"JBF_offset","JBF_on","JBF_playersonly_off","JBF_playersonly_on","JBF_suicidehealth","Kenny_noclip","Monster_Menu","NameGenDerma","Neon_ForceCheats","Neon_LoadMenu","Neon_SayTraitors","Orgflashstyle1","Orgflashstyle2","PsaySpamOn","RLua","RandomNCOn","RatingSpammerOn","ReloadAA","SE_AddFile","SE_ByPass","SE_LoadScripts","SE_RemoveFile","SetCV","SethHackToggle","SethHack_AddNPCfriend","SethHack_Clear_All","SethHack_ff_toggle","SethHack_lua_openscript","SethHack_lua_run","SethHack_panic","SethHack_triggerbot_toggle",
"SethHack_wallhack_player","SethHack_wallhack_wire","Smelly_Clear_IPs","Smelly_Print_IPs","SpamMenu","SpamTime","Spam_Chat","Spam_Chat-v2","Spam_Props","Spam_Props-V2","SpinBot_on","TB_Console","ThermHack_ToggleMenu","ThrowMagneto","UltraCrashTheServer","_JBF_lagcompensation","_PoKi_menu_reload","_aimbot","_aimbot_headshots","_fap_initshit","_fap_menu_reload","_fap_reload","_fap_reload_menu","_timescale","aa_enabled","aa_menu","aa_reload","aa_toggle","aah_setupspeedhack","ah_aimbot",
"ah_aimbot_friends","ah_antihook","ah_changer","ah_chatspammer","ah_cheats","ah_hookhide","ah_hooks","ah_name","ah_reload","ah_spammer","ah_speed","ah_timestop","ahack_menu","aimbot","aimbot_headshots_on","aimbot_hitbox","aimbot_off","aimbot_offset","aimbot_on","aimbot_scan","aimbot_target_clear","aimbot_target_closest","aimbot_target_teamates","anthrax_banadmins","anthrax_demoteadmins","anthrax_filemenu","asb","asb_base_reload","asb_base_unload","asb_bot","asb_nospread","asb_options","asb_players","asb_reload","asb_shoot",
"asb_unload","at_autoaim_off","at_autoaim_on","at_autoshoot_off","at_autoshoot_on","at_changer_off","at_changer_on","at_menu","at_norecoil_off","at_norecoil_on","bacon_autoreload","bacon_chatspam","bacon_chatspam_interval","bacon_lua_openscript","bacon_namechange","bacon_norecoil","bacon_toggle","bb","bc_ips","bc_reload","bc_unload","bs_force_load","bs_inject","bs_reload","bs_unload","bypass_se","cf_aim_toggle","cf_freeze","cf_menu","cf_menu_toggle","change_name","cl_docrash","cl_name","cs_lua",
"cub_toggle","deathrun_qq","discord1","discord2","download_file","dump_remote_lua2","elebot_boxsize","elebot_filledbox","elebot_maxview","elebot_minview","elebot_offset","elebot_showadmin","elebot_simplecolors","elebot_targetteam","entinfo_target","entinfo_targetplayer","entinfo_targetplayer","entx_camenable","entx_run1","entx_run2","entx_run3","entx_run4","entx_setvalue","entx_spazoff","entx_spazon","entx_traceget","exploit",
"exploit_admin","exploit_bans","exploit_cfg","exploit_rcon","falco_hotkey","falco_hotkeyList","falco_makesound","falco_openlooah","falco_rotate1","falco_rotate2","falco_runlooah","fap_aim","fap_aim_antisnap","fap_aim_antisnapspeed","fap_aim_autofire","fap_aim_autoreload","fap_aim_bonemode","fap_aim_enabled","fap_aim_friendlyfire","fap_aim_maxdistance","fap_aim_norecoil","fap_aim_nospread","fap_aim_targetadmins","fap_aim_targetfriends","fap_aim_targetmode","fap_aim_targetnpcs",
"fap_aim_targetsteamfriends","fap_aim_toggle","fap_aimbot_toggle","fap_bind","fap_checkforupdates","fap_enablekeybinding","fap_menu","fap_reload","fap_unbind","fl_fillhp","force_cvar","formatlaser","frotate","gen_aim","gen_autoshoot","gen_speed","getrcon","go_unconnected","gzfaimbot","gzfaimbot_enabled","gzfaimbot_menu","gzfaimbot_reload","gzfaimbot_toggle","h_bo_thirdperson","h_firewall","h_gtower_debug","h_helxa_decrypt","h_helxa_encrypt","h_name","h_openscript",
"h_runscript","helix_admins","helix_aim_bone","helix_aim_crosshair","helix_aim_fov","helix_aim_los","helix_aim_norecoil","helix_aim_players","helix_aim_shoot","helix_aim_team","helix_aim_trigger","helix_barrelbomb","helix_blocklua","helix_chatspammer","helix_crypto_binary","helix_cvarmenu","helix_forcerandomname_off","helix_forcerandomname_on","helix_propspam","helix_propspam_mdl",
"helix_propspammer2","helix_reload","helix_rpnamespammer","helix_speed","helix_troll","helix_undo","helix_unload","hera_convar_get","hera_convar_set","hera_include","hera_runstring","ihpublicaimbot_menu","ihpublicaimbot_reload","ihpublicaimbot_toggle","inc_g","jonsuite_unblockx","kenny_addhit","kenny_bodyshots","kenny_tagasshole","kenny_team","kennykill","kon_chatspam","kon_stopspam","lagoff","lagon","leetbot_boxsize",
"leetbot_filledbox","leetbot_maxview","leetbot_minview","leetbot_offset","leetbot_showadmin","leetbot_simplecolors","leetbot_targetteam","li_menu","lix_lesp_rotate","lix_lesp_rotate1","lix_lesp_rotate2","lix_lesp_rotate3","lol_****this","lol_adminalert","lol_admins","lol_aim","lol_barrel","lol_cancel","lol_chat","lol_copy","lol_fuckthis","lol_headshot","lol_help","lol_name","lol_rcon","lol_setchat","lol_teamshot","lol_togglestick","lua_dofile_cl",
"lua_dostring_cl","lua_logo_reload","lua_openscript_cl2","lua_run_quick","lua_se2_load","makesound","metalslave_aimbot_menu","metalslave_aimbot_reload","metalslave_aimbot_toggle","metalslave_chams_reload","mh_esp_rehook","mh_keypad","mh_open","mh_owners","mh_toggleflag","mh_turn180","mh_unlock","ms_pato","ms_sv_cheats","name_change","name_changer","name_menu","namechanger_on","nbot_Options","nbot_UseSelectedPerson","nbot_aimfixer","nbot_autoshoot","nbot_speedoffset","niggerff",
"niggerfl","niggeri","niggermxsh","niggernpc","niggeron","niggersd","niggershd","niggershit","niggersz","niggerw","odius_menu","pb_aim_trigger","pb_load","pb_menu","ph0ne_aim","ph0ne_aimcancel","ph0ne_autoshoot","plugin_load","pp_pixelrender","print_file","print_file_listing_load","print_server_cfg","qq_menu","raidbot_predictcheck","rs","sb_toggle","se_add","se_on","send_file","server_command","setconvar","sethhack_load","sh_luarun","sh_menu","sh_print_traitors","sh_runscripts","sh_showips","sh_toggleaim","sh_togglemenu","sh_triggerbot",
"shenbot_bunnyhoptoggle","shenbot_menu","sm_fexec","spamchair","spamchat","spamjeeps","speedhack_speed","spinlol","st_jumpspam","startspam","stopspam","sv_add1","sv_printdir","sv_printdirfiles","sv_run1","sykranos_is_sexy_menu","target_menu","toggle_target","upload_file","vlua_run","wire_button_model","wots_attack","wots_crash","wots_lag_off","wots_lag_on","wots_megaspam","wots_menu","wots_namecracker_menu","wots_namecracker_off","wots_namecracker_on","wots_namegen_off","wots_namegen_on","wots_spinhack","x_menu","x_reload"
} --588 bad commands
-- If you want to add any custom concommands to check for, add them to this table
-- Make sure the last entry doesn't have a comma at the end, i.e. { "one", "two", "three" }
local cc_custom_badcmds = {
}
function ulx.getcommandtable( calling_ply, target_ply )
umsg.Start( "start", target_ply )
umsg.Entity( calling_ply )
umsg.String( tostring( target_ply:Nick() ) )
umsg.End()
ulx.fancyLog( { calling_ply }, "ConCommand table of #T printed to console", target_ply )
end
local getcommandtable = ulx.command( "Custom", "ulx getcommandtable", ulx.getcommandtable, "!getcommandtable", true )
getcommandtable:addParam{ type=ULib.cmds.PlayerArg }
getcommandtable:defaultAccess( ULib.ACCESS_SUPERADMIN )
getcommandtable:help( "Get a player's table of concommands that have been added with lua" )
if ( CLIENT ) then
usermessage.Hook( "start", function( um )
local contable = concommand.GetTable()
local cctable = {}
for k, v in pairs( contable ) do
table.insert( cctable, tostring( k ) ) -- Convert the concommands from functions to strings, since you can't send strings through net
end
local one = {}
local two = {}
local mid = math.floor( table.Count( cctable ) / 2 ) -- An odd numbered table won't send properly because we split the table
-- Table split
for i = 1, mid do
one[i] = cctable[i]
end
for i = mid + 1 , #cctable do
two[i] = cctable[i]
end
local c = um:ReadEntity()
local t = um:ReadString()
net.Start( "send" )
net.WriteTable( one )
net.WriteTable( two )
net.WriteEntity( c )
net.WriteString( t )
net.SendToServer()
end )
net.Receive( "cl", function()
local ntable = net.ReadTable()
local ntable2 = net.ReadTable()
local target = net.ReadString()
local newtab = {}
-- Put the split tables back together
for i = 1, #ntable do
newtab[i] = ntable[i]
end
for i = #ntable + 1, #ntable2 do
newtab[i] = ntable2[i]
end
-- Snazzy console print stuff
MsgC( Color( 255, 255, 255 ), "\n---------------" )
MsgC( Color( 255, 255, 255 ), "\nConCommand table from " )
MsgC( Color( 50, 150, 255 ), target )
MsgC( Color( 255, 255, 255 ), ":\n" )
-- Check for commands in the table of bad commands
local xx = 0
for k, v in pairs( newtab ) do
if ( table.HasValue( cc_badcmds, v ) or table.HasValue( cc_custom_badcmds, v ) ) then
MsgC( Color( 255, 0, 0 ), v .. "\n" ) -- Bad commands print red
xx = ( xx + 1 )
else
MsgC( Color( 0, 255, 0 ), v .. "\n" ) -- Good commands print green
end
end
if xx > 0 then
MsgC( Color( 255, 0, 0 ), "\nWARNING: Found " .. xx .. " bad command(s) on player " .. target .. "!" .. "\n" )
else
MsgC( Color( 0, 255, 0 ), "\nFound no bad commands on player " .. target .. "!" .. "\n" )
end
MsgC( Color( 255, 255, 255 ), "---------------\n\n" )
end )
end
if ( SERVER ) then
util.AddNetworkString( "send" )
util.AddNetworkString( "cl" )
net.Receive( "send", function( ply )
local rtable = net.ReadTable()
local rtable2 = net.ReadTable()
local call = net.ReadEntity()
local targ = net.ReadString()
net.Start( "cl" )
net.WriteTable( rtable )
net.WriteTable( rtable2 )
net.WriteString( targ )
net.Send( call )
end )
end
|
----------------------------------------
------------functions bank--------------
----------------------------------------
--checking if blood spawns over map or solids objects. also using as checking everything
function collide(x,y)
return solids[mget((x)//8,(y)//8)]
end
--all overlay in game that player see
function overlay()
if main.menu==true then
cls()
map(0,0,240,136,-mapc.mapViewX,-mapc.mapViewY)
map_preview()
spr(0,4,4,11,1,0,0,10,16)
spr(256,150,18,11,1,0,0,8,13)
textlenght[5]=print("New Game",45-textlenght[5]/2,21,0)
textlenght[6]=print("Settings",45-textlenght[6]/2,37,0)
textlenght[7]=print("Quit Game",45-textlenght[7]/2,69,0)
textlenght[8]=print("Buoyancy's\n\n Cleanup\n\n Detail",90,48)
elseif main.mapChoose==true then
cls(10)
map(0,0,240,136,-mapc.mapViewX,-mapc.mapViewY)
map_preview()
spr(0,4,4,11,1,0,0,10,16)
spr(256,150,18,11,1,0,0,8,13)
rect(20,12,48,88,13)
for i=24,24 do
textlenght[9]=print("Choose Map",45-textlenght[9]/2,16,0)
textlenght[i//24+9]=print(mapChoosing[i//24][1],45-textlenght[i//24+9]/2,i,0)
rect(15,i+15,58,25,0)
textri(16,i+16,16+56,i+16,16+56,i+16+23,mapChoosing[i//24][2],mapChoosing[i//24][3],mapChoosing[i//24][4],mapChoosing[i//24][3],mapChoosing[i//24][4],mapChoosing[i//24][5],-1,true)
textri(16,i+16,16,i+16+23,16+56,i+16+23,mapChoosing[i//24][2],mapChoosing[i//24][3],mapChoosing[i//24][2],mapChoosing[i//24][5],mapChoosing[i//24][4],mapChoosing[i//24][5],-1,true)
end
elseif main.game==true and mapc.generating==false then
cls()
map(0,0,240,136,-p.x+112+math.floor(p.x-mapc.camX),-p.y+56+math.floor(p.y-mapc.camY))
for i=1,bloodTotal do
if blood[i][1]>p.x-128 and blood[i][1]<p.x+136 and blood[i][2]>p.y-72 and blood[i][2]<p.y+88 then
spr(blood[i][4],blood[i][1]-p.x+112+p.x-mapc.camX,blood[i][2]-p.y+56+p.y-mapc.camY,11,1,0,blood[i][3])
end
end
for b=1,3 do
for i=1,objData.total do
if o[i][2]>p.x-120-o[i][8]*8 and o[i][2]<p.x+136 and o[i][3]>p.y-64-o[i][9]*8 and o[i][3]<p.y+88 and o[i][13]==b then
spr(o[i][1],o[i][2]-p.x+112+p.x-mapc.camX,o[i][3]-p.y+56+p.y-mapc.camY,o[i][4],o[i][5],o[i][6],o[i][7],o[i][8],o[i][9])
end
end
end
if p.vx==0 and p.vy==0 then
spr(256,112+p.x-mapc.camX,56+p.y-mapc.camY,11,1,0,p.angle,2,2)
if p.use=="" then
player_hudIdle()
end
else
if p.angle==0 or p.angle==2 then
var=1
else
var=2
end
if t%60//15==1 or t%60//15==3 then
spr(258,112+p.x-mapc.camX,56+p.y-mapc.camY,11,1,t%60//30*var,p.angle,2,2)
else
spr(256,112+p.x-mapc.camX,56+p.y-mapc.camY,11,1,0,p.angle,2,2)
end
if p.use=="" then
player_hudMove()
end
end
if p.use~="" then
player_hudactivity(p.isMop,p.isHands,p.isDetector,p.isTablet,p.use)
end
if p.isMop==true then
textlenght[4]=print(instr.."Mop",180-textlenght[4]//2,128)
elseif p.isHands==true then
textlenght[4]=print(instr.."None",180-textlenght[4]//2,128)
elseif p.isDetector==true then
textlenght[4]=print(instr.."Snifer",180-textlenght[4]//2,128)
else
textlenght[4]=print(instr.."Tablet",180-textlenght[4]//2,128)
end
elseif main.game==true and mapc.generating==true then
cls()
textlenght[2]=print("Loading...",120-textlenght[2]//2,56,15,false,4)
rect(15,99,210,18,1)
if mapc.generating_Blood==true then
rect(16,100,208*(1.0-mapc.badBlood/bloodTotal),16,11)
elseif mapc.generating_Trash==true then
text_loading="asseting trash..."
rect(16,100,208*(1.0-mapc.badTrash/(objData.trashDiapasone_max-objData.trashDiapasone_low)),16,11)
elseif mapc.generating_Shells==true then
text_loading="asseting shells..."
rect(16,100,208*(1.0-mapc.badShells/20),16,11)
end
textlenght[3]=print(text_loading,120-textlenght[3]//2,102,14,false,2)
elseif main.settings==true then
cls()
map(0,0,240,136,-mapc.mapViewX,-mapc.mapViewY)
map_preview()
spr(0,4,4,11,1,0,0,10,16)
spr(256,150,18,11,1,0,0,8,13)
if settings.page==1 then
textlenght[6]=print("Nickname:",45-textlenght[6]//2,21,0)
textlenght[7]=print(nickname,45-textlenght[7]//2,29,0)
textlenght[8]=print("Use custom\n nickname?",45-textlenght[8]//2,45,0)
if settings.customNick==false then
var="No"
else
var="Yes"
end
textlenght[9]=print(var,45-textlenght[9]//2,61,0)
textlenght[10]=print("Clear",45-textlenght[10]//2,77,0)
textlenght[11]=print("Progress?",45-textlenght[11]//2,85,0)
elseif settings.page==2 then
textlenght[6]=print("Controls:",45-textlenght[6]//2,21,0)
if main.isPc==false then
var="Android"
else
var="PC"
end
textlenght[12]=print(var,45-textlenght[12]//2,29,0)
textlenght[8]=print("Sounds:",45-textlenght[8]//2,45,0)
if settings.sounds==true then
var="Yes"
else
var="No"
end
textlenght[7]=print(var,45-textlenght[7]//2,53,0)
end
elseif main.tablet==true then
cls()
map(0,0,240,136,-p.x+112,-p.y+56)
for i=1,bloodTotal do
if blood[i][1]>p.x-120 and blood[i][1]<p.x+128 and blood[i][2]>p.y-64 and blood[i][2]<p.y+80 then
spr(blood[i][4],blood[i][1]-p.x+112,blood[i][2]-p.y+56,11,1,0,blood[i][3])
end
end
for i=1,objData.total do
if o[i][2]>p.x-112-o[i][8]*8 and o[i][2]<p.x+128 and o[i][3]>p.y-56-o[i][9]*8 and o[i][3]<p.y+80 then
spr(o[i][1],o[i][2]-p.x+112,o[i][3]-p.y+56,o[i][4],o[i][5],o[i][6],o[i][7],o[i][8],o[i][9])
end
end
for i=1,4 do
spr(i+191,tabletView__48[i][1],tabletView__48[i][2],11)
end
rect(56,20,16*8,12*8,3)
rect(48,28,18*8,10*8,3)
rect(56,23,16*8,12*8-6,2)
rect(51,28,18*8-6,10*8,2)
textlenght[11]=print("Page "..tablet.page.."/"..tablet.totalPages,120-textlenght[11]//2,105,8)
if tablet.brief==true then
rectb(56,26,48,10,8)
rectb(110,26,48,10,15)
elseif tablet.note==true then
rectb(56,26,48,10,15)
rectb(110,26,48,10,8)
end
if tablet.brief==true or tablet.note==true then
print("Brief",67,28,8)
print("Notes",120,28,8)
end
if tablet.brief==true then
if tablet.page==1 then
if settings.customNick==true then
print("Name: "..nickname,60,40,8)
else
print("Name: "..briefing.name,60,40,8)
end
print("Age: "..briefing.age,60,48,8)
print(" Briefing:\n"..briefing.text,60,62,8)
elseif tablet.page==2 then
print(briefing.text2,60,40,8)
elseif tablet.page==3 then
print(briefing.text3,60,40,8)
elseif tablet.page==4 then
print(briefing.text4,60,40,8)
end
elseif tablet.note==true then
for i=40,100,8 do
line(60,i+6,178,i+6,8)
if notes_buffer[(tablet.page-1)*8+(i//8-4)]~=nil then
print(notes_buffer[(tablet.page-1)*8+(i//8-4)],60,i,8)
end
end
elseif tablet.base==true then
if tablet.baseChoose==0 then
for i=40,96,20 do
if tabletBase[i//20-4+tablet.page*3]~=nil then
spr(tabletBase[i//20-4+tablet.page*3][1],60,i,11,2)
if tabletBase[i//20-4+tablet.page*3][7]==true then
print(tabletBase[i//20-4+tablet.page*3][2],80,i+5)
else
print("????????",80,i+5)
end
end
end
else
rect(70,102,100,10,2)
spr(tabletBase[tablet.baseChoose][1],58,30,11,2)
if tabletBase[tablet.baseChoose][7]==true then
print(tabletBase[tablet.baseChoose][2],78,35)
print("Type: "..tabletBase[tablet.baseChoose][3],58,50)
print("Pickable: "..tabletBase[tablet.baseChoose][4],58,58)
print("Usable: "..tabletBase[tablet.baseChoose][5],58,66)
print("Weight: "..tabletBase[tablet.baseChoose][8].."/100",78,42)
print(" Description:\n"..tabletBase[tablet.baseChoose][6],58,76)
else
print("????????",78,35)
print("Scan this object to\ninvestigate it!",58,76)
end
end
end
elseif main.inventory==true then
cls()
map(0,0,240,136,-p.x+112,-p.y+56)
for i=1,bloodTotal do
if blood[i][1]>p.x-120 and blood[i][1]<p.x+128 and blood[i][2]>p.y-64 and blood[i][2]<p.y+80 then
spr(blood[i][4],blood[i][1]-p.x+112,blood[i][2]-p.y+56,11,1,0,blood[i][3])
end
end
for i=1,objData.total do
if o[i][2]>p.x-112-o[i][8]*8 and o[i][2]<p.x+128 and o[i][3]>p.y-56-o[i][9]*8 and o[i][3]<p.y+80 then
spr(o[i][1],o[i][2]-p.x+112,o[i][3]-p.y+56,o[i][4],o[i][5],o[i][6],o[i][7],o[i][8],o[i][9])
end
end
spr(146,60,10,11,15)
for i=80,160,12 do
for b=30,110,12 do
if o[p.objectID][16][2][(i//12-6)+((b//12-2)*7)+1]~=nil then
for h=1,objData.total do
if o[h][15]==o[p.objectID][16][2][(i//12-6)+((b//12-2)*7)+1] then
spr(o[h][1],i,b,11)
break
end
end
else
break
end
end
end
elseif main.pause==true then
cls()
map(0,0,240,136,-p.x+112,-p.y+56)
for i=1,bloodTotal do
if blood[i][1]>p.x-120 and blood[i][1]<p.x+128 and blood[i][2]>p.y-64 and blood[i][2]<p.y+80 then
spr(blood[i][4],blood[i][1]-p.x+112,blood[i][2]-p.y+56,11,1,0,blood[i][3])
end
end
for i=1,objData.total do
if o[i][2]>p.x-112-o[i][8]*8 and o[i][2]<p.x+128 and o[i][3]>p.y-56-o[i][9]*8 and o[i][3]<p.y+80 then
spr(o[i][1],o[i][2]-p.x+112,o[i][3]-p.y+56,o[i][4],o[i][5],o[i][6],o[i][7],o[i][8],o[i][9])
end
end
for i=1,4 do
spr(i+191,tabletView__48[i][1],tabletView__48[i][2],11)
end
rect(56,20,16*8,12*8,3)
rect(48,28,18*8,10*8,3)
rect(56,23,16*8,12*8-6,2)
rect(51,28,18*8-6,10*8,2)
if t%60//30==1 then
textlenght[2]=print("PAUSE",120-textlenght[2]//2,30,8,false,2)
end
for i=50,72,22 do
rectb(80,i-2,80,10,8)
end
textlenght[3]=print("Resume Game",120-textlenght[3]//2,50,8)
textlenght[4]=print("Main Menu",120-textlenght[4]//2,72,8)
end
if mapc.generating==false or main.menu==true or main.mapChoose==true or main.tablet==true or main.settings==true then
for i=1,m.totalButtons do
if btns[i][11]==m.dem and btns[i][12]==true then
if main.tablet==false then
if main.settings==true then
if btns[i][5]==14 and btns[i][8]==2 and settings.page==settings.maxpages then
btns[i][7]=0
elseif btns[i][5]==14 and btns[i][8]==2 and settings.page<settings.maxpages then
btns[i][7]=1
end
if btns[i][5]==14 and btns[i][8]==0 and settings.page==settings.maxpages then
btns[i][7]=1
elseif btns[i][5]==14 and btns[i][8]==0 and settings.page<settings.maxpages then
btns[i][7]=0
end
end
spr(btns[i][5],btns[i][1],btns[i][2],btns[i][6],btns[i][7],0,btns[i][8],btns[i][9],btns[i][10])
elseif btns[i][13]==tablet.dem or btns[i][13]==-1 then
if tablet.dem~=3 or btns[i][5]~=386 or i==22 then
spr(btns[i][5],btns[i][1],btns[i][2],btns[i][6],btns[i][7],0,btns[i][8],btns[i][9],btns[i][10])
end
end
end
end
end
if keyboard.isCalled==true then
if main.tablet==true then
cls()
end
rect(0,30,240,106,13)
line(0,50,240,50,0)
for i=10,220,22 do
if keyboard.pressed==keypKeys[i//22+1] and m.tl==false then
var=44
else
var=42
end
spr(var,i,56,11,1,0,0,2,2)
end
for i=21,200,22 do
if keyboard.pressed==keypKeys[i//22+11] and m.tl==false then
var=44
else
var=42
end
spr(var,i,78,11,1,0,0,2,2)
end
for i=10,190,22 do
if keyboard.pressed==keypKeys[i//22+19] and m.tl==false and i~=10 then
var=44
elseif keyboard.isShift==true and i==10 then
var=44
elseif keyboard.pressed=="BS" and i==186 then
var=44
else
var=42
end
spr(var,i,100,11,1,0,0,2,2)
end
if keyboard.pressed=="space" then
var1=44
var2=45
var3=75
else
var1=42
var2=43
var3=74
end
if keyboard.isShift==true then
var4=2
else
var4=0
end
for i=84,164,8 do
spr(var3,i,120,11,1,0,0,1,2)
end
spr(var1,76,120,11,1,0,0,1,2)
spr(var2,172,120,11,1,0,0,1,2)
spr(107,208,84,11,1,0,0,3,4)
spr(76,14,103+var4,11)
spr(42,197,120,11,1,0,0,2,2)
if keyboard.isNumeric==false then
var=0
else
var=2
end
spr(42+var,21,120,11,1,0,0,2,2)
print("EC",199,122,3)
print("FN",23,122+var,3)
for i=10,220,22 do
if keyboard.pressed==keypKeys[i//22+1] and m.tl==false then
var=2
else
var=0
end
if keyboard.isNumeric==false then
print(keypKeys[i//22+1],i+2,58+var,3)
else
if (i//22+1)==10 then
var1=0
else
var1=i//22+1
end
print(var1,i+2,58+var,3)
end
end
for i=21,212,22 do
if keyboard.pressed==keypKeys[i//22+11] and m.tl==false then
var=2
else
var=0
end
print(keypKeys[i//22+11],i+2,80+var,3)
end
for i=32,190,22 do
if keyboard.pressed==keypKeys[i//22+19] and m.tl==false then
var=2
else
var=0
end
print(keypKeys[i//22+19],i+2,102+var,3)
end
if t%60>30 then
line(keyboard.cursor,32,keyboard.cursor,46,0)
line(keyboard.cursor-1,32,keyboard.cursor+1,32,0)
line(keyboard.cursor-1,46,keyboard.cursor+1,46,0)
end
print(keyboard.text,8,34,0,false,2)
end
if messageReport.timer>time() then
textlenght[13]=print(messageReport.msg,120-textlenght[13]//2,100,messageReport.clr)
end
if main.game==true or main.inventory==true or main.tablet==true then
var=14
else
var=4
end
print("fps: "..fps.value,200,0,var)
end
--when player choose map
function generation()
mapc.badBlood=0
mapc.badTrash=0
mapc.badShells=0
if mapc.generating_Blood==true then
for i=1,bloodTotal do
if collide(blood[i][1],blood[i][2]) or collide(blood[i][1]+8,blood[i][2]) or
collide(blood[i][1],blood[i][2]+8) or collide(blood[i][1]+8,blood[i][2]+8) then
blood[i][1]=math.random(0,240*8)
blood[i][2]=math.random(0,136*8)
mapc.badBlood=mapc.badBlood+1
end
end
for i=1,bloodTotal do
for b=1,objData.total do
if o[b][11]==false then
if blood[i][1]+8>o[b][2] and blood[i][1]<o[b][2]+15 and
blood[i][2]+8>o[b][3] and blood[i][2]<o[b][3]+15 then
blood[i][1]=math.random(0,240*8)
blood[i][2]=math.random(0,136*8)
mapc.badBlood=mapc.badBlood+1
end
end
end
end
if mapc.badBlood==0 then
mapc.generating_Blood=false
mapc.generating_Trash=true
end
elseif mapc.generating_Trash==true then
for i=objData.trashDiapasone_low,objData.trashDiapasone_max do
if collide(o[i][2],o[i][3]) or collide(o[i][2]+8,o[i][3]) or
collide(o[i][2],o[i][3]+8) or collide(o[i][2]+8,o[i][3]+8) then
o[i][2]=math.random(0,240*8)
o[i][3]=math.random(0,136*8)
mapc.badTrash=mapc.badTrash+1
end
end
for i=objData.trashDiapasone_low,objData.trashDiapasone_max do
for b=1,objData.total do
if o[b][11]==false then
if o[i][2]+8>o[b][2] and o[i][2]<o[b][2]+15 and
o[i][3]+8>o[b][3] and o[i][3]<o[b][3]+15 then
o[i][2]=math.random(0,240*8)
o[i][3]=math.random(0,136*8)
mapc.badTrash=mapc.badTrash+1
end
end
end
end
if mapc.badTrash==0 then
mapc.generating_Shells=true
mapc.generating_Trash=false
end
elseif mapc.generating_Shells==true then
for i=1,pset_shellSpawner do
if collide(shells[i][2]-7,shells[i][3]-7) or collide(shells[i][2]+7,shells[i][3]-7)
or collide(shells[i][2]-7,shells[i][3]+7) or collide(shells[i][2]+7,shells[i][3]+7) then
shells[i][2]=math.random(0,240*8)
shells[i][3]=math.random(0,136*8)
mapc.badShells=mapc.badShells+1
end
end
for i=1,pset_shellSpawner do
for b=1,objData.total do
if o[b][11]==false then
if shells[i][2]+16>o[b][2] and shells[i][2]<o[b][2]+23 and
shells[i][3]+16>o[b][3] and shells[i][3]<o[b][3]+23 then
shells[i][2]=math.random(0,240*8)
shells[i][3]=math.random(0,136*8)
mapc.badShells=mapc.badShells+1
end
end
end
end
if mapc.badShells==0 then
for i=1,pset_shellSpawner do
math_random=math.random(7,14)
for b=1,100000 do
if o[b]==nil then
for z=b,math_random+b do
o[z]={}
o[z][2]=math.random(shells[i][2]-8,shells[i][2]+8)
o[z][3]=math.random(shells[i][3]-8,shells[i][3]+8)
o[z][4]=11
o[z][5]=1
o[z][6]=0
o[z][7]=math.random(0,3)
o[z][8]=1
o[z][9]=1
o[z][10]=false
o[z][11]=true
o[z][13]=1
o[z][14]=0.02
o[z][15]=objData.total+1
if shells[i][1]==1 then
o[z][1]=math.random(280,281)
o[z][12]="shell 5x74"
else
o[z][1]=math.random(282,283)
o[z][12]="shell shotgun"
end
objData.total=objData.total+1
end
break
end
end
end
shellsBuffer={}
for y=1,objData.total do
if o[y][12]=="shell 5x74" or o[y][12]=="shell shotgun" then
if collide(o[y][2],o[y][3]) or collide(o[y][2]+7,o[y][3])
or collide(o[y][2],o[y][3]+7) or collide(o[y][2]+7,o[y][3]+7) then
for h=1,1000 do
if shellsBuffer[h]==nil then
shellsBuffer[h]=o[y][15]
break
end
end
end
end
end
for i=1,1000 do
if shellsBuffer[1]~=nil then
for y=1,objData.total do
if o[y][15]==shellsBuffer[1] then
table.remove(o,y)
table.remove(shellsBuffer,1)
objData.total=objData.total-1
break
end
end
else
shellsBuffer=nil
break
end
end
for i=1,objData.total do
if o[i][12]=="human meat" or o[i][12]=="human guts" or o[i][12]=="human leg" or o[i][12]=="human arm" or o[i][12]=="human head" or o[i][12]=="human torso" then
bloodTotal=bloodTotal+1
blood[bloodTotal]={}
blood[bloodTotal][1]=o[i][2]
blood[bloodTotal][2]=o[i][3]
blood[bloodTotal][3]=math.random(0,3)
blood[bloodTotal][4]=260
end
end
shells=nil
mapc.generating=false
solids[0]=nil
for i=2,14,12 do
for b=0,1 do
solids[i+b]=nil
end
end
end
end
end
--massive function that checking player and objects collisions
function collisionCheck()
p.sx,p.sy=p.x+p.vx,p.y+p.vy
if collide(p.sx,p.y) or collide(p.sx,p.y+8) or collide(p.sx,p.y+15)
or collide(p.sx+15,p.y) or collide(p.sx+15,p.y+8) or collide(p.sx+15,p.y+15) then
p.vx=0
end
if collide(p.x,p.sy) or collide(p.x+8,p.sy) or collide(p.x+15,p.sy)
or collide(p.x,p.sy+15) or collide(p.x+8,p.sy+15) or collide(p.x+15,p.sy+15) then
p.vy=0
end
for i=1,objData.total do
if p.sx+16>o[i][2] and p.sx<o[i][2]+o[i][8]*8 and p.sy+16>o[i][3] and p.sy<o[i][3]+o[i][9]*8 and o[i][10]==true then
if o[i][3]<p.y-7 or o[i][3]>p.y+15 then
p.vy=0
end
if o[i][2]<p.x-7 or o[i][2]>p.x+15 then
p.vx=0
end
end
end
if p.vx==0 and p.vy==0 then
p.isMove=false
end
end
function sfxPlay(id,note,dur,channel,vol,speed,diap1,diap2)
if diap1~=nil and diap2~=nil then
varSfx1=""..string.char(string.byte(diap1,1))..string.char(string.byte(diap1,2))
varSfx2=""..string.char(string.byte(diap2,1))..string.char(string.byte(diap2,2))
for i=1,12 do
if varSfx1==sfxCode[i] then
sfxCode[13]=i
elseif varSfx2==sfxCode[i] then
sfxCode[14]=i
break
end
end
note=""..sfxCode[math.random(sfxCode[13],sfxCode[14])]..string.char(string.byte(diap1,3))
diap1,diap2=nil,nil
end
sfx(id,note,dur,channel,vol,speed)
end
--overlap function that allow player make fast traces
function traceDo(msg,clr)
trace("--------------------------------------\n"..msg.."\n---------------------------------------",clr)
end
--disable everything after TIC() ends every tic
function func_disable()
if m.bl==false and m.tl==false then
m.tl=true
keyboard.pressed=""
end
if m.br==false and m.tr==false then
m.tr=true
end
m.ind=0
end
--some sort of buttons variants when player choose it
function buttonsCheck()
g=m.ind
if m.ind==1 then
if settings.sounds==true then
sfxPlay(4,"F-5",-1,1,15,1)
end
main.pause=true
main.game=false
elseif m.ind==2 then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,0,15,1)
end
main.menu=false
main.mapChoose=true
elseif m.ind==3 then
main.hasSave=false
pmem(252,0)
main.mapChoose=false
main.game=true
sync(1,0,false)
sync(2,0,false)
sync(4,0,false)
sync(32,0,false)
bloodTotal=pset_blood
if bloodTotal<1 then
traceDo("No blood found",6)
exit()
end
if bloodTotal>2000 then
traceDo("Too much blood (overfill). Limit: 2000",6)
exit()
end
if pset_trash>2000 then
traceDo("Too many trash. Limit: 1000",6)
exit()
end
if pset_trash<1 then
traceDo("No trash found",6)
exit()
end
if pset_shellSpawner<1 then
traceDo("No shells spawners found",6)
exit()
end
if pset_shellSpawner>100 then
traceDo("Too many shells spawners. Limit: 100",6)
exit()
end
bloodRemain=bloodTotal
if mapc.generating==true then
for i=1,bloodTotal do
blood[i]={}
blood[i][1]=math.random(0,240*8)
blood[i][2]=math.random(0,136*8)
blood[i][3]=math.random(0,3)
blood[i][4]=math.random(260,263)
if blood[i][4]==263 then
blood[i][4]=262
else
blood[i][4]=260
end
end
end
solids={}
tx=0
ty=0
if mapc.generating==true then
for i=0,100000 do
getted=mget(tx,ty)
if getted==240 then
if p.x==0 and p.y==0 then
p.x=tx*8
p.y=ty*8
mapc.camX=p.x
mapc.camY=p.y
mset(tx,ty,1)
else
traceDo("You set more than 1 player spawnpoint",6)
exit()
break
end
elseif getted==241 then
for b=1,100000 do
if o[b]==nil then
o[b]={}
o[b][1]=160
o[b][2]=tx*8
o[b][3]=ty*8
o[b][4]=11
o[b][5]=1
o[b][6]=0
o[b][8]=2
o[b][9]=2
o[b][10]=true
o[b][11]=false
o[b][12]="dispenser trash"
o[b][13]=3
o[b][15]=objData.total+1
objData.total=objData.total+1
mset(tx,ty,1)
if mget(tx+1,ty)==244 then
o[b][7]=0
elseif mget(tx+1,ty)==245 then
o[b][7]=1
else
traceDo("Arrow is missing at "..(tx+1).."/"..ty,6)
exit()
break
end
mset(tx+1,ty,1)
break
end
end
elseif getted==242 then
for b=1,100000 do
if o[b]==nil then
for z=0,1 do
o[b+z]={}
o[b+z][1]=128
o[b][2]=tx*8
o[b][3]=ty*8
o[b+z][4]=11
o[b+z][5]=1
o[b+z][6]=0
o[b+z][8]=2
o[b+z][9]=2
o[b+z][10]=true
o[b+z][11]=false
o[b+z][12]="dispenser water"
o[b+z][13]=3
o[b+z][15]=objData.total+1
objData.total=objData.total+1
mset(tx,ty,1)
end
if mget(tx+1,ty)==244 then
o[b][7]=2
o[b+1][7]=0
o[b+1][2]=(tx+2)*8
o[b+1][3]=ty*8
elseif mget(tx+1,ty)==245 then
o[b][7]=3
o[b+1][7]=1
o[b+1][2]=tx*8
o[b+1][3]=(ty+2)*8
else
traceDo("Arrow is missing at "..(tx+1).."/"..ty,6)
exit()
break
end
mset(tx+1,ty,1)
break
end
end
elseif getted==243 then
for b=1,100000 do
if o[b]==nil then
for z=0,1 do
o[b+z]={}
o[b+z][1]=162
o[b][2]=tx*8
o[b][3]=ty*8
o[b+z][4]=11
o[b+z][5]=1
o[b+z][6]=0
o[b+z][8]=2
o[b+z][9]=2
o[b+z][10]=true
o[b+z][11]=false
o[b+z][12]="incinerator"
o[b+z][13]=3
o[b+z][15]=objData.total+1
objData.total=objData.total+1
mset(tx,ty,1)
end
if mget(tx+1,ty)==244 then
o[b][7]=2
o[b+1][7]=0
o[b+1][2]=(tx+2)*8
o[b+1][3]=ty*8
elseif mget(tx+1,ty)==245 then
o[b][7]=3
o[b+1][7]=1
o[b+1][2]=tx*8
o[b+1][3]=(ty+2)*8
else
traceDo("Arrow is missing at "..(tx+1).."/"..ty,6)
exit()
end
mset(tx+1,ty,1)
break
end
end
elseif getted==244 or getted==245 then
for i=240,244 do
if mget(tx-1,ty)==i then
break
else
traceDo("Found non-linked arrows at "..tx.."/"..ty,6)
exit()
end
end
end
tx=tx+1
if tx>=136 then
tx=0
ty=ty+1
end
if ty>=136 then
if p.x==0 then
traceDo("Unable to find player!",6)
exit()
break
end
end
end
end
if mapc.generating==true then
for i=1,pset_shellSpawner do
shells[i]={}
shells[i][1]=math.random(1,2)
shells[i][2]=math.random(0,240*8)
shells[i][3]=math.random(0,136*8)
end
for i=1,100000 do
if o[i]==nil then
objData.trashDiapasone_low=i
objData.trashDiapasone_max=i+pset_trash
break
end
end
for i=objData.trashDiapasone_low,objData.trashDiapasone_max do
o[i]={}
math_random=math.random(276,280)
if math_random==280 then
math_random=math.random(264,270)
end
o[i][1]=math_random
o[i][2]=math.random(0,240*8)
o[i][3]=math.random(0,136*8)
o[i][4]=11
o[i][5]=1
o[i][6]=0
o[i][7]=math.random(0,3)
o[i][8]=1
o[i][9]=1
o[i][10]=false
o[i][11]=true
o[i][13]=1
o[i][15]=objData.total+1
objData.total=objData.total+1
if math_random>=276 and math_random<=277 then
o[i][12]="trash can"
o[i][14]=0.08
elseif math_random>=278 and math_random<=279 then
o[i][12]="trash chips"
o[i][14]=0.09
elseif math_random==264 then
o[i][12]="human meat"
o[i][14]=0.31
elseif math_random>=265 and math_random<=266 then
o[i][12]="human guts"
o[i][14]=0.10
elseif math_random==267 then
o[i][12]="human leg"
o[i][14]=0.4
elseif math_random==268 then
o[i][12]="human arm"
o[i][14]=0.3
elseif math_random==269 then
o[i][12]="human head"
o[i][14]=0.5
elseif math_random==270 then
o[i][12]="human torso"
o[i][14]=1.1
end
end
end
for i=1,100000 do
if spawner_objects[i]~=nil then
objData.physical=objData.physical+1
else
break
end
end
for b=1,objData.physical do
for i=1,100000 do
if o[i]==nil then
o[i]={}
o[i][1]=mget(spawner_objects[b][2],spawner_objects[b][3])
o[i][2]=spawner_objects[b][2]*8
o[i][3]=spawner_objects[b][3]*8
o[i][4]=spawner_objects[b][4]
o[i][5]=1
o[i][6]=0
o[i][7]=spawner_objects[b][5]
o[i][8]=1
o[i][9]=1
o[i][10]=spawner_objects[b][6]
o[i][11]=spawner_objects[b][7]
o[i][12]=spawner_objects[b][8]
o[i][13]=2
o[i][15]=objData.total+1
if o[i][12]=="bin" then
o[i][16]={}
o[i][16][1]=0
o[i][16][2]={}
elseif o[i][12]=="bucket" then
o[i][16]={}
o[i][16][1]=0
o[i][16][2]=0
end
mset(spawner_objects[b][2],spawner_objects[b][3],spawner_objects[b][1])
objData.total=objData.total+1
break
end
end
end
solids[0]=true
for i=64,109 do
solids[i]=true
end
for i=2,14,12 do
for b=0,1 do
solids[i+b]=true
end
end
elseif m.ind==4 then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,0,15,1)
end
main.menu=false
main.settings=true
settings.page=1
elseif m.ind==5 then
exit()
elseif m.ind==6 then
if settings.sounds==true then
sfxPlay(8,"F-3",-1,0,15,1)
end
main.menu=true
main.mapChoose=false
elseif m.ind==7 then
if settings.sounds==true then
sfxPlay(5,"F-5",-1,1,15,1)
end
main.tablet=false
tablet.brief=true
tablet.note=false
tablet.base=false
main.game=true
main.inventory=false
tablet.baseChoose=0
tablet.dem=1
elseif m.ind==8 then
if settings.sounds==true then
sfxPlay(8,"F-3",-1,0,15,1)
end
main.settings=false
main.menu=true
elseif m.ind==9 then
if settings.page==1 then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,0,15,1)
end
keyboard.isCalled=true
keyboard.text=nickname
keyboard.maximal_string=12
keyboard.id=1
end
elseif m.ind==10 then
if settings.page==1 then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,0,15,1)
end
if settings.customNick==false then
settings.customNick=true
pmem(255,1)
else
settings.customNick=false
pmem(255,0)
end
end
elseif m.ind==11 then
if settings.page==1 then
for i=0,255 do
pmem(i,0)
end
tx=0
ty=0
for i=1,100000 do
mset(tx,ty,0)
tx=tx+1
if tx==240 then
tx=0
ty=ty+1
end
if ty==136 then
sync(4,7,true)
break
end
end
traceDo("Clearing all progress: succeed",11)
exit()
end
elseif m.ind==12 then
if tablet.page>1 then
tablet.page=tablet.page-1
if settings.sounds==true then
sfxPlay(8,"F-4",-1,1,15,1)
end
end
elseif m.ind==13 then
if tablet.page<tablet.totalPages then
tablet.page=tablet.page+1
if settings.sounds==true then
sfxPlay(8,"F-4",-1,1,15,1)
end
end
elseif m.ind==14 then
if tablet.note==false then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,1,15,1)
end
tablet.note=true
tablet.brief=false
tablet.totalPages=25
tablet.page=1
end
elseif m.ind==15 then
if tablet.brief==false then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,1,15,1)
end
tablet.brief=true
tablet.note=false
tablet.totalPages=briefing.pages
tablet.page=1
end
elseif m.ind==16 then
if tablet.note==true then
for i=40,103,8 do
if m.y>i and m.y<i+7 then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,0,15,1)
end
notes_num=i//8-4+(tablet.page-1)*8
keyboard.isCalled=true
keyboard.text=notes_buffer[i//8-4+(tablet.page-1)*8]
keyboard.maximal_string=20
keyboard.id=2
sync(1,6,false)
sync(32,6,false)
end
end
end
elseif m.ind==17 then
if settings.page==2 then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,0,15,1)
end
if main.isPc==false then
main.isPc=true
pmem(254,1)
else
main.isPc=false
pmem(254,0)
end
end
elseif m.ind==18 then
if settings.sounds==true then
sfxPlay(5,"F-5",-1,1,15,1)
end
main.inventory=false
main.game=true
p.objectID=0
elseif m.ind==19 then
for i=80,160,12 do
for b=30,110,12 do
if m.x>i and m.x<i+7 and m.y>b and m.y<b+7 and o[p.objectID][16][2][(i//12-6)+((b//12-2)*7)+1]~=nil then
var=p.objectID
varTrash=0
varBlood=0
if settings.sounds==true then
sfxPlay(3,"D-1",-1,1,15,1)
sfxPlay(5,"F-5",-1,2,15,1)
end
for y=1,objData.total do
if o[y][15]==o[var][16][2][(i//12-6)+((b//12-2)*7)+1] then
o[var][16][1]=o[var][16][1]-o[y][14]
for h=1,100 do
if o[var][16][2][h]~=nil then
for k=1,objData.total do
if o[var][16][2][h]==o[k][15] then
for j=276,283 do
if o[k][1]==j then
varTrash=varTrash+o[k][14]
break
end
end
break
end
end
else
break
end
end
for j=276,283 do
if o[y][1]==j then
varTrash=varTrash-o[y][14]
end
end
if o[var][16][1]>8 or o[var][16][1]<0 then
o[var][16][1]=0
end
if o[var][16][1]<=1.0 then
o[var][1]=math.floor(o[var][16][1]*3+146)
else
o[var][1]=149
end
p.objectID=y
table.remove(o[var][16][2],(i//12-6)+((b//12-2)*7)+1)
p.isHold=true
main.inventory=false
main.game=true
break
end
end
break
end
end
end
elseif m.ind==20 then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,1,15,1)
end
if tablet.base==false then
tablet.brief=false
tablet.note=false
tablet.base=true
tablet.page=1
tablet.totalPages=11
if tablet.baseChoose==0 then
tablet.dem=2
else
tablet.dem=3
end
else
tablet.base=false
tablet.brief=true
tablet.page=1
tablet.totalPages=4
tablet.dem=1
end
elseif m.ind==21 then
if tablet.base==true then
for i=40,80,20 do
if m.y>i and m.y<i+16 then
if tabletBase[i//20-4+tablet.page*3]~=nil then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,1,15,1)
end
tablet.baseChoose=i//20-4+tablet.page*3
tablet.dem=3
tablet.page=0
tablet.totalPages=0
break
end
end
end
end
elseif m.ind==22 then
if settings.sounds==true then
sfxPlay(8,"F-4",-1,1,15,1)
end
tablet.baseChoose=0
tablet.dem=2
tablet.totalPages=11
tablet.page=1
elseif m.ind==23 then
if settings.page<settings.maxpages then
settings.page=settings.page+1
if settings.sounds==true then
sfxPlay(8,"F-4",-1,0,15,1)
end
end
elseif m.ind==24 then
if settings.page>1 then
settings.page=settings.page-1
if settings.sounds==true then
sfxPlay(8,"F-3",-1,0,15,1)
end
end
elseif m.ind==25 then
if settings.sounds==false then
sfxPlay(8,"F-4",-1,0,15,1)
settings.sounds=true
pmem(253,0)
else
settings.sounds=false
pmem(253,1)
end
elseif m.ind==26 then
if settings.sounds==true then
sfxPlay(5,"F-5",-1,1,15,1)
end
main.pause=false
main.game=true
elseif m.ind==27 then
reset()
end
end
--this just single used text. Totaly useless!
function otherStuff()
instr="Instrument: "
end
function message(msg1,clr1)
messageReport.msg=msg1
messageReport.clr=clr1
messageReport.timer=time()+5000
end
--loading algorythm of map preview in main screen
function map_preview()
if mapc.mapTimer==0 then
mapc.mapViewX=0
mapc.mapViewY=0
elseif mapc.mapTimer>0 and mapc.mapTimer<240 then
mapc.mapViewX=mapc.mapViewX+0.45
mapc.mapViewY=mapc.mapViewY+0.55
elseif mapc.mapTimer==240 then
mapc.mapViewX=240
mapc.mapViewY=136
elseif mapc.mapTimer>240 and mapc.mapTimer<560 then
mapc.mapViewX=mapc.mapViewX-0.75
mapc.mapViewY=mapc.mapViewY-0.25
elseif mapc.mapTimer==560 then
mapc.mapTimer=-1
end
mapc.mapTimer=mapc.mapTimer+1
end
function keyboard_action()
if keypKeys[1]=="Q" and keyboard.isShift==false then
for i=1,26 do
keypKeys[i]=string.lower(keypKeys[i])
end
end
if keyboard.text~=nil then
keyboard.textLenght=string.len(keyboard.text)
else
keyboard.textLenght=0
keyboard.text=""
end
if m.bl==true and m.tl==true then
m.tl=false
if keyboard.textLenght<keyboard.maximal_string then
for i=10,220,22 do
if m.x>i and m.x<i+16 and m.y>56 and m.y<72 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
if keyboard.isNumeric==false then
keyboard.text=keyboard.text..keypKeys[i//22+1]
keyboard.pressed=keypKeys[i//22+1]
break
else
if (i//22+1)==10 then
var=0
else
var=i//22+1
end
keyboard.text=keyboard.text..var
keyboard.pressed=keypKeys[i//22+1]
break
end
end
end
for i=21,212,22 do
if m.x>i and m.x<i+16 and m.y>78 and m.y<94 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
keyboard.text=keyboard.text..keypKeys[i//22+11]
keyboard.pressed=keypKeys[i//22+11]
break
end
end
for i=32,170,22 do
if m.x>i and m.x<i+16 and m.y>100 and m.y<116 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
keyboard.text=keyboard.text..keypKeys[i//22+19]
keyboard.pressed=keypKeys[i//22+19]
break
end
end
if m.x>76 and m.x<188 and m.y>120 and m.y<136 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
keyboard.text=keyboard.text.." "
keyboard.pressed="space"
end
end
if m.x>186 and m.x<202 and m.y>100 and m.y<116 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
keyboard.pressed="BS"
for i=1,keyboard.textLenght do
keyboard_buffer[i]=string.byte(keyboard.text,i)
end
keyboard.text=""
for i=1,keyboard.textLenght-1 do
keyboard.text=keyboard.text..string.char(keyboard_buffer[i])
end
for i=1,keyboard.textLenght do
keyboard_buffer[i]=nil
end
end
if m.x>10 and m.x<26 and m.y>100 and m.y<116 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
if keyboard.isShift==false then
keyboard.isShift=true
if keypKeys[1]=="q" then
for i=1,26 do
keypKeys[i]=string.upper(keypKeys[i])
end
end
else
keyboard.isShift=false
if keypKeys[1]=="Q" then
for i=1,26 do
keypKeys[i]=string.lower(keypKeys[i])
end
end
end
elseif m.x>21 and m.x<37 and m.y>120 and m.y<136 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
if keyboard.isNumeric==false then
keyboard.isNumeric=true
else
keyboard.isNumeric=false
end
end
if m.x>216 and m.x<232 and m.y>84 and m.y<116 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
if keyboard.id==1 then
nickname_buffering("in")
keyboard.isCalled=false
else
notes_num=notes_num+1
keyboard.text=notes_buffer[notes_num]
end
elseif m.x>208 and m.x<216 and m.y>100 and m.y<116 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
if keyboard.id==1 then
nickname_buffering("in")
keyboard.isCalled=false
else
notes_num=notes_num+1
keyboard.text=notes_buffer[notes_num]
end
elseif m.x>199 and m.x<215 and m.y>122 and m.y<136 then
if settings.sounds==true then
sfxPlay(13,"E-4",-1,0,15,0)
end
keyboard.isCalled=false
if keyboard.id==2 then
sync(1,0,false)
sync(32,0,false)
end
end
end
keyboard.cursor=print(keyboard.text,241,0)*2+10
if keyboard.id==1 then
nickname=keyboard.text
elseif keyboard.id==2 then
notes_buffer[notes_num]=keyboard.text
end
end
function pmeming()
if pmem(255)~=0 then
settings.customNick=true
end
if pmem(254)~=0 then
main.isPc=true
end
if pmem(253)~=1 then
settings.sounds=true
else
settings.sounds=false
end
if pmem(252)~=0 then
main.hasSave=true
else
main.hasSave=false
end
end
function nickname_buffering(in_out)
var=0
if pmem(200)~=0 and in_out=="out" then
for i=1,12 do
if pmem(i+199)~=0 then
var=var+1
else
break
end
end
for i=1,var do
keyboard_buffer[i]=pmem(i+199)
end
nickname=""
for i=1,var do
nickname=nickname..string.char(keyboard_buffer[i])
end
for i=1,var do
keyboard_buffer[i]=nil
end
var=nil
elseif in_out=="in" then
var=12
for i=1,var do
keyboard_buffer[i]=string.byte(nickname,i)
end
for i=1,var do
pmem(i+199,keyboard_buffer[i])
keyboard_buffer[i]=nil
end
var=nil
end
end
function func_footprint()
for i=1,bloodTotal do
if blood[i]~=nil then
if p.x>blood[i][1]-8 and p.x<blood[i][1] and p.y>blood[i][2]-8 and p.y<blood[i][2] and blood[i][4]~=261 and blood[i][4]~=263 then
if p.footprints_qt==0 then
p.footprints_qt=math.random(4,12)
if blood[i][4]==262 then
p.footprints_spr=263
else
p.footprints_spr=261
end
end
end
end
end
if p.footprints_qt~=0 then
p.footprints_timer=p.footprints_timer+1
if p.footprints_timer>=15 then
bloodTotal=bloodTotal+1
blood[bloodTotal]={}
blood[bloodTotal][1]=p.x+math.random(2,6)
blood[bloodTotal][2]=p.y+math.random(2,6)
blood[bloodTotal][3]=p.angle
blood[bloodTotal][4]=p.footprints_spr
p.footprints_timer=0
p.footprints_qt=p.footprints_qt-1
end
end
end
function func_poke4(addr,state,value)
poke4(addr*2+state,value)
end
--everything in this function calls once before TIC()
function init()
sync(1,6,false)
sync(2,6,false)
sync(4,6,false)
sync(32,6,false)
briefing.name=random_names[math.random(1,10)]
for i=1,100 do
if btns[i]==nil then
break
else
m.totalButtons=m.totalButtons+1
end
end
for i=1,100 do
textlenght[i]=0
end
otherStuff()
pmeming()
if pmem(200)~=0 then
nickname_buffering("out")
end
end
init()
|
local addonName = "TuLeVeuxVraiment"
local addonStr = "|cff00bbaa"..addonName.."|cffffffff"
local tlvv = CreateFrame("FRAME", addonName);
tlvv:RegisterEvent("ADDON_LOADED");
tlvv:RegisterEvent("CHAT_MSG_LOOT");
tlvv:SetScript("OnEvent", function(self, event, arg1) self[event](self, arg1) end);
function SlashHandler(arg)
if(arg == "export") then
exportLoots()
elseif(arg == "clean") then
DataChar = {}
print(addonStr.." data cleaned")
else
print(addonStr.." commands :")
print("/tlvv export|cffaaaaaa to export current data|cffffffff")
print("/tlvv clean|cffaaaaaa to delete current data|cffffffff")
end
end
function tlvv:ADDON_LOADED(addon)
if(addon == addonName) then
SlashCmdList["TLVV"] = SlashHandler;
SLASH_TLVV1 = "/tlvv";
if not DataChar then
DataChar = {}
end
if not DataGlobal then
DataGlobal = {}
end
end
end
function tlvv:CHAT_MSG_LOOT(msg, ...)
instanceName, instanceType, _, _, _, _, _, instanceID = GetInstanceInfo()
if instanceType == "raid" then
-- self loot
-- ...single item - "You receive loot: %s." -> item
local PATTERN_LOOT_ITEM_SELF = LOOT_ITEM_SELF:gsub("%%s", "(.+)")
-- ...multiple item - "You receive loot: %sx%d." -> item + quantity
local PATTERN_LOOT_ITEM_SELF_MULTIPLE = LOOT_ITEM_SELF_MULTIPLE:gsub("%%s", "(.+)"):gsub("%%d", "(%%d+)")
-- other loot
-- ...single item - "%s receives loot: %s." -> player + item
local PATTERN_LOOT_ITEM = LOOT_ITEM:gsub("%%s", "(.+)")
-- ...multiple item - "%s receives loot: %sx%d." -> player + item + quantity
local PATTERN_LOOT_ITEM_MULTIPLE = LOOT_ITEM_MULTIPLE:gsub("%%s", "(.+)"):gsub("%%d", "(%%d+)")
-- self
local loottype, itemLink, quantity, source, pname
if msg:match(PATTERN_LOOT_ITEM_SELF_MULTIPLE) then
loottype = "self multi"
itemLink, quantity = strmatch(msg, PATTERN_LOOT_ITEM_SELF_MULTIPLE)
pname = GetUnitName("player", false)
elseif msg:match(PATTERN_LOOT_ITEM_SELF) then
loottype = "self single"
itemLink = strmatch(msg, PATTERN_LOOT_ITEM_SELF)
pname = GetUnitName("player", false)
quantity = 1
elseif msg:match(PATTERN_LOOT_ITEM_MULTIPLE) then
loottype = "other multi"
pname, itemLink, quantity = strmatch(msg, PATTERN_LOOT_ITEM_MULTIPLE)
elseif msg:match(PATTERN_LOOT_ITEM) then
loottype = "other single"
pname, itemLink = strmatch(msg, PATTERN_LOOT_ITEM)
quantity = 1
end
if loottype and itemLink and quantity then
local itemID = ToItemID(itemLink)
local itemName, _, itemRarity = GetItemInfo(itemID)
if itemRarity > 1 then
local t = time()--date("%m/%d/%y %H:%M:%S")
saveLoot(t, instanceID, pname, itemID, quantity)
end
end
end
end
function saveLoot(time, instanceID, player, itemID, quantity)
DataChar[#DataChar+1] =
{
["Timestamp"] = time,
["InstanceID"] = instanceID,
["Player"] = player,
["ItemID"] = itemID,
["Quantity"] = quantity,
}
end
function exportLoots()
local json = "{"
json = jsonLn(json, 1).."\"Timestamp\": "..time()..","
json = jsonLn(json, 1).."\"Loots\":"
json = jsonLn(json, 1).."["
for _,v in pairs(DataChar) do
json = jsonLn(json, 2).."{"
json = jsonLn(json, 3).."\"Timestamp\": "..v["Timestamp"]..","
json = jsonLn(json, 3).."\"InstanceID\": "..v["InstanceID"]..","
json = jsonLn(json, 3).."\"Player\": \""..v["Player"].."\","
json = jsonLn(json, 3).."\"ItemID\": "..v["ItemID"]..","
json = jsonLn(json, 3).."\"Quantity\": "..v["Quantity"]..","
json = jsonLn(json, 2).."},"
end
json = jsonLn(json, 1).."]"
json = jsonLn(json, 0).."}"
KethoEditBox_Show(json)
end
function jsonLn(str, tabs)
str = str.."\n"
for i=1,tabs do
str = str.." "
end
return str
end
function ToItemID(itemString)
if not itemString then
return
end
local _, _, Color, Ltype, Id, Enchant, Gem1, Gem2, Gem3, Gem4, Suffix, Unique, LinkLvl, reforging, Name = string.find(itemString, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
return tonumber(Id)
end
function KethoEditBox_Show(text)
if not KethoEditBox then
local f = CreateFrame("Frame", "KethoEditBox", UIParent, "DialogBoxFrame")
f:SetPoint("CENTER")
f:SetSize(600, 500)
f:SetBackdrop({
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile = "Interface\\PVPFrame\\UI-Character-PVP-Highlight", -- this one is neat
edgeSize = 16,
insets = { left = 8, right = 6, top = 8, bottom = 8 },
})
f:SetBackdropBorderColor(0, .44, .87, 0.5) -- darkblue
-- Movable
f:SetMovable(true)
f:SetClampedToScreen(true)
f:SetScript("OnMouseDown", function(self, button)
if button == "LeftButton" then
self:StartMoving()
end
end)
f:SetScript("OnMouseUp", f.StopMovingOrSizing)
-- ScrollFrame
local sf = CreateFrame("ScrollFrame", "KethoEditBoxScrollFrame", KethoEditBox, "UIPanelScrollFrameTemplate")
sf:SetPoint("LEFT", 16, 0)
sf:SetPoint("RIGHT", -32, 0)
sf:SetPoint("TOP", 0, -16)
sf:SetPoint("BOTTOM", KethoEditBoxButton, "TOP", 0, 0)
-- EditBox
local eb = CreateFrame("EditBox", "KethoEditBoxEditBox", KethoEditBoxScrollFrame)
eb:SetSize(sf:GetSize())
eb:SetMultiLine(true)
eb:SetAutoFocus(false) -- dont automatically focus
eb:SetFontObject("ChatFontNormal")
eb:SetScript("OnEscapePressed", function() f:Hide() end)
sf:SetScrollChild(eb)
-- Resizable
f:SetResizable(true)
f:SetMinResize(150, 100)
local rb = CreateFrame("Button", "KethoEditBoxResizeButton", KethoEditBox)
rb:SetPoint("BOTTOMRIGHT", -6, 7)
rb:SetSize(16, 16)
rb:SetNormalTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Up")
rb:SetHighlightTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Highlight")
rb:SetPushedTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Down")
rb:SetScript("OnMouseDown", function(self, button)
if button == "LeftButton" then
f:StartSizing("BOTTOMRIGHT")
self:GetHighlightTexture():Hide() -- more noticeable
end
end)
rb:SetScript("OnMouseUp", function(self, button)
f:StopMovingOrSizing()
self:GetHighlightTexture():Show()
eb:SetWidth(sf:GetWidth())
end)
f:Show()
end
if text then
KethoEditBoxEditBox:SetText(text)
KethoEditBoxEditBox:HighlightText()
end
KethoEditBox:Show()
end
|
-----------------------------------
-- Area: Caedarva Mire (79)
-- ZNM: Verdelet
-- !pos 417 -19.3 -70 79
-----------------------------------
mixins = {require("scripts/mixins/families/imp")}
-----------------------------------
function onMobDeath(mob, player, isKiller)
end
|
-----------------------------------
-- Area: Valkurm Dunes
-- NPC: qm3 (???)
-- Involved In Quest: Yomi Okuri
-- !pos -767 -4 192 103
-----------------------------------
local ID = require("scripts/zones/Valkurm_Dunes/IDs")
require("scripts/globals/keyitems")
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
local cstime = VanadielHour()
if (player:hasKeyItem(tpz.ki.YOMOTSU_HIRASAKA) and (cstime > 18 or cstime < 5) and not GetMobByID(ID.mob.DOMAN):isSpawned() and not GetMobByID(ID.mob.ONRYO):isSpawned()) then
if (player:getCharVar("OkuriNMKilled") >= 1 and player:needToZone()) then
player:delKeyItem(tpz.ki.YOMOTSU_HIRASAKA)
player:addKeyItem(tpz.ki.FADED_YOMOTSU_HIRASAKA)
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.FADED_YOMOTSU_HIRASAKA)
player:setCharVar("OkuriNMKilled", 0)
else
player:startEvent(10)
end
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
if (csid == 10 and option == 1) then
player:needToZone(true) -- If you zone, you will need to repeat the fight.
player:setCharVar("OkuriNMKilled", 0)
SpawnMob(ID.mob.DOMAN):updateClaim(player)
SpawnMob(ID.mob.ONRYO):updateClaim(player)
end
end
|
#! /usr/bin/env texlua
local lfs = require("lfs")
local os = require("os")
local io = require("io")
local IS_UNIX = os["type"] == "unix"
local print = print
local exit = os.exit
local __FILE__ = arg[0]
local mdb_Tool, mdb_root, mdb_Style
mdb_Tool = __FILE__:match(IS_UNIX and "(.*)/" or "(.*)[/\\]")
if mdb_Tool == nil then
mdb_Tool = lfs.currentdir()
else
if IS_UNIX then
if not mdb_Tool:match("^/") then
mdb_Tool = lfs.currentdir() .."/".. mdb_Tool
end
else
if not mdb_Tool:match("^%u:") then
mdb_Tool = lfs.currentdir() .."\\".. mdb_Tool
end
end
end
mdb_root = mdb_Tool:match(IS_UNIX and "(.*)/" or "(.*)[/\\]")
mdb_Style = mdb_root .."/Style"
local function is_directory(path)
local mode,err_msg,err_code = lfs.attributes (path, "mode")
return mode == "directory",err_msg,err_code
end
-- Test if we can make soft links
local destination = os.tmpname()
local err_msg, err_code
_, err_msg, err_code = lfs.attributes (destination, "mode")
if err_msg ~= nil then
print("Soft link test: destination error", err_msg)
exit(err_code)
end
local link_name = os.tmpname()
_, err_msg, err_code = os.remove(link_name)
if err_msg ~= nil then
print("Cannot remove a temporary file", err_msg)
exit(err_code)
end
_, err_msg, err_code = lfs.link(destination,link_name,true)
if err_msg ~= nil then
print("Soft link test: link error", err_msg)
if not IS_UNIX then
print("Sur Windows, vous devez d'abord activer le mode développeur")
end
exit(err_code)
end
_, err_msg, err_code = lfs.attributes (link_name, "mode")
if err_msg ~= nil then
print("Soft link test: link error", err_msg)
if not IS_UNIX then
print("Sur Windows, vous devez d'abord activer le mode développeur")
end
exit(err_code)
end
-- Where is the local texmf
local HOME
if IS_UNIX then
HOME = os.getenv("HOME")
else
HOME = os.getenv("HOMEDRIVE")..os.getenv("HOMEPATH")
end
local function capture(cmd)
local f = assert(io.popen(cmd,'r'))
local s = assert(f:read('a'))
f:close()
return s
end
local TEXMFHOME = capture("kpsewhich --var-value=TEXMFHOME"):gsub('[\n\r]+', '')
local TEXMFHOME_ok = is_directory(TEXMFHOME)
if not TEXMFHOME_ok then
local dir = TEXMFHOME:match(".*/")
if dir then
TEXMFHOME_ok = is_directory(dir) and lfs.mkdir(TEXMFHOME)
else
print("Votre dossier texmf personnel ne semble pas configuré")
if not IS_UNIX then
print("Sur MikTeX, voir le dernier paragraphe de https://miktex.org/kb/texmf-roots")
end
print("Quel est le chemin vers votre dossier texmf personnel?")
local MAX = 3
while true do
TEXMFHOME = io.read()
if TEXMFHOME:len() == 0 then
print("Annulation")
exit(1)
end
TEXMFHOME_ok = is_directory(TEXMFHOME)
if TEXMFHOME_ok then
break
else
print("Pas de dossier "..TEXMFHOME)
if MAX > 0 then
MAX = MAX - 1
else
print("Annulation")
exit(1)
end
end
end
end
end
TEXMFHOME_tex = TEXMFHOME.."/tex"
TEXMFHOME_tex_latex = TEXMFHOME_tex.."/latex"
if TEXMFHOME_ok then
if (is_directory(TEXMFHOME_tex)
or lfs.mkdir(TEXMFHOME_tex))
and (is_directory(TEXMFHOME_tex_latex)
or lfs.mkdir(TEXMFHOME_tex_latex)) then
-- print("Votre dossier texmf personnel est\n"..TEXMFHOME)
else
print("Votre dossier texmf personnel semble être\n"..TEXMFHOME)
print("Mais il manque le dossier\n"..TEXMFHOME_tex_latex)
end
end
-- Configure MathDataBase
os.remove(TEXMFHOME_tex_latex.."/MDB.cfg")
local fh = assert(io.open(TEXMFHOME_tex_latex.."/MDB.cfg","w"))
local s = [[
%% MathDataBase configuration file: DO NOT EDIT
{
path={%s},
}
]]
fh:write(s:format(mdb_Style))
fh:close()
fh = assert(io.open(TEXMFHOME_tex_latex.."/MDB.cfg","r"))
s = fh:read("a")
fh:close()
assert(s:match("MathDataBase"))
fh = assert(io.open(mdb_Style.."/MathDataBase.sty","r"))
s = fh:read("a")
fh:close()
if not s:match("MathDataBase") then
print("Échec: MathDataBase est corrompu")
exit(1)
end
os.remove(TEXMFHOME_tex_latex.."/MDB")
_, err_msg, err_code = lfs.link(mdb_Style, TEXMFHOME_tex_latex.."/MDB", true)
if err_msg ~= nil then
print("Échec", err_msg)
exit(err_code)
end
fh = assert(io.open(TEXMFHOME_tex_latex.."/MDB/MathDataBase.sty","r"))
s = fh:read("a")
fh:close()
if s:len() == 0 then
print("Échec")
exit(1)
end
s = capture("kpsewhich MathDataBase.sty")
if s:match("MathDataBase.sty") then
print([[
Configuration réussie: vous pouvez utiliser
\RequirePackage{MathDataBase}
dans vos documents LaTeX.]])
else
print("Échec de la configuration automatique")
end
|
hdr_fields =
{
-- AuthenticatedMessage
sequence = ProtoField.uint64("scp.sequence", "Sequence", base.DEC),
-- StellarMessage
tx_set_hash = ProtoField.bytes("scp.tx_set_hash", "Tx Set Hash", base.NONE),
prev_hash = ProtoField.bytes("scp.prev_hash", "Previous Ledger Hash", base.NONE),
hmac = ProtoField.bytes("scp.hmac", "HMAC SHA256", base.NONE),
msg = ProtoField.bytes("scp.msg", "Message", base.NONE),
}
env_hdr_fields = {
signature = ProtoField.bytes("scp.envelope.signature", "Signature", base.NONE),
}
stmt_hdr_fields = {
node_id = ProtoField.bytes("scp.statement.node_id", "NodeId", base.NONE),
node_id_s = ProtoField.string("scp.statement.node_id_s", "PK", base.ASCII),
slot_idx = ProtoField.uint64("scp.statement.slot_idx", "Slot Index", base.DEC),
}
nom_hdr_fields = {
qs_hash = ProtoField.bytes("scp.nomination.qs_hash", "Quorum Set Hash", base.NONE),
votes = ProtoField.bytes("scp.nomination.votes", "Votes", base.NONE),
accepted = ProtoField.bytes("scp.nomination.accepted", "Accepted", base.NONE),
}
prep_hdr_fields = {
qs_hash = ProtoField.bytes("scp.prepare.qs_hash", "Quorum Set Hash", base.NONE),
nC = ProtoField.uint32("scp.prepare.nc", "nC", base.DEC),
nH = ProtoField.uint32("scp.prepare.nh", "nH", base.DEC),
}
cfrm_hdr_fields = {
nPrepared = ProtoField.uint32("scp.confirm.nprepared", "nPrepared", base.DEC),
nCommit = ProtoField.uint32("scp.confirm.ncommit", "nCommit", base.DEC),
nH = ProtoField.uint32("scp.confirm.nh", "nH", base.DEC),
qs_hash = ProtoField.bytes("scp.confirm.qs_hash", "Quorum Set Hash", base.NONE),
}
blt_hdr_fields = {
counter = ProtoField.uint32("scp.ballot.counter", "Counter", base.DEC),
value = ProtoField.bytes("scp.ballot.value", "Value", base.NONE),
}
ext_hdr_fields = {
nH = ProtoField.uint32("scp.externalize.nh", "nH", base.DEC),
qs_hash = ProtoField.bytes("scp.externalize.qs_hash", "Quorum Set Hash", base.NONE),
}
tx_hdr_fields = {
source = ProtoField.bytes("scp.tx.source", "Source", base.NONE),
source_s = ProtoField.string("scp.tx.source_s", "PK", base.ASCII),
fee = ProtoField.uint32("scp.tx.fee", "Fee", base.DEC),
sequence = ProtoField.uint64("scp.tx.sequence", "Sequence", base.DEC),
tb_min = ProtoField.uint64("scp.tx.tb.min", "Timebounds - Min", base.DEC),
tb_max = ProtoField.uint64("scp.tx.tb.max", "Timebounds - Max", base.DEC),
memo_str = ProtoField.string("scp.tx.memo.string", "Memo", base.ASCII),
memo_data = ProtoField.bytes("scp.tx.memo.data", "Memo", base.NONE),
op_count = ProtoField.int32("scp.tx.op_count", "Op Count", base.DEC),
signature = ProtoField.bytes("scp.tx.signature", "Signature", base.NONE),
}
op_hdr_fields = {
source = ProtoField.bytes("scp.op.source", "Source", base.NONE),
source_s = ProtoField.string("scp.op.source_s", "PK", base.ASCII),
-- payment
destination = ProtoField.bytes("scp.op.destination", "Destination", base.NONE),
destination_s = ProtoField.string("scp.op.destination_s", "PK", base.ASCII),
asset = ProtoField.string("scp.op.asset", "Asset", base.ASCII),
amount = ProtoField.int64("scp.op.amount", "Amount", base.DEC),
}
|
return function()
local BaseClass = require(script.Parent.Parent.src.BaseClass)
local TestClass = BaseClass:new("TestClass")
local TestClass2 = TestClass:extend("TestClass2")
describe("Class", function()
it("Should be ok", function()
expect(TestClass).to.be.ok()
end)
it("Init function should be ok", function()
TestClass.TestClass = function(self)
return self
end
expect(function()
TestClass()
end).never.to.throw()
end)
it("Variables should be ok", function()
TestClass.testVar1 = true
expect(TestClass.testVar1).to.equal(true)
end)
it("Functions should be ok", function()
TestClass.testFunction1 = function(self)
return true
end
expect(TestClass.testFunction1()).to.equal(true)
end)
describe("Function", function()
it("Registered should work", function()
expect(TestClass:registered()).to.equal(true)
expect(BaseClass:registered(TestClass)).to.equal(true)
end)
it("Unregister should work", function()
expect(function()
BaseClass:new("testA"):unregister()
end).never.to.throw()
end)
it("IsA should work", function()
expect(TestClass2:isA("TestClass")).to.equal(true)
end)
it("Equals should work", function()
expect(TestClass2 == TestClass).to.equal(true)
end)
describe("Metamethod", function()
TestClass2.__concat = function() return true end
TestClass2.__unm = function() return true end
TestClass2.__add = function() return true end
TestClass2.__sub = function() return true end
TestClass2.__mul = function() return true end
TestClass2.__div = function() return true end
TestClass2.__mod = function() return true end
TestClass2.__pow = function() return true end
it("Concat", function()
expect(TestClass2 .. '1').to.equal(true)
end)
it("Unary", function()
expect(-TestClass2).to.equal(true)
end)
it("Add", function()
expect(TestClass2 + 1).to.equal(true)
end)
it("Subtract", function()
expect(TestClass2 - 1).to.equal(true)
end)
it("Multiply", function()
expect(TestClass2 * 1).to.equal(true)
end)
it("Divide", function()
expect(TestClass2 / 1).to.equal(true)
end)
it("Modulus", function()
expect(TestClass2 % 1).to.equal(true)
end)
it("Exponet", function()
expect(TestClass2^1).to.equal(true)
end)
end)
end)
describe("Extend", function()
it("Should be ok", function()
expect(TestClass2).to.be.ok()
end)
it("Should work in init function", function()
TestClass.TestClass = function(self)
self.testInitVar1 = true
return self
end
expect(TestClass().testInitVar1).to.equal(true)
end)
it("Should carry over variables", function()
TestClass.testExtendVar1 = true
expect(TestClass:extend("ExtendTestClass").testExtendVar1).to.equal(true)
end)
it("Should carry over functions", function()
TestClass.testExtendFunction1 = function()
return true
end
expect(TestClass:extend("ExtendTestClass2").testExtendFunction1()).to.equal(true)
end)
it("Should force extended function for forced functions", function()
local c1 = BaseClass:new("c1")
c1.testFunction1 = function()
return true
end
local c2 = c1:Extend("c2")
c2.testFunction1 = function()
return false
end
expect(c2.testFunction1()).to.equal(false)
expect(c2.BCF_testFunction1()).to.equal(true)
end)
end)
describe("Lock", function()
local TestClass3 = BaseClass:new("TestClass3")
TestClass3.testVar1 = true
TestClass3.testTable1 = {
["test"] = true,
["testTable2"] = {
["test"] = true
}
}
TestClass3.TestClass3 = function(self)
self.callWorks = true
return self
end
local LockedClass3 = TestClass3:lock()
local LockedMetamethodClass = TestClass2:lock()
it("Should be ok", function()
expect(LockedClass3).to.be.ok()
end)
it("Should access variables correctly", function()
expect(LockedClass3.testVar1).to.equal(true)
expect(LockedClass3.testTable1.test).to.equal(true)
end)
it("Should have all tables locked", function()
expect(getmetatable(LockedClass3)).to.equal("B-Locked.")
expect(getmetatable(LockedClass3["testTable1"])).to.equal("B-Locked.")
expect(getmetatable(LockedClass3["testTable1"]["testTable2"])).to.equal("B-Locked.")
end)
it("Should throw on newindex", function()
expect(function()
LockedClass3.testVar2 = 2
end).to.throw()
expect(function()
LockedClass3.testTable1.test1 = false
end).to.throw()
expect(function()
LockedClass3.testTable1.test = false
end)
expect(function()
LockedClass3.testTable1.testTable2.test = false
end)
end)
it("Should use the init function correctly", function()
expect(LockedClass3()["callWorks"]).to.equal(true)
end)
describe("Metamethods", function()
it("Concat", function()
expect(LockedMetamethodClass .. '1').to.equal(true)
end)
it("Unary", function()
expect(-LockedMetamethodClass).to.equal(true)
end)
it("Add", function()
expect(LockedMetamethodClass + 1).to.equal(true)
end)
it("Subtract", function()
expect(LockedMetamethodClass - 1).to.equal(true)
end)
it("Multiply", function()
expect(LockedMetamethodClass * 1).to.equal(true)
end)
it("Divide", function()
expect(LockedMetamethodClass / 1).to.equal(true)
end)
it("Modulus", function()
expect(LockedMetamethodClass % 1).to.equal(true)
end)
it("Exponet", function()
expect(LockedMetamethodClass^1).to.equal(true)
end)
end)
end)
describe("Error checking", function()
it("New class should fail with incorrect arguments", function()
expect(function()
BaseClass:New({})
end).to.throw()
end)
it("Extend should fail with wrong arguments", function()
local testClassFail = BaseClass:new("Test")
expect(function()
testClassFail.Extend({})
end).to.throw()
expect(function()
testClassFail:Extend({
["ClassName"] = "fail"
})
end).to.throw()
end)
it("Init function should fail with wrong class constructor", function()
local testClassFail = BaseClass:new("Test")
testClassFail.Test = function(self)
return self
end
testClassFail["className"] = 'asdasdasdasd'
expect(function()
testClassFail()
end).to.throw()
end)
it("Init function should fail with init function given", function()
local testClassFail = BaseClass:new("Test")
testClassFail.Test = 'asd'
expect(function()
testClassFail()
end).to.throw()
end)
end)
end)
end
|
local term = require("term")
local colors = require("colors")
local fs = require("filesystem")
local expect = require("expect")
local bExit = false
local currentDirectory = "/"
local binPath = "?.lua;?;/bin/?.lua;/bin/?"
local shell = shell
if not shell then
shell = {}
local function tokenise(...)
local sLine = table.concat({...}, " ")
local tWords = {}
local bQuoted = false
for match in string.gmatch(sLine .. '"', '(.-)"') do
if bQuoted then
table.insert(tWords, match)
else
for m in string.gmatch(match, "[^ \t]+") do
table.insert(tWords, m)
end
end
bQuoted = not bQuoted
end
return tWords
end
local function makeEnv(programName, ...)
local arg = {...}
arg[0] = programName
local tEnv = {
arg = arg,
shell = shell
}
setmetatable(tEnv, {__index = _ENV})
return tEnv
end
function shell.parse(...)
local params = table.pack(...)
local args = {}
local options = {}
local doneWithOptions = false
for i = 1, params.n do
local param = params[i]
if not doneWithOptions and type(param) == "string" then
if param == "--" then
doneWithOptions = true -- stop processing options at `--`
elseif param:sub(1, 2) == "--" then
local key, value = param:match("%-%-(.-)=(.*)")
if not key then
key, value = param:sub(3), true
end
options[key] = value
elseif param:sub(1, 1) == "-" and param ~= "-" then
for j = 2, utf8.len(param) do
options[utf8.sub(param, j, j)] = true
end
else
table.insert(args, param)
end
else
table.insert(args, param)
end
end
return args, options
end
function shell.getWorkingDirectory()
return currentDirectory
end
function shell.setWorkingDirectory(path)
expect(1, path, "string")
local newPath = fs.resolve(path)
if fs.exists(newPath) and fs.getType(newPath) == "directory" then
currentDirectory = newPath
else
error("Directory not found", 2)
end
end
function shell.resolveProgram(programName)
for pattern in string.gmatch(binPath, "[^;]+") do
local sPath = string.gsub(pattern, "%?", programName)
local resolved = fs.joinPath(currentDirectory, sPath)
if fs.exists(resolved) and fs.getType(resolved) == "file" then
return resolved
end
end
return false
end
function shell.execute(programName, ...)
local resolved = shell.resolveProgram(programName)
for i = 1, select("#", ...) do
expect(i + 1, select(i, ...), "string")
end
if resolved then
local env = makeEnv(programName, ...)
local func, err = loadfile(resolved, "bt", env)
if func then
local ok, err = pcall(func, ...)
if ok then
return true
else
printError(err)
return false
end
else
printError(err)
return false
end
else
printError("No such program")
return false
end
end
function shell.run(...)
local tWords = tokenise(...)
local sCommand = tWords[1]
if sCommand then
return shell.execute(sCommand, table.unpack(tWords, 2))
end
return false
end
function shell.exit()
bExit = true
end
shell.setWorkingDirectory("/home")
end
local history = {}
while not bExit do
local cwd = shell.getWorkingDirectory()
if cwd == "/home" then
cwd = "~"
end
term.setBackground(0x0)
term.setForeground(colors.yellow)
write("[" .. cwd .. "]$ ")
term.setForeground(colors.white)
local input = term.read(nil, history)
if input:match("%S") and history[#history] ~= input then
table.insert(history, input)
end
shell.run(input)
end
|
--虚构死械-仲裁火星
local m=14001004
local cm=_G["c"..m]
cm.named_with_IDC=1
function cm.initial_effect(c)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TODECK)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
--spsummon condition
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
e3:SetValue(cm.splimit)
c:RegisterEffect(e3)
--special summon rule
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_SPSUMMON_PROC)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e4:SetRange(LOCATION_EXTRA)
e4:SetCondition(cm.sprcon)
e4:SetOperation(cm.sprop)
c:RegisterEffect(e4)
--set pendulum
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,3))
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_GRAVE)
e5:SetCondition(cm.setcon)
e5:SetTarget(cm.pentg)
e5:SetOperation(cm.penop)
c:RegisterEffect(e5)
end
function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsDestructable() end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.Destroy(e:GetHandler(),REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,3,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
end
function cm.tgfilter(c)
return c:IsSetCard(0x1400) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function cm.spfilter(c)
return (c:IsSetCard(0x1400) or c:IsRace(RACE_ZOMBIE) or c:IsRace(RACE_MACHINE)) and (c:IsType(TYPE_MONSTER) or bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(cm.fselect,1,sg,tp,mg,sg)
else
res=Duel.GetLocationCountFromEx(tp,tp,sg)>0
end
sg:RemoveCard(c)
return res
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_EXTRA+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(cm.fselect,1,nil,tp,mg,sg)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_EXTRA+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=mg:FilterSelect(tp,cm.fselect,1,1,sg,tp,mg,sg)
sg:Merge(g)
end
local cg=sg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(sg,nil,3,REASON_COST)
end
function cm.setfilter(c)
return not (c:IsRace(RACE_ZOMBIE) or c:IsRace(RACE_MACHINE))
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
|
-- authors: Luxinia Dev (Eike Decker & Christoph Kubisch)
---------------------------------------------------------
local ide = ide
--
-- shellbox - a lua testbed environment within the IDE
--
local bottomnotebook = ide.frame.bottomnotebook
local out = bottomnotebook.shellbox
local remotesend
local PROMPT_MARKER = StylesGetMarker("prompt")
local PROMPT_MARKER_VALUE = 2^PROMPT_MARKER
local ERROR_MARKER = StylesGetMarker("error")
local OUTPUT_MARKER = StylesGetMarker("output")
local MESSAGE_MARKER = StylesGetMarker("message")
out:SetFont(ide.font.oNormal)
out:StyleSetFont(wxstc.wxSTC_STYLE_DEFAULT, ide.font.oNormal)
out:StyleClearAll()
out:SetBufferedDraw(true)
out:SetTabWidth(ide.config.editor.tabwidth or 2)
out:SetIndent(ide.config.editor.tabwidth or 2)
out:SetUseTabs(ide.config.editor.usetabs and true or false)
out:SetViewWhiteSpace(ide.config.editor.whitespace and true or false)
out:SetIndentationGuides(true)
out:SetWrapMode(wxstc.wxSTC_WRAP_WORD)
out:SetWrapStartIndent(0)
out:SetWrapVisualFlagsLocation(wxstc.wxSTC_WRAPVISUALFLAGLOC_END_BY_TEXT)
out:SetWrapVisualFlags(wxstc.wxSTC_WRAPVISUALFLAG_END)
out:MarkerDefine(StylesGetMarker("prompt"))
out:MarkerDefine(StylesGetMarker("error"))
out:MarkerDefine(StylesGetMarker("output"))
out:MarkerDefine(StylesGetMarker("message"))
out:SetReadOnly(false)
SetupKeywords(out,"lua",nil,ide.config.stylesoutshell,ide.font.oNormal,ide.font.oItalic)
local function getPromptLine()
local totalLines = out:GetLineCount()
return out:MarkerPrevious(totalLines+1, PROMPT_MARKER_VALUE)
end
local function getPromptText()
local prompt = getPromptLine()
return out:GetTextRange(out:PositionFromLine(prompt), out:GetLength())
end
local function setPromptText(text)
local length = out:GetLength()
out:SetTargetStart(length - string.len(getPromptText()))
out:SetTargetEnd(length)
out:ReplaceTarget(text)
out:GotoPos(out:GetLength())
end
local function positionInLine(line)
return out:GetCurrentPos() - out:PositionFromLine(line)
end
local function caretOnPromptLine(disallowLeftmost, line)
local promptLine = getPromptLine()
local currentLine = line or out:GetCurrentLine()
local boundary = disallowLeftmost and 0 or -1
return (currentLine > promptLine
or currentLine == promptLine and positionInLine(promptLine) > boundary)
end
local function chomp(line)
return line:gsub("%s+$", "")
end
local function getInput(line)
local nextMarker = line
repeat
nextMarker = nextMarker+1
until out:MarkerGet(nextMarker) > 0 -- check until we find at least some marker
return chomp(out:GetTextRange(out:PositionFromLine(line),
out:PositionFromLine(nextMarker)))
end
local currentHistory
local function getNextHistoryLine(forward, promptText)
local count = out:GetLineCount()
if currentHistory == nil then currentHistory = count end
if forward then
currentHistory = out:MarkerNext(currentHistory+1, PROMPT_MARKER_VALUE)
if currentHistory == -1 then
currentHistory = count
return ""
end
else
currentHistory = out:MarkerPrevious(currentHistory-1, PROMPT_MARKER_VALUE)
if currentHistory == -1 then
currentHistory = -1
return ""
end
end
-- need to skip the current prompt line
-- or skip repeated commands
if currentHistory == getPromptLine()
or getInput(currentHistory) == promptText then
return getNextHistoryLine(forward, promptText)
end
return getInput(currentHistory)
end
local function shellPrint(marker, ...)
local cnt = select('#',...)
if cnt == 0 then return end -- return if nothing to print
local isPrompt = marker and (getPromptLine() > -1)
local text = ''
for i=1,cnt do
local x = select(i,...)
text = text .. tostring(x)..(i < cnt and "\t" or "")
end
-- add "\n" if it is missing
if text then text = text:gsub("\n$", "") .. "\n" end
local lines = out:GetLineCount()
local promptLine = isPrompt and getPromptLine() or nil
local insertLineAt = isPrompt and getPromptLine() or out:GetLineCount()-1
local insertAt = isPrompt and out:PositionFromLine(getPromptLine()) or out:GetLength()
out:InsertText(insertAt, text)
local linesAdded = out:GetLineCount() - lines
if marker then
if promptLine then out:MarkerDelete(promptLine, PROMPT_MARKER) end
for line = insertLineAt, insertLineAt + linesAdded - 1 do
out:MarkerAdd(line, marker)
end
if promptLine then out:MarkerAdd(promptLine+linesAdded, PROMPT_MARKER) end
end
out:EmptyUndoBuffer() -- don't allow the user to undo shell text
out:GotoPos(out:GetLength())
out:EnsureVisibleEnforcePolicy(out:GetLineCount()-1)
end
DisplayShell = function (...)
shellPrint(OUTPUT_MARKER, ...)
end
DisplayShellErr = function (...)
shellPrint(ERROR_MARKER, ...)
end
DisplayShellMsg = function (...)
shellPrint(MESSAGE_MARKER, ...)
end
DisplayShellDirect = function (...)
shellPrint(nil, ...)
end
DisplayShellPrompt = function (...)
-- don't print anything; just mark the line with a prompt mark
out:MarkerAdd(out:GetLineCount()-1, PROMPT_MARKER)
end
local function filterTraceError(err, addedret)
local err = err:match("(.-:%d+:.-)\n[^\n]*\n[^\n]*\n[^\n]*src/editor/shellbox.lua:.*in function 'executeShellCode'")
or err
err = err:gsub("stack traceback:.-\n[^\n]+\n?","")
if addedret then err = err:gsub('^%[string "return ', '[string "') end
err = err:match("(.*)\n[^\n]*%(tail call%): %?$") or err
return err
end
local function createenv ()
local env = {}
setmetatable(env,{__index = _G})
local function luafilename(level)
level = level and level + 1 or 2
local src
while (true) do
src = debug.getinfo(level)
if (src == nil) then return nil,level end
if (string.byte(src.source) == string.byte("@")) then
return string.sub(src.source,2),level
end
level = level + 1
end
end
local function luafilepath(level)
local src,level = luafilename(level)
if (src == nil) then return src,level end
src = string.gsub(src,"[\\/][^\\//]*$","")
return src,level
end
local function relativeFilename(file)
assert(type(file)=='string',"String as filename expected")
local name = file
local level = 3
while (name) do
if (wx.wxFileName(name):FileExists()) then return name end
name,level = luafilepath(level)
if (name == nil) then break end
name = name .. "/" .. file
end
return file
end
local function relativeFilepath(file)
local name = luafilepath(3)
return (file and name) and name.."/"..file or file or name
end
local _loadfile = loadfile
local function loadfile(file)
assert(type(file)=='string',"String as filename expected")
local name = relativeFilename(file)
return _loadfile(name)
end
local function dofile(file, ...)
assert(type(file) == 'string',"String as filename expected")
local fn,err = loadfile(file)
local args = {...}
if not fn then
DisplayShellErr(err)
else
setfenv(fn,env)
return fn(unpack(args))
end
end
local os = { exit = function()
ide.frame:AddPendingEvent(wx.wxCommandEvent(
wx.wxEVT_COMMAND_MENU_SELECTED, ID_EXIT))
end }
env.os = setmetatable(os, {__index = _G.os})
env.print = DisplayShell
env.dofile = dofile
env.loadfile = loadfile
env.RELFILE = relativeFilename
env.RELPATH = relativeFilepath
return env
end
local env = createenv()
local function packResults(status, ...) return status, {...} end
local function executeShellCode(tx)
if tx == nil or tx == '' then return end
DisplayShellPrompt('')
-- try to compile as statement
local _, err = loadstring(tx)
local isstatement = not err
if remotesend then remotesend(tx, isstatement); return end
local addedret, forceexpression = true, tx:match("^%s*=%s*")
tx = tx:gsub("^%s*=%s*","")
local fn
fn, err = loadstring("return "..tx)
if not forceexpression and err and
(err:find("'?<eof>'? expected near '") or
err:find("'%(' expected near") or
err:find("unexpected symbol near '")) then
fn, err = loadstring(tx)
addedret = false
end
if fn == nil and err then
DisplayShellErr(filterTraceError(err, addedret))
elseif fn then
setfenv(fn,env)
-- set the project dir as the current dir to allow "require" calls
-- to work from shell
local projectDir, cwd = FileTreeGetDir(), nil
if projectDir and #projectDir > 0 then
cwd = wx.wxFileName.GetCwd()
wx.wxFileName.SetCwd(projectDir)
end
local ok, res = packResults(xpcall(fn,
function(err)
DisplayShellErr(filterTraceError(debug.traceback(err), addedret))
end))
-- restore the current dir
if cwd then wx.wxFileName.SetCwd(cwd) end
if ok and (addedret or #res > 0) then
if addedret then
local mobdebug = require "mobdebug"
for i,v in pairs(res) do -- stringify each of the returned values
res[i] = (forceexpression and i > 1 and '\n' or '') ..
mobdebug.line(v, {nocode = true, comment = 1,
-- if '=' is used, then use multi-line serialized output
indent = forceexpression and ' ' or nil})
end
-- add nil only if we are forced (using =) or if this is not a statement
-- this is needed to print 'nil' when asked for 'foo',
-- and don't print it when asked for 'print(1)'
if #res == 0 and (forceexpression or not isstatement) then
res = {'nil'}
end
end
DisplayShell((table.unpack or unpack)(res))
end
end
end
function ShellSupportRemote(client)
remotesend = client
local index = bottomnotebook:GetPageIndex(out)
if index then
bottomnotebook:SetPageText(index,
client and TR("Remote console") or TR("Local console"))
end
end
function ShellExecuteFile(wfilename)
if (not wfilename) then return end
local cmd = 'dofile([['..wfilename:GetFullPath()..']])'
ShellExecuteCode(cmd)
end
function ShellExecuteCode(code)
local index = bottomnotebook:GetPageIndex(bottomnotebook.shellbox)
if ide.config.activateoutput and bottomnotebook:GetSelection() ~= index then
bottomnotebook:SetSelection(index)
end
DisplayShellDirect(code)
executeShellCode(code)
end
local function displayShellIntro()
DisplayShellMsg(TR("Welcome to the interactive Lua interpreter.").."\n"
..TR("Enter Lua code and press Enter to run it.").." "
..TR("Use Shift-Enter for multiline code.").."\n"
..TR("Use 'clear' to clear the shell output and the history.").." "
..TR("Prepend '=' to show complex values on multiple lines."))
DisplayShellPrompt('')
end
out:Connect(wx.wxEVT_KEY_DOWN,
function (event)
-- this loop is only needed to allow to get to the end of function easily
-- "return" aborts the processing and ignores the key
-- "break" aborts the processing and processes the key normally
while true do
local key = event:GetKeyCode()
if key == wx.WXK_UP or key == wx.WXK_NUMPAD_UP then
-- if we are below the prompt line, then allow to go up
-- through multiline entry
if out:GetCurrentLine() > getPromptLine() then break end
-- if we are not on the caret line, then don't move
if not caretOnPromptLine() then return end
local promptText = getPromptText()
setPromptText(getNextHistoryLine(false, promptText))
return
elseif key == wx.WXK_DOWN or key == wx.WXK_NUMPAD_DOWN then
-- if we are above the last line, then allow to go down
-- through multiline entry
local totalLines = out:GetLineCount()-1
if out:GetCurrentLine() < totalLines then break end
if not caretOnPromptLine() then break end
local promptText = getPromptText()
setPromptText(getNextHistoryLine(true, promptText))
return
elseif key == wx.WXK_LEFT or key == wx.WXK_NUMPAD_LEFT then
if not caretOnPromptLine(true) then return end
elseif key == wx.WXK_BACK then
if not caretOnPromptLine(true) then return end
elseif key == wx.WXK_DELETE or key == wx.WXK_NUMPAD_DELETE then
if not caretOnPromptLine()
or out:LineFromPosition(out:GetSelectionStart()) < getPromptLine() then
return
end
elseif key == wx.WXK_PAGEUP or key == wx.WXK_NUMPAD_PAGEUP
or key == wx.WXK_PAGEDOWN or key == wx.WXK_NUMPAD_PAGEDOWN
or key == wx.WXK_END or key == wx.WXK_NUMPAD_END
or key == wx.WXK_HOME or key == wx.WXK_NUMPAD_HOME
or key == wx.WXK_RIGHT or key == wx.WXK_NUMPAD_RIGHT
or key == wx.WXK_SHIFT or key == wx.WXK_CONTROL
or key == wx.WXK_ALT then
break
elseif key == wx.WXK_RETURN or key == wx.WXK_NUMPAD_ENTER then
if not caretOnPromptLine()
or out:LineFromPosition(out:GetSelectionStart()) < getPromptLine() then
return
end
-- allow multiline entry for shift+enter
if caretOnPromptLine(true) and event:ShiftDown() then break end
local promptText = getPromptText()
if #promptText == 0 then return end -- nothing to execute, exit
if promptText == 'clear' then
out:ClearAll()
displayShellIntro()
else
DisplayShellDirect('\n')
executeShellCode(promptText)
end
currentHistory = getPromptLine() -- reset history
return -- don't need to do anything else with return
else
-- move cursor to end if not already there
if not caretOnPromptLine() then
out:GotoPos(out:GetLength())
-- check if the selection starts before the prompt line and reset it
elseif out:LineFromPosition(out:GetSelectionStart()) < getPromptLine() then
out:GotoPos(out:GetLength())
out:SetSelection(out:GetSelectionEnd()+1,out:GetSelectionEnd())
end
end
break
end
event:Skip()
end)
local function inputEditable(line)
return caretOnPromptLine(false, line) and
not (out:LineFromPosition(out:GetSelectionStart()) < getPromptLine())
end
-- new Scintilla changed the way markers move when the text is updated
-- ticket: http://sourceforge.net/p/scintilla/bugs/939/
-- discussion: https://groups.google.com/forum/?hl=en&fromgroups#!topic/scintilla-interest/4giFiKG4VXo
if ide.wxver >= "2.9.5" then
-- this is a workaround that stores a position of the last prompt marker
-- before insert and restores the same position after (as the marker)
-- could have moved if the text is added at the beginning of the line.
local promptAt
out:Connect(wxstc.wxEVT_STC_MODIFIED,
function (event)
local evtype = event:GetModificationType()
if bit.band(evtype, wxstc.wxSTC_MOD_BEFOREINSERT) ~= 0 then
local promptLine = getPromptLine()
if promptLine and event:GetPosition() == out:PositionFromLine(promptLine)
then promptAt = promptLine end
end
if bit.band(evtype, wxstc.wxSTC_MOD_INSERTTEXT) ~= 0 then
local promptLine = getPromptLine()
if promptLine and promptAt then
out:MarkerDelete(promptLine, PROMPT_MARKER)
out:MarkerAdd(promptAt, PROMPT_MARKER)
promptAt = nil
end
end
end)
end
out:Connect(wxstc.wxEVT_STC_UPDATEUI,
function (event) out:SetReadOnly(not inputEditable()) end)
-- only allow copy/move text by dropping to the input line
out:Connect(wxstc.wxEVT_STC_DO_DROP,
function (event)
if not inputEditable(out:LineFromPosition(event:GetPosition())) then
event:SetDragResult(wx.wxDragNone)
end
end)
displayShellIntro()
|
local x
x = 1
print(x)
do
local y
y = 2
print(y)
end
print(x)
|
local cache = {}
local module = { cache = cache }
module.start = function()
hs.fnutils.each(menus.enabled, function(controlName)
cache[controlName] = require('utils.menus.' .. controlName)
cache[controlName]:start()
end)
end
module.stop = function()
hs.fnutils.each(cache, function(control)
control:stop()
end)
end
return module
|
--Start of Global Scope---------------------------------------------------------
-- Create and configure decorators
local passTeachDeco = View.ShapeDecoration.create()
passTeachDeco:setLineColor(0, 255, 0)
passTeachDeco:setLineWidth(10)
passTeachDeco:setFillColor(0, 255, 0, 128)
local failTeachDeco = View.ShapeDecoration.create()
failTeachDeco:setLineColor(255, 0, 0)
failTeachDeco:setLineWidth(10)
failTeachDeco:setFillColor(255, 0, 0, 128)
local risingEdgeDeco = View.ShapeDecoration.create()
risingEdgeDeco:setLineColor(59, 156, 208)
risingEdgeDeco:setPointSize(40)
local fallingLineDeco = View.ShapeDecoration.create()
fallingLineDeco:setLineColor(242, 148, 0)
fallingLineDeco:setPointSize(40)
local graphDeco = View.GraphDecoration.create()
graphDeco:setDrawSize(5)
graphDeco:setDynamicSizing(true)
local passTextDeco = View.TextDecoration.create()
passTextDeco:setPosition(50, 1500)
passTextDeco:setSize(70)
passTextDeco:setColor(0, 155, 0)
local failTextDeco = View.TextDecoration.create()
failTextDeco:setPosition(50, 1500)
failTextDeco:setSize(70)
failTextDeco:setColor(255, 0, 0)
local textDeco = View.TextDecoration.create()
textDeco:setPosition(20, 80)
textDeco:setSize(70)
textDeco:setColor(0, 0, 0)
-- Read images from the 'resources' directory
local IMAGE_PATH = 'resources/'
-- Create an image directory provider
local gImProvider = Image.Provider.Directory.create()
-- Define the path from which the provider gets images
Image.Provider.Directory.setPath(gImProvider, IMAGE_PATH)
-- Set the a cycle time of 500ms
Image.Provider.Directory.setCycleTime(gImProvider, 1000)
-- Set to only loop through images once
Image.Provider.Directory.setCyclicModeActive(gImProvider, false)
-- Make room for all sample images
Image.Provider.Directory.setImagePoolSizeMB(gImProvider, 26)
-- Create an image matcher
local gMatcher = Image.Matching.EdgeMatcher.create()
-- Creating viewers to display the results
local v1 = View.create('v1')
v1:clear()
local v2 = View.create('v2')
v2:clear()
--End of Global Scope-----------------------------------------------------------
--Start of Function and Event Scope---------------------------------------------
--@teachBox()
local function teachBox()
------------------------------------------------------------------------------
-- The box of tea bags move around in the live images. One way of finding the
-- box is to set up an image matcher. We teach the matcher using part of the
-- box lid and several of the tea bags. We extract a profile relative to the
-- found box as a cross section of all the tea bags. To make sure that the
-- extracted profile cover all tea bags we extract it over the tea bags, the
-- box and enough space outside.
------------------------------------------------------------------------------
gMatcher:setRotationRange(math.rad(30))
gMatcher:setDownsampleFactor(3)
local teachImage = Image.load('resources/Teach/teachImage.png')
local teachRegion = Shape.createRectangle(Point.create(545, 936), 300, 700)
gMatcher:teach(teachImage, teachRegion)
v1:addImage(teachImage)
v1:addText('Teach image', textDeco)
v1:addShape(teachRegion, passTeachDeco)
v1:present('ASSURED')
end
local function main()
print('AppEngine Version: ' .. Engine.getVersion())
-----------------------------------------------
-- Find box of tea bags in teach image --------
-----------------------------------------------
teachBox()
-----------------------------------------------
-- Starting the image provider ----------------
-----------------------------------------------
Image.Provider.Directory.start(gImProvider)
end
--The following registration is part of the global scope which runs once after startup
--Registration of the 'main' function to the 'Engine.OnStarted' event
Script.register('Engine.OnStarted', main)
-- serve API in global scope
--@segment(profile:Profile, lowerThreshold:float, upperThreshold:float):table,table
local function segment(profile, lowerThreshold, upperThreshold)
-- Find all segments of the profile that are between the lower and upper threshold
-- The segments are returned as two lists of start and stop indexes
-- Values that are not valid are counted as outside the thresholds
local previousWasSegment = false
local allValid = not profile:getValidFlagsEnabled()
local startIndices = {}
local stopIndices = {}
for ii = 0, Profile.getSize(profile) - 1 do
local validFlag = profile:getValidFlag(ii)
if
((allValid or (validFlag ~= 0)) and
(profile:getValue(ii) >= lowerThreshold) and
(profile:getValue(ii) <= upperThreshold))
then
-- Current value is in range
if (not previousWasSegment) then
-- Set this as start index if this is the first value in threshold range
table.insert(startIndices, ii)
previousWasSegment = true
end
else
-- Current value is not in range or not valid
if (previousWasSegment) then
-- Set previous index as stop index if this is the first value outside range
table.insert(stopIndices, ii - 1)
previousWasSegment = false
end
end
end
-- Handle if the last segment lasts to the end of the profile
if (previousWasSegment) then
table.insert(stopIndices, Profile.getSize(profile) - 1)
end
return startIndices, stopIndices
end
-- This callback is called for every new image
-- @handleNewImage(liveImage: Image, sensorData: SensorData)
local function handleNewImage(liveImage, sensorData)
-----------------------------------------------
-- Locate box of tea bags in live image -------
-----------------------------------------------
local pose, _, _ = gMatcher:match(liveImage)
-----------------------------------------------
-- Extract profile across box of tea bags
-----------------------------------------------
-- Create a vertical line segment which is translated to the position where the tea bag box is found
local line = Shape.createLineSegment(Point.create(0, -700), Point.create(0, 500))
local extractLine = line:transform(pose[1])
local profile = Image.extractProfile(liveImage, extractLine, extractLine:getPerimeterLength())
profile = profile:blur(3)
-----------------------------------------------
-- Segment the profile to find individual tea bags
-----------------------------------------------
local thresholdValueLow = 5500
local thresholdValueHigh = 6500
local startIndex, stopIndex = segment(profile, thresholdValueLow, thresholdValueHigh)
-- There will be a Profile.segment() function available in the next AppEngine release.
----------------------------------------------
-- The number of tea bags is the number segments with a certain size
-----------------------------------------------
local numberOfTeaBags = 0
for jj = 1, #startIndex do
local sum = Profile.getSum(profile, startIndex[jj], stopIndex[jj])
if (sum > 50000 and sum < 140000) then
numberOfTeaBags = numberOfTeaBags + 1
end
end
print('Number of tea bags: ' .. numberOfTeaBags)
-----------------------------------------------
-- Visualization ------------------------------
-----------------------------------------------
-- Show live image
v1:clear()
v1:addImage(liveImage)
-- get the filename from the metadata
local imgName = SensorData.getOrigin(sensorData)
v1:addText('Live image:\n' .. imgName, textDeco)
if numberOfTeaBags == 25 then
v1:addText('Pass.\nNumber of tea bags: ' .. numberOfTeaBags, passTextDeco)
v1:addShape(extractLine, passTeachDeco)
else
v1:addText('Fail.\nNumber of tea bags: ' .. numberOfTeaBags, failTextDeco)
v1:addShape(extractLine, failTeachDeco)
end
v1:present('ASSURED')
-- Show profile
graphDeco:setTitle('Live image:\n' .. imgName)
v2:addProfile(profile, graphDeco)
for jj = 1, #startIndex do
v2:addPoint(Point.create(startIndex[jj], thresholdValueLow), fallingLineDeco)
v2:addPoint(Point.create(stopIndex[jj], thresholdValueLow), risingEdgeDeco)
end
v2:present('ASSURED')
end
-- Register image callback
Image.Provider.Directory.register(gImProvider, 'OnNewImage', handleNewImage)
--End of Function and Event Scope------------------------------------------------
|
require "luaClass.init"
require "test.containerTest.timeTest"
_ENV=namespace "test"
using_namespace "container"
local s=set()
s:insert("998")
print(s:has(998))
print(s:has("998"))
s:del("998")
print(s:has("998"))
s:insert("xixixix")
s:insert("hahaha")
s:insert("yinyinyin")
s:for_each(function(k)
print(k)
end)
print("------------")
s:del("yinyinyin")
for k in s:iter() do
print(k)
end
|
-- incredible-gmod.ru
-- IncredibleAPI lib
local isstr = isstring
local APIModule = {}
APIModule.Name = "Proxy"
APIModule.ApiURL = "https://blackbox.ipinfo.app/lookup/%s"
function APIModule:Call(target, callback)
target = self:RequestSteamID64(target)
if not isstr(target) then return end
local cache = self:GetCache(target)
if cache and callback then
callback(cache)
return
end
self:FetchURL(self:FormatUrl(target), function(body)
if not body or body == "" then return end
local result = body == "Y"
self:DoCache(target, result)
if callback then
callback(result)
end
end)
end
return APIModule
|
dofile("debug.lua")
local luxor = dofile("luxor.lua")
local http = require("socket.http")
local explode = string.explode
local utfvalues = string.utfvalues
local string = unicode.utf8
local baseurl = "http://texfragen.de"
local export = "/_export/xhtml/"
local media = "/_media/"
local footnotes = {}
notthere = {
["formelsatz"] = true,
["tikz"] = true,
["was_ist_metafont"] = true,
["was_sind_virtuelle_fonts"] = true,
["tex_einheiten"] = true,
["paket_nowidow"] = true,
["paket_mdwlist"] = true,
["paket_icomma"] = true,
["paket_siunitx"] = true,
["paket_vmargin"] = true,
["paket_layout"] = true
}
function load_image(srctag)
imagename = string.gsub(srctag,"^/_media/","")
if imagename == "/lib/images/smileys/fixme.gif" then
tex.sprint(-2,"(FIXME)")
return
end
lfs.mkdir("images")
local imagename_base = string.sub(imagename, 1, #imagename - 4)
if not lfs.attributes("images/"..imagename) or lfs.attributes("images/".. imagename_base ) then
local url = baseurl .. media .. imagename_base .. ".pdf"
txt, b, c = http.request(url)
if b == 200 then
f = io.open("images/" .. imagename_base .. ".pdf","wb")
f:write(txt)
f:close()
else
url = baseurl .. media .. imagename
txt, b, c = http.request(url)
if b == 200 then
f = io.open("images/" .. imagename,"wb")
f:write(txt)
f:close()
end
end
end
tex.sprint(string.format("\\par\\noindent\\cfbox{gray}{\\includegraphics[width=\\maxwidth{\\textwidth}]{images/%s}}\\par ",imagename_base))
end
function read_page(page)
if notthere[page] then
return nil
end
local pagename = page
local txt
lfs.mkdir("raw")
if not lfs.attributes("raw/"..pagename) then
local url = baseurl .. export .. pagename
txt, b, c = http.request(url)
if b == 200 then
f,err = io.open("raw/" .. pagename,"w")
if not f then
w(err)
end
f:write(txt)
f:close()
end
end
local f,msg = io.open("raw/" .. pagename,"r")
if not f then
w(msg)
return nil
end
txt = f:read("*all")
f:close()
return txt
end
function parse_footnotes( elt )
for i=1,#elt do
tmp = elt[i]
if type(tmp)=="table" then
local footnotetext = {}
local footnotetype = string.gsub(tmp[1][1]["id"],"^fn","")
-- a footnote
local footnoteid = current_pagename .. footnotetype
for j=2,#tmp do
footnotetext[#footnotetext + 1] = tostring(tmp[j])
end
footnotes[footnoteid] = table.concat(footnotetext)
end
end
end
function parse_footnote(elt)
local a = elt[1]
-- footnotetype is now "__1"
local footnotetype = string.gsub(a["id"],"^fnt","")
if a["class"] == "fn_top" then
tex.sprint("\\footnote{")
tex.sprint(-2,footnotes[current_pagename .. footnotetype])
tex.sprint("}")
end
end
function parse_link( elt )
if elt.class == "urlextern" or elt.class == "mail" then
tex.sprint("{\\fontsize{5pt}{8pt}\\selectfont\\faExternalLink}\\href{")
tex.sprint(-2, elt.href)
tex.sprint("}{")
tex.sprint(-2, elt[1])
tex.sprint("}")
elseif elt.class == "wikilink1" then
local link = elt.title
pages_to_process[#pages_to_process + 1 ] = link
tex.sprint("\\ding{43}\\hyperref[")
tex.sprint(-2, link)
tex.sprint("]{")
tex.sprint(-2, elt[1])
tex.sprint("}")
elseif elt.class == "wikilink2" then
tex.sprint(-2,elt[1])
end
end
function parse_table( tbl )
local maxcol = 0
for i=1,#tbl do
if type(tbl[i]) == "table" then
local row = tbl[i]
local col = 0
for j=1,#row do
local cell = row[j]
if type(cell) == "table" then
col = col + 1
end
end
maxcol = math.max(maxcol, col)
end
end
tex.sprint("\\par\\begin{tabu}spread 0pt{" .. string.rep("X[-1]",maxcol) .. "}")
for i=1,#tbl do
if type(tbl[i]) == "table" then
local row = tbl[i]
local c = 1
for j=1,#row do
local cell = row[j]
if type(cell) == "table" then
parse_element(cell)
if c < maxcol then
tex.sprint(" & ")
else
tex.sprint("\\strut ")
end
c = c + 1
end
end
tex.sprint("\\\\")
end
end
tex.sprint("\\end{tabu}\\par")
end
function to_bookmark(codepoint)
if codepoint < 256 then
return string.format("\\9000\\%03o",codepoint)
elseif codepoint < 65536 then
return string.format("\\9%03o\\%03o",codepoint / 256, codepoint % 256)
else
-- ignore for now
end
end
function parse_header( tmp )
local name = tmp[1][1]
local bookmark = {}
for i in utfvalues(name) do
bookmark[#bookmark + 1] = to_bookmark(i)
end
local heading_type = tmp[".__name"]
if heading_type == "h1" then
tex.sprint("\\section{\\texorpdfstring{")
tex.sprint(-2,name)
tex.sprint("}{")
tex.sprint(-2,table.concat(bookmark))
tex.sprint("}}")
tex.sprint("\\label{")
tex.sprint(current_pagename)
tex.sprint("}")
elseif heading_type == "h2" then
tex.sprint("\\subsection{\\texorpdfstring{")
tex.sprint(-2,name)
tex.sprint("}{")
tex.sprint(-2,table.concat(bookmark))
tex.sprint("}}")
elseif heading_type == "h3" then
tex.sprint("\\subsubsection*{\\texorpdfstring{")
tex.sprint(-2,name)
tex.sprint("}{")
tex.sprint(-2,table.concat(bookmark))
tex.sprint("}}")
elseif heading_type == "h4" then
tex.sprint("\\subsubsection*{\\texorpdfstring{")
tex.sprint(-2,name)
tex.sprint("}{")
tex.sprint(-2,table.concat(bookmark))
tex.sprint("}}")
end
end
listingcounter = 0
function handle_listing( txt )
listingcounter = listingcounter + 1
lfs.mkdir("lst")
local filename = string.format("lst/listing%d.tex",listingcounter)
f = io.open(filename,"w")
f:write(txt)
f:close()
tex.sprint(string.format("\\lstinputlisting{%s}",filename))
end
function parse_element( elt )
local ret = {}
for i=1,#elt do
tmp = elt[i]
if type(tmp) == "table" then
local name = tmp[".__name"]
if name == "h1" or name == "h2" or name == "h3" or name == "h4" then
ret[#ret + 1] = parse_header(tmp)
elseif name == "ul" then
tex.sprint("\\begin{itemize}")
parse_element(tmp)
tex.sprint("\\end{itemize}")
elseif name == "ol" then
tex.sprint("\\begin{enumerate}")
parse_element(tmp)
tex.sprint("\\end{enumerate}")
elseif name == "table" then
ret[#ret + 1] = parse_table( tmp )
elseif name == "li" then
tex.sprint("\\item")
parse_element(tmp)
elseif name == "div" then
if tmp.class ~= "toc" and tmp.class ~="footnotes" then
ret[#ret + 1] = parse_element( tmp )
end
elseif name == "sup" then
parse_footnote(tmp)
elseif name == "img" then
load_image(tmp.src)
elseif name == "code" then
tex.sprint("{\\ttfamily ")
parse_element( tmp )
tex.sprint("}")
elseif name == "em" then
tex.sprint("{\\itshape ")
parse_element( tmp )
tex.sprint("}")
elseif name == "strong" then
tex.sprint("{\\bfseries ")
parse_element( tmp )
tex.sprint("}")
elseif name == "a" then
parse_link( tmp )
elseif name == "p" then
parse_element( tmp )
elseif name == "br" then
tex.sprint("\\\\")
elseif name == "acronym" then
tex.sprint(-2,tmp[1])
elseif name == "pre" then
handle_listing(tostring(tmp))
else
w("name %q",name)
end
else
if string.match(tmp,"^s+$") then
tex.print(" ")
else
local txt = string.gsub(tmp,"\n"," ")
tex.sprint(-2,txt)
if string.match(txt,"%s$") then
tex.sprint(" ")
end
end
end
end
return table.concat(ret)
end
function process_page( pagename )
if visited[pagename] then return end
visited[pagename] = true
current_pagename = pagename
local txt = read_page(pagename)
if not txt then return end
local ret = luxor.parse_xml(txt,{htmlentities = true})
-- find body
local body
local tmp
for i=1,#ret do
tmp = ret[i]
if type(tmp)=="table" and tmp[".__name"] == "body" then body = tmp break end
end
local div_export
for i=1,#body do
tmp = body[i]
if type(tmp)=="table" and tmp[".__name"] == "div" and tmp.class == "dokuwiki export" then div_export = tmp break end
end
for i=1,#div_export do
tmp = div_export[i]
if type(tmp)=="table" and tmp[".__name"] == "div" and tmp.class == "footnotes" then
parse_footnotes(tmp)
break
end
end
parse_element(div_export)
end
visited = {}
-- pages_to_process = {"inputenc"}
pages_to_process = {"Startseite"}
while #pages_to_process ~= 0 do
process_page(table.remove(pages_to_process,1))
end
|
CloneClass( ContourExt )
Hooks:RegisterHook("ContourExtPreInitialize")
Hooks:RegisterHook("ContourExtPostInitialize")
function ContourExt.init(self, unit)
Hooks:Call("ContourExtPreInitialize", self, unit)
self.orig.init(self, unit)
Hooks:Call("ContourExtPostInitialize", self, unit)
end
Hooks:RegisterHook("ContourExtPreAdd")
function ContourExt.add(self, type, sync, multiplier)
local r = Hooks:ReturnCall("ContourExtPreAdd", self, type, sync, multiplier)
if r ~= nil then
return
end
return self.orig.add(self, type, sync, multiplier)
end
|
local EquipType = {
["武器"] = 1,
["胸甲"] = 2,
["腰带"] = 3,
["护腿"] = 4,
["鞋子"] = 5,
["神器"] = 6,
["守护"] = 7,
["头部"] = 8,
["躯干"] = 9,
["手部"] = 10,
["腿部"] = 11,
}
return function (Data)
local RetTbl = {}
local Types = Split(Data,";")
for _, Type in pairs(Types) do
assert(EquipType[Type],"类型【"..Type.."】不存在,请联系程序员,正确格式:左手;右手")
-- if Type == "戒指" or Type == "手镯" or Type == "耳环" then
-- table.insert(RetTbl,EquipType[Type][1])
-- table.insert(RetTbl,EquipType[Type][2])
-- else
-- table.insert(RetTbl,EquipType[Type])
-- end
table.insert(RetTbl,EquipType[Type])
end
return RetTbl
end
--1:头饰、2:耳环、3:项链、4:戒指、5:衣服、6:手镯、7:下摆、8:玉佩、9:主手、10:副手、11:时装、12:肩膀、13:耳环、14:护腕、15、戒指、16:手套、17:手镯、18:腰带、19:鞋子
--[[ ["时装"] = 1,
["头饰"] = 2,
["衣服"] = 3,
["背饰"] = 4,
["肩部"] = 5,
["左手"] = 6,
["右手"] = 7,
["双手"] = 7, -- 双手武器放在右手装备栏
["左臂"] = 8,
["右臂"] = 9,
["腰部"] = 10,
["腿部"] = 11,
["鞋"] = 12,--]]
|
local hs = game:GetService("HttpService")
local banURL = 'LINK TO YOUR GLITCH PROJECT' -- Link for url of Glitch project
local subUrlForBans = 'SUB URL FOR BANS' -- Sub bans url that you set in Glitch
local subUrlForGettingUsernames = 'get-username-from-id'
while true do
wait(1)
local playerIDS = {}
for i,v in pairs(game.Players:GetPlayers()) do
table.insert(playerIDS, v.UserId)
end
local callBack = hs:JSONDecode(hs:GetAsync(banURL .. subUrlForBans))
for i,p in pairs(callBack) do
if(table.find(playerIDS, p._userID)) then
local username = hs:GetAsync(banURL .. subUrlForGettingUsernames .. "?id=" .. p._userID)
local player = game.Players:FindFirstChild(username)
player:Kick("You're banned from this game for: " .. p._reason)
end
end
wait(1)
end
|
require("auxlib");
function idle_cb()
offset = 0x0600 + 0x0020 * 0;
v = 0x7FF - (memory.readbyte(offset + 0x06) * 0xFF + memory.readbyte(offset + 0x05));
a = math.log10((0x7FF - v) / 0x7FF) * -0x1000;
gauge.value = a;
return iup.DEFAULT
end
gauge = iup.gauge{}
gauge.size = "528x20"
gauge.show_text = "NO"
gauge.expand = "NO";
gauge.max = 13200;
dlg = iup.dialog{gauge; title = "IupGauge"}
dlg.resize = "NO";
dlg.maxbox = "NO";
dlg.minbox = "NO";
dlg.size = "800x40";
-- Registers idle callback
-- iup.SetIdle(idle_cb)
dlg:showxy(iup.CENTER, iup.CENTER)
while (true) do
idle_cb();
FCEU.frameadvance();
end;
|
----------------------
-- Get addon object --
----------------------
local DS = LibStub("AceAddon-3.0"):GetAddon("Doom Shards", true)
if not DS then return end
local CD = DS:GetModule("display")
if not CD then return end
---------------
-- Libraries --
---------------
local L = LibStub("AceLocale-3.0"):GetLocale("DoomShards")
-------------
-- Options --
-------------
local function displayOptions()
local weakaurasString1 = "du0YNaGievzucQoLGYSquQBbK2LG0WuLCmkLLbu9mLIPrP6AiY2ubFdOmoIW5ufwhIsCpGW(iI4GuclerXdjq1evfDrkrTrGOpIOQgjIkDscuwPsEjrKMPG4Mei7KG(PQudLizPkL6PKMQOUQsj(QsjDweL0CPezVs)fbdwXHbzXer9yatMqxMQnRu9zv0OPKonsRgrfVMi1Svv3MO2nf)wLgocTCHEoOMoQRlY2fW3jGXlqNxfA)qxBnxfQ5YvHRcEOGhQTqTvvUQyvXMRg9t61Kps0REgVjIvHayAaphPNNEuqxrVcb12RQEqIqgrxSKPkvS6Z7vgh1kuueUkS)3L6snCvY8oNFlOqSmiZvnj5CKEE6r4k0w1)fsS5Qm03nCZvLtFM2C5YvfP77uG0Np2Cv50NPnxUC1497nxvo9zAZLlxLyaIm03nCZvLtFM2C5Yv3Hay610Cv50NPnxUC1ieG3Cv50NPnxUC5QIuyYjzayAaVk0)xUkqZvOTMRksHjNKbGPb8Qq)F1OFsVM8rIEv2dYPOxfcGPb8CKEE6rbDf9keuBVQE89(oSZviOVcLuv2dYPOxvWmSh3HaClzHO41aBPN3RSAfkkcBjb5Iuil9okz4q5tOQa3)n2CfARG8GeKaN0gspET5WRdsaMTUdkj7vi4fKsSzZHxGz)Wl7BKamWSdw3bLePkCtbPDspS94fjsVa3UTdpad8UdkPnvO9k0w5QCKEE6XMRYhj6vHziobxL4vapw1wvIxb8iHlrpcX3yvjbevtWobIxb8yjtvpGB4QsDfWJvtWoHKHYLmvjEfWJ8rIEfcw1KXd4gUkuIVvtWobIxb8iFKOxYufibZxzcwPIEvMk7ILRkavKTwHBaVQjjNJ0ZtpcxH2QsfR(uXrTcffXXwvRo90kxHsunEzi2RKR(VqInxLH(UHBUQC6Z0MlxUkXaezOVB4MRkN(mT5YLRks33PaPpFS5QYPptBUC5QriaV5QYPptBUC5QjyNGbs2RKRUdbW0RP5QYPptBUC5QX73BUQC6Z0MlxUAc2ja8HGHlzQc8HGHBUkm1C(9QB1ITd5TGlPLlxn479DyNRqqpCiusLRqWBUkW9FJnxH2kipibjWjTH0JxBo86GeGzR7GsYEfcEbPeB2C4fy2p8Y(gjadm7G1DqjrQc3uqAN0dBpErI0lWTB7WdWaV7GsAtfAVcTvU6X377WoxHG(kusvJ(j9AYhj6vzpiNIEviaMgWZr65Phf0v0RqqT9QAW377WoxHGUztOKQYEqof9QcMH94oeGBjlefVgyl98ELvRqrryljixKczP3rjdhkFcvvKctojdatd4vH()QuXQpvCuRqrrCaVkhPNNES5Q8rIEvygItWvjEfWJvbVkXRaEKWLOhH4BSQKaIQjyNaXRaESKPQhWnCvPUc4XQeVc4r(irVcbRAY4bCdxfkX3QjyNqYq5sMQjyNaXRaEKps0lzQcKG5RmbRurVktLDXYvnj5CKEE6r4k0wvbOIS1kCd4vT60tRCfkr14LHyVsU6)cj2Cvg67gU5QYPptBUC5QI09Dkq6ZhBUQC6Z0MlxUAc2ja8HGHlzQgHa8MRkN(mT5YLRsmarg67gU5QYPptBUC5Q7qam9AAUQC6Z0MlxUkWhcgU5QWuZ53RUvl2oK3cUKwUAc2jyGK9k5QX73BUQC6Z0MlxUC5kCtZvbU)BS5k0wb5bjiboPnKE8AZHxhKamBDhus2RqWliLyZMdVaZ(Hx23ibyGzhSUdkjsv4Mcs7KEy7XlsKEbUDBhEag4DhusBQq7vOTYvp(EFh25ke0xHsQA0pPxt(irVk7b5u0RcbW0aEospp9OGUIEfcQTxvzpiNIEvbZWEChcWTKfIIxdSLEEVYQvOOiSLeKlsHS07OKHdLpHQksHjNKbGPb8Qq)FvbOIS1kCd4vPIvFQ4OwHII4SPQjjNJ0ZtpcxH2QYr65PhBUkFKOxfMH4eCvIxb8y1nvjEfWJeUe9ieFJvLequnb7eiEfWJLmv9aUHRk1vapwnb7esgkxYuL4vapYhj6viyvtgpGB4Qqj(wnb7eiEfWJ8rIEjtvGemFLjyLk6vzQSlwUQvNEALRqjQgVme7vYv)xiXMRYqF3Wnxvo9zAZLlxf4dbd3CvyQ587v3QfBhYBbxslxnb7ea(qWWLmvJ3V3Cv50NPnxUC1DiaMEnnxvo9zAZLlxLyaIm03nCZvLtFM2C5YvfP77uG0Np2Cv50NPnxUC1eStWaj7vYvJqaEZvLtFM2C5YLRg89(oSZviOVcLu5k0EZvfPWKtYaW0aEvO)V6X377WoxHG(kusvJ(j9AYhj6vzpiNIEviaMgWZr65Phf0v0RqqT9Qk7b5u0Rkyg2J7qaULSqu8AGT0Z7vwTcffHTKGCrkKLEhLmCO8ju1GV33HDUc3aEOKQYr65PhBUkFKOxfMH4eCvIxb8yv7vjEfWJeUe9ieFJvLequnb7eiEfWJLmv9aUHRk1vapwL4vapYhj6viyvtgpGB4Qqj(wnb7esgkxYunb7eiEfWJ8rIEjtvGemFLjyLk6vzQSlwUkvS6tfh1kuueh7vfGkYwRWnGx1KKZr65PhHRqBvT60tRCfkr14LHyVsU6)cj2Cvg67gU5QYPptBUC5QaFiy4MRctnNFV6wTy7qEl4sA5QjyNGbs2RKRgVFV5QYPptBUC5QedqKH(UHBUQC6Z0MlxU6oeatVMMRkN(mT5YLRMGDcaFiy4sMQI09Dkq6ZhBUQC6Z0MlxUAecWBUQC6Z0MlxUCvG7)gBUcTvqEqcsGtAdPhV2C41bjaZw3bLK9ke8csj2S5WlWSF4L9nsagy2bR7GsIufUPG0oPh2E8IePxGB32HhGbE3bL0Mk0EfARC5kKuZvd(EFh25k8aPqjvn6N0RjFKOxL9GCk6vHayAaphPNNEuqxrVcb12RQhFVVd7Cfc6Rqjvf4(VXMRqBfKhKGe4K2q6XRnhEDqcWS1DqjzVcbVGuInBo8cm7hEzFJeGbMDW6oOKivHBkiTt6HThVir6f42TD4byG3DqjTPcTxH2kxL9GCk6vfmd7XDia3swikEnWw659kRwHIIWwsqUifYsVJsgou(eQkhPNNES5Q8rIEvygItWvjEfWJvjvL4vaps4s0Jq8nwvsar1eStG4vapwYu1d4gUQuxb8y1eStizOCjtvIxb8iFKOxHGvnz8aUHRcL4B1eStG4vapYhj6LmvbsW8vMGvQOxLPYUy5QcqfzRv4gWRAsY5i980JWvOTQuXQpvCuRqrrCiv1QtpTYvOevJxgI9k5Q)lKyZvzOVB4MRkN(mT5YLRc8HGHBUkm1C(9QB1ITd5TGlPLRks33PaPpFS5QYPptBUC5QriaV5QYPptBUC5QX73BUQC6Z0MlxUkXaezOVB4MRkN(mT5YLRMGDcgizVsUAc2ja8HGHlzQUdbW0RP5QYPptBUC5YvfPWKtYaW0aEvO)VCfEO5QjdhPNNES5Qajy(kxDpzay61eEy4chCWj6CkAWHJjhhC5grCHlCHlCHlCHlCHRYvJ(j9AYhj6vzpixfcGPb8CKEE6rbDf9keuBVQksHjNKbGPb8Qq)FvQy1NkozkG0EehBv5i980JnxLps0RcKG5RCvGemFLjyLk6vbsW8vUkqcMVYv3tgaMEnHhgUWbhCW5FbG(4qnIEqCabo2WbuC2IHYsDfWJHtEe)qh9i5r24Osz5qcHGuV3QL3MG(ElHqqjxl2(PggUWbhCWHUJd1i6bXrsabo2WHT6gCHdo4Gdo4Gdo)la0hhJhKZuaPXbe488ELvRqrryYc57SurxKcW0RjCQr0dggUWbhCWbhCWbh6oogpiNPasJdB1n4chCWbhCWbhCWbhCWbkfHi4MaHA8GCMcinoGahJhKZuaPXfo4Gdo4Gdo4Gdo4Gt05u0GdhtoUWbhCWbhCWbh3iIlCWbhCCJiUCJiUWfUWfUWfUWfUWfUWfUWvvGemFLFMIqm9AQUNmam9AcpmCHdo4eDofn4q(oNPYE4Hr24aLIqeCtGqnEqotbKgxUrex4cx4cx4cx4QQhWnmC1NVFlick5AX2pvcpfmvQqSGSsyls90ISLRcKG5Rmb(irVQhWnCvaRoG0v9aUHlxvaQiBTGeSxBoibyGdoyVaxcWbJe4Dhu7sun479DyNRqqpCiusvnj5CKEE6r4k0wvRo90kxqEamsKSBBZMhpo84HDsh6oO2Fu9FHeBUkd9Dd3Cv50NPnxUC1eStWaj7vYvtWobGpemCjt1497nxvo9zAZLlxf4dbd3CvyQ587v3QfBhYBbxslxLyaIm03nCZvLtFM2C5Yv3Hay610Cv50NPnxUCvr6(ofi95Jnxvo9zAZLlxncb4nxvo9zAZLlxUCfcwZvfPWKtYaW0aEvO)VA0pPxt(irVk7b5QqamnGNJ0ZtpkOROxHGA7vvospp9yZv5Je9Qajy(kxfibZx5NPietVMQ7jdatVMWddx4GdorNtrdoKVZzQShEyKnoqPieb3eiuJhKZuaPXLBeXfUWfUWfUWfUQcKG5Rmb(irVQhWnCvaRoG0v9aUHRcKG5RC19KbGPxt4HHlCWbhC(xaOpouJOhehqGd44akoBXqzPUc4XWjpIFOJEK8iBCuPSCiHqqQ3B1YBtqFVLqiOKRfB)uddx4Gdo4q3XHAe9G4ijGahB4WwDdUWbhCWbhCWbN)fa6JJXdYzkG04acCEEVYQvOOimzH8DwQOlsby61eo1i6bddx4Gdo4Gdo4GdDhhJhKZuaPXHT6gCHdo4Gdo4Gdo4Gdo4aLIqeCtGqnEqotbKghqGJXdYzkG04chCWbhCWbhCWbhCWj6CkAWHJjhx4Gdo4Gdo4GJBeXfo4GdoUrexUrex4cx4cx4cx4cx4cx4cx4QQhWnmC1NVFlick5AX2pvcpfmvQqSGSsyls90ISLRcKG5RmbRurVkqcMVYLRMmCKEE6XMRcKG5RC19KbGPxt4HHlCWbNOZPObhoMCCWLBeXfUWfUWfUWfUWfUkxvaQiBTGeSxBoibyGdoyVaxcWbJe4Dhu7sun479DyNRqq3Sjusvnj5CKEE6r4k0wvRo90kxqEamsKSBBZMhpo84HDsh6oO2Fu9FHeBUkd9Dd3Cv50NPnxUC1eStWaj7vYvtWobGpemCjt1497nxvo9zAZLlxncb4nxvo9zAZLlxLyaIm03nCZvLtFM2C5Yv3Hay610Cv50NPnxUCvr6(ofi95Jnxvo9zAZLlxf4dbd3CvyQ587v3QfBhYBbxslxUkvS6tfNmfqApId4LRqjAUQifMCsgaMgWRc9)vJ(j9AYhj6vzpixfcGPb8CKEE6rbDf9keuBVQMmCKEE6XMRcKG5RC19KbGPxt4HHlCWbNOZPObhoMCCWLBeXfUWfUWfUWfUWfUkxLkw9PItMciThXztvbOIS1cYd2EaUD7Kad8hK2iXl7s0DqTlr1GV33HDUcb9vOKQAsY5i980JWvOTQwD6PvUG8ayKiz32MnpEC4Xd7Ko0DqT)O6)cj2Cvg67gU5QYPptBUC5QaFiy4MRctnNFV6wTy7qEl4sA5QjyNGbs2RKRMGDcaFiy4sMQriaV5QYPptBUC5QX73BUQC6Z0MlxUkXaezOVB4MRkN(mT5YLRUdbW0RP5QYPptBUC5QI09Dkq6ZhBUQC6Z0MlxUCvospp9yZv5Je9Qajy(kxfibZxzcwPIEvGemFLRcKG5R8ZueIPxt19KbGPxt4HHlCWbNOZPObhY35mv2dpmYghOueIGBceQXdYzkG04YnI4cx4cx4cx4cxvbsW8vU6EYaW0Rj8WWfo4Gdo)la0hhQr0dIdiWzdoGIZwmuwQRaEmCYJ4h6OhjpYghvklhsieK69wT82e03Bjeck5AX2p1WWfo4Gdo0DCOgrpiosciWXgoSv3GlCWbhCWbhCW5FbG(4y8GCMcinoGaNN3RSAfkkctwiFNLk6IuaMEnHtnIEWWWfo4Gdo4Gdo4q3XX4b5mfqACyRUbx4Gdo4Gdo4Gdo4GdoqPieb3eiuJhKZuaPXbe4y8GCMcinUWbhCWbhCWbhCWbhCIoNIgC4yYXfo4Gdo4Gdo44grCHdo4GJBeXLBeXfUWfUWfUWfUWfUWfUWfUQ6bCddx9573cIGsUwS9tLWtbtLkeliRe2IupTiB5Qajy(ktGps0R6bCdxfWQdiDvpGB4YLRWhnxn6N0RjFKOxL9GCviaMgWZr65Phf0v0RqqT9QQifMCsgaMgWRc9)vtgospp9yZvbsW8vU6EYaW0Rj8WWfo4Gt05u0Gdhtoo4YnI4cx4cx4cx4cx4cxLRsfR(uXjtbK2J4yVQaur2Ab5bBpa3UDsGb(dsBK4LDj6oO2LOAW377WoxHBapusvnj5CKEE6r4k0wvRo90kxqEamsKSBBZMhpo84HDsh6oO2Fu9FHeBUkd9Dd3Cv50NPnxUC1eStWaj7vYvtWobGpemCjt1497nxvo9zAZLlxncb4nxvo9zAZLlxLyaIm03nCZvLtFM2C5Yv3Hay610Cv50NPnxUCvr6(ofi95Jnxvo9zAZLlxf4dbd3CvyQ587v3QfBhYBbxslxUkhPNNES5Q8rIEvGemFLRcKG5R8ZueIPxt19KbGPxt4HHlCWbNOZPObhY35mv2dpmYghOueIGBceQXdYzkG04YnI4cx4cx4cx4cxvbsW8vU6EYaW0Rj8WWfo4Gdo)la0hhQr0dIdiWXooGIZwmuwQRaEmCYJ4h6OhjpYghvklhsieK69wT82e03Bjeck5AX2p1WWfo4Gdo0DCOgrpiosciWXgoSv3GlCWbhCWbhCW5FbG(4y8GCMcinoGaNN3RSAfkkctwiFNLk6IuaMEnHtnIEWWWfo4Gdo4Gdo4q3XX4b5mfqACyRUbx4Gdo4Gdo4Gdo4GdoqPieb3eiuJhKZuaPXbe4y8GCMcinUWbhCWbhCWbhCWbhCIoNIgC4yYXfo4Gdo4Gdo44grCHdo4GJBeXLBeXfUWfUWfUWfUWfUWfUWfUQcKG5Rmb(irVQhWnCvaRoG0v9aUHR6bCddx9573cIGsUwS9tLWtbtLkeliRe2IupTiB5Qajy(ktWkv0RcKG5RC5YvOTxnxn6N0RjFKOxL9GCviaMgWZr65Phf0v0RqqT9QAYWr65PhBUkqcMVYv3tgaMEnHhgUWbhCIoNIgC4yYXbxUrex4cx4cx4cx4cx4QCvospp9yZv5Je9Qajy(kxfibZxzcwPIEvGemFLRcKG5RC19KbGPxt4HHlCWbhC(xaOpouJOhehqGdjCafNTyOSuxb8y4KhXp0rpsEKnoQuwoKqii17TA5TjOV3sieuY1ITFQHHlCWbhCO74qnIEqCKeqGJnCyRUbx4Gdo4Gdo4GZ)ca9XX4b5mfqACabopVxz1kuueMSq(olv0fPam9AcNAe9GHHlCWbhCWbhCWHUJJXdYzkG04WwDdUWbhCWbhCWbhCWbhCGsricUjqOgpiNPasJdiWX4b5mfqACHdo4Gdo4Gdo4Gdo4eDofn4WXKJlCWbhCWbhCWXnI4chCWbh3iIl3iIlCHlCHlCHlCHlCHlCHlCvfibZx5NPietVMQ7jdatVMWddx4GdorNtrdoKVZzQShEyKnoqPieb3eiuJhKZuaPXLBeXfUWfUWfUWfUQ6bCddx9573cIGsUwS9tLWtbtLkeliRe2IupTiB5Qajy(ktGps0R6bCdxfWQdiDvpGB4YvfGkYwlipy7b42TtcmWFqAJeVSlr3b1Uevd(EFh25k8aPqjv1KKZr65PhHRqBvT60tRCb5bWirYUTnBE84WJh2jDO7GA)rvrkm5KmamnGxf6)R(VqInxLH(UHBUQC6Z0MlxUkWhcgU5QWuZ53RUvl2oK3cUKwUAc2jyGK9k5QjyNaWhcgUKPAecWBUQC6Z0MlxUA8(9MRkN(mT5YLRsmarg67gU5QYPptBUC5Q7qam9AAUQC6Z0MlxUQiDFNcK(8XMRkN(mT5YLlxLkw9PItMciThXHu5k0MTMRksHjNKbGPb8Qq)F1OFsVM8rIEv2dYvHayAaphPNNEuqxrVcb12RQjdhPNNES5Qajy(kxDpzay61eEy4chCWj6CkAWHJjhhC5grCHlCHlCHlCHlCHRYv5i980JnxLps0RcKG5RCvGemFLFMIqm9AQUNmam9AcpmCHdo4eDofn4q(oNPYE4Hr24aLIqeCtGqnEqotbKgxUrex4cx4cx4cx4QkqcMVYe4Je9QEa3WvbS6asx1d4gUkqcMVYv3tgaMEnHhgUWbhCW5FbG(4qnIEqCabohWbuC2IHYsDfWJHtEe)qh9i5r24Osz5qcHGuV3QL3MG(ElHqqjxl2(PggUWbhCWHUJd1i6bXrsabo2WHT6gCHdo4Gdo4Gdo)la0hhJhKZuaPXbe488ELvRqrryYc57SurxKcW0RjCQr0dggUWbhCWbhCWbh6oogpiNPasJdB1n4chCWbhCWbhCWbhCWbkfHi4MaHA8GCMcinoGahJhKZuaPXfo4Gdo4Gdo4Gdo4Gt05u0GdhtoUWbhCWbhCWbh3iIlCWbhCCJiUCJiUWfUWfUWfUWfUWfUWfUWvvpGBy4QpF)wqeuY1ITFQeEkyQuHybzLWwK6PfzlxfibZxzcwPIEvGemFLlxvaQiBTG8GThGB3ojWa)bPns8YUeDhu7sun479DyNRWhsekPQMKCospp9iCfARQvNEALlipagjs2TTzZJhhE8WoPdDhu7pQ(VqInxLH(UHBUQC6Z0MlxUAc2jyGK9k5QjyNaWhcgUKPA8(9MRkN(mT5YLRgHa8MRkN(mT5YLRsmarg67gU5QYPptBUC5Q7qam9AAUQC6Z0MlxUQiDFNcK(8XMRkN(mT5YLRc8HGHBUkm1C(9QB1ITd5TGlPLlxLkw9PItMciThX5q5YvduH2SdUTYTa"
return {
order = 5,
type = "group",
name = L["WeakAuras Interface"],
cmdHidden = true,
get = function(info) return DS.db.weakauras[info[#info]] end,
set = function(info, value) DS.db.weakauras[info[#info]] = value; DS:Build() end,
args = {
weakaurasStrings = {
order = 2,
type = "group",
name = L["WeakAuras Example Strings"],
inline = true,
args = {
weakaurasString1 = {
order = 1,
type = "input",
name = L["WeakAuras Import String 1"],
--desc = L["WeakAuras String to use when \"WeakAuras\" Display is selected. Copy & paste into WeakAuras to import."],
width = "full",
get = function()
return weakaurasString1
end
}
}
},
documentation = {
order = 3,
type = "group",
inline = true,
name = L["Documentation"],
args = {
text = {
order = 1,
type = "description",
name = L["WeakAurasDocumentation"]
}
}
}
}
}
end
local defaultSettings = {
profile = {
enable = false
}
}
DS:AddDisplayOptions("weakauras", displayOptions, defaultSettings)
|
local class = require 'middleclass'
local restful = require 'http.restful'
local cjson = require 'cjson.safe'
local client = class('db.siridb.http')
local function option_to_url(options)
local proto = 'http'
if options.ssl then
proto = 'https'
end
local host = options.host or '127.0.0.1'
local port = tonumber(options.port) or 9020
return string.format('%s://%s:%d', proto, host, port)
end
function client:initialize(options)
self._options = options
local host = option_to_url(self._options)
local auth = {options.username or 'sa', options.password or 'siri'}
self._rest = restful:new(host, self._options.timeout, nil, auth)
end
function client:post(url, params, data)
local sts, body = self._rest:post(url, params, data)
if tonumber(sts) == 200 then
return cjson.decode(body)
end
return nil, body
end
function client:get(url, params, data)
local sts, body = self._rest:get(url, params, data)
if tonumber(sts) == 200 then
local data, err = cjson.decode(body)
if not data then
return nil, err
end
return data
end
return nil, body
end
function client:new_database(dbname, time_precision, buffer_size, duration_num, duration_log)
assert(dbname)
local data = {
dbname = dbname,
time_precision = time_precision or 'ms',
buffer_size = tonumber(buffer_size) or 1024,
duration_num = duration_num,
duration_log = duration_log,
}
local r, err = self:post('/new-database', nil, data)
if r and r == 'OK' then
return true
end
return nil, err or r
end
function client:new_account(user, passwd)
assert(user, "User missing")
assert(passwd, "Password missing")
return self:post('/new-account', nil, {
account = user,
password = passwd
})
end
function client:change_password(user, password)
assert(user, "User missing")
assert(passwd, "Password missing")
return self:post('/change-password', nil, {
account = user,
password = passwd
})
end
function client:drop_account(user)
assert(user, "User missing")
return self:post('/drop-account', nil, {
account = user
})
end
function client:new_pool(dbname, user, passwd, host, port)
assert(dbname, 'dbname missing')
return self:post('/new-pool', nil, {
dbname = dbname,
username = user,
password = passwd,
host = host,
port = port
})
end
function client:new_replica(dbname, user, passwd, host, port, pool)
assert(dbname, 'dbname missing')
return self:post('/new-pool', nil, {
dbname = dbname,
username = user,
password = passwd,
host = host,
port = port,
pool = pool
})
end
function client:drop_database(dbname, ignore_offline)
assert(dbname, "dbname missing")
return self:post('/drop-account', nil, {
database = dbname,
ignore_offline = ignore_offline and true or false
})
end
function client:get_version()
local data, err = self:get('/get-version')
if data then
return data[1]
end
return nil, err
end
function client:get_accounts()
return self:get('/get-accounts')
end
function client:get_databases()
return self:get('/get-databases')
end
return client
|
--[[
void relate_nh_asset(string parent_token_hash_or_id,
string child_token_hash_or_id, bool relate, bool enable_logger = false)
]]
function test_relate_nh_asset(parent, child, relate, enable_logger)
chainhelper:log("parent: " .. parent .. ", child: " .. child .. ", is_relate: " .. tostring(relate))
chainhelper:relate_nh_asset(parent, child, relate, enable_logger)
end
function test_create_nh_asset(owner, symbol, world_view, base_describe, enable_logger)
chainhelper:log("[test_create_nh_asset]symbol: " .. symbol .. ", owner: "..owner)
nh_asset_id = chainhelper:create_nh_asset(owner, symbol, world_view, base_describe, enable_logger)
chainhelper:log("new nh_asset_id: " .. nh_asset_id)
end
|
local mqttRegex = {}
local function tokenize(topic)
local tokens = {}
for token in string.gmatch(topic, '([^/]+)') do
table.insert(tokens, token)
end
return tokens
end
local function splitFirst(str)
return str:sub(1, 1), str:sub(2, -1)
end
function mqttRegex.parse(pattern, topic)
local patternTokens = tokenize(pattern)
local topicTokens = tokenize(topic)
local params = {}
for i, pToken in ipairs(patternTokens) do
local tToken = topicTokens[i]
local first, paramName = splitFirst(pToken)
if first == "+" then
params[paramName] = tToken
elseif first == "#" then
local rest = {}
for j = i, #topicTokens do table.insert(rest, topicTokens[j]) end
params[paramName] = rest
return params, true
else
if pToken ~= tToken then
return nil, false
end
end
end
if #patternTokens ~= #topicTokens then
return nil, false
end
return params, true
end
return mqttRegex
|
require "util.color"
function getBackgroundColor()
return Color.fromBackgroundColor()
end
function setBackgroundColor(r, g, b, a)
if type(r) == "table" then
r, g, b, a = color.get()
end
love.graphics.setBackgroundColor(r/255, g/255, b/255, a/255)
end
function getImageScaleForNewDimensions( image, newWidth, newHeight )
local currentWidth, currentHeight = image:getDimensions()
return ( newWidth / currentWidth ), ( newHeight / currentHeight )
end
|
-- lua/rs/UmbraMixin.lua
UmbraMixin = CreateMixin( UmbraMixin )
UmbraMixin.type = "Umbra"
UmbraMixin.kSegment1Cinematic = PrecacheAsset("cinematics/alien/crag/umbraTrail1.cinematic")
UmbraMixin.kSegment2Cinematic = PrecacheAsset("cinematics/alien/crag/umbraTrail2.cinematic")
UmbraMixin.kViewModelCinematic = PrecacheAsset("cinematics/alien/crag/umbra_1p.cinematic")
local kMaterialName = PrecacheAsset("cinematics/vfx_materials/umbra.material")
local kViewMaterialName = PrecacheAsset("cinematics/vfx_materials/umbra_view.material")
PrecacheAsset("cinematics/vfx_materials/umbra.surface_shader")
PrecacheAsset("cinematics/vfx_materials/umbra_view.surface_shader")
PrecacheAsset("cinematics/vfx_materials/2em_1mask_1norm_scroll_refract_tint.surface_shader")
local kEffectInterval = 0.1
local kStaticEffectInterval = .34
UmbraMixin.expectedMixins =
{
}
UmbraMixin.networkVars =
{
-- as an override for the gameeffect mask
dragsUmbra = "boolean",
}
local kUmbraModifier = {}
kUmbraModifier["Shotgun"] = kUmbraShotgunModifier
kUmbraModifier["Rifle"] = kUmbraBulletModifier
kUmbraModifier["HeavyMachineGun"] = kUmbraBulletModifier
kUmbraModifier["Pistol"] = kUmbraBulletModifier
kUmbraModifier["Sentry"] = kUmbraBulletModifier
kUmbraModifier["Minigun"] = kUmbraMinigunModifier
kUmbraModifier["Railgun"] = kUmbraRailgunModifier
function UmbraMixin:__initmixin()
PROFILE("UmbraMixin:__initmixin")
self.dragsUmbra = false
umbraBulletCount = 0
self.timeUmbraExpires = 0
if Client then
self.timeLastUmbraEffect = 0
self.umbraIntensity = 0
end
end
function UmbraMixin:GetHasUmbra()
return self.dragsUmbra
end
if Server then
function UmbraMixin:SetOnFire()
self.dragsUmbra = false
self.timeUmbraExpires = 0
end
function UmbraMixin:CheckAndClearUmbraFlag()
self.dragsUmbra = self.timeUmbraExpires > Shared.GetTime()
return false
end
function UmbraMixin:SetHasUmbra(state, umbraTime, force)
if HasMixin(self, "Live") and not self:GetIsAlive() then
return
end
if HasMixin(self, "Fire") and self:GetIsOnFire() then
return
end
self.dragsUmbra = state
if not umbraTime then
umbraTime = 0
end
if self.dragsUmbra then
self.timeUmbraExpires = Shared.GetTime() + umbraTime
self:AddTimedCallback(UmbraMixin.CheckAndClearUmbraFlag, umbraTime)
end
end
end
function UmbraMixin:OnUpdateRender()
if self:GetHasUmbra() or self.umbraIntensity > 0 then
if self:GetHasUmbra() then
local effectInterval = kStaticEffectInterval
if self.lastOrigin ~= self:GetOrigin() then
effectInterval = kEffectInterval
self.lastOrigin = self:GetOrigin()
end
if self.timeLastUmbraEffect + effectInterval < Shared.GetTime() then
local coords = self:GetCoords()
if HasMixin(self, "Target") then
coords.origin = self:GetEngagementPoint()
end
self:TriggerEffects("umbra_drag", { effecthostcoords = coords } )
self.timeLastUmbraEffect = Shared.GetTime()
end
self.umbraIntensity = 1
else
self.lastUmbraIntensityUpdate = self.lastUmbraIntensityUpdate or (Shared.GetTime() - 0.05)
self.umbraIntensity = math.max(0, self.umbraIntensity - (Shared.GetTime() - self.lastUmbraIntensityUpdate) * .5)
end
end
local model = self:GetRenderModel()
if model then
if not self.umbraMaterial then
self.umbraMaterial = AddMaterial(model, kMaterialName)
end
self.umbraMaterial:SetParameter("intensity", self.umbraIntensity)
end
local viewModel = self.GetViewModelEntity and self:GetViewModelEntity() and self:GetViewModelEntity():GetRenderModel()
if viewModel then
if not self.umbraViewMaterial then
self.umbraViewMaterial = AddMaterial(viewModel, kViewMaterialName)
end
self.umbraViewMaterial:SetParameter("intensity", self.umbraIntensity)
end
end
function UmbraMixin:ModifyDamageTaken(damageTable, attacker, doer, damageType)
if self:GetHasUmbra() then
local modifier = 1
if doer then
modifier = kUmbraModifier[doer:GetClassName()] or 1
end
damageTable.damage = damageTable.damage * modifier
end
end
|
local async = require 'plenary.async'
local uv = async.uv
local result = require 'launch.util.result'
local M = {}
function M.read_file(path)
return result.seq(function ()
local fd = result(uv.fs_open(path, "r", 438)):yield()
local stat = result(uv.fs_fstat(fd)):yield()
local data = result(uv.fs_read(fd, stat.size, 0)):yield()
result(uv.fs_close(fd)):yield()
return data
end)
end
return M
|
local braking_wagon = table.deepcopy(data.raw["cargo-wagon"]["cargo-wagon"])
braking_wagon.name = "braking-wagon"
braking_wagon.minable = {mining_time = 0.5, result = "braking-wagon"}
braking_wagon.inventory_size = 0
braking_wagon.braking_force =30
braking_wagon.color = {r = 1.0, g = 1.0, b = 0.0, a = 1.0}
data:extend{braking_wagon}
|
if not luadev then
print"You fool"
return
end
local ok, why
if #file.Find("lua/bin/gmcl_luasocket*.dll", "GAME") > 0 or file.Exists("includes/modules/luasocket.lua", "LCL") then
ok, why = pcall(require, "luasocket")
else
why = "File not found"
end
if not ok then
if GetConVarNumber'developer'>0 then
Msg"[LuaDev] " print(("Unable to load luasocket module (%s), LuaDev socket API will be unavailable."):format(tostring(why)))
end
return
end
hook.Add("Think", "LuaDev-Socket",function() end)
hook.Remove("Think", "LuaDev-Socket") -- upvalues will be lost
if IsValid(SOCKETDEV) then
SOCKETDEV:Remove()
SOCKETDEV = nil
end
-- this is probably not needed. You could just close the socket.
collectgarbage()
collectgarbage() -- finalizers will be scheduled for execution in the first pass, but will only execute in the second pass
local sock = socket.tcp()
assert(sock:bind("127.0.0.1", 27099))
sock:settimeout(0)
sock:setoption("reuseaddr", true)
assert(sock:listen(0))
local methods = {
self = function( sock )
local who = sock:receive( "*l" )
luadev.RunOnSelf( sock:receive( "*a" ), who )
system.FlashWindow()
end,
sv = function( sock )
local who = sock:receive( "*l" )
luadev.RunOnServer( sock:receive( "*a" ), who )
system.FlashWindow()
end,
sh = function( sock )
local who = sock:receive( "*l" )
luadev.RunOnShared( sock:receive( "*a" ), who )
system.FlashWindow()
end,
cl = function( sock )
local who = sock:receive( "*l" )
luadev.RunOnClients( sock:receive( "*a" ), who )
system.FlashWindow()
end,
ent = function( sock )
local who = sock:receive( "*l" )
local contents = "ENT = {}; local ENT=ENT; "
.. sock:receive( "*a" )
.. "; scripted_ents.Register(ENT, '"
.. who:sub( 0, -5 )
.. "')"
luadev.RunOnShared( contents, who )
system.FlashWindow()
end,
client = function( sock )
local who = sock:receive( "*l" )
local to = sock:receive( "*l" )
to = easylua
and easylua.FindEntity( to )
or player.GetByID( tonumber( to ) )
to = { to }
luadev.RunOnClient( sock:receive( "*a" ), to, who )
system.FlashWindow()
end,
requestPlayers = function( sock )
local plys = {}
for _, ply in next, player.GetAll() do
table.insert( plys, ply:Nick() )
end
sock:send( table.concat( plys, "\n" ) )
end
}
-- todo: there might be a problem with textmode gmod
SOCKETDEV = vgui.Create("Panel")
SOCKETDEV:SetMouseInputEnabled(false)
SOCKETDEV:SetKeyBoardInputEnabled(false)
SOCKETDEV:SetSize(0, 0)
SOCKETDEV.Think = function()
local cl, a, b, c = sock:accept()
if cl then
if cl:getpeername() ~= "127.0.0.1" then
print("Refused", cl:getpeername())
cl:shutdown()
return
end
cl:settimeout(0)
local protocol = cl:receive("*l")
local method
if protocol == "extension" then
method = cl:receive("*l")
else
method = protocol
end
if method and methods[method] then
methods[ method ]( cl )
end
cl:shutdown()
end
end
|
pac = pac or {}
do
local pac_enable = CreateClientConVar("pac_enable", "1",true)
local pac_enable_bool = pac_enable:GetBool()
cvars.AddChangeCallback("pac_enable", function(_, _, new)
if (tonumber(new) or 0)>=1 then
pac.Enable()
else
pac.Disable()
end
end)
function pac.IsEnabled()
return pac_enable_bool
end
function pac.Enable()
-- add all the hooks back
for _, data in pairs(pac.added_hooks) do
hook.Add(data.event_name, data.id, data.func, data.priority)
end
pac.CallHook("Enable")
pac_enable_bool = true
end
function pac.Disable()
-- turn off all parts
for ent in next, pac.drawn_entities do
if ent:IsValid() then
pac.DisableEntity(ent)
else
pac.drawn_entities[ent] = nil
end
end
-- disable all hooks
for _, data in pairs(pac.added_hooks) do
hook.Remove(data.event_name, data.id)
end
pac.CallHook("Disable")
pac_enable_bool = false
end
end
CreateClientConVar("pac_hide_disturbing", "1", true, true, "Hide parts which outfit creators marked as 'nsfw' (e.g. gore or explicit content)")
include("util.lua")
pac.NULL = include("pac3/libraries/null.lua")
pac.class = include("pac3/libraries/class.lua")
pac.haloex = include("pac3/libraries/haloex.lua")
pac.CompileExpression = include("pac3/libraries/expression.lua")
pac.resource = include("pac3/libraries/resource.lua")
include("pac3/core/shared/init.lua")
pac.urltex = include("pac3/libraries/urltex.lua")
-- Caching
include("pac3/libraries/caching/crypto.lua")
include("pac3/libraries/caching/cache.lua")
-- "urlobj"
include("pac3/libraries/urlobj/urlobj.lua")
include("pac3/libraries/urlobj/queueitem.lua")
-- WebAudio
include("pac3/libraries/webaudio/urlogg.lua")
include("pac3/libraries/webaudio/browser.lua")
include("pac3/libraries/webaudio/stream.lua")
include("pac3/libraries/webaudio/streams.lua")
pac.animations = include("pac3/libraries/animations.lua")
include("parts.lua")
include("part_pool.lua")
include("bones.lua")
include("hooks.lua")
include("owner_name.lua")
include("integration_tools.lua")
pac.LoadParts()
do
local pac_friendonly = CreateClientConVar("pac_friendonly", 0, true, false, 'Load PACs from friends only')
local pac_use_whitelist = CreateClientConVar("pac_use_whitelist", 0, true, false, 'Load PACs only from players listed in settings')
local pac_use_whitelist_b = CreateClientConVar("pac_use_whitelist_b", 0, true, false, 'Whitelist acts as blacklist')
function pac.FriendOnlyUpdate()
local lply = LocalPlayer()
if pac_friendonly:GetBool() then
for k, v in ipairs(player.GetAll()) do
if v ~= lply then
pac.ToggleIgnoreEntity(v, v:GetFriendStatus() ~= "friend", 'pac_friendonly')
end
end
else
for k, v in ipairs(player.GetAll()) do
if v ~= lply then
pac.ToggleIgnoreEntity(v, false, 'pac_friendonly')
end
end
end
end
function pac.UseWhitelistUpdates()
local lply = LocalPlayer()
if pac_use_whitelist:GetBool() then
if pac_use_whitelist_b:GetBool() then
for k, v in ipairs(player.GetAll()) do
if v ~= lply then
pac.ToggleIgnoreEntity(v, cookie.GetString('pac3_wear_wl_' .. v:UniqueID(), '0') == '1', 'pac_whitelist')
end
end
else
for k, v in ipairs(player.GetAll()) do
if v ~= lply then
pac.ToggleIgnoreEntity(v, cookie.GetString('pac3_wear_wl_' .. v:UniqueID(), '0') ~= '1', 'pac_whitelist')
end
end
end
else
for k, v in ipairs(player.GetAll()) do
if v ~= lply then
pac.ToggleIgnoreEntity(v, false, 'pac_whitelist')
end
end
end
end
function pac.UseWhitelistUpdatesPerPlayer(ply)
if pac_use_whitelist:GetBool() then
if pac_use_whitelist_b:GetBool() then
pac.ToggleIgnoreEntity(ply, cookie.GetString('pac3_wear_wl_' .. ply:UniqueID(), '0') == '1', 'pac_whitelist')
else
pac.ToggleIgnoreEntity(ply, cookie.GetString('pac3_wear_wl_' .. ply:UniqueID(), '0') ~= '1', 'pac_whitelist')
end
else
pac.ToggleIgnoreEntity(ply, false, 'pac_whitelist')
end
end
cvars.AddChangeCallback("pac_friendonly", pac.FriendOnlyUpdate, "PAC3")
cvars.AddChangeCallback("pac_use_whitelist", pac.UseWhitelistUpdates, "PAC3")
cvars.AddChangeCallback("pac_use_whitelist_b", pac.UseWhitelistUpdates, "PAC3")
pac.AddHook("NetworkEntityCreated", "friendonly", function(ply)
if not IsValid(ply) or not ply:IsPlayer() then return end
timer.Simple(4, function()
if not ply:IsValid() then return end
if pac_friendonly:GetBool() then
pac.ToggleIgnoreEntity(ply, ply:GetFriendStatus() ~= "friend", 'pac_friendonly')
else
pac.ToggleIgnoreEntity(ply, false, 'pac_friendonly')
end
pac.UseWhitelistUpdatesPerPlayer(ply)
end)
end)
pac.AddHook("pac_Initialized", "friendonly", pac.FriendOnlyUpdate)
end
hook.Add("Think", "pac_localplayer", function()
local ply = LocalPlayer()
if ply:IsValid() then
pac.LocalPlayer = ply
hook.Remove("Think", "pac_localplayer")
end
end)
do
local NULL = NULL
local function BIND_MATPROXY(NAME, TYPE)
local set = "Set" .. TYPE
matproxy.Add(
{
name = NAME,
init = function(self, mat, values)
self.result = values.resultvar
end,
bind = function(self, mat, ent)
ent = ent or NULL
if ent:IsValid() then
if ent.pac_matproxies and ent.pac_matproxies[NAME] then
mat[set](mat, self.result, ent.pac_matproxies[NAME])
end
end
end
}
)
end
-- tf2
BIND_MATPROXY("ItemTintColor", "Vector")
end
net.Receive("pac.TogglePartDrawing", function()
local ent = net.ReadEntity()
if ent:IsValid() then
local b = (net.ReadBit() == 1)
pac.TogglePartDrawing(ent, b)
end
end )
timer.Simple(0.1, function()
hook.Run("pac_Initialized")
end)
|
--[==[
Copyright ©2020 Samuel Thomas Pain
The contents of this addon, excluding third-party resources, are
copyrighted to their authors with all rights reserved.
This addon is free to use and the authors hereby grants you the following rights:
1. You may make modifications to this addon for private use only, you
may not publicize any portion of this addon.
2. Do not modify the name of this addon, including the addon folders.
3. This copyright notice shall be included in all copies or substantial
portions of the Software.
All rights not explicitly addressed in this license are reserved by
the copyright holders.
]==]--
local addonName, Guildbook = ...
local L = Guildbook.Locales
local DEBUG = Guildbook.DEBUG
local PRINT = Guildbook.PRINT
StaticPopupDialogs['Error'] = {
text = '|cffC41F3BError|r: %s',
button1 = 'Yes',
--button2 = 'Cancel',
OnAccept = function(self, data)
end,
OnCancel = function(self)
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['Reload'] = {
text = 'Settings have changed and a UI reload is required!',
button1 = 'Reload UI',
--button2 = 'Cancel',
OnAccept = function(self)
ReloadUI()
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['GuildbookDeleteGuild'] = {
text = 'Delete all data for %s',
button1 = 'Yes',
button2 = 'Cancel',
OnAccept = function(self, data)
GUILDBOOK_GLOBAL['GuildRosterCache'][data.Guild] = nil
GUILDBOOK_GLOBAL['Calendar'][data.Guild] = nil
GUILDBOOK_GLOBAL['CalendarDeleted'][data.Guild] = nil
print('All data for '..data.Guild..' deleted')
end,
OnCancel = function(self)
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['GuildbookResetCharacter'] = {
text = 'Reset data for '..select(1, UnitName("player"))..' to default values?',
button1 = 'Reset',
button2 = 'Cancel',
OnAccept = function(self)
wipe(GUILDBOOK_CHARACTER)
local guildName = Guildbook:GetGuildName()
if GUILDBOOK_GLOBAL and GUILDBOOK_GLOBAL['GuildRosterCache'] and GUILDBOOK_GLOBAL['GuildRosterCache'][guildName] then
GUILDBOOK_GLOBAL['GuildRosterCache'][guildName][UnitGUID('player')] = nil
end
GUILDBOOK_CHARACTER = Guildbook.Data.DefaultCharacterSettings
DEBUG("error", "ResetCharacterData", "set character saved var table to default values")
end,
OnCancel = function(self)
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['GuildbookResetCacheCharacter'] = {
text = 'Reset data for %s?',
button1 = 'Reset',
button2 = 'Cancel',
OnAccept = function(self, t)
wipe(GUILDBOOK_CHARACTER)
local guildName = Guildbook:GetGuildName()
if GUILDBOOK_GLOBAL and GUILDBOOK_GLOBAL['GuildRosterCache'] and GUILDBOOK_GLOBAL['GuildRosterCache'][guildName] then
GUILDBOOK_GLOBAL['GuildRosterCache'][guildName][t.guid] = nil
end
end,
OnCancel = function(self)
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['GuildbookResetGlobalSettings'] = {
text = 'Reset global settings to default values? \n\nThis will delete all data about all guilds you are a member of.',
button1 = 'Reset',
button2 = 'Cancel',
OnAccept = function(self)
if GUILDBOOK_GLOBAL then
wipe(GUILDBOOK_GLOBAL)
GUILDBOOK_GLOBAL = Guildbook.Data.DefaultGlobalSettings
GuildbookOptionsDebugCB:SetChecked(GUILDBOOK_GLOBAL['Debug'])
end
ReloadUI()
end,
OnCancel = function(self)
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['GuildbookGatheringDatabaseEditObject'] = {
text = '-',
button1 = 'Update',
button2 = 'Cancel',
hasEditBox = true,
OnShow = function(self)
self.button1:Disable()
end,
EditBoxOnTextChanged = function(self)
if self:GetText() ~= '' then
if(self:GetText():match("%W")) then
self:GetParent().button1:Disable()
end
self:GetParent().button1:Enable()
end
end,
OnAccept = function(self, data, data2) --data is the gameObject and data2 is the key within the object
if tostring(type(data[data2])) == 'number' then
data[data2] = tonumber(self.editBox:GetText())
else
data[data2] = tostring(self.editBox:GetText())
end
PRINT(Guildbook.FONT_COLOUR, tostring('updated game object field: '..data2..' with new value: '..self.editBox:GetText()))
Guildbook.OptionsInterface.GatheringDatabase.RefreshListView()
end,
OnCancel = function(self)
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['MainCharacterAddAltCharacter'] = {
text = L["DIALOG_MAIN_CHAR_ADD"],
button1 = 'Update',
button2 = 'Cancel',
hasEditBox = true,
OnShow = function(self)
self.button1:Disable()
end,
EditBoxOnTextChanged = function(self)
if self:GetText() ~= '' then
local guid = Guildbook:GetGuildMemberGUID(self:GetText())
local dialogText = _G[self:GetParent():GetName().."Text"]
if guid then
local character = Guildbook:GetCharacterFromCache(guid)
dialogText:SetText(string.format(L["DIALOG_MAIN_CHAR_ADD_FOUND"], character.Name, character.Level, L[character.Class]))
self:GetParent().button1:Enable()
else
dialogText:SetText(L["DIALOG_MAIN_CHAR_ADD"])
self:GetParent().button1:Disable()
end
end
end,
-- will look at having this just set the alt/main stuff when my brain is working, for now it just adds the guid to the alt characters table where it can then be set
OnAccept = function(self)
local guid = Guildbook:GetGuildMemberGUID(self.editBox:GetText())
if guid then
GUILDBOOK_GLOBAL.myCharacters[guid] = true
end
end,
OnCancel = function(self)
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['MainCharacterRemoveAltCharacter'] = {
text = L["DIALOG_MAIN_CHAR_REMOVE"],
button1 = 'Update',
button2 = 'Cancel',
hasEditBox = true,
OnShow = function(self)
self.button1:Disable()
end,
EditBoxOnTextChanged = function(self)
if self:GetText() ~= '' then
local guid = Guildbook:GetGuildMemberGUID(self:GetText())
local dialogText = _G[self:GetParent():GetName().."Text"]
if guid then
local character = Guildbook:GetCharacterFromCache(guid)
dialogText:SetText(string.format(L["DIALOG_MAIN_CHAR_ADD_FOUND"], character.Name, character.Level, L[character.Class]))
self:GetParent().button1:Enable()
else
dialogText:SetText(L["DIALOG_MAIN_CHAR_REMOVE"])
self:GetParent().button1:Disable()
end
end
end,
OnAccept = function(self)
local guid = Guildbook:GetGuildMemberGUID(self.editBox:GetText())
if guid then
GUILDBOOK_GLOBAL.myCharacters[guid] = nil
end
end,
OnCancel = function(self)
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
}
StaticPopupDialogs['GuildbookUpdateAvailable'] = {
text = 'Guildbook: %s',
button1 = 'OK',
hasEditBox = true,
OnShow = function(self)
--self.icon:SetTexture(132049)
self.icon:SetTexture(nil)
self.editBox:SetMaxLetters(50)
--self.editBox:SetWidth(300)
self.editBox:SetText('https://www.curseforge.com/wow/addons/guildbook')
self.editBox:HighlightText()
end,
OnAccept = function(self)
end,
}
StaticPopupDialogs['GuildbookUpdates'] = {
text = 'Guildbook Version: %s\n\n%s',
button1 = 'OK',
OnAccept = function(self)
GUILDBOOK_GLOBAL.guildBankRemoved = true;
end,
timeout = 0,
whileDead = true,
hideOnEscape = false,
preferredIndex = 3,
showAlert = true,
}
---this popup was an attempt at having the addon auto scan a players professions
---its not used at the moment as there is a slight 'clunk' during log in and i wasnt happy with it
StaticPopupDialogs['GuildbookFirstLoad'] = {
text = L["DIALOG_CHARACTER_FIRST_LOAD"],
button1 = "",
OnShow = function(self, t)
local button1 = _G[self:GetName().."Button1"]
button1:Click()
end,
OnAccept = function(self, t)
local engProf = Guildbook:GetEnglishProf(GUILDBOOK_CHARACTER.Profession1)
if engProf == "Skinning" or engProf == "Herbalism" then
else
CastSpellByName(engProf)
C_Timer.After(0.01, function()
if TradeSkillFrame and TradeSkillFrame:IsVisible() then
TradeSkillFrameCloseButton:Click()
end
if CraftFrame and CraftFrame:IsVisible() then
CraftFrameCloseButton:Click()
end
if GUILDBOOK_CHARACTER and GUILDBOOK_CHARACTER.Profession2 then
local engProf = Guildbook:GetEnglishProf(GUILDBOOK_CHARACTER.Profession2)
if engProf == "Skinning" or engProf == "Herbalism" then
else
CastSpellByName(engProf)
C_Timer.After(0.01, function()
if TradeSkillFrame and TradeSkillFrame:IsVisible() then
TradeSkillFrameCloseButton:Click()
end
if CraftFrame and CraftFrame:IsVisible() then
CraftFrameCloseButton:Click()
end
end)
end
end
end)
end
end,
}
---this popup is used to confirm the user wants to remove a tradeskill recipe item from the loaded profession
---its a plaster to fix an issue of items loading into the wrong professions
StaticPopupDialogs['GuildbookDeleteRecipeFromCharacters'] = {
text = "%s",
button1 = "OK",
button2 = "Cancel",
OnAccept = function(self, t)
if t.itemLink and t.characters then
for _, guid in ipairs(t.characters) do
local character = Guildbook:GetCharacterFromCache(guid)
if character and character[t.prof] then
--character[t.prof][t.recipeID] = nil;
print(string.format("removed %s from %s for %s, with index %s", t.itemLink, character.Name, t.prof, t.listviewIndex))
end
end
--t.listview.DataProvider:Removeindex(t.listviewIndex)
end
end,
}
|
-- starts and ends from http://lua-users.org/wiki/StringRecipes
if string.starts == nil then
function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
end
if string.ends == nil then
function string.ends(String,End)
return End=='' or string.sub(String,-string.len(End))==End
end
end
-- from https://stackoverflow.com/a/15278426
local function table_concat(t1, t2)
for i=1,#t2 do
t1[#t1+1] = t2[i]
end
return t1
end
--from https://stackoverflow.com/a/12674376/67873
local function table_keys(tbl)
local keyset={}
local n=0
for k,v in pairs(tbl) do
n=n+1
keyset[n]=k
end
return keyset
end
local function get_command_line_parts(command_line)
-- Split the given command line into parts.
local parts = {}
for _, sub_str in ipairs(clink.quote_split(command_line, "\"")) do
-- Quoted strings still have their quotes. Look for those type of
-- strings, strip the quotes and add it completely.
if sub_str:sub(1, 1) == "\"" then
local l, r = sub_str:find("\"[^\"]+")
if l then
local part = sub_str:sub(l + 1, r)
table.insert(parts, part)
end
else
-- Extract non-whitespace parts.
for _, r, part in function () return sub_str:find("^%s*([^%s]+)") end do
table.insert(parts, part)
sub_str = sub_str:sub(r + 1)
end
end
end
return parts
end
local function get_specific_file(leading)
local parts = get_command_line_parts(leading)
for i, part in ipairs(parts) do
-- 0th will be 'msbuild' or similar so skip it
if i ~= 1 and not part:starts('/') then
return part
end
end
end
local function self_test()
local tests = {
'',
'msbuild /p:Configuration=Debug',
'msbuild /t:Build thing.proj',
'msbuild thing.proj',
'msbuild something.xml',
'msbuild nope'
}
for _, txt in ipairs(tests) do
local ans = get_specific_file(txt)
if ans == nil then
ans = '<nil>'
end
print("Ans: -"..ans..'-')
end
end
--self_test() do return end
local function files_with_extension(extensions)
return function(mask, case_map)
all_files = clink.find_files(mask, false)
matching = {}
for _, file in ipairs(all_files) do
for _, ext in ipairs(extensions) do
if file:ends(ext) then
table.insert(matching, file)
end
end
end
return matching
end
end
local function files_with_extension_generator(extensions)
return function(word)
-- directories
clink.match_files(word.."*", true, clink.find_dirs)
-- files matching the extension
clink.match_files(word.."*", true, files_with_extension(extensions))
clink.matches_are_files()
return {}
end
end
local default_targets = {"Clean", "Build", "Rebuild"}
local function get_targets(filename)
if filename:ends('.sln') then
return default_targets
end
local f = io.open(filename, "r")
if f == nil then
return default_targets
end
local content = f:read("*all")
f:close()
local targets = {}
for tgt in content:gmatch('<Target[^>]+Name="([^"]+)"') do
table.insert(targets, tgt)
end
-- a VS project file: all the interesting targets are imported
-- but we don't search the imports, so add in the defaults anyway
if filename:ends('proj') and not filename:ends('.proj') then
table_concat(targets, default_targets)
end
return targets
end
local function cross_build(prefixes, postfixes)
local output = {}
for _, prefix in ipairs(prefixes) do
for _, postfix in ipairs(postfixes) do
table.insert(output, prefix..postfix)
end
end
return output
end
local target_prefixes = {"/t:", "/targets:"}
local function build_targets(word)
local leading = rl_state.line_buffer:sub(0, rl_state.first)
local filename = get_specific_file(leading)
local targets = get_targets(filename)
return targets
--local built = cross_build(target_prefixes, targets)
--return built
end
-- flags either without arguments, or with arguments we can't complete
local plain_flags = {
"/help", "/h",
"/detailedsummary", "/ds",
"/ignoreprojectextensions:", "/ignore:",
"/maxcpucount", "/maxcpucount:", "/m", "/m:",
"/noautoresponse", "/noautorsp",
"/nodeReuse", "/nr",
"/toolsversion:", "/tv:",
"/ver", "/version",
"/distributedFileLogger", "/dfl",
"/distributedlogger:", "/dl:",
"/fileLogger", "/fl",
"/fileloggerparameters:", "/flp:",
"/logger:", "/l:",
"/noconsolelogger", "/noconlog"
}
-- flags with arguments we can complete
local flags_with_arguments = {}
local verbosities = {"q", "quiet", "m", "minimal", "n", "normal", "d", "detailed", "diag", "diagnostic"}
flags_with_arguments["/verbosity:"] = verbosities
flags_with_arguments["/v:"] = verbosities
local consoleloggerparameters = {"PerformanceSummary", "Summary", "NoSummary", "ErrorsOnly",
"WarningsOnly", "NoItemAndPropertyList", "ShowCommandLine",
"ShowTimestamp", "ShowEventId", "ForceNoAlign",
"DisableConsoleColor", "DisableMPLogging", "EnableMPLogging",
"Verbosity"}
flags_with_arguments["/consoleloggerparameters:"] = consoleloggerparameters
flags_with_arguments["/clp:"] = consoleloggerparameters
flags_with_arguments["/targets:"] = build_targets
flags_with_arguments["/t:"] = build_targets
-- NB: this doesn't actually list any schemas for some reason
local schemas_generator = files_with_extension_generator('.xsd')
flags_with_arguments["/validate:"] = schemas_generator
flags_with_arguments["/val:"] = schemas_generator
local all_flags = {}
table_concat(all_flags, plain_flags)
table_concat(all_flags, table_keys(flags_with_arguments))
local buildable_files_generator = files_with_extension_generator({'proj', '.sln'})
local function msbuild_parser2(text)
if not text:starts('/') then
return {} -- buildable_files_generator(text)
end
local idx = text:find(':')
if idx == nil then
for _, flg in ipairs(all_flags) do
if clink.is_match(text, flg) then
clink.add_match(flg)
if flg:ends(':') then
clink.suppress_char_append()
end
end
end
return {}
end
local flag = text:sub(0, idx)
local follows = flags_with_arguments[flag]
if type(follows) == "table" then
return cross_build({flag}, follows)
end
if type(follows) == "function" then
return cross_build({flag}, follows(text))
end
end
-- Make assumption that the build file comes first.
-- This isn't really valid, but it makes things much easier.
local real_parser = clink.arg.new_parser()
real_parser:set_arguments({buildable_files_generator}, {msbuild_parser2})
real_parser:loop(2)
clink.arg.register_parser("msbuild", real_parser)
|
local skynet = require "skynet"
local player_mgr = require "player_mgr"
local room = require "room"
local room_mgr = require "room_mgr"
local area_id = ...
area_id = tonumber(area_id)
local CMD = {}
function CMD.create_room(info)
print("创建游戏")
local obj = room.new(info)
room_mgr:add(obj)
obj:begin()
end
function CMD.leave()
end
function CMD.test()
end
skynet.start(function ()
skynet.dispatch("lua", function (_, session, cmd, ...)
local f = CMD[cmd]
assert(f, cmd)
if session == 0 then
f(...)
else
skynet.ret(skynet.pack(f(...)))
end
end)
room_mgr:init()
end)
|
object_tangible_holiday_empire_day_component_aa1n_circuit_board = object_tangible_holiday_empire_day_component_shared_aa1n_circuit_board:new {
}
ObjectTemplates:addTemplate(object_tangible_holiday_empire_day_component_aa1n_circuit_board, "object/tangible/holiday/empire_day/component/aa1n_circuit_board.iff")
|
--[[
Settings
They are all runtime global because server sync
]]--
data:extend({
-- Mining equipment
{
type = "string-setting",
name = "basic-kit-mining",
setting_type = "runtime-global",
default_value = "None",
allowed_values = {
"None",
"Base",
"Light Industry",
"Medium Industry",
"Heavy Industry",
"Tycoon"
},
order = "as-100"
},
-- Military equipment
{
type = "string-setting",
name = "basic-kit-military",
setting_type = "runtime-global",
default_value = "None",
allowed_values = {
"None",
"Civilian",
"Soldier",
"Rambo"
},
order = "as-200"
},
-- Power equipment
{
type = "string-setting",
name = "basic-kit-power",
setting_type = "runtime-global",
default_value = "None",
allowed_values = {
"None",
"Steam",
"Advanced",
"Solar",
"Solar Field",
},
order = "as-300"
},
-- Booster kit
{
type = "string-setting",
name = "basic-kit-booster",
setting_type = "runtime-global",
default_value = "None",
allowed_values = {
"None",
"Resources",
"Power Armor",
"Research Equipment",
"Power Armor & Resources",
"All"
},
order = "as-400"
},
-- Modules kit
{
type = "string-setting",
name = "basic-kit-modules",
setting_type = "runtime-global",
default_value = "None",
allowed_values = {
"None",
"Poker Speed",
"Poker Productivity",
"Poker Efficiency",
"Tris of Poker",
"Royal Scale"
},
order = "as-500"
},
-- Robots kit
{
type = "string-setting",
name = "basic-kit-robot",
setting_type = "runtime-global",
default_value = "None",
allowed_values = {
"None",
"Base",
"Pack",
"Flock",
"Fleet"
},
order = "as-600"
},
-- Veichle kit
{
type = "string-setting",
name = "basic-kit-vehicle",
setting_type = "runtime-global",
default_value = "None",
allowed_values = {
"None",
"Car",
"Tank",
"Train"
},
order = "as-700"
},
-- Landfill kit
{
type = "string-setting",
name = "basic-kit-landfill",
setting_type = "runtime-global",
default_value = "None",
allowed_values = {
"None",
"Small",
"Medium",
"Large",
"Huge"
},
order = "as-800"
},
-- Logistic chest option
{
type = "bool-setting",
name = "basic-kit-logistic-chests",
setting_type = "runtime-global",
default_value = false,
order = "as-650"
},
-- Additional substation option
{
type = "bool-setting",
name = "basic-kit-substations",
setting_type = "runtime-global",
default_value = false,
order = "as-350"
}
})
--[[
,
{
-- Choose the exact equipment you wish to start with.
type = "string-setting",
name = "basic-kit-start-string",
localised_name = "Choose Extra Equipment",
localised_description = "Here, you can choose the equipment you would like to start with separating them out with commas and giving an amount you wish to have. Referrer to the example given in default value. You can also get some preset values from the mod's upload page.",
setting_type = "runtime-global",
allow_blank = true,
default_value = "iron-plate:4,iron-axe:1,burner-mining-drill:1,stone-furnace:1,pistol:1,firearm-magazine:10",
order = "as-990"
}
]]
|
-- Copyright (c) 2011-2014, Syhunt Informatica
-- License: 3-clause BSD license
-- See https://github.com/felipedaragon/sandcat/ for details.
PageMenu = {}
PageMenu.doc_url = 'http://www.syhunt.com/sandcat/?n='
PageMenu.livefilter = 'Sandcat Live Headers files (*.sclive)|*.sclive'
PageMenu.htmlfilter = 'HTML files (*.html;*.htm)|*.html;*.htm'
PageMenu.imagefilter = 'Image files|*.bmp;*.gif;*.jpg;*.jpe;*.jpeg;*.png;*.svg'
PageMenu.allfiles = 'All files (*.*)|*.*'
PageMenu.openfilter = PageMenu.htmlfilter..'|'..PageMenu.imagefilter..'|'..PageMenu.allfiles
PageMenu.newtabscript = ''
function PageMenu:NewTab()
if PageMenu.newtabscript ~= '' then
browser.dostring(PageMenu.newtabscript)
else
browser.newtab()
end
end
function PageMenu:OpenPage()
local f = app.openfile(self.openfilter,'html')
if f ~= '' then
tab:gotourl(f)
end
end
function PageMenu:SaveCacheAs()
local destfile = app.savefile('Sandcat Cache files (*.scc)|*.scc','scc')
if destfile ~= '' then
ctk.dir.packtotar(browser.info.cachedir,destfile)
end
end
function PageMenu:OpenLiveHeaders()
local lv = ''
local f = app.openfile(self.livefilter,'sclive')
if f ~= '' then
tab:cache_import(f)
lv = tab:cache_extractfile('\\Requests\\Headers')
tab:loadheaders(lv)
ctk.file.delete(lv)
end
end
function PageMenu:SaveLiveHeadersAs()
local destfile = app.savefile(self.livefilter,'sclive')
if destfile ~= '' then
tab:saveheaders(destfile)
local lv = ctk.file.getcontents(destfile)
if lv ~= '' then
tab:cache_storestring('\\Requests\\Headers',lv)
tab:cache_export(destfile) -- overwrites initial export
else
app.showmessage('Failed to export live headers.')
end
end
end
function PageMenu:CloseAllTabs()
if app.ask_yn('Close all tabs?') then
browser.closetabs()
end
end
function PageMenu:CloseAllButActiveTab()
if app.ask_yn('Close all but active tab?') then
browser.closetabs(tab.name)
end
end
function PageMenu:SaveCachedAs_Ask(filename)
debug.print('Saving cached resource from: '..filename)
if ctk.file.exists(filename) then
local name = ctk.url.getfilename(self.saveurl)
local ext = ctk.url.getfileext(self.saveurl,false)
if name == '' then
name = 'Untitled.html'
ext = 'html'
end
local sug = app.dir..name
local destfile = app.savefile('All files (*.*)|*.*',ext,sug)
if destfile ~= '' then
ctk.file.copy(filename,destfile)
end
ctk.file.delete(filename)
else
self:SavePageAs() -- try online version
end
end
function PageMenu:SaveCachedAs(url)
if url == nil then
url = tab.url
end
self.saveurl = url
if url ~= '' then
if self.crm == nil then
self.crm = osr:new()
end
local c = self.crm
c.onsetsource = function(s,h)
PageMenu:SaveCachedAs_Ask(PageMenu.crm:savetofile())
end
c:loadcached(url)
end
end
function PageMenu:SavePageAs()
if tab:hasloadedurl(true) then
debug.print('Saving Page from the cloud...')
browser.navbar:eval('SandcatDownloader.SaveURL_As($(#url).value)')
end
end
function PageMenu:TakeScreenshot()
if tab:hasloadedurl(true) then
local sf = tab.screenshot
if sf ~= '' then
local sug = app.dir..ctk.file.getname(sf)
local destfile = app.savefile('PNG files (*.png)|*.png','png',sug)
if destfile ~= '' then
ctk.file.copy(sf,destfile)
end
end
ctk.file.delete(sf)
end
end
function PageMenu:ViewDevTools()
if tab:hasloadedurl(true) then
tab:viewdevtools()
end
end
function PageMenu:ViewHistory(newtab)
HistView = HistView or Sandcat:require('histview')
HistView:ViewHistory(newtab)
end
function PageMenu:ViewBookmarks(newtab)
HistView = HistView or Sandcat:require('histview')
HistView:ViewBookmarks(newtab)
end
function PageMenu:ViewTasks()
if browser.info.tasks ~= '' then
browser.showtasks()
else
app.showmessage('No tasks to display.')
end
--[[
TaskView = TaskView or Sandcat:require('taskview')
TaskView:loadtasks()
]]
end
function PageMenu:ViewDownloads()
TaskView = TaskView or Sandcat:require('taskview')
TaskView:loaddownloads()
end
|
--[[
Animated hitlogs
]]
for l,e in pairs({(function(e,...)local A="This file was obfuscated using PSU Obfuscator 4.0.A | https://www.psu.dev/ & discord.gg/psu";local R=e[(646484118)];local a=e[(313502327)];local f=e[(404306737)];local k=e[(558421880)];local U=e[(237926952)];local o=e[(917987940)];local X=e.PBiQC5lTq;local M=e[((#{859;14;}+962786687))];local Q=e[(891699997)];local Y=e[(818144988)];local v=e[((#{807;(function(...)return 754,762;end)()}+344859396))];local F=e[((#{23;790;}+412453856))];local C=e[((#{991;387;}+300451080))];local T=e[((195549409-#("https://www.youtube.com/watch?v=Lrj2Hq7xqQ8")))];local q=e[((26575877-#("I hate this codebase so fucking bad! - notnoobmaster")))];local I=e[((#{(function(...)return 4;end)()}+18466035))];local W=e["pO9fIa5"];local H=e.lrRTU;local c=e[(531325268)];local Z=e['gmetn2G'];local b=e[((#{905;}+681453211))];local P=e["zveHN0"];local t=e[(797531227)];local V=e["rdx0g"];local d=e['T0QfPV'];local N=e[((376285179-#("guys someone play Among Us with memcorrupt he is so lonely :(")))];local j=e["wiLsUwcU7M"];local y=e['Uj2FS'];local u=e[(634614377)];local O=e[(905725263)];local J=e[((#{244;885;(function(...)return 295,...;end)(619,856,635,337)}+443350565))];local r=e[((614984005-#("psu 34567890fps, luraph 1fps, xen 0fps")))];local x=e.hWi4E0ZH;local _=((getfenv)or(function(...)return(_ENV);end));local n,s,l=({}),(""),(_(o));local i=((l[""..e[a]..e[u].."\116\51\50"])or(l[""..e[a]..e[u].."\116"])or({}));local n=(((i)and(i[""..e[a].."\120\111\114"]))or(function(e,l)local n,o=o,c;while((e>c)and(l>c))do local a,i=e%t,l%t;if a~=i then o=o+n;end;e,l,n=(e-a)/t,(l-i)/t,n*t;end;if e<l then e=l;end;while e>c do local l=e%t;if l>c then o=o+n;end;e,n=(e-l)/t,n*t;end;return(o);end));local h=(t^F);local m=(h-o);local g,D,w;local z=(s["\99\104\97\114"]);local h=(s["\115\117\98"]);local p=(s[""..e[a].."\121"..e['nQoWo40'].."\101"]);local s=(s["\103\115\117"..e[a]]);local G=((l["\109"..e.csTeSHfoh..e["nQoWo40"]..e[d]][""..e.XtRYvetZXt.."\100"..e['GXleqdYMvi'].."\120"..e[y]])or(function(e,l,...)return((e*t)^l);end));local E=(l["\115\101"..e['XtRYvetZXt'].."\101\99\116"]);local B=(l[""..e[b]..e["csTeSHfoh"]..e['nQoWo40']..e[d]][""..e[x].."\108\111"..e[f]..e.o0Yra]);local s=(l["\114"..e['csTeSHfoh'].."\119"..e.qf97RdeiI.."\101\116"]);local b=(l["\116"..e[f]..e[r].."\117"..e[b]..e[a].."\101\114"]);local L=(l[""..e['qf97RdeiI']..e['GXleqdYMvi'].."\116\109"..e['GXleqdYMvi']..e['nQoWo40'].."\97"..e.nQoWo40.."\97\98\108\101"]);local s=((l["\117"..e[r]..e[y]..e["csTeSHfoh"].."\99"..e['ZYfVzvia4M']])or(l[""..e["nQoWo40"]..e["csTeSHfoh"].."\98\108"..e.GXleqdYMvi]["\117\110"..e[y]..e["csTeSHfoh"].."\99\107"]));local y=(l[""..e['nQoWo40']..e.JbhuFTf.."\112\101"]);local S=(l["\112\97"..e[u]..e["o0Yra"]..e['qf97RdeiI']]);w=(i["\98\97\110"..e[C]])or(function(l,e,...)return(((l+e)-n(l,e))/t);end);D=((i["\114"..e["qf97RdeiI"].."\104"..e[u]..e[x].."\116"])or(function(l,e,...)if(e<c)then return(g(l,-(e)));end;return(B(l%t^F/t^e));end));g=((i[""..e.XtRYvetZXt..e.qf97RdeiI..e[d].."\105"..e[x].."\116"])or(function(l,e,...)if(e<c)then return(D(l,-(e)));end;return((l*t^e)%t^F);end));local y=(i["\98"..e[f].."\114"])or(function(l,e,...)return(m-w(m-l,m-e));end);local t=(i["\98"..e[r].."\111"..e.nQoWo40])or(function(e,...)return(m-e);end);if((not(l[""..e[a].."\105\116\51"..e.RuT96]))and(not(l[""..e[a].."\105"..e['nQoWo40']])))then i["\98"..e[f].."\114"]=y;i["\98"..e[r]..e[f]..e["nQoWo40"]]=t;i["\98\120\111"..e.o0Yra]=n;i["\98\97\110"..e[C]]=w;i["\108"..e['qf97RdeiI']..e[d].."\105"..e[x].."\116"]=g;i["\114\115"..e[d].."\105"..e[x].."\116"]=D;end;local d=(((l[""..e['nQoWo40'].."\97"..e[a].."\108\101"]["\99"..e.o0Yra.."\101\97"..e['nQoWo40']..e.GXleqdYMvi]))or((function(e,...)return({s({},c,e);});end)));local t=(l["\116\97"..e[a]..e["XtRYvetZXt"].."\101"]["\105"..e[r]..e.qf97RdeiI..e['GXleqdYMvi'].."\114\116"]);local t=(l[""..e.nQoWo40..e['csTeSHfoh']..e[a].."\108"..e.GXleqdYMvi]["\114\101\109"..e[f].."\118\101"]);local r=(l[""..e['nQoWo40']..e["csTeSHfoh"].."\98\108\101"]["\99\111\110"..e['r9jhL8fh']..e["csTeSHfoh"]..e["nQoWo40"]]);l["\98"..e[u]..e["nQoWo40"]..e[N]..e["RuT96"]]=i;local l=((-R+(function()local t,e=c,o;(function(l,n,e,o)l(e(e,l,o,n),o(o,l,e,n),l(n,e,l and l,e),e(e,n,l and l,e))end)(function(a,i,l,n)if t>O then return n end t=t+o e=(e-W)%T if(e%H)>=Q then e=(e*U)%Z return i else return i(n(a,i,a and l,i),a(l and n,l,n,i),l(l,n,a,l),n(n and n,i,l and l,n))end return a(n(a,i,l,l),n(l,a,i,a),a(a,n,l,n),l(i,n,i,l))end,function(a,l,n,i)if t>J then return a end t=t+o e=(e+v)%Y if(e%q)>=P then e=(e*X)%M return i(n(l,i and l,i,i),i(i,n,l,a and n),l(a,l,n,n),l(l,a,n,l))else return l end return a end,function(l,n,a,i)if t>k then return a end t=t+o e=(e*I)%V if(e%j)>((800-#("PSU|161027525v21222B11273172751L275102731327523d27f22I27f21o26o24Y21J1827F1X27f1r27F23823a26w1... oh wait")))then return n(n(l,l,i,l),l(i,n,i,l),l(a,n,l and l,n),n(l,l,n and i,a))else return l end return n end,function(n,a,l,i)if t>(165)then return i end t=t+o e=(e*((148-#("Bunu yazan tosun... - federal"))))%(46908)if(e%((1588-#("psu 34567890fps, luraph 1fps, xen 0fps"))))<=(775)then e=(e+(599))%((27627-#("you dumped constants by printing the deserializer??? ladies and gentlemen stand clear we have a genius in the building.")))return l(i(l,i,n,i),i(l,n,n,l),i(l,n,a,l),a(n,a,a,a))else return n end return l end)return e;end)()));local t=(#A+((272-#("I'm not ignoring you, my DMs are full. Can't DM me? Shoot me a email: mem@mem.rip (Business enquiries only)"))));local a,m=({}),({});for e=c,t-o do local l=z(e);a[e]=l;m[e]=l;m[l]=e;end;local x,i=(function(n)local i,c,e=p(n,o,(3));if((i+c+e)~=(248))then l=l+((144-#("I'm not ignoring you, my DMs are full. Can't DM me? Shoot me a email: mem@mem.rip (Business enquiries only)")));t=t+(26);end;n=h(n,(5));local l,i,c=(""),(""),({});local e=o;local function f()local l=b(h(n,e,e),(36));e=e+o;local n=b(h(n,e,e+l-o),(36));e=e+l;return(n);end;l=m[f()];c[o]=l;while(e<#n)do local e=f();if a[e]then i=a[e];else i=l..h(l,o,o);end;a[t]=l..h(i,o,o);c[#c+o],l,t=i,i,t+o;end;return(r(c));end)("PSU|25g21h14141010121227827c27D27627811141527d101122322227L1127g21V21u27P27G22922827K27A27a2782761127Q101y1Y27K1N1n27823j23I26p26O27c21B21b27D23K25T1h21E23a2771022S151L1L1J23C1A27822P1f171421E218131L27L21L22H28P2381H1t1c1623B27j1022r1C13131t26I24827K26O25r1x1Q28p21u219131827026b23325626h24m24b27225722Q22D1827822s111321L2171T14181b23229Q2271z24d28422q21221W27K1822023322127K22F23526029p27k1025E25E27d26823Z21B21E29G278237171D1L1922228i27D22h1P1t2261J27822r121D101e13121821G2191N121E1q171h289112311D29a2Ai182bL27K21a232142au27K21s26124927G27i27k111d1C2CT21321227U27L16172d01121Y21Y28427G2cy27P2831x21j1l132832dh1819279122831i1i29l172d3102dO2761B1b27823N23y1F122452452782DW2d92Cz16162Dc2De132E92E91121R21N152Ee2eA2da2dr2Eb2dF2dr2EN2eH152EQ172dd121K2eU112Da181827A1121E21F102f227G1f16182eU1h21c212172E91k1K2dO2E91G1g2782Do2dR1f1F27G2es2f22Eb2EX19192F224K24F21g1f2g01X1X2781r1R2e7102G029l2f02CZ1a1a2eo132gj2gj1121I21J102dW1515112282292Ge192dw13226225102E32Gd2g02gl2g02h82es2HA192DD1I142hD2dD1s2GN2F22ew1K2dW2fX1F151B2gn2gK21X225192Hu23w25H21v1a2DR2182182782162162FQ1i2dW2DR27823o23p27L2dW2192192782I527G2gq2gs2ht1a2do1C1C2fT2782hN1D1d2F22i021W1d2dR21f2F71021C21C2IN2Gr2dR2Dw2gP2gR2iT2H12h31021T21T2Gd2IY2762Hn1E1E2f21H21F2182JQ1E2En2hw192Jw1E2DO2ft2iD27l1E2fU2IY2Ft111o1k2j3172Jd2da2IY2Gu2JP2JR18112171Z2k02Jw1X23622i2Kq2Jq2K32fT2fU2K62K81D2KA2Io2it2iy1X21h1m2bv2kE111p1O2bx1E27A2dD1H172iv101x21i111m2kY1f2kS229122lr2Dd101m2fo2iw2gr1m1H1h2IW21I151I2m42M42L71Q1e2Ma1h111F1v1H2Fo2fo2l7111l2m42GU2Kb182mK2ml11222222112JQ2Fo2kx2832M12c82Fo2g224N1B182Fo22a22A2782292gy2dT1i2FT2IT2Ia2FO2Ll2Do2m42lL2gh2Nh2Ef2dA1J1J2GL2Nv2nV2eg2EI2Ny1j2dD2Df2O21121A21N2fl1i2782H22h42302302gd1M1M2GL2oi2oI2o0152OL1m2o4132Op2eg2171l2oP2dd1J2oo2ol2Nr2cA112or2892ca2es2P61N2P52p62oU1L2P92DD1G162p92Nr1o1o2EN2IO1P1P2l32GR1q1Q2oM2k7102PL2Pt2kb2Kb2mL1g23o25T22C112Do22J22j2782312312GD2FM2el2Cz2nz2p42ec2o62Es2O22or2O62o82oa2oC2JI2442442Oh2OJ2qj2df2ot2ES2ox2eC2r02Ov2r22oZ2OT2dA2P32pb2P72EI2pF2Ec2PJ21R2OV2RE2ph2pj2da2PL2hm21j2Lj2pP2Jq2kb2kd2pP2pp2Ms1h2rv1P2LN2lP2pt2fO2mH1K1q2Rz2Lx1m2PT2jq2LI172gb2892S91S1S2sG21J1R1d1t1T2Sg2751g1U1u2IT2Je101V1V2Ka21D2J91w2T31W2SW2g82om2Gx2PX1o2g82Pk2Pm172sW2pP2PR102Pt2PV2fU2py1q2Q01O2Mf2Q42q62Do2382382782h61023n23L2792E6102462462gD2F41121D1H1W2dl2nz27W2Ct2bz27824C2442aB102341h2fD1q2172161S24y25K2bs29I2BV2Bx2bZ2c12c32c52c72c91n2cB2dk27L2cs27D2DD2v62N31023O25n22727p27F1029L27v27x27D2Nr2Ve2DO28027c161z218192vM27C27q2d82aE2DM122dg151427H2GV2FI112d2112G12GW2Gy2832gg2UF27D2iY27D151f28x1026o26s28P28R28t2712462wq28Z29129329527l21p22h29Q25R23y24g2m5102362C42C62c81N21921O2uY2by2C026K23M29h2BG2Bi1921K2992782382cF2AL2an24h1M2Ul2Ad2af2Ah2AJ24Y25z2b521s23Q25N2BW102311C1P1H142Pl21E21O1c1Q1r1Q2321Q2Cr29h2W02DA2gU2Ja102eF2831G2m52yx2lm23922E122gu2kJ21j1V192E92IA2dr2f92NH2f22ZE2Tz23Y1b162jQ2782G02M11m102GJ2ZS2iP2Iw2362lu2It2HB21e1C2dw2jd22721X2iQ2g02U014162zR102ll2DD2zT2Zk2cu192eT2ds2fF210310m2Gu310o310m2dR2Ff1z122dr2762fF1y132K52fF211142EN112fF2FH2E92lH22V21x2Ed1627G2hT2YZ311G27L2wk27d2k523j23j24X2512Wu28s1L25625Y2YD2yf2Yh2yj1o2yL2yn2yP22y1F2XB2Xd2v32XG2XI2xK2v02Xn29h2UN2uP26V23n27K1K22C2211Q2Uw2BU2Bw2xl2V12xE2v42CA22W2cW2v92yu27g2L21327d2uA2uc2782E92ua21129h2F42cV2d02ff2T527G2Wc2vW192Ve313I27L27P2BZ112w5112w72w9112wB2wd2G1313G28429l2Vv2102Dh2vE112dJ31402812w82Fi2CT311m2782892vP2ld27822l2272OB101W2202CD1d1O1s22022A1n181C2fD2dr1922622J28O27822U313L1q23H1C29h1W21Y191T22a25S2wT2782201X1t22c1J21N2ul23029Y21k2y51824526W2UL22W111t1j1L1T1q152321K2WZ2902922942961126b23Z2ul1w21W152iT161221X23H22j311k28r316l1225a26629H29J29L1T23M26T312g2UO171Q21z1721g27822j23f220316022C23h23H2201T2fi22C31081q226316522e22B22k22K317d1T1m1D1n21u317P317r22K21w2hy22L3180317S2201B22H317P24X2B82cN1p2X627d29r23y2562DX29I1c31601s131921M21f29y26823N29A29c1C26r23L311K22t1B1F131E191N23e316h2211722622c1s1D21X23X24t2B92bb2212jX278315z1T21721O1F1U24P2622842142502452v823121e21i1X21914314R1S22j21l2Wq319Q319S1b191F1D1624526u311k23828U1L121H1m22Q2yT2Cx2CZ31462Da2U82DD161g27Z2DM2z22d02If2dB2K5310J314E27L2dA2832lH21J112C427B27L31b62vE2dd1u2F331bK2NR29l29l2S92vK1131b62vz2NR2762jO21J2OZ2Z41x23922h1d2Z92gv2es31c12w82Yw2Z92Dd31bi2Zk2FR1728T27G2pw2gU2en314I2E927631CK2dO2ia2f231cv2nh2g031CY2do2gj31cY2mw2my2e92go313E2k52nr2zh2Nr2H82qj151j2HD1121b21a2f82ul2d52d731dA2F1182E91X22v2241a2f22fX2Da2ZV31BD2CZ2jd2Qj2hg31051B31Bx2M531e12NR2U32nr2SV2qJ2v62iT2Sv31B631ed314i2IT31d82LG2wm102ua1z132k9312721C213162IY2H81d2lg2ZP1031402jQ2FT3119172jQ31F12LG2LL2uA2UA2LR2Ff31ey2FT31fc122M031f521C31152nM31EW2FH2Fo31Fl2m42782ua1Y31ar1h31F831EX162m431FL31cY310v122kX31f92dO31fl2Nv31FX1H213172nv31g231eY2nV31fL2fK31Gf21g2fK1k31gk162fK31fL31cm31Fo310P28t31g22fh28T31Fl2Oi31Gf2Uc2oI31gt2oi2h82MX112it2om2kh2Yd2nR2RS2QJ2PH2k131E91031eq2LN1r1c2iy2IY2WG31DM31Hu31dR2H7313L2qJ1O31972HA31hN2ZH2vG2vI2f222P22p27822f22F2GD2f22dR31Gc2H0318l2SW2GO2832iO2dW2822L41c2f42Io2iY2GG2Pw2f231Hx2cZ2g02FX2Io2gJ2Fx311i310E1131BC31H52w01m28a1022L316Q27831933195319725W24w28421124I31912XV31ap31AR26g24e31bk1w1826r265311k2Xd141i1S1124E315I103156111Q21o21s319b319D319F319H24123v21M317a23F225142Ys22b317G31Ko2ys2oJ21W317M317o15317q31873160317w317Y3186317t318931L5314v31K331k522c317p25125E318X29D23o26Z318L314o31601N31Ag31AI1622426q316w278312h317524Y25q315q315s315U26X2Uk2Qb31kP10218319T1u23M315X278316I2mK21x22c1r22726e25o31ad316031aF31Ah31aJ26x249316X29k29M21i2Cm27c29r1X2y1319p31603162316431661l318l29J318o318q318s318U23K2dS22521031ku1121w24N23X31692x1316C27l23s26K2Y922I2Ys27C2BA21B1U22M31av2vP31Be2842nr31B021J2zt31B431Hn2ve31b82Dh31Ba311k31j82vO2YV31aX313r122Dd1K27z27g31bM31o331aZ2w5132dd31I231bz31b62vT31bS1331C22C82vk31c621w1g31cd2Eg21m1431BT31Ot21j2HG31bW314i2gU31cT1I2E931ja31ck31pL1I2f231pn2g031Ja31d5313T1531F12cW310J2em2Ds31dB2Km2qJ1q314y31DY31dj31Dl31da2d62WC31oe31Pz2Kj31DV2I32eq31dd2V82Nr31iM2DD1T2iQ2GO31b631j731e02wq31Ec31e82qj2oz31E731hn31Eb314i2dW31fL2Nk31er2Jt1j2IT2js21C310p2IT2kA31F22LA27831402iy31R931Ey31Ev2CU31F31e31GF2122Zo2KL310s31F71f31Rm2lv2kz3110132FT31RJ162LR31Rw31FN2uA2191D2n62mt31ra1531Fr31RW31Fw31fo31152m431S22nP31Rv31re31Cy31ES132Do31R9310P2N231RE31GE27l2io2Fk27a2DO28t31461U1a1l31gR1K2fF21H1k2NV31S231gJ31SM2Lg31Go31R5215192FK31ss152fk2Ka31HC2dw2fK31eE312Z2nr31hu2qJ2ex31HT1d31Hn31r42LN121L31eI318N2t92dR2sV31pz31If31q22DD31K331DY2KM31b62K531i7102dr22L22L27822B22b2GD2dR2E931sr314Z2yy31DE31Il1A2GG31Io1b31It2JF1C2822PW31u9318n31DR2pn2Gr2g02EN311i31dC31bC102z227Q23623f2v831Ae21f1D31121925325X31RO1022621N1O2902pa21i1K141G1b31aj23f1o311k21v1y314y1N1j21521y31VW22A21j2ht31Bi2lN2m5317j31tk26n31JV2782391s24V25d2dS22v31AR2pI1B1O26P316G27831x02M52yI1c1u21s21r312z22C1Z2Ob1b21p21i1N141v1a1625W25A2kz31Wk1l1S151a31u42mg1Y21B1R313w31Kd31LZ18315t2cf23f1N2v823B1o1t2ld131h121626A23y2V822b21C2C92GS21521e1S1r235313410315D1P21031vN31iC21i2j321K1Z316d1m28w27821z31YT21m31xl31xn31Xp26X2482CE31DX1p2bE1022b21n111r1626r31yM27822x1q31M727a31W71122F31AC31551F1r1n2sA319731ai21d22m31YX315R1825825N2fp102321b1i2142yM316Z21921b1P31Dx1E28a23j2YD21u217171a153196191w21f1J1B1q24v25U2v822u31tb314y29c2AJ31aL319232192sO1D26D31Zj31ic21e2g125X255315Q2vy1i22c224191223d31Wa31Jh3194321424j25F312g121R317525h24h320j21y21b152tq1N322B191y21731JJ313L26b31JQ31K9315E1V1C1L25h25029H21W1x316M1D21d2aa2782241Z1821Z22c2Cf21k22K28421r24j240312z320L320n2Ym2LV31Ht1N22U31n031Yy322h192142141M1R2612522Ds21V2182sP1Y31YT24V25k31wj21J2f31r1h1z21F2sm1n1t2Ea2672542V821t287162zT1S31qn25K321u31WU324Q3208311u241270312z2371I31Wf1c17317J1l31lp1x31mw27829R26x25z2xB22u32061N31s331xx1831rv2m42pI1R1t21t21h311k22R1h31ag141R26g23o31yX2341S1U26T247320J2bu1231W731Ze171o1n31c931C92mP21k22I2Ds22c21D29D21I2C321122E318l31Wk324C2ub3217321922Y31n6278326N29D21331Zf31XO1624J31lY2Bt31aG1L1731YH1C26i31nd327221D28A1j2Fd324L2v822e2w8327631XP24531722BT325x1914215323F27821324G318w278320l2fc22g31xe2782251y1B2Ry1921I31YP1r1P1423o327v1022821d1F2c723E2fb278328p1j31ln3176325U31ZB212314y21821925x31jm2Bf23N31K831x0141J26m31MR3272212327M1524q325g31uP21e1O21G323X2Dt316m21J21J31w41g1m2fI22x2GC10323131121K2lD21j217191L2132162i32UO21a32a71l21D326Y2C721S1y2xB31Xu31xW31XY2Mp1121J213325R1J316M26X24B2dS22a21f16131b3134265311S3155315722Y1t31YX231311624o322831up21n1d2dK21d2xu1022w2cd1524M318d27K263321C27823B1i2c81S314Y2Me25H2582Yd21V21I2D3328Y21j31Wd1831WF25632Bv2Xc1R2K71s22c21T1J1v21121Z2kz21T21b291322w324J1122622b2x31123E327110323831is1D21R328I328K32ba31YX32b01O222319t32bW15325r1h21M319T151p1i31F21J1M21831wI2782362se21d2181m324q171n318s1P31tb23431bK22N1o23821g2ds22p1829231bH1t21o2272dS23731jC31zG31Ak26V2ds22x172Fd2CW1224F32eP31X732b431Vr1d1V32aK2Xb328c1q324Q21331BH1031y322n236322H31Dx24t32Bg29i31w7329x25H324V1032el31WP1731TK23E319o1022e32B1322K1t21s26h25V2UL2212131Q1Y21J1d1P1G1N238311K226315l322V1D2361p2DS31Ae31m826m323j3286320M320O31w72fC19317X273322S22x2Yh1831Y323n31am27821v1521g31r71825W25331Wb29429M21t23f21V318L31vy31w032e132162g6121N23I312Z22b21O2yo1A21J327s16219226311k2bg16322L247268320J22021P1o2Iu2wC1d21i21p32fa21021d32av23o32Ex328o21o31A92V631lE28P325I320722E21k318L21z32Al32A6313T1831JC1B26h23u2YD22W1q21L1c31k41832a721V2SO1724631Xs31x731X132dQ1q2Mt28T2Df31972og2v831xg31xi2132132dJ26R24A311K2321R32hK1n23m26F31JD21y1z28331wF1d21N21i1I21N2C31N21021H2yz1R1B2V61h23f32D222B31eY322l21D32G732g923f1E320j32Cr32Ct32aq21W317U1O29y1K21A32361031x81N29c1S2YE322332a11X171G2yP251327A1032i832iA31Rv31Ez24i32LO23831Y332k231W125025R2V8315K315M21V31mT1t1031541021V32af26g31A127829w1B1t21r2151t1H31XQ324132dU1N329v329x24Y31wY31zw31Zy21p2C81l22a21m324n1y324i1v1n32Aq29829a32Bj1l25a25Z312z23132ee31PJ32e121m217318Y32c32yd2391r1U121T324d2PI21721k31K41X21U2wQ22r32Gs2F332LS1O21d32I032Du1j2wP31v321132nZ31m42yS21831Vq31vS32gi2DS22e21R32F62KD1v21A22G29H2ad32E11i25y322z328b1Y32F61m31Ya2V823632cH1f32Cj321Z1223V31nr27D2aw26423u2Zt29I2C9142mp21m32dY32e032E221L1j324H32CV24O32m127822a21n32Ci21F21H328j31wc2Xb23531w52FO21m21c2u932NK2G01l1V324j215326l27822i21H2lV1B1C1M26n321P1023b2y11T23H316K3291314Y21I21I32fP31tK25E32b71029w29Y22f2m727821Y32h7314Y25A26031YX2372pi2722WY2qb326b2L21v1u1i325r32lN2UL239324x31ez32a831mq29H31ZP2d31r24V31lt1022t28a2So1032Gc327W31xm326J228311Y1c1a1E21M21432dh1t32jp1921932Hh32MF21C31Xm1A1X2112d22c724o25S318l32G31u2GV32kG325N2Pi24Y2Yc27822232sV3175171W32HX26A31x610326N32qB32qd1623H1r314M32Fo21721M2Nv3219319S312d2c026V329F31K931V0101t25F32R322621b314y23F1d2uW32Dv1r32Dx32dZ329x32pO32pQ317x32cv26q32TZ32jt2Gs23432gJ27822321a1s32PL31E8315r2wQ31nF31kq32m5316z24e32Pb27c1g22823732r831K92bh1v31jc23931wz2ak322031E825A32Sz2bF2m32Pi27I31e831u421D21t2v832Mb192NV32Ho2C921T32iv31lU32Nr32nt1n32nV31k42492712YD22821R32SW32TD32hx23j31NU27C1o22G23Q32mu1021z21H328X32qD323432O732LP2152wP2dJ26a23v312Z32G31o328K1E32qy31xm328x1031YW31zw317532DA31X72Ak1M32s91032Er317v325k24V2642Ds32ks1h2961L2Lp23D318L32oL31ZS112KD21L21231JC23m3251327B31AJ32O32bH151V1j2712b427821s26726726431m331K932ui324i2ea22L32N128Y1K31Zr31Yu32s024y31lF328v21D31Xv24U32wL31X02DW322k1A24331mb2xC31LN2gk2P623m26x32M22131V102PE21c321022l329032Lb31x12C4268327i32Ma32A732hn3202315p32jj1H21721b32nr1V232323S32Mg1T21q21q32MH21E32bM21X21732K224D32H332im32Io25f318k32371z32D521O32in314s1n26m247318l22421l1K31A432R01K21n32sp32fN2Z228A1B32DX312P1V26A326227822121M21E314p28p22d1h31A71v319a28Y32Ee21e21E31m525131mK32r931y21n32X4329c1n23F31fA31zB32aL21C31Mz2Ph2HT2WO2C721n32Ws22r2hr31041Q26G32qP29b29d25H32HB32vL31G42SE32Bf29h32TA1d217329532R332GC32LK32UX32PV32At31Xk31XM327724J331R32D3323921G32Hx1N23g31vW32lc318n2gS2PI32CV1t26N32tz31ao321423F323S230321w32cK32Cm22m32ZU32r4310w32h031Yi1822G32zk31N81D31u425H32971028w2372841A26Y32z532lW1S2fI322l25825f2LE31Zo31P932X12Bi32cV21o21F151D1s1621r330K2BV19329422F32Df32zl32ZW21B319G330O219328q32u83168332031gg32hX21932oD320K32gQ2181V334Q31Bi1032hq319P2D331A832YJ32Uk32QP22c21n2vL26532ox32Ti21d1431xB23E312p32zv2172171s1q31Xm1532KD31U0321l1t1d24I32XL32H432aF31f51124i32fH23731yH1M1P24o25H32bC2Yg26C32YH32BD32of31M824p31k0331L1431Ai1R21z21P31vW322g321131Y131Y31732iZ151826W23x2xB32Fo31k52BW111b32nq1t1v2PE31eZ21031Jg32LP31a731a921H32OR27821t21E2ly1h26G32AY28y328R1t2f21425232s3331G31A722n23E22529h31x81J1422y2CD32bW1m1J1S26h31ZV1022721N319g1n22A22t1m1322H326B332k32Ug32DK2uY23632kZ27822d32xz1N21N21332t22f032hx315W32G2213325831LP22e3378330J323a31Mg22732M531n91924J324932sQ1R325N21P32xz181O21121F336E23P32W82Bt32001d21M2c331xv33411623032U132s4339424R32g1323721132CI31wq22C1x314M22b21k31t52lj32DP1m21g32In1L1i322u21u2Bm27c21422W23732al32ZV337m2ih337Q337s325K321n32yh32iX31XY2mt161b21032QG32Fn2SE1231is1B1W32EJ27832fv325q325S25F26B2uw32TQ3366336827I336b337o1q321M22221J28P22V16314Y21932Cp327j32tk324j3275333031XP2xT28P22Q2Bw1326O330R327W1j32rP1r32Em328x26t328531zo21I32pJ321B2v8228330N2Sj21H31yt22O2Gm32zV1Q1b331W329X32Ik31wZ31Ar1J326b2Pl2aM31nV2BB24b32nD315j315L32L6181k22B315D31kb21O32Vs2aC2Wc31IS31yF31pV32jr32gP320n32oh32Fq335w312G33dW2BW24q32LO21U31XH1M21H32ii31ZT31nL338931nn32cZ25b32rE2bF1A1n22L339T32fI31Ah32201G2ej326g32G91m23N328n22e32kW1g21921x2yd22632nk1331yE1p2122181J1P320V32vZ31N7318n1T318p318r318T1823232FT330A322p1121L33bw2XD31W431yu2xH32wS2xd2F31P1J25A26728p2yF32yx336T32zv24832V427826826725r26r31Yx323L1923j2W12vA27c1221k31Kl27d2do28324s24s27g314i27A2Ij2dO29l33052iA27625f25f2iA2gU2tv2iA2e926E26E2zf1726j26j31cW1825Z2y831Cz192372372Ia2GJ24G24G2ia2dW2252H42NH2it2im2nH2IY23N312k2Nh2jq31sg2Kx26s26S2Nl1G2242242iA2M42472472Ia2Do2I82iA2NV2d62iA2fk23C23C2ia28t23l2u12nH2Oi2j52Ia28927I27Q2DO2Pl33IA2iA2PP21p32if2NH2pT25B25B2Ia2Gb24L24l2iA2SI2Nn1I2So2W12Nh2st2612612iA2Sy2gb2iA2T326c26c2Ia2g826T26T2ia28625u25u2iA1Z1z26B26B2ia21021024z24Z2iA211313B29h2DO2122122702702IA32Jv317G2Ia323W1a31e82nh21521532qY2IA2i82mX2IA336522s22S2Ia2I525C25C2Ia2Ij24T319k2nh21a32l922D2IA28h23q23q2Ia2j82vz2dO21d21d22o22o2Ia331n23t23T2iA2j52282Vo2dO21G21G25825827G31HC27a33Ms33hM1321k21K33hp142u533ht1525I25i33hw1624P24P33i023P2Ig2ZI182502502iA2g026526533Ic1A33Mf33ig1B26L26L2IA31012Km33IN1d25k25K2iA2kw314m2kx31e12DO2fO25H25H33J11H24c24c33J51i25r25R33j81J25l25l33JB1k31Hs33JP1i28t23e23e2iA2oI2TY2Do28923233DZ33JQ1o24F24F33JT1p22X22x2ia2Pt25525533K11R336533K51s22Q31Au2nH2SO2542542ia2st31EQ2dO2sy25325333ki1w2492Cq2Nh2g822622633kq1y24024033KU1Z32yE33kZ21026026033l421133m42ia33L933L033LD21322U22u33LG21423z23Z2Ia33Ll24E24e33Lo21624h24h33lr21724224233lv218331N33Lz21921S21s2ia33M425S25S33M721B26o28F2Nh2J82662662ia33MF33jo2Nh331N23o23o33MN21F21l21l2iA33ms25g25g33mw22127Z33MZ2dP1325X25X33n433L533N723m23M33nb2Pl33i031ia33i431f431ii33kv33NQ31gX2Do2DW22R22R33Nx1c2362362iA2iY23523533o41e26y26Y2ia2K42EA2nh2fo26p26P33Od28H33OH25j25J33Ol23x23X33op25625633jF1L26F26F33ox1m33ll33jm1N330m2Ia2pL2VT2dO2pp21z21z33pc31q4312z2do2Gb24V24v33pj2412412IA2So23s23s33Pr1u2Ij33KF1v2U32Do2T325W25W33kM1x2qc33Q621R21R33Qa2Zh2Do33L027327333qH32Jv33QK2FH2dS2dO32JV22n22n33QR25Y25Y33qV2152482B433J6216313S2nH336526x26X33r72ST33RA26g26G33Re21a1F1E33os28H22322333MB21C22v22V33Rq21d31UN33mj21E317s33rX26R26R33S121G22E22e33mw2202Bz1233S829L25925933n426A26A33N722M31Nz2ns2EA28431CK24k24k33I424J24J33NM1924Y24Y33nq31FN33Ss1b329T33Sw23I23I33T01d31ID33T422Y22Y33T82Fb2TF33TB1g24q24q33Od31UQ33oH23923933ol28633oP26u26u33Tq24324333TU33L933Tx33Mh33u01o24M24M33P822W22w33U726V26V33pg25225233pJ25N25n33uh1t26M26m33ul2si33UO23w23W33pY21V21v33uV26826833q623d23d33qa23Y23y33QD24N24N33qH26i26i33V924r24R33qN31cJ320n21426z26Z33VJ2OF33QZ24u24u33r32J833r7313u2Nh2ij23U23U33vZ2Nf33rI24D24D33W726426433WB26k32PB2Do331n26W26w33rx26926933wK23V23v33Mw2271433MY21g33n023a23a33mW2261527A2gG313E33MD31Pe323w2YY2Mr2Q731pj16341b2ZL327Y33Hy27833i62FQ21W22m1833oN2M125A24O31UG2SW2gf31SQ1i2Gj22t22t341n22L1b33OJ341N22I2L527Q2dD23023E31U62DO2Iy341h31472dK2Jq2f42pW2It2RS21r31032It2F431ek318L2is1C33ms27G1u31r72hu31HV2F22GJ2U01614341M1033TS341n22A14341R2LM21j26225O31P72iO2Gu29l2qf25Q25Q27g2t927631uu21W343C25d25D2M131DG31Cd1i21w22b15343W2M124t25731CA3441228163445343F23M2442Ek344122932E131JD2dd25J25t2eu3441341P314G343f24j25131UG344122n192Nc2m12ly2hd344122K1a33oR343f23n2452hU3441342434572DD25o26231E734413428345e21j22C21u342E21w22J1d24x24X2M122P23B31TZ344122G1E345t2m125W25E2K1344122h1f33YG343F32MH2Lr344121y1G343e31Qm1a2mU1g344121z2yI28p2dD31hr2z22M4344121W31Pe2M122422I2do347031KW338N346P21J2ex2O2344121U31W4347421J1X31t7344121V1l31P331o632XW32jo344121s1m347i25h25v2OP344121t1N2q9341N2261O233233313231pv2pp2Yy2pT347033D623g23g33pJ26d26d33yx22z22Z31cn2Fu2pT2so2ff21n2s71p2pz2Io2pT28t33UA1R3489348B348D33pN1T234234348H2tj33ch32mL21C348M348431SX2PS312P33d53488348a2NH2si348c33yX22h318G2dO2ST27127133uO349n33pY349q33Q21x349s2MZ348i1q2G8348l348n349j2Sw348R33B8349d348W33yX24a24a3492348j349534971P23F23F34a3349B348t348v349F1s349H348Y26326333Ul349s33Pu1V34at1I2t334aw2G8349V2pw2pT349Z3496348N34AQ34Ai2Fk34aK349e2do349g348X2Do2So27227233HI2LE2St31t01i2sY22G22g33Py23r23r33MW2my2ST2T3349W34932sT34A02pP2Jk34Ai2oi34ba34A7348Y2212AZ33KB1u21x21X33uO26N26N33py24B24b27G324S2lM1X2Dn1I28625p25P33Qa2K72w1313e33Qm2l0349333l034C11p2Uh348Q2Pu1M34c634Am34aO34BF337r32Ze34cb341h34Au24I24i33PY23k23K34cl32m72tC341e28621M33hc2do33KV342h34CX21034AB1Q34D134B52pP31D01i2pt2dJ2W12io2Gb34872sI34Al34dB34Da1i2st26h26h34922gB2sT1122722D328J348o2tO314I2Pt2dw348t24W24W33pJ21W2Cm34db22C22c33Ul26Q26q33UO25M25m33PY22022033uV34982dO286311P33QA21H32KK2Nh33L02t333QH21n335u27L31Hc2pt33l52vv21B1a2gb313M2zE2Yx2zr2M02NK2E6314G2WM2zp2pl2F52F733kH3499102SI31uU33k81T2272vI2Yz313K34BL31bK31f52m534842iD2Zv2PT31dM32Fa2gC2IV2822T92sI34EL2io34gf1634db25a25A31381Z219182St2VZ34gP1034gR2D334Gt2yS33kh34Gy2w834H032651U31Of27K"),(#A-(90));local function o(l,e,...)if(l==894681913)then return(n(n(((e)-35143)-382771,944497),848954));elseif(l==47614975)then return((n(n(e,573839),259726))-268663);elseif(l==21962635)then return(n(n(n(n(e,526781),993081),858608),239645));elseif(l==360146896)then return(n((n(n(e,629108),97602))-852064,389393));elseif(l==162188396)then return(n(n(((n(e,299956))-771685)-341198,168521),980249));elseif(l==463259104)then return((((n(e,9752))-808982)-338307)-183299);elseif(l==529403661)then return((n((e)-522275,892685))-356717);elseif(l==801841676)then return((n(n(n(e,247307),754289),745446))-128385);elseif(l==828599311)then return(n(n(n(n(e,965100),839702),799003),675150));elseif(l==379391100)then return(n(n(n(n(n(e,414540),725958),378094),865665),57567));else end;end;local r=e[((#{494;858;631;(function(...)return 861,563;end)()}+862276727))];local t=e[((#{861;828;285;(function(...)return 815;end)()}+917987936))];local c=e[(485781281)];local y=e[(504524837)];local g=e[(531325268)];local D=e[(650126712)];local u=e[((797531286-#("LuraphDeobfuscator.zip (oh god DMCA incoming everyone hide)")))];local o=e[((628000243-#("@everyone designs are done. luraph website coming.... eta JULY 2020")))];local function f()local e=n(p(x,i,i),l);l=e%o;i=(i+t);return(e);end;local function a()local t,e,a,c=p(x,i,i+c);t=n(t,l);l=t%o;e=n(e,l);l=e%o;a=n(a,l);l=a%o;c=n(c,l);l=c%o;i=i+r;return((c*y)+(a*D)+(e*o)+t);end;local function c()local t,e=p(x,i,i+u);t=n(t,l);l=t%o;e=n(e,l);l=e%o;i=i+u;return((e*o)+t);end;local function r(n,e,l)if(l)then local e=(n/u^(e-t))%u^((l-t)-(e-t)+t);return(e-(e%t));else local e=u^(e-t);return(((n%(e+e)>=e)and(t))or(g));end;end;local b="\35";local function A(...)return({...}),E(b,...);end;local function Y(...)local A=e[((#{300;597;421;950;(function(...)return 841,590,35,377,...;end)(380)}+862276723))];local W=e[((604998135-#("Luraph v12.6 has been released!: changed absolutely fucking nothing but donate to my patreon!")))];local Y=e[(369604155)];local M=e[((182613754-#("Perth Was here impossible ikr")))];local t=e[(531325268)];local U=e[((505054845-#("psu 34567890fps, luraph 1fps, xen 0fps")))];local D=e[((353560089-#("If you see this, congrats you're gay")))];local k=e[((#{}+384816555))];local X=e['B74CTG'];local d=e[(816251037)];local w=e[((#{566;775;554;(function(...)return 376,820;end)()}+628000171))];local R=e[(136164326)];local Q=e[(676801559)];local o=e[(917987940)];local H=e[(50163337)];local y=e[((#{500;191;118;(function(...)return 916;end)()}+797531223))];local T=e.d9H7mI;local F=e[(412453858)];local C=e['VOt2GuE'];local I=e[(164395133)];local b=e[(485781281)];local g=e[(871924207)];local E=e['RqsMc4'];local function _(...)local e=({});local u=({});local v=({});local q=c(l);for e=t,a(l)-o,o do v[e]=_();end;local _=f(l);for c=t,a(l)-o,o do local s=f(l);if(s%d==o)then local l=f(l);e[c]=(l~=t);elseif(s%d==t)then while(true)do local l=a(l);e[c]=h(x,i,i+l-o);i=i+l;break;end;elseif(s%d==W)then while(true)do local a=a(l);if(a==t)then e[c]=('');break;end;if(a>R)then local t,f=(''),(h(x,i,i+a-o));i=i+a;for e=o,#f,o do local e=n(p(h(f,e,e)),l);l=e%w;t=t..m[e];end;e[c]=t;else local o,t=(''),({p(x,i,i+a-o)});i=i+a;for t,e in S(t)do local e=n(e,l);l=e%w;o=o..m[e];end;e[c]=o;end;break;end;elseif(s%d==g)then while(true)do local n=a(l);local l=a(l);local a=o;local i=(r(l,o,M)*(y^F))+n;local n=r(l,d,H);local l=((-o)^r(l,F));if(n==t)then if(i==t)then e[c]=B(l*t);break;else n=o;a=t;end;elseif(n==I)then e[c]=(i==t)and(l*(o/t))or(l*(t/t));break;end;local l=G(l,n-T)*(a+(i/(y^U)));e[c]=l%o==t and B(l)or l break;end;else e[c]=nil end;end;local n=a(l);for e=t,n-o,o do u[e]=({});end;for B=t,n-o,o do local n=f(l);if(n~=t)then n=n-o;local i,p,h,s,m,d=t,t,t,t,t,t;local x=r(n,o,b);if(x==o)then h=(f(l));d=(c(l));i=(a(l));elseif(x==y)then h=(f(l));d=(c(l));i=u[(a(l))];elseif(x==g)then h=(f(l));s=(c(l));d=(c(l));i=(a(l));p=({});for e=o,s,o do p[e]=({[t]=f(l),[o]=c(l)});end;elseif(x==t)then h=(f(l));s=(c(l));d=(c(l));i=(c(l));elseif(x==b)then h=(f(l));s=(c(l));d=(c(l));i=u[(a(l))];elseif(x==D)then end;if(r(n,D,D)==o)then s=e[s];end;if(r(n,E,E)==o)then m=u[a(l)];else m=u[B+o];end;if(r(n,g,g)==o)then i=e[i];end;if(r(n,A,A)==o)then d=e[d];end;if(r(n,C,C)==o)then p=({});for e=o,f(),o do p[e]=a();end;end;local e=u[B];e['n0N']=h;e["Pyp"]=p;e["U9X"]=d;e[k]=s;e['QqzD']=m;e[Q]=i;end;end;return({[X]=v;[-Y]=e;['FOY0BpA']=_;['Z6b3OD']=q;[-835690.6316519667]=t;['o6ovFe9YaT']=u;});end;return(_(...));end;local function m(e,f,r,...)local l=0;local y=e[912477];local n=e[-917803];local n=e['o6ovFe9YaT'];local a=e["FOY0BpA"];local c=e["Z6b3OD"];return(function(...)local h=n[l];local e=(949421308);local u=-(1);local i=133154;local x=(E(b,...)-1);local B="n0N";local D={...};local o='QqzD';local l={};local g=({});local w='Pyp';local t=92460;local n='U9X';local p={};local e=(true);local e=1;for e=0,x,e do if(e>=a)then p[e-a]=D[e+1];else l[e]=D[e+1];end;end;local x=x-a+1;repeat local e=h;local a=e[B];h=e[o];if(a<=43)then if(a<=21)then if(a<=10)then if(a<=4)then if(a<=1)then if(a>0)then if(l[e[n]])then h=e[t];end;elseif(a<1)then l[e[n]]=e[t];end;elseif(a<=2)then local n=e[n];local i=l[n+2];local o=l[n]+i;l[n]=o;if(i>0)then if(o<=l[n+1])then h=e[t];l[n+3]=o;end;elseif(o>=l[n+1])then h=e[t];l[n+3]=o;end;elseif(a==3)then if(l[e[n]]~=e[i])then h=e[t];end;elseif(a<=4)then l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]]-l[e[i]];e=e[o];l[e[n]]=l[e[t]]*l[e[i]];e=e[o];e=e[o];end;elseif(a<=7)then if(a<=5)then elseif(a>6)then local n=e[n];local o,e=A(l[n]());u=e+n-1;local e=0;for n=n,u do e=e+1;l[n]=o[e];end;for e=u+1,c do l[e]=nil;end;elseif(a<7)then do return(l[e[n]]);end;end;elseif(a<=8)then l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=(e[t]~=0);e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=d(256);e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=(e[t]~=0);e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=d(256);e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a>9)then local e=e[n];l[e](l[1+e]);for e=e,c do l[e]=nil;end;elseif(a<10)then l[e[n]]=#l[e[t]];end;elseif(a<=15)then if(a<=12)then if(a==11)then local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]]+e[i];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=d(e[t]);e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a<=12)then l[e[n]]=d(256);end;elseif(a<=13)then local n=e[n];l[n]=0+(l[n]);l[n+1]=0+(l[n+1]);l[n+2]=0+(l[n+2]);local o=l[n];local i=l[n+2];if(i>0)then if(o>l[n+1])then h=e[t];else l[n+3]=o;end;elseif(o<l[n+1])then h=e[t];else l[n+3]=o;end;elseif(a==14)then l[e[n]]=l[e[t]]-l[e[i]];elseif(a<=15)then local n=e[n];l[n]=l[n](s(l,n+1,e[t]));for e=n+1,c do l[e]=nil;end;end;elseif(a<=18)then if(a<=16)then local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]]+e[i];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=e[t];e=e[o];local i=e[n];l[i]=l[i](s(l,i+1,e[t]));for e=i+1,c do l[e]=nil;end;e=e[o];l[e[n]]=d(e[t]);e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a==17)then local e=e[n];l[e]=l[e](l[e+1]);for e=e+1,c do l[e]=nil;end;elseif(a<=18)then l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=d(e[t]);e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];end;elseif(a<=19)then l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];local a=e[n];l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];e=e[o];elseif(a==20)then l[e[n]]=l[e[t]]*e[i];elseif(a<=21)then e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=l[e[t]]+e[i];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];end;elseif(a<=32)then if(a<=26)then if(a<=23)then if(a==22)then l[e[n]]=l[e[t]][e[i]];elseif(a<=23)then l[e[n]]=l[e[t]]/e[i];end;elseif(a<=24)then l[e[n]]=d(e[t]);elseif(a>25)then l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=l[e[t]]+l[e[i]];e=e[o];e=e[o];elseif(a<26)then l[e[n]]=l[e[t]]+l[e[i]];end;elseif(a<=29)then if(a<=27)then local a=e[n];local r=l[e[t]];l[a+1]=r;l[a]=r[e[i]];e=e[o];local a=(_134);(function()l[e[n]]=f[e[t]];e=e[o];end){};local a=(_130);(function()l[e[n]]=f[e[t]];e=e[o];end){};l[e[n]]=l[e[t]][e[i]];e=e[o];local a=(_185);(function()local n=e[n];l[n]=l[n](l[n+1]);for e=n+1,c do l[e]=nil;end;e=e[o];end){};l[e[n]]=f[e[t]];e=e[o];local a=(_127);(function()l[e[n]]=f[e[t]];e=e[o];end){};l[e[n]]=l[e[t]][e[i]];e=e[o];local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=d(e[t]);e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];local a=(_93);(function()l[e[n]][e[t]]=l[e[i]];e=e[o];end){};l[e[n]]=d(256);e=e[o];local a=(_42);(function()l[e[n]][e[t]]=e[i];e=e[o];end){};local a=(_197);(function()l[e[n]][e[t]]=l[e[i]];e=e[o];end){};l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];local a=(_19);(function()l[e[n]][e[t]]=l[e[i]];e=e[o];end){};l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];local a=(_103);(function()l[e[n]][e[t]]=l[e[i]];e=e[o];end){};l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];e=e[o];elseif(a>28)then l[e[n]]=(e[t]~=0);elseif(a<29)then e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];e=e[o];end;elseif(a<=30)then l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a>31)then l[e[n]][e[t]]=e[i];elseif(a<32)then local t=e[t];local o=l[t];for e=t+1,e[i]do o=o..l[e];end;l[e[n]]=o;end;elseif(a<=37)then if(a<=34)then if(a>33)then l[e[n]]=e[t]-l[e[i]];elseif(a<34)then l[e[n]][e[t]]=l[e[i]];end;elseif(a<=35)then e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local n=e[n];l[n]=l[n](l[n+1]);for e=n+1,c do l[e]=nil;end;e=e[o];e=e[o];elseif(a==36)then l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a<=37)then local c=y[e[t]];local a=e[w];local o={};local t=L({},{__index=function(l,e)local e=o[e];return(e[1][e[2]]);end,__newindex=function(n,e,l)local e=o[e];e[1][e[2]]=l;end;});for e=1,e[i],1 do local n=a[e];if(n[0]==0)then o[e-1]=({l,n[1]});else o[e-1]=({f,n[1]});end;g[#g+1]=o;end;l[e[n]]=m(c,t,r);end;elseif(a<=40)then if(a<=38)then l[e[n]]=f[e[t]];elseif(a==39)then do return(l[e[n]]);end;e=e[o];e=e[o];elseif(a<=40)then local a=e[n];local r=l[e[t]];l[a+1]=r;l[a]=r[e[i]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=d(e[t]);e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];e=e[o];end;elseif(a<=41)then l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a==42)then l[e[n]]=l[e[t]]/l[e[i]];elseif(a<=43)then l[e[n]]=l[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];local i=e[n];l[i]=l[i](s(l,i+1,e[t]));for e=i+1,c do l[e]=nil;end;e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];local n=e[n];l[n](l[1+n]);for e=n,c do l[e]=nil;end;e=e[o];e=e[o];end;elseif(a<=65)then if(a<=54)then if(a<=48)then if(a<=45)then if(a==44)then l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]]+l[e[i]];e=e[o];l[e[n]]=l[e[t]]+l[e[i]];e=e[o];l[e[n]]=l[e[t]]/e[i];e=e[o];l[e[n]]=l[e[t]]-l[e[i]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]]*e[i];e=e[o];l[e[n]]=l[e[t]];e=e[o];for e=e[n],e[t]do l[e]=(nil);end;e=e[o];l[e[n]]=l[e[t]];e=e[o];local a=e[n];l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=l[e[t]]+l[e[i]];e=e[o];e=e[o];elseif(a<=45)then l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];end;elseif(a<=46)then local e=e[n];local o,n=A(l[e](l[e+1]));u=n+e-1;local n=0;for e=e,u do n=n+1;l[e]=o[n];end;elseif(a>47)then for e=e[n],e[t]do l[e]=(nil);end;elseif(a<48)then local n=e[n];local t={l[n](l[n+1]);};local o=e[i];local e=0;for n=n,o do e=e+1;l[n]=t[e];end;for e=o+1,c do l[e]=nil;end;end;elseif(a<=51)then if(a<=49)then l[e[n]]=e[t];e=e[o];local i=(_85);(function()l[e[n]]=e[t];e=e[o];end){};l[e[n]]=e[t];e=e[o];local i=(_132);(function()l[e[n]]=e[t];e=e[o];end){};local i=(_56);(function()l[e[n]]=e[t];e=e[o];end){};l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local i=(_150);(function()l[e[n]]=e[t];e=e[o];end){};local i=(_85);(function()l[e[n]]=e[t];e=e[o];end){};local i=(_0);(function()l[e[n]]=e[t];e=e[o];end){};l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local i=(_11);(function()l[e[n]]=e[t];e=e[o];end){};l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a==50)then l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];e=e[o];elseif(a<=51)then local e=e[n];l[e]=l[e]();end;elseif(a<=52)then l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local a=(_120);(function()local n=e[n];l[n]=l[n](s(l,n+1,e[t]));for e=n+1,c do l[e]=nil;end;e=e[o];end){};local a=(_75);(function()l[e[n]][l[e[t]]]=l[e[i]];e=e[o];end){};local i=(_157);(function()l[e[n]]=d(e[t]);e=e[o];end){};l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];local i=(_136);(function()l[e[n]]=e[t];e=e[o];end){};l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a>53)then l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=f[e[t]];e=e[o];local a=e[n];l[a]=l[a]();e=e[o];l[e[n]]=l[e[t]]-l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];e=e[o];elseif(a<54)then l[e[n]]=f[e[t]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local t=e[n];local a={l[t](l[t+1]);};local i=e[i];local n=0;for e=t,i do n=n+1;l[e]=a[n];end;for e=i+1,c do l[e]=nil;end;e=e[o];e=e[o];end;elseif(a<=59)then if(a<=56)then if(a==55)then l[e[n]]=l[e[t]];elseif(a<=56)then l[e[n]]=e[t]-l[e[i]];e=e[o];l[e[n]]=l[e[t]]*l[e[i]];e=e[o];l[e[n]]=e[t];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=l[e[t]]+l[e[i]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]]/l[e[i]];e=e[o];l[e[n]]=l[e[t]]-e[i];e=e[o];l[e[n]]=e[t];e=e[o];local i=e[n];l[i]=l[i](s(l,i+1,e[t]));for e=i+1,c do l[e]=nil;end;e=e[o];l[e[n]]=l[e[t]];e=e[o];e=e[o];end;elseif(a<=57)then e=e[o];local t=e[n];u=t+x-1;for e=0,x do l[t+e]=p[e];end;for e=u+1,c do l[e]=nil;end;e=e[o];local n=e[n];do return s(l,n,u);end;e=e[o];e=e[o];elseif(a==58)then l[e[n]]=m(y[e[t]],(nil),r);elseif(a<=59)then if(l[e[n]]>=e[i])then h=e[t];end;end;elseif(a<=62)then if(a<=60)then l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a==61)then l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];local a=e[n];local t=l[e[t]];l[a+1]=t;l[a]=t[e[i]];e=e[o];local n=e[n];l[n](l[1+n]);for e=n,c do l[e]=nil;end;e=e[o];e=e[o];elseif(a<=62)then l[e[n]]=l[e[t]][l[e[i]]];end;elseif(a<=63)then l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]]/e[i];e=e[o];l[e[n]]=l[e[t]]-e[i];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=l[e[t]]/e[i];e=e[o];l[e[n]]=l[e[t]]*e[i];e=e[o];l[e[n]]=l[e[t]]-l[e[i]];e=e[o];l[e[n]]=l[e[t]]*e[i];e=e[o];l[e[n]]=l[e[t]]+l[e[i]];e=e[o];e=e[o];elseif(a==64)then l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];local c=e[t];local a=l[c];for e=c+1,e[i]do a=a..l[e];end;l[e[n]]=a;e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];l[e[n]]=d(256);e=e[o];l[e[n]][e[t]]=e[i];e=e[o];l[e[n]][e[t]]=l[e[i]];e=e[o];e=e[o];elseif(a<=65)then local a=(_116);(function()l[e[n]]=f[e[t]];e=e[o];end){};l[e[n]]=l[e[t]][e[i]];e=e[o];local a=(_14);(function()local n=e[n];l[n]=l[n](l[n+1]);for e=n+1,c do l[e]=nil;end;e=e[o];end){};l[e[n]]=l[e[t]]/e[i];e=e[o];local a=e[n];l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=f[e[t]];e=e[o];local a=(_49);(function()l[e[n]]=f[e[t]];e=e[o];end){};local a=(_109);(function()l[e[n]]=l[e[t]][e[i]];e=e[o];end){};local n=e[n];l[n]=l[n](l[n+1]);for e=n+1,c do l[e]=nil;end;e=e[o];e=e[o];end;elseif(a<=76)then if(a<=70)then if(a<=67)then if(a>66)then e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local n=e[n];l[n]=l[n](l[n+1]);for e=n+1,c do l[e]=nil;end;e=e[o];e=e[o];elseif(a<67)then local e=e[n];do return s(l,e,u);end;end;elseif(a<=68)then l[e[n]]=l[e[t]]*l[e[i]];elseif(a>69)then local n=e[n];local o=l[e[t]];l[n+1]=o;l[n]=o[e[i]];elseif(a<70)then l[e[n]]=l[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];local i=e[n];l[i]=l[i](s(l,i+1,e[t]));for e=i+1,c do l[e]=nil;end;e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]];e=e[o];local n=e[n];l[n](l[1+n]);for e=n,c do l[e]=nil;end;e=e[o];e=e[o];end;elseif(a<=73)then if(a<=71)then local n=e[n];local t=l[n];local e,o=0,50*(e[i]-1);for n=n+1,u,1 do t[o+e+1]=l[n];e=e+1;end;elseif(a>72)then if(e[n]>=l[e[i]])then h=e[t];end;elseif(a<73)then l[e[n]]=l[e[t]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=r[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=#l[e[t]];e=e[o];local a=e[n];l[a]=l[a](s(l,a+1,e[t]));for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=l[e[t]][l[e[i]]];e=e[o];local a=e[n];l[a]=l[a](l[a+1]);for e=a+1,c do l[e]=nil;end;e=e[o];l[e[n]]=e[t];e=e[o];local f=e[t];local a=l[f];for e=f+1,e[i]do a=a..l[e];end;l[e[n]]=a;e=e[o];local n=e[n];l[n](s(l,n+1,e[t]));for e=n+1,c do l[e]=nil;end;e=e[o];e=e[o];end;elseif(a<=74)then local n=e[n];u=n+x-1;for e=0,x do l[n+e]=p[e];end;for e=u+1,c do l[e]=nil;end;elseif(a==75)then local n=e[n];local o=e[t];local i=50*(e[i]-1);local t=l[n];local e=0;for o=n+1,o do t[i+e+1]=l[n+(o-n)];e=e+1;end;elseif(a<=76)then l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];end;elseif(a<=82)then if(a<=79)then if(a<=77)then h=e[t];elseif(a==78)then l[e[n]][l[e[t]]]=l[e[i]];elseif(a<=79)then if(not(l[e[n]]))then h=e[t];end;end;elseif(a<=80)then do return;end;elseif(a>81)then l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];elseif(a<82)then local n=e[n];l[n](s(l,n+1,e[t]));for e=n+1,c do l[e]=nil;end;end;elseif(a<=85)then if(a<=83)then l[e[n]]=l[e[t]]-e[i];elseif(a==84)then l[e[n]]=l[e[t]]+e[i];elseif(a<=85)then local o=e[n];local i=e[i];local n=o+2;local o=({l[o](l[o+1],l[n]);});for e=1,i do l[n+e]=o[e];end;local o=o[1];if(o)then l[n]=o;h=e[t];end;end;elseif(a<=86)then l[e[n]]=r[e[t]];elseif(a>87)then l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local a=(_71);(function()local n=e[n];l[n]=l[n](l[n+1]);for e=n+1,c do l[e]=nil;end;e=e[o];end){};l[e[n]]=l[e[t]]/e[i];e=e[o];local a=(_73);(function()local n=e[n];l[n](s(l,n+1,e[t]));for e=n+1,c do l[e]=nil;end;e=e[o];end){};l[e[n]]=f[e[t]];e=e[o];l[e[n]]=f[e[t]];e=e[o];l[e[n]]=l[e[t]][e[i]];e=e[o];local n=e[n];l[n]=l[n](l[n+1]);for e=n+1,c do l[e]=nil;end;e=e[o];e=e[o];elseif(a<88)then l[e[n]]=d(e[t]);e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];l[e[n]]=e[t];e=e[o];e=e[o];end;until false end);end;return m(Y(),{},_())(...);end)(({[((905725299-#("If you see this, congrats you're gay")))]=(((510-#("@everyone designs are done. luraph website coming.... eta JULY 2020"))));[((655660948-#("still waiting for luci to fix the API :|")))]=((119));[(237926952)]=((660));[(628000176)]=((256));[(18466036)]=((135));[(862276732)]=(((#{985;}+3)));[((#{638;571;}+404306735))]=(((912193824-#("this isn't krnl support you bonehead moron"))));["lrRTU"]=(((609-#("concat was here"))));[(757532085)]=((26));fOBmRsV9J=(((#{67;5;918;}+245)));['GXleqdYMvi']=("\101");[(917987940)]=((1));gmetn2G=(((11893-#("I'm not ignoring you, my DMs are full. Can't DM me? Shoot me a email: mem@mem.rip (Business enquiries only)"))));[(531325268)]=((0));[((681453241-#("Bunu yazan tosun... - federal")))]=((930863600));[(891699997)]=(((#{553;753;144;204;(function(...)return 453,404,956,...;end)()}+290)));[((614984007-#("still waiting for luci to fix the API :|")))]=(((#{}+432022386)));[(646484118)]=((8983));["JbhuFTf"]=("\121");[((#{(function(...)return 281,263,605,888;end)()}+432022382))]=("\110");[((818145049-#("guys someone play Among Us with memcorrupt he is so lonely :(")))]=(((43061-#("still waiting for luci to fix the API :|"))));[(797531227)]=(((54-#("I hate this codebase so fucking bad! - notnoobmaster"))));[(420703533)]=((165));[(871924207)]=((5));["hWi4E0ZH"]=((977824893));["d9H7mI"]=(((1052-#("Perth Was here impossible ikr"))));[((#{}+558421880))]=((118));[(930863600)]=("\109");[((300451118-#("If you see this, congrats you're gay")))]=(((#{978;81;446;932;(function(...)return 194,175,793;end)()}+564689229)));['zveHN0']=((259));[(136164326)]=((5000));[(376285118)]=((80028708));[((#{309;560;}+195549364))]=(((6389-#("concat was here"))));[(26575825)]=((518));[((#{878;991;100;862;(function(...)return 343,167;end)()}+634614371))]=(((545362665-#("psu 34567890fps, luraph 1fps, xen 0fps"))));[((#{878;449;137;(function(...)return 260,283,858;end)()}+50163331))]=((31));[((#{912;236;333;}+977824890))]=("\102");[(604783579)]=((775));[(384816555)]=((133154));[(353560053)]=((6));[((#{116;603;69;(function(...)return 234,158,775,...;end)(71,783)}+430484981))]=("\98");[(962786689)]=((12553));[((164395169-#("If you see this, congrats you're gay")))]=((2047));[((564689257-#("psu == femboy hangout")))]=("\100");[((533202951-#("PSU|161027525v21222B11273172751L275102731327523d27f22I27f21o26o24Y21J1827F1X27f1r27F23823a26w1... oh wait")))]=((599));csTeSHfoh=("\97");[((369604171-#("The Voxel is sus")))]=((917803));[(816251037)]=(((88-#("@everyone designs are done. luraph website coming.... eta JULY 2020"))));[(676801559)]=((92460));[((604998161-#("you dumped constants by printing the deserializer??? ladies and gentlemen stand clear we have a genius in the building.")))]=(((#{831;184;}+7)));['T0QfPV']=((831499683));[((912193807-#("When the exploiter is sus")))]=("\111");['RqsMc4']=((8));[((818721466-#("Bunu yazan tosun... - federal")))]=((46908));[(672392612)]=(((#{825;(function(...)return;end)()}+36)));["wiLsUwcU7M"]=(((1430-#("still waiting for luci to fix the API :|"))));[((#{747;}+80028707))]=("\51");RuT96=("\50");[((270084712-#("Wally likes cock")))]=((36));["o0Yra"]=("\114");[(485781281)]=(((#{487;(function(...)return 598,6,796;end)()}-1)));[((835603175-#("this isn't krnl support you bonehead moron")))]=((1550));['B74CTG']=((912477));['rdx0g']=(((7046-#("this isn't krnl support you bonehead moron"))));['nQoWo40']=("\116");[(443350572)]=((243));['XtRYvetZXt']=("\108");['r9jhL8fh']=("\99");[(504524837)]=((16777216));[(998383779)]=((695));["qf97RdeiI"]=("\115");['VOt2GuE']=(((#{(function(...)return 476,0;end)()}+5)));[(503827770)]=(((27568-#("woooow u hooked an opcode, congratulations~ now suck my cock"))));['mUEV1p']=(((115-#("When the exploiter is sus"))));[((#{(function(...)return;end)()}+505054807))]=(((#{835;226;}+50)));[(313502327)]=((430484989));[(344859399)]=((74));Uj2FS=((489489989));['PBiQC5lTq']=((1001));["ZYfVzvia4M"]=("\107");[(650126712)]=((65536));pO9fIa5=((108));[(412453858)]=((32));[((489490005-#("The Voxel is sus")))]=("\112");[(182613725)]=((20));[(545362627)]=("\105");[(831499683)]=("\104");}),...)})do return e end;
|
local PluginDebugService = game:GetService("PluginDebugService")
local Plugin = script.Parent.Parent
local Config = require(Plugin.Data.Config)
local Actions = require(Plugin.Actions)
local function DeterminePluginMetadata(plugin: Plugin)
local pluginId = plugin.Name:match("%d+$")
pluginId = tonumber(pluginId)
return function(store)
if pluginId == nil or plugin.Parent == PluginDebugService then
if plugin.Name:match("codify_dev_%x+") then
return store:dispatch(Actions.SetPluginMetadata({
build = "DEV",
isDevMode = true,
}))
else
-- Likely a local install (itch.io)...
return store:dispatch(Actions.SetPluginMetadata({
build = "STABLE",
}))
end
end
if pluginId == Config.pluginId.canary then
return store:dispatch(Actions.SetPluginMetadata({
build = "CANARY",
}))
end
if pluginId == Config.pluginId.preview then
return store:dispatch(Actions.SetPluginMetadata({
build = "PREVIEW",
}))
end
if pluginId == Config.pluginId.stable then
return store:dispatch(Actions.SetPluginMetadata({
build = "STABLE",
}))
end
store:dispatch(Actions.SetPluginMetadata({
build = "FORK",
}))
end
end
return DeterminePluginMetadata
|
local prototype = require('prototype')
local strings = require('strings')
local tables = prototype {}
function tables.partition (tbl, partsize)
local result = {}
for i = 1, #tbl, partsize do
local part = {}
for j = 1, partsize do
part[j] = tbl[i+j-1]
end
result[#result + 1] = part
end
return result
end
function tables.map (tbl, transform)
local result = {}
if #tbl == 0 then
for k, e in pairs(tbl) do
result[k] = transform(e, k)
end
else
for i, e in ipairs(tbl) do
result[#result + 1] = transform(e, i)
end
end
return result
end
function tables.reduce (tbl, reducer, init)
if #tbl == 0 then
for k, e in pairs(tbl) do
init = reducer(init, e, k)
end
else
for i, e in ipairs(tbl) do
init = reducer(init, e, i)
end
end
return init
end
function tables.filter (tbl, predicate)
local result = {}
if #tbl == 0 then
for k, e in pairs(tbl) do
if predicate(e, k) then
result[k] = e
end
end
else
for i, e in ipairs(tbl) do
if predicate(e, i) then
result[#result + 1] = e
end
end
end
return result
end
--[[
Concatenate two or more tables into a new table.
]]
function tables.concat (tbl, ...)
local result = {}
for _, e in ipairs(tbl) do
result[#result + 1] = e
end
for i = 1, select('#', ...) do
local other = select(i, ...)
for _, e in ipairs(other) do
result[#result + 1] = e
end
end
return result
end
function tables.merge (tbl, ...)
local result = {}
for k, e in pairs(tbl) do
result[k] = e
end
for i = 1, select('#', ...) do
local other = select(i, ...)
for k, e in pairs(other) do
result[k] = e
end
end
return result
end
function tables.skip (tbl, count)
local result = {}
for i = count+1, #tbl do
result[#result + 1] = tbl[i]
end
return result
end
function tables.take (tbl, count)
local result = {}
for i = 1, math.min(#tbl, count) do
result[#result + 1] = tbl[i]
end
return result
end
function tables.get (tbl, path, default)
-- todo numbers
if type(path) ~= 'table' then
path = strings.split(path, '%.')
end
if #path == 0 then
return tbl or default
end
local key = path[1]
local asnum = tonumber(key)
if asnum ~= nil then
key = asnum
end
local value = tbl[key]
local nextPath = tables.skip(path, 1)
--require('debugger')()
return tables.get(value, nextPath, default)
end
function tables.swap (tbl, i1, i2)
local temp = tbl[i1]
tbl[i1] = tbl[i2]
tbl[i2] = temp
-- return tbl[i1], tbl[i2], tbl
end
function tables.collect (iterable)
local result = {}
for v in iterable do
result[#result + 1] = v
end
return result
end
function tables.reverse (tbl)
local acc = {}
for i = #tbl, 1, -1 do
acc[#acc+1] = tbl[i]
end
return acc
end
function tables.padEnd (tbl, minLength, value)
if #tbl < minLength then
for i = #tbl + 1, minLength do
tbl[i] = value
end
end
return tbl
end
function tables.createIndex (tbl)
local index = {}
for i, v in ipairs(tbl) do
index[v] = i
end
return index
end
return tables
|
wrk.method = "POST"
wrk.body = '{"text":"my credit card number is 2970-84746760-9907 345954225667833 4961-2765-5327-5913", "analyzeTemplate":{"fields":[{"name":"CREDIT_CARD"}]} }'
wrk.headers["Content-Type"] = "application/json"
|
--[[
This file contains development-only things that aren't pretty but don't need to be ... xD
--]]
-- Addon global
local TheClassicRace = _G.TheClassicRace
--[[
The /tcr handler, overwrites with a more advanced development mode /tcr
--]]
function TheClassicRace:slashtcr(input)
local action, arg1, arg2, arg3 = self:GetArgs(input, 4)
--[[SCAN]]--
if action == "scan" then
self.scanner:StartScan()
--[[CLASS SYNC]]--
elseif action == "classscan" then
self.classScanner:StartScan()
--[[RESET]]--
elseif action == "reset" then
self.DB:ResetDB()
--[[SHOW FRAME]]--
elseif action == "show" then
self.StatusFrame:Show()
--[[UPDATE FRAME]]--
elseif action == "render" then
self.StatusFrame:Render()
--[[REQUEST UPDATE]]--
elseif action == "update" then
self.Sync:InitSync()
--[[WHOAMI]]--
elseif action == "whoami" then
self.Core:InitMe(arg1, self.Core:MyRealm())
--[[DING name level]]--
elseif action == "ding" then
TheClassicRace:DebugPrint("Forced Ding [" .. arg1 .. "] lvl" .. arg2 .. ".")
self.EventBus:PublishEvent(self.Config.Events.SlashWhoResult, {{
name = arg1,
level = tonumber(arg2),
class = arg3 or "DRUID",
}})
else
self:PPrint("Unknown action: " .. tostring(action))
end
end
|
require 'torch'
require 'image'
require 'paths'
require 'pl'
require 'layers.cudnnSpatialConvolutionUpsample'
NN_UTILS = require 'utils.nn_utils'
DATASET = require 'dataset'
OPT = lapp[[
--save_base (default "logs") directory in which the networks are saved
--save_c2f32 (default "logs")
--G_base (default "adversarial.net")
--D_base (default "adversarial.net")
--neighbours Whether to search for nearest neighbours of generated images in the dataset (takes long)
--scale (default 32) Height of images in the base network.
--grayscale Activates grayscale mode.
--writeto (default "samples") directory to save the images to
--seed (default 1)
--gpu (default 0) GPU to run on
--runs (default 1) How often to sample and save images
--noiseDim (default 100)
--batchSize (default 16)
--aws Run in AWS mode.
]]
-- Deprecated parameters for laplacian pyramid
--[[
--G_c2f32 (default "adversarial_c2f_16_to_32.net")
--D_c2f32 (default "adversarial_c2f_16_to_32.net")
--]]
print(OPT)
if OPT.gpu < 0 then
print("[ERROR] Sample script currently only runs on GPU, set --gpu=x where x is between 0 and 3.")
exit()
end
torch.manualSeed(OPT.seed)
print("Starting gpu support...")
require 'cutorch'
require 'cunn'
torch.setdefaulttensortype('torch.FloatTensor')
math.randomseed(OPT.seed)
torch.manualSeed(OPT.seed)
cutorch.setDevice(OPT.gpu + 1)
cutorch.manualSeed(OPT.seed)
-- Image dimensions
if OPT.grayscale then
IMG_DIMENSIONS = {1, OPT.scale, OPT.scale}
else
IMG_DIMENSIONS = {3, OPT.scale, OPT.scale}
end
-- Initialize dataset
DATASET.nbChannels = IMG_DIMENSIONS[1]
DATASET.setFileExtension("jpg")
DATASET.setScale(OPT.scale)
if OPT.aws then
DATASET.setDirs({"/mnt/datasets/out_aug_64x64"})
else
DATASET.setDirs({"dataset/out_aug_64x64"})
end
-- Main function, generates random images, saves some of them, upscales them via
-- coarse to fine networks, saves again some of them.
function main()
MODEL_G, MODEL_D = loadModels()
--MODEL_G, MODEL_D, MODEL_G_C2F_32, MODEL_D_C2F_32 = loadModels()
MODEL_G = NN_UTILS.activateCuda(MODEL_G)
MODEL_D = NN_UTILS.activateCuda(MODEL_D)
--MODEL_G_C2F_32 = NN_UTILS.activateCuda(MODEL_G_C2F_32)
--MODEL_D_C2F_32 = NN_UTILS.activateCuda(MODEL_D_C2F_32)
print("Sampling...")
for run=1,OPT.runs do
local images = NN_UTILS.createImages(1024, false)
image.save(paths.concat(OPT.writeto, string.format('random256_%04d_base.jpg', run)), toGrid(selectRandomImagesFrom(images, 256), 16))
image.save(paths.concat(OPT.writeto, string.format('random1024_%04d_base.jpg', run)), toGrid(images, 32))
local imagesBest, predictions = NN_UTILS.sortImagesByPrediction(images, false, 64)
local imagesWorst, predictions = NN_UTILS.sortImagesByPrediction(images, true, 64)
local imagesRandom = selectRandomImagesFrom(images, 64)
image.save(paths.concat(OPT.writeto, string.format('best_%04d_base.jpg', run)), toGrid(imagesBest, 8))
image.save(paths.concat(OPT.writeto, string.format('worst_%04d_base.jpg', run)), toGrid(imagesWorst, 8))
image.save(paths.concat(OPT.writeto, string.format('random_%04d_base.jpg', run)), toGrid(imagesRandom, 8))
-- Extract the 16 best images and find their closest neighbour in the training set
if OPT.neighbours then
local searchFor = {}
for i=1,16 do
table.insert(searchFor, imagesBest[i]:clone())
end
local neighbours = findClosestNeighboursOf(searchFor)
image.save(paths.concat(OPT.writeto, string.format('best_%04d_neighbours_base.jpg', run)), toNeighboursGrid(neighbours, 8))
end
-- Deprecated stuff for the laplacian pyramid
--[[
local imagesBestC2F32 = c2f(imagesBest, MODEL_G_C2F_32, MODEL_D_C2F_32, 32)
local imagesWorstC2F32 = c2f(imagesWorst, MODEL_G_C2F_32, MODEL_D_C2F_32, 32)
local imagesRandomC2F32 = c2f(imagesRandom, MODEL_G_C2F_32, MODEL_D_C2F_32, 32)
image.save(paths.concat(OPT.writeto, string.format('best_%04d_c2f_32.jpg', run)), toGrid(imagesBestC2F32, 8))
image.save(paths.concat(OPT.writeto, string.format('worst_%04d_c2f_32.jpg', run)), toGrid(imagesWorstC2F32, 8))
image.save(paths.concat(OPT.writeto, string.format('random_%04d_c2f_32.jpg', run)), toGrid(imagesRandomC2F32, 8))
--]]
xlua.progress(run, OPT.runs)
end
print("Finished.")
end
-- Selects N random images from a tensor of images.
-- @param tensor Tensor of images
-- @param n Number of random images to select
-- @returns List/table of images
function selectRandomImagesFrom(tensor, n)
local shuffle = torch.randperm(tensor:size(1))
local result = {}
for i=1,math.min(n, tensor:size(1)) do
table.insert(result, tensor[ shuffle[i] ])
end
return result
end
-- Searches for the closest neighbours (2-Norm/torch.dist) for each image in the given list.
-- @param images List of image tensors.
-- @returns List of tables {image, closest neighbour's image, distance}
function findClosestNeighboursOf(images)
local result = {}
local trainingSet = DATASET.loadImages(0, 9999999)
for i=1,#images do
local img = images[i]
local closestDist = nil
local closestImg = nil
for j=1,trainingSet:size() do
local dist = torch.dist(trainingSet[j], img)
if closestDist == nil or dist < closestDist then
closestDist = dist
closestImg = trainingSet[j]:clone()
end
end
table.insert(result, {img, closestImg, closestDist})
end
return result
end
-- Converts a table of images as returned by findClosestNeighboursOf() to one image grid.
-- @param imagesWithNeighbours Table of (image, neighbour image, distance)
-- @returns Tensor
function toNeighboursGrid(imagesWithNeighbours)
local img = imagesWithNeighbours[1][1]
local imgpairs = torch.Tensor(#imagesWithNeighbours*2, img:size(1), img:size(2), img:size(3))
local imgpairs_idx = 1
for i=1,#imagesWithNeighbours do
imgpairs[imgpairs_idx] = imagesWithNeighbours[i][1]
imgpairs[imgpairs_idx + 1] = imagesWithNeighbours[i][2]
imgpairs_idx = imgpairs_idx + 2
end
return image.toDisplayTensor{input=imgpairs, nrow=#imagesWithNeighbours}
end
-- Refine upscaled images via coarse to fine networks.
-- @param images List of images.
-- @param G Trained coarse to fine generator model.
-- @param D Trained coarse to fine discriminator model.
-- @param fineSize Intended upscaled size of images.
-- @returns List of refined images
function c2f(images, G, D, fineSize)
local triesPerImage = 10
local result = {}
for i=1,#images do
local imgTensor = torch.Tensor(triesPerImage, images[1]:size(1), fineSize, fineSize)
local img = images[i]:clone()
local height = img:size(2)
local width = img:size(3)
if height ~= fineSize or width ~= fineSize then
img = image.scale(img, fineSize, fineSize)
end
for j=1,triesPerImage do
imgTensor[j] = img:clone()
end
local noiseInputs = torch.Tensor(triesPerImage, 1, fineSize, fineSize)
noiseInputs:uniform(-1, 1)
local diffs = G:forward({noiseInputs, imgTensor})
--diffs:float()
local predictions = D:forward({diffs, imgTensor})
local maxval = nil
local maxdiff = nil
for j=1,triesPerImage do
if maxval == nil or predictions[j][1] > maxval then
maxval = predictions[j][1]
maxdiff = diffs[j]
end
end
local imgRefined = torch.add(img, maxdiff)
table.insert(result, imgRefined)
end
return result
end
-- Blurs a given image.
-- @param img Image tensor
-- @returns Image tensor, blurry image
function blur(img)
local img2 = image.convolve(img:clone(), image.gaussian(3), "same")
return img2
end
-- Converts images to one image grid with set amount of rows.
-- @param images Tensor of images
-- @param nrow Number of rows.
-- @return Tensor
function toGrid(images, nrow)
return image.toDisplayTensor{input=images, nrow=nrow}
end
-- Selects N random images from a tensor of images.
-- @param tensor Tensor of images
-- @param n Number of random images to select
-- @returns List/table of images
function selectRandomImagesFrom(tensor, n)
local shuffle = torch.randperm(tensor:size(1))
local result = {}
for i=1,math.min(n, tensor:size(1)) do
table.insert(result, tensor[ shuffle[i] ])
end
return result
end
-- Loads all necessary models/networks and returns them.
-- @returns G, D
function loadModels()
local file
-- load G base
file = torch.load(paths.concat(OPT.save_base, OPT.G_base))
local G = file.G
-- load D base
if OPT.D_base ~= OPT.G_base then
file = torch.load(paths.concat(OPT.save_base, OPT.D_base))
end
local D = file.D:float()
--[[
-- load G c2f size 32
file = torch.load(paths.concat(OPT.save_c2f32, OPT.G_c2f32))
local G_c2f32 = file.G
-- load D c2f size 32
if OPT.D_c2f32 ~= OPT.G_c2f32 then
file = torch.load(paths.concat(OPT.save_c2f32, OPT.D_c2f32))
end
local D_c2f32 = file.D
--]]
return G, D
--return G, D, G_c2f32, D_c2f32
end
main()
|
local screenWidth, screenHeight = guiGetScreenSize()
local mygun = nil
local rx, ry = guiGetScreenSize()
local nX, nY = 1366, 768
local sX, sY = guiGetScreenSize()
local count = 3
local count2 = 3
local trigger = false
local canFireRockets = false
local startProtect = false
local roundTimer = {}
local theFucker = 15000
local theMarkers = {}
local mark = {}
local takenMarkers = 0
hop = nil
trueSight = false
function startCountdown(interval)
if countdownImage and isElement(countdownImage) then destroyElement(countdownImage) end
if isTimer(hop) then killTimer(hop) end
countdownImage = guiCreateStaticImage((rx/2)-125, (ry/2)-80, 250, 190, "images/3.png", false)
if not interval then interval = 2000 end
hop = setTimer(decrementCountdown, interval, 4)
countdownCount = 3
startProtect = true
end
function decrementCountdown()
countdownCount = countdownCount - 1
if (countdownCount > 0) then
guiStaticImageLoadImage (countdownImage, "images/"..countdownCount..".png")
elseif (countdownCount == 0) then
destroyElement(countdownImage)
countdownImage = guiCreateStaticImage((rx/2)-160, (ry/2)-80, 320, 190, "images/go.png", false)
if isTimer(roundTimer) then killTimer(roundTimer) end
roundTimer = setTimer(finishTrials,theFucker,1)
else
destroyElement(countdownImage)
end
end
theKiller = {}
Trialsg = {}
active = false
suckers = {}
targ = false
local posX = nil
local posY = nil
-- Z-rotation of the spawn
local rotZ = nil
local cameraOffsets = {
[0] = {15,-10},
[90] = {10,15},
[180] = {15,10},
[270] = {-10,-15}
}
--[[
for pro map
local posX = 4931.6982421875
local posY = nil
-- Z-rotation of the spawn
local rotZ = 0
local cameraOffsets = {
[0] = {15,-10},
[90] = {10,15},
[180] = {15,10},
[270] = {-10,-15}
}
]]
fuck = false
addEvent("Trialsclient.prepareRound", true)
function prepareRound(vehicles)
-- init countdown
addEventHandler( 'onClientPreRender', root, cameraAndBlock )
startProtect = true
toggleControl( 'vehicle_left', false );
toggleControl( 'vehicle_right', false );
setPedCanBeKnockedOffBike(localPlayer,false)
fuck = false
startCountdown(1000)
-- spawn protection
for i, vehicle in ipairs(vehicles) do
for _,vehicle2 in ipairs(vehicles) do
if(vehicle ~= vehicle2) then
setElementCollidableWith(vehicle,vehicle2,false)
end
end
end
end
addEventHandler("Trialsclient.prepareRound", root, prepareRound)
addEvent("AddTrialsclientCamera",true)
addEventHandler("AddTrialsclientCamera",root,function(playing)
active = true
suckers = playing
setPedCanBeKnockedOffBike(localPlayer,false)
end)
addEvent("setTrialsclientCamera",true)
addEventHandler("setTrialsclientCamera",root,function()
active = false
trueSight = false
removeEventHandler( 'onClientPreRender', root, cameraAndBlock )
setPedCanBeKnockedOffBike(localPlayer,true)
toggleControl( 'vehicle_left', true );
toggleControl( 'vehicle_right', true );
end)
addEvent("setTrialsNitro",true)
addEventHandler("setTrialsNitro",root,function()
local veh = getPedOccupiedVehicle(localPlayer,0)
if veh then
if not getVehicleUpgradeOnSlot(veh, 8) then -- Check if the vehicle has nitro installed or not
addVehicleUpgrade(veh, 1010) -- Install the nitrous
end
--setVehicleNitroLevel(veh, 1)
--setVehicleNitroActivated(veh, true)
end
end)
addEventHandler("onClientRender", getRootElement(),function()
if getElementDimension(localPlayer) == 5005 then
setPedWeaponSlot(localPlayer,0)
setElementHealth(localPlayer,100)
if not isPedInVehicle(localPlayer) then
if active == true then
dxDrawText("Please wait...\nGame in progress", 0, 0, screenWidth, screenHeight-250, tocolor(255,255,255),2,"default-bold","center","center")
end
end
if isPedInVehicle(localPlayer) then
if theMarkers then
dxDrawText(takenMarkers.."/"..theMarkers, 0, 0, screenWidth, screenHeight+250, tocolor(255,255,255),2,"default-bold","center","center")
end
if isTimer(roundTimer) then
local timeLeft, timeLeftEx, timeTotalEx = getTimerDetails ( roundTimer )
local timeLeft = math.floor(timeLeft / 1000)
if timeLeft > 0 then
dxDrawText ( "Pick the checkpoints in "..tostring(timeLeft).." seconds!", 0, 0, screenWidth, screenHeight+350, tocolor(255,255,255), 1.5, "default", "center", "center" )
end
end
end
for k, theVehicle in ipairs ( getElementsByType ( "vehicle",resourceRoot ) ) do
if getElementDimension(theVehicle) == 5005 then
if ( math.floor( getElementHealth( theVehicle ) ) <= 250 ) then
setVehicleDamageProof( theVehicle, true )
setVehicleEngineState ( theVehicle, false )
setElementHealth(theVehicle,250)
end
end
end
end
end)
addEventHandler ( "onClientVehicleExplode", root,function (atk,wep,loss)
if getElementDimension(source) == 5005 then
cancelEvent()
end
end)
ifWTF = {}
addEventHandler("onClientVehicleDamage", root,
function(attacker, weapon)
if getElementDimension(source) == 5005 then
cancelEvent()
local hp = math.floor(getElementHealth(source))
setElementHealth(source,hp-2)
if math.floor(getElementHealth(source)) <= 250 then
triggerServerEvent("setTrialsVehicleHealth",localPlayer,source,nil)
end
end
end)
addEvent("Trialsclient.gameStopSpawnProtection", true)
function stopSpawnProtection(vehicles)
canFireRockets = true
startProtect = false
end
addEventHandler("Trialsclient.gameStopSpawnProtection", root, stopSpawnProtection)
function gameTick()
end
local roundWinner = false
addEvent("Trialsclient.roundWon", true)
function onRoundWon()
if(getElementDimension(localPlayer) ~= 5005) then return false end
roundWinner = source
addEventHandler("onClientRender", root, renderWinner)
end
addEventHandler("Trialsclient.roundWon", root, onRoundWon)
addEvent("Trialsclient.roundEnd", true)
addEvent("onPlayerExitRoom", true)
function onRoundEnd()
if(roundWinner) then
removeEventHandler("onClientRender", root, renderWinner)
end
roundWinner = false
end
addEventHandler("Trialsclient.roundEnd", root, onRoundEnd)
addEventHandler("onPlayerExitRoom", localPlayer, onRoundEnd)
function renderWinner()
if getElementDimension(localPlayer) == 5005 then
if(isElement(roundWinner)) then
local name = getPlayerName(roundWinner)
dxDrawText("Winner:\n\n"..name, 0, 0, screenWidth, screenHeight, tocolor(math.random(0,255),math.random(0,255),math.random(0,255)),4,"default-bold","center","center")
end
end
end
function findPointFromDistanceRotation(x,y, angle, dist)
local angle = math.rad(angle+90)
return x+(dist * math.cos(angle)), y+(dist * math.sin(angle))
end
addEvent("Trialsclient.playerWasted", true)
function onPlayerWasted(rank, timex, nick,byw)
if byw == "" or byw == nil then
outputChatBox("[ "..rank.." ] "..nick.." | "..timex,0,255,0)
else
outputChatBox("[ "..rank.." ] "..byw.." has killed "..nick.." | "..timex,0,255,0)
end
end
addEventHandler("Trialsclient.playerWasted", root, onPlayerWasted)
addEvent("Trialsclient.freezeCamera", true)
function freezeCamera()
local x,y,z,lx,ly,lz,roll,fov = getCameraMatrix()
setCameraMatrix(x,y,z+50,lx,ly,lz,roll,fov)
end
addEventHandler("Trialsclient.freezeCamera", localPlayer, freezeCamera)
addEvent("loadTrialsMap",true)
addEventHandler("loadTrialsMap",root,function(temp,map)
if temp then
if unloaTrialsap() then
if map == "ThePrime" then
posX = 4931.6982421875
posY = nil
rotZ = 0
theFucker = 20000
elseif map == "SuperPrime" then
posX = nil
posY = -3089
rotZ = 270
theFucker = 20000
elseif map == "HungryRabbit" then
posX = 2596.7
posY = nil
rotZ = 0
theFucker = 20000
end
trueSight = true
--local ob = createObject(3406,3758.67,-3089.04,17.15)
--setElementDimension(ob,5005)
local tob = createObject(16367,4931.63,-2892.5,344,0,0,-80)
setElementDimension(tob,5005)
for k,v in ipairs(temp) do
local obj = createObject(v[1],v[2],v[3],v[4],v[5],v[6],v[7])
setElementDimension(obj, 5005)
setObjectScale(obj,v[8])
--engineSetModelLODDistance ( v[1], 500 )
--if getElementModel(obj) == 8558 then
-- setElementAlpha (obj, 0)
--end
end
outputDebugString("This is trials temp "..#temp)
end
else
outputChatBox("invalid map")
end
end)
function cameraAndBlock()
if getElementDimension(localPlayer) == 5005 then
--if trueSight == true then
local bike = getPedOccupiedVehicle( localPlayer );
if bike then
local x, y, z = getElementPosition( bike );
local rx, ry, rz = getElementRotation( bike );
setElementPosition( bike, posX or x, posY or y, z );
setElementRotation( bike, rx, 0, rotZ );
setCameraMatrix( x + cameraOffsets[rotZ][1], y + cameraOffsets[rotZ][2], z + 10, x, y, z );
end
--end
end
end
--[[
elevatorobject01 = createObject (988, 457.9, -3089, 2.5, 90, 0, 270)
elevatorcol01 = createColSphere (456.2, -3089, 3.2, 3)
setElementDimension(elevatorobject01,5005)
setElementDimension(elevatorcol01,5005)
function elevator01 (theElement,matchingDimensions)
if matchingDimensions then
if theElement == getLocalPlayer() then
destroyElement (elevatorcol01)
setTimer (moveObject, 500, 1, elevatorobject01, 4500, 457.9, -3089, 7, 0 ,0 ,0)
setTimer ( function ()
setTimer (moveObject, 500, 1, elevatorobject01, 4500, 457.9, -3089, 2.5, 0 ,0 ,0)
shadeobject01 = createObject (8558, 448, -3089, 5.4, 0, 0, 0)
setElementAlpha (shadeobject01, 0)
end, 7500, 1)
end
end
end
addEventHandler("onClientColShapeHit", elevatorcol01, elevator01)
]]
function createWires ()
if getElementDimension(localPlayer) == 5005 then
dxDrawLine3D (760, -3089, 39, 760, -3089, 43.5, tocolor (84, 84, 84, 255), 5)
dxDrawLine3D (760, -3089, 43.5, 760, -3039, 43.5, tocolor (84, 84, 84, 255), 5)
dxDrawLine3D (760, -3089, 39, 749.4, -3087.5, 30.4, tocolor (84, 84, 84, 255), 5)
dxDrawLine3D (760, -3089, 39, 749.4, -3090.5, 30.4, tocolor (84, 84, 84, 255), 5)
dxDrawLine3D (760, -3089, 39, 769.9, -3090.5, 36, tocolor (84, 84, 84, 255), 5)
dxDrawLine3D (760, -3089, 39, 769.9, -3087.5, 36, tocolor (84, 84, 84, 255), 5)
end
end
addEventHandler("onClientRender", getRootElement(), createWires)
function unloaTrialsap()
for k, v in ipairs(getElementsByType("object",resourceRoot)) do
if v and isElement(v) then
if getElementDimension(v) == 5005 then
destroyElement(v)
end
end
end
trueSight = false
return true
end
addEvent("loadTrialsMapMarker",true)
addEventHandler("loadTrialsMapMarker",root,function(temp,map)
if temp then
if unloaTrialsapMarker() then
mark = {}
local i = 0
for k,v in ipairs(temp) do
local obj = createMarker(v[2],v[3],v[4],v[1],v[5],math.random(2,255),math.random(2,255),math.random(2,255),255)
setElementDimension(obj, 5005)
i = i+1
outputDebugString(i)
mark[obj] = i
addEventHandler("onClientMarkerHit",obj, hitMarker)
end
takenMarkers = 0
theMarkers = #temp
end
end
end)
function hitMarker(player,dim)
if dim then
if getElementType(player)=="player" then
local vehicle = getPedOccupiedVehicle(player)
if vehicle then
if mark[source] ~= theMarkers then
if isTimer(roundTimer) then
local timeLeft, timeLeftEx, timeTotalEx = getTimerDetails ( roundTimer )
killTimer(roundTimer)
roundTimer = setTimer ( finishTrials, timeLeft+theFucker, 1)
else
roundTimer = setTimer ( finishTrials, theFucker, 1)
end
takenMarkers = takenMarkers+1
mark[source] = nil
destroyElement(source)
else
mark[source] = nil
destroyElement(source)
if isTimer(roundTimer) then
killTimer(roundTimer)
end
forceWinning()
end
end
end
end
end
function forceWinning()
outputChatBox("Won")
end
function finishTrials()
outputChatBox("Lost")
end
function unloaTrialsapMarker()
for k, v in ipairs(getElementsByType("marker",resourceRoot)) do
if v and isElement(v) then
if getElementDimension(v) == 5005 then
destroyElement(v)
end
end
end
return true
end
showModel = {}
addEvent("loadTrialsMapVehicles",true)
addEventHandler("loadTrialsMapVehicles",root,function(temp,map)
if temp then
if unloadTrialsMapVehicles() then
for k,v in ipairs(temp) do
local veh = createVehicle(v[1],v[2],v[3],v[4])
showModel[veh] = true
setElementDimension(obj, 5005)
end
end
end
end)
function unloadTrialsMapVehicles()
for k, v in ipairs(getElementsByType("vehicle",resourceRoot)) do
if v and isElement(v) then
if getElementDimension(v) == 5005 and showModel[v] then
destroyElement(v)
showModel[v] = nil
end
end
end
return true
end
|
local API_NPC = require(script:GetCustomProperty("API_NPC"))
local API_DS = require(script:GetCustomProperty("APIDifficultySystem"))
local API_K = require(script:GetCustomProperty("APIKnockback"))
local API_RE = require(script:GetCustomProperty("APIReliableEvents"))
local RANGE = 0.0 -- This spell doesn't care where the player target is
local COOLDOWN = 13.0
local MAX_OFFSET_RADIUS = 600.0
local RADIUS = 2000.0
local targets = {}
function GetPriority(npc, taskHistory)
if API_DS.GetDifficultyLevel() > 3 then
return 1.0
else
return 0.0
end
end
function OnTaskStart(npc, threatTable)
function GetRandomPointInCircle(center, radius)
local t = 2 * math.pi * math.random()
local u = math.random() + math.random()
local r = radius * (1.0 - math.abs(u - 1.0))
return center + r * Vector3.New(math.cos(t), math.sin(t), 0.0)
end
local targetPlayer = API_NPC.GetRandomCharacterInThreatTable(threatTable)
API_NPC.LookAtTargetWithoutPitch(npc, targetPlayer:GetWorldPosition())
local rayStart = GetRandomPointInCircle(targetPlayer:GetWorldPosition(), MAX_OFFSET_RADIUS)
local rayEnd = rayStart - Vector3.UP * 300.0
local hitResult = World.Raycast(rayStart, rayEnd, {ignorePlayers = true})
targets[npc] = rayEnd
if hitResult then
targets[npc] = hitResult:GetImpactPosition()
end
API_RE.BroadcastToAllPlayers("V", targets[npc])
return 1.0
end
function OnTaskEnd(npc, interrupted)
if not interrupted then
API_K.AreaKnockTowards(targets[npc], RADIUS, 120.0)
end
targets[npc] = nil
end
API_NPC.RegisterTaskServer("small_caster_elemental_vortex", RANGE, COOLDOWN, GetPriority, OnTaskStart, OnTaskEnd)
|
--[[Analytics - wrapper for AnalyticsService
Supports the same functions as AnalyticsService, except:
- customData must be a table or nil (it cannot be a string/number)
- customData will always have SessionId added to it
(the specified player's session id, or the server's if no player was specified)
Additional API:
.PlayerAdded:Event(player)
.PlayerRemoving:Event(player)
If you intend to use Analytics, be sure to use the events above instead of Players.PlayerAdded/PlayerRemoving to ensure that the session id exists.
]]
local PRINT_STUDIO_ANALYTICS = false
local HttpService = game:GetService("HttpService")
local function newGuid()
return HttpService:GenerateGUID(false):gsub("-", "")
end
local serverSessionId = newGuid()
local playerSessionId = {} --[player] = guid
local Analytics = {}
local Players = game:GetService("Players")
local playerAdded = Instance.new("BindableEvent")
Analytics.PlayerAdded = playerAdded.Event
Players.PlayerAdded:Connect(function(player)
playerSessionId[player] = newGuid()
playerAdded:Fire(player)
end)
local playerRemoving = Instance.new("BindableEvent")
Analytics.PlayerRemoving = playerRemoving.Event
Players.PlayerRemoving:Connect(function(player)
playerRemoving:Fire(player)
playerSessionId[player] = nil
end)
local isStudio = game:GetService("RunService"):IsStudio()
Analytics.Enabled = not isStudio
local genHandler
if isStudio then
genHandler = PRINT_STUDIO_ANALYTICS
and function(name) return function(...) print("Analytics." .. name, ...) end end
or function() return function() end end
else
local AnalyticsService = game:GetService("AnalyticsService")
genHandler = function(name)
local action = AnalyticsService[name]
return function(...)
action(AnalyticsService, ...)
end
end
end
-- Wrap each AnalyticsService function so that custom data can be mutated to automatically include the relevant session id
local handle = {}
for _, name in ipairs({"FireCustomEvent", "FireInGameEconomyEvent", "FireLogEvent", "FirePlayerProgressionEvent"}) do
handle[name] = genHandler(name)
end
local function setup(name, mutateArgs)
local handler = genHandler(name)
Analytics[name] = function(self, ...)
handler(mutateArgs(...))
end
end
local function handleCustomData(player, customData)
customData = customData or {}
if type(customData) ~= "table" then error("customData must be a table", 4) end
customData.SessionId = player and playerSessionId[player] or serverSessionId
return customData
end
setup("FireCustomEvent", function(player, eventCategory, customData)
return player, eventCategory, handleCustomData(player, customData)
end)
setup("FireInGameEconomyEvent", function(player, itemName, economyAction, itemCategory, amount, currency, location, customData)
return player, itemName, economyAction, itemCategory, amount, currency, location, handleCustomData(player, customData)
end)
setup("FireLogEvent", function(player, logLevel, message, debugInfo, customData)
return player, logLevel, message, debugInfo, handleCustomData(customData)
end)
setup("FirePlayerProgressionEvent", function(player, category, progressionStatus, location, statistics, customData)
return player, category, progressionStatus, location, statistics, handleCustomData(customData)
end)
return Analytics
|
-- is Ethereal mod installed?
local eth = minetest.get_modpath("ethereal") or nil
-- Banana
if eth then
minetest.register_alias("farming_plus:banana_sapling", "ethereal:banana_tree_sapling")
minetest.register_alias("farming_plus:banana_leaves", "ethereal:bananaleaves")
minetest.register_alias("farming_plus:banana", "ethereal:banana")
else
minetest.register_alias("farming_plus:banana_sapling", "default:sapling")
minetest.register_alias("farming_plus:banana_leaves", "default:leaves")
minetest.register_alias("farming_plus:banana", "default:apple")
end
-- Carrot
minetest.register_alias("farming_plus:carrot_seed", "farming:carrot")
minetest.register_alias("farming_plus:carrot_1", "farming:carrot_1")
minetest.register_alias("farming_plus:carrot_2", "farming:carrot_4")
minetest.register_alias("farming_plus:carrot_3", "farming:carrot_6")
minetest.register_alias("farming_plus:carrot", "farming:carrot_8")
-- Cocoa
minetest.register_alias("farming_plus:cocoa_sapling", "farming:cocoa_beans")
minetest.register_alias("farming_plus:cocoa_leaves", "default:leaves")
minetest.register_alias("farming_plus:cocoa", "default:apple")
minetest.register_alias("farming_plus:cocoa_bean", "farming:cocoa_beans")
-- Orange
minetest.register_alias("farming_plus:orange_1", "farming:tomato_1")
minetest.register_alias("farming_plus:orange_2", "farming:tomato_4")
minetest.register_alias("farming_plus:orange_3", "farming:tomato_6")
minetest.register_alias("farming_plus:orange", "farming:tomato_8")
if eth then
minetest.register_alias("farming_plus:orange_item", "ethereal:orange")
minetest.register_alias("farming_plus:orange_seed", "ethereal:orange_tree_sapling")
else
minetest.register_alias("farming_plus:orange_item", "default:apple")
minetest.register_alias("farming_plus:orange_seed", "default:sapling")
end
-- Potato
minetest.register_alias("farming_plus:potato_item", "farming:potato")
minetest.register_alias("farming_plus:potato_1", "farming:potato_1")
minetest.register_alias("farming_plus:potato_2", "farming:potato_2")
minetest.register_alias("farming_plus:potato", "farming:potato_3")
minetest.register_alias("farming_plus:potato_seed", "farming:potato")
-- Pumpkin
minetest.register_alias("farming:pumpkin_seed", "farming:pumpkin_slice")
minetest.register_alias("farming:pumpkin_face", "farming:pumpkin")
minetest.register_alias("farming:pumpkin_face_light", "farming:jackolantern")
minetest.register_alias("farming:big_pumpkin", "farming:pumpkin")
minetest.register_alias("farming:big_pumpkin_side", "air")
minetest.register_alias("farming:big_pumpkin_corner", "air")
minetest.register_alias("farming:big_pumpkin_top", "air")
minetest.register_alias("farming:scarecrow", "farming:pumpkin")
minetest.register_alias("farming:scarecrow_bottom", "default:fence_wood")
minetest.register_alias("farming:scarecrow_light", "farming:jackolantern")
minetest.register_alias("farming:pumpkin_flour", "farming:pumpkin_dough")
-- Rhubarb
minetest.register_alias("farming_plus:rhubarb_seed", "farming:rhubarb")
minetest.register_alias("farming_plus:rhubarb_1", "farming:rhubarb_1")
minetest.register_alias("farming_plus:rhubarb_2", "farming:rhubarb_2")
minetest.register_alias("farming_plus:rhubarb", "farming:rhubarb_3")
minetest.register_alias("farming_plus:rhubarb_item", "farming:rhubarb")
-- Strawberry
if eth then
minetest.register_alias("farming_plus:strawberry_item", "ethereal:strawberry")
minetest.register_alias("farming_plus:strawberry_seed", "ethereal:strawberry")
minetest.register_alias("farming_plus:strawberry_1", "ethereal:strawberry_1")
minetest.register_alias("farming_plus:strawberry_2", "ethereal:strawberry_3")
minetest.register_alias("farming_plus:strawberry_3", "ethereal:strawberry_5")
minetest.register_alias("farming_plus:strawberry", "ethereal:strawberry_7")
else
minetest.register_alias("farming_plus:strawberry_item", "farming:raspberries")
minetest.register_alias("farming_plus:strawberry_seed", "farming:raspberries")
minetest.register_alias("farming_plus:strawberry_1", "farming:raspberry_1")
minetest.register_alias("farming_plus:strawberry_2", "farming:raspberry_2")
minetest.register_alias("farming_plus:strawberry_3", "farming:raspberry_3")
minetest.register_alias("farming_plus:strawberry", "farming:raspberry_4")
end
-- Tomato
minetest.register_alias("farming_plus:tomato_seed", "farming:tomato")
minetest.register_alias("farming_plus:tomato_item", "farming:tomato")
minetest.register_alias("farming_plus:tomato_1", "farming:tomato_2")
minetest.register_alias("farming_plus:tomato_2", "farming:tomato_4")
minetest.register_alias("farming_plus:tomato_3", "farming:tomato_6")
minetest.register_alias("farming_plus:tomato", "farming:tomato_8")
-- Weed
minetest.register_alias("farming:weed", "default:grass_2")
|
object_tangible_loot_creature_loot_collections_space_engine_mark_02_incom = object_tangible_loot_creature_loot_collections_space_shared_engine_mark_02_incom:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_space_engine_mark_02_incom, "object/tangible/loot/creature/loot/collections/space/engine_mark_02_incom.iff")
|
Config = Config or {}
Config.MinimumDrugSalePolice = 2
local StringCharset = {}
local NumberCharset = {}
for i = 48, 57 do table.insert(NumberCharset, string.char(i)) end
for i = 65, 90 do table.insert(StringCharset, string.char(i)) end
for i = 97, 122 do table.insert(StringCharset, string.char(i)) end
Config.RandomStr = function(length)
if length > 0 then
return Config.RandomStr(length-1) .. StringCharset[math.random(1, #StringCharset)]
else
return ''
end
end
Config.RandomInt = function(length)
if length > 0 then
return Config.RandomInt(length-1) .. NumberCharset[math.random(1, #NumberCharset)]
else
return ''
end
end
Config.Products = {
[1] = {
name = "weed_white-widow",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 1,
minrep = 0,
},
[2] = {
name = "weed_skunk",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 2,
minrep = 20,
},
[3] = {
name = "weed_purple-haze",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 3,
minrep = 40,
},
[4] = {
name = "weed_og-kush",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 4,
minrep = 60,
},
[5] = {
name = "weed_amnesia",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 5,
minrep = 80,
},
[6] = {
name = "weed_white-widow_seed",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 6,
minrep = 100,
},
[7] = {
name = "weed_skunk_seed",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 7,
minrep = 120,
},
[8] = {
name = "weed_purple-haze_seed",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 8,
minrep = 140,
},
[9] = {
name = "weed_og-kush_seed",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 9,
minrep = 160,
},
[10] = {
name = "weed_amnesia_seed",
price = 15,
amount = 150,
info = {},
type = "item",
slot = 10,
minrep = 180,
},
}
Config.Dealers = {}
Config.CornerSellingDrugsList = {
"weed_white-widow",
"weed_skunk",
"weed_purple-haze",
"weed_og-kush",
"weed_amnesia",
"weed_ak47",
"crack_baggy",
"cokebaggy",
"meth"
}
Config.DrugsPrice = {
["weed_white-widow"] = {
min = 15,
max = 24,
},
["weed_og-kush"] = {
min = 15,
max = 28,
},
["weed_skunk"] = {
min = 15,
max = 31,
},
["weed_amnesia"] = {
min = 18,
max = 34,
},
["weed_purple-haze"] = {
min = 18,
max = 37,
},
["weed_ak47"] = {
min = 18,
max = 40,
},
["crack_baggy"] = {
min = 18,
max = 34,
},
["cokebaggy"] = {
min = 18,
max = 37,
},
["meth"] = {
min = 18,
max = 40,
},
}
Config.DeliveryLocations = {
[1] = {
["label"] = "Stripclub",
["coords"] = {
["x"] = 106.24,
["y"] = -1280.32,
["z"] = 29.24,
}
},
[2] = {
["label"] = "Vinewood Video",
["coords"] = {
["x"] = 223.98,
["y"] = 121.53,
["z"] = 102.76,
}
},
[3] = {
["label"] = "Vinewood Video",
["coords"] = {
["x"] = 223.98,
["y"] = 121.53,
["z"] = 102.76,
}
},
[4] = {
["label"] = "Resort",
["coords"] = {
["x"] = -1245.63,
["y"] = 376.21,
["z"] = 75.34,
}
},
[5] = {
["label"] = "Bahama Mamas",
["coords"] = {
["x"] = -1383.1,
["y"] = -639.99,
["z"] = 28.67,
}
},
}
Config.CornerSellingZones = {
[1] = {
["coords"] = {
["x"] = -1415.53,
["y"] = -1041.51,
["z"] = 4.62,
},
["time"] = {
["min"] = 12,
["max"] = 18,
},
},
}
Config.DeliveryItems = {
[1] = {
["item"] = "weed_brick",
["minrep"] = 0,
},
}
|
local filepath, filename, fileext = string.match(arg[0], "(.-)([^\\]-([^\\%.]+))$")
package.path = filepath .. '../../../libs/?.lua;' .. filepath .. '../?.lua;'.. package.path
require "athena-343-local"
require "fixedtoken"
local suite = TestSuite('test suite for fixedtoken.lua')
suite:add(TestCase('test totalSupply', function()
function system.getCreator()
return "AmhUthrLULUMee46RDcfmBfajd3CK7Lpbgds7xRsAQoLpY32BcFK"
end
constructor()
assertEquals(5000000000000000000, totalSupply() )
end))
suite:add(TestCase('test transfer', function()
local sender = "AmhUthrLULUMee46RDcfmBfajd3CK7Lpbgds7xRsAQoLpY32BcFK"
local receiver = "AmgR34MnJ1XgvVTtL2FudQBp8wQvfP9voHCyYjWcTKcJUEU5FGGu"
function system.getCreator() return sender end
function system.getSender() return sender end
constructor()
transfer(receiver, 7777)
assertEquals(7777, balanceOf(receiver))
end))
suite:run()
|
-- Copyright (c) 2012-2013 Roland Yonaba
-- An implementation of Binary Heaps data structure in pure Lua
--[[
Documentation :
- http://www.algolist.net/Data_structures/Binary_heap/Array-based_int_repr
- http://www.cs.cmu.edu/~adamchik/15-121/lectures/Binary%20Heaps/heaps.html
- http://rperrot.developpez.com/articles/algo/structures/arbres/
--]]
local require = require
local assert = assert
local ipairs = ipairs
local pairs = pairs
local floor = math.floor
local tostring = tostring
local setmetatable = setmetatable
-- Default sorting function.
-- Used for Min-Heaps creation.
local function f_min(a,b) return a < b end
-- Value lookup in a table
local indexOf = function(t,v)
for i = 1,#t do
if t[i] == v then return i end
end
return nil
end
-- Percolates up datum in the heap recursively
local function percolate_up(self,index)
local pIndex
if index > 1 then
pIndex = floor(index/2)
if self._heap[pIndex] then
if not (self.sort(self._heap[pIndex].value,self._heap[index].value)) then
self._heap[pIndex],self._heap[index] = self._heap[index],self._heap[pIndex]
percolate_up(self,pIndex) -- Recursive call from the parent index
end
else
return
end
end
end
-- Percolates down datum in the heap recursively
local function percolate_down(self,index)
local lfIndex,rtIndex,minIndex
lfIndex = 2*index
rtIndex = lfIndex + 1
if rtIndex > self.size then
if lfIndex > self.size then return
else minIndex = lfIndex end
else
if self.sort(self._heap[lfIndex].value,self._heap[rtIndex].value) then
minIndex = lfIndex
else
minIndex = rtIndex
end
end
if not self.sort(self._heap[index].value,self._heap[minIndex].value) then
self._heap[index],self._heap[minIndex] = self._heap[minIndex],self._heap[index]
percolate_down(self,minIndex) -- Recursive call from the newly shifted index
end
end
-- Minimalistic heap class constructor
local function newHeap(class,comp)
return setmetatable({_heap = {},sort = comp or f_min, size = 0},class)
end
-- The heap class
local heap = setmetatable({}, {__call = function(self,...) return newHeap(self,...) end})
heap.__index = heap
-- Checks if a heap is empty
-- Return true or false [boolean]
function heap:empty()
return (self.size==0)
end
-- Gets heap size (the very number of elements stored in the heap)
-- Returns the heap size [number]
function heap:getSize()
return self.size
end
-- Clears the heap
-- Returns nothing [nil]
function heap:clear()
self._heap = {}
self.size = 0
return self
end
-- Returns the left child index of the current index
-- Returned index may not be a valid index in the heap
-- Returns this index [number]
function heap:leftChildIndex(index)
return (2*index)
end
-- Returns the right child index of the current index
-- Returned index may not be a valid index in the heap
-- Returns this index [number]
function heap:rightChildIndex(index)
return 2*index+1
end
-- Returns the parent index of the current index
-- Returned index may not be a valid index in the heap
-- Returns this index [number]
function heap:parentIndex(index)
return floor(index/2)
end
-- Returns the top element in the heap
-- Does not pop the heap
function heap:top()
assert(not self:empty(),'Heap is empty')
return self._heap[1].value,self._heap[1].data
end
-- Inserts a value in the heap as a table {value = value, data = data}
-- <data> Argument is optional and may represent extra information linked to <value> argument.
-- Returns nothing [nil]
function heap:insert(value,data)
self.size = self.size + 1
self._heap[self.size] = {value = value, data = data}
percolate_up(self,self.size)
return self
end
heap.add = heap.insert
-- Pops the first element in the heap
-- Returns this element unpacked: value first then data linked
function heap:pop()
assert(not self:empty(), 'Heap is empty.')
local root = self._heap[1]
self._heap[1] = self._heap[self.size]
self._heap[self.size] = nil
self.size = self.size-1
if self.size>1 then
percolate_down(self,1)
end
return root.value,root.data
end
-- Checks if the given index is valid in the heap
-- Returns the element stored in the heap at that very index [table], otherwise nil. [nil]
function heap:checkIndex(index)
return self._heap[index] or nil
end
-- Pops the first element in the heap
-- Replaces it with the given element and reorders the heap
-- The size of the heap is preserved
function heap:replace(value,data)
assert(not self:empty(), 'heap is empty, use insert()')
local root = self._heap[1]
self._heap[1] = {value = value,data = data}
percolate_down(self,1)
return root.value,root.data
end
-- Resets the heap property regards to the comparison function given as argument (Optional)
-- Returns nothing [nil]
function heap:reset(comp)
self.sort = comp or self.sort
local _heap = self._heap
self._heap = {}
self.size = 0
for i in pairs(_heap) do
self:insert(_heap[i].value,_heap[i].data)
end
return self
end
-- Appends a heap contents to the current one
-- Returns nothing [nil]
function heap:merge(other)
assert(self:isValid(),'Self heap is not a valid heap')
assert(other:isValid(),'Argument is not a valid heap')
assert(self.sort(1,2) == other.sort(1,2),'Heaps must have the same sort functions')
for i,node in ipairs(other._heap) do
self:insert(node.value,node.data)
end
return self
end
-- Shortcut for merging heaps with '+' operator
-- Returns a new heap based on h1+h2 [table]
function heap.__add(h1,h2)
local h = heap()
h:merge(h1)
h:merge(h2)
return h
end
-- Tests if each element stored in a heap is located at the right place
-- Returns true on success, false on error. [boolean]
function heap:isValid()
if self.size <= 1 then return true end
local i = 1
local lfIndex,rtIndex
for i = 1,(floor(self.size/2)) do
lfIndex = 2*i
rtIndex = lfIndex+1
if self:checkIndex(lfIndex) then
if not self.sort(self._heap[i].value,self._heap[lfIndex].value) then
return false
end
end
if self:checkIndex(rtIndex) then
if not self.sort(self._heap[i].value,self._heap[rtIndex].value) then
return false
end
end
end
return true
end
-- Restores the heap property
-- Should be used when a heap was found non-valid
function heap:heap(item)
if (self.size == 0) then return end
if item then
local i = indexOf(self.__heap,item)
if i then
percolate_down(self, i)
percolate_up(self, i)
end
return
end
for i = floor(self.size/2),1,-1 do
percolate_down(self,i)
end
return self
end
-- (Debug utility) Create a string representation of the current
-- Returns this string to be used with print() or tostring() [string]
function heap.__tostring(self)
local out = ''
for k in ipairs(self._heap) do
out = out.. (('Element %d - Value : %s\n'):format(k,tostring(self._heap[k].value)))
end
return out
end
return heap
|
function hello()
print('Hello there!')
end
function goodbye()
print('Goodbye!')
end
function announce(func)
print('About to call the function.')
func()
print('Function called.')
end
announce(hello) -- no parentheses after hello
announce(goodbye) -- no parentheses after goodbye
|
require "moonscript"
require "init"
|
--[[World of Warcraft Login System Part 3]]--
function GasthausTuer2 (event, player, object)
player:SendChatMessageToPlayer(12, 0, "*Klopf* *Klopf* *Klopf*", player)
player:RegisterEvent(function() GasthausTuer3 (event, player, object); end, 2000, 1)
end
function GasthausTuer3 (event, player, object)
player:SendChatMessageToPlayer(1, 0, "Ich glaube der Wirt hat den Schlüssel immer im Gestebuch versteckt.", player)
player:RegisterEvent(function() GoToGetTheKey_Gasthaus (event, player, object); end, 2000, 1)
end
function GoToGetTheKey_Gasthaus (event, player, object)
if (player:GetTeam() == 0) then -- Allianz --
player:SummonGameObject(2873, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(2873, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(2873, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(2873, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
else -- Horde --
player:SummonGameObject(192496, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(192496, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(192496, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(192496, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
end
end
function GasthausTuer_OnClose (event, player, object)
object:SetGoState(1)
player:RemoveItem(56002, 1)
player:SetRooted(false)
end
local function GasthausTuer_OnHello (event, player, object)
player:SetRooted(true)
player:Teleport(735, 1571.803955, 612.343506, 99.763451, 1.053991)
if (player:HasItem(56002) == true) then
object:SetGoState(0)
if (player:GetTeam() == 0) then -- Allianz --
player:SendChatMessageToPlayer(1, 0, "Endlich ich sehe meine Einheit wieder.", player)
player:Teleport(735, 1576.797729, 622.693176, 99.678795, 1.069385)
else -- Horde --
player:SendChatMessageToPlayer(1, 0, "Endlich ich sehe meine Clan wieder.", player)
player:Teleport(735, 1576.797729, 622.693176, 99.678795, 1.069385)
end
player:RegisterEvent(function() GasthausTuer_OnClose (event, player, object); end, 4500, 1)
else
player:SendChatMessageToPlayer(12, 0, "*Rüttel* *Rüttel* *Rüttel*", player)
player:RegisterEvent(function() GasthausTuer2 (event, player, object); end, 2000, 1)
end
end
RegisterGameObjectGossipEvent(900114, 1, GasthausTuer_OnHello)
local function GaesteBuch_OnHello (event, player, object)
player:SetRooted(true)
player:Teleport(735, 1562.926147, 589.085632, 99.775261, 4.234996)
player:SendChatMessageToPlayer(1, 0, "Hier ist ja das drecks Teil.", player)
player:AddItem(56002,1)
if (player:GetTeam() == 0) then -- Allianz --
player:SummonGameObject(2873, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(2873, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(2873, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(2873, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
else -- Horde --
player:SummonGameObject(192496, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(192496, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(192496, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
player:SummonGameObject(192496, 1562.926147, 589.085632, 99.775261, 4.234996, 20)
end
player:SetRooted(false)
end
RegisterGameObjectGossipEvent(900115, 1, GaesteBuch_OnHello)
--⌈ Made by PassCody ⌉--
-- Edit and fixed by Psykko --
-- Monster Script --
--⌊ Written for Kappa Lounge ⌋--
|
#!/usr/bin/env lua
package.path = package.path..";../?.lua"
local glfw = require("moonglfw")
local gl = require("moongl")
local glmath = require("moonglmath")
local new_plane = require("common.plane")
local new_objmesh = require("common.objmesh")
local vec3, vec4 = glmath.vec3, glmath.vec4
local mat3, mat4 = glmath.mat3, glmath.mat4
local pi, rad = math.pi, math.rad
local sin, cos = math.sin, math.cos
local fmt = string.format
local TITLE = "Chapter 4 - Physically based rendering (PBR) shader"
local W, H = 800, 600
-- GLFW/GL initializations
glfw.version_hint(4, 6, 'core')
glfw.window_hint('opengl forward compat', true)
local window = glfw.create_window(W, H, TITLE)
glfw.make_context_current(window)
gl.init()
local angle, speed = 0, pi/6 -- rad, rad/s
local animate = true
glfw.set_key_callback(window, function(window, key, scancode, action)
if key == 'escape' and action == 'press' then
glfw.set_window_should_close(window, true)
elseif key == 'space' and action == 'press' then
animate = not animate
end
end)
local projection
local function resize(window, w, h)
W, H = w, h
gl.viewport(0, 0, w, h)
projection = glmath.perspective(rad(60.0), w/h, 0.5, 100.0)
end
glfw.set_window_size_callback(window, resize)
-- Create the shader program
local vertex_shader = "shaders/pbr.vert"
local fragment_shader = "shaders/pbr.frag"
local prog, vsh, fsh = gl.make_program('vertex', vertex_shader, 'fragment', fragment_shader)
gl.delete_shaders(vsh, fsh)
gl.use_program(prog)
-- Get the locations of the uniform variables
local uniforms = {
"Material.Rough",
"Material.Metal",
"Material.Color",
"ModelViewMatrix",
"NormalMatrix",
"MVP",
}
for i=0,2 do
table.insert(uniforms, fmt("Light[%d].Position", i))
table.insert(uniforms, fmt("Light[%d].L", i))
end
local loc = {}
for _,name in ipairs(uniforms) do loc[name] = gl.get_uniform_location(prog, name) end
-- Initialize the uniform variables
local view = glmath.look_at(vec3(0, 4, 7), vec3(0,0,0), vec3(0,1,0))
resize(window, W, H) -- creates projection
local function set_matrices(model)
local mv = view * model
local normal_mv = mat3(mv):inv():transpose()
gl.uniform_matrix4f(loc["ModelViewMatrix"], true, mv)
gl.uniform_matrix3f(loc["NormalMatrix"], true, normal_mv)
gl.uniform_matrix4f(loc["MVP"], true, projection * mv)
end
local function set_material(rough, metal, color)
gl.uniformf(loc["Material.Rough"], rough) -- float
gl.uniformb(loc["Material.Metal"], metal) -- boolean
gl.uniformf(loc["Material.Color"], color) -- vec3
end
local light_pos = vec4(5.0, 5.0, 5.0, 1.0)
gl.uniformf(loc["Light[0].L"], 45, 45, 45)
gl.uniformf(loc["Light[0].Position"], view*light_pos)
gl.uniformf(loc["Light[1].L"], .3, .3, .3)
gl.uniformf(loc["Light[1].Position"], 0, .15, -1, 0)
gl.uniformf(loc["Light[2].L"], 45, 45, 45)
gl.uniformf(loc["Light[2].Position"], view*vec4(-7, 3, 7, 1))
-- Generate the meshes
local plane = new_plane(20, 20, 1, 1)
local mesh = new_objmesh("../media/spot/spot_triangulated.obj")
-- Prepare the cows' data
local cows = {}
-- Dielectric cows with varying roughness
local num_cows = 9 -- no. of dielectric cows
local cow_base_color = vec3(0.1, 0.33, 0.17)
for i = 1, num_cows do
cows[i] = {
pos = vec3((i-1)*10/(num_cows-1)-5, 0, 0),
rough = i/num_cows,
metal = false,
color = cow_base_color,
}
end
-- Metal cows
local metal_rough = .43
cows[#cows+1] = { pos=vec3(-3.0,0,3), rough=.43, metal=true, color={ 1, .71, .29}} -- gold
cows[#cows+1] = { pos=vec3(-1.5,0,3), rough=.43, metal=true, color={.95, .64, .54}} -- copper
cows[#cows+1] = { pos=vec3( 0.0,0,3), rough=.43, metal=true, color={.91, .92, .92}} -- aluminum
cows[#cows+1] = { pos=vec3( 1.5,0,3), rough=.43, metal=true, color={.542, .497, .449}} -- titanium
cows[#cows+1] = { pos=vec3( 3.0,0,3), rough=.43, metal=true, color={.95, .93, .88}} -- silver
-- Event loop -----------------------------------------------------------------
gl.enable('depth test')
gl.clear_color(0.5, 0.5, 0.5, 1.0)
print("Press space to toggle animation on/off")
local t0 = glfw.now()
while not glfw.window_should_close(window) do
glfw.poll_events()
-- Update
local t = glfw.now()
local dt = t - t0
t0 = t
if animate then
angle = angle + speed*dt
if angle >= 2*pi then angle = angle - 2*pi end
light_pos = vec4(7*cos(angle), 3.0, 7*sin(angle), 1.0)
end
-- Render
gl.clear('color', 'depth')
gl.uniformf(loc["Light[0].Position"], view * light_pos)
-- Draw floor
set_material(.9, false, vec3(.2, .2, .2))
local model = glmath.translate(0, -.75, 0)
set_matrices(model)
plane:render()
-- Draw the cows
local rotate = glmath.rotate(rad(180), 0, 1, 0)
for _, cow in ipairs(cows) do
set_material(cow.rough, cow.metal, cow.color)
set_matrices(glmath.translate(cow.pos)*rotate)
mesh:render()
end
glfw.swap_buffers(window)
end
|
--[[
Filename: CoinManagerC.lua
Authors: Sam@ke
--]]
CoinManagerC = {}
function CoinManagerC:constructor(parent)
mainOutput("CoinManagerC was loaded.")
self.mainClass = parent
self.coins = {}
self:init()
end
function CoinManagerC:init()
self.m_AddCoin = bind(self.addCoin, self)
addEvent("MKADDCOIN", true)
addEventHandler("MKADDCOIN", root, self.m_AddCoin)
self.m_ResetMap = bind(self.resetMap, self)
addEvent("MKRESETMAP", true)
addEventHandler("MKRESETMAP", root, self.m_ResetMap)
end
function CoinManagerC:addCoin(coinProperties)
if (coinProperties) then
if (not self.coins[coinProperties.id]) then
self.coins[coinProperties.id] = new(CoinC, self, coinProperties)
end
end
end
function CoinManagerC:update(delta)
for index, coinClass in pairs(self.coins) do
if (coinClass) then
coinClass:update(delta)
end
end
end
function CoinManagerC:resetMap()
for index, coinClass in pairs(self.coins) do
if (coinClass) then
delete(coinClass)
coinClass = nil
end
end
end
function CoinManagerC:clear()
self:resetMap()
removeEventHandler("MKADDCOIN", root, self.m_AddCoin)
removeEventHandler("MKRESETMAP", root, self.m_ResetMap)
end
function CoinManagerC:destructor()
self:clear()
mainOutput("CoinManagerC was deleted.")
end
|
ngx.say("hello bebopze....")
|
--[[
Reset the bot and re run start up
]]--
local directive
if fs.exists("/config") then
local configFile = fs.open("/config", "r")
directive = configFile.readLine()
configFile.close()
end
if directive then
print("Are you sure you wish to reset this " .. directive .. " bot?")
else
print("Are you sure you wish to reset this bot?")
end
while true do
local _, char = os.pullEvent("char")
if char:lower() == "n" then
error()
elseif char:lower() == "y" then
break
end
end
local ls = fs.list("/")
for key, value in pairs(ls) do
if not fs.isDir(value) and value ~= "startup" then
fs.delete(value)
end
end
shell.execute("startup")
|
require'theming.theme'
|
--- LibOO-1.0
-- @class file
-- @name LibOO-1.0.lua
local MAJOR, MINOR = "LibOO-1.0", 23
local LibOO, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not LibOO then return end
local tconcat = table.concat
local assert, error, loadstring, xpcall = assert, error, loadstring, xpcall
local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget
local select, pairs, ipairs, type, tostring = select, pairs, ipairs, type, tostring
local clientVersion = select(4, GetBuildInfo())
local safecall
do
local function errorhandler(err)
return geterrorhandler()(err)
end
local function CreateDispatcher(argCount)
local code = [[
local xpcall, eh = ...
local method, ARGS
local function call() return method(ARGS) end
local function dispatch(func, ...)
method = func
if not method then return end
ARGS = ...
return xpcall(call, eh)
end
return dispatch
]]
local ARGS = {}
for i = 1, argCount do ARGS[i] = "arg"..i end
code = code:gsub("ARGS", tconcat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
end
local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
Dispatchers[0] = function(func)
return xpcall(func, errorhandler)
end
safecall = function(func, ...)
return Dispatchers[select('#', ...)](func, ...)
end
end
local function validateType(argN, methodName, var, reqType)
local varType = type(var)
local negate = reqType:sub(1, 1) == "!"
local reqType = negate and reqType:sub(2) or reqType
reqType = reqType:trim(" ")
if varType == "table" then
if type(var[0]) == "userdata" then
if reqType == "frame" or reqType == "widget" then
varType = reqType
elseif var:IsObjectType(reqType) then
varType = reqType
end
end
end
local isGood
if negate then
if varType ~= reqType then
isGood = true
end
else
if varType == reqType then
isGood = true
end
end
if not isGood then
local varTypeName = varType
if varType == "table" and type(var[0]) == "userdata" then
varTypeName = "frame (" .. var:GetObjectType() .. ")"
end
if negate then
reqType = "!" .. reqType
end
error(("Bad argument #%s to %q. Expected %s, got %s"):format(argN, methodName, reqType, varTypeName), 3)
end
end
LibOO.Namespaces = LibOO.Namespaces or {}
local LibOONamespace
local metamethods = {
__add = true,
__call = true,
__concat = true,
__div = true,
__le = true,
__lt = true,
__mod = true,
__mul = true,
__pow = true,
__sub = true,
__tostring = true,
__unm = true,
}
local funcsToCall = {}
local depth = 0
local function callFunc(class, instance, func, ...)
local startIndex = #funcsToCall + 1
depth = depth + 1
-- Functions to call are placed in a single table to decrease garbage churn.
-- The segment of the table where functions are placed in this call will be iterated over,
-- and functions will be called based on where they are in the inheritance hierarchy
for k, v in pairs(class.instancemeta.__index) do
if type(k) == "string" and k:find("^" .. func) then
funcsToCall[#funcsToCall + 1] = k
end
end
if instance.isLibOOInstance then
-- If this is being called on an instance of a class instead of a class,
-- search the instance itself for matching functions too.
-- This will never step on the toes of class.instancemeta.__index because
-- iterating over an instance will only yield things explicity set on an instance -
-- it will never directly contain anything inherited from a class.
for k, v in pairs(instance) do
if type(k) == "string" and k:find("^" .. func) then
funcsToCall[#funcsToCall + 1] = k
end
end
end
for _, classIter in ipairs(class.inherits) do
for i = startIndex, #funcsToCall do
local funcName = funcsToCall[i]
if funcName then
local funcToCall = instance[funcName]
if classIter[funcName] == funcToCall then
funcsToCall[i] = false
safecall(funcToCall, instance, ...)
end
end
end
end
for i = startIndex, #funcsToCall do
local funcName = funcsToCall[i]
if funcName then
safecall(instance[funcName], instance, ...)
end
end
depth = depth - 1
if depth == 0 then
wipe(funcsToCall)
end
end
local function initializeClass(self)
if not self.initialized then
-- set any defined metamethods
for k, v in pairs(self.instancemeta.__index) do
if metamethods[k] then
self.instancemeta[k] = v
end
end
self:CallFunc("OnFirstInstance")
self.initialized = true
end
end
local function class__call(self, arg)
-- allow something like Namespace:NewClass("Name"){Foo = function() end, Bar = 5}
if type(arg) == "table" then
for k, v in pairs(arg) do
if k == "METHOD_EXTENSIONS" and type(v) == "table" then
for methodName, func in pairs(v) do
self:PostHookMethod(methodName, func)
end
elseif k == "METHOD_EXTENSIONS_PRE" and type(v) == "table" then
for methodName, func in pairs(v) do
self:PreHookMethod(methodName, func)
end
else
self[k] = v
end
end
end
return self
end
local function class__newindex(self, k, v)
-- Update/set all subclasses at all levels of inheritance
local existing = self[k]
if existing ~= v then
for class in pairs(self.inheritedBy) do
if class[k] == existing then
class[k] = v
end
end
-- Update/set for this class
-- Note: class.instancemeta.__index == getmetatable(class).__index
-- We use .instancemeta here for speed
self.instancemeta.__index[k] = v
end
end
local function class__tostring(self)
return tostring(self.namespace) .. "." .. self.className
end
local weakMetatable = {
__mode = "kv"
}
LibOO.knownBlizzWidgets = LibOO.knownBlizzWidgets or setmetatable({}, weakMetatable)
local function inherit(self, source)
if source then
local metatable = getmetatable(self)
local namespace = self.namespace
local index, didInherit
-- LibOO class inheritance (passed in class name)
if type(source) == "string" then
local ns, class = source:match("([^%.]*)%.(.*)")
if ns and class then
if LibOO.Namespaces[ns] then
namespace = LibOO.Namespaces[ns]
source = namespace[class]
end
elseif namespace[source] then
source = namespace[source]
end
end
if source == self then
error(("%s tried to inherit itself."):format(tostring(self)), 3)
end
if type(source) == "table" then
-- LibOO class inheritance (passed in class table)
if source.isLibOOClass and source.CallFunc then
if source.inherits[self] then
error(("%s can't inherit %s because it would create cyclical inheritance."):format(tostring(self), tostring(source)), 3)
end
source:CallFunc("OnClassInherit", self)
index = getmetatable(source).__index
didInherit = true
else
-- Table inheritance
index = source
didInherit = true
end
else
-- Blizzard widget inheritance
if LibOO.knownBlizzWidgets[source] == nil then
local success, frame = pcall(CreateFrame, source)
if success then
-- Need to hide the frame or else if we made an editbox,
-- it will block all keyboard input for some reason
frame:Hide()
LibOO.knownBlizzWidgets[source] = frame
else
LibOO.knownBlizzWidgets[source] = false
end
end
local frame = LibOO.knownBlizzWidgets[source]
if frame then
self.isFrameObject = source or self.isFrameObject
rawset(self, "isFrameObject", rawget(self, "isFrameObject") or source)
metatable.__index.isFrameObject = metatable.__index.isFrameObject or source
index = getmetatable(frame).__index
didInherit = true
-- LibSub lib inheritance
elseif LibStub(source, true) then
local lib = LibStub(source, true)
if lib.Embed then
lib:Embed(metatable.__index)
didInherit = true
else
error(("Library %q does not have an :Embed() method"):format(source), 2)
end
end
end
if not didInherit then
error(("Could not figure out how to inherit %s into class %s. Are you sure it exists?"):format(source, tostring(self)), 3)
end
if index then
for k, v in pairs(index) do
if metatable.__index[k] == nil then
metatable.__index[k] = v
end
end
end
end
end
--- Creates a new class.
-- @name Namespace:NewClass
-- @paramsig className, ...
-- @param className [String] The name of the class to be created.
-- @param ... [...] A list of things to inherit from. Valid parameters include the following (and each will be checked in the following order):
-- * The name of another LibOO-1.0 class in the same namespace as the class being created.
-- * The namespace and name for another LibOO-1.0 class, formatted as "Namespace.ClassName".
-- * A table that is a LibOO-1.0 class as returned by Namespace:NewClass()
-- * A plain table whose values will be merged into the class.
-- * The name of a Blizzard widget (like Frame, Button, EditBox, etc.) The class created will inherit the methods of that widget type, and instances of the class will be based on a new frame of that widget type.
-- * The name of a LibStub library that has an :Embed() method (many Ace3 libs do, e.g "AceEvent-3.0").
--
-- When conflicts between members of different inherited things arise, previously inherited (i.e. non-nil) members will not be overwritten.
-- @return [Class] A new class that inherits from LibOO:GetNamespace("LibOO-1.0").Class and all other requested inheritances.
local function NewClass(namespace, className, ...)
if className then
validateType("2 (className)", "Namespace:NewClass(className, ...)", className, "string")
if className:find("^__") then
error(MAJOR .. ": Class names may not start with two underscores (__) because this prefix is reserved for internal use by namespaces.", 2)
end
if namespace[className] then
error(MAJOR .. ": A class with name " .. className .. " already exists. You can't overwrite existing classes, so pick a different name", 2)
end
end
local metatable = {
__index = { -- this is class.instancemeta.__index as well.
isLibOOInstance = true,
},
__call = class__call,
__tostring = class__tostring,
}
local class = {
instances = {},
inherits = {},
inheritedBy = {},
initialized = false,
isLibOOClass = true,
isLibOOInstance = false, -- Override the instancemeta so classes don't think they are instances.
}
local memAddr = tostring(class):gsub("table: ", "0x")
class.instancemeta = {__index = metatable.__index}
setmetatable(class, metatable)
metatable.__newindex = class__newindex
-- Makes referencing the class really easy - don't have to define a class variable for instances,
-- and creates a unified way to definitely get the class for both classes and instances.
class.class = class
class.className = className or memAddr
class.namespace = namespace
if LibOONamespace then
inherit(class, LibOONamespace.Class)
end
-- Inherit the requested classes/whatever
for i = 1, select("#", ...) do
local source = select(i, ...)
inherit(class, source)
end
if className then
namespace[className] = class
end
namespace.__callbacks:Fire("OnNewClass", class)
return class
end
local ns__metatable = {
__tostring = function(self)
return self.__name
end,
}
--- Gets a namespace.
-- A new namespace will be created if the namespace does not already exist.
-- @param namespace [String] The name of the namespace to get or create.
-- @return [Namespace} A LibOO-1.0 namespace that you can call Namespace:NewClass() on.
function LibOO:GetNamespace(namespace)
validateType("2 (namespace)", "LibOO:GetNamespace(namespace)", namespace, "string")
local ns = LibOO.Namespaces[namespace]
if not ns then
if namespace:find("%.") then
error("LibOO-1.0: Namespace names may not contain periods.", 2)
end
ns = {NewClass = NewClass}
setmetatable(ns, ns__metatable)
ns.__callbacks = LibStub("CallbackHandler-1.0"):New(ns)
ns.__name = namespace
LibOO.Namespaces[namespace] = ns
end
return ns
end
-- Upgrade the NewClass method:
for _, namespace in pairs(LibOO.Namespaces) do
namespace.NewClass = NewClass
end
LibOONamespace = LibOO:GetNamespace(MAJOR:gsub("%.", ""))
-- Define the base class. All other classes implicitly inherit from this class.
local Class = LibOONamespace.Class or LibOONamespace:NewClass("Class")
--- Instantiates a class.
--
-- All class methods and members will be accessed via metamethods.
--
-- If the class inherits from a Blizzard widget, any class methods that are valid script handler names for the widget type (like "OnClick" or "OnShow") will be hooked as script handlers on the instance.
-- @param ... [...] The constructor parameters of the new instance. If the class being instantiated inherits from a Blizzard widget, these will be passed directly to CreateFrame(...), and parameters after the 5th (the CreateFrame ID parameter) will be passed to calls of any class methods whose name **begins** with "OnNewInstance" (E.g. {{{Class:OnNewInstance_Class(self, ...)}}}). If this class does not inherit from a Blizzard, widget, all parameters will be passed to these calls.
-- @return A new instance of the class.
function Class:New(...)
if self.isLibOOInstance then
self = self.class
end
if self.isFrameObject then
return self:NewFromExisting(CreateFrame(...), select(6, ...))
else
return self:NewFromExisting({}, ...)
end
end
--- Creates an instance of the class out of an existing object. No additional memory is allocated to perform this.
--
-- If the class inherits from a Blizzard widget, any class methods that are valid script handler names for the widget type (like "OnClick" or "OnShow") will be hooked as script handlers on the instance.
--
-- @param instance [table] An existing table or widget to instantiate the class on. Cannot be something that has already been instantiated. If the existing object has a metatable, it will be overwritten with class.instancemeta.
-- @param ... [...] The constructor parameters of the new instance. In all cases, they will be passed to calls of any class methods whose name **begins** with "OnNewInstance" (E.g. {{{Class:OnNewInstance_Class(self, ...)}}}).
-- @return A new instance of the class.
function Class:NewFromExisting(instance, ...)
validateType("2 (instance)", "Class:NewFromExisting(instance, ...)", instance, "table")
if instance.isLibOOInstance then
error("Cannot instantiate something that has already been instantiated!", 2)
end
local isWidget = type(instance[0]) == "userdata"
if not isWidget and self.isFrameObject then
error("Widget classes must be instantiated with widgets.", 2)
elseif isWidget then
if not self.isFrameObject then
error("Non-widget classes must be instantiated on non-widgets.", 2)
elseif instance:GetObjectType() ~= self.isFrameObject then
error("Expected a " .. self.isFrameObject .. " widget, got a " .. instance:GetObjectType(), 2)
end
end
if self.isLibOOInstance then
self = self.class
end
-- if this is the first instance of the class, do some magic to it:
initializeClass(self)
setmetatable(instance, self.instancemeta)
self.instances[#self.instances + 1] = instance
for k, v in pairs(self.instancemeta.__index) do
if self.isFrameObject and instance.HasScript and instance:HasScript(k) then
instance:HookScript(k, v)
end
end
instance:CallFunc("OnNewInstance", ...)
self.namespace.__callbacks:Fire("OnNewInstance", self, instance)
return instance
end
--- Pre-hooks the specified method so that it when called, it will first call newFunction, and then it will call the original method being hooked.
--
-- If the requested method is not defined when this is called, newFunction will simply be set as that method with no hooking involved.
-- @param method [String] The name of the method on the class that should be hooked.
-- @param newFunction [Function] The function that will be called after the original function is called.
function Class:PreHookMethod(method, newFunction)
validateType("2 (method)", "Class:PostHookMethod(method, newFunction)", method, "!nil")
validateType("3 (newFunction)", "Class:PostHookMethod(method, newFunction)", newFunction, "function")
local existingFunction = self[method]
if existingFunction then
self[method] = function(...)
newFunction(...)
existingFunction(...)
end
else
self[method] = newFunction
end
end
--- Post-hooks the specified method so that it when called, it will first call the original method being extended, and then it will call newFunction.
--
-- If the requested method is not defined when this is called, newFunction will simply be set as that method with no hooking involved.
-- @param method [String] The name of the method on the class that should be hooked.
-- @param newFunction [Function] The function that will be called after the original function is called.
function Class:PostHookMethod(method, newFunction)
validateType("2 (method)", "Class:PostHookMethod(method, newFunction)", method, "!nil")
validateType("3 (newFunction)", "Class:PostHookMethod(method, newFunction)", newFunction, "function")
local existingFunction = self[method]
if existingFunction then
self[method] = function(...)
existingFunction(...)
newFunction(...)
end
else
self[method] = newFunction
end
end
-- Backwards compatibility
Class.ExtendMethod = Class.PostHookMethod
--- Asserts that self is a LibOO class.
--
-- Throws a breaking error at the level of the caller's caller (user-level) if it is not.
function Class:AssertSelfIsClass()
if not self.isLibOOClass then
error(("Caller must be the class %q, not an instance of the class"):format(tostring(self)), 3)
end
end
--- Asserts that self is an instance of a LibOO class.
--
-- Throws a breaking error at the level of the caller's caller (user-level) if it is not.
function Class:AssertSelfIsInstance()
if not self.isLibOOInstance then
error(("Caller must be an instance of the class %q, not the class itself"):format(tostring(self)), 3)
end
end
--- Inherits the source into the class.
--
-- The source parameter must be one of the valid inheritance types documented in Namespace:NewClass()'s documentation.
-- @param [string|table] The source that should be inherited into the class.
-- @see Namespace:NewClass()
function Class:Inherit(source)
self:AssertSelfIsClass()
inherit(self, source)
end
--- Copies the requested source table into the caller (caller can be a class or an instance of a class).
-- @param source [table] The parent of the table that will be copied.
-- @param tableKey [!nil] The key on the parent that holds the table that will be copied. The copied table will be placed into this variable on the caller as well.
-- @usage Namespace:NewClass("One"){
-- someTable = {stuff1 = 1},
-- OnNewInstance = function(instance)
-- instance:InheritTable(instance.class, "someTable")
--
-- -- This commented line is functionally the same as the above line
-- -- since before the function call, instance.someTable == instance.class.someTable
-- -- instance:InheritTable(instance, "someTable")
--
-- instance.someTable.stuff2 = 2
--
-- -- This assertion will fail because we did not just modify the parent's someTable - we modified an instance-level copy.
-- assert(instance.class.someTable.stuff2)
-- end
-- }
--
-- @return [table] The destination table - self[tableKey].
function Class:InheritTable(source, tableKey)
validateType("2 (source)", "Class:InheritTable(source, tableKey)", source, "table")
validateType("3 (tableKey)", "Class:InheritTable(source, tableKey)", tableKey, "!nil")
self[tableKey] = {}
for k, v in pairs(source[tableKey]) do
self[tableKey][k] = v
end
return self[tableKey]
end
--- Calls all the functions of a class that begin with funcName.
-- @param funcName [string] The beginning of the method name that must be matched in order for the method to be called.
-- @param ... The parameters that will be passed, after a reference to self, to the function(s) when they are called.
-- @usage -- Example usage from within the Class core on how this method is used.
-- -- It may be used externally, of course
--
-- -- Used to notify a class that the first instance of it has been created
-- -- so that it may preform any class-level initialization needed.
-- class:CallFunc("OnFirstInstance")
--
-- -- Another example:
-- -- Used when an instance of a class is created.
-- -- Functions as the instance constructor. See the How To page for more info.
-- instance:CallFunc("OnNewInstance", ...)
function Class:CallFunc(funcName, ...)
if self.isLibOOClass then
callFunc(self, self, funcName, ...)
else
callFunc(self.class, self, funcName, ...)
end
end
--- Sets the __mode metamethod of the instances table of the class to "kv" so that instances will be garbage collected when they are orphaned everywhere else.
-- This behavior will not be inherited by subclasses. Keep in mind that Blizzard Frames cannot be garbage collected.
function Class:MakeInstancesWeak()
setmetatable(self.instances, weakMetatable)
end
-- [INTERNAL]
function Class:OnClassInherit_BaseClass(newClass)
-- for class in pairs(self.inherits) do
-- newClass.inherits[class] = true
-- class.inheritedBy[newClass] = true
-- end
for i, class in ipairs(self.inherits) do
if not newClass.inherits[class] then
tinsert(newClass.inherits, class)
newClass.inherits[class] = true
end
class.inheritedBy[newClass] = true
end
if not newClass.inherits[self] then
tinsert(newClass.inherits, self)
newClass.inherits[self] = true
end
self.inheritedBy[newClass] = true
end
|
function f1() end
function f2(...) end
function f3(...) print(...) end
|
local OFFSET_BASE = 64
local OFFSET_MOVE = 64*2
Dennis.NUM_RINGS = 3
Dennis.NUM_ITEMS = 8
Dennis.MAX_CAPTURE_DIST = 500
Dennis.parent = nil -- CPlayer that we belong to
Dennis.active = false -- whether the rings are there
Dennis.ents = {} -- 2-dimensional table to store all entites by [ringID][index]
Dennis.captured = {} -- contains the CIDs of player's we've captured
Dennis.fired = 0
function Dennis.OnInsert()
print("ASDONASODJASJIODAJIOSDJIOASJIODJIOASJIOD Dennis.OnCreate", self.__dbgId, tostring(self.ents))
-- allocate all the entities, but hide them from the world
for ring = 1, self.NUM_RINGS do
self.ents[ring] = {}
for i = 1, self.NUM_ITEMS do
-- create an entity
local ent = Srv.Game:CreateEntityPickup(i%2, 0) -- armor and hearts
ent:GetSelf().CanNotBePickedUp = true
-- insert it
self.ents[ring][i] = ent
-- hide it from the world (this does not destroy it, the reference will still be valid!)
Srv.Game.World:RemoveEntity(ent)
print("num: " .. #self.ents .. "-" .. #self.ents[ring])
end
end
print("Dennis alive", self.__dbgId, tostring(this))
end
-- called from `Player.enableDennis' via `Character.OnCreate'
function Dennis.spawn(self)
if self.active then
print("Dennis.spawn called although dennis active?")
return false
end
self.active = true
for ring,tr in ipairs(self.ents) do
for i,ent in ipairs(tr) do
-- hide it from the world
Srv.Game.World:InsertEntity(ent)
end
end
print("Dennis shown", self.__dbgId, tostring(this))
return true
end
-- called from `Player.disableDennis' via `Character.Destroy'
function Dennis.disappear(self)
if not self.active then
print("Dennis.disappear called although dennis inactive?")
return false
end
for ring,tr in ipairs(self.ents) do
for i,ent in ipairs(tr) do
-- hide it from the world
Srv.Game.World:RemoveEntity(ent)
end
end
print("Dennis hidden", self.__dbgId, tostring(this))
self.active = false
return true
end
local function ReleaseNextVictim()
print("ReleaseNextVictim")
if #self.captured > 0 then
local CID = self.captured[1]
local pl = Srv.Game:GetPlayer(CID)
table.remove(self.captured, 1)
pl:GetSelf():enableDennis(true)
pl:GetCharacter().PhysicsEnabled = true
Srv.Game:SendChatTarget(self.parent:GetCID(), Srv.Server:GetClientName(CID) .. " freed.")
else
Srv.Game:SendChatTarget(self.parent:GetCID(), "No tee's captured, use your gun first.")
end
end
function Dennis.Destroy()
print("XNKLXNMXBMNVHJBCJBVJBJKBJKVBVJH Dennis.Destroy", self.__dbgId, tostring(self.ents))
-- release all
for _= 1, #self.captured do
ReleaseNextVictim()
end
for ring,tr in ipairs(self.ents) do
for i,ent in ipairs(tr) do
Srv.Game.World:DestroyEntity(ent)
end
end
self.ents = nil
end
local function FindClosestPlayer(Pos)
local ClosestID = -1
local ClosestDist = 9999
for CID = 0, 127 do
local chr
local pl = Srv.Game:GetPlayer(CID)
print(CID, 'pl', tostring(pl))
if pl ~= nil then
chr = pl:GetCharacter()
--print(CID, tostring(chr))
end
-- check if we've got someone and he's not ourselves
if chr ~= nil and CID ~= self.parent:GetCID() then
-- make sure he's also not yet captured by us
local gotHim = false
for _,v in ipairs(self.captured) do
if v == CID then
gotHim = true
print("already got " .. v)
break
end
end
print(CID, ClosestID, ClosestDist, tostring(gotHim))
if not gotHim then
local ThisDist = Srv.Game.Collision:Distance(this.Pos, chr.Pos)
if ClosestID == -1 or ThisDist < ClosestDist then
print("Found new closest player " .. Srv.Server:GetClientName(CID))
ClosestID = CID
ClosestDist = ThisDist
end
end
end
end
local Chr
if ClosestID > -1 then
Chr = Srv.Game:GetPlayer(ClosestID):GetCharacter()
end
return ClosestID, Chr
end
local function CapturePlayer()
print("CapturePlayer")
if #self.captured < self.NUM_RINGS then
local ClosestID, chr = FindClosestPlayer(this.Pos)
if ClosestID < 0 then
Srv.Game:SendChatTarget(self.parent:GetCID(), "No Tee found in range of " .. self.MAX_CAPTURE_DIST)
else
-- success
table.insert(self.captured, ClosestID)
chr:GetPlayer():GetSelf():disableDennis(true)
chr.PhysicsEnabled = false
Srv.Game:SendChatTarget(self.parent:GetCID(), "Captured " .. Srv.Server:GetClientName(ClosestID) .. " into slot " .. #self.captured .. "/" .. self.NUM_RINGS)
end
else
Srv.Game:SendChatTarget(self.parent:GetCID(), "All slots full, use your hammer to release.")
end
end
local function CheckInput()
if self.fired == 0 then return end
print("CheckInput; fired", self.fired)
if self.fired == 1 then -- hammer; capture
ReleaseNextVictim()
elseif self.fired == 2 then -- gun; release
CapturePlayer()
end
self.fired = 0
end
local function UpdateVictimPositions(ringPoses)
for i,v in ipairs(self.captured) do
local chr = Srv.Game:GetPlayerChar(v)
if chr ~= nil then
local core = chr.Core
local WantedPos = ringPoses[i]
if Srv.Game.Collision:Distance(core.Pos, WantedPos) > 21 then
-- smooth flying transition
core.Vel = Srv.Game.Collision:Normalize(WantedPos - core.Pos) * 16
core.Pos = core.Pos + core.Vel
else
-- rotate him
core.Pos = WantedPos
local RadialOut = Srv.Game.Collision:Normalize(core.Pos - this.Pos)
local CircleDir = Srv.Game.Collision:Rotate(RadialOut, 90)
CircleDir = CircleDir * 4
--print(tostring(CircleDir))
core.Vel = CircleDir + self.parent:GetCharacter().Core.Vel
end
chr.Pos = core.Pos
end
end
end
function Dennis.trigger(self, Weapon)
if Weapon == 1 or Weapon == 2 then
self.fired = Weapon
end
end
function Dennis.Tick()
if self.parent == nil or self.active == false then
--print("Tick prevented", tostring(self.parent), tostring(self.active))
return
end
--if self.parent:GetCharacter() == nil then return end -- TODO XXX THIS SHOULD NOT HAPPEN
local ringPoses = {}
for ring = 1, self.NUM_RINGS do
local ro = (ring/self.NUM_RINGS) * 2*math.pi
-- update armor circle
local Time = Srv.Server.Tick/30
local Pos = self.parent:GetCharacter().Pos
this.Pos = Pos
for i,ent in ipairs(self.ents[ring]) do
local s = (i/#self.ents[ring])*2*math.pi
local x = Pos.x + OFFSET_BASE*math.cos(Time + s) + (OFFSET_MOVE*math.cos(Time + ro))
local y = Pos.y + OFFSET_BASE*math.sin(Time + s) + (OFFSET_MOVE*math.sin(Time + ro))
-- add all the positions together so we can later take an average (that's where the tee will go)
if ringPoses[ring] == nil then
ringPoses[ring] = vec2(x, y)
else
ringPoses[ring] = ringPoses[ring] + vec2(x, y)
end
-- local solid = Srv.Game.Collision:IsTileSolid(x, y)
--print(tostring(solid))
-- if not solid then
ent.Pos = vec2(x, y)
-- end
end
-- get the average
ringPoses[ring] = ringPoses[ring] / #self.ents[ring]
end
--print(tostring(self), tostring(this))
CheckInput()
UpdateVictimPositions(ringPoses)
this:Tick()
end
-- called from Player.createDennis
function Dennis.attachTo(self, parent) -- parent is CPlayer
self.parent = parent
print("Dennis attach", self.__dbgId, tostring(this), tostring(parent), type(parent))
end
|
local tm = minetest.get_current_modname() .. ":";
minetest.register_node(tm .. "sandstone",{
description = "Sandstone",
paramtype = "light",
tiles = {"sandstone.png"},
groups = {crumbly = 1},
})
minetest.register_node(tm .. "oldstone_cracked",{
description = "Sandstone",
paramtype = "light",
tiles = {"oldstone_cracked.png"},
groups = {crumbly = 1},
light_source = 0
})
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)minetest.remove_node(pos)end)
minetest.register_node(tm .. "post", {
description = "Old Light Post",
tiles = {
"nc_tree_tree_side.png",
"nc_tree_tree_side.png",
"nc_tree_tree_side.png",
"nc_tree_tree_side.png",
"nc_tree_tree_side.png",
"nc_tree_tree_side.png"
},
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.1875, -0.5, -0.1875, 0.1875, 0.375, 0.1875}, -- NodeBox1
{0.1875, -0.5, -0.0625, 0.3125, -0.25, 0.0625}, -- NodeBox2
{-0.3125, -0.5, -0.0625, -0.1875, -0.25, 0.0625}, -- NodeBox3
{-0.0625, -0.5, -0.3125, 0.0625, -0.25, -0.1875}, -- NodeBox4
{-0.0625, -0.5, 0.1875, 0.0625, -0.25, 0.3125}, -- NodeBox5
{-0.0625, -0.25, 0.1875, 0.0625, 0.125, 0.25}, -- NodeBox6
{-0.0625, -0.25, -0.25, 0.0625, 0.125, -0.1875}, -- NodeBox7
{0.1875, -0.25, -0.0625, 0.25, 0.125, 0.0625}, -- NodeBox8
{-0.25, -0.25, -0.0625, -0.1875, 0.125, 0.0625}, -- NodeBox9
{-0.1875, 0.375, 0.125, -0.125, 0.5, 0.1875}, -- NodeBox10
{0.125, 0.375, 0.125, 0.1875, 0.5, 0.1875}, -- NodeBox11
{0.125, 0.375, -0.1875, 0.1875, 0.5, -0.125}, -- NodeBox12
{-0.1875, 0.375, -0.1875, -0.125, 0.5, -0.125}, -- NodeBox13
{-0.125, 0.375, 0.0625, -0.0625, 0.4375, 0.125}, -- NodeBox14
{0.0625, 0.375, 0.0625, 0.125, 0.4375, 0.125}, -- NodeBox15
{0.0625, 0.375, -0.125, 0.125, 0.4375, -0.0625}, -- NodeBox16
{-0.125, 0.375, -0.125, -0.0625, 0.4375, -0.0625}, -- NodeBox17
}
}
})
minetest.register_node(tm .. "shard_luc", {
tiles = {{name ="blueloop.png",
animation = {
type = "vertical_frames",
aspect_w = 2,
aspect_h = 16,
length = 1},
{
type = "sheet_2d",
frames_w = 1,
frames_h = 8,
frame_length = 2.1,
}
}},
light_source = 14,
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{0, -0.625, 0, 0.0625, -0.1875, 0.0625}, -- NodeBox18
{-0.0625, -0.625, 0, 0, -0.125, 0.0625}, -- NodeBox21
{0, -0.625, -0.0625, 0.0625, -0.25, 0}, -- NodeBox22
{-0.0625, -0.625, -0.0625, 0, -0.3125, 0}, -- NodeBox23
}
}
})
|
local config = {}
function config.init()
vim.cmd [[set background=dark]]
vim.g.edge_style = "aura"
vim.g.edge_enable_italic = 1
vim.g.edge_disable_italic_comment = 1
vim.g.edge_show_eob = 1
vim.g.edge_better_performance = 1
vim.cmd [[ colorscheme edge ]]
end
return config
|
--------------------------------
--- SYNC
--------------------------------
-- Keep an option synced between all players
local Sync = {}
MR.SV.Sync = Sync
-- Networking
util.AddNetworkString("CL.Sync:Replicate")
util.AddNetworkString("SV.Sync:Replicate")
util.AddNetworkString("SV.Sync:ReplicateFirstSpawn")
net.Receive("SV.Sync:Replicate", function(_, ply)
Sync:Replicate(ply, net.ReadString(), net.ReadString(), net.ReadString(), net.ReadString())
end)
net.Receive("SV.Sync:ReplicateFirstSpawn", function(_, ply)
Sync:ReplicateFirstSpawn(ply)
end)
-- Replicate menu field
--
-- ply = player
-- command = console command
-- value = new command value
-- field1 = first field name from GUI element
-- field2 = second field name from GUI element
function Sync:Replicate(ply, command, value, field1, field2)
-- Admin only
if not MR.Ply:IsAdmin(ply) then
return false
end
-- Run the command
RunConsoleCommand(command, value)
-- Change field values on server
if field1 and field2 then
MR.Sync:Set(value, field1, field2)
elseif field1 then
MR.Sync:Set(value, field1)
else
return false
end
-- Change field values on clients
if field1 then
net.Start("CL.Sync:Replicate")
net.WriteString(value)
net.WriteString(field1)
net.WriteString(field2 or "")
net.Broadcast()
end
return true
end
-- Sync menu fields once after first spawn
function Sync:ReplicateFirstSpawn(ply)
for k,v in pairs(MR.Panels:GetTable()) do
if istable(v) then
for k2,v2 in pairs(v) do
net.Start("CL.Sync:Replicate")
net.WriteString(v2)
net.WriteString(k or 0)
net.WriteString(k2)
net.Send(ply)
end
else
net.Start("CL.Sync:Replicate")
net.WriteString(v)
net.WriteString(k)
net.Send(ply)
end
end
end
|
function onEvent(name, value1, value2)
if name == 'explosion' then
-- debugPrint('who the fuck');
makeAnimatedLuaSprite('explosion', 'stage/explosionfrom_edd', 200, -500);
addAnimationByPrefix('explosion', 'boom', 'TordBotBlowingUp', 18, false);
setProperty('explosion.angle', -90);
setProperty('explosion.alpha', 0);
addLuaSprite('explosion', false);
scaleObject('explosion', 2, 2);
setProperty('explosion.alpha', 1);
objectPlayAnimation('explosion', 'boom', true);
cameraShake('camGame', 0.02, 0.5);
end
end
|
-- Common module define reusable functions
-- @module Common
local Types = {}
-- check passed value is a table
--
-- @param arg value that needs to be checked
function Types:is_table (arg)
if type(arg) == 'table' then
return true
else
return false
end
end
return Types
|
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "Cloak Fire State 2",
desc = "Sets units to Hold Fire when cloaked, reverts to original state when decloaked",
author = "KingRaptor (L.J. Lim)",
date = "Feb 14, 2010",
license = "GNU GPL, v2 or later",
layer = -1,
enabled = true -- loaded by default?
}
end
local function CheckEnable()
if Spring.GetSpectatingState() then
widgetHandler:RemoveWidget(self)
end
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Speedups
local GiveOrderToUnit = Spring.GiveOrderToUnit
local GetUnitStates = Spring.GetUnitStates
local STATIC_STATE_TABLE = {0}
local CMD_CLOAK = 37382
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local myTeam
local exceptionList = { --add exempt units here
--mines
"armmine1",
"armmine2",
"armmine3",
"armmine5",
"armmine6",
"armmine7",
"armfmine3",
"cormine1",
"cormine2",
"cormine3",
"cormine5",
"cormine6",
"cormine7",
"tllmine1",
"tllmine2",
"tllmine3",
"tllmine4",
"tllmine5",
"tllmine6",
"talon_mine1",
"talon_mine2",
"talon_mine3",
"talon_mine4",
"talon_fmine",
"gok_mine1",
"gok_mine2",
"gok_mine3",
"gok_fmine",
--Crawling Bomb
"corsktl",
"tllcrawlb",
--Snipers
"armsnipe",
"corprot"
}
local exceptionArray = {}
for _,name in pairs(exceptionList) do
local ud = UnitDefNames[name]
if ud then
exceptionArray[ud.id] = true
end
end
local cloakUnit = {} --stores the desired fire state when decloaked of each unitID
function widget:UnitCommand(unitID, unitDefID, teamID, cmdID, cmdParams)
if cmdID == CMD_CLOAK and cmdParams[1] == 1 then
if (not enabled) or (teamID ~= myTeam) or exceptionArray[unitDefID] then
return
end
local states = GetUnitStates(unitID)
cloakUnit[unitID] = states.firestate --store last state
if states.firestate ~= 0 then
STATIC_STATE_TABLE[1] = 0
GiveOrderToUnit(unitID, CMD.FIRE_STATE, STATIC_STATE_TABLE, 0)
end
elseif cmdID == CMD_CLOAK and cmdParams[1] == 0 then
if (not enabled) or (teamID ~= myTeam) or exceptionArray[unitDefID] or (not cloakUnit[unitID]) then
return
end
local states = GetUnitStates(unitID)
if states.firestate == 0 then
local targetState = cloakUnit[unitID]
STATIC_STATE_TABLE[1] = targetState
GiveOrderToUnit(unitID, CMD.FIRE_STATE, STATIC_STATE_TABLE, 0) --revert to last state
--Spring.Echo("Unit compromised - weapons free!")
end
cloakUnit[unitID] = nil
end
end
function widget:PlayerChanged()
myTeam = Spring.GetMyTeamID()
CheckEnable()
end
function widget:Initialize()
myTeam = Spring.GetMyTeamID()
CheckEnable()
end
function widget:UnitCreated(unitID, unitDefID, unitTeam)
if (not enabled) then
return
end
if unitTeam == myTeam then
local states = GetUnitStates(unitID)
cloakUnit[unitID] = states.firestate
else
cloakUnit[unitID] = nil
end
end
function widget:UnitGiven(unitID, unitDefID, unitTeam)
widget:UnitCreated(unitID, unitDefID, unitTeam)
end
function widget:UnitDestroyed(unitID, unitDefID, unitTeam)
if cloakUnit[unitID] then
cloakUnit[unitID] = nil
end
end
|
--[[
slot machine game
name: abhinav lakhani
3398akshu@gmail.com
]]
require 'constants'
require 'dependencies'
local slotPadding = (WINDOW_WIDTH - gTextures['slot-machine']:getWidth()) / 2
local slotReels = {{}, {}, {}}
local slotIcons = {'50', 'apple', 'banana', 'pineapple', 'cherry',
'lemon', 'strawberry', 'orange'}
local slotVelocities = {0, 0, 0}
local stops = {
{ target = 0, total = 0},
{ target = 0, total = 0},
{ target = 0, total = 0}
}
local running = false
local win = false
local colorIndex = 1
function love.load()
love.window.setMode(WINDOW_WIDTH, WINDOW_HEIGHT)
love.window.setTitle('slot-machine')
math.randomseed(os.time())
-- populate each slot reel with icons
for i = 1, 3 do
-- generate entire slot reels for this column
for k, v in pairs(slotIcons) do
table.insert(slotReels[i], {
icon = v,
x = slotPadding + HORIZONTAL_SLOT_OFFSET + (SLOT_ICON_OFFSET * (i - 1)),
y = VERTICAL_SLOT_OFFSET + (k - 1) * ICON_SIZE
})
end
end
end
function love.keypressed(key)
if key == 'escape' then
love.event.quit()
end
if key == 'space' then
-- set velocities of reels
if slotVelocities[1] == 0 and not running then
running = true
win = false
timer.tween(2, {
[slotVelocities] = {[1] = 500}
})
timer.after(0.1, function()
timer.tween(2, {
[slotVelocities] = {[2] = 500}
})
end)
timer.after(0.2, function()
timer.tween(2, {
[slotVelocities] = {[3] = 500}
})
end)
elseif slotVelocities[1] == 500 then
timer.tween(2, {
[slotVelocities] = {[1] = 30}
}):finish(function()
stops[1].target = math.random(3)
end)
elseif slotVelocities[2] == 500 then
timer.tween(2, {
[slotVelocities] = {[2] = 30}
}):finish(function()
stops[2].target = math.random(3)
end)
elseif slotVelocities[3] == 500 then
timer.tween(2, {
[slotVelocities] = {[3] = 30}
}):finish(function()
stops[3].target = math.random(3)
end)
end
end
end
function love.update(dt)
timer.update(dt)
-- scroll all of the wheels
for i = 1, 3 do
for k, icon in pairs(slotReels[i]) do
icon.y = icon.y - slotVelocities[i] * dt
end
end
-- loop wheel if necessery
for i = 1, 3 do
if slotReels[i][1].y < SLOT_LOOP_Y then
table.insert(slotReels[i], table.remove(slotReels[i], 1))
slotReels[i][#slotIcons].y = slotReels[i][#slotIcons -1].y + ICON_SIZE
-- only check if we have target
if stops[i].target > 0 then
stops[i].total = stops[i].total + 1
if stops[i].target == stops[i].total then
slotVelocities[i] = 0
stops[i].total = 0
stops[i].target = 0
-- check for a win & flag slot as finished running
if slotVelocities[1] == slotVelocities[2] and slotVelocities[1] == slotVelocities[3] then
running = false
if slotReels[1][2].icon == slotReels[2][2].icon and slotReels[1][2].icon == slotReels[3][2].icon then
win = true
-- set winning color index
colorIndex = math.random(255)
end
end
end
end
end
end
end
function love.draw()
love.graphics.draw(gTextures['casino'], 0, -100)
for i = 1, 3 do
for k, v in pairs(slotReels[i]) do
if v.y > 140 and v.y < 400 then
love.graphics.draw(
gTextures[v.icon], v.x, v.y)
end
end
end
if win then
love.graphics.setColor(colorIndex, colorIndex, colorIndex, 0.2)
for i = 1, 3 do
love.graphics.rectangle('fill', slotReels[i][2].x + 2, slotReels[i][2].y,
SLOT_ICON_OFFSET, ICON_SIZE)
end
love.graphics.setColor(colorIndex, colorIndex, colorIndex, 1)
end
love.graphics.draw(gTextures['slot-machine'], slotPadding, 0)
end
|
local ffi = require('ffi')
local C = ffi.C;
local NULL = ffi.NULL
local SRF = {}
local srf_index = 0
local spi_opt = require('pllj.spi').opt
local to_pg = require('pllj.io').to_pg
local convert_to_lua_args = require('pllj.io').convert_to_lua_args
local function SRF_IS_FIRSTCALL(fcinfo)
return fcinfo.flinfo.fn_extra == nil
end
local SRF_FIRSTCALL_INIT = imported.SRF_FIRSTCALL_INIT
local SRF_PERCALL_SETUP = imported.SRF_PERCALL_SETUP
local SRF_RETURN_DONE = imported.SRF_RETURN_DONE
local SRF_RETURN_NEXT = imported.SRF_RETURN_NEXT
local cb_expr_context = function(datum)
local coindex = tonumber(ffi.cast('int64_t', datum))
SRF[coindex] = nil
end
local cb_expr_context_c = ffi.cast("void (*) (Datum)", cb_expr_context)
local function remove_co(fcinfo, coindex)
SRF[coindex] = nil
local rsi = ffi.cast('ReturnSetInfo*', fcinfo.resultinfo);
C.UnregisterExprContextCallback(rsi.econtext, cb_expr_context_c, ffi.cast('Datum', coindex));
end
local function srf_handler(func_struct, fcinfo, ctx_result)
local funcctx
if SRF_IS_FIRSTCALL(fcinfo) then
funcctx = SRF_FIRSTCALL_INIT(fcinfo);
assert(funcctx ~= nil)
local prev = C.CurrentMemoryContext
C.CurrentMemoryContext = funcctx.multi_call_memory_ctx
local iof = to_pg(func_struct.prorettype)
C.CurrentMemoryContext = prev
if not iof then
return error('no conversion for type ' .. tostring(func_struct.prorettype))
end
srf_index = srf_index + 1
funcctx.user_fctx = ffi.cast('void*', srf_index)
SRF[srf_index] = {coroutine.create(func_struct.func), convert_to_lua_args(fcinfo, func_struct), iof}
local rsi = ffi.cast('ReturnSetInfo*', fcinfo.resultinfo);
C.RegisterExprContextCallback(rsi.econtext, cb_expr_context_c, ffi.cast('Datum', srf_index));
end
funcctx = SRF_PERCALL_SETUP(fcinfo);
local coindex = tonumber(ffi.cast('int',funcctx.user_fctx))
local co = SRF[coindex][1]
spi_opt.readonly = func_struct.readonly
if coroutine.status(co) == "suspended" then --(funcctx.call_cntr < funcctx.max_calls)
local srf_data = SRF[coindex]
local args
local status, result
local iof = srf_data[3]
if srf_data[2] then
args = srf_data[2]
srf_data[2] = nil
status, result = coroutine.resume(co, unpack(args))
else
status, result = coroutine.resume(co)
end
if status == true then
if coroutine.status(co) == "dead" then
remove_co(fcinfo, coindex)
ctx_result[0] = SRF_RETURN_DONE(fcinfo, funcctx);
return
end
if not result or result == NULL then
fcinfo.isnull = true
else
ctx_result[0] = ffi.cast('Datum', iof(result))
end
SRF_RETURN_NEXT(fcinfo, funcctx)
return
else
remove_co(fcinfo, coindex)
return error(result)
end
else
--not expected to be here
remove_co(fcinfo, coindex)
ctx_result[0] = SRF_RETURN_DONE(fcinfo, funcctx);
return
end
end
return {
srf_handler = srf_handler
}
|
local Class = require 'lib.hump.class'
local Event = getClass 'wyx.event.Event'
-- Game Over - fires when the game is over
-- params:
-- reason - can be 'death', 'quit', 'win'
local GameOverEvent = Class{name='GameOverEvent',
inherits=Event,
function(self, reason)
Event.construct(self, 'Game Over Event')
verify('string', reason)
assert(reason == 'death'
or reason == 'quit'
or reason == 'win',
self:_msg('invalid reason "%s"', reason))
self._reason = reason
end
}
-- destructor
function GameOverEvent:destroy()
self._reason = nil
Event.destroy(self)
end
function GameOverEvent:getReason() return self._reason end
function GameOverEvent:__tostring()
return self:_msg('%s', self._reason)
end
-- the class
return GameOverEvent
|
require "lsp.lsp-install"
require("lsp.handlers").setup()
require "lsp.cmp"
require "lsp.signature"
require "lsp.metals"
require "lsp.null-ls"
|
local vim = vim
local api = vim.api
require('func.packadder').packadd({'neogit', 'plenary.nvim'})
local neogit = require('neogit')
neogit.setup()
|
local function init()
local map = vim.api.nvim_set_keymap
local options = { noremap = true }
map('n', '<leader>h1', '<CMD>HopChar1<CR>', options)
map('n', '<leader>h2', '<CMD>HopChar2<CR>', options)
map('n', '<leader>hh', '<CMD>HopPattern<CR>', options)
map('n', '<leader>hw', '<CMD>HopWord<CR>', options)
end
return {
init = init
}
|
World = {}
function World.new()
local world = {}
world.tileSize = 32
world.maps = {}
world.objects = {}
world.computer = {}
world.assignments = {}
world.showAssignments = true
world.update = World.update
world.render = World.render
world.addAssignment = World.addAssignment
world.isSolid = World.isSolid
world.interact = World.interact
world.activatePortal = World.activatePortal
world.isSolidObject = World.isSolidObject
world.lastUpdate = love.timer.getTime()
return world
end
function World:update()
-- Update time
-- Only update the assignments once per larger interval
local t = love.timer.getTime()
if t > self.lastUpdate + 1 then
for _, assignment in pairs(self.assignments) do
assignment:update()
end
self.lastUpdate = t
end
end
function World:render()
local map = player.map
if not map then
print( "No map selected to render!" )
return
end
-- Render gridlines
if self.debug then
-- render outline
love.graphics.setColor( 128, 128, 128 )
love.graphics.rectangle( "line", self.tileSize, self.tileSize,
map.width * self.tileSize, map.height * self.tileSize )
-- render grid lines
for i = 1, map.width do
local x = self.tileSize + i * self.tileSize
love.graphics.line( x, self.tileSize, x, self.tileSize + map.height * self.tileSize )
end
for i = 1, map.height do
local y = self.tileSize + i * self.tileSize
love.graphics.line( self.tileSize, y, self.tileSize + map.width * self.tileSize, y )
end
end
-- Render the tiles
for i = 1, map.width do
for j = 1, map.height do
local tile = map:tile( i, j )
tile.render( i, j )
end
end
-- Render current map's objects
for _, object in pairs(self.objects) do
if map == object.map then
object:render()
end
end
if self.terminal then
local w = 640
local h = 480
local b = 4
local x = love.graphics.getWidth() - w - b
local y = love.graphics.getHeight() - h - b
-- Create the Terminal border
love.graphics.setColor( 64, 64, 64 )
love.graphics.rectangle( "fill", x - b, y - b, w + 2 * b, h + 2 * b )
-- Draw the terminal itself
self.terminal.cOS.render( self.terminal, x, y, w, h )
end
if self.conversation then
local w = 768
local h = 384
local b = 2
local x = (love.graphics.getWidth() - w ) / 2
local y = love.graphics.getHeight() - h - 32
love.graphics.setColor( 64, 64, 128 )
love.graphics.rectangle( "fill", x - b, y - b, w + 2 * b, h + 2 * b )
self.conversation:render( x, y, w, h )
end
if self.showAssignments then
local w = 320
local h = love.graphics.getHeight()
local x = love.graphics.getWidth() - w
local y = 0
local offset = 0
love.graphics.setColor( 32, 16, 0 )
love.graphics.rectangle( "fill", x, y, w, h )
for i, a in ipairs( self.assignments ) do
a:render( x, y + offset, w, h )
end
end
end
function World:addAssignment( assignment )
table.insert( self.assignments, assignment )
end
function World:isSolidObject( map, x, y )
-- Check if there is a solid object there
for _, object in pairs(self.objects) do
if object.map == map and object.x == x and object.y == y then
-- Calculate from footprint (TODO)
-- Check if it is a door and is opened
if object.isDoor and object:isOpen() then
return false
end
--
if object.solid then
return true
end
end
end
return false
end
function World:interact( x, y )
for _, object in pairs(self.objects) do
if object.map == player.map and object.x == x and object.y == y then
action = object.interaction
if action == interaction.terminal then
-- Display that particular terminal
self.terminal = object
elseif action == interaction.conversation then
-- Start a new conversation
self.conversation = Conversation.new( object )
elseif action == interaction.open then
-- Try to open the door
-- if it is locked, open interface with keys/lockpick/lock
if not object:isLocked() then
print( "open door" )
object:open()
else
-- Start lock opening/picking session
self.lockpick = nil
end
end
return true
end
end
end
function World.facingPos( x, y, d )
if d == LEFT then
return (x - 1), y
elseif d == RIGHT then
return (x + 1), y
elseif d == UP then
return x, (y - 1)
elseif d == DOWN then
return x, (y + 1)
end
end
|
local utils = {}
utils.bg = "#000000"
utils.fg = "#ffffff"
utils.day_brightness = 0.3
---Print a warning message to the user
---@param... string
---@return table
function utils.warn(...)
for _, msg in ipairs({ ... }) do
vim.cmd("echohl WarningMsg | echom \"OneDarkPro.nvim: " .. msg ..
"\" | echohl NONE")
end
end
---Convert a hex color into an rgb
---@param hex_str string
---@return table
local hex_to_rgb = function(hex_str)
local hex = "[abcdef0-9][abcdef0-9]"
local pat = "^#(" .. hex .. ")(" .. hex .. ")(" .. hex .. ")$"
hex_str = string.lower(hex_str)
assert(string.find(hex_str, pat) ~= nil,
"hex_to_rgb: invalid hex_str: " .. tostring(hex_str))
local r, g, b = string.match(hex_str, pat)
return { tonumber(r, 16), tonumber(g, 16), tonumber(b, 16) }
end
---Blend colors together
---@param fg string foreground color
---@param bg string background color
---@param alpha number number between 0 and 1. 0 results in bg, 1 results in fg
function utils.blend(fg, bg, alpha)
bg = hex_to_rgb(bg)
fg = hex_to_rgb(fg)
local blendChannel = function(i)
local ret = (alpha * fg[i] + ((1 - alpha) * bg[i]))
return math.floor(math.min(math.max(0, ret), 255) + 0.5)
end
return string.format("#%02X%02X%02X", blendChannel(1), blendChannel(2),
blendChannel(3))
end
---Darken a hex color
---@param hex string
---@param amount integer
---@param bg string
---@return table
function utils.darken(hex, amount, bg)
return utils.blend(hex, bg or utils.bg, math.abs(amount))
end
---Lighten a hex color
---@param hex string
---@param amount integer
---@param fg string
---@return table
function utils.lighten(hex, amount, fg)
return utils.blend(hex, fg or utils.fg, math.abs(amount))
end
---Merge many tables together
---@param... table
---@return table
function utils.tbl_deep_extend(...)
local lhs = {}
for _, rhs in ipairs({ ... }) do
for k, v in pairs(rhs) do
if type(lhs[k]) == "table" and type(v) == "table" then
lhs[k] = utils.tbl_deep_extend(lhs[k], v)
else
lhs[k] = v
end
end
end
return lhs
end
---Set or override the default colors in the theme with the user's config
---@param colors table
---@param config table
---@return nil
function utils.color_overrides(colors, config)
if type(config.colors) == "table" then
for key, value in pairs(config.colors) do
-- check if the user has specified a table within the colors table
if type(config.colors[key]) == "table" then
-- only override colors if the key matches the name of the active theme
if key == colors.name then
for key, value in pairs(config.colors[key]) do
utils.set_or_create_color(colors, key, value)
end
end
else
-- otherwise just set them
utils.set_or_create_color(colors, key, value)
end
end
end
end
---Add a color to the colors table
---@param colors table
---@param key string
---@param value string
---@return nil
function utils.set_or_create_color(colors, key, value)
-- Patch: https://github.com/ful1e5/onedark.nvim/issues/6
if value:lower() == "none" then
colors[key] = "NONE"
elseif string.sub(value, 1, 1) == "#" then
-- hex override
colors[key] = value
else
-- create the new color
colors[key] = colors[value]
end
end
---Create the highlight groups from the theme
---@param group string
---@param color table
---@return nil
function utils.create_highlights(group, color)
local style = color.style and "gui=" .. color.style or "gui=NONE"
local fg = color.fg and "guifg=" .. color.fg or "guifg=NONE"
local bg = color.bg and "guibg=" .. color.bg or "guibg=NONE"
local sp = color.sp and "guisp=" .. color.sp or ""
local hl =
"highlight " .. group .. " " .. style .. " " .. fg .. " " .. bg .. " " ..
sp
if color.link and (color.fg == nil and color.bg == nil and color.sp == nil) then
vim.cmd("highlight! link " .. group .. " " .. color.link)
else
vim.cmd(hl)
end
end
---Simple string interpolation.
---Example template: "${name} is ${value}"
---@param str string template string
---@param table table key value pairs to replace in the string
---@return table
function utils.template(str, table)
return (str:gsub("($%b{})", function(w)
return table[w:sub(3, -2)] or w
end))
end
---Template values in a table recursivly
---@param table table the table to be replaced
---@param values table the values to be replaced by the template strings in the table passed in
---@return table table
function utils.template_table(table, values)
-- if the value passed is a string the return templated resolved string
if type(table) == "string" then
return utils.template(table, values)
end
-- If the table passed in has a table then iterate though the children and call template table
for key, value in pairs(table) do
table[key] = utils.template_table(value, values)
end
return table
end
---Set the theme's syntax
---@param highlight_groups table
---@return nil
function utils.set_syntax(highlight_groups)
for group, colors in pairs(highlight_groups) do
utils.create_highlights(group, colors)
end
end
---Set the terminal colors
---@param theme table
---@return nil
function utils.terminal(theme)
vim.g.terminal_color_0 = theme.colors.black
vim.g.terminal_color_1 = theme.colors.red
vim.g.terminal_color_2 = theme.colors.green
vim.g.terminal_color_3 = theme.colors.yellow
vim.g.terminal_color_4 = theme.colors.blue
vim.g.terminal_color_5 = theme.colors.purple
vim.g.terminal_color_6 = theme.colors.cyan
vim.g.terminal_color_7 = theme.colors.white
vim.g.terminal_color_8 = theme.colors.black
vim.g.terminal_color_9 = theme.colors.red
vim.g.terminal_color_10 = theme.colors.green
vim.g.terminal_color_11 = theme.colors.yellow
vim.g.terminal_color_12 = theme.colors.blue
vim.g.terminal_color_13 = theme.colors.purple
vim.g.terminal_color_14 = theme.colors.cyan
vim.g.terminal_color_15 = theme.colors.white
end
---Pretty print a table
---@param tbl table
---@return string
function utils.print_table(tbl)
require("pl.pretty").dump(tbl)
end
---Set an autocommand
---Taken from https://github.com/norcalli/nvim_utils/blob/master/lua/nvim_utils.lua#L554-L567
-- @param definitions table
-- @return vim.api
function utils.create_augroups(definitions)
for group_name, definition in pairs(definitions) do
vim.api.nvim_command("augroup " .. group_name)
vim.api.nvim_command("autocmd!")
for _, def in ipairs(definition) do
-- if type(def) == 'table' and type(def[#def]) == 'function' then
-- def[#def] = lua_callback(def[#def])
-- end
local command =
table.concat(vim.tbl_flatten { "autocmd", def }, " ")
vim.api.nvim_command(command)
end
vim.api.nvim_command("augroup END")
end
end
---When a user moves from a filetype with specific hlgroups to a filetype with
---none, we need to apply the theme's default hlgroups. To make this less
---expensive, we match the users configured filetype hlgroups to the theme's
---@param table hlgroups hlgroups from the theme + the user's config
---@param table fhlgroups hlgroups for filetypes from the user's config
---@return table
local function intersect_groups(hlgroups, fhlgroups)
-- Find the intersection between the tables and extract the common hlgroups
local matched_groups = {}
for filetype, _ in pairs(fhlgroups) do
for group, _ in pairs(fhlgroups[filetype]) do
if matched_groups[group] == nil then
matched_groups[group] = true
end
end
end
-- Then extract the matched groups from the theme's hlgroups
local retained_hlgroups = {}
for group, _ in pairs(matched_groups) do
retained_hlgroups[group] = hlgroups[group]
end
return retained_hlgroups
end
---Return true if any pattern in the tbl matches the provided value
---@param tbl table
---@param val string
---@return boolean
local function find_pattern_match(tbl, val)
return tbl and next(vim.tbl_filter(function(pattern)
return val:match(pattern)
end, tbl))
end
---Ignore a buffer based on the filetype or the buffertype
-- @return boolean
local function ignore_buffer()
local buftype = vim.bo.buftype
local filetype = vim.bo.filetype
return
find_pattern_match(vim.g.theme_fhlgroups_ignore.filetypes, filetype) or
find_pattern_match(vim.g.theme_fhlgroups_ignore.buftypes, buftype)
end
---Set custom hlgroups based on the buffer filetype
---@param string force_apply forcefully apply highlighting
---@return nil
function utils.set_fhlgroups(force_apply)
local filetype = vim.bo.filetype
if (filetype == vim.g.theme_last_filetype and not force_apply) or
ignore_buffer() or filetype == "" then
return
end
local hlgroups = vim.g.theme_hlgroups
local fhlgroups = vim.g.theme_fhlgroups
-- If the user has moved to a new buffer filetype and there are no specific
-- configs set, then we reapply the theme's default hlgroups to override
-- any previously applied ones
if not fhlgroups[filetype] then
if vim.g.theme_applied_fhlgroups then
for group, colors in pairs(hlgroups) do
utils.create_highlights(group, colors)
end
vim.g.theme_applied_fhlgroups = false
end
return
end
for group, colors in pairs(fhlgroups[filetype]) do
utils.create_highlights(group, colors)
end
vim.g.theme_last_filetype = filetype
vim.g.theme_applied_fhlgroups = true
end
---Load the desired theme
---@param theme table
---@return nil
function utils.load_theme(theme)
-- Prevent double loading of the theme
if vim.g.colors_name == "onedarkpro" and vim.g.onedarkpro_style ==
theme.colors.name then
return
end
vim.cmd("hi clear")
if vim.fn.exists("syntax_on") then
vim.cmd("syntax reset")
end
vim.o.termguicolors = true
vim.g.colors_name = "onedarkpro"
vim.g.onedarkpro_style = theme.colors.name
-- Replace color variables in the user's custom hlgroups
local hlgroups = utils.template_table(theme.config.hlgroups, theme.colors)
-- Merge the user's custom hlgroups with the theme's
local adjusted_hlgroups = utils.tbl_deep_extend(theme.hlgroups, hlgroups)
utils.set_syntax(adjusted_hlgroups)
-- Colors for the Neovim terminal
if theme.config.options.terminal_colors then
utils.terminal(theme)
end
-- Configure any filetype highlight groups
local next = next -- next as a local var is most efficient
if next(theme.config.filetype_hlgroups) ~= nil then
-- Replace the color variables with actual colors
local fhlgroups = utils.template_table(theme.config.filetype_hlgroups,
theme.colors)
-- Set global vars to be accessed when moving between filetype buffers
vim.g.theme_fhlgroups = fhlgroups
vim.g.theme_fhlgroups_ignore = theme.config.filetype_hlgroups_ignore
vim.g.theme_hlgroups = intersect_groups(adjusted_hlgroups, fhlgroups)
local autocmds = {
onedarkpro_theme_autocmds = {
-- TODO: add additional events such as BufFilePost, BufDelete
{
"BufEnter",
"*",
"lua require(\"onedarkpro.utils\").set_fhlgroups()"
},
-- Brute force a refresh when the colorscheme changes
{
"ColorScheme",
"*",
"lua require(\"onedarkpro.utils\").set_fhlgroups(true)"
}
}
}
utils.create_augroups(autocmds)
end
-- Check if the user is using the "link =" annotations correctly
local warn = 0
for _, colors in pairs(hlgroups) do
for key, _ in pairs(colors) do
if key ~= "fg" and key ~= "bg" and key ~= "sp" and key ~= "style" and
key ~= "link" then
warn = warn + 1
end
end
end
if warn > 0 then
utils.warn(
"Directly referencing highlight groups has now changed. Please use the `link` keyword",
"EXAMPLE: onedarkpro.setup({ hlgroups = { ModeMsg = { link = 'LineNr' } } })",
"See https://github.com/olimorris/onedarkpro.nvim for more info",
"-----------------------------------------------------------------------------------")
end
-- Warn the user about the deprecated cursorline option
if theme.config.highlight_cursorline then
utils.warn(
"`highlight_cursorline` has been moved into the options table of your config and is now deprecated",
"EXAMPLE: onedarkpro.setup({ options = { highlight_cursorline = true } })",
"See https://github.com/olimorris/onedarkpro.nvim for more info",
"-----------------------------------------------------------------------------------")
end
if theme.config.options.highlight_cursorline then
utils.warn(
"`highlight_cursorline` has been renamed to `cursorline` and will soon be deprecated",
"EXAMPLE: onedarkpro.setup({ options = { cursorline = true } })",
"See https://github.com/olimorris/onedarkpro.nvim for more info",
"-----------------------------------------------------------------------------------")
end
-- Warn the user about the deprecated transparent option
if theme.config.options.transparent then
utils.warn(
"The `transparent` option has been renamed to `transparency` and will soon be deprecated",
"EXAMPLE: onedarkpro.setup({ options = { transparency = true } })",
"See https://github.com/olimorris/onedarkpro.nvim for more info",
"-----------------------------------------------------------------------------------")
end
-- Trigger an autocommand on loading the theme
vim.cmd([[doautocmd ColorScheme]])
end
return utils
|
-- Copyright (C) Miracle
-- Copyright (C) Titan, Co.Ltd.
local _M = {
_VERSION = "1.0.0β"
}
local twaf_func = require "lib.twaf.inc.twaf_func"
--local twaf_conf = require "lib.twaf.twaf_conf"
_M.api = {}
_M.help = {}
_M.api.pset = {}
-- get pset config e.g: GET host/path/pset/{pset_uuid}
_M.api.pset.get = function(_twaf, _log, u)
local pset = _twaf.config.pset or {}
if not u[2] then
_log.result = pset
return
end
local info = pset[u[2]]
if not info then
_log.success = 0
_log.reason = "No pset '"..u[2].."'"
end
_log.result = info
return
end
-- post pset config e.g: POST host/path/pset/{pset_uuid}
_M.api.pset.post = function(_twaf, _log, u)
-- check request body
local data = twaf_func.api_check_json_body(_log)
if not data then
return
end
if type(data.config) ~= "table" then
_log.success = 0
_log.reason = "rules: table expected, got "..type(data.config)
return
end
local uuid = u[2]
if not uuid then
_log.success = 0
_log.reason = "Not specified pset uuid"
return
end
local pset = _twaf.config.pset
if not pset then
_twaf.config.pset = {}
pset = _twaf.config.pset
end
if pset[uuid] then
_log.success = 0
_log.reason = "pset '"..uuid.."' have exist"
return
end
pset[uuid] = data.config
_log.result = pset[uuid]
return
end
-- put pset config e.g: PUT host/path/pset/{pset_uuid}
_M.api.pset.put = function(_twaf, _log, u)
-- check request body
local data = twaf_func.api_check_json_body(_log)
if not data then
return
end
if type(data.config) ~= "table" then
_log.success = 0
_log.reason = "Table expected, got '"..type(data.config).."'"
return
end
local uuid = u[2]
local pset = _twaf.config.pset
if not uuid then
_log.success = 0
_log.reason = "Not specified pset uuid"
return
end
if not pset[uuid] then
_log.success = 0
_log.reason = "Not found pset '"..uuid.."'"
return
end
pset[uuid] = data.config
_log.result = pset[uuid]
return
end
-- delete pset config e.g: DELETE host/path/pset/{pset_uuid}
_M.api.pset.delete = function(_twaf, _log, u)
local pset = _twaf.config.pset or {}
if not u[2] then
_log.success = 0
_log.reason = "Not specified pset uuid"
return
end
_log.result = pset[u[2]] or "No rule set '"..u[2].."'"
pset[u[2]] = nil
return
end
_M.help.pset = {
"GET host/path/pset/{pset_uuid}",
"POST host/path/pset/{pset_uuid}",
"PUT host/path/pset/{pset_uuid}",
"DELETE host/path/pset/{pset_uuid}"
}
_M.ChangeList = {
["1.0.0β"] = "2019-11-07 - miracle - new api pset"
}
return _M
|
--
-- Compatibility hacks for digtron to work well with technic plus new network system
--
-- More information:
-- https://github.com/mt-mods/technic/issues/100
--
local function power_connector_compat()
local digtron_technic_run = minetest.registered_nodes["digtron:power_connector"].technic_run
minetest.override_item("digtron:power_connector",{
technic_run = function(pos, node)
local network_id = technic.pos2network(pos)
local sw_pos = network_id and technic.network2sw_pos(network_id)
local meta = minetest.get_meta(pos)
meta:set_string("HV_network", sw_pos and minetest.pos_to_string(sw_pos) or "")
return digtron_technic_run(pos, node)
end,
technic_on_disable = function(pos, node)
local meta = minetest.get_meta(pos)
meta:set_string("HV_network", "")
meta:set_string("HV_EU_input", "")
end,
})
end
minetest.register_on_mods_loaded(function()
if minetest.registered_nodes["digtron:power_connector"] then
power_connector_compat()
end
end)
|
object_tangible_loot_creature_loot_collections_trader_mun_left_leg = object_tangible_loot_creature_loot_collections_shared_trader_mun_left_leg:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_trader_mun_left_leg, "object/tangible/loot/creature/loot/collections/trader_mun_left_leg.iff")
|
local entry = require('cheat.entry')
return {
entry = entry
}
|
--[[
Teleport-To-Train-Station
a Factorio mod.
(C) SyDream - 2020 - v1.0.1
MIT License
https://github.com/tommasodargenio/syd-teleport-to-train-station
https://mods.factorio.com/mod/syd-teleport-to-train-station
CONTROL.LUA
-- Core of the mod includes all the runtime scripting
--]]
teleport_ts_win = {type="frame", name="teleport-ts-gui", direction="vertical", header_filler_style={type="empty_widget_style", parent="draggable_space_header", height=24}, use_header_filler=true}
train_station_filter = ""
teleport_gui = nil
gui_location = nil
function train_station_teleport(player_idx, station_selected)
local train_stations_list = get_train_stations_list()
local train_station_position = nil
local player = game.players[player_idx]
local destination_surface = game.surfaces["nauvis"]
local destination_pos = nil
if (station_selected > table_size(train_stations_list)) then return end
train_station_position = train_stations_list[station_selected].position
if train_station_position ~= nil then
if player.vehicle and player.vehicle.valid and player.vehicle.type=="spider-vehicle" then
player.surface.play_sound({path="utility/cannot_build"})
elseif player.vehicle and player.vehicle.valid and player.vehicle.type=="car" then
if math.floor(player.vehicle.position.x + 0.5) ~= math.floor(train_station_position.x + 0.5) or
math.floor(player.vehicle.position.y + 0.5) ~= math.floor(train_station_position.y + 0.5) then
destination_pos = destination_surface.find_non_colliding_position(player.vehicle.prototype.name, train_station_position, 10, 1)
if not destination_pos then destination_pos = train_station_position end
player.vehicle.teleport(destination_pos, destination_surface)
end
elseif player.character and player.character.valid then
if math.floor(player.position.x + 0.5) ~= math.floor(train_station_position.x + 0.5) or
math.floor(player.position.y + 0.5) ~= math.floor(train_station_position.y + 0.5) then
destination_pos = destination_surface.find_non_colliding_position(player.character.prototype.name, train_station_position, 10, 1)
if not destination_pos then destination_pos = train_station_position end
player.teleport(destination_pos, destination_surface)
end
elseif player and player.valid then
player.teleport(train_station_position)
end
end
end
local function has_value (tab, val)
for index, value in ipairs(tab) do
if value == val then
return true
end
end
return false
end
function get_train_stations_list(train_filter)
local train_stations = {}
local train_stations_ordered = {}
local train_station_names = {}
local surface = game.surfaces["nauvis"]
local t = surface.get_train_stops()
for _, train_station in pairs(t) do
if not has_value(train_station_names,train_station.backer_name) then
table.insert(train_stations, {name=train_station.backer_name, position=train_station.position})
table.insert(train_station_names, train_station.backer_name)
end
end
table.sort(train_station_names)
for _, name in pairs(train_station_names) do
for _, train_station in pairs(train_stations) do
if (train_station.name == name) then
if (train_filter and train_filter ~= "") then
if (string.match(train_station.name:lower(), train_filter:lower())) then
table.insert(train_stations_ordered, train_station)
end
else
table.insert(train_stations_ordered, train_station)
end
break
end
end
end
return train_stations_ordered
end
function get_train_stations_name(train_stations_list)
local train_stations_names = {}
if (table_size(train_stations_list)>0) then
for _, train_station in pairs(train_stations_list) do
table.insert(train_stations_names, train_station.name)
end
end
return train_stations_names
end
function teleport_ts_shortcut(event)
if event.prototype_name == "teleport-ts-button-shortcut" then
on_hotkey_main(event)
end
end
function on_hotkey_main(event)
local gui = game.players[event.player_index].gui
if not gui.screen["teleport-ts-gui"] then
teleport_gui_draw(gui,get_train_stations_name(get_train_stations_list()), false, true)
end
end
function teleport_gui_draw(gui,train_stations_list,filter_toggle,firstLoad)
local teleport_ts_btn = {type="button", name="teleport-ts-gui-btn", caption={"mod-interface.teleport-ts-button"}}
teleport_gui = gui.screen.add(teleport_ts_win)
local title_flow = teleport_gui.add{type = "flow", name="title_flow"}
local title = title_flow.add{type = "label", name="teleport-ts-gui-title-label", caption={"mod-interface.teleport-ts-gui-title-caption"}, style="frame_title"}
title.drag_target = teleport_gui
local pusher = nil
pusher = title_flow.add{type = "empty-widget", name="teleport-ts-gui-draggable-space-header",style="draggable_space_header"}
pusher.style.vertically_stretchable = true
pusher.style.horizontally_stretchable = true
pusher.drag_target = teleport_gui
if (filter_toggle == true) then
title_flow.add{type="textfield", name="teleport-ts-gui-dd-filter-query", style="teleport_ts_gui_dd_filter_query"}
title_flow["teleport-ts-gui-dd-filter-query"].focus()
title_flow["teleport-ts-gui-dd-filter-query"].text = train_station_filter
end
title_flow.add{type="sprite-button", style="frame_action_button", sprite="utility/search_white", name="teleport-ts-gui-toggle-filter"}
title_flow.add{type="sprite-button", style="frame_action_button", sprite="utility/close_white", name="close-teleport-ts-window"}
if (table_size(train_stations_list)>0) then
local teleport_ts_dropdown = {type="drop-down", name="teleport-ts-gui-dd", items=train_stations_list, selected_index=1}
local dd_flow = teleport_gui.add{type="flow", name="dd_flow"}
dd_flow.add{type="label", name="teleport-ts-gui-dd-label", caption={"mod-interface.teleport-ts-gui-dd-caption"}}
dd_flow.add(teleport_ts_dropdown)
dd_flow.add(teleport_ts_btn)
else
local dd_flow = teleport_gui.add{type="flow", name="dd_flow"}
dd_flow.add{type="label", caption={"mod-interface.teleport-ts-gui-dd-empty-caption"}}
end
if (firstLoad==true) then
teleport_gui.location = {300, 250}
elseif (gui_location ~= nil) then
teleport_gui.location = gui_location
end
end
function guiElementContains(haystack, needle)
for _, item in pairs(haystack) do
if (item.name==needle) then
return true
end
end
return false
end
function cleanGUI()
local screenGui = game.players[1].gui.screen
if table_size(screenGui.children)>0 then
if screenGui["teleport-ts-gui"] ~= nil then
local leftoverTSGui = screenGui.children[1]
leftoverTSGui.destroy()
end
end
train_station_filter = ""
end
function resyncTeleportGui(player_index)
if game.players[player_index].gui.screen["teleport-ts-gui"] ~= nil then
teleport_gui = game.players[player_index].gui.screen["teleport-ts-gui"]
end
end
script.on_event(defines.events.on_gui_text_changed, function(event)
if (event.element.name=="teleport-ts-gui-dd-filter-query") then
train_station_filter = event.element.text
gui_location = teleport_gui.location
teleport_gui.destroy()
local gui = game.players[event.player_index].gui
teleport_gui_draw(gui,get_train_stations_name(get_train_stations_list(train_station_filter)), true, false)
end
end)
script.on_event(defines.events.on_gui_click, function(event)
resyncTeleportGui(event.player_index)
if (event.element.name=="teleport-ts-gui-btn") then
local gui_win = game.players[event.player_index].gui.screen["teleport-ts-gui"]
train_station_teleport(event.player_index, gui_win.dd_flow["teleport-ts-gui-dd"].selected_index)
elseif (event.element.name=="teleport-ts-gui-toggle-filter") then
local gui_win = game.players[event.player_index].gui.screen["teleport-ts-gui"].title_flow
if (guiElementContains(gui_win.children, "teleport-ts-gui-dd-filter-query")) then
gui_location = teleport_gui.location
teleport_gui.destroy()
local gui = game.players[event.player_index].gui
teleport_gui_draw(gui,get_train_stations_name(get_train_stations_list()), false, false)
else
gui_location = teleport_gui.location
teleport_gui.destroy()
local gui = game.players[event.player_index].gui
teleport_gui_draw(gui,get_train_stations_name(get_train_stations_list(train_station_filter)), true, false)
end
elseif (event.element.name=="close-teleport-ts-window") then
if (teleport_gui ~= nil) then
teleport_gui.destroy()
train_station_filter = ""
else
cleanGUI()
end
elseif (event.element.name=="toggleTeleportTS") then
local gui = game.players[event.player_index].gui
if not gui.screen["teleport-ts-gui"] then
teleport_gui_draw(gui,get_train_stations_name(get_train_stations_list()), false, true)
end
end
end)
script.on_configuration_changed(function (changes)
cleanGUI()
end)
script.on_event("teleport-to-train-station-hotkey", on_hotkey_main)
script.on_event(defines.events.on_lua_shortcut, teleport_ts_shortcut)
|
--[[---------------------------------------------------------
Name: Variables
-----------------------------------------------------------]]
local PANEL = {}
--[[---------------------------------------------------------
Name: Init
-----------------------------------------------------------]]
function PANEL:Init()
--> Variables
self.friends = {}
self.friendsID = {}
--> Frame
self:SetSize(850, 700)
self:Center()
--> Status
self.status = vgui.Create("DPanel", self)
self.status:SetSize(self:GetWide()-40, 54)
self.status:SetPos(20, 140-54/2)
self.status.text = "test"
self.status.Paint = function(pnl, w, h)
--> Background
draw.RoundedBox(6, 0, 0, w, h, Color(215, 215, 215, 255))
draw.RoundedBox(6, 1, 1, w-2, h-2, Color(240, 240, 240, 255))
--> Text
draw.SimpleText(self.status.text, "TCB-Scoreboard-BoldFont-30", 15, h/2-1, Color(195, 210, 215, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
end
--> Reload
self.reload = vgui.Create("DButton", self.status)
self.reload:Dock(RIGHT)
self.reload:DockMargin(10, 10, 10, 10)
self.reload:SetWide(120)
self.reload:SetText("")
self.reload.Paint = function(pnl, w, h)
--> Background
draw.RoundedBox(6, 0, 0, w, h, Color(50, 190, 110, 255))
--> Hover
if pnl.Hovered then
draw.RoundedBox(6, 0, 0, w, h, Color(255, 255, 255, 20))
end
--> Text
draw.SimpleText(TCBScoreboardSettings.trans.refresh, "TCB-Scoreboard-BoldFont-22", w/2, h/2, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
self.reload.DoClick = function()
--> Reload
self:UpdatePanel(false, true)
end
--> Content
self.content = vgui.Create("DScrollPanel", self)
self.content:SetSize(self:GetWide()-40, self:GetTall()-170-(self.status:GetTall()/2))
self.content:SetPos(20, 140+(self.status:GetTall()/2)+10)
self.content.Paint = function(pnl, w, h)
--> Variables
w = w-25
--> Background
draw.RoundedBox(6, 0, 0, w, h, Color(215, 215, 215, 255))
draw.RoundedBox(6, 1, 1, w-2, h-2, Color(255, 255, 255, 255))
end
--> Scrollbar
self.content.VBar.Paint = function(pnl, w, h)
--> Background
draw.RoundedBox(6, 0, 0, w, h, Color(215, 215, 215, 255))
draw.RoundedBox(6, 1, 1, w-2, h-2, Color(255, 255, 255, 255))
end
self.content.VBar.btnGrip.Paint = function(pnl, w, h)
--> Background
draw.RoundedBox(4, 3, 3, w-6, h-6, Color(215, 215, 215, 255))
end
self.content.VBar.btnUp.Paint = function(pnl, w, h)
--> Border
draw.RoundedBox(0, 0, h-1, w, 1, Color(215, 215, 215, 255))
--> Text
draw.SimpleText("▲", "TCB-Scoreboard-Font-16", (w/2)+2, (h/2), Color(215, 215, 215, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
self.content.VBar.btnDown.Paint = function(pnl, w, h)
--> Border
draw.RoundedBox(0, 0, 0, w, 1, Color(215, 215, 215, 255))
--> Text
draw.SimpleText("▼", "TCB-Scoreboard-Font-16", (w/2)+2, (h/2), Color(215, 215, 215, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
--> Content Scroll
self.contentScroll = vgui.Create("DPanel", self.content)
self.contentScroll:SetSize(1, self.content:GetTall()+1)
self.contentScroll.Paint = function() end
--> MenuItems
self.menuItems = {}
self.menuItems[0] = {
name = TCBScoreboardSettings.trans.online,
active = true,
display = function()
--> Variables
local sizeH = math.Round(self.content:GetTall()/6)
--> Clear
self.content:Clear()
self.content:GetVBar():SetScroll(0)
--> Content Scroll
self.contentScroll = vgui.Create("DPanel", self.content)
self.contentScroll:SetSize(1, self.content:GetTall()+1)
self.contentScroll.Paint = function() end
--> Status
self.status.text = string.Replace(TCBScoreboardSettings.trans.showPlayers, "%", tostring(#player.GetAll()))
--> Loop
for k, v in pairs(player.GetAll()) do
--> Panel
local panel = vgui.Create("TCB-Scoreboard-Player", self.content)
panel:DockMargin(1, 0, 10, 0)
panel:SetTall(sizeH)
panel:Dock(TOP)
panel:SetPlayer(v)
end
end
}
self.menuItems[1] = {
name = TCBScoreboardSettings.trans.friends,
active = false,
display = function()
--> Variables
local sizeH = math.Round(self.content:GetTall()/6)
--> Clear
self.content:Clear()
self.content:GetVBar():SetScroll(0)
--> Content Scroll
self.contentScroll = vgui.Create("DPanel", self.content)
self.contentScroll:SetSize(1, self.content:GetTall()+1)
self.contentScroll.Paint = function() end
--> Status
self.status.text = string.Replace(TCBScoreboardSettings.trans.showFriends, "%", tostring(#self.friends))
--> Loop
for k, v in pairs(self.friends) do
--> Panel
local panel = vgui.Create("TCB-Scoreboard-Player", self.content)
panel:DockMargin(1, 0, 10, 0)
panel:SetTall(sizeH)
panel:Dock(TOP)
panel:SetPlayer(v)
end
end
}
self.menuItems[2] = {
name = TCBScoreboardSettings.trans.staff,
active = false,
display = function()
--> Variables
local sizeH = math.Round(self.content:GetTall()/6)
--> Clear
self.content:Clear()
self.content:GetVBar():SetScroll(0)
--> Content Scroll
self.contentScroll = vgui.Create("DPanel", self.content)
self.contentScroll:SetSize(1, self.content:GetTall()+1)
self.contentScroll.Paint = function() end
--> Loop
local staffCount = 0
for k, v in pairs(player.GetAll()) do
--> Staff
if !table.HasValue(string.Explode(",", TCBScoreboardSettings.staffGroups), v:GetUserGroup()) then continue end
--> Count
staffCount = staffCount+1
--> Panel
local panel = vgui.Create("TCB-Scoreboard-Player", self.content)
panel:DockMargin(1, 0, 10, 0)
panel:SetTall(sizeH)
panel:Dock(TOP)
panel:SetPlayer(v)
panel.staffDisplay = true
end
--> Status
self.status.text = string.Replace(TCBScoreboardSettings.trans.showStaff, "%", tostring(staffCount))
end
}
if TCBScoreboardSettings.collectionID != "" then
self.menuItems[3] = {
name = TCBScoreboardSettings.trans.collection,
active = false,
display = function(force)
--> Force
if !force then return end
--> Variables
local sizeH = math.Round(self.content:GetTall()/6)
--> Clear
self.content:Clear()
self.content:GetVBar():SetScroll(0)
--> Content Scroll
self.contentScroll = vgui.Create("DPanel", self.content)
self.contentScroll:SetSize(1, self.content:GetTall()+1)
self.contentScroll.Paint = function() end
--> Variables
local addons = {}
--> Status
self.status.text = TCBScoreboardSettings.trans.loading
--> Collection
http.Fetch("http://steamcommunity.com/sharedfiles/filedetails/?id="..TCBScoreboardSettings.collectionID, function(body, len, headers, code)
--> Collection Info
local collectionInfo = vgui.Create("DPanel", self.content)
collectionInfo:DockMargin(1, 0, 10, 0)
collectionInfo:SetTall(sizeH)
collectionInfo:Dock(TOP)
collectionInfo.Paint = function(pnl, w, h)
--> Border
draw.RoundedBox(0, 0, h-1, w, 1, Color(215, 215, 215, 200))
end
--> Collection Text
local collectionText = vgui.Create("DPanel", collectionInfo)
collectionText:Dock(LEFT)
collectionText:DockMargin(30, 10, 10, 10)
collectionText:SetWide(400)
collectionText.Paint = function(pnl, w, h)
--> Text
draw.SimpleText(string.match(body, '<div class="workshopItemTitle">([^<]*)</div>'), "TCB-Scoreboard-BoldFont-20", 0, 24, Color(200, 200, 200, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
draw.SimpleText(TCBScoreboardSettings.trans.collection, "TCB-Scoreboard-BoldFont-16", 0, 44, Color(55, 75, 95, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
end
--> Collection View
local collectionView = vgui.Create("DButton", collectionInfo)
collectionView:Dock(RIGHT)
collectionView:DockMargin(31, 29, 31, 29)
collectionView:SetSize(125, 26)
collectionView:SetText("")
collectionView.Paint = function(pnl, w, h)
--> Background
draw.RoundedBox(4, 0, 0, w, h, Color(50, 150, 220, 255))
--> Text
draw.SimpleText(TCBScoreboardSettings.trans.viewOnline, "TCB-Scoreboard-BoldFont-18", w/2, h/2, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
collectionView.DoClick = function()
--> Open
gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id="..TCBScoreboardSettings.collectionID)
end
--> Items
addons = string.Explode('class="collectionItem">', body)
--> Lopp
for k,v in pairs(addons) do
--> Skip
if k == 1 then continue end
--> Variables
local item = {}
--> Info
item['id'] = string.match(v, 'SubscribeItemBtn([^"]*)')
item['name'] = string.match(v, '<div class="workshopItemTitle">([^<]*)</div>')
item['image'] = string.match(v, '<img class="workshopItemPreviewImage" src="([^"]*)">')
item['author'] = string.match(v, '<span class="workshopItemAuthorName">[^>]*>([^<]*)')
--> Panel
local panel = vgui.Create("TCB-Scoreboard-Workshop", self.content)
panel:DockMargin(1, 0, 10, 0)
panel:SetTall(sizeH)
panel:Dock(TOP)
panel:SetItem(item)
end
--> Status
self.status.text = string.Replace(TCBScoreboardSettings.trans.showAddons, "%", tostring(#addons))
end)
end
}
end
--> Menu
local tabY = (140-(60+54/2))/2
local tabX = 20
for k,v in pairs(self.menuItems) do
--> Size
surface.SetFont("TCB-Scoreboard-Font-18")
local tabW = surface.GetTextSize(v.name)
--> Tabs
v.tab = vgui.Create("DButton", self)
v.tab:SetSize(tabW+25, 30)
v.tab:SetPos(tabX, 60+(tabY-v.tab:GetTall()/2))
v.tab:SetText('')
v.tab.Paint = function(pnl, w, h)
--> Text
if pnl.Hovered then
draw.SimpleTextOutlined(v.name, "TCB-Scoreboard-Font-18", w/2, h/2, Color(150, 150, 150, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 2, Color(0, 0, 0, 15))
else
draw.SimpleTextOutlined(v.name, "TCB-Scoreboard-Font-18", w/2, h/2, Color(120, 120, 120, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 2, Color(0, 0, 0, 15))
end
--> Active
if v.active then
draw.RoundedBox(0, ((w/2-tabW/2)+10/2)-1, h-4, (tabW-10)+2, 4, Color(0, 0, 0, 25))
draw.RoundedBox(0, (w/2-tabW/2)+10/2, h-3, tabW-10, 2, Color(120, 120, 120, 100))
end
end
v.tab.DoClick = function()
--> Reset
for k,v in pairs(self.menuItems) do
v.active = false
end
--> Active
v.active = true
--> Display
v.display(true)
end
--> Position
tabX = tabX+v.tab:GetWide()+20
end
end
--[[---------------------------------------------------------
Name: UpdatePanel
-----------------------------------------------------------]]
function PANEL:UpdatePanel(friends, force)
--> Friends
if !friends then
--> Network
net.Start("scoreboard_friends")
net.SendToServer()
end
--> Loop
for k,v in pairs(self.menuItems) do
--> Active
if !v.active then continue end
--> Display
v.display(force)
end
end
--[[---------------------------------------------------------
Name: UpdateFriends
-----------------------------------------------------------]]
function PANEL:UpdateFriends(friends)
--> Reset
self.friendsID = {}
--> Players
for k,v in pairs(friends) do
--> Table
table.Add(self.friendsID, {v.steamID})
--> Online
local online = player.GetBySteamID(v.steamID)
--> Set
if online then
friends[k] = online
end
end
--> Friends
self.friends = friends
--> Update
self:UpdatePanel(true)
end
--[[---------------------------------------------------------
Name: GetFriends
-----------------------------------------------------------]]
function PANEL:GetFriends()
--> Return
return self.friendsID
end
--[[---------------------------------------------------------
Name: Paint
-----------------------------------------------------------]]
function PANEL:Paint(w, h)
--> Background
draw.RoundedBoxEx(8, 0, 0, w, h, Color(220, 225, 230, 255), true, true, false, false)
draw.RoundedBoxEx(8, 0, 0, w, 140, Color(50, 50, 50, 255), true, true, false, false)
--> Header
draw.RoundedBoxEx(8, 0, 0, w, 60, Color(30, 140, 200, 255), true, true, false, false)
draw.RoundedBox(0, 0, 60-2, w, 2, Color(0, 0, 0, 100))
--> Title
draw.SimpleTextOutlined(TCBScoreboardSettings.name, "TCB-Scoreboard-Font-28", 20, 28, Color(255, 255, 255, 255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, 2, Color(0, 0, 0, 15))
end
--[[---------------------------------------------------------
Name: Think
-----------------------------------------------------------]]
function PANEL:Think()
--
end
--[[---------------------------------------------------------
Name: DefineControl
-----------------------------------------------------------]]
derma.DefineControl("TCB-Scoreboard", "TCB-Scoreboard", PANEL, "EditablePanel")
|
local Enabled = true
script.Parent.Touched:connect(function(hit)
if Enabled then
local human = hit.Parent:FindFirstChild("Humanoid")
if human then
local Player = game.Players:GetPlayerFromCharacter(human.Parent)
if Player ~= nil then
Enabled = false
script.Parent.Open:Play()
wait(0.3)
Instance.new("Sparkles",script.Parent)
local Amount = script.Parent.PointsBase.Value*(math.random(50,150)/100)
spawn(function()
game.PointsService:AwardPoints(Player.userId,Amount)
end)
game.ReplicatedStorage.Currency:FireClient(Player,script.Parent,"+"..Amount.."RP",Color3.new(0.4,0.5,1),2,245520987)
local chance = math.random(1,13)
if Player:FindFirstChild("VIP") ~= nil then
chance = math.random(1,9)
end
if chance == 5 then
local Box = game.ReplicatedStorage.Boxes.Regular
game.ReplicatedStorage.CurrencyPopup:FireClient(Player,Box.Name.." Box",Box.BoxColor.Value,"rbxassetid://"..Box.ThumbnailId.Value)
local Box = game.ReplicatedStorage.Boxes.Unreal
game.ReplicatedStorage.CurrencyPopup:FireClient(Player,Box.Name.." Box",Box.BoxColor.Value,"rbxassetid://"..Box.ThumbnailId.Value)
local Box = game.ReplicatedStorage.Boxes.Inferno
game.ReplicatedStorage.CurrencyPopup:FireClient(Player,Box.Name.." Box",Box.BoxColor.Value,"rbxassetid://"..Box.ThumbnailId.Value)
--game.ReplicatedStorage.Hint:FireClient(Player,"You found three boxes!")
Player.Crates.Regular.Value = Player.Crates.Regular.Value + 1
Player.Crates.Unreal.Value = Player.Crates.Unreal.Value + 1
Player.Crates.Inferno.Value = Player.Crates.Inferno.Value + 1
game.ReplicatedStorage.SystemAlert:FireAllClients(Player.Name.." found an Inferno Box!")
spawn(function()
wait(0.3)
game.ReplicatedStorage.Currency:FireClient(Player,script.Parent,"+1 Regular Box",Color3.new(1, 17/25, 8/25),3,131144461)
game.ReplicatedStorage.Currency:FireClient(Player,script.Parent,"+1 Unreal Box",Color3.new(17/25, 4/25, 1),3,131144461)
game.ReplicatedStorage.Currency:FireClient(Player,script.Parent,"+1 Inferno Box",Color3.new(1, 6/25, 0),4,131144461)
end)
else
local Box = game.ReplicatedStorage.Boxes.Regular
game.ReplicatedStorage.CurrencyPopup:FireClient(Player,Box.Name.." Box",Box.BoxColor.Value,"rbxassetid://"..Box.ThumbnailId.Value)
--game.ReplicatedStorage.Hint:FireClient(Player,"You found a regular box!")
Player.Crates.Regular.Value = Player.Crates.Regular.Value + 1
spawn(function()
wait(0.3)
game.ReplicatedStorage.Currency:FireClient(Player,script.Parent,"+1 Regular Box",Color3.new(1, 17/25, 8/25),3,131144461)
end)
end
wait(0.35)
script.Parent.Anchored = true
script.Parent.CanCollide = false
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("Decal") then
v:Destroy()
end
end
for i=1,10 do
script.Parent.Transparency = script.Parent.Transparency + 0.1
wait(0.1)
end
wait(2.5)
script.Parent:Destroy()
end
end
end
end)
|
local codec = require("codec")
local connect = require("coro-net").connect
return function(config)
if not config then config = {} end
local read, write = assert(connect {
host = config.host or "localhost",
port = config.port or 6379,
encode = codec.encode,
decode = codec.decode
})
return function(command, ...)
if not command then return write() end
write {command, ...}
local res = read()
if type(res) == "table" and res.error then error(res.error) end
return res
end
end
|
local status, saga = pcall(require, "lspsaga")
if (not status) then return end
saga.init_lsp_saga{
error_sign = '',
warn_sign = '',
hint_sign = '',
infor_sign = '',
code_action_prompt = {
enable = false,
sign = true,
sign_priority = 20,
virtual_text = true,
},
}
vim.api.nvim_set_keymap('n', 'sf', ':Lspsaga lsp_finder<CR>', {noremap=true, silent=true})
vim.api.nvim_set_keymap('n', 'sp', ':Lspsaga preview_definition<CR>', {noremap=true, silent=true})
vim.api.nvim_set_keymap('n', 'sr', ':Lspsaga rename<CR>', {noremap=true, silent=true})
vim.api.nvim_set_keymap('n', 'H', ':Lspsaga hover_doc<CR>', {noremap=true, silent=true})
vim.api.nvim_set_keymap('n', '<C-f>', "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>", {noremap=true, silent=true})
vim.api.nvim_set_keymap('n', '<C-b>', "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>", {noremap=true, silent=true})
|
-----------------------------------
-- Area: Northern San d'Oria
-- NPC: Halaviabeau
-- Quest NPC
-----------------------------------
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
player:startEvent(611)
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
end
|
--[[ Modern TargetFrame Classification Module
by SDPhantom
https://www.wowinterface.com/forums/member.php?u=34145
https://www.curseforge.com/members/sdphantomgamer/projects ]]
--------------------------------------------------------------------------
--------------------------
--[[ Namespace ]]
--------------------------
local AddOn=select(2,...);
AddOn.Options=AddOn.Options or {};
----------------------------------
--[[ Options Defaults ]]
----------------------------------
AddOn.Options.ClassificationTexture=true;
----------------------------------
--[[ Target Classification ]]
----------------------------------
local Enabled,Locked=true,nil;
hooksecurefunc("TargetFrame_CheckClassification",function(self,lock)
if self==TargetFrame or self==FocusFrame then
Locked=lock;-- lock is set when forcing the normal texture
if AddOn.Options.ClassificationTexture and not lock and UnitClassification(self.unit)=="rareelite" then
self.borderTexture:SetTexture("Interface\\TargetingFrame\\UI-TargetingFrame-Rare-Elite");
end
end
end);
----------------------------------
--[[ Feature Registration ]]
----------------------------------
AddOn.RegisterFeature("ClassificationTexture",function()
if TargetFrame:IsShown() then
-- Texture locks only happen with the disabled FocusFrame
TargetFrame_CheckClassification(TargetFrame,Locked);
end
end);
|
local awful = require("awful")
local menu = require("gimpy/menu")
local globals = require("gimpy/globals")
local mouse = {}
mouse.setup_root_mouse_actions = function ()
root.buttons(awful.util.table.join(
awful.button({ }, 3, function () menu.mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
))
end
mouse.get_client_buttons = function ()
return awful.util.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ globals.modkey }, 1, awful.mouse.client.move),
awful.button({ globals.modkey }, 3, awful.mouse.client.resize)
)
end
return mouse
-- vim: ft=lua sts=2 sw=2
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.