content
stringlengths
5
1.05M
TOOL.Category = "C_GM13B_GUI_DEV" TOOL.Name = "#Tool.spawn_curse_detector_upgrade.name" TOOL.Command = nil TOOL.ConfigName = "" TOOL.Information = { { name = "left" }, } if CLIENT then language.Add("Tool.spawn_curse_detector_upgrade.name", "Curse Detector Upgrade") language.Add("Tool.spawn_curse_detector_upgrade.desc", "Spawns Curse Detector Upgrade") language.Add("Tool.spawn_curse_detector_upgrade.left", "Spawn Curse Detector Upgrade") end local function spawn_curse_detector_upgrade(pos) -- please make this a ent. if SERVER then local pos2 = Vector(math.Round(pos.x, 2), math.Round(pos.y, 2), math.Round(pos.z, 2)) local spawn_curse_detector_upgrade = ents.Create("prop_physics") spawn_curse_detector_upgrade:SetNWBool("upgradekit", true) spawn_curse_detector_upgrade:SetName("upgradekit") spawn_curse_detector_upgrade:SetModel("models/weapons/w_package.mdl") spawn_curse_detector_upgrade:Spawn() spawn_curse_detector_upgrade:SetPos(pos2 + Vector(0, 0, 10)) local function _PrintMessage(messageType, message) PrintMessage(messageType, message) end local function SetConeAutoHeal() local curseDetector = ents.FindByClass("gm13_sent_curse_detector")[1] if curseDetector then curseDetector:SetNWBool("readyheal", true) local currentLevel = GM13.Event.Memory:Get("coneLevel") if not currentLevel then return end local areaMultiplier = currentLevel / 2 CGM13.Custom:ProximityTrigger(eventName, "Touch", curseDetector, curseDetector:GetPos(), 150, 75 * areaMultiplier, function(ent) if not ent:IsPlayer() and not ent:IsNPC() then return end if ent:IsNPC() then local somePlayer for k, v in ipairs(player.GetHumans()) do somePlayer = v break end if ent:Disposition(somePlayer) < 3 then -- https://wiki.facepunch.com/gmod/Enums/D return end end if ent:Health() == ent:GetMaxHealth() then return end if curseDetector:GetNWBool("readyheal") then curseDetector:SetNWBool("readyheal", false) local effectdata = EffectData() effectdata:SetOrigin(ent:EyePos() - Vector(0, 0, 20)) effectdata:SetStart(curseDetector.light:GetPos()) curseDetector.light:SetColor(Color(47, 225, 237, 255)) curseDetector.light:SetOn(true) timer.Simple(0.2, function() if curseDetector:IsValid() then curseDetector.light:SetOn(false) curseDetector.light:SetColor(Color(255, 255, 255, 255)) end end) util.Effect("ToolTracer", effectdata) timer.Simple(2 / currentLevel, function() if curseDetector:IsValid() then curseDetector:SetNWBool("readyheal", true) end end) ent:SetHealth(ent:Health() + 3) ent:EmitSound("items/medshot4.wav") if ent:IsPlayer() and currentLevel >= 3 then ent:SetArmor(ent:Armor() + 3) ent:EmitSound("items/battery_pickup.wav") if ent:Armor() >= ent:GetMaxArmor() then ent:SetArmor(ent:GetMaxArmor()) end end if ent:Health() >= ent:GetMaxHealth() then ent:SetHealth(ent:GetMaxHealth()) end end end) curseDetector:CallOnRemove("cgm13_restore_cone_healing", function() timer.Simple(2, function() SetConeAutoHeal() end) end) end end local timerName = "cgm13_upgradekit_check_" .. tostring(spawn_curse_detector_upgrade)-- from https://github.com/Xalalau/Anomaly-Research-Center-ARC/blob/master/lua/arc/events/tier1/submarine/sv_notgrigori.lua timer.Create(timerName, 1, 0, function() if not IsValid(spawn_curse_detector_upgrade) then timer.Remove(timerName) return end for _, ent in pairs(ents.FindInSphere(spawn_curse_detector_upgrade:LocalToWorld(Vector(0, 0, 10)), 20)) do if ent:GetClass() == "gm13_sent_curse_detector" then if GM13.Event.Memory:Get("coneLevel") == 10 then GM13.Ent:FadeOut(spawn_curse_detector_upgrade, 0.5, function() spawn_curse_detector_upgrade:Remove() GM13.Ent:Dissolve(ent, 3) end) return end spawn_curse_detector_upgrade:EmitSound("items/suitchargeok1.wav") local oldLevel = GM13.Event.Memory:Get("coneLevel") or 1 local newLevel = oldLevel + 1 GM13.Event.Memory:Set("coneLevel", newLevel) _PrintMessage(HUD_PRINTCENTER, "The Curse Detector has been upgraded to Level " .. newLevel) _PrintMessage(HUD_PRINTTALK,"The Curse Detector has been upgraded to Level " .. newLevel) if newLevel == 2 then _PrintMessage(HUD_PRINTTALK, "Level 2 Curse Detector: Heals players while any player is near it. Every level after 2 gains faster healing.") end if newLevel == 3 then _PrintMessage(HUD_PRINTTALK, "Level 3 Curse Detector: Each time a player gets healed, the player gains armor of the same amount. Every level after 3 increases healing area.") end SetConeAutoHeal() spawn_curse_detector_upgrade:Remove() break end end end) end end function TOOL:LeftClick(trace) spawn_curse_detector_upgrade(trace.HitPos) return true end function TOOL.BuildCPanel(pnl) pnl:AddControl("Header",{Text = "#Tool.spawn_curse_detector_upgrade.name", Description = "#Tool.spawn_curse_detector_upgrade.desc"}) end
-- DarkShadow6's TARDIS -- It's a telephone booth... Or is it? -- Variable initialization. ExteriorOffset = Vector3.new(math.random(-5000, 5000), math.random(5000, 10000), math.random(-5000, 5000)) ExteriorVelocityTarget = Vector3.new() ExteriorVelocityTargetSpeed = 0 DoorDebounce = true DoorLocked = false DoorOpen = false DamageMaxHealth = 1000 DamageHealth = DamageMaxHealth DamageCanHit = true DamageEffect = {} DamageEffectPart = {} FlyPlayer = nil Flying = false FlySpeed = 30 FlyStabalize = false WeaponPlayer = nil RepairPlayer = nil RepairParts = {} RepairWelds = {} EnergyPlayer = nil EnergyMax = 3 EnergyToWeapon = 0 EnergyToShield = 1 EnergyToFly = 1 EnergyToTeleport = 1 EnergyToRepair = 0 TeleportPlayer = nil TeleportReady = true TeleportWaypoints = { "Center", Vector3.new(0, 0, 20), "Edge of Base (1000x1000)", Vector3.new(494, 0, 494) } RadarPlayer = nil RadarMaxDistance = 100 -- Damage Effect base creation. DamageEffectBase = Instance.new("Part") DamageEffectBase.Name = "Damage Effect" DamageEffectBase.Transparency = 1 DamageEffectBase.CanCollide = false DamageEffectBase.Anchored = true DamageEffectBase.Locked = true DamageEffectBase.TopSurface = 0 DamageEffectBase.BottomSurface = 0 DamageEffectBase.FormFactor = "Custom" DamageEffectBase.Size = Vector3.new(0.2, 0.2, 0.2) Fire = Instance.new("Fire", DamageEffectBase) Fire.Enabled = false Fire.Heat = 1 Fire.Size = 1 Smoke = Instance.new("Smoke", DamageEffectBase) Smoke.Enabled = false Smoke.RiseVelocity = 1 Smoke.Size = 1 -- Model initialization. TARDIS = Instance.new("Model", Workspace.Base) TARDIS.Name = "TARDIS" TeleportValue = Instance.new("Vector3Value", TARDIS) TeleportValue.Name = "Teleport" TeleportValue.Changed:connect(function() Teleport(TeleportValue.Value) end) FlyValue = Instance.new("Vector3Value", TARDIS) FlyValue.Name = "Fly" FlyValue.Changed:connect(function() Flying = true ExteriorVelocityTarget = FlyValue.Value * FlySpeed ExteriorVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) end) StabalizeValue = Instance.new("BoolValue", TARDIS) StabalizeValue.Name = "Stabalize" StabalizeValue.Changed:connect(function() if StabalizeValue == true then ExteriorGyro.maxTorque = Vector3.new(math.huge, 0, math.huge) StabalizeValue.Value = false FlyStabalize = true end end) DestabalizeValue = Instance.new("BoolValue", TARDIS) DestabalizeValue.Name = "Destbalize" DestabalizeValue.Changed:connect(function() if DestabalizeValue.Value == true then ExteriorGyro.maxTorque = Vector3.new(0, 0, 0) DestabalizeValue.Value = false FlyStabalize = false end end) Interior = Instance.new("Model", TARDIS) Interior.Name = "Interior" Exterior = Instance.new("Model", TARDIS) Exterior.Name = "Exterior" -- Interior. Base = Instance.new("Part", Interior) Base.Name = "Base" Base.BrickColor = BrickColor.new("Black") Base.TopSurface = 0 Base.BottomSurface = 0 Base.Locked = true Base.FormFactor = "Custom" Base.Size = Vector3.new(100, 1, 100) Wall = Base:Clone() Wall.Name = "Wall" Wall.BrickColor = BrickColor.new("Pastel brown") Wall.Size = Vector3.new(17.5, 15, 1) Wall.Anchored = false for i = 0, 360, 20 do Wall1 = Wall:Clone() Wall1.Parent = Interior Wall1.Size = Vector3.new(5, 5, 0.2) Wall1.BrickColor = BrickColor.new("Dark stone grey") Wall2 = Wall:Clone() Wall2.Parent = Interior Weld = Instance.new("Weld", Wall1) Weld.Part0 = Wall2 Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0, -0.7) Weld = Instance.new("Weld", Wall2) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(math.sin(math.rad(i)) * 100 / 2.05, 15 / 2 + 0.5, math.cos(math.rad(i)) * 100 / 2.05) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0) end for i = 0, 360, 20 do Wall1 = Wall:Clone() Wall1.Parent = Interior Wall1.Size = Vector3.new(5, 5, 0.2) Wall1.BrickColor = BrickColor.new("Dark stone grey") Wall2 = Wall:Clone() Wall2.Parent = Interior Weld = Instance.new("Weld", Wall1) Weld.Part0 = Wall2 Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0, -0.7) Weld = Instance.new("Weld", Wall2) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(math.sin(math.rad(i)) * 100 / 2.25, 15 * 2 / 1.5, math.cos(math.rad(i)) * 100 / 2.25) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0) Weld.C1 = CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0) end for i = 0, 360, 20 do Wall1 = Wall:Clone() Wall1.Parent = Interior Wall1.Size = Vector3.new(27.5, 45, 1) Weld = Instance.new("Weld", Wall1) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(math.sin(math.rad(i)) * 20, 32 + 0.5, math.cos(math.rad(i)) * 20) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0) Weld.C1 = CFrame.fromEulerAnglesXYZ(math.rad(67.5), 0, 0) for x = 0, 2, 2 do Wall2 = Wall:Clone() Wall2.Parent = Interior Wall2.Size = Vector3.new(5, 5, 0.2) Wall2.BrickColor = BrickColor.new("Dark stone grey") Weld = Instance.new("Weld", Wall2) Weld.Part0 = Wall1 Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 7.5 * x - 7.5 * 2, -0.7) end end Wall.Parent = Interior Wall.Size = Vector3.new(35, 1, 35) Weld = Instance.new("Weld", Wall) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 35, 0) Floor = Wall:Clone() Floor.Parent = Interior Floor.Name = "Floor" Floor.BrickColor = BrickColor.new("Medium stone grey") Floor.Size = Vector3.new(100, 3, 25) Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 3 / 2, 0) Floor = Floor:Clone() Floor.Parent = Interior Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 3 / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) Floor = Instance.new("TrussPart", Interior) Floor.Name = "Floor Ladder" Floor.BrickColor = BrickColor.new("Black") Floor.TopSurface = 0 Floor.BottomSurface = 0 Floor.Locked = true Floor.Size = Vector3.new(15, 2, 2) Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(30, 0.5, -30) * CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0) Floor = Floor:Clone() Floor.Parent = Interior Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-30, 0.5, -30) * CFrame.fromEulerAnglesXYZ(0, math.rad(135), 0) Floor = Floor:Clone() Floor.Parent = Interior Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-30, 0.5, 30) * CFrame.fromEulerAnglesXYZ(0, math.rad(225), 0) Floor = Floor:Clone() Floor.Parent = Interior Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(30, 0.5, 30) * CFrame.fromEulerAnglesXYZ(0, math.rad(315), 0) Floor = Instance.new("WedgePart", Interior) Floor.Name = "Floor" Floor.BrickColor = BrickColor.new("Medium stone grey") Floor.TopSurface = 0 Floor.BottomSurface = 0 Floor.Locked = true Floor.FormFactor = "Custom" Floor.Size = Vector3.new(100, 3, 5) Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 3 / 2, -25 / 2 - 5 / 2) Floor = Floor:Clone() Floor.Parent = Interior Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 3 / 2, 25 / 2 + 5 / 2) * CFrame.fromEulerAnglesXYZ(0, math.rad(180), 0) Floor = Floor:Clone() Floor.Parent = Interior Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-25 / 2 - 5 / 2, 3 / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) Floor = Floor:Clone() Floor.Parent = Interior Weld = Instance.new("Weld", Floor) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(25 / 2 + 5 / 2, 3 / 2, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(270), 0) FloorCenter = Wall:Clone() FloorCenter.Parent = Interior FloorCenter.Name = "Floor Center" FloorCenter.BrickColor = BrickColor.new("Light stone grey") FloorCenter.Size = Vector3.new(25, 1, 25) Weld = Instance.new("Weld", FloorCenter) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 3.5, 0) ConsoleBase = Wall:Clone() ConsoleBase.Parent = Interior ConsoleBase.Name = "Console Base" ConsoleBase.Size = Vector3.new(10, 3, 10) Mesh = Instance.new("CylinderMesh", ConsoleBase) Weld = Instance.new("Weld", ConsoleBase) Weld.Part0 = FloorCenter Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 2, 0) for i = 0, 360, 360 / 6 do ConsoleArm = Floor:Clone() ConsoleArm.Parent = Interior ConsoleArm.Name = "Console Arm" ConsoleArm.BrickColor = BrickColor.new("Black") ConsoleArm.Size = Vector3.new(1, 2, 3) Weld = Instance.new("Weld", ConsoleArm) Weld.Part0 = ConsoleBase Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(math.sin(math.rad(i)) * 3.5, 2.5, math.cos(math.rad(i)) * 3.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(i + 180), 0) end ConsoleSupport = ConsoleBase:Clone() ConsoleSupport.Parent = Interior ConsoleSupport.Name = "Console Support" ConsoleSupport.Size = Vector3.new(4.25, 2, 4.25) Weld = Instance.new("Weld", ConsoleSupport) Weld.Part0 = ConsoleBase Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 2.5, 0) TeleportTelevision = Wall:Clone() TeleportTelevision.Parent = Interior TeleportTelevision.Name = "Teleport Television" TeleportTelevision.BrickColor = BrickColor.new("Really black") TeleportTelevision.Size = Vector3.new(1.5, 1.5, 1.5) Mesh = Instance.new("SpecialMesh", TeleportTelevision) Mesh.MeshType = "FileMesh" Mesh.MeshId = "http://www.roblox.com/Asset/?id=11641931" Mesh.TextureId = "http://www.roblox.com/Asset/?id=11641912" Weld = Instance.new("Weld", TeleportTelevision) Weld.Part0 = ConsoleBase Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-3.35, 2.15, 0.25) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) TeleportTelevisionScreen = Wall:Clone() TeleportTelevisionScreen.Parent = Interior TeleportTelevisionScreen.Name = "Teleport Television Screen" TeleportTelevisionScreen.BrickColor = BrickColor.new("Really black") TeleportTelevisionScreen.Size = Vector3.new(1.15, 1, 0.5) Weld = Instance.new("Weld", TeleportTelevisionScreen) Weld.Part0 = TeleportTelevision Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0, -0.35) coroutine.wrap(function() while true do if TeleportTelevisionScreen:FindFirstChild("Weld") == nil or TeleportPlayer == nil then TeleportTelevisionScreen.BrickColor = BrickColor.new("Really black") TeleportTelevisionScreen.Reflectance = 0.1 else TeleportTelevisionScreen.BrickColor = BrickColor.random() TeleportTelevisionScreen.Reflectance = math.random(0, 100) / 100 wait(math.random(100, 1000) / 7500) end wait() end end)() TeleportKeypad = Wall:Clone() TeleportKeypad.Parent = Interior TeleportKeypad.Name = "Teleport Keypad" TeleportKeypad.BrickColor = BrickColor.new("Dark stone grey") TeleportKeypad.Size = Vector3.new(1, 1, 1) Mesh = Instance.new("SpecialMesh", TeleportKeypad) Mesh.MeshType = "Wedge" Weld = Instance.new("Weld", TeleportKeypad) Weld.Part0 = TeleportTelevision Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(1.25, -0.15, -0.5) for x = -0.4, 0.4, 0.4 do for y = -0.4, 0.4, 0.26 do if not (y == -0.4 and x ~= 0) then TeleportKey = Wall:Clone() TeleportKey.Parent = Interior TeleportKey.Name = "Teleport Key" TeleportKey.BrickColor = BrickColor.new("Dark stone grey") TeleportKey.Size = Vector3.new(0.2, 0.2, 0.2) Mesh = Instance.new("SpecialMesh", TeleportKeypad) Mesh.MeshType = "Wedge" Weld = Instance.new("Weld", TeleportKey) Weld.Part0 = TeleportKeypad Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(x * 0.9, y * 0.9, y) * CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0) end end end RadarTelevision = Wall:Clone() RadarTelevision.Parent = Interior RadarTelevision.Name = "Radar Television" RadarTelevision.BrickColor = BrickColor.new("Really black") RadarTelevision.Size = Vector3.new(2, 2, 1.5) Mesh = Instance.new("SpecialMesh", RadarTelevision) Mesh.MeshType = "FileMesh" Mesh.MeshId = "http://www.roblox.com/Asset/?id=11641883" Mesh.TextureId = "http://www.roblox.com/Asset/?id=11641873" Weld = Instance.new("Weld", RadarTelevision) Weld.Part0 = ConsoleBase Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) Weld.C0 = CFrame.new(math.sin(rad) * 3, 2.5, math.cos(rad) * 3) * CFrame.fromEulerAnglesXYZ(0, rad + math.rad(180), 0) RadarTelevisionScreen = Wall:Clone() RadarTelevisionScreen.Parent = Interior RadarTelevisionScreen.Name = "Radar Television Screen" RadarTelevisionScreen.BrickColor = BrickColor.new("Really black") RadarTelevisionScreen.Size = Vector3.new(1.85, 0.8, 1.35) Weld = Instance.new("Weld", RadarTelevisionScreen) Weld.Part0 = RadarTelevision Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, -0.1, 0) coroutine.wrap(function() while true do if RadarTelevisionScreen:FindFirstChild("Weld") == nil or RadarPlayer == nil then RadarTelevisionScreen.BrickColor = BrickColor.new("Really black") RadarTelevisionScreen.Reflectance = 0.1 else RadarTelevisionScreen.BrickColor = BrickColor.random() RadarTelevisionScreen.Reflectance = math.random(0, 100) / 100 wait(math.random(100, 1000) / 7500) end wait() end end)() FlyMonitorBase = Wall:Clone() FlyMonitorBase.Parent = Interior FlyMonitorBase.Name = "Fly Monitor Base" FlyMonitorBase.BrickColor = BrickColor.new("Dark stone grey") FlyMonitorBase.Size = Vector3.new(1.5, 0.25, 1) Weld = Instance.new("Weld", FlyMonitorBase) Weld.Part0 = ConsoleBase Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 5) Weld.C0 = CFrame.new(math.sin(rad) * 3, 1.625, math.cos(rad) * 3.25) * CFrame.fromEulerAnglesXYZ(0, rad + math.rad(180), 0) FlyMonitorStand = Wall:Clone() FlyMonitorStand.Parent = Interior FlyMonitorStand.Name = "Fly Monitor Stand" FlyMonitorStand.BrickColor = BrickColor.new("Dark stone grey") FlyMonitorStand.Size = Vector3.new(0.5, 1, 0.2) Weld = Instance.new("Weld", FlyMonitorStand) Weld.Part0 = FlyMonitorBase Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0.625, 0.25) FlyMonitorScreenBack = Wall:Clone() FlyMonitorScreenBack.Parent = Interior FlyMonitorScreenBack.Name = "Fly Monitor Screen Back" FlyMonitorScreenBack.BrickColor = BrickColor.new("Dark stone grey") FlyMonitorScreenBack.Size = Vector3.new(2.5, 2, 0.2) Weld = Instance.new("Weld", FlyMonitorScreenBack) Weld.Part0 = FlyMonitorStand Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 1.25, -0.2) FlyMonitorScreenEdge = Wall:Clone() FlyMonitorScreenEdge.Parent = Interior FlyMonitorScreenEdge.Name = "Fly Monitor Screen Edge" FlyMonitorScreenEdge.BrickColor = BrickColor.new("Dark stone grey") FlyMonitorScreenEdge.Size = Vector3.new(2.5, 0.2, 0.2) Weld = Instance.new("Weld", FlyMonitorScreenEdge) Weld.Part0 = FlyMonitorScreenBack Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0.9, -0.2) FlyMonitorScreenEdge = Wall:Clone() FlyMonitorScreenEdge.Parent = Interior FlyMonitorScreenEdge.Name = "Fly Monitor Screen Edge" FlyMonitorScreenEdge.BrickColor = BrickColor.new("Dark stone grey") FlyMonitorScreenEdge.Size = Vector3.new(2.5, 0.2, 0.2) Weld = Instance.new("Weld", FlyMonitorScreenEdge) Weld.Part0 = FlyMonitorScreenBack Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, -0.9, -0.2) FlyMonitorScreenEdge = Wall:Clone() FlyMonitorScreenEdge.Parent = Interior FlyMonitorScreenEdge.Name = "Fly Monitor Screen Edge" FlyMonitorScreenEdge.BrickColor = BrickColor.new("Dark stone grey") FlyMonitorScreenEdge.Size = Vector3.new(0.2, 2, 0.2) Weld = Instance.new("Weld", FlyMonitorScreenEdge) Weld.Part0 = FlyMonitorScreenBack Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(1.15, 0, -0.2) FlyMonitorScreenEdge = Wall:Clone() FlyMonitorScreenEdge.Parent = Interior FlyMonitorScreenEdge.Name = "Fly Monitor Screen Edge" FlyMonitorScreenEdge.BrickColor = BrickColor.new("Dark stone grey") FlyMonitorScreenEdge.Size = Vector3.new(0.2, 2, 0.2) Weld = Instance.new("Weld", FlyMonitorScreenEdge) Weld.Part0 = FlyMonitorScreenBack Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-1.15, 0, -0.2) FlyMonitorScreen = Wall:Clone() FlyMonitorScreen.Parent = Interior FlyMonitorScreen.Name = "Fly Monitor Screen" FlyMonitorScreen.BrickColor = BrickColor.new("Really black") FlyMonitorScreen.Size = Vector3.new(2.4, 1.6, 0.2) Weld = Instance.new("Weld", FlyMonitorScreen) Weld.Part0 = FlyMonitorScreenBack Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0, -0.1) coroutine.wrap(function() while true do if FlyMonitorScreen:FindFirstChild("Weld") == nil or FlyPlayer == nil then FlyMonitorScreen.BrickColor = BrickColor.new("Really black") FlyMonitorScreen.Reflectance = 0.1 else FlyMonitorScreen.BrickColor = BrickColor.random() FlyMonitorScreen.Reflectance = math.random(0, 100) / 100 wait(math.random(100, 1000) / 7500) end wait() end end)() WeaponStand = Wall:Clone() WeaponStand.Parent = Interior WeaponStand.Name = "Weapon Stand" WeaponStand.Size = Vector3.new(0.3, 1.5, 0.2) WeaponStand.BrickColor = BrickColor.new("Black") Weld = Instance.new("Weld", WeaponStand) Weld.Part0 = ConsoleBase Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 1) Weld.C0 = CFrame.new(math.sin(rad) * 4.625, 2.25, math.cos(rad) * 6) * CFrame.fromEulerAnglesXYZ(0, rad, 0) WeaponBinoculars = Wall:Clone() WeaponBinoculars.Parent = Interior WeaponBinoculars.Name = "Weapon Binoculars" WeaponBinoculars.Parent = Interior WeaponBinoculars.Size = Vector3.new(2, 0.5, 1.5) Mesh = Instance.new("SpecialMesh", WeaponBinoculars) Mesh.MeshType = "FileMesh" Mesh.MeshId = "http://www.roblox.com/Asset/?id=27039535" Mesh.TextureId = "http://www.roblox.com/Asset/?id=27039641" Mesh.Scale = Vector3.new(0.5, 0.5, 0.5) Weld = Instance.new("Weld", WeaponBinoculars) Weld.Part0 = ConsoleBase Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 1) Weld.C0 = CFrame.new(math.sin(rad) * 4.75, 2.75, math.cos(rad) * 6) * CFrame.fromEulerAnglesXYZ(0, rad, 0) WeaponJoystickBase = Wall:Clone() WeaponJoystickBase.Parent = Interior WeaponJoystickBase.Name = "Weapon Joystick Base" WeaponJoystickBase.BrickColor = BrickColor.new("Really black") WeaponJoystickBase.Size = Vector3.new(0.8, 0.2, 0.8) Weld = Instance.new("Weld", WeaponJoystickBase) Weld.Part0 = WeaponStand Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(1.25, -0.65, -0.3) WeaponJoystick = Wall:Clone() WeaponJoystick.Parent = Interior WeaponJoystick.Name = "Weapon Joystick" WeaponJoystick.BrickColor = BrickColor.new("Really black") WeaponJoystick.Size = Vector3.new(0.3, 1, 0.3) Mesh = Instance.new("CylinderMesh", WeaponJoystick) Weld = Instance.new("Weld", WeaponJoystick) Weld.Part0 = WeaponJoystickBase Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0.6, 0) WeaponJoystickButton = WeaponJoystick:Clone() WeaponJoystickButton.Parent = Interior WeaponJoystickButton.Name = "Weapon Joystick Button" WeaponJoystickButton.BrickColor = BrickColor.new("Really red") WeaponJoystickButton.Size = Vector3.new(0.2, 0.2, 0.2) Weld = Instance.new("Weld", WeaponJoystickButton) Weld.Part0 = WeaponJoystickBase Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-0.25, 0.2, 0.25) WeaponJoystickBase2 = Wall:Clone() WeaponJoystickBase2.Parent = Interior WeaponJoystickBase2.Name = "Weapon Joystick Base" WeaponJoystickBase2.BrickColor = BrickColor.new("Really black") WeaponJoystickBase2.Size = Vector3.new(0.8, 0.2, 0.8) Weld = Instance.new("Weld", WeaponJoystickBase2) Weld.Part0 = WeaponStand Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-1.25, -0.65, -0.3) WeaponJoystick2 = Wall:Clone() WeaponJoystick2.Parent = Interior WeaponJoystick2.Name = "Weapon Joystick" WeaponJoystick2.BrickColor = BrickColor.new("Really black") WeaponJoystick2.Size = Vector3.new(0.3, 1, 0.3) Mesh = Instance.new("CylinderMesh", WeaponJoystick2) Weld = Instance.new("Weld", WeaponJoystick2) Weld.Part0 = WeaponJoystickBase2 Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0.6, 0) WeaponJoystickButton2 = WeaponJoystick2:Clone() WeaponJoystickButton2.Parent = Interior WeaponJoystickButton2.Name = "Weapon Joystick Button" WeaponJoystickButton2.BrickColor = BrickColor.new("Really red") WeaponJoystickButton2.Size = Vector3.new(0.2, 0.2, 0.2) Weld = Instance.new("Weld", WeaponJoystickButton2) Weld.Part0 = WeaponJoystickBase2 Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0.25, 0.2, 0.25) EnergyTelevision = Wall:Clone() EnergyTelevision.Parent = Interior EnergyTelevision.Name = "Energy Television" EnergyTelevision.BrickColor = BrickColor.new("Really black") EnergyTelevision.Size = Vector3.new(2.25, 2, 1) Mesh = Instance.new("SpecialMesh", EnergyTelevision) Mesh.MeshType = "FileMesh" Mesh.Scale = Vector3.new(1.5, 1.5, 0.5) Mesh.MeshId = "http://www.roblox.com/Asset/?id=11641931" Mesh.TextureId = "http://www.roblox.com/Asset/?id=11641912" Mesh.VertexColor = Vector3.new(0.5, 0.5, 0.5) Weld = Instance.new("Weld", EnergyTelevision) Weld.Part0 = ConsoleBase Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 3) Weld.C0 = CFrame.new(math.sin(rad) * 3.35, 2.45, math.cos(rad) * 3.3) * CFrame.fromEulerAnglesXYZ(0, rad + math.rad(180), 0) EnergyTelevisionScreen = Wall:Clone() EnergyTelevisionScreen.Parent = Interior EnergyTelevisionScreen.Name = "Energy Television Screen" EnergyTelevisionScreen.BrickColor = BrickColor.new("Really black") EnergyTelevisionScreen.Size = Vector3.new(1.5, 1.35, 0.2) Weld = Instance.new("Weld", EnergyTelevisionScreen) Weld.Part0 = EnergyTelevision Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0, -0.3) coroutine.wrap(function() while true do if EnergyTelevisionScreen:FindFirstChild("Weld") == nil or EnergyPlayer == nil then EnergyTelevisionScreen.BrickColor = BrickColor.new("Really black") EnergyTelevisionScreen.Reflectance = 0.1 else EnergyTelevisionScreen.BrickColor = BrickColor.random() EnergyTelevisionScreen.Reflectance = math.random(0, 100) / 100 wait(math.random(100, 1000) / 7500) end wait() end end)() ConsoleGlass = ConsoleBase:Clone() ConsoleGlass.Parent = Interior ConsoleGlass.Name = "Console Glass" ConsoleGlass.Transparency = 0.3 ConsoleGlass.BrickColor = BrickColor.new("Institutional white") ConsoleGlass.Size = Vector3.new(3.75, 10, 3.75) Weld = Instance.new("Weld", ConsoleGlass) Weld.Part0 = ConsoleSupport Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 6, 0) ConsoleTop = ConsoleBase:Clone() ConsoleTop.Parent = Interior ConsoleTop.Name = "Console Top" ConsoleTop.BrickColor = BrickColor.new("Dark stone grey") ConsoleTop.Size = Vector3.new(5, 6, 5) Weld = Instance.new("Weld", ConsoleTop) Weld.Part0 = ConsoleGlass Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 8, 0) for i = 1, 6 / 1.5 do ConsoleRing = Wall:Clone() ConsoleRing.Parent = Interior ConsoleRing.Name = "Console Ring" ConsoleRing.Size = Vector3.new(6, 1, 6) Mesh = Instance.new("SpecialMesh", ConsoleRing) Mesh.MeshType = "Sphere" Weld = Instance.new("Weld", ConsoleRing) Weld.Part0 = ConsoleTop Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, (i * 1.5) - 6 / 1.625, 0) end ConsoleAnchor = ConsoleBase:Clone() ConsoleAnchor.Parent = Interior ConsoleAnchor.Name = "Console Anchor" ConsoleAnchor.BrickColor = BrickColor.new("Medium stone grey") ConsoleAnchor.Size = Vector3.new(12.5, 10, 12.5) Weld = Instance.new("Weld", ConsoleAnchor) Weld.Part0 = ConsoleTop Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 8, 0) for i = 45, 360, 360 / 4 do ConsoleAnchorSupport = Wall:Clone() ConsoleAnchorSupport.Parent = Interior ConsoleAnchorSupport.Name = "Console Anchor Support" ConsoleAnchorSupport.BrickColor = BrickColor.new("Black") ConsoleAnchorSupport.Size = Vector3.new(2, 50, 4) Weld = Instance.new("Weld", ConsoleAnchorSupport) Weld.Part0 = ConsoleAnchor Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(math.sin(math.rad(i)) * 20, -15, math.cos(math.rad(i)) * 20) * CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0) Weld.C1 = CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0) end PowerCore = ConsoleBase:Clone() PowerCore.Parent = Interior PowerCore.Name = "Power Core" PowerCore.BrickColor = BrickColor.new("Bright blue") PowerCore.Transparency = 0.325 PowerCore.Size = Vector3.new(2, 7, 2) Weld = Instance.new("Weld", PowerCore) Weld.Part0 = ConsoleGlass Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0, 0) PowerCoreHolder = PowerCore:Clone() PowerCoreHolder.Parent = Interior PowerCoreHolder.Name = "Power Core Holder" PowerCoreHolder.BrickColor = BrickColor.new("Bright blue") PowerCoreHolder.Size = Vector3.new(1, 1.75, 1) Weld = Instance.new("Weld", PowerCoreHolder) Weld.Part0 = ConsoleGlass Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 4.375, 0) PowerCoreHolder = PowerCoreHolder:Clone() PowerCoreHolder.Parent = Interior Weld = Instance.new("Weld", PowerCoreHolder) Weld.Part0 = ConsoleGlass Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, -4.375, 0) for i = 0, 360, 360 / 4 do PowerRod = PowerCore:Clone() PowerRod.Parent = Interior PowerRod.Name = "Power Rod 1" PowerRod.Size = Vector3.new(0.5, 5, 0.5) Weld = Instance.new("Weld", PowerRod) Weld.Part0 = ConsoleGlass Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(math.sin(math.rad(i)) * 1.5, 2, math.cos(math.rad(i)) * 1.5) end for i = 45, 360, 360 / 4 do PowerRod = PowerCore:Clone() PowerRod.Parent = Interior PowerRod.Name = "Power Rod 2" PowerRod.Size = Vector3.new(0.5, 5, 0.5) Weld = Instance.new("Weld", PowerRod) Weld.Part0 = ConsoleGlass Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(math.sin(math.rad(i)) * 1.5, -2, math.cos(math.rad(i)) * 1.5) end Seat = Instance.new("Seat", Interior) Seat.Name = "Radar Seat" Seat.TopSurface = 0 Seat.BottomSurface = 0 Seat.Locked = true Seat.BrickColor = BrickColor.new("Dark stone grey") Seat.FormFactor = "Custom" Seat.Size = Vector3.new(1, 1, 1) Weld = Instance.new("Weld", Seat) Weld.Part0 = FloorCenter Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) Weld.C0 = CFrame.new(math.sin(rad) * 6, 1, math.cos(rad) * 6) * CFrame.fromEulerAnglesXYZ(0, rad, 0) Seat = Seat:Clone() Seat.Parent = Interior Seat.Name = "Weapon Seat" Weld = Instance.new("Weld", Seat) Weld.Part0 = FloorCenter Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 1) Weld.C0 = CFrame.new(math.sin(rad) * 6, 1, math.cos(rad) * 6) * CFrame.fromEulerAnglesXYZ(0, rad, 0) Seat = Seat:Clone() Seat.Parent = Interior Seat.Name = "Repair Seat" Weld = Instance.new("Weld", Seat) Weld.Part0 = FloorCenter Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 2) Weld.C0 = CFrame.new(math.sin(rad) * 6, 1, math.cos(rad) * 6) * CFrame.fromEulerAnglesXYZ(0, rad, 0) Seat = Seat:Clone() Seat.Parent = Interior Seat.Name = "Energy Seat" Weld = Instance.new("Weld", Seat) Weld.Part0 = FloorCenter Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 3) Weld.C0 = CFrame.new(math.sin(rad) * 6, 1, math.cos(rad) * 6) * CFrame.fromEulerAnglesXYZ(0, rad, 0) Seat = Seat:Clone() Seat.Parent = Interior Seat.Name = "Teleport Seat" Weld = Instance.new("Weld", Seat) Weld.Part0 = FloorCenter Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 4) Weld.C0 = CFrame.new(math.sin(rad) * 6, 1, math.cos(rad) * 6) * CFrame.fromEulerAnglesXYZ(0, rad, 0) Seat = Seat:Clone() Seat.Parent = Interior Seat.Name = "Fly Seat" Weld = Instance.new("Weld", Seat) Weld.Part0 = FloorCenter Weld.Part1 = Weld.Parent rad = math.rad(360 / 6 / 2) + math.rad(360 / 6 * 5) Weld.C0 = CFrame.new(math.sin(rad) * 6, 1, math.cos(rad) * 6) * CFrame.fromEulerAnglesXYZ(0, rad, 0) Teleport = Wall:Clone() Teleport.Parent = Interior Teleport.Name = "Teleport" Teleport.Size = Vector3.new(2, 2, 0.2) Teleport.Transparency = 1 Weld = Instance.new("Weld", Teleport) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 6.5, 47.5) Teleport.Touched:connect(function(Hit) pcall(function() if DoorDebounce == false or DoorOpen == false then return end if Hit.Parent:FindFirstChild("Torso") ~= nil and Hit.Parent:FindFirstChild("Humanoid") ~= nil then Position = Exterior.Teleport.CFrame * CFrame.new(0, 0, -2) while Hit.Parent.Torso.CFrame ~= Position do Hit.Parent.Torso.CFrame = Position end DoorDebounce = false coroutine.wrap(function() wait(1) DoorDebounce = true end)() end end) end) for i = 0, 1, 1 / 20 do Shadow = Wall:Clone() Shadow.Parent = Interior Shadow.Name = "Shadow" Shadow.Transparency = i Shadow.BrickColor = BrickColor.new("Really black") Shadow.Size = Vector3.new(5, 7, 0.2) Shadow.CanCollide = false Weld = Instance.new("Weld", Shadow) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 6.5, 48.5 - (0.2 * (i * 20))) end Wall = Wall:Clone() Wall.Parent = Interior Wall.BrickColor = BrickColor.new("White") Wall.Size = Vector3.new(0.5, 7, 4) Weld = Instance.new("Weld", Wall) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(2.75, 6.5, 47) Wall = Wall:Clone() Wall.Parent = Interior Wall.Size = Vector3.new(0.5, 7, 4) Weld = Instance.new("Weld", Wall) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-2.75, 6.5, 47) Corner = Wall:Clone() Corner.Parent = Interior Corner.Name = "Corner" Corner.BrickColor = BrickColor.new("Medium stone grey") Corner.Size = Vector3.new(1, 7, 1) Weld = Instance.new("Weld", Corner) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-3, 6.5, 44.5) Corner = Corner:Clone() Corner.Parent = Interior Weld = Instance.new("Weld", Corner) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(3, 6.5, 44.5) Door = Wall:Clone() Door.Parent = Interior Door.Name = "Door" Door.BrickColor = BrickColor.new("White") Door.Size = Vector3.new(5, 7, 0.5) Motor = Instance.new("Motor", Door) Motor.Part0 = Base Motor.Part1 = Motor.Parent Motor.C0 = CFrame.new(-2.5, 0, 44.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0) Motor.C1 = CFrame.new(-2.5, -6.5, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0) Motor.MaxVelocity = 0.1 coroutine.wrap(function() while Door.Parent ~= nil do if DoorOpen == false then pcall(function() Exterior.Door.Motor.DesiredAngle = 0 end) pcall(function() Interior.Door.Motor.DesiredAngle = 0 end) else pcall(function() Exterior.Door.Motor.DesiredAngle = math.rad(90) end) pcall(function() Interior.Door.Motor.DesiredAngle = math.rad(90) end) end wait() end end)() DoorLockedBool1 = Instance.new("BoolValue", Door) DoorLockedBool1.Parent = Door DoorLockedBool1.Name = "DoorLocked" DoorLockedBool1.Value = false DoorLockedBool1.Changed:connect(function(Property) DoorLocked = DoorLockedBool1.Value end) coroutine.wrap(function() while true do DoorLockedBool1.Value = DoorLocked wait(0.25) end end)() DoorOpenBool1 = Instance.new("BoolValue", Door) DoorOpenBool1.Parent = Door DoorOpenBool1.Name = "DoorOpen" DoorOpenBool1.Value = false DoorOpenBool1.Changed:connect(function(Property) DoorOpen = DoorOpenBool1.Value if DoorOpen == true then DoorLocked = false end end) coroutine.wrap(function() while true do DoorOpenBool1.Value = DoorOpen wait(0.25) end end)() Sign = Wall:Clone() Sign.Parent = Interior Sign.Name = "Sign" Sign.Size = Vector3.new(2, 2, 0.2) Sign.BrickColor = BrickColor.new("Medium stone grey") Decal = Instance.new("Decal", Sign) Decal.Texture = "http://www.roblox.com/Asset/?id=52411167" Decal.Face = "Front" Weld = Instance.new("Weld", Sign) Weld.Part0 = Door Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 1.75, -0.3) DoorButton = Wall:Clone() DoorButton.Parent = Interior DoorButton.Name = "Door Button" DoorButton.BrickColor = BrickColor.new("Really red") DoorButton.Size = Vector3.new(0.45, 0.45, 0.2) Weld = Instance.new("Weld", DoorButton) Weld.Part0 = Corner Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0, -0.6) ClickDetector = Instance.new("ClickDetector", DoorButton) ClickDetector.MaxActivationDistance = 12 ClickDetector.MouseClick:connect(function() if (DoorLocked or not TeleportReady) and not DoorOpen then return end if DoorOpen == true then DoorOpen = false else DoorOpen = true end end) coroutine.wrap(function() while DoorButton.Parent ~= nil do if DoorOpen == false then DoorButton.BrickColor = BrickColor.new("Really red") else DoorButton.BrickColor = BrickColor.new("Bright green") end wait() end end)() LockButton = Wall:Clone() LockButton.Parent = Interior LockButton.Name = "Door Button" LockButton.BrickColor = BrickColor.new("Really red") LockButton.Size = Vector3.new(0.45, 0.45, 0.2) Weld = Instance.new("Weld", LockButton) Weld.Part0 = Corner Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0.55, -0.6) ClickDetector = Instance.new("ClickDetector", LockButton) ClickDetector.MaxActivationDistance = 12 ClickDetector.MouseClick:connect(function() if DoorLocked == true then DoorLocked = false else DoorLocked = true end end) coroutine.wrap(function() while LockButton.Parent ~= nil do if DoorLocked == false then LockButton.BrickColor = BrickColor.new("Bright green") else LockButton.BrickColor = BrickColor.new("New Yeller") end wait() end end)() Top = Wall:Clone() Top.Parent = Interior Top.Name = "Top 1" Top.BrickColor = BrickColor.new("Medium stone grey") Top.Size = Vector3.new(7, 0.2, 6) Weld = Instance.new("Weld", Top) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 10.1, 47) Top = Floor:Clone() Top.Parent = Interior Top.Name = "Top 2" Top.BrickColor = BrickColor.new("Medium stone grey") Top.Size = Vector3.new(7, 0.5, 3) Weld = Instance.new("Weld", Top) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 10.45, 47) -- Exterior. Base = Wall:Clone() Base.Parent = Exterior Base.Name = "Base" Base.BrickColor = BrickColor.new("Medium stone grey") Base.Size = Vector3.new(7, 0.2, 7) Wall = Base:Clone() Wall.Parent = Exterior Wall.Name = "Wall" Wall.BrickColor = BrickColor.new("White") Wall.Size = Vector3.new(5, 7, 0.5) Weld = Instance.new("Weld", Wall) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 3.6, 2.75) Door = Wall:Clone() Door.Parent = Exterior Door.Name = "Door" Door.Size = Vector3.new(5, 7, 0.5) Motor = Instance.new("Motor", Door) Motor.Part0 = Base Motor.Part1 = Motor.Parent Motor.C0 = CFrame.new(-2.5, 0, -2.75) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0) Motor.C1 = CFrame.new(-2.5, -3.6, 0) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0) Motor.MaxVelocity = 0.1 DoorLockedBool2 = Instance.new("BoolValue", Door) DoorLockedBool2.Parent = Door DoorLockedBool2.Name = "DoorLocked" DoorLockedBool2.Value = false DoorLockedBool2.Changed:connect(function(Property) DoorLocked = DoorLockedBool2.Value end) coroutine.wrap(function() while true do DoorLockedBool2.Value = DoorLocked wait(0.25) end end)() DoorOpenBool2 = Instance.new("BoolValue", Door) DoorOpenBool2.Parent = Door DoorOpenBool2.Name = "DoorOpen" DoorOpenBool2.Value = false DoorOpenBool2.Changed:connect(function(Property) DoorOpen = DoorOpenBool2.Value if DoorOpen == true then DoorLocked = false end end) coroutine.wrap(function() while true do DoorOpenBool2.Value = DoorOpen wait(0.25) end end)() DoorHandleHolder = Wall:Clone() DoorHandleHolder.Parent = Exterior DoorHandleHolder.Name = "Door Handle Holder" DoorHandleHolder.BrickColor = BrickColor.new("Medium stone grey") DoorHandleHolder.Size = Vector3.new(0.35, 0.2, 0.2) Weld = Instance.new("Weld", DoorHandleHolder) Weld.Part0 = Door Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(1.65, 0.5, -0.3) DoorHandleHolder = DoorHandleHolder:Clone() DoorHandleHolder.Parent = Exterior Weld = Instance.new("Weld", DoorHandleHolder) Weld.Part0 = Door Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(1.65, 0, -0.3) DoorHandle = DoorHandleHolder:Clone() DoorHandle.Parent = Exterior DoorHandle.Name = "Door Handle" DoorHandle.Size = Vector3.new(0.35, 0.7, 0.2) Weld = Instance.new("Weld", DoorHandle) Weld.Part0 = Door Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(1.65, 0.25, -0.5) ClickDetector = Instance.new("ClickDetector", DoorHandle) ClickDetector.MaxActivationDistance = 7 ClickDetector.MouseClick:connect(function() if (DoorLocked or not TeleportReady) and not DoorOpen then return end if DoorHandle:FindFirstChild("Weld") == nil then return end if DoorOpen then DoorOpen = false else DoorOpen = true end end) Wall = Wall:Clone() Wall.Parent = Exterior Wall.Size = Vector3.new(0.5, 7, 5) Weld = Instance.new("Weld", Wall) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(2.75, 3.6, 0) Wall = Wall:Clone() Wall.Parent = Exterior Wall.Size = Vector3.new(0.5, 7, 5) Weld = Instance.new("Weld", Wall) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-2.75, 3.6, 0) Corner = Wall:Clone() Corner.Parent = Exterior Corner.Name = "Corner" Corner.BrickColor = BrickColor.new("Medium stone grey") Corner.Size = Vector3.new(1, 7, 1) Weld = Instance.new("Weld", Corner) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(3, 3.6, 3) Corner = Corner:Clone() Corner.Parent = Exterior Weld = Instance.new("Weld", Corner) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-3, 3.6, 3) Corner = Corner:Clone() Corner.Parent = Exterior Weld = Instance.new("Weld", Corner) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-3, 3.6, -3) Corner = Corner:Clone() Corner.Parent = Exterior Weld = Instance.new("Weld", Corner) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(3, 3.6, -3) Top = Base:Clone() Top.Parent = Exterior Top.Name = "Top" Weld = Instance.new("Weld", Top) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 7.2, 0) LightBase = Wall:Clone() LightBase.Parent = Exterior LightBase.Name = "Light Base" LightBase.BrickColor = BrickColor.new("Dark stone grey") LightBase.Size = Vector3.new(1, 0.5, 1) Mesh = Instance.new("CylinderMesh", LightBase) Weld = Instance.new("Weld", LightBase) Weld.Part0 = Top Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0.35, 0) Light = LightBase:Clone() Light.Parent = Exterior Light.Name = "Light" Light.BrickColor = BrickColor.new("Bright blue") Light.Transparency = 0.5 Light.Size = Vector3.new(1, 1, 1) Weld = Instance.new("Weld", Light) Weld.Part0 = LightBase Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0.75, 0) LightTop = LightBase:Clone() LightTop.Parent = Exterior LightTop.Name = "Light Top" Weld = Instance.new("Weld", LightTop) Weld.Part0 = Light Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 0.75, 0) Sign = Top:Clone() Sign.Parent = Exterior Sign.Name = "Sign" Sign.Size = Vector3.new(2, 2, 0.2) Decal = Instance.new("Decal", Sign) Decal.Texture = "http://www.roblox.com/Asset/?id=49400995" Decal.Face = "Front" Weld = Instance.new("Weld", Sign) Weld.Part0 = Door Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 1.75, -0.3) Sign = Sign:Clone() Sign.Parent = Exterior Weld = Instance.new("Weld", Sign) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 5.4, 3.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(180), 0) Sign = Sign:Clone() Sign.Parent = Exterior Weld = Instance.new("Weld", Sign) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(-3.1, 5.4, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) Sign = Sign:Clone() Sign.Parent = Exterior Weld = Instance.new("Weld", Sign) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(3.1, 5.4, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0) Teleport = Wall:Clone() Teleport.Parent = Exterior Teleport.Name = "Teleport" Teleport.Size = Vector3.new(2, 2, 0.2) Teleport.Transparency = 1 Weld = Instance.new("Weld", Teleport) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 4.2, 1.5) Teleport.Touched:connect(function(Hit) pcall(function() if DoorDebounce == false or DoorOpen == false then return end if Hit.Parent:FindFirstChild("Torso") ~= nil and Hit.Parent:FindFirstChild("Humanoid") ~= nil then Position = Interior.Teleport.CFrame * CFrame.new(0, 0, -2) while Hit.Parent.Torso.CFrame ~= Position do Hit.Parent.Torso.CFrame = Position end DoorDebounce = false coroutine.wrap(function() wait(1) DoorDebounce = true end)() end end) end) for i = 0, 1, 1 / 25 do Shadow = Wall:Clone() Shadow.Parent = Exterior Shadow.Name = "Shadow" Shadow.Transparency = i Shadow.BrickColor = BrickColor.new("Really black") Shadow.Size = Vector3.new(5, 7, 0.2) Shadow.CanCollide = false Weld = Instance.new("Weld", Shadow) Weld.Part0 = Base Weld.Part1 = Weld.Parent Weld.C0 = CFrame.new(0, 3.6, 2.4 - (0.2 * (i * 25))) end -- Functions. for _, Part in pairs(Exterior:GetChildren()) do local Joint = nil for _, Joints in pairs(Part:GetChildren()) do if Joints:IsA("JointInstance") then Joint = Joints end end table.insert(RepairParts, { Part = Part, Joint = Joint }) Part.ChildRemoved:connect(function(Part2) if Part2:IsA("JointInstance") and Part2.Name == Part2.ClassName then if math.floor(math.random(1, ((1 - (EnergyToShield * 0.999)) * 100) + 1)) == 1 and DamageHealth > 0 then for i = 1, #RepairParts do if RepairParts[i].Part == Part then local NewJoint = RepairParts[i].Joint:Clone() NewJoint.Parent = Part Part:MakeJoints() local Sound = Instance.new("Sound", Part) Sound.Name = "Heal Sound" Sound.Pitch = math.random(250, 400) / 100 Sound.Volume = 1 Sound.SoundId = "http://www.roblox.com/Asset/?id=2785493" Sound:Play() coroutine.wrap(function() wait(1) Sound:Remove() end)() end end local TARDISShield = Instance.new("SelectionBox", Part) TARDISShield.Name = "TARDIS Shield" TARDISShield.Adornee = Part coroutine.wrap(function() while TARDISShield.Parent ~= nil do TARDISShield.Color = BrickColor.new(Color3.new(0, 0, math.random(100, 255) / 255)) wait() end end)() coroutine.wrap(function() wait(2) for i = 0, 1, 0.05 do TARDISShield.Transparency = i wait() end TARDISShield:Remove() end)() else if Part.Name == "Wall" or Part.Name == "Top" then Destroy() else DamageHealth = DamageHealth - math.random(25, 50) end end end end) Part.Changed:connect(function(Property) if Property == "Parent" and Part.Parent ~= Exterior then if math.floor(math.random(1, ((1 - (EnergyToShield * 0.999)) * 100) + 1)) == 1 and DamageHealth > 0 then Part.Parent = Exterior else if Part.Name == "Wall" or Part.Name == "Top" or Part.Name == "Base" then Destroy() else DamageHealth = DamageHealth - math.random(10, 100) end end end end) Part.Touched:connect(function(Hit) if Hit.CanCollide == false then return end if DamageCanHit == false then return end for i = 1, #DamageEffect do if Hit == DamageEffect[i] then return end end local SoundId = math.random(1, 3) local Sound = Instance.new("Sound", Part) Sound.Name = "Hit Sound" Sound.Volume = (Part.Velocity.x + Part.Velocity.y + Part.Velocity.z + Part.RotVelocity.x + Part.RotVelocity.y + Part.RotVelocity.z + Hit.Velocity.x + Hit.Velocity.y + Hit.Velocity.z + Hit.RotVelocity.x + Hit.RotVelocity.y + Hit.RotVelocity.z) / 200 Sound.Pitch = math.random(75, 125) / 100 if SoundId == 1 then Sound.SoundId = "rbxasset://sounds\\metal.ogg" elseif SoundId == 2 then Sound.SoundId = "rbxasset://sounds\\metal2.ogg" elseif SoundId == 3 then Sound.SoundId = "rbxasset://sounds\\metal3.ogg" end wait() Sound:Play() coroutine.wrap(function() wait(1) Sound:Remove() end)() if Hit.Parent == nil then return end if Hit.Parent == Exterior then return end if Part:FindFirstChild("Weld") == nil then return end DamageCanHit = false local Velocity1 = { math.abs(Part.Velocity.x), math.abs(Part.Velocity.y), math.abs(Part.Velocity.z) } local RotVelocity1 = { math.abs(Part.RotVelocity.x), math.abs(Part.RotVelocity.y), math.abs(Part.RotVelocity.z) } local Velocity2 = { math.abs(Hit.Velocity.x), math.abs(Hit.Velocity.y), math.abs(Hit.Velocity.z) } local RotVelocity2 = { math.abs(Hit.RotVelocity.x), math.abs(Hit.RotVelocity.y), math.abs(Hit.RotVelocity.z) } for i = 1, #Velocity1 do local Total = math.abs(Velocity1[i] - Velocity2[i]) if Total > 75 then if math.floor(math.random(1, ((1 - (EnergyToShield * 0.999)) * 100) + 1)) == 1 then local TARDISShield = Instance.new("SelectionBox", Part) TARDISShield.Name = "TARDIS Shield" TARDISShield.Adornee = Part coroutine.wrap(function() while TARDISShield.Parent ~= nil do TARDISShield.Color = BrickColor.new(Color3.new(0, 0, math.random(100, 255) / 255)) wait() end end)() coroutine.wrap(function() for i = 0, 1, 0.1 do TARDISShield.Transparency = i wait() end TARDISShield:Remove() end)() else if Total > 125 and Hit:GetMass() > 3 and Hit.Name ~= "Wall" and Hit.Name ~= "Base" and Hit.Name ~= "Top" then Flying = false ExteriorVelocity.maxForce = Vector3.new() for _, Joints in pairs(Part:GetChildren()) do if Joints:IsA("JointInstance") then Joints:Remove() end end Part.Velocity = Part.Velocity + Vector3.new(math.random(-Total / 10, Total / 10), math.random(-Total / 10, Total / 10), math.random(-Total / 10, Total / 10)) Part.RotVelocity = Part.RotVelocity + Vector3.new(math.random(-Total / 25, Total / 25), math.random(-Total / 25, Total / 25), math.random(-Total / 25, Total / 25)) elseif Total > 100 then DamageHealth = DamageHealth - (Total / 25) else DamageHealth = DamageHealth - (Total / 50) end end end if Total > math.random(50, 75) then if math.random(1, 5) == 1 then if Hit.Parent:FindFirstChild("Humanoid") ~= nil then local Tag = Instance.new("ObjectValue", Hit.Parent.Humanoid) Tag.Name = "creator" Tag.Value = FlyPlayer coroutine.wrap(function() wait(1) Tag:Remove() end)() end Hit:BreakJoints() end end end for i = 1, #RotVelocity1 do local Total = math.abs(RotVelocity1[i] - RotVelocity2[i]) if Total > 25 then if math.floor(math.random(1, ((1 - (EnergyToShield * 0.999)) * 100) + 1)) == 1 then local TARDISShield = Instance.new("SelectionBox", Part) TARDISShield.Name = "TARDIS Shield" TARDISShield.Adornee = Part coroutine.wrap(function() while TARDISShield.Parent ~= nil do TARDISShield.Color = BrickColor.new(Color3.new(0, 0, math.random(100, 255) / 255)) wait() end end)() coroutine.wrap(function() for i = 0, 1, 0.1 do TARDISShield.Transparency = i wait() end TARDISShield:Remove() end)() else if Total > 50 and Hit:GetMass() > 3 and Hit.Name ~= "Wall" and Hit.Name ~= "Base" and Hit.Name ~= "Top" then Flying = false ExteriorVelocity.maxForce = Vector3.new() for _, Joints in pairs(Part:GetChildren()) do if Joints:IsA("JointInstance") then Joints:Remove() end end Part.Velocity = Part.Velocity + Vector3.new(math.random(-Total / 10, Total / 10), math.random(-Total / 10, Total / 10), math.random(-Total / 10, Total / 10)) Part.RotVelocity = Part.RotVelocity + Vector3.new(math.random(-Total / 25, Total / 25), math.random(-Total / 25, Total / 25), math.random(-Total / 25, Total / 25)) elseif Total > 35 then DamageHealth = DamageHealth - (Total / 10) else DamageHealth = DamageHealth - (Total / 25) end end end if Total > math.random(35, 75) then if math.random(1, 3) == 1 then if Hit.Parent:FindFirstChild("Humanoid") ~= nil then local Tag = Instance.new("ObjectValue", Hit.Parent.Humanoid) Tag.Name = "creator" Tag.Value = FlyPlayer coroutine.wrap(function() wait(1) Tag:Remove() end)() end Hit:BreakJoints() end end end wait(0.075) DamageCanHit = true end) end for _, Part in pairs(Interior:GetChildren()) do Part.ChildRemoved:connect(function(Part2) if Part2.ClassName == "Weld" and Part2.Name == "Weld" then if Part.Name == "Wall" or Part.Name == "Top" then Destroy() else DamageHealth = DamageHealth - math.random(25, 50) end end end) Part.Changed:connect(function(Property) if Property == "Parent" then if Part.Name == "Wall" or Part.Name == "Top" or Part.Name == "Base" then Destroy() else DamageHealth = DamageHealth - math.random(50, 100) end end end) end function Destroy() coroutine.wrap(function() wait() if TARDIS.Parent == nil or Interior.Parent == nil or Exterior.Parent == nil then return end if DamageHealth <= -math.huge then return end DamageHealth = -math.huge InteriorPosition:Remove() InteriorGyro:Remove() ExteriorVelocity:Remove() ExteriorGyro:Remove() TeleportReady = false DoorOpen = false DoorLocked = true local Position = nil if Exterior:FindFirstChild("Base") ~= nil then Position = (Exterior.Base.CFrame * CFrame.new(0, 3, 0)).p else for _, Part in pairs(Exterior:GetChildren()) do if Part:IsA("BasePart") then Position = Part.Position break end end end if Position == nil then return end local function Move(Part) Part:BreakJoints() Part.CFrame = CFrame.new(Position) * CFrame.new(math.random(-30, 30), math.random(-30, 30), math.random(-30, 30)) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(-360, 360)), math.rad(math.random(-360, 360)), math.rad(math.random(-360, 360))) Part.Velocity = (Part.Position - Position).unit * math.random(0, 50) Part.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100)) end for i = 1, #DamageEffect do pcall(function() DamageEffect[i].Anchored = false Move(DamageEffect[i]) end) DamageEffect[i] = nil DamageEffectPart[i] = nil end for _, PlayerList in pairs(game:GetService("Players"):GetPlayers()) do if PlayerList.Character ~= nil then if PlayerList.Character:FindFirstChild("Torso") ~= nil then if (PlayerList.Character.Torso.Position - TARDIS.Interior.Base.Position).magnitude < 250 then for _, Part in pairs(PlayerList.Character:GetChildren()) do if Part:IsA("BasePart") then Move(Part) elseif Part:IsA("Accoutrement") then if Part:FindFirstChild("Handle") ~= nil then Part.Parent = Workspace Move(Part.Handle) end end end end end end end for _, Part in pairs(Exterior:GetChildren()) do if Part.Name == "Shadow" or Part.Name == "Teleport" then Part:Remove() elseif Part:IsA("BasePart") then Move(Part) end end for _, Part in pairs(Interior:GetChildren()) do if Part.Name == "Shadow" or Part.Name == "Teleport" or Part.Name == "Base" then Part:Remove() elseif Part:IsA("BasePart") then Move(Part) end end for _, Part in pairs(TARDIS:GetChildren()) do if Part.Name == "TARDIS Link" then Part:Remove() end end local Sound = Instance.new("Sound", Workspace) Sound.SoundId = "http://www.roblox.com/Asset/?id=2101159" Sound.Volume = 1 Sound.Pitch = math.random(90, 110) / 100 Sound:Play() local Sound = Instance.new("Sound", Workspace) Sound.SoundId = "http://www.roblox.com/Asset/?id=3087031" Sound.Volume = 1 Sound.Pitch = math.random(90, 110) / 100 Sound:Play() for i = 1, math.random(5, 7) do local ExplosionBall = Instance.new("Part", Workspace) ExplosionBall.Name = "TARDIS Explosion Ball" ExplosionBall.FormFactor = "Custom" ExplosionBall.TopSurface = 0 ExplosionBall.BottomSurface = 0 ExplosionBall.Anchored = true ExplosionBall.CanCollide = false ExplosionBall.Size = Vector3.new(1, 1, 1) ExplosionBall.BrickColor = BrickColor.new((function() local Choice = math.random(1, 5) if Choice == 1 then return "Institutional white" elseif Choice == 2 then return "White" elseif Choice == 3 then return "Really red" elseif Choice == 4 then return "New Yeller" elseif Choice == 5 then return "Black" end end)()) ExplosionBall.CFrame = CFrame.new(Position) Instance.new("SpecialMesh", ExplosionBall).MeshType = "Sphere" coroutine.wrap(function() for i = 0, 1, 0.005 do ExplosionBall.Transparency = (1 - i) ExplosionBall.Mesh.Scale = Vector3.new(i * 250, i * 250, i * 250) ExplosionBall.CFrame = CFrame.new(Position + (Vector3.new(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) * i)) if math.random(1, 25) == 1 then local Explosion = Instance.new("Explosion") Explosion.Position = ExplosionBall.Position + (Vector3.new(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) * i) Explosion.BlastPressure = 10000 * i Explosion.BlastRadius = i * 250 Explosion.Parent = Workspace end wait() end for i = 0, 1, 0.05 do ExplosionBall.Transparency = i ExplosionBall.CFrame = CFrame.new(Position + (Vector3.new(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)) * (1 - i))) wait() end ExplosionBall:Remove() end)() end end)() coroutine.wrap(function() wait(25) TARDIS:Remove() script:Remove() end)() end function Teleport(Position) if TeleportReady == false or DoorOpen == true then return end TeleportReady = false ExteriorGyro.maxTorque = Vector3.new(math.huge, 0, math.huge) FlyStabalize = true coroutine.wrap(function() while FlyStabalize == true do ExteriorGyro.cframe = CFrame.new(Exterior.Base.Position) * CFrame.new(0, 0, 10) wait() end end)() local BoomSound1 = Instance.new("Sound", Interior.Base) BoomSound1.SoundId = "http://www.roblox.com/Asset/?id=11984254" BoomSound1.Pitch = 2 BoomSound1.Volume = 1 BoomSound1:Play() local BoomSound2 = BoomSound1:Clone() BoomSound2.Parent = Exterior.Base BoomSound2:Play() wait(2) BoomSound1:Remove() BoomSound2:Remove() local Wind1 = Instance.new("Sound", Exterior.Base) Wind1.SoundId = "http://www.roblox.com/Asset/?id=18435238" Wind1.Pitch = 0.25 Wind1.Volume = 1 Wind1:Play() local Wind2 = Wind1:Clone() Wind2.Parent = Interior.Base Wind2:Play() wait(1) local Whoosh1 = Wind1:Clone() Whoosh1.Parent = Interior.Base Whoosh1.Pitch = math.random(300, 400) / 100 Whoosh1.Looped = true Whoosh1:Play() local Whoosh2 = Whoosh1:Clone() Whoosh2.Parent = Exterior.Base Whoosh2:Play() local SoundPart = Instance.new("Part", Workspace) SoundPart.Name = "" SoundPart.Transparency = 1 SoundPart.TopSurface = 0 SoundPart.BottomSurface = 0 SoundPart.FormFactor = "Custom" SoundPart.Size = Vector3.new(6, 0.2, 6) SoundPart.Anchored = true SoundPart.CanCollide = false SoundPart:BreakJoints() SoundPart.Position = Position local Wind3 = Wind1:Clone() Wind3.Parent = SoundPart Wind3:Play() local Whoosh3 = Whoosh1:Clone() Whoosh3.Parent = SoundPart Whoosh3:Play() local Transparency = {} for x, Part in pairs(Exterior:GetChildren()) do Transparency[x] = Part.Transparency end local Decals = {} for x, Part in pairs(Exterior:GetChildren()) do if Part:FindFirstChild("Decal") ~= nil then Decals[x] = Part.Decal.Texture Part.Decal.Texture = "" end end for i = 0, 1, (EnergyToTeleport / 75) + 0.005 do for x, Part in pairs(Exterior:GetChildren()) do Part.Transparency = Transparency[x] + ((1 - Transparency[x]) * i) end for _, Part in pairs(Interior:GetChildren()) do if Part.Name == "Power Rod 1" then pcall(function() Part.Weld.C1 = CFrame.new(0, (((math.sin(i * 10) + 1) / 2) * 4), 0) end) elseif Part.Name == "Power Rod 2" then pcall(function() Part.Weld.C1 = CFrame.new(0, -(((math.sin(i * 10) + 1) / 2) * 4), 0) end) end end wait() end wait(math.random(0, EnergyToTeleport * 100) / 100) for x, Part in pairs(Exterior:GetChildren()) do Part.Velocity = Vector3.new() Part.RotVelocity = Vector3.new() Part.Transparency = 1 end SoundPart.CFrame = CFrame.new(Exterior.Base.Position) coroutine.wrap(function() local SoundIds = { "http://www.roblox.com/Asset/?id=13775466", "http://www.roblox.com/Asset/?id=22968437", "http://www.roblox.com/Asset/?id=13775494" } for i = 1, math.random(3, 10) do wait(math.random(100, 2000) / 1000) local AfterSound = Instance.new("Sound", SoundPart) AfterSound.Pitch = math.random(2000, 3500) / 1000 AfterSound.Volume = 1 AfterSound.SoundId = SoundIds[math.random(1, #SoundIds)] for i = 1, 0, -0.1 do AfterSound:Play() AfterSound.Volume = i wait(((1 - AfterSound.Pitch / 3.5) * 0.3) + 0.05) end AfterSound:Remove() end SoundPart:Remove() end)() Exterior:MoveTo(Position + Vector3.new(math.random(-(1 - EnergyToTeleport) * 100, (1 - EnergyToTeleport) * 100), math.random(-(1 - EnergyToTeleport) * 100, (1 - EnergyToTeleport) * 100), math.random(-(1 - EnergyToTeleport) * 100, (1 - EnergyToTeleport) * 100))) ExteriorOffset = Interior.Base.Position - (Exterior.Base.Position / 10) for i = 1, 0, -((EnergyToTeleport / 25) + 0.01) do for x, Part in pairs(Exterior:GetChildren()) do Part.Transparency = Transparency[x] + ((1 - Transparency[x]) * i) end for x, Part in pairs(Interior:GetChildren()) do if Part.Name == "Power Rod 1" then pcall(function() Part.Weld.C1 = CFrame.new(0, (((math.sin(i * 20) + 1) / 2) * 4), 0) end) elseif Part.Name == "Power Rod 2" then pcall(function() Part.Weld.C1 = CFrame.new(0, -(((math.sin(i * 20) + 1) / 2) * 4), 0) end) end end wait() end for x, Part in pairs(Exterior:GetChildren()) do Part.Transparency = Transparency[x] if Decals[x] ~= nil and Part:FindFirstChild("Decal") ~= nil then Part.Decal.Texture = Decals[x] end end for x, Part in pairs(Interior:GetChildren()) do if Part.Name == "Power Rod 1" then pcall(function() Part.Weld.C1 = CFrame.new() end) elseif Part.Name == "Power Rod 2" then pcall(function() Part.Weld.C1 = CFrame.new() end) end end Whoosh1.Looped = false Whoosh2.Looped = false Whoosh3.Looped = false wait(1.5) Wind1:Remove() Wind2:Remove() Wind3:Remove() Whoosh1:Remove() Whoosh2:Remove() Whoosh3:Remove() ExteriorGyro.maxTorque = Vector3.new() FlyStabalize = false TeleportReady = true end -- Final stuff. InteriorPosition = Instance.new("BodyPosition", Interior.Base) InteriorPosition.D = 1500 InteriorPosition.P = 7500 InteriorPosition.maxForce = Vector3.new(math.huge, math.huge, math.huge) InteriorPosition.position = ExteriorOffset InteriorGyro = Instance.new("BodyGyro", Interior.Base) InteriorGyro.D = 750 InteriorGyro.P = 2500 InteriorGyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) ExteriorVelocity = Instance.new("BodyVelocity", Exterior.Base) ExteriorVelocity.P = 1500 ExteriorVelocity.maxForce = Vector3.new() ExteriorVelocity.velocity = Vector3.new() coroutine.wrap(function() while ExteriorVelocity.Parent ~= nil do if math.abs(ExteriorVelocityTarget.x - ExteriorVelocity.velocity.x) < ExteriorVelocityTargetSpeed and math.abs(ExteriorVelocityTarget.y - ExteriorVelocity.velocity.y) < ExteriorVelocityTargetSpeed and math.abs(ExteriorVelocityTarget.z - ExteriorVelocity.velocity.z) < ExteriorVelocityTargetSpeed then ExteriorVelocity.velocity = ExteriorVelocityTarget else ExteriorVelocity.velocity = Vector3.new( ExteriorVelocity.velocity.x + (function() if ExteriorVelocityTarget.x - ExteriorVelocity.velocity.x > ExteriorVelocityTargetSpeed then return ExteriorVelocityTargetSpeed elseif ExteriorVelocityTarget.x - ExteriorVelocity.velocity.x < -ExteriorVelocityTargetSpeed then return -ExteriorVelocityTargetSpeed else return ExteriorVelocityTarget.x - ExteriorVelocity.velocity.x end end)(), ExteriorVelocity.velocity.y + (function() if ExteriorVelocityTarget.y - ExteriorVelocity.velocity.y > ExteriorVelocityTargetSpeed then return ExteriorVelocityTargetSpeed elseif ExteriorVelocityTarget.y - ExteriorVelocity.velocity.y < -ExteriorVelocityTargetSpeed then return -ExteriorVelocityTargetSpeed else return ExteriorVelocityTarget.y - ExteriorVelocity.velocity.y end end)(), ExteriorVelocity.velocity.z + (function() if ExteriorVelocityTarget.z - ExteriorVelocity.velocity.z > ExteriorVelocityTargetSpeed then return ExteriorVelocityTargetSpeed elseif ExteriorVelocityTarget.z - ExteriorVelocity.velocity.z < -ExteriorVelocityTargetSpeed then return -ExteriorVelocityTargetSpeed else return ExteriorVelocityTarget.z - ExteriorVelocity.velocity.z end end)() ) end wait() end end)() ExteriorGyro = Instance.new("BodyGyro", Exterior.Base) ExteriorGyro.D = 500 ExteriorGyro.P = 3000 ExteriorGyro.maxTorque = Vector3.new() Exterior:MoveTo(Vector3.new(0, 0, 10)) pcall(function() Exterior:MoveTo(Workspace.grgrgry21.Torso.Position + Vector3.new(0, 0, 10)) end) Interior:MoveTo((Exterior.Base.Position / 10) + ExteriorOffset) while true do if DamageHealth <= 0 then Destroy() break end pcall(function() InteriorPosition.position = (Exterior.Base.Position / 10) + ExteriorOffset InteriorGyro.cframe = Exterior.Base.CFrame * CFrame.new(-Exterior.Base.Position) end) pcall(function() ExteriorVelocity.P = 1000 * ((EnergyToFly / 2) + 0.5) end) ExteriorVelocityTargetSpeed = 2.5 * ((EnergyToFly / 2) + 0.5) local Seat = Interior:FindFirstChild("Teleport Seat") if Seat ~= nil then if Seat:FindFirstChild("SeatWeld") ~= nil and TeleportPlayer == nil then local Part1 = Seat.SeatWeld.Part1 if Part1 ~= nil then TeleportPlayer = game:GetService("Players"):GetPlayerFromCharacter(Part1.Parent) if TeleportPlayer ~= nil then local Camera = game:GetService("InsertService"):LoadAsset(49712909).Camera Camera.CameraSubject.Value = Exterior.Base Camera.CameraType.Value = Enum.CameraType.Track.Value Camera.Disabled = false wait(0.05) Camera.Parent = Part1.Parent local PlayerGui = TeleportPlayer:FindFirstChild("PlayerGui") if PlayerGui == nil then return end local TeleportGui = Instance.new("ScreenGui", PlayerGui) TeleportGui.Name = "TeleportGui" local Frame = Instance.new("Frame") Frame.Name = "Content" Frame.Size = UDim2.new(0, 300, 0, 300) Frame.Position = UDim2.new(0, 0, 0.5, -300 / 2) Frame.BorderSizePixel = 1 Frame.BorderColor3 = Color3.new(0, 0, 0) Frame.BackgroundColor3 = Color3.new(0.15, 0.15, 0.15) Frame.Parent = TeleportGui local TextLabel = Instance.new("TextLabel") TextLabel.Name = "X Label" TextLabel.Size = UDim2.new(1, -15, 0, 15) TextLabel.Position = UDim2.new(0, 15, 0, 15) TextLabel.BorderSizePixel = 0 TextLabel.BackgroundTransparency = 1 TextLabel.TextColor3 = Color3.new(1, 1, 1) TextLabel.Text = "X coordinate:" TextLabel.TextXAlignment = "Left" TextLabel.FontSize = "Size12" TextLabel.TextWrap = true TextLabel.Parent = TeleportGui.Content local TextLabel = TextLabel:Clone() TextLabel.Name = "Y Label" TextLabel.Position = UDim2.new(0, 15, 0, 45) TextLabel.Text = "Y coordinate:" TextLabel.Parent = TeleportGui.Content local TextLabel = TextLabel:Clone() TextLabel.Name = "Z Label" TextLabel.Position = UDim2.new(0, 15, 0, 75) TextLabel.Text = "Z coordinate:" TextLabel.Parent = TeleportGui.Content local TextBox = Instance.new("TextBox") TextBox.Name = "X" TextBox.ClearTextOnFocus = false TextBox.Size = UDim2.new(1, -130, 0, 15) TextBox.Position = UDim2.new(0, 115, 0, 15) TextBox.BorderColor3 = Color3.new(0, 0, 0) TextBox.BackgroundColor3 = Color3.new(1, 1, 1) TextBox.TextColor3 = Color3.new(0, 0, 0) TextBox.Text = "0" TextBox.TextXAlignment = "Left" TextBox.FontSize = "Size12" TextBox.Parent = TeleportGui.Content local TextBox = TextBox:Clone() TextBox.Name = "Y" TextBox.Position = UDim2.new(0, 115, 0, 45) TextBox.Parent = TeleportGui.Content local TextBox = TextBox:Clone() TextBox.Name = "Z" TextBox.Position = UDim2.new(0, 115, 0, 75) TextBox.Parent = TeleportGui.Content local Divider = Instance.new("Frame") Divider.Name = "Divider" Divider.Size = UDim2.new(1, -30, 0, 1) Divider.Position = UDim2.new(0, 15, 0, 100) Divider.BorderSizePixel = 0 Divider.BackgroundColor3 = Color3.new(1, 1, 1) Divider.Parent = TeleportGui.Content local TextLabel = TextLabel:Clone() TextLabel.Name = "CX" TextLabel.Position = UDim2.new(0, 15, 0, 110) TextLabel.Text = "Current X coordinate: " TextLabel.Parent = TeleportGui.Content local TextLabel = TextLabel:Clone() TextLabel.Name = "CY" TextLabel.Position = UDim2.new(0, 15, 0, 140) TextLabel.Text = "Current Y coordinate: " TextLabel.Parent = TeleportGui.Content local TextLabel = TextLabel:Clone() TextLabel.Name = "CZ" TextLabel.Position = UDim2.new(0, 15, 0, 170) TextLabel.Text = "Current Z coordinate: " TextLabel.Parent = TeleportGui.Content local Divider = Divider:Clone() Divider.Position = UDim2.new(0, 15, 0, 195) Divider.BorderSizePixel = 0 Divider.BackgroundColor3 = Color3.new(1, 1, 1) Divider.Parent = TeleportGui.Content local TextButton = Instance.new("TextButton") TextButton.Name = "Teleport" TextButton.Size = UDim2.new(1, -30, 0, 15) TextButton.Position = UDim2.new(0, 15, 0, 205) TextButton.BorderColor3 = Color3.new(0, 0, 0) TextButton.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3) TextButton.TextColor3 = Color3.new(1, 1, 1) TextButton.Text = "Begin Teleportation" TextButton.FontSize = "Size12" TextButton.Parent = TeleportGui.Content TextButton.MouseButton1Up:connect(function() Teleport(Vector3.new(tonumber(TeleportGui.Content.X.Text), tonumber(TeleportGui.Content.Y.Text), tonumber(TeleportGui.Content.Z.Text))) end) coroutine.wrap(function() wait() while TextButton.Parent ~= nil do if TeleportReady == false or DoorOpen == true then TextButton.AutoButtonColor = false TextButton.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1) else TextButton.AutoButtonColor = true TextButton.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3) end wait(0.1) end end)() local TextButton = TextButton:Clone() TextButton.Name = "Set Inputs to Current Coordinates" TextButton.Position = UDim2.new(0, 15, 0, 220) TextButton.Text = "Set Inputs to Current Coordinates" TextButton.Parent = TeleportGui.Content TextButton.MouseButton1Up:connect(function() TeleportGui.Content.X.Text = string.sub(Exterior.Base.Position.x, 0, 12) TeleportGui.Content.Y.Text = string.sub(Exterior.Base.Position.y, 0, 12) TeleportGui.Content.Z.Text = string.sub(Exterior.Base.Position.z, 0, 12) end) local TextButton = TextButton:Clone() TextButton.Name = "Waypoints" TextButton.Position = UDim2.new(0, 15, 0, 235) TextButton.Text = "Open Waypoints Dialogue..." TextButton.Parent = TeleportGui.Content TextButton.MouseButton1Up:connect(function() pcall(function() TeleportGui.Content["Players List"]:Remove() end) pcall(function() TeleportGui.Content["Waypoints List"]:Remove() end) local Frame = Frame:Clone() Frame.Parent = TeleportGui.Content Frame.Name = "Waypoints List" Frame.Position = UDim2.new(1, 0, 0, 0) Frame.Size = UDim2.new(1, 0, 0, 75) for _, Part in pairs(Frame:GetChildren()) do Part:Remove() end for i = 1, #TeleportWaypoints, 2 do local TextButton = TextButton:Clone() TextButton.Parent = Frame TextButton.Name = TeleportWaypoints[i].. " Waypoint" TextButton.Text = TeleportWaypoints[i] TextButton.Size = UDim2.new(1, -45, 0, 15) TextButton.Position = UDim2.new(0, 15, 0, Frame.Size.Y.Offset - 60) TextButton.MouseButton1Up:connect(function() TeleportGui.Content.X.Text = TeleportWaypoints[i + 1].x TeleportGui.Content.Y.Text = TeleportWaypoints[i + 1].y TeleportGui.Content.Z.Text = TeleportWaypoints[i + 1].z end) local TextButton = TextButton:Clone() TextButton.Parent = Frame TextButton.Name = TeleportWaypoints[i].. " Remove" TextButton.Text = "X" TextButton.Size = UDim2.new(0, 15, 0, 15) TextButton.Position = UDim2.new(1, -30, 0, Frame.Size.Y.Offset - 60) Frame.Size = Frame.Size + UDim2.new(0, 0, 0, 15) TextButton.MouseButton1Up:connect(function() for x = 1, 2 do table.remove(TeleportWaypoints, i) end Frame:Remove() end) end local TextButton = TextButton:Clone() TextButton.Parent = Frame TextButton.Name = "Create Waypoint" TextButton.Text = "Create Waypoint" TextButton.Size = UDim2.new(1, -30, 0, 15) TextButton.Position = UDim2.new(0, 15, 0, Frame.Size.Y.Offset - 45) TextButton.MouseButton1Up:connect(function() local WaypointButton = Frame["Create Waypoint"] WaypointButton.Parent = nil local TextBox = TextBox:Clone() TextBox.Parent = Frame TextBox.Name = "Waypoint Name" TextBox.Size = UDim2.new(1, -60, 0, 15) TextBox.Position = WaypointButton.Position TextBox.Text = "Waypoint Name" local TextButton = TextButton:Clone() TextButton.Parent = Frame TextButton.Name = "Cancel" TextButton.Size = UDim2.new(0, 15, 0, 15) TextButton.Text = "X" TextButton.Position = UDim2.new(1, -45, 0, WaypointButton.Position.Y.Offset) TextButton.MouseButton1Up:connect(function() Frame["Waypoint Name"]:Remove() Frame["Cancel"]:Remove() Frame["Save"]:Remove() WaypointButton.Parent = Frame end) local TextButton = TextButton:Clone() TextButton.Parent = Frame TextButton.Name = "Save" TextButton.Size = UDim2.new(0, 15, 0, 15) TextButton.Text = ">" TextButton.Position = UDim2.new(1, -30, 0, WaypointButton.Position.Y.Offset) TextButton.MouseButton1Up:connect(function() table.insert(TeleportWaypoints, TextBox.Text) table.insert(TeleportWaypoints, Vector3.new(tonumber(string.sub(Exterior.Base.Position.x, 0, 12)), tonumber(string.sub(Exterior.Base.Position.y, 0, 12)), tonumber(string.sub(Exterior.Base.Position.z, 0, 12)))) Frame:Remove() end) end) local TextButton = TextButton:Clone() TextButton.Parent = Frame TextButton.Name = "Close" TextButton.Text = "Close" TextButton.Position = UDim2.new(0, 15, 0, Frame.Size.Y.Offset - 30) TextButton.MouseButton1Up:connect(function() Frame:Remove() end) end) local TextButton = TextButton:Clone() TextButton.Name = "Players" TextButton.Position = UDim2.new(0, 15, 0, 250) TextButton.Text = "Open Players Dialogue..." TextButton.Parent = TeleportGui.Content TextButton.MouseButton1Up:connect(function() pcall(function() TeleportGui.Content["Players List"]:Remove() end) pcall(function() TeleportGui.Content["Waypoints List"]:Remove() end) local Frame = Frame:Clone() Frame.Parent = TeleportGui.Content Frame.Name = "Players List" Frame.Position = UDim2.new(1, 0, 0, 0) Frame.Size = UDim2.new(1, 0, 0, 60) for _, Part in pairs(Frame:GetChildren()) do Part:Remove() end for _, PlayerList in pairs(game:GetService("Players"):GetPlayers()) do local TextButton = TextButton:Clone() TextButton.Parent = Frame TextButton.Name = PlayerList.Name TextButton.Text = PlayerList.Name TextButton.Position = UDim2.new(0, 15, 0, Frame.Size.Y.Offset - 45) Frame.Size = Frame.Size + UDim2.new(0, 0, 0, 15) if (function() if PlayerList == TeleportPlayer then return false end if PlayerList.Character == nil then return false end if PlayerList.Character:FindFirstChild("Torso") == nil then return false end if (PlayerList.Character.Torso.Position - TARDIS.Interior.Base.Position).magnitude < 250 then return false end return true end)() == false then TextButton.AutoButtonColor = false TextButton.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1) else TextButton.MouseButton1Up:connect(function() pcall(function() TeleportGui.Content.X.Text = PlayerList.Character.Torso.Position.x TeleportGui.Content.Y.Text = PlayerList.Character.Torso.Position.y TeleportGui.Content.Z.Text = PlayerList.Character.Torso.Position.z end) end) end end local TextButton = TextButton:Clone() TextButton.Parent = Frame TextButton.Name = "Close" TextButton.Text = "Close" TextButton.Position = UDim2.new(0, 15, 0, Frame.Size.Y.Offset - 30) TextButton.MouseButton1Up:connect(function() Frame:Remove() end) end) local TextButton = TextButton:Clone() TextButton.Name = "Clear" TextButton.Position = UDim2.new(0, 15, 0, 265) TextButton.Text = "Clear Inputs" TextButton.Parent = TeleportGui.Content TextButton.MouseButton1Up:connect(function() TeleportGui.Content.X.Text = 0 TeleportGui.Content.Y.Text = 0 TeleportGui.Content.Z.Text = 0 end) coroutine.wrap(function() local TextCX = TeleportGui.Content.CX.Text local TextCY = TeleportGui.Content.CY.Text local TextCZ = TeleportGui.Content.CZ.Text while TeleportGui.Parent ~= nil do TeleportGui.Content.CX.Text = TextCX .. string.sub(Exterior.Base.Position.x, 0, 12) TeleportGui.Content.CY.Text = TextCY .. string.sub(Exterior.Base.Position.y, 0, 12) TeleportGui.Content.CZ.Text = TextCZ .. string.sub(Exterior.Base.Position.z, 0, 12) wait() end end)() end end elseif Seat:FindFirstChild("SeatWeld") == nil and TeleportPlayer ~= nil then if TeleportPlayer:FindFirstChild("PlayerGui") ~= nil then if TeleportPlayer.PlayerGui:FindFirstChild("TeleportGui") ~= nil then TeleportPlayer.PlayerGui.TeleportGui:Remove() end end local Camera = game:GetService("InsertService"):LoadAsset(49712909).Camera Camera.CameraSubject.Value = TeleportPlayer.Character.Humanoid Camera.CameraType.Value = Enum.CameraType.Custom.Value Camera.Disabled = false wait(0.05) Camera.Parent = TeleportPlayer.Character TeleportPlayer = nil end end local Seat = Interior:FindFirstChild("Radar Seat") if Seat ~= nil then if Seat:FindFirstChild("SeatWeld") ~= nil and RadarPlayer == nil then local Part1 = Seat.SeatWeld.Part1 if Part1 ~= nil then RadarPlayer = game:GetService("Players"):GetPlayerFromCharacter(Part1.Parent) if RadarPlayer ~= nil then local Camera = game:GetService("InsertService"):LoadAsset(49712909).Camera Camera.CameraSubject.Value = Exterior.Base Camera.CameraType.Value = Enum.CameraType.Track.Value Camera.Disabled = false wait(0.05) Camera.Parent = Part1.Parent local PlayerGui = RadarPlayer:FindFirstChild("PlayerGui") if PlayerGui == nil then return end local RadarGui = Instance.new("ScreenGui", PlayerGui) RadarGui.Name = "RadarGui" local ImageLabel = Instance.new("ImageLabel") ImageLabel.Name = "Content" ImageLabel.Image = "http://www.roblox.com/Asset/?id=19617472" ImageLabel.Size = UDim2.new(0, 400, 0, 400) ImageLabel.Position = UDim2.new(0, 0, 0.5, -400 / 2) ImageLabel.BorderSizePixel = 0 ImageLabel.BackgroundColor3 = Color3.new(0.15, 0.15, 0.15) ImageLabel.Parent = RadarGui local TextLabel = Instance.new("TextLabel") TextLabel.Name = "Current Coordinates" TextLabel.Size = UDim2.new(1, 0, 0, 15) TextLabel.Position = UDim2.new(0, 15, 1, -20) TextLabel.BorderSizePixel = 0 TextLabel.BackgroundTransparency = 1 TextLabel.TextColor3 = Color3.new(1, 1, 1) TextLabel.Text = "Current coordinates: " TextLabel.TextXAlignment = "Left" TextLabel.FontSize = "Size12" TextLabel.Parent = ImageLabel coroutine.wrap(function() local Text = RadarGui.Content["Current Coordinates"].Text local Blip = Instance.new("Frame") Blip.Name = "Blip" Blip.BorderColor3 = Color3.new(0, 0, 0) Blip.BackgroundColor3 = Color3.new(0, 1, 0) Blip.Size = UDim2.new(0, 10, 0, 10) local BlipText = TextLabel:Clone() BlipText.Name = "Blip Text" BlipText.TextColor3 = Color3.new(0, 1, 0) BlipText.Size = UDim2.new(0, 0, 0, 15) BlipText.TextXAlignment = "Center" while RadarGui.Parent ~= nil do RadarGui.Content["Current Coordinates"].Text = Text.. "(" ..math.floor(Exterior.Base.Position.x).. ", " ..math.floor(Exterior.Base.Position.y).. ", " ..math.floor(Exterior.Base.Position.z).. ")" for _, Part in pairs(RadarGui.Content:GetChildren()) do if Part.Name == "Blip" or Part.Name == "Blip Text" then Part:Remove() end end for _, PlayerList in pairs(game:GetService("Players"):GetPlayers()) do if PlayerList.Character ~= nil then if PlayerList.Character:FindFirstChild("Torso") ~= nil then local Distance = (Exterior.Base.Position - PlayerList.Character.Torso.Position) if Distance.magnitude < RadarMaxDistance then local NewBlip = Blip:Clone() NewBlip.Parent = RadarGui.Content NewBlip.Position = UDim2.new(0, (Distance.x * ((RadarGui.Content.Size.X.Offset / RadarMaxDistance) / 2)) + (RadarGui.Content.Size.X.Offset / 2) + 5, 0, (Distance.z * ((RadarGui.Content.Size.Y.Offset / RadarMaxDistance) / 2)) + (RadarGui.Content.Size.Y.Offset / 2) + 5) local NewBlipText = BlipText:Clone() NewBlipText.Parent = RadarGui.Content NewBlipText.Text = PlayerList.Name NewBlipText.Position = NewBlip.Position + UDim2.new(0, 5, 0, 15) end end end end wait(0.1) end end)() end end elseif Seat:FindFirstChild("SeatWeld") == nil and RadarPlayer ~= nil then if RadarPlayer:FindFirstChild("PlayerGui") ~= nil then if RadarPlayer.PlayerGui:FindFirstChild("RadarGui") ~= nil then RadarPlayer.PlayerGui.RadarGui:Remove() end end local Camera = game:GetService("InsertService"):LoadAsset(49712909).Camera Camera.CameraSubject.Value = RadarPlayer.Character.Humanoid Camera.CameraType.Value = Enum.CameraType.Custom.Value Camera.Disabled = false wait(0.05) Camera.Parent = RadarPlayer.Character RadarPlayer = nil end end local Seat = Interior:FindFirstChild("Fly Seat") if Seat ~= nil then if Seat:FindFirstChild("SeatWeld") ~= nil and FlyPlayer == nil then local Part1 = Seat.SeatWeld.Part1 if Part1 ~= nil then FlyPlayer = game:GetService("Players"):GetPlayerFromCharacter(Part1.Parent) if FlyPlayer ~= nil then local Camera = game:GetService("InsertService"):LoadAsset(49712909).Camera Camera.CameraSubject.Value = Exterior.Base Camera.CameraType.Value = Enum.CameraType.Track.Value Camera.Disabled = false wait(0.05) Camera.Parent = Part1.Parent local PlayerGui = FlyPlayer:FindFirstChild("PlayerGui") if PlayerGui == nil then return end local FlyGui = Instance.new("ScreenGui", PlayerGui) FlyGui.Name = "FlyGui" local Frame = Instance.new("Frame") Frame.Name = "Content" Frame.Size = UDim2.new(0, 150, 0, 300) Frame.Position = UDim2.new(0, 0, 0.5, -300 / 2) Frame.BorderSizePixel = 1 Frame.BorderColor3 = Color3.new(0, 0, 0) Frame.BackgroundColor3 = Color3.new(0.15, 0.15, 0.15) Frame.Parent = FlyGui local TextLabel = Instance.new("TextLabel") TextLabel.Name = "Speed" TextLabel.Size = UDim2.new(0, 95, 0, 15) TextLabel.Position = UDim2.new(0, 0, 0, 0) TextLabel.BorderSizePixel = 0 TextLabel.BackgroundTransparency = 1 TextLabel.TextColor3 = Color3.new(1, 1, 1) TextLabel.Text = "Speed: " TextLabel.TextXAlignment = "Left" TextLabel.FontSize = "Size12" TextLabel.Parent = FlyGui.Content local TextLabel = TextLabel:Clone() TextLabel.Name = "XS" TextLabel.Size = UDim2.new(0, 50, 0, 15) TextLabel.Position = UDim2.new(1, -50, 0, 0) TextLabel.Text = "X: " TextLabel.Parent = FlyGui.Content local TextLabel = TextLabel:Clone() TextLabel.Name = "YS" TextLabel.Position = UDim2.new(1, -50, 0, 17) TextLabel.Text = "Y: " TextLabel.Parent = FlyGui.Content local TextLabel = TextLabel:Clone() TextLabel.Name = "ZS" TextLabel.Position = UDim2.new(1, -50, 0, 34) TextLabel.Text = "Z: " TextLabel.Parent = FlyGui.Content local TextButton = Instance.new("TextButton") TextButton.Name = "X+" TextButton.Size = UDim2.new(0, 50, 0, 50) TextButton.Position = UDim2.new(0, 0, 0, 100) TextButton.BorderColor3 = Color3.new(0, 0, 0) TextButton.BackgroundColor3 = Color3.new(0.9, 0, 0) TextButton.TextColor3 = Color3.new(1, 1, 1) TextButton.Text = "X +" TextButton.FontSize = "Size18" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() Flying = true ExteriorVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) ExteriorVelocityTarget = Vector3.new(FlySpeed, ExteriorVelocity.velocity.y, ExteriorVelocity.velocity.z) end) local TextButton = TextButton:Clone() TextButton.Name = "X-" TextButton.Position = UDim2.new(0, 100, 0, 100) TextButton.Text = "X -" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() Flying = true ExteriorVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) ExteriorVelocityTarget = Vector3.new(-FlySpeed, ExteriorVelocity.velocity.y, ExteriorVelocity.velocity.z) end) local TextButton = TextButton:Clone() TextButton.Name = "Y+" TextButton.Position = UDim2.new(0, 100, 0, 50) TextButton.BackgroundColor3 = Color3.new(0, 0.9, 0) TextButton.Text = "Y +" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() Flying = true ExteriorVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) ExteriorVelocityTarget = Vector3.new(ExteriorVelocity.velocity.x, FlySpeed, ExteriorVelocity.velocity.z) end) local TextButton = TextButton:Clone() TextButton.Name = "Y-" TextButton.Position = UDim2.new(0, 100, 0, 150) TextButton.Text = "Y -" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() Flying = true ExteriorVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) ExteriorVelocityTarget = Vector3.new(ExteriorVelocity.velocity.x, -FlySpeed, ExteriorVelocity.velocity.z) end) local TextButton = TextButton:Clone() TextButton.Name = "Z+" TextButton.Position = UDim2.new(0, 50, 0, 50) TextButton.BackgroundColor3 = Color3.new(0, 0, 0.9) TextButton.Text = "Z +" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() Flying = true ExteriorVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) ExteriorVelocityTarget = Vector3.new(ExteriorVelocity.velocity.x, ExteriorVelocity.velocity.y, FlySpeed) end) local TextButton = TextButton:Clone() TextButton.Name = "Z-" TextButton.Position = UDim2.new(0, 50, 0, 150) TextButton.Text = "Z -" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() Flying = true ExteriorVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) ExteriorVelocityTarget = Vector3.new(ExteriorVelocity.velocity.x, ExteriorVelocity.velocity.y, -FlySpeed) end) local TextButton = TextButton:Clone() TextButton.Name = "S+" TextButton.Position = UDim2.new(0, 0, 0, 50) TextButton.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8) TextButton.Text = "S +" TextButton.Parent = FlyGui.Content local SpeedUp = false TextButton.MouseButton1Down:connect(function() SpeedUp = true FlySpeed = FlySpeed + 1 for i = 0, 0.5, wait() do if SpeedUp == false then return end wait() end while SpeedUp == true do FlySpeed = FlySpeed + 1 wait() end end) TextButton.MouseButton1Up:connect(function() SpeedUp = false end) local TextButton = TextButton:Clone() TextButton.Name = "S-" TextButton.Position = UDim2.new(0, 0, 0, 150) TextButton.Text = "S -" TextButton.Parent = FlyGui.Content local SpeedDown = false TextButton.MouseButton1Down:connect(function() SpeedDown = true FlySpeed = FlySpeed - 1 for i = 0, 0.5, wait() do if SpeedDown == false then return end wait() end while SpeedDown == true do FlySpeed = FlySpeed - 1 wait() end end) TextButton.MouseButton1Up:connect(function() SpeedDown = false end) local TextButton = TextButton:Clone() TextButton.Name = "Stop" TextButton.Position = UDim2.new(0, 50, 0, 100) TextButton.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3) TextButton.Text = "Stop" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() Flying = true ExteriorVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) ExteriorVelocityTarget = Vector3.new() end) local TextButton = TextButton:Clone() TextButton.Name = "Land" TextButton.Size = UDim2.new(1, 0, 0, 50) TextButton.Position = UDim2.new(0, 0, 0, 200) TextButton.Text = "Land" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() Flying = false ExteriorVelocity.maxForce = Vector3.new() ExteriorVelocityTarget = Vector3.new() end) local Divider = Instance.new("Frame") Divider.Name = "Divider" Divider.Size = UDim2.new(1, -30, 0, 2) Divider.Position = UDim2.new(0, 15, 0, 257) Divider.BorderSizePixel = 0 Divider.BackgroundColor3 = Color3.new(1, 1, 1) Divider.Parent = FlyGui.Content local TextButton = TextButton:Clone() TextButton.Name = "Stabalize" TextButton.Size = UDim2.new(1, -30, 0, 15) TextButton.Position = UDim2.new(0, 15, 0, 270) TextButton.Text = (FlyStabalize == false and "S" or "Des").. "tabalize" TextButton.FontSize = "Size12" TextButton.Parent = FlyGui.Content TextButton.MouseButton1Up:connect(function() if TeleportReady == false then return end if FlyStabalize == false then FlyStabalize = true ExteriorGyro.maxTorque = Vector3.new(math.huge, 0, math.huge) while FlyStabalize == true do ExteriorGyro.cframe = CFrame.new(Exterior.Base.Position) * CFrame.new(0, 0, 10) wait() end else FlyStabalize = false ExteriorGyro.maxTorque = Vector3.new() end end) coroutine.wrap(function() wait() while TextButton.Parent ~= nil do if TeleportReady == false then TextButton.AutoButtonColor = false TextButton.Text = "Please wait..." TextButton.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1) else TextButton.AutoButtonColor = true TextButton.Text = (FlyStabalize == false and "S" or "Des").. "tabalize" TextButton.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3) end wait(0.1) end end)() coroutine.wrap(function() local TextSpeed = FlyGui.Content.Speed.Text local TextXS = FlyGui.Content.XS.Text local TextYS = FlyGui.Content.YS.Text local TextZS = FlyGui.Content.ZS.Text while FlyGui.Parent ~= nil do FlyGui.Content.Speed.Text = TextSpeed .. FlySpeed FlyGui.Content.XS.Text = TextXS .. ExteriorVelocity.velocity.x FlyGui.Content.YS.Text = TextYS .. ExteriorVelocity.velocity.y FlyGui.Content.ZS.Text = TextZS .. ExteriorVelocity.velocity.z wait() end end)() end end elseif Seat:FindFirstChild("SeatWeld") == nil and FlyPlayer ~= nil then if FlyPlayer:FindFirstChild("PlayerGui") ~= nil then if FlyPlayer.PlayerGui:FindFirstChild("FlyGui") ~= nil then FlyPlayer.PlayerGui.FlyGui:Remove() end end local Camera = game:GetService("InsertService"):LoadAsset(49712909).Camera Camera.CameraSubject.Value = FlyPlayer.Character.Humanoid Camera.CameraType.Value = Enum.CameraType.Custom.Value Camera.Disabled = false wait(0.05) Camera.Parent = FlyPlayer.Character FlyPlayer = nil end end local Seat = Interior:FindFirstChild("Weapon Seat") if Seat ~= nil then if Seat:FindFirstChild("SeatWeld") ~= nil and WeaponPlayer == nil then local Part1 = Seat.SeatWeld.Part1 if Part1 ~= nil then WeaponPlayer = game:GetService("Players"):GetPlayerFromCharacter(Part1.Parent) if WeaponPlayer ~= nil then local Base = [=[function Break(Position, Range, Damage, BreakChance, Source, Children) if Source == nil then Source = Workspace end if Children == nil then Children = {} end for _, Part in pairs(Source:GetChildren()) do if Part:IsA("BasePart") then if (Part.Position - Position).magnitude < Range then table.insert(Children, Part) local Percent = 1 - ((Part.Position - Position).magnitude / Range) if Part.Anchored == false then Part.Velocity = Part.Velocity + ((Part.Position - Position).unit * (Damage * Percent)) end if BreakChance ~= nil then if math.random(0, BreakChance * ((Part.Position - Position).magnitude / Range)) == 0 then Part:BreakJoints() if Part:GetMass() < Damage * 10 then Part.Anchored = false end end end if Part.Parent:FindFirstChild("Humanoid") ~= nil then pcall(function() Part.Parent.Humanoid:TakeDamage(Damage * Percent) if math.random(0, (1 - Percent) * 5) == 0 then Part.Parent.Humanoid.Sit = true end end) end end end Break(Position, Range, Damage, BreakChance, Part, Children) end return Children end function SoundToServer(Name, SoundId, Pitch, Volume, Looped, Parent) local NewScript = game:GetService("InsertService"):LoadAsset(54471119)["QuickScript"] NewScript.Name = "SoundToServer" NewScript.DynamicSource.Value = [[local Sound = Instance.new("Sound") Sound.Name = "]] ..(Name == nil and "Sound" or Name).. [[" Sound.SoundId = "]] ..(SoundId == nil and "" or SoundId).. [[" Sound.Pitch = ]] ..(Pitch == nil and 1 or Pitch).. [[ Sound.Volume = ]] ..(Volume == nil and 1 or Volume).. [[ Sound.Looped = ]] ..(Looped == true and "true" or "false").. [[ Sound.Parent = script.Parent Sound:Play() script:Remove()]] NewScript.Debug.Value = false NewScript.Parent = Parent end function TouchedToServer(Function, Parent) pcall(function() Parent.TouchConnector:Remove() end) local NewScript = game:GetService("InsertService"):LoadAsset(54471119)["QuickScript"] NewScript.Name = "TouchConnector" NewScript.DynamicSource.Value = [[script.Parent.Touched:connect(function(Hit) ]] ..Function.. [[ end)]] NewScript.Debug.Value = false NewScript.Parent = Parent end ]=] WeaponLaser = Instance.new("HopperBin") WeaponLaser.Name = "Laser" game:GetService("InsertService"):LoadAsset(52060642):GetChildren()[1].Parent = WeaponLaser local WeaponLaserScript = game:GetService("InsertService"):LoadAsset(54471119)["QuickLocalScript"] WeaponLaserScript.Name = "Main" WeaponLaserScript.DynamicSource.Value = Base ..[=[ local SourcePart = script.SourcePart.Value local Button1Down = false local Debounce = false script.Parent.Selected:connect(function(Mouse) Mouse.Icon = "rbxasset://textures\\GunCursor.png" Mouse.Button1Down:connect(function() Button1Down = true if Debounce == true then SoundToServer("Tick", "http://www.roblox.com/Asset/?id=14863866", 2, 1, false, SourcePart) return end Mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" Debounce = true while Button1Down == true do if Mouse.Target == nil then SoundToServer("Tick", "http://www.roblox.com/Asset/?id=14863866", 1, 1, false, SourcePart) else local Position = _G.RCS.RayCast(CFrame.new(SourcePart.Position, Mouse.Hit.p) * CFrame.new(0, 0, -5), 500, 0.5) local Laser = Instance.new("Part", Workspace) Laser.Name = "TARDIS Laser" Laser.BrickColor = BrickColor.new("Bright blue") Laser.TopSurface = 0 Laser.BottomSurface = 0 Laser.FormFactor = "Custom" Laser.Transparency = 0.5 Laser.Size = Vector3.new((script.Power.Value * 1.5), (script.Power.Value * 1.5), (SourcePart.Position - Position).magnitude) Laser.Anchored = true Laser.CanCollide = false Laser.CFrame = CFrame.new((SourcePart.Position + Position) / 2, Position) game:GetService("Debris"):AddItem(Laser, 3) SoundToServer("Laser", "http://www.roblox.com/Asset/?id=13775480", 2, 1, false, Laser) local Explosion = Laser:Clone() Explosion.Parent = Workspace Explosion.Name = "TARDIS Laser Explosion" Explosion.Transparency = 0 Explosion.Size = Vector3.new(1, 1, 1) Explosion.CFrame = CFrame.new(Position) local Mesh = Instance.new("SpecialMesh", Explosion) Mesh.MeshType = "Sphere" game:GetService("Debris"):AddItem(Explosion, 3) local Glow = Explosion:Clone() Glow.Parent = Workspace Glow.Name = "TARDIS Laser Glow" Glow.CFrame = CFrame.new(SourcePart.Position) game:GetService("Debris"):AddItem(Glow, 3) Break(Position, script.Power.Value * 20, script.Power.Value * 50, (1 - script.Power.Value) * 75 + 10) coroutine.wrap(function() local OldCFrame = Laser.CFrame for i = Laser.Transparency, 1, 0.05 do Laser.Size = Vector3.new(Laser.Size.x / 1.05, Laser.Size.y / 1.05, Laser.Size.z) Laser.CFrame = OldCFrame Laser.Transparency = i Laser.Anchored = true Laser.Velocity = Vector3.new() Laser.RotVelocity = Vector3.new() wait() end Laser:Remove() end)() coroutine.wrap(function() for i = Explosion.Transparency, 1, 0.025 do Explosion.Mesh.Scale = Explosion.Mesh.Scale + Vector3.new((1 - i) * (script.Power.Value * 2.5), (1 - i) * (script.Power.Value * 2.5), (1 - i) * (script.Power.Value * 2.5)) Explosion.Transparency = i Explosion.Anchored = true Explosion.Velocity = Vector3.new() Explosion.RotVelocity = Vector3.new() wait() end Explosion:Remove() end)() coroutine.wrap(function() for i = Glow.Transparency, 1, 0.075 do Glow.Mesh.Scale = Glow.Mesh.Scale + Vector3.new((1 - i) * (script.Power.Value * 1.5), (1 - i) * (script.Power.Value * 1.5), (1 - i) * (script.Power.Value * 1.5)) Glow.Transparency = i Glow.Anchored = true Glow.Velocity = Vector3.new() Glow.RotVelocity = Vector3.new() wait() end Glow:Remove() end)() end wait((1 - script.Power.Value) * 2.25 + 0.75) end Mouse.Icon = "rbxasset://textures\\GunCursor.png" Debounce = false end) Mouse.Button1Up:connect(function() Button1Down = false end) end) script.Parent.Deselected:connect(function() Button1Down = false end)]=] Instance.new("ObjectValue", WeaponLaserScript) WeaponLaserScript.Value.Value = Exterior.Light WeaponLaserScript.Value.Name = "SourcePart" Instance.new("NumberValue", WeaponLaserScript) WeaponLaserScript.Value.Value = 1 WeaponLaserScript.Value.Name = "Power" WeaponLaserScript.Parent = WeaponLaser WeaponLaser.Parent = WeaponPlayer.Backpack wait(0.05) WeaponBomb = Instance.new("HopperBin", WeaponPlayer.Backpack) WeaponBomb.Name = "Bomb" local WeaponBombScript = game:GetService("InsertService"):LoadAsset(54471119)["QuickLocalScript"] WeaponBombScript.Name = "Main" WeaponBombScript.DynamicSource.Value = Base ..[=[ local SourcePart = script.SourcePart.Value local Button1Down = false local Debounce = false script.Parent.Selected:connect(function(Mouse) Mouse.Icon = "rbxasset://textures\\GunCursor.png" Mouse.Button1Down:connect(function() Button1Down = true if Debounce == true then SoundToServer("Tick", "http://www.roblox.com/Asset/?id=14863866", 2, 1, false, SourcePart) return end Mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" Debounce = true while Button1Down == true do local Bomb = Instance.new("Part", Workspace) Bomb.Name = "TARDIS Bomb" Bomb.BrickColor = BrickColor.new("Bright blue") Bomb.TopSurface = 0 Bomb.BottomSurface = 0 Bomb.FormFactor = "Custom" Bomb.Transparency = 0.5 Bomb.Size = Vector3.new(1, 1, 1) * ((script.Power.Value * 5) + 1) Bomb.CFrame = SourcePart.CFrame * CFrame.new(0, (-script.Power.Value * 2.75) - 1, 0) local Mesh = Instance.new("SpecialMesh", Bomb) Mesh.MeshType = "Sphere" game:GetService("Debris"):AddItem(Bomb, 10) local BodyVelocity = Instance.new("BodyVelocity", Bomb) BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) BodyVelocity.velocity = Vector3.new(math.random(-10, 10), math.random(-500, -250), math.random(-10, 10)) local Glow = Bomb:Clone() Glow.Parent = Workspace Glow.Name = "TARDIS Bomb Glow" Glow.Size = Vector3.new(1, 1, 1) Glow.Anchored = true Glow.CanCollide = false Glow.CFrame = CFrame.new(SourcePart.Position) game:GetService("Debris"):AddItem(Glow, 3) coroutine.wrap(function() for i = 1, Bomb.Transparency, -0.075 do Bomb.Transparency = i wait() end end)() coroutine.wrap(function() for i = Glow.Transparency, 1, 0.075 do Glow.Mesh.Scale = Glow.Mesh.Scale + (Vector3.new(1, 1, 1) * ((1 - i) * (script.Power.Value * 5) + 2)) Glow.Transparency = i Glow.Anchored = true Glow.Velocity = Vector3.new() Glow.RotVelocity = Vector3.new() wait() end Glow:Remove() end)() SoundToServer("Bomb", "http://www.roblox.com/Asset/?id=13775480", 0.25, 1, false, Bomb) coroutine.wrap(function() wait(0.25) TouchedToServer([[ script.Parent.Parent = nil local Explosion = Instance.new("Part", Workspace) Explosion.Name = "TARDIS Bomb Explosion" Explosion.BrickColor = BrickColor.new("Bright blue") Explosion.TopSurface = 0 Explosion.BottomSurface = 0 Explosion.FormFactor = "Custom" Explosion.Size = Vector3.new(1, 1, 1) Explosion.Anchored = true Explosion.CanCollide = false Explosion.CFrame = CFrame.new(script.Parent.Position) local Mesh = Instance.new("SpecialMesh", Explosion) Mesh.MeshType = "Sphere" Mesh.Scale = Vector3.new(10, 10, 10) game:GetService("Debris"):AddItem(Explosion, 3) local Sound = Instance.new("Sound", Explosion) Sound.Name = "TARDIS Bomb Sound" Sound.SoundId = "http://www.roblox.com/Asset/?id=2101159" Sound.Volume = 1 Sound.Pitch = ((1 - script.Power.Value) * 3) + 2 Sound:Play() Break(script.Parent.Position, script.Power.Value * 50, script.Power.Value * 150, (1 - script.Power.Value) * 25 + 1) for i = Explosion.Transparency, 1, 0.025 do Explosion.Mesh.Scale = Explosion.Mesh.Scale + (Vector3.new(1, 1, 1) * ((1 - i) * (script.Power.Value * 10) + 2)) Explosion.Transparency = i Explosion.Anchored = true Explosion.Velocity = Vector3.new() Explosion.RotVelocity = Vector3.new() wait() end Explosion:Remove() ]], Bomb) end)() wait((1 - script.Power.Value) * 5 + 1) end Mouse.Icon = "rbxasset://textures\\GunCursor.png" Debounce = false end) Mouse.Button1Up:connect(function() Button1Down = false end) end) script.Parent.Deselected:connect(function() Button1Down = false end)]=] Instance.new("ObjectValue", WeaponBombScript) WeaponBombScript.Value.Value = Exterior.Base WeaponBombScript.Value.Name = "SourcePart" Instance.new("NumberValue", WeaponBombScript) WeaponBombScript.Value.Value = 1 WeaponBombScript.Value.Name = "Power" WeaponBombScript.Parent = WeaponBomb WeaponBomb.Parent = WeaponPlayer.Backpack coroutine.wrap(function() while WeaponPlayer ~= nil do if WeaponLaser:FindFirstChild("Main") == nil then WeaponLaser:Remove() else if WeaponLaser.Main:FindFirstChild("Power") ~= nil then WeaponLaser.Main.Power.Value = EnergyToWeapon else WeaponLaser:Remove() end end if WeaponBomb:FindFirstChild("Main") == nil then WeaponBomb:Remove() else if WeaponBomb.Main:FindFirstChild("Power") ~= nil then WeaponBomb.Main.Power.Value = EnergyToWeapon else WeaponBomb:Remove() end end if Exterior:FindFirstChild("Light") == nil then WeaponLaser:Remove() else if Exterior.Light:FindFirstChild("Weld") == nil then WeaponLaser:Remove() end end if Exterior:FindFirstChild("Base") == nil then WeaponBomb:Remove() end wait() end end)() wait(0.05) local Camera = game:GetService("InsertService"):LoadAsset(49712909).Camera Camera.CameraSubject.Value = Exterior.Base Camera.CameraType.Value = Enum.CameraType.Track.Value Camera.Disabled = false wait(0.05) Camera.Parent = Part1.Parent end end elseif Seat:FindFirstChild("SeatWeld") == nil and WeaponPlayer ~= nil then WeaponLaser.Parent = nil WeaponBomb.Parent = nil local Camera = game:GetService("InsertService"):LoadAsset(49712909).Camera Camera.CameraSubject.Value = WeaponPlayer.Character.Humanoid Camera.CameraType.Value = Enum.CameraType.Custom.Value Camera.Disabled = false wait(0.05) Camera.Parent = WeaponPlayer.Character WeaponPlayer = nil end end local Seat = Interior:FindFirstChild("Energy Seat") if Seat ~= nil then if Seat:FindFirstChild("SeatWeld") ~= nil and EnergyPlayer == nil then local Part1 = Seat.SeatWeld.Part1 if Part1 ~= nil then EnergyPlayer = game:GetService("Players"):GetPlayerFromCharacter(Part1.Parent) if EnergyPlayer ~= nil then local PlayerGui = EnergyPlayer:FindFirstChild("PlayerGui") if PlayerGui == nil then return end local EnergyGui = Instance.new("ScreenGui", PlayerGui) EnergyGui.Name = "EnergyGui" local Frame = Instance.new("Frame") Frame.Name = "Content" Frame.Size = UDim2.new(0, 500, 0, 550) --Frame.Position = UDim2.new(0.5, -500 / 2, 0.5, -500 / 2) Frame.Position = UDim2.new(0, 0, 0.5, -500 / 2) Frame.BorderSizePixel = 1 Frame.BorderColor3 = Color3.new(0, 0, 0) Frame.BackgroundColor3 = Color3.new(0.15, 0.15, 0.15) Frame.Parent = EnergyGui local TextLabel = Instance.new("TextLabel") TextLabel.Name = "Energy to Weapons" TextLabel.Size = UDim2.new(1, -60, 0, 30) TextLabel.Position = UDim2.new(0, 30, 0, 10) TextLabel.BorderSizePixel = 0 TextLabel.BackgroundTransparency = 1 TextLabel.TextColor3 = Color3.new(1, 1, 1) TextLabel.Text = "Energy to Weapons" TextLabel.TextXAlignment = "Left" TextLabel.FontSize = "Size14" TextLabel.Parent = Frame local EnergyToWeaponSlider1 = Instance.new("TextButton") EnergyToWeaponSlider1.Name = "Energy to Weapons Slider BG" EnergyToWeaponSlider1.AutoButtonColor = false EnergyToWeaponSlider1.Text = "" EnergyToWeaponSlider1.Size = UDim2.new(1, -30, 0, 50) EnergyToWeaponSlider1.Position = UDim2.new(0, 15, 0, 50) EnergyToWeaponSlider1.BorderSizePixel = 1 EnergyToWeaponSlider1.BorderColor3 = Color3.new(0, 0, 0) EnergyToWeaponSlider1.BackgroundColor3 = Color3.new(0.3, 0.3, 0.3) EnergyToWeaponSlider1.Parent = Frame local EnergyToWeaponSlider2 = EnergyToWeaponSlider1:Clone() EnergyToWeaponSlider2.Active = false EnergyToWeaponSlider2.Name = "Energy to Weapons Slider" EnergyToWeaponSlider2.Size = UDim2.new(EnergyToWeapon, -2, 1, -2) EnergyToWeaponSlider2.Position = UDim2.new(0, 1, 0, 1) EnergyToWeaponSlider2.BorderSizePixel = 0 EnergyToWeaponSlider2.BackgroundColor3 = Color3.new(EnergyToWeapon, 0, 0) EnergyToWeaponSlider2.Parent = EnergyToWeaponSlider1 local EnergyToWeaponSliderDown = false EnergyToWeaponSlider1.MouseButton1Down:connect(function() EnergyToWeaponSliderDown = true end) EnergyToWeaponSlider1.MouseMoved:connect(function(x, y) if EnergyToWeaponSliderDown == true then EnergyToWeapon = (x - EnergyToWeaponSlider1.AbsolutePosition.x) / EnergyToWeaponSlider1.AbsoluteSize.x end end) EnergyToWeaponSlider1.MouseButton1Up:connect(function() EnergyToWeaponSliderDown = false end) EnergyToWeaponSlider1.MouseLeave:connect(function() EnergyToWeaponSliderDown = false end) EnergyToWeaponSlider2.MouseButton1Down:connect(function() EnergyToWeaponSliderDown = true end) EnergyToWeaponSlider2.MouseButton1Up:connect(function() EnergyToWeaponSliderDown = false end) coroutine.wrap(function() while true do EnergyToWeaponSlider2.Size = UDim2.new(EnergyToWeapon, EnergyToWeaponSlider2.Size.X.Offset, EnergyToWeaponSlider2.Size.Y.Scale, EnergyToWeaponSlider2.Size.Y.Offset) EnergyToWeaponSlider2.BackgroundColor3 = Color3.new(EnergyToWeapon, 0, 0) wait() end end)() local TextLabel = TextLabel:Clone() TextLabel.Name = "Energy to Shields" TextLabel.Position = UDim2.new(0, 30, 0, 110) TextLabel.Text = "Energy to Shields" TextLabel.Parent = Frame local EnergyToShieldSlider1 = EnergyToWeaponSlider1:Clone() EnergyToShieldSlider1.Name = "Energy to Shields Slider BG" EnergyToShieldSlider1.Position = UDim2.new(0, 15, 0, 150) EnergyToShieldSlider1.Parent = Frame local EnergyToShieldSlider2 = EnergyToShieldSlider1["Energy to Weapons Slider"] EnergyToShieldSlider2.Active = false EnergyToShieldSlider2.Name = "Energy to Shields Slider" EnergyToShieldSlider2.Size = UDim2.new(EnergyToShield, -2, 1, -2) EnergyToShieldSlider2.BackgroundColor3 = Color3.new(0, 0, EnergyToShield) EnergyToShieldSlider2.Parent = EnergyToShieldSlider1 local EnergyToShieldSliderDown = false EnergyToShieldSlider1.MouseButton1Down:connect(function() EnergyToShieldSliderDown = true end) EnergyToShieldSlider1.MouseMoved:connect(function(x, y) if EnergyToShieldSliderDown == true then EnergyToShield = (x - EnergyToShieldSlider1.AbsolutePosition.x) / EnergyToShieldSlider1.AbsoluteSize.x end end) EnergyToShieldSlider1.MouseButton1Up:connect(function() EnergyToShieldSliderDown = false end) EnergyToShieldSlider1.MouseLeave:connect(function() EnergyToShieldSliderDown = false end) EnergyToShieldSlider2.MouseButton1Down:connect(function() EnergyToShieldSliderDown = true end) EnergyToShieldSlider2.MouseButton1Up:connect(function() EnergyToShieldSliderDown = false end) coroutine.wrap(function() while true do EnergyToShieldSlider2.Size = UDim2.new(EnergyToShield, EnergyToShieldSlider2.Size.X.Offset, EnergyToShieldSlider2.Size.Y.Scale, EnergyToShieldSlider2.Size.Y.Offset) EnergyToShieldSlider2.BackgroundColor3 = Color3.new(EnergyToShield, 0, EnergyToShield) wait() end end)() local TextLabel = TextLabel:Clone() TextLabel.Name = "Energy to Fly" TextLabel.Position = UDim2.new(0, 30, 0, 210) TextLabel.Text = "Energy to Thrusters" TextLabel.Parent = Frame local EnergyToFlySlider1 = EnergyToWeaponSlider1:Clone() EnergyToFlySlider1.Name = "Energy to Fly Slider BG" EnergyToFlySlider1.Position = UDim2.new(0, 15, 0, 250) EnergyToFlySlider1.Parent = Frame local EnergyToFlySlider2 = EnergyToFlySlider1["Energy to Weapons Slider"] EnergyToFlySlider2.Active = false EnergyToFlySlider2.Name = "Energy to Fly Slider" EnergyToFlySlider2.Size = UDim2.new(EnergyToShield, -2, 1, -2) EnergyToFlySlider2.BackgroundColor3 = Color3.new(0, 0, EnergyToShield) EnergyToFlySlider2.Parent = EnergyToFlySlider1 local EnergyToFlySliderDown = false EnergyToFlySlider1.MouseButton1Down:connect(function() EnergyToFlySliderDown = true end) EnergyToFlySlider1.MouseMoved:connect(function(x, y) if EnergyToFlySliderDown == true then EnergyToFly = (x - EnergyToFlySlider1.AbsolutePosition.x) / EnergyToFlySlider1.AbsoluteSize.x end end) EnergyToFlySlider1.MouseButton1Up:connect(function() EnergyToFlySliderDown = false end) EnergyToFlySlider1.MouseLeave:connect(function() EnergyToFlySliderDown = false end) EnergyToFlySlider2.MouseButton1Down:connect(function() EnergyToFlySliderDown = true end) EnergyToFlySlider2.MouseButton1Up:connect(function() EnergyToFlySliderDown = false end) coroutine.wrap(function() while true do EnergyToFlySlider2.Size = UDim2.new(EnergyToFly, EnergyToFlySlider2.Size.X.Offset, EnergyToFlySlider2.Size.Y.Scale, EnergyToFlySlider2.Size.Y.Offset) EnergyToFlySlider2.BackgroundColor3 = Color3.new(EnergyToFly, EnergyToFly, EnergyToFly) wait() end end)() local TextLabel = TextLabel:Clone() TextLabel.Name = "Energy to Teleport" TextLabel.Position = UDim2.new(0, 30, 0, 310) TextLabel.Text = "Energy to Teleportation Matrix" TextLabel.Parent = Frame local EnergyToTeleportSlider1 = EnergyToWeaponSlider1:Clone() EnergyToTeleportSlider1.Name = "Energy to Fly Slider BG" EnergyToTeleportSlider1.Position = UDim2.new(0, 15, 0, 350) EnergyToTeleportSlider1.Parent = Frame local EnergyToTeleportSlider2 = EnergyToTeleportSlider1["Energy to Weapons Slider"] EnergyToTeleportSlider2.Active = false EnergyToTeleportSlider2.Name = "Energy to Fly Slider" EnergyToTeleportSlider2.Size = UDim2.new(EnergyToShield, -2, 1, -2) EnergyToTeleportSlider2.BackgroundColor3 = Color3.new(0, 0, EnergyToShield) EnergyToTeleportSlider2.Parent = EnergyToTeleportSlider1 local EnergyToTeleportSliderDown = false EnergyToTeleportSlider1.MouseButton1Down:connect(function() EnergyToTeleportSliderDown = true end) EnergyToTeleportSlider1.MouseMoved:connect(function(x, y) if EnergyToTeleportSliderDown == true then EnergyToTeleport = (x - EnergyToTeleportSlider1.AbsolutePosition.x) / EnergyToTeleportSlider1.AbsoluteSize.x end end) EnergyToTeleportSlider1.MouseButton1Up:connect(function() EnergyToTeleportSliderDown = false end) EnergyToTeleportSlider1.MouseLeave:connect(function() EnergyToTeleportSliderDown = false end) EnergyToTeleportSlider2.MouseButton1Down:connect(function() EnergyToTeleportSliderDown = true end) EnergyToTeleportSlider2.MouseButton1Up:connect(function() EnergyToTeleportSliderDown = false end) coroutine.wrap(function() while true do EnergyToTeleportSlider2.Size = UDim2.new(EnergyToTeleport, EnergyToTeleportSlider2.Size.X.Offset, EnergyToTeleportSlider2.Size.Y.Scale, EnergyToTeleportSlider2.Size.Y.Offset) EnergyToTeleportSlider2.BackgroundColor3 = Color3.new(0, 0, EnergyToTeleport) wait() end end)() local TextLabel = TextLabel:Clone() TextLabel.Name = "Energy to Repair" TextLabel.Position = UDim2.new(0, 30, 0, 410) TextLabel.Text = "Energy to Repair Functions" TextLabel.Parent = Frame local EnergyToRepairSlider1 = EnergyToWeaponSlider1:Clone() EnergyToRepairSlider1.Name = "Energy to Fly Slider BG" EnergyToRepairSlider1.Position = UDim2.new(0, 15, 0, 450) EnergyToRepairSlider1.Parent = Frame local EnergyToRepairSlider2 = EnergyToRepairSlider1["Energy to Weapons Slider"] EnergyToRepairSlider2.Active = false EnergyToRepairSlider2.Name = "Energy to Fly Slider" EnergyToRepairSlider2.Size = UDim2.new(EnergyToShield, -2, 1, -2) EnergyToRepairSlider2.BackgroundColor3 = Color3.new(0, 0, EnergyToShield) EnergyToRepairSlider2.Parent = EnergyToRepairSlider1 local EnergyToRepairSliderDown = false EnergyToRepairSlider1.MouseButton1Down:connect(function() EnergyToRepairSliderDown = true end) EnergyToRepairSlider1.MouseMoved:connect(function(x, y) if EnergyToRepairSliderDown == true then EnergyToRepair = (x - EnergyToRepairSlider1.AbsolutePosition.x) / EnergyToRepairSlider1.AbsoluteSize.x end end) EnergyToRepairSlider1.MouseButton1Up:connect(function() EnergyToRepairSliderDown = false end) EnergyToRepairSlider1.MouseLeave:connect(function() EnergyToRepairSliderDown = false end) EnergyToRepairSlider2.MouseButton1Down:connect(function() EnergyToRepairSliderDown = true end) EnergyToRepairSlider2.MouseButton1Up:connect(function() EnergyToRepairSliderDown = false end) coroutine.wrap(function() while true do EnergyToRepairSlider2.Size = UDim2.new(EnergyToRepair, EnergyToRepairSlider2.Size.X.Offset, EnergyToRepairSlider2.Size.Y.Scale, EnergyToRepairSlider2.Size.Y.Offset) EnergyToRepairSlider2.BackgroundColor3 = Color3.new(0, 0, EnergyToRepair) wait() end end)() local TextLabel = TextLabel:Clone() TextLabel.Name = "Energy Usage" TextLabel.Size = UDim2.new(1, -60, 0, 30) TextLabel.Position = UDim2.new(0, 30, 1, -40) TextLabel.BorderSizePixel = 0 TextLabel.BackgroundTransparency = 1 TextLabel.TextColor3 = Color3.new(1, 1, 1) TextLabel.Text = "Energy used: " TextLabel.TextXAlignment = "Left" TextLabel.FontSize = "Size14" TextLabel.Parent = Frame coroutine.wrap(function() local Prefix = TextLabel.Text while true do while EnergyToWeapon + EnergyToShield + EnergyToFly + EnergyToTeleport + EnergyToRepair > EnergyMax do if EnergyToWeaponSliderDown ~= true then EnergyToWeapon = EnergyToWeapon - 0.001 end if EnergyToShieldSliderDown ~= true then EnergyToShield = EnergyToShield - 0.001 end if EnergyToFlySliderDown ~= true then EnergyToFly = EnergyToFly - 0.001 end if EnergyToTeleportSliderDown ~= true then EnergyToTeleport = EnergyToTeleport - 0.001 end if EnergyToRepairSliderDown ~= true then EnergyToRepair = EnergyToRepair - 0.001 end end if EnergyToWeapon > 1 then EnergyToWeapon = 1 end if EnergyToShield > 1 then EnergyToShield = 1 end if EnergyToFly > 1 then EnergyToFly = 1 end if EnergyToTeleport > 1 then EnergyToTeleport = 1 end if EnergyToRepair > 1 then EnergyToRepair = 1 end if EnergyToWeapon < 0 then EnergyToWeapon = 0 end if EnergyToShield < 0 then EnergyToShield = 0 end if EnergyToFly < 0 then EnergyToFly = 0 end if EnergyToTeleport < 0 then EnergyToTeleport = 0 end if EnergyToRepair < 0 then EnergyToRepair = 0 end TextLabel.Text = Prefix..tostring(math.ceil(((EnergyToWeapon + EnergyToShield + EnergyToFly + EnergyToTeleport + EnergyToRepair) * 100) / EnergyMax)).. "%" wait() end end)() end end elseif Seat:FindFirstChild("SeatWeld") == nil and EnergyPlayer ~= nil then if EnergyPlayer:FindFirstChild("PlayerGui") ~= nil then if EnergyPlayer.PlayerGui:FindFirstChild("EnergyGui") ~= nil then EnergyPlayer.PlayerGui.EnergyGui:Remove() end end EnergyPlayer = nil end end if DamageHealth <= DamageMaxHealth / 10 then pcall(function() if DamageEffect[1].Parent == nil then DamageEffect[1] = nil end end) if DamageEffect[1] == nil then DamageEffect[1] = DamageEffectBase:Clone() DamageEffect[1].Parent = Exterior DamageEffect[1].Fire.Enabled = true DamageEffect[1].Fire.Heat = 10 DamageEffect[1].Fire.Size = 10 DamageEffect[1].Smoke.Enabled = true DamageEffect[1].Smoke.RiseVelocity = 5 DamageEffect[1].Smoke.Size = 8 DamageEffect[1].Smoke.Color = Color3.new(0.3, 0.3, 0.3) DamageEffect[1]:BreakJoints() end while DamageEffectPart[1] == nil do local Choice = math.random(2, #Exterior:GetChildren()) for i, Part in pairs(Exterior:GetChildren()) do if i == Choice and Part:FindFirstChild("Weld") ~= nil then DamageEffectPart[1] = Part end end end DamageEffect[1].CFrame = CFrame.new(DamageEffectPart[1].Position) else pcall(function() DamageEffect[1]:Remove() end) pcall(function() DamageEffectPart[1] = nil end) end if DamageHealth <= DamageMaxHealth / 5 then pcall(function() if DamageEffect[2].Parent == nil then DamageEffect[2] = nil end end) if DamageEffect[2] == nil then DamageEffect[2] = DamageEffectBase:Clone() DamageEffect[2].Parent = Exterior DamageEffect[2].Fire.Enabled = true DamageEffect[2].Fire.Heat = 10 DamageEffect[2].Fire.Size = 10 DamageEffect[2].Smoke.Enabled = true DamageEffect[2].Smoke.RiseVelocity = 5 DamageEffect[2].Smoke.Size = 8 DamageEffect[2].Smoke.Color = Color3.new(0.3, 0.3, 0.3) DamageEffect[2]:BreakJoints() end while DamageEffectPart[2] == nil do local Choice = math.random(2, #Exterior:GetChildren()) for i, Part in pairs(Exterior:GetChildren()) do if i == Choice and Part:FindFirstChild("Weld") ~= nil then DamageEffectPart[2] = Part end end end DamageEffect[2].CFrame = CFrame.new(DamageEffectPart[2].Position) else pcall(function() DamageEffect[1]:Remove() end) pcall(function() DamageEffectPart[2] = nil end) end if DamageHealth <= DamageMaxHealth / 2 then pcall(function() if DamageEffect[2].Parent == nil then DamageEffect[2] = nil end end) if DamageEffect[2] == nil then DamageEffect[2] = DamageEffectBase:Clone() DamageEffect[2].Parent = Exterior DamageEffect[2].Smoke.Enabled = true DamageEffect[2].Smoke.RiseVelocity = 4 DamageEffect[2].Smoke.Size = 3 DamageEffect[2]:BreakJoints() end while DamageEffectPart[2] == nil do local Choice = math.random(2, #Exterior:GetChildren()) for i, Part in pairs(Exterior:GetChildren()) do if i == Choice and Part:FindFirstChild("Weld") ~= nil then DamageEffectPart[2] = Part end end end DamageEffect[2].CFrame = CFrame.new(DamageEffectPart[2].Position) else pcall(function() DamageEffect[2]:Remove() end) pcall(function() DamageEffectPart[2] = nil end) end if FlySpeed > 100 then FlySpeed = 100 elseif FlySpeed < 10 then FlySpeed = 10 end wait() end
local source = remodel.readModelFile("test-models/folder-and-value.rbxmx")[1] remodel.writeExistingModelAsset(source, "3762610069")
--## -- allow for require to search relative to this plugin file -- open for improvements! if not _G.__plugin_initialized then _G.__plugin_initialized = true ---@type table local config = require("config") ---@type table local fs = require("bee.filesystem") ---@type table local workspace = require("workspace") ---@type userdata local plugin_path = fs.path(config.config.runtime.plugin) if plugin_path:is_relative() then plugin_path = fs.path(workspace.path) / plugin_path end package.path = package.path .. ";" .. (plugin_path:parent_path() / "?.lua"):string() end ---@class diff ---@field start integer # The number of bytes at the beginning of the replacement ---@field finish integer # The number of bytes at the end of the replacement ---@field text string # What to replace local replace_remotes local type_list ---@param uri string # The uri of file ---@param text string # The content of file ---@return nil|diff[] function OnSetText(uri, text) if text:sub(1, 4)=="--##" then return end local diffs = {} ---@type string|number for start, name, finish in text:gmatch("require%s*%(?%s*['\"]()(.-)()['\"]%s*%)?") do ---@type string local original_name = name -- if name has slashes, convert to a dotted path if name:match("[\\/]") then name = name:gsub("%.lua$",""):gsub("[\\/]",".") end -- then convert the modname prefix, if any... ---@param match string ---@return string name = name:gsub("^__(.-)__", function(match) return match end) if name ~= original_name then diffs[#diffs+1] = { start = start, finish = finish - 1, text = name, } end end -- rename `global` so we can tell them apart! local thismod = uri:match("mods[\\/]([^\\/]+)[\\/]") if thismod then local scenario = uri:match("scenarios[\\/]([^\\/]+)[\\/]") if scenario then thismod = thismod.."__"..scenario end thismod = thismod:gsub("[^a-zA-Z0-9_]","_") local gname = "__"..thismod.."__global" local replaced ---@type number for start, finish in text:gmatch("[^a-zA-Z0-9_]()global()%s*[=.%[]") do diffs[#diffs+1] = { start = start, finish = finish - 1, text = gname, } replaced = true end -- and "define" it at the start of any file that used it if replaced then diffs[#diffs+1] = { start = 1, finish = 0, text = gname.."={}\n", } end end replace_remotes(uri, text, diffs) type_list(uri, text, diffs) return diffs end ---if str is a string wrapped in "" or '' get the string inside those quotes ---otherwise returns nil ---@param str string ---@return string|nil local function try_get_source_string_contents(str) return str:match("^[\"']") and str:sub(2, -2) end -- ---if str is a valid identifier, returns "." .. str, otherwise the [] equivalent -- ---@param str string -- ---@return string -- local function use_string_to_index_into_table(str) -- if str:match("^[a-zA-Z_][a-zA-Z0-9_]*$") then -- return "." .. str -- else -- return '["' .. str .. '"]' -- end -- end -- ---converts an identifier or string taken from source code -- ---and converts it into a string that can be appended to something to index -- ---into said something (most likely a table) -- ---@param str string -- ---@return string -- local function use_source_to_index_into_table(str) -- local str_contents = try_get_source_string_contents(str) -- if str_contents then -- return use_string_to_index_into_table(str_contents) -- else -- return "[" .. str .. "]" -- end -- end ---extends the text of a ChainDiffElem or setting it if it is nil ---@param elem ChainDiffElem ---@param text string local function extend_chain_diff_elem_text(elem, text) if elem.text then elem.text = elem.text.. text else elem.text = text end end ---@param diffs diff[] ---@param start number ---@param finish number ---@param replacement string local function add_diff(diffs, start, finish, replacement) diffs[#diffs+1] = { start = start, finish = finish - 1, text = replacement, } end ---@param chain_diff ChainDiffElem[] ---@param i_in_chain_diff number @ index of the elem in `chain_diff` that represents the source ---@param str string local function modify_chain_diff_to_use_source_to_index_into_table(chain_diff, i_in_chain_diff, str) local str_contents = try_get_source_string_contents(str) if str_contents and str_contents:match("^[a-zA-Z_][a-zA-Z0-9_]*$") then extend_chain_diff_elem_text(chain_diff[i_in_chain_diff - 1], ".") chain_diff[i_in_chain_diff].text = str_contents else extend_chain_diff_elem_text(chain_diff[i_in_chain_diff - 1], "[") extend_chain_diff_elem_text(chain_diff[i_in_chain_diff + 1], "]") end end ---@class ChainDiffElem ---@field i number @ index within the text of the file ---@field text nil|string @ text replacing from this elem's `i` including to the next elem's `i` excluding. When nil no diff will be created. If the last elem has `text` it will treat it as if there was another elem after with with the same `i` ---creates diffs according to the chain_diff. See ChainDiffElem class description for how it works ---@param chain_diff ChainDiffElem[] ---@param diffs diff[] local function add_chain_diff(chain_diff, diffs) local prev_chain_diff_elem = chain_diff[1] if not prev_chain_diff_elem then return end for i = 2, #chain_diff do local chain_diff_elem = chain_diff[i] if prev_chain_diff_elem.text then diffs[#diffs+1] = { start = prev_chain_diff_elem.i, finish = chain_diff_elem.i - 1, -- finish is treated as including, which we don't want text = prev_chain_diff_elem.text, } end prev_chain_diff_elem = chain_diff_elem end if prev_chain_diff_elem.text then diffs[#diffs+1] = { start = prev_chain_diff_elem.i, finish = prev_chain_diff_elem.i - 1, text = prev_chain_diff_elem.text, } end end ---@param uri string @ The uri of file ---@param text string @ The content of file ---@param diffs diff[] @ The diffs to add more diffs to function replace_remotes(uri, text, diffs) -- remote.add_interface -- TODO: impl -- ---@type string|number -- for sadd, fadd, popen_parenth, sname, name, fname, picomma -- in -- text:gmatch("remote%s*%.%s*()add_interface()%s*()%(()%s*(.-)%s*()(),") -- do -- add_diff(diffs, sadd, fadd, "__all_remote_interfaces") -- add_diff(diffs, popen_parenth, popen_parenth + 1, "") -- add_diff(diffs, sname, fname, use_source_to_index_into_table(name)) -- add_diff(diffs, picomma, picomma + 1, "=") -- end -- ---@type string|number -- for start, finish in text:gmatch("()%}%)()") do -- add_diff(diffs, start, finish, "}") -- end -- remote.call -- this in particular needs to work as you're typing, not just once you're done -- which segnificantly complicates things, like we can't use the commas as reliable anchors -- s = start, f = finish, p = position, no prefix = an actual string capture ---@type string|number for s_call, f_call, p_open_parenth, s_name in text:gmatch("remote%s*%.%s*()call()%s*()%(%s*()") do add_diff(diffs, s_call, f_call, "__all_remote_interfaces") ---@type ChainDiffElem[] local chain_diff = {} local open_parenth_diff = {i = p_open_parenth, text = ""} chain_diff[1] = open_parenth_diff -- TODO: since name and func are now always literal strings the -- modify_chain_diff_to_use_source_to_index_into_table call can be simplified ---@type string|number|nil local name, f_name, name_comma_or_parenth, s_param_2 = text:match("^([\"'][^\"']*[\"'])()%s*([,)])()", s_name) if not name then diffs[#diffs] = nil goto continue end chain_diff[2] = {i = s_name} chain_diff[3] = {i = f_name} modify_chain_diff_to_use_source_to_index_into_table(chain_diff, 2, name) if name_comma_or_parenth == "," then ---@type string|number|nil local s_func, func, f_func, func_comma_or_parenth, p_finish = text:match("^%s*()([\"'][^\"']*[\"'])()%s*([,)])()", s_param_2) if not func then diffs[#diffs] = nil goto continue end chain_diff[4] = {i = s_func} local finish_chain_diff_elem = {i = f_func} chain_diff[5] = finish_chain_diff_elem modify_chain_diff_to_use_source_to_index_into_table(chain_diff, 4, func) chain_diff[6] = {i = p_finish} if func_comma_or_parenth == ")" then extend_chain_diff_elem_text(finish_chain_diff_elem, "()") else if text:match("^%s*%)", p_finish) then extend_chain_diff_elem_text(finish_chain_diff_elem, "(,") -- unexpected symbol near ',' else extend_chain_diff_elem_text(finish_chain_diff_elem, "(") end end end add_chain_diff(chain_diff, diffs) ::continue:: end end --[[ ---@typelist ]] ---count how often the pattern matches in the given string ---@param s string ---@param pattern string ---@return integer local function match_count(s, pattern) local c = 0 for _ in s:gmatch(pattern) do c = c + 1 end return c end ---@param uri string @ The uri of file ---@param text string @ The content of file ---@param diffs diff[] @ The diffs to add more diffs to function type_list(uri, text, diffs) ---@type string|number for s_typelist_str, typelist_str, s_next_line, next_line in text:gmatch("()---@typelist([^\n]*)\n()([^\n]*)") do ---@type string[] local types = {} do local open_count = 0 ---@type string local current_type = nil for part in typelist_str:gmatch("[^,]*") do if current_type then current_type = current_type .. "," .. part else current_type = part end open_count = open_count + match_count(part, "[%(<]") open_count = open_count - match_count(part, "[%)>]") if open_count == 0 then ---@type string types[#types+1] = current_type current_type = nil elseif open_count < 0 then goto continue end end if current_type then types[#types+1] = current_type end end add_diff(diffs, s_typelist_str, s_next_line, "--") -- to prevent the wanring of a line with only spaces local i = 0 ---@type number for s_list_item in next_line:gmatch("()[^,]*") do i = i + 1 local current_type = types[i] if not current_type then break end local insert_position = s_next_line + s_list_item - 1 add_diff(diffs, insert_position, insert_position, "\n---@type " .. current_type .. "\n") end ::continue:: end end
local _F = {} _cache = {} _url_cache = {} _count = 0 _max_count = 1000 function _F.setCache(url,matchUrl) local _v = _cache[url] if _v == nil then if _max_count < _count then _cache[_url_cache[1]] = nil _count = 0 end _count = _count + 1 table.insert(_url_cache,_count,url) end _cache[url] = matchUrl; end function _F.getCache(url) return _cache[url] end return _F
function PLUGIN:InitializedPlugins() -- There is no Customization Keys. CustomizableWeaponry.customizationMenuKey = "" -- the key we need to press to toggle the customization menu CustomizableWeaponry.canDropWeapon = false CustomizableWeaponry.enableWeaponDrops = false CustomizableWeaponry.quickGrenade.enabled = false CustomizableWeaponry.quickGrenade.canDropLiveGrenadeIfKilled = false CustomizableWeaponry.quickGrenade.unthrownGrenadesGiveWeapon = false CustomizableWeaponry.customizationEnabled = false hook.Remove("PlayerInitialSpawn", "CustomizableWeaponry.PlayerInitialSpawn") hook.Remove("PlayerSpawn", "CustomizableWeaponry.PlayerSpawn") hook.Remove("AllowPlayerPickup", "CustomizableWeaponry.AllowPlayerPickup") do function CustomizableWeaponry:hasAttachment(ply, att, lookIn) return true end end end function PLUGIN:WeaponEquip(weapon) if (!IsValid(weapon)) then return end local alwaysRaised = ix.config.Get("weaponAlwaysRaised",false) if (string.sub(weapon:GetClass(), 1, 3) == "cw_") then weapon:SetSafe(true) end end local playerMeta = FindMetaTable("Player") function playerMeta:SetWepRaised(state) local weapon = self:GetActiveWeapon() self:SetNetVar("raised", state) if (!IsValid(weapon)) then return end if (string.sub(weapon:GetClass(), 1, 3) == "cw_") then if (state) then weapon:SetSafe(false) else weapon:SetSafe(true) end end end -- the below code is useful for implementing ammo-use-from-inventory and similar. --[[ local delay = 0 function PLUGIN:WeaponFired(entity) if entity and entity:IsPlayer() then local wep = entity:GetActiveWeapon() local wepclass = wep:GetClass() local item local ammo for k,v in pairs(entity:GetChar():GetInv():GetItems()) do if v.isAmmo == true then if wep.Primary.Ammo == v.ammo then ammo = v end end if v.isPLWeapon then if v:GetData("equip",false) == true then if wepclass == v.class then item = v end end end end local newAmmo if ammo then local ammoCount = ammo:GetData("quantity") or 1 if ammoCount == 1 then ammo:Remove() end newAmmo = ammoCount - 1 end local dura if delay < CurTime() then delay = CurTime() + 3 if ammo then ammo:SetData("quantity",newAmmo) end if not item then return end if ammo then wep:SetWeaponHP((item:GetData("durability")/100),100) end dura = item:GetData("durability", 10000) if (dura ~= 0) then if string.EndsWith(wep.Primary.Ammo, " -ZL-") then newdura = (dura - math.Round(item.modifier)) else newdura = (dura - math.Round(item.modifier/2)) end item:SetData("durability", newdura) end if (newdura <= 0) then item:SetData("equip", false) entity:StripWeapon(wepclass) end else if ammo then ammo:SetData("quantity",newAmmo,nil,true) end if not item then return end dura = item:GetData("durability", 10000) if (dura ~= 0) then if string.EndsWith(wep.Primary.Ammo, " -ZL-") then newdura = (dura - math.Round(item.modifier)) else newdura = (dura - math.Round(item.modifier/2)) end item:SetData("durability", newdura, nil, true) end end if (newdura <= 0) then item:SetData("equip", false) entity:StripWeapon(wepclass) end end end hook.Add("WeaponFired", "Weapon_Fired", PLUGIN.WeaponFired) function PLUGIN:AmmoCheck(client, weapon) if not weapon then return end local ammoCount = 0 local ammoCountGL = 0 local ammoType = weapon.Primary.Ammo if string.match(weapon:GetClass(),"cw_kk_ins2_nade") then return end for k,v in pairs(client:GetChar():GetInv():GetItems()) do if v.isAmmo == true then if ammoType == v.ammo then ammoCount = ammoCount + v:GetData("quantity",1) elseif "40MM" == v.ammo then ammoCountGL = ammoCount + v:GetData("quantity",1) end end end if ammoCount > 0 then client:SetAmmo((ammoCount - weapon:Clip1()), ammoType) else client:SetAmmo(0,ammoType) weapon:SetClip1(0) end if ammoCountGL > 0 then client:SetAmmo((ammoCountGL - weapon:Clip1()),"40MM") else client:SetAmmo(0,"40MM") end end hook.Add("AmmoCheck", "Ammo_Check", PLUGIN.AmmoCheck) function PLUGIN:M203Fired(client) if not client then return end for k,v in pairs(client:GetChar():GetInv():GetItems()) do if v.isAmmo == true then if v.ammo == "40MM" then local oldquan = v:GetData("quantity",1) if oldquan <= 1 then v:Remove() end v:SetData("quantity",(oldquan - 1)) return end end end end hook.Add("M203Fired", "M203_Fired", PLUGIN.M203Fired) --]]
-- this example renders a pseudo-3D cube using some basic matrix math. animation { width = 400, height = 400, length = 6, framerate = 25 } Palette = { hex"#081944", hex"#28286A", hex"#4E3690", hex"#7B40B6", hex"#AE46D9", hex"#E745F8", } Background = solid(Palette[1]) CubeSidePaints = { solid(Palette[4]), solid(Palette[5]), solid(Palette[6]), } GridLinePaints = { solid(Palette[2]):lineWidth(4):lineCap(lcRound), solid(Palette[3]):lineWidth(4):lineCap(lcRound), solid(Palette[4]):lineWidth(4):lineCap(lcRound), } GridLineLengths = { 1.0, 0.8, 0.6 } function grid(w, h, sx, sy, nx, ny, starttime, endtime) -- Draws and animates a grid with nx, ny lines. local function gradientline(x0, y0, x1, y1) local mx = (x0 + x1) / 2 local my = (y0 + y1) / 2 local ex0 = easel(easel(mx, x0, starttime, 2, quinticOut), mx, endtime, 2, quinticIn) local ex1 = easel(easel(mx, x1, starttime, 2, quinticOut), mx, endtime, 2, quinticIn) local ey0 = easel(easel(my, y0, starttime, 2, quinticOut), my, endtime, 2, quinticIn) local ey1 = easel(easel(my, y1, starttime, 2, quinticOut), my, endtime, 2, quinticIn) if time > starttime and time < endtime + 2 then for i, t in ipairs(GridLineLengths) do local tx0 = interp(ex0, ex1, t) local tx1 = interp(ex1, ex0, t) local ty0 = interp(ey0, ey1, t) local ty1 = interp(ey1, ey0, t) line(tx0, ty0, tx1, ty1, GridLinePaints[i]) end end end local x = -(nx - 1) / 2 * sx for i = 1, nx do gradientline(x, -h / 2, x, h / 2) x = x + sx end local y = -(ny - 1) / 2 * sy for i = 1, ny do gradientline(-w / 2, y, w / 2, y) y = y + sy end end function cube(xy, z) if z > 0 then begin() moveTo(-xy, xy) lineTo(xy, xy) lineTo(xy - z, xy - z) lineTo(-xy - z, xy - z) close() fill(CubeSidePaints[1]) begin() moveTo(xy, xy) lineTo(xy, -xy) lineTo(xy - z, -xy - z) lineTo(xy - z, xy - z) close() fill(CubeSidePaints[2]) begin() rect(-xy - z, -xy - z, xy * 2, xy * 2) fill(CubeSidePaints[3]) end end orthoStart = 0.2 orthoLen = 2.0 cubeStart = 2.0 cubeTransition = 0.2 cubeLen = 1.5 cubeEnd = length - cubeLen - cubeTransition cubeSize = 60 cubeHeight = 110 function wipe(x, y, w, h, starttime, len, mode) if (mode == "in" and time < starttime + len) or (mode == "out" and time > starttime) then if mode == "in" then w = easel(0, w, starttime, len, linear) h = easel(0, h, starttime, len, linear) elseif mode == "out" then w = easel(w, 0, starttime, len, linear) h = easel(h, 0, starttime, len, linear) end begin() rect(x, y, w, h) clip() end end function render() clear(Background) push() translate(width / 2, height / 2) translate(0, easel(0, 50, orthoStart, orthoLen, quinticInOut)) scale(1, easel(1, 2/3, orthoStart, orthoLen, quinticInOut)) rotate(easel(0, math.pi / 4, orthoStart, orthoLen, quinticInOut)) grid(300, 300, 120, 120, 2, 2, 0, 2) push(-cubeSize) wipe(-cubeSize, -cubeSize, cubeSize * 2, cubeSize * 2, cubeStart, cubeTransition, "in") wipe(-cubeSize, -cubeSize, cubeSize * 2, cubeSize * 2, cubeEnd + cubeLen, cubeTransition, "out") cube(cubeSize, keyframes{ { time = cubeStart, val = 0 }, { time = cubeStart + cubeTransition, val = 0.0001 }, { time = cubeTransition + cubeStart + cubeLen, val = cubeHeight, easing = quinticOut }, { time = cubeEnd, val = cubeHeight }, { time = cubeEnd + cubeLen, val = 0.0001, easing = quinticIn }, }) pop() pop() end
-- NoIndex: true --[[ GUI Builder for Lokasenna_GUI v2.9 Ultraschall-Mod ]]-- dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua") ultraschall.Lokasenna_LoadGuiLib_v2() --[[ local lib_path = reaper.GetExtState("Lokasenna_GUI", "lib_path_v2") if not lib_path or lib_path == "" then reaper.MB("Couldn't load the Lokasenna_GUI library. Please install 'Lokasenna's GUI library v2 for Lua', available on ReaPack, then run the 'Set Lokasenna_GUI v2 library path.lua' script in your Action List.", "Whoops!", 0) return end loadfile(lib_path .. "Core.lua")() --]] GUI.req("Classes/Class - Button.lua")() GUI.req("Classes/Class - Frame.lua")() GUI.req("Classes/Class - Knob.lua")() GUI.req("Classes/Class - Label.lua")() GUI.req("Classes/Class - Listbox.lua")() GUI.req("Classes/Class - Menubar.lua")() GUI.req("Classes/Class - Menubox.lua")() GUI.req("Classes/Class - Options.lua")() GUI.req("Classes/Class - Slider.lua")() GUI.req("Classes/Class - Tabs.lua")() GUI.req("Classes/Class - Textbox.lua")() GUI.req("Classes/Class - TextEditor.lua")() GUI.req("Classes/Class - Window.lua")() ------------------------------------ -------- Random globals ------------ ------------------------------------ Sidebar_w = 272 function Sidebar_ref_x() return (GUI.cur_w or GUI.w or gfx.w) - Sidebar_w end ------------------------------------ -------- GB Modules ---------------- ------------------------------------ package.path = package.path .. ";" .. GUI.script_path .. "modules/?.lua" Element = GUI.req(GUI.script_path .. "modules/func_Elements.lua")() Export = GUI.req(GUI.script_path .. "modules/func_Export.lua")() Sidebar = GUI.req(GUI.script_path .. "modules/wnd_Sidebar.lua")() Properties = GUI.req(GUI.script_path .. "modules/tab_Properties.lua")() Project = GUI.req(GUI.script_path .. "modules/wnd_Project.lua")() Prefs = GUI.req(GUI.script_path .. "modules/wnd_Prefs.lua")() Menu = GUI.req(GUI.script_path .. "modules/func_Menu.lua")() Help = GUI.req(GUI.script_path .. "modules/wnd_Help.lua")() --local Element = require("func_Elements") --local Export = require("func_Export") --local Sidebar = require("wnd_Sidebar") --local Properties = require("tab_Properties") -- If any of the requested libraries weren't found, abort the script. if missing_lib then return 0 end ------------------------------------ -------- GUI Stuff ----------------- ------------------------------------ GUI.name = "GUI Builder" GUI.x, GUI.y, GUI.w, GUI.h = 0, 0, 640 + Sidebar_w, 480 + Menu.h GUI.anchor, GUI.corner = "mouse", "C" ------------------------------------ -------- Basic frames -------------- ------------------------------------ GUI.New("GB_frm_bg", "Frame", 112, 0, 0, 800, 768, false, false, "wnd_bg") -- For highlighting the current element GUI.New("GB_frm_sel_elm", "Frame", 1, 1, 1, 1, 1) ------------------------------------ -------- Basic frames -------------- -------- Properties + methods ------ ------------------------------------ function GUI.elms.GB_frm_bg:init() self.buff = GUI.GetBuffer() self.w, self.h = Sidebar_ref_x(), (GUI.cur_h or GUI.h or gfx.h) local w, h = self.w, self.h gfx.dest = self.buff gfx.setimgdim(self.buff, -1, -1) gfx.setimgdim(self.buff, w, h) Prefs.draw_grid(self) end -- Doesn't need to be visible. function GUI.elms.GB_frm_bg:draw() if Prefs.preferences.grid_show then --gfx.blit(source, scale, rotation[, srcx, srcy, srcw, srch, destx, desty, destw, desth, rotxoffs, rotyoffs] ) gfx.blit(self.buff, 1, 0, 0, 0, self.w, self.h, 0, Menu.h) end GUI.color("white") gfx.rect( -1, 0, Project.proj_settings.w + 2, Project.proj_settings.h + Menu.h + 1, false) end --mespotine function GUI.elms.GB_frm_bg:onmouseup() if GUI.mouse.cap & 8 == 8 then Element.deselect_elm() end end function GUI.elms.GB_frm_bg:onmouser_up() Element.new_elm_menu() end GUI.elms.GB_frm_sel_elm.bg = nil -- We don't want the frame to pick up any user input function GUI.elms.GB_frm_sel_elm:onupdate() return true end function GUI.elms.GB_frm_sel_elm:draw() GUI.color("magenta") if self.elm then gfx.rect( GUI.elms[self.elm].x - 4, GUI.elms[self.elm].y - 4, GUI.elms[self.elm].w + 8, GUI.elms[self.elm].h + 8, false) end end GUI.Init() ------------------------------------ -------- Things we can't do -------- -------- until Init has run -------- ------------------------------------ GUI.onresize = Sidebar.adjust_sidebar Sidebar.adjust_sidebar() Project.add_method_overrides( GUI.elms.GB_wnd_proj:getchildelms() ) Prefs.add_method_overrides( GUI.elms.GB_wnd_prefs:getchildelms() ) GUI.Main()
-- define a global pi, every digit I can remember pi=3.1415926535897923846262643383279502 -- lcm of any number of integers function lcm(...) local function lcm_(x,y) local lcm_num=0 local greater=0 local multiplier=1 while math.floor(x)~=x or math.floor(y)~=y do x=x*10 y=y*10 multiplier=multiplier*10 end -- choose the greater number if x>y then greater=x else greater=y end while true do if ((greater%x==0) and (greater%y==0)) then lcm_num=greater break end greater=greater+1 end return lcm_num/multiplier end local res=nil -- https://www.lua.org/pil/5.2.html local arg={...} for i,v in ipairs(arg) do if i==1 then res=lcm_(arg[1],arg[2]) elseif i==2 then else res=lcm_(res,v) end end return res end function current_time() return clock.get_beat_sec()*clock.get_beats() end
local gs = require "gitsigns" return gs.setup { yadm = { enable = true } }
local screenWidth, screenHeight = guiGetScreenSize() local screenWidth, screenHeight = guiGetScreenSize() rectangleAlpha = 170 rectangleAlpha2 = 170 textAlpha = 255 textAlpha2 = 255 local screenW, screenH = guiGetScreenSize() local kill = false local resX, resY = guiGetScreenSize() function drawTitle() for k, v in pairs( getElementsByType( "player", root, true ) ) do if (isElementOnScreen( v ) ) then local x, y, z = getElementPosition( v ) local a, b, c = getElementPosition( localPlayer ) local dist = getDistanceBetweenPoints3D( x, y , z, a, b, c ) x, y, z = getPedBonePosition( v, 5 ) local tX, tY = getScreenFromWorldPosition( x, y, z+0.25, 0, false ) if ( tX and tY and isLineOfSightClear( a, b, c, x, y, z, true, false, false, true, true, false, false, v ) ) then if ( dist < 30 ) then theText = getElementData(v,"TC") local width = dxGetTextWidth( tostring(theText), 0.8, "default-bold" ) if ( theText ~= false ) then dxDrawText( tostring(theText), tX-( width/2), tY-1, resX, resY, tocolor( 0,0,0, 255 ), 1, "default-bold") dxDrawText( tostring(theText), tX-( width/2), tY+1.1, resX, resY, tocolor( 0,0,0, 255 ), 1, "default-bold") dxDrawText( tostring(theText), tX-( width/2), tY, resX, resY, tocolor( 255,0,0, 255 ), 1, "default-bold") end end end end end end addEventHandler("onClientRender", root, drawTitle) local sW, sH = guiGetScreenSize() function drawCunt() if kill == false then if getElementData(localPlayer,"isPlayerInDM") == true then local countdown = getElementData ( root, "signedup" ) if countdown then if tonumber(countdown) and tonumber(countdown) > 0 and tonumber(countdown) < 8 then dxDrawBorderedText("Top Criminal: Please wait", 1.75, 0, 30, sW, 340, tocolor(255,255,255, 255), 1, "pricedown", "center", "center", false, false, true, false, false) dxDrawBorderedText("Top Criminal: "..countdown.."/8 Players", 1.75, 0, 120, sW, 340, tocolor(255,255,255, 255), 1, "pricedown", "center", "center", false, false, true, false, false) end end end end end addEventHandler("onClientRender",root,drawCunt) addEvent("killTC",true) addEventHandler("killTC",root,function() kill = true end) addEvent("SetTC",true) addEventHandler("SetTC",root,function(msg) rectangleAlpha = 170 rectangleAlpha2 = 170 textAlpha = 255 textAlpha2 = 255 message = msg fadeTimer = setTimer(fadeTheText, 500, 0) removeEventHandler("onClientRender", root, drawTCText) addEventHandler("onClientRender", root, drawTCText) end) function fadeTheText() textAlpha = textAlpha - 8.5 rectangleAlpha = rectangleAlpha - 8.5 if (rectangleAlpha <= 0) then if isTimer(fadeTimer) then killTimer(fadeTimer) end removeEventHandler("onClientRender", root, drawTCText) end end function drawTCText() dxDrawBorderedText(message, 1.75, (screenW - 504) / 2, (screenH - 350) / 1.05, ((screenW - 504) / 2) + 504, ( (screenH - 44) / 1.05) + 44, tocolor(0,255,0, 255), 1, "pricedown", "center", "center", false, false, true, false, false) end function dxDrawBorderedText ( text, wh, x, y, w, h, clr, scale, font, alignX, alignY, clip, wordBreak, postGUI ) if not wh then wh = 1.5 end dxDrawText ( text, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, a ), scale, font, alignX, alignY, clip, wordBreak, false, true) -- black dxDrawText ( text, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, a ), scale, font, alignX, alignY, clip, wordBreak, false, true) dxDrawText ( text, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, a ), scale, font, alignX, alignY, clip, wordBreak, false, true) dxDrawText ( text, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, a ), scale, font, alignX, alignY, clip, wordBreak, false, true) dxDrawText ( text, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, a ), scale, font, alignX, alignY, clip, wordBreak, false, true) dxDrawText ( text, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, a ), scale, font, alignX, alignY, clip, wordBreak, false, true) dxDrawText ( text, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, a ), scale, font, alignX, alignY, clip, wordBreak, false, true) dxDrawText ( text, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, a ), scale, font, alignX, alignY, clip, wordBreak, false, true) dxDrawText ( text, x, y, w, h, clr, scale, font, alignX, alignY, clip, wordBreak, postGUI, true) end function drawCount() if not imagecount then windowWidth, windowHeight = 250,190 windowX, windowY = (screenWidth / 2) - (windowWidth / 2), (screenHeight / 2) - (windowHeight / 2) imagecount = guiCreateStaticImage (windowX, windowY, windowWidth, windowHeight,"images/3.png",false) else guiSetVisible(imagecount,true) guiStaticImageLoadImage ( imagecount, "images/3.png" ) end setTimer ( function() guiStaticImageLoadImage ( imagecount, "images/2.png" ) setTimer ( function() guiStaticImageLoadImage ( imagecount, "images/1.png" ) setTimer ( function() guiStaticImageLoadImage ( imagecount, "images/go.png" ) setTimer(function() guiSetVisible(imagecount,false) if isElement(imagecount) then destroyElement(imagecount) end triggerServerEvent("setPlayerCanDM",localPlayer) end, 1000, 1 ) end, 1000, 1 ) end, 1000, 1 ) end, 1000, 1 ) setWeaponSlotDisabled(7,true) setWeaponSlotDisabled(8,true) end addEvent("drawCount",true) addEventHandler("drawCount",root,drawCount) cobras = {--[[ createObject(3997,2948.6347656,-1472.5263672,746.4971313,0.0000000,0.0000000,0.0000000), --object(cityhallblok_lan), (1), createObject(11088,2905.9682620,-1453.5399170,753.2540280,0.0000000,0.0000000,0.0000000), --object(cf_ext_dem_sfs), (1), createObject(11428,2974.1440430,-1460.9063720,752.0001830,0.0000000,0.0000000,0.0000000), --object(des_indruin02), (1), createObject(11440,2964.9782710,-1483.4725340,746.0189820,0.0000000,0.0000000,0.0000000), --object(des_pueblo1), (1), createObject(11427,2995.9953610,-1500.7438960,753.6870120,0.0000000,0.0000000,89.9999813), --object(des_adobech), (1), createObject(11426,2973.9624020,-1492.2426760,746.3906250,0.0000000,0.0000000,-89.9999813), --object(des_adobe03), (1), createObject(11440,2983.6232910,-1491.2845460,745.9939580,0.0000000,0.0000000,0.0000000), --object(des_pueblo1), (2), createObject(11441,3010.4533690,-1424.5637210,746.6720580,0.0000000,0.0000000,0.0000000), --object(des_pueblo5), (1), createObject(11442,3009.5600590,-1432.2164310,746.6708980,0.0000000,0.0000000,0.0000000), --object(des_pueblo3), (1), createObject(11443,3000.2722170,-1427.7399900,746.6688840,0.0000000,0.0000000,-180.0000198), --object(des_pueblo4), (1), createObject(11444,2959.1140140,-1462.3211670,746.4901120,0.0000000,0.0000000,0.0000000), --object(des_pueblo2), (1), createObject(11442,2956.5717770,-1450.5699460,746.6708980,0.0000000,0.0000000,-89.9999813), --object(des_pueblo3), (2), createObject(11441,2962.5671390,-1441.7663570,746.6720580,0.0000000,0.0000000,0.0000000), --object(des_pueblo5), (2), createObject(11442,2953.0805660,-1441.1468510,746.6708980,0.0000000,0.0000000,-89.9999813), --object(des_pueblo3), (3), createObject(11443,2953.2880860,-1431.4017330,746.5938110,0.0000000,0.0000000,-180.0000198), --object(des_pueblo4), (2), createObject(11445,2944.2260740,-1425.8930660,746.6688840,0.0000000,0.0000000,89.9999813), --object(des_pueblo06), (1), createObject(11446,2962.1953130,-1436.8525390,746.6720580,0.0000000,0.0000000,0.0000000), --object(des_pueblo07), (1), createObject(11447,2954.9594730,-1423.6601560,746.4912720,0.0000000,0.0000000,0.0000000), --object(des_pueblo08), (1), createObject(11447,2987.6401370,-1469.4382320,746.4662480,0.0000000,0.0000000,-89.9999813), --object(des_pueblo08), (2), createObject(11457,2971.2788090,-1422.6876220,746.0983280,0.0000000,0.0000000,0.0000000), --object(des_pueblo09), (1), createObject(11458,2979.7634280,-1453.9821780,746.6690670,0.0000000,0.0000000,0.0000000), --object(des_pueblo10), (1), createObject(11459,2955.1062010,-1423.7991940,749.3488160,0.0000000,0.0000000,-89.9999813), --object(des_pueblo11), (1), createObject(11458,3005.7028810,-1491.2677000,746.6690670,0.0000000,0.0000000,0.0000000), --object(des_pueblo10), (2), createObject(11459,3014.5117190,-1510.5541990,746.4953000,0.0000000,0.0000000,-89.9999813), --object(des_pueblo11), (2), createObject(11458,3009.7868650,-1517.1901860,746.6690670,0.0000000,0.0000000,-89.9999813), --object(des_pueblo10), (3), createObject(11457,2986.6970210,-1430.9230960,746.0983280,0.0000000,0.0000000,0.0000000), --object(des_pueblo09), (2), createObject(11446,2995.0825200,-1489.1337890,746.6720580,0.0000000,0.0000000,0.0000000), --object(des_pueblo07), (2), createObject(11444,2998.7150880,-1483.3085940,746.4901120,0.0000000,0.0000000,0.0000000), --object(des_pueblo2), (2), createObject(11443,3013.2951660,-1485.3375240,746.6688840,0.0000000,0.0000000,89.9999813), --object(des_pueblo4), (3), createObject(11441,3015.7224120,-1495.9600830,746.6720580,0.0000000,0.0000000,-89.9999813), --object(des_pueblo5), (3), createObject(11442,3020.4021000,-1476.4290770,746.5457760,0.0000000,0.0000000,89.9999813), --object(des_pueblo3), (4), createObject(11441,3012.4587400,-1475.3979490,746.6720580,0.0000000,0.0000000,0.0000000), --object(des_pueblo5), (4), createObject(11440,3001.9113770,-1453.9025880,746.0940550,0.0000000,0.0000000,0.0000000), --object(des_pueblo1), (3), createObject(11440,3015.6630860,-1465.2810060,746.0940550,0.0000000,0.0000000,89.9999813), --object(des_pueblo1), (4), createObject(11428,2931.9946290,-1429.0766600,751.8927000,0.0000000,0.0000000,-191.2499889), --object(des_indruin02), (2), createObject(11427,2941.2028810,-1486.7493900,753.6369630,0.0000000,0.0000000,89.9999813), --object(des_adobech), (2), createObject(11426,2958.8444820,-1489.7519530,746.4907230,0.0000000,0.0000000,0.0000000), --object(des_adobe03), (2), createObject(11441,2957.4719240,-1481.0489500,746.6720580,0.0000000,0.0000000,0.0000000), --object(des_pueblo5), (5), createObject(11442,2972.2500000,-1444.1497800,746.6708980,0.0000000,0.0000000,0.0000000), --object(des_pueblo3), (5), createObject(11446,2993.9165040,-1474.4849850,746.6470340,0.0000000,0.0000000,0.0000000), --object(des_pueblo07), (3), createObject(11445,2988.7314450,-1452.9910890,746.6688840,0.0000000,0.0000000,-89.9999813), --object(des_pueblo06), (2), createObject(11444,3021.4167480,-1454.4848630,746.4901120,0.0000000,0.0000000,0.0000000), --object(des_pueblo2), (3), createObject(11446,2980.8786620,-1460.6164550,746.6720580,0.0000000,0.0000000,0.0000000), --object(des_pueblo07), (4), createObject(11445,2996.0688480,-1463.0004880,746.6688840,0.0000000,0.0000000,0.0000000), --object(des_pueblo06), (3), createObject(11445,3017.9243160,-1520.5803220,746.6688840,0.0000000,0.0000000,-89.9999813), --object(des_pueblo06), (4), createObject(11445,3002.3474120,-1522.7402340,746.6688840,0.0000000,0.0000000,-270.0000011), --object(des_pueblo06), (5), createObject(11446,2998.3103030,-1515.0635990,746.6720580,0.0000000,0.0000000,0.0000000), --object(des_pueblo07), (5), createObject(11446,3025.0268550,-1509.0931400,746.6720580,0.0000000,0.0000000,-180.0000198), --object(des_pueblo07), (6), createObject(11445,2940.2543950,-1448.2468260,746.6438600,0.0000000,0.0000000,-359.9999824), --object(des_pueblo06), (6), createObject(976,2868.7617190,-1412.7198490,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (1), createObject(976,2877.6330570,-1412.6873780,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (2), createObject(976,2886.3542480,-1412.7237550,746.7051390,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (3), createObject(976,2895.1862790,-1412.5831300,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (4), createObject(976,2903.9646000,-1412.5861820,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (5), createObject(976,2912.7985840,-1412.6024170,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (6), createObject(976,2921.5566410,-1412.6588130,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (7), createObject(976,2930.3652340,-1412.6448970,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (8), createObject(976,2939.1494140,-1412.6489260,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (9), createObject(976,2947.9672850,-1412.6569820,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (10), createObject(976,2956.8554690,-1412.6170650,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (11), createObject(976,2965.6887210,-1412.6311040,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (12), createObject(976,2974.5063480,-1412.6188960,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (13), createObject(976,2983.4160160,-1412.6141360,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (14), createObject(976,2992.2602540,-1412.6379390,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (15), createObject(976,3001.0947270,-1412.6190190,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (16), createObject(976,3009.9333500,-1412.6068120,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (17), createObject(976,3018.7055660,-1412.6213380,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (18), createObject(976,3020.1113280,-1412.7335210,746.6590580,0.0000000,0.0000000,0.0000000), --object(phils_compnd_gate), (19), createObject(976,3028.7873540,-1412.8354490,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (20), createObject(976,3028.7783200,-1421.5889890,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (21), createObject(976,3028.7692870,-1430.3894040,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (22), createObject(976,3028.8195800,-1439.0452880,746.6846310,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (23), createObject(976,3028.8171390,-1447.8115230,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (24), createObject(976,3028.8674320,-1456.5183110,746.6925660,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (25), createObject(976,3028.8156740,-1465.2618410,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (26), createObject(976,3028.8012700,-1474.1038820,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (27), createObject(976,3028.7739260,-1482.8757320,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (28), createObject(976,3028.7846680,-1491.6771240,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (29), createObject(976,3028.7866210,-1500.4981690,746.6590580,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (30), createObject(976,3028.7985840,-1509.2308350,746.6644900,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (31), createObject(976,3028.8488770,-1517.8034670,746.6693730,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (32), createObject(976,3028.9489750,-1523.8438720,746.5988160,0.0000000,0.0000000,-89.9999813), --object(phils_compnd_gate), (33), createObject(976,3028.6706540,-1532.5234380,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (34), createObject(976,3019.8693850,-1532.5201420,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (35), createObject(976,3011.0734860,-1532.5123290,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (36), createObject(976,3002.2626950,-1532.5286870,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (37), createObject(976,2993.3916020,-1532.5477290,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (38), createObject(976,2984.4375000,-1532.5596920,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (39), createObject(976,2975.6496580,-1532.5644530,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (40), createObject(976,2966.9169920,-1532.5654300,746.6600950,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (41), createObject(976,2958.0434570,-1532.5589600,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (42), createObject(976,2949.2104490,-1532.5144040,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (43), createObject(976,2940.3820800,-1532.4787600,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (44), createObject(976,2931.7421880,-1532.4300540,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (45), createObject(976,2922.9731450,-1532.4439700,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (46), createObject(976,2914.1596680,-1532.3806150,746.6840820,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (47), createObject(976,2905.2358400,-1532.4591060,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (48), createObject(976,2896.3977050,-1532.4720460,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (49), createObject(976,2887.6281740,-1532.4398190,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (50), createObject(976,2878.7443850,-1532.4000240,746.6590580,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (51), createObject(976,2877.1555180,-1532.3636470,746.6838990,0.0000000,0.0000000,-180.0000198), --object(phils_compnd_gate), (52), createObject(976,2868.5104980,-1532.3039550,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (53), createObject(976,2868.4860840,-1523.4281010,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (54), createObject(976,2868.5124510,-1514.4959720,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (55), createObject(976,2868.5312500,-1505.5748290,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (56), createObject(976,2868.5185550,-1496.7009280,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (57), createObject(976,2868.5549320,-1487.9790040,746.7102050,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (58), createObject(976,2868.5913090,-1479.3684080,746.7178340,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (59), createObject(976,2868.6276860,-1470.6386720,746.7377930,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (60), createObject(976,2868.4816890,-1461.8936770,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (61), createObject(976,2868.4829100,-1453.0415040,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (62), createObject(976,2868.5014650,-1444.1856690,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (63), createObject(976,2868.5036620,-1435.3457030,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (64), createObject(976,2868.4912110,-1426.5281980,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (65), createObject(976,2868.6381840,-1421.3052980,746.6590580,0.0000000,0.0000000,-270.0000011), --object(phils_compnd_gate), (66), createObject(967,2894.6298830,-1516.2456050,746.4971310,0.0000000,0.0000000,-0.0000573), --object(bar_gatebox01), (1), createObject(3866,2928.8691406,-1500.9833984,754.3352051,0.0000000,0.0000000,179.9945068), --object(demolish1_sfxrf), (1), createObject(11492,2883.6669920,-1523.2490230,746.4927980,0.0000000,0.0000000,-180.0000198), --object(des_rshed1_), (1), createObject(12929,3022.4519040,-1428.5576170,746.9951170,0.0000000,0.0000000,-89.9999813), --object(sw_shed06), (1), createObject(12942,2905.8598630,-1427.4481200,746.7092900,0.0000000,0.0000000,0.0000000), --object(sw_shedinterior01), (1), createObject(5153,2934.7988280,-1491.3813480,753.5238040,0.0000000,0.0000000,0.0000000), --object(stuntramp7_las2), (1), createObject(5153,2930.7897950,-1491.3865970,751.7723390,0.0000000,0.0000000,0.0000000), --object(stuntramp7_las2), (2), createObject(5153,2926.7646480,-1491.3750000,750.0083010,0.0000000,0.0000000,0.0000000), --object(stuntramp7_las2), (3), createObject(5153,2922.7480470,-1491.3524170,748.2339480,0.0000000,0.0000000,0.0000000), --object(stuntramp7_las2), (4), createObject(5153,2919.4450680,-1491.3580320,746.7872310,0.0000000,0.0000000,0.0000000), --object(stuntramp7_las2), (5), createObject(5153,2899.2441410,-1427.1718750,752.4390260,0.0000000,0.0000000,-180.0000198), --object(stuntramp7_las2), (6), createObject(12929,2905.8093260,-1427.5389400,746.7150880,0.0000000,0.0000000,-180.0000198), --object(sw_shed06), (2), createObject(12928,3022.4504390,-1428.5687260,746.9951170,0.0000000,0.0000000,-89.9999813), --object(sw_shedinterior04), (1), createObject(1696,2936.8623050,-1465.3752440,747.1293330,0.0000000,0.0000000,89.9999813), --object(roofstuff15), (1), createObject(14395,2874.2875980,-1437.0125730,747.0100100,0.0000000,0.0000000,0.0000000), --object(dr_gsnew11), (1), createObject(14407,2881.4477540,-1435.6485600,750.4400630,0.0000000,0.0000000,89.9999813), --object(carter-stairs01), (1), createObject(14467,2889.2058110,-1463.2957760,750.6440430,0.0000000,0.0000000,67.4999860), --object(carter_statue), (1), createObject(9191,2891.1801760,-1486.4281010,751.2327270,0.0000000,0.0000000,0.0000000), --object(vgeastbillbrd03), (1), createObject(9191,2891.1777340,-1486.4461670,751.2307740,0.0000000,0.0000000,-180.0000198), --object(vgeastbillbrd03), (2), createObject(980,2919.1760250,-1412.6387940,752.6286620,0.0000000,0.0000000,0.0000000), --object(airportgate), (1), createObject(980,2907.5991210,-1412.6225590,752.6283570,0.0000000,0.0000000,0.0000000), --object(airportgate), (2), createObject(980,2896.1416016,-1412.6015625,752.6233521,0.0000000,0.0000000,0.0000000), --object(airportgate), (3), createObject(980,2884.7578130,-1412.6987300,752.5914920,0.0000000,0.0000000,0.0000000), --object(airportgate), (4), createObject(980,2874.3295900,-1412.6873780,752.6233520,0.0000000,0.0000000,0.0000000), --object(airportgate), (5), createObject(980,2930.6833500,-1412.6389160,752.6233520,0.0000000,0.0000000,0.0000000), --object(airportgate), (6), createObject(980,2942.1879880,-1412.6492920,752.6233520,0.0000000,0.0000000,0.0000000), --object(airportgate), (7), createObject(980,2953.8103030,-1412.6676030,752.6233520,0.0000000,0.0000000,0.0000000), --object(airportgate), (8), createObject(980,2965.3774410,-1412.6496580,752.6233520,0.0000000,0.0000000,0.0000000), --object(airportgate), (9), createObject(980,2976.9216310,-1412.5986330,752.6233520,0.0000000,0.0000000,0.0000000), --object(airportgate), (10), createObject(980,2988.4240720,-1412.6279300,752.6233520,0.0000000,0.0000000,0.0000000), --object(airportgate), (11), createObject(980,2999.9184570,-1412.6743160,752.6116940,0.0000000,0.0000000,0.0000000), --object(airportgate), (12), createObject(980,3011.4497070,-1412.6431880,752.6052250,0.0000000,0.0000000,0.0000000), --object(airportgate), (13), createObject(980,3022.9812010,-1412.6882320,752.6233520,0.0000000,0.0000000,0.0000000), --object(airportgate), (14), createObject(980,2868.5275880,-1418.2685550,752.5854490,0.0000000,0.0000000,-89.9999813), --object(airportgate), (15), createObject(980,2868.4614260,-1429.6694340,752.5482790,0.0000000,0.0000000,-89.9999813), --object(airportgate), (16), createObject(980,2868.4567870,-1441.1517330,752.5482790,0.0000000,0.0000000,-89.9999813), --object(airportgate), (17), createObject(980,2868.4445800,-1452.5533450,752.6347050,0.0000000,0.0000000,-89.9999813), --object(airportgate), (18), createObject(980,2868.5847170,-1464.1542970,752.7020870,0.0000000,0.0000000,-89.9999813), --object(airportgate), (19), createObject(980,2868.5314940,-1475.6481930,752.6821290,0.0000000,0.0000000,-89.9999813), --object(airportgate), (20), createObject(980,2868.5637210,-1487.2021480,752.6745000,0.0000000,0.0000000,-89.9999813), --object(airportgate), (21), createObject(980,2868.5466310,-1498.6064450,752.6233520,0.0000000,0.0000000,-89.9999813), --object(airportgate), (22), createObject(980,2868.4697270,-1510.0212400,752.6233520,0.0000000,0.0000000,-89.9999813), --object(airportgate), (23), createObject(980,2868.4477540,-1521.5170900,752.6071170,0.0000000,0.0000000,-89.9999813), --object(airportgate), (24), createObject(980,2868.4433590,-1526.6416020,752.6741330,0.0000000,0.0000000,-89.9999813), --object(airportgate), (25), createObject(980,2874.1721190,-1532.3878170,752.6233520,0.0000000,0.0000000,-180.0000198), --object(airportgate), (26), createObject(980,2885.5986330,-1532.4648440,752.6233520,0.0000000,0.0000000,-180.0000198), --object(airportgate), (27), createObject(980,2897.2775880,-1532.4227290,752.5980220,0.0000000,0.0000000,-180.0000198), --object(airportgate), (28), createObject(980,2908.7653810,-1532.4443360,752.6151730,0.0000000,0.0000000,-180.0000198), --object(airportgate), (29), createObject(980,2920.3146970,-1532.4821780,752.6233520,0.0000000,0.0000000,-180.0000198), --object(airportgate), (30), createObject(980,2931.8002930,-1532.4382320,752.6233520,0.0000000,0.0000000,-180.0000198), --object(airportgate), (31), createObject(980,2943.2531740,-1532.4780270,752.6027220,0.0000000,0.0000000,-180.0000198), --object(airportgate), (32), createObject(980,2954.7172850,-1532.5225830,752.5925900,0.0000000,0.0000000,-180.0000198), --object(airportgate), (33), createObject(980,2966.2319340,-1532.5290530,752.6003420,0.0000000,0.0000000,-180.0000198), --object(airportgate), (34), createObject(980,2977.6955570,-1532.5233150,752.5969240,0.0000000,0.0000000,-180.0000198), --object(airportgate), (35), createObject(980,2989.1564940,-1532.5113530,752.6215820,0.0000000,0.0000000,-180.0000198), --object(airportgate), (36), createObject(980,3000.6250000,-1532.5173340,752.6207280,0.0000000,0.0000000,-180.0000198), --object(airportgate), (37), createObject(980,3012.1296390,-1532.5092770,752.6233520,0.0000000,0.0000000,-180.0000198), --object(airportgate), (38), createObject(980,3023.1599120,-1532.4620360,752.6477050,0.0000000,0.0000000,-180.0000198), --object(airportgate), (39), createObject(980,3028.9731450,-1526.7282710,752.5631100,0.0000000,0.0000000,-270.0000011), --object(airportgate), (40), createObject(980,3028.7658690,-1515.1276860,752.6287840,0.0000000,0.0000000,-270.0000011), --object(airportgate), (41), createObject(980,3028.7502440,-1503.6523440,752.6337890,0.0000000,0.0000000,-270.0000011), --object(airportgate), (42), createObject(980,3028.7482910,-1492.0921630,752.6226200,0.0000000,0.0000000,-270.0000011), --object(airportgate), (43), createObject(980,3028.8022460,-1480.6314700,752.6233520,0.0000000,0.0000000,-270.0000011), --object(airportgate), (44), createObject(980,3028.7792970,-1469.1632080,752.6111450,0.0000000,0.0000000,-270.0000011), --object(airportgate), (45), createObject(980,3028.8310550,-1457.7237550,752.6054080,0.0000000,0.0000000,-270.0000011), --object(airportgate), (46), createObject(980,3028.8293460,-1446.2139890,752.6489260,0.0000000,0.0000000,-270.0000011), --object(airportgate), (47), createObject(980,3028.8203130,-1434.6854250,752.6483760,0.0000000,0.0000000,-270.0000011), --object(airportgate), (48), createObject(980,3028.8220210,-1418.4971920,752.6233520,0.0000000,0.0000000,-270.0000011), --object(airportgate), (49), createObject(980,3028.8266600,-1425.7503660,752.6233520,0.0000000,0.0000000,-270.0000011), --object(airportgate), (50), createObject(11444,3013.1433110,-1449.9155270,746.4901120,0.0000000,0.0000000,0.0000000), --object(des_pueblo2), (4), createObject(11444,3011.1960450,-1440.3251950,746.4901120,0.0000000,0.0000000,-89.9999813), --object(des_pueblo2), (5), createObject(3644,2978.7771000,-1517.3251950,749.1599730,0.0000000,0.0000000,179.9999626), --object(idlebuild01_lax) (1) createObject(8661,2833.7866211,-1616.9844971,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (1), createObject(8661,2833.7871094,-1597.0343018,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (2), createObject(8661,2833.7419434,-1577.0736084,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (3), createObject(8661,2873.6706543,-1577.0754395,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (4), createObject(8661,2873.7158203,-1597.0343018,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (5), createObject(8661,2873.7580566,-1616.9880371,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (6), createObject(8661,2833.6284180,-1557.0947266,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (7), createObject(8661,2873.5869141,-1557.1009521,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (8), createObject(13106,2819.2302246,-1625.9114990,263.5090942,310.3751221,337.4494629,333.4449463), --object(ce_groundpalo08), (1), createObject(8661,2793.8376465,-1616.9808350,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (9), createObject(8661,2793.7927246,-1597.0708008,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (10), createObject(8661,2793.7646484,-1577.0943604,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (11), createObject(8661,2793.7026367,-1557.1134033,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (12), createObject(8661,2873.6308594,-1537.2745361,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (13), createObject(8661,2833.6337891,-1537.1325684,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (14), createObject(8661,2793.6354980,-1537.1311035,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (15), createObject(8661,2753.8789062,-1616.9982910,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (16), createObject(8661,2753.7937012,-1597.0325928,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (17), createObject(8661,2753.7714844,-1577.0534668,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (18), createObject(8661,2753.7443848,-1557.1253662,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (19), createObject(8661,2753.7263184,-1537.1744385,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (20), createObject(8661,2873.5961914,-1517.2976074,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (21), createObject(8661,2833.6027832,-1517.3298340,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (22), createObject(8661,2793.6079102,-1517.2873535,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (23), createObject(8661,2753.6682129,-1517.2165527,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (24), createObject(8661,2753.5683594,-1497.2918701,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (25), createObject(8661,2793.5405273,-1497.3522949,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (26), createObject(8661,2833.5400391,-1497.3946533,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (27), createObject(8661,2873.5161133,-1497.4001465,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (28), createObject(13106,2894.2929688,-1518.2390137,259.6350403,310.3751221,337.4494629,60.0493164), --object(ce_groundpalo08), (2), createObject(8661,2873.4104004,-1477.4357910,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (29), createObject(8661,2833.4711914,-1477.4533691,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (30), createObject(8661,2793.5061035,-1477.3848877,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (31), createObject(8661,2753.6081543,-1477.3813477,289.1856689,0.0000000,0.0000000,0.0000000), --object(gnhtelgrnd_lvs), (32), createObject(13106,2869.5759277,-1468.3631592,259.3850403,310.3751221,337.4494629,149.3593750), --object(ce_groundpalo08), (3), createObject(13106,2733.0532227,-1574.6188965,262.0331726,310.3751221,337.4494629,243.5455322), --object(ce_groundpalo08), (4), createObject(7016,2800.5039062,-1623.6624756,290.2310181,0.0000000,0.0000000,0.0000000), --object(circusconstruct06), (1), createObject(7017,2856.3647461,-1619.5476074,290.1854248,0.0000000,0.0000000,270.6749268), --object(circusconstruct07), (1), createObject(8879,2798.6369629,-1586.0147705,295.2783813,0.0000000,0.0000000,213.1099854), --object(vgsecnstrct08), (1), createObject(8878,2802.3110352,-1591.6424561,296.0912781,0.0000000,0.0000000,77.4150085), --object(vgsecnstrct11), (1), createObject(2960,2797.2124023,-1589.7650146,289.5851746,0.0000000,0.0000000,0.0000000), --object(kmb_beam), (1), createObject(3939,2799.4824219,-1616.9276123,290.9503479,0.0000000,0.0000000,0.0000000), --object(hanger01), (1), createObject(3030,2745.9294434,-1573.6214600,293.3606873,0.0000000,0.0000000,0.0000000), --object(wongs_erection), (1), createObject(16325,2788.8535156,-1587.4304199,289.1856689,0.0000000,0.0000000,0.0000000), --object(des_quarryhut02), (1), createObject(10357,2784.0927734,-1492.2353516,378.2415161,0.0000000,0.0000000,0.0000000), --object(transmitter_sfs), (1), createObject(1684,2797.1330566,-1595.5167236,290.7755432,0.0000000,0.0000000,89.9999695), --object(portakabin), (1), createObject(5711,2807.2426758,-1490.2723389,292.6628418,0.0000000,0.0000000,0.0000000), --object(cem02_law), (1), createObject(6962,2785.3769531,-1487.8947754,295.9418335,0.0000000,0.0000000,0.0000000), --object(vgsnwedchap1), (1), createObject(10378,2804.9443359,-1542.8867188,289.1412354,0.0000000,0.0000000,0.0000000), --object(ctiyhallsquare_sfs), (1), createObject(12925,2781.8359375,-1590.7695312,289.1856689,0.0000000,0.0000000,89.5599670), --object(sw_shed01), (1), createObject(5838,2804.9257812,-1540.7841797,306.1702576,0.0000000,0.0000000,0.0000000), --object(ci_watertank01), (1), createObject(5628,2872.3710938,-1489.3626709,293.3041992,0.0000000,0.0000000,0.0000000), --object(laenwblkb1), (1), createObject(5737,2870.9895020,-1520.0882568,295.2253723,0.0000000,0.0000000,180.0000000), --object(archshop07_law02), (1), createObject(5781,2859.9504395,-1553.1387939,294.8302002,0.0000000,0.0000000,0.0000000), --object(melblok11_lawn), (1), createObject(6946,2759.3027344,-1504.1171875,289.1856689,0.0000000,0.0000000,268.6871338), --object(vgnwalgren1), (1), createObject(12843,2748.0539551,-1577.0843506,289.1856689,0.0000000,0.0000000,91.3099670), --object(cos_liquorshop), (1), createObject(12844,2748.1140137,-1580.0598145,291.1601868,0.0000000,0.0000000,91.3099670), --object(cos_liqinside), (1), createObject(12845,2747.8117676,-1579.9606934,291.2984619,0.0000000,0.0000000,90.0400391), --object(cos_liqinsidebits), (1), createObject(12951,2749.6582031,-1594.9482422,289.1856689,0.0000000,0.0000000,0.0000000), --object(sw_shopflat01), (1), createObject(7017,2770.5593262,-1529.2037354,290.1854248,0.0000000,0.0000000,0.4692383), --object(circusconstruct07), (2), createObject(2960,2797.2011719,-1589.5196533,290.0350647,0.0000000,0.0000000,0.0000000), --object(kmb_beam), (2), createObject(2960,2797.2021484,-1589.2606201,289.5851746,0.0000000,0.0000000,0.0000000), --object(kmb_beam), (3), createObject(1426,2800.0383301,-1612.4370117,289.1856689,0.0000000,0.0000000,0.0000000), --object(dyn_scaffold), (1), createObject(1436,2797.6530762,-1610.1121826,290.7408752,0.0000000,0.0000000,89.3249817), --object(dyn_scaffold_2), (1), createObject(8613,2860.6125488,-1483.4227295,293.9320068,0.0000000,0.0000000,88.0550232), --object(vgssstairs03_lvs), (2), createObject(8615,2749.0219727,-1587.8944092,292.2352905,0.0000000,0.0000000,0.0000000), --object(vgssstairs04_lvs), (1), createObject(8615,2798.6267090,-1486.2542725,295.4102478,0.2500000,27.8199463,0.0000000), --object(vgssstairs04_lvs), (2), createObject(12839,2857.3415527,-1504.4493408,298.5549927,0.0000000,0.0000000,0.0000000), --object(cos_sbanksteps02), (2), createObject(12950,2857.3127441,-1497.9508057,294.2662354,345.7500000,0.0000000,180.0000000), --object(cos_sbanksteps03), (1), createObject(1656,2744.8603516,-1587.9670410,289.3042603,0.0000000,0.0000000,89.9999390), --object(esc_step), (1), createObject(12839,2769.3818359,-1486.1683350,296.8043823,27.7500000,0.0000000,270.0000000), --object(cos_sbanksteps02), (1), createObject(12950,2777.4787598,-1486.1345215,295.4411316,326.0000000,0.0000000,89.6599731), --object(cos_sbanksteps03), (2), createObject(8615,2816.5400391,-1486.2119141,296.7099304,0.2500000,26.0699158,0.0000000), --object(vgssstairs04_lvs), (3), createObject(8615,2860.8759766,-1537.6096191,301.1300354,0.2500000,33.7599182,269.9599609), --object(vgssstairs04_lvs), (4), createObject(1656,2860.9201660,-1540.8796387,301.2093811,330.3398438,0.0000000,180.6049805), --object(esc_step), (2), createObject(3399,2815.6591797,-1541.5611572,317.3496094,0.0000000,351.2500000,180.0000000), --object(cxrf_a51_stairs), (1), createObject(3399,2826.1447754,-1541.6033936,310.4985962,0.0000000,346.8399048,180.0000000), --object(cxrf_a51_stairs), (2), createObject(3399,2836.3222656,-1541.5638428,304.1251526,0.0000000,350.3850098,180.0000000), --object(cxrf_a51_stairs), (3), createObject(1656,2840.3732910,-1541.6206055,301.2343750,25.8045959,0.0000000,90.7445068), --object(esc_step), (3), createObject(1391,2847.4094238,-1613.3498535,321.7159729,0.0000000,0.0000000,0.0000000), --object(twrcrane_s_03), (1), createObject(1389,2847.4101562,-1613.3658447,334.3147583,0.0000000,0.0000000,0.0000000), --object(twrcrane_s_01), (1), createObject(1388,2847.4311523,-1613.3812256,334.6430969,0.0000000,0.0000000,0.0000000), --object(twrcrane_s_04), (1), createObject(11406,2847.4865723,-1577.1127930,336.8164978,0.0000000,0.0000000,0.0000000), --object(acwinch1b_sfs01), (1), createObject(14448,2838.9318848,-1593.8201904,290.0598450,0.0000000,0.0000000,0.0000000), --object(carter_girders02), (1), createObject(14435,2834.9750977,-1584.8654785,291.9840698,0.0000000,0.0000000,0.0000000), --object(carter_girders), (1), createObject(11558,2830.7702637,-1593.2119141,292.5088501,0.0000000,0.0000000,0.0000000), --object(cn_sta_grid_03), (1), createObject(11558,2838.8449707,-1593.1584473,292.5088501,0.0000000,0.0000000,0.0000000), --object(cn_sta_grid_03), (2), createObject(11558,2847.5690918,-1593.8275146,292.5088501,0.0000000,0.0000000,0.0000000), --object(cn_sta_grid_03), (3), createObject(16132,2833.7204590,-1593.4566650,289.1856689,0.0000000,0.0000000,0.0000000), --object(dam_trellis01), (1), createObject(16088,2847.8774414,-1584.7818604,289.1856689,0.0000000,0.0000000,91.3099670), --object(des_pipestrut01), (1), createObject(16092,2847.2346191,-1604.9259033,289.1856689,0.0000000,0.0000000,268.4099731), --object(des_pipestrut05), (1), createObject(9131,2852.7661133,-1585.6735840,290.3145752,0.0000000,0.0000000,0.0000000), --object(shbbyhswall13_lvs), (1), createObject(2960,2835.9880371,-1584.7482910,289.5852966,0.0000000,0.0000000,326.2550049), --object(kmb_beam), (4), createObject(2960,2835.9724121,-1584.7717285,290.0851746,0.0000000,0.0000000,326.2550049), --object(kmb_beam), (5), createObject(9824,2852.6513672,-1593.9678955,292.1781311,0.0000000,0.0000000,180.0000000), --object(diner_sfw), (1), createObject(11469,2832.6425781,-1595.0179443,289.1356812,0.0000000,0.0000000,0.0000000), --object(des_bullgrill_), (1), createObject(9131,2836.0966797,-1586.8197021,290.3145752,0.0000000,0.0000000,0.0000000), --object(shbbyhswall13_lvs), (2), createObject(9131,2835.1645508,-1586.2762451,290.3145752,0.0000000,0.0000000,0.0000000), --object(shbbyhswall13_lvs), (3), createObject(16067,2825.0322266,-1615.2449951,289.2106628,0.0000000,0.0000000,180.0000000), --object(des_stwnmotel02), (1), createObject(3283,2767.9584961,-1614.1362305,289.1856689,0.0000000,0.0000000,271.9449463), --object(conhoos3), (1), createObject(3284,2750.7375488,-1614.9658203,291.1153564,0.0000000,0.0000000,0.0000000), --object(conhoos5), (1), createObject(3285,2769.6057129,-1595.0451660,291.1148987,0.0000000,0.0000000,0.0000000), --object(conhoos4), (1), createObject(3454,2752.5903320,-1551.3636475,293.4632263,0.0000000,0.0000000,270.0000000), --object(vgnhseing15), (1), createObject(3558,2865.4311523,-1611.1166992,292.1402283,0.0000000,0.0000000,0.0000000), --object(compmedhos5_lae), (1), createObject(3580,2874.8715820,-1570.6517334,293.8247070,0.0000000,0.0000000,89.9999695), --object(compbigho2_lae), (1), createObject(3583,2879.7971191,-1587.7954102,292.3322754,0.0000000,1.9849854,314.3450012), --object(compbigho3_lae), (1), createObject(3587,2877.2966309,-1603.2028809,291.7871399,0.0000000,0.0000000,222.3601074), --object(nwsnpedhus1_las), (1), createObject(3601,2769.9309082,-1540.0614014,297.0349121,0.0000000,0.0000000,0.0000000), --object(hillhouse04_la), (1), createObject(3617,2877.1108398,-1483.5863037,291.9242249,0.0000000,0.0000000,0.0000000), --object(midranhus_las), (1), createObject(3626,2884.8085938,-1495.2568359,290.7529602,0.0000000,0.0000000,270.6701660), --object(dckwrkhut), (1), createObject(3642,2805.4963379,-1516.6246338,292.1367798,0.0000000,0.0000000,0.0000000), --object(glenphouse03_lax), (1), createObject(3651,2872.9843750,-1499.7012939,293.5423889,0.0000000,0.0000000,0.0000000), --object(ganghous04_lax), (1), createObject(3698,2817.1860352,-1596.1776123,291.9350586,0.0000000,0.0000000,0.0000000), --object(barrio3b_lae), (1), createObject(3783,2841.1896973,-1505.9971924,291.4741821,0.0000000,0.0000000,0.0000000), --object(las2xref01_lax), (1), createObject(5341,2851.8723145,-1527.0230713,292.1889038,0.0000000,0.0000000,270.6749878), --object(crlsafhus_las2), (1), createObject(9258,2765.7995605,-1576.0767822,292.9979248,0.0000000,0.0000000,0.0000000), --object(preshoosml02_sfn), (1), createObject(9323,2860.2844238,-1592.7011719,291.0509033,0.0000000,0.0000000,0.0000000), --object(moresfnshit29), (1), createObject(3279,2785.3830566,-1565.3627930,289.4693604,0.0000000,0.0000000,180.0000000), --object(a51_spottower), (1), createObject(3279,2828.5644531,-1565.6611328,289.4693604,0.0000000,0.0000000,0.0000000), --object(a51_spottower), (2), createObject(3279,2828.8786621,-1520.6624756,289.4693604,0.0000000,0.0000000,0.0000000), --object(a51_spottower), (3), createObject(3279,2783.8242188,-1520.7998047,289.4693604,0.0000000,0.0000000,179.9945068), --object(a51_spottower), (4), createObject(3399,2794.3278809,-1540.7740479,317.3617859,0.0000000,351.2500000,0.0000000), --object(cxrf_a51_stairs), (4), createObject(3399,2783.5690918,-1540.7736816,310.9367676,0.0000000,351.2500000,0.0000000), --object(cxrf_a51_stairs), (5), createObject(3399,2775.1616211,-1540.7264404,305.1867065,0.0000000,351.2500000,0.0000000), --object(cxrf_a51_stairs), (6), createObject(3399,2823.2053223,-1520.8189697,307.8244934,0.2500000,2.5000000,180.0000000), --object(cxrf_a51_stairs), (7), createObject(3399,2790.0268555,-1520.6962891,307.9744568,0.2500000,1.5000000,0.0000000), --object(cxrf_a51_stairs), (8), createObject(16645,2804.5620117,-1520.5948486,309.8680420,0.0000000,0.7500000,0.0000000), --object(a51_ventsouth01), (1), createObject(3399,2822.4240723,-1565.8841553,307.8244934,0.2500000,2.5000000,180.0000000), --object(cxrf_a51_stairs), (9), createObject(3399,2791.4548340,-1565.5700684,307.8494873,0.2500000,2.5000000,0.0000000), --object(cxrf_a51_stairs), (10), createObject(16645,2810.1337891,-1565.7812500,309.7430725,0.0000000,0.0000000,179.9945068), --object(a51_ventsouth01), (2), createObject(16645,2797.1884766,-1553.0468750,309.7051697,0.4998779,359.7473145,271.9995117), --object(a51_ventsouth01), (3), createObject(16645,2796.1555176,-1529.3045654,309.8551331,0.0000000,1.2349854,270.5000000), --object(a51_ventsouth01), (4), createObject(16644,2796.3239746,-1539.2397461,309.6870422,0.0000000,0.0000000,270.6749268), --object(a51_ventsouth), (1), createObject(16644,2816.9472656,-1531.6171875,309.7066040,0.0000000,0.0000000,89.3243408), --object(a51_ventsouth), (2), createObject(16644,2816.6870117,-1548.9381104,309.7066040,0.0000000,0.0000000,89.3249512), --object(a51_ventsouth), (3), createObject(16644,2816.4218750,-1566.2597656,309.7066040,0.0000000,0.0000000,89.3243408), --object(a51_ventsouth), (4), createObject(16644,2817.7285156,-1508.4931641,307.5130005,0.0000000,347.3382568,262.7302246), --object(a51_ventsouth), (6), createObject(16644,2819.7814941,-1493.3989258,301.1638794,4.0450134,330.5899048,258.0750732), --object(a51_ventsouth), (7), createObject(3399,2758.2431641,-1545.1762695,302.4615173,0.7349854,358.9249268,0.0000000), --object(cxrf_a51_stairs), (11), createObject(3399,2752.6650391,-1545.1564941,299.9364014,0.7349854,358.9249268,0.0000000), --object(cxrf_a51_stairs), (12), createObject(3399,2749.7622070,-1570.5841064,295.3365479,359.7349854,358.9249268,89.3250122), --object(cxrf_a51_stairs), (13), createObject(3399,2747.3330078,-1584.1835938,294.8116760,359.7349854,358.9249268,268.7850342), --object(cxrf_a51_stairs), (14), createObject(16644,2752.2526855,-1527.5876465,297.6932678,0.0000000,0.0000000,269.6899414), --object(a51_ventsouth), (8), createObject(16644,2752.3552246,-1517.4361572,297.6932678,0.0000000,0.0000000,269.6899414), --object(a51_ventsouth), (9), createObject(16644,2818.1523438,-1603.9953613,294.5924988,0.0000000,0.0000000,88.5899963), --object(a51_ventsouth), (10), createObject(16644,2816.0378418,-1583.1634521,306.6673584,0.0000000,342.1350098,88.5899963), --object(a51_ventsouth), (11), createObject(16644,2815.5793457,-1599.6915283,301.3423767,0.0000000,342.1350098,88.5899963), --object(a51_ventsouth), (12), createObject(16644,2815.2746582,-1608.8966064,298.3672485,0.0000000,342.1350098,88.5899963), --object(a51_ventsouth), (13), createObject(3399,2808.8452148,-1609.7105713,292.0863647,0.7349854,352.9699707,0.0000000), --object(cxrf_a51_stairs), (15), createObject(12950,2863.7773438,-1481.9996338,293.7410583,330.7049561,358.0000000,267.3399658), --object(cos_sbanksteps03), (3), createObject(16644,2873.9472656,-1490.9822998,295.7309875,0.0000000,351.3099976,270.6749878), --object(a51_ventsouth), (14), createObject(12950,2871.2773438,-1503.6127930,297.9412537,358.7500000,0.0000000,180.0000000), --object(cos_sbanksteps03), (4), createObject(16644,2850.7126465,-1531.7924805,296.7783203,0.0000000,332.2099915,268.6899414), --object(a51_ventsouth), (17), createObject(16644,2757.1528320,-1533.8381348,298.4184570,2.2349854,349.5899963,359.0142822), --object(a51_ventsouth), (18), createObject(16644,2771.0769043,-1567.7734375,295.5937805,0.0000000,351.5299683,0.0000000), --object(a51_ventsouth), (19), createObject(16644,2756.7714844,-1580.4313965,294.6940002,0.0000000,351.5299683,0.0000000), --object(a51_ventsouth), (20), createObject(16645,2802.3217773,-1593.7805176,294.2550964,0.0000000,2.9849854,179.6750488), --object(a51_ventsouth01), (5), createObject(16645,2847.6252441,-1610.1280518,294.4354858,0.0000000,0.0000000,0.0000000), --object(a51_ventsouth01), (6), createObject(16644,2878.8276367,-1580.2027588,294.7994080,0.0000000,340.1499939,90.1050110), --object(a51_ventsouth), (23), createObject(16644,2878.3046875,-1569.5627441,297.6325684,0.0000000,338.1650085,89.3250122), --object(a51_ventsouth), (24), createObject(1656,2878.8024902,-1560.0361328,300.9094543,359.9549561,0.0000000,0.6749268), --object(esc_step), (4), createObject(1656,2849.9631348,-1540.9909668,301.0844116,358.0149536,0.0000000,179.3249512), --object(esc_step), (5), createObject(1656,2851.2299805,-1496.9185791,293.0844116,358.1296387,0.0000000,180.6049805), --object(esc_step), (6), createObject(16645,2851.4887695,-1504.7242432,293.5649109,0.0000000,0.0000000,269.9399719), --object(a51_ventsouth01), (7), createObject(1656,2840.6223145,-1541.6262207,300.9094543,25.8013916,0.0000000,89.4891357), --object(esc_step), (3), createObject(16645,2809.6721191,-1552.1317139,309.7301636,0.4998779,359.7473145,178.9696045), --object(a51_ventsouth01), (3), createObject(16645,2808.6279297,-1532.0292969,309.7301636,0.4998779,359.7473145,179.4506836), --object(a51_ventsouth01), (3), createObject(16645,2805.9809570,-1552.7222900,316.9663086,0.0000000,23.8349915,273.5694580), --object(a51_ventsouth01), (2), createObject(16645,2808.0581055,-1587.7489014,301.4739075,0.0000000,23.8348389,273.5650635), --object(a51_ventsouth01), (2), createObject(16645,2807.0139160,-1570.2298584,309.2265015,0.0000000,23.8348389,273.5650635), --object(a51_ventsouth01), (2), createObject(16645,2809.0480957,-1604.5111084,292.3736877,0.0000000,35.7448425,273.5650635), --object(a51_ventsouth01), (2), createObject(16645,2805.5642090,-1530.8278809,317.8911438,0.2471924,27.2857056,86.7535400), --object(a51_ventsouth01), (2), createObject(16645,2806.5625000,-1513.6827393,309.3165283,0.2471924,25.2960205,86.7480469), --object(a51_ventsouth01), (2), createObject(16645,2807.5710449,-1496.3673096,301.1166992,0.2471924,25.2960205,86.7480469), --object(a51_ventsouth01), (2), createObject(9247,2786.6999512,-1609.5261230,295.6641235,0.0000000,0.0000000,88.0550232), ]] createObject(8357,-2004.4775391,940.7675781,64.2412338,0.0000000,90.0000000,0.0000000), --object(vgssairportland14), (1), createObject(8357,-2074.5029297,1042.3935547,64.2412338,0.0000000,90.0000000,90.0000000), --object(vgssairportland14), (2), createObject(8357,-2074.5029297,1042.3935547,103.9912338,0.0000000,90.0000000,90.0000000), --object(vgssairportland14), (3), createObject(8357,-2004.4775391,940.7675781,103.9912338,0.0000000,90.0000000,0.0000000), --object(vgssairportland14), (4), createObject(8357,-2143.2812500,939.1435547,64.2412338,0.0000000,90.0000000,179.9945068), --object(vgssairportland14), (5), createObject(8357,-2143.2812500,939.1435547,103.9912338,0.0000000,90.0000000,179.9945068), --object(vgssairportland14), (6), createObject(8357,-2143.2812500,726.3935547,64.2412338,0.0000000,90.0000000,179.9945068), --object(vgssairportland14), (7), createObject(8357,-2143.2812500,726.3935547,103.9912338,0.0000000,90.0000000,179.9945068), --object(vgssairportland14), (8), createObject(8357,-2004.4775391,728.0175781,64.2412338,0.0000000,90.0000000,0.0000000), --object(vgssairportland14), (9), createObject(8357,-2004.4775391,728.0175781,103.9912338,0.0000000,90.0000000,0.0000000), --object(vgssairportland14), (10), createObject(8357,-2075.7275391,808.3681641,64.2412338,0.0000000,90.0000000,270.0000000), --object(vgssairportland14), (11), createObject(8357,-2075.7275391,808.3681641,103.9912338,0.0000000,90.0000000,270.0000000), --object(vgssairportland14), (12), createObject(12958,-2023.1741940,824.2455440,64.3977200,0.0000000,0.0000000,90.0000000), --object(cos_sbanksteps01), (1), createObject(3399,-2034.1276860,845.7254030,69.1073530,0.0000000,0.0000000,180.0000000), --object(cxrf_a51_stairs), (1), createObject(3399,-2040.1527100,851.6500850,73.8073500,0.0000000,0.0000000,90.0000000), --object(cxrf_a51_stairs), (2), createObject(3361,-2033.6652830,821.0817260,73.2372060,0.0000000,0.0000000,0.0000000), --object(cxref_woodstair), (1), createObject(3361,-2029.1903080,824.8817750,69.2372060,0.0000000,0.0000000,90.0000000), --object(cxref_woodstair), (2), createObject(3399,-2045.8035890,830.8507690,65.4916610,0.0000000,0.0000000,0.0000000), --object(cxrf_a51_stairs), (3), createObject(8613,-2053.2160640,825.1121220,79.6517720,0.0000000,0.0000000,90.0000000), --object(vgssstairs03_lvs), (1), createObject(16322,-2080.6782230,827.3913570,86.8712770,0.0000000,0.0000000,0.0000000), --object(a51_plat), (1), createObject(3867,-2093.0102540,857.1372680,83.5497360,0.0000000,0.0000000,0.0000000), --object(ws_scaffolding_sfx), (1), createObject(3867,-2110.4355470,857.1372680,83.5497360,0.0000000,0.0000000,0.0000000), --object(ws_scaffolding_sfx), (2), createObject(3867,-2082.8608400,864.6625370,83.5497360,0.0000000,0.0000000,90.0000000), --object(ws_scaffolding_sfx), (3), createObject(16644,-2125.5979000,849.2136840,91.7924270,0.0000000,329.9197000,90.0000000), --object(a51_ventsouth), (1), createObject(16644,-2125.6477050,834.0635380,83.0674290,0.0000000,329.9197000,90.0000000), --object(a51_ventsouth), (2), createObject(1365,-2120.5627440,855.9062500,87.2757110,0.0000000,0.0000000,90.0000000), --object(cj_big_skip1), (1), createObject(12950,-2082.9099120,872.2775270,75.0442050,0.0000000,0.0000000,0.0000000), --object(cos_sbanksteps03), (1), createObject(8572,-2083.3886720,875.6522220,90.6287920,0.0000000,0.0000000,90.0000000), --object(vgssstairs02_lvs), (1), createObject(11472,-2090.8793950,877.1448360,89.0674900,0.0000000,0.0000000,90.0000000), --object(des_swtstairs1), (1), createObject(11472,-2090.8793950,877.7697140,89.0662610,0.0000000,0.0000000,90.0000000), --object(des_swtstairs1), (2), createObject(1365,-2120.5627440,851.4562990,85.9507060,0.0000000,327.3414000,90.0000000), --object(cj_big_skip1), (2), createObject(16644,-2118.4479980,857.6896970,81.0100560,0.0000000,0.0000000,0.0000000), --object(a51_ventsouth), (3), createObject(16644,-2124.1955570,848.1796880,82.7815780,0.0000000,0.0000000,270.0000000), --object(a51_ventsouth), (4), createObject(1437,-2087.1699219,889.3505859,88.2113419,335.9344482,0.0000000,90.0000000), --object(dyn_ladder_2), (1), createObject(1437,-2083.9199219,889.3505859,83.4113388,335.9344482,0.0000000,90.0000000), --object(dyn_ladder_2), (2), createObject(1437,-2080.6699219,889.3505859,78.6113358,335.9344482,0.0000000,90.0000000), --object(dyn_ladder_2), (3), createObject(1635,-2026.8051760,883.3067630,63.2884830,0.0000000,0.0000000,90.0000000), --object(nt_aircon1dbl), (1), createObject(3502,-2061.4838870,892.5021970,78.6802060,351.4056000,114.4089000,67.5000000), --object(vgsn_con_tube), (1), createObject(1689,-2072.4309080,882.2807010,77.9374390,0.0000000,0.0000000,270.0000000), --object(gen_roofbit3), (1), createObject(3798,-2037.6975100,886.6251830,66.2074810,0.0000000,0.0000000,11.2500000), --object(acbox3_sfs), (1), createObject(3798,-2037.5798340,889.6692500,66.2074810,0.0000000,0.0000000,348.7500000), --object(acbox3_sfs), (2), createObject(3798,-2037.7205810,889.6003420,68.2074810,0.0000000,0.0000000,0.0000000), --object(acbox3_sfs), (3), createObject(3798,-2035.3763430,890.6734620,66.2074810,0.0000000,0.0000000,22.5000000), --object(acbox3_sfs), (4), createObject(3800,-2035.3221440,884.6958620,66.2074810,0.0000000,0.0000000,0.0000000), --object(acbox4_sfs), (1), createObject(3260,-2014.5468750,894.9267578,61.2629776,289.6270752,0.0000000,269.9945068), --object(oldwoodpanel), (1), createObject(3260,-2017.3710938,894.9267578,60.2629776,289.6270752,0.0000000,269.9945068), --object(oldwoodpanel), (2), createObject(3260,-2020.1718750,894.9267578,59.2629776,289.6270752,0.0000000,269.9945068), --object(oldwoodpanel), (3), createObject(1617,-2015.3032230,892.1717530,63.6657260,0.0000000,0.0000000,180.0000000), --object(nt_aircon1_01), (1), createObject(1617,-2014.6533200,892.1712650,63.6657260,0.0000000,0.0000000,180.0000000), --object(nt_aircon1_01), (2), createObject(3576,-2106.5566410,878.1970210,93.8598630,0.0000000,0.0000000,22.5000000), --object(dockcrates2_la), (1), createObject(3577,-2108.2937010,881.3267210,93.1496960,0.0000000,0.0000000,101.2500000), --object(dockcrates1_la), (1), createObject(16766,-1988.1955570,885.5989990,25.0979540,0.0000000,35.2369000,0.0000000), --object(des_oilpipe_02), (1), createObject(16766,-1988.1955570,884.5989990,25.0979540,0.0000000,35.2369000,0.0000000), --object(des_oilpipe_02), (2), createObject(8572,-2058.6723630,886.8013920,68.4361040,0.0000000,0.0000000,270.0000000), --object(vgssstairs02_lvs), (2), createObject(8572,-2060.2558590,893.6878050,63.0782390,0.0000000,0.0000000,90.0000000), --object(vgssstairs02_lvs), (3), createObject(11544,-2019.3013920,867.1848140,74.9971080,0.0000000,0.0000000,180.0000000), --object(des_ntfrescape2), (1), createObject(11544,-2019.3013920,874.4848630,72.2721100,0.0000000,0.0000000,180.0000000), --object(des_ntfrescape2), (2), createObject(11544,-2019.3013920,881.7598880,69.5471120,0.0000000,0.0000000,180.0000000), --object(des_ntfrescape2), (3), createObject(11544,-2019.3013920,889.0346680,66.8221130,0.0000000,0.0000000,180.0000000), --object(des_ntfrescape2), (4), createObject(3458,-2115.8811040,918.3948360,94.2418210,0.0000000,359.6992000,270.0000000), --object(vgncarshade1), (1), createObject(9766,-2045.3320310,924.5140380,80.9075780,1.7189000,0.0000000,0.0000000), --object(scaff3_sfw), (1), createObject(3361,-2040.5599370,962.7552490,82.1226120,0.0000000,0.0000000,270.0000000), --object(cxref_woodstair), (3), createObject(3361,-2036.6711430,958.4451900,78.0754320,0.0000000,0.0000000,0.0000000), --object(cxref_woodstair), (4), createObject(3361,-2032.3217770,962.2948000,74.0504760,0.0000000,0.0000000,90.0000000), --object(cxref_woodstair), (5), createObject(3406,-2040.5574950,963.8240360,74.0597000,0.0000000,0.0000000,90.0000000), --object(cxref_woodjetty), (1), createObject(3399,-2024.6181640,975.3120730,70.7625660,0.0000000,0.0000000,0.0000000), --object(cxrf_a51_stairs), (4), createObject(3399,-2034.2187500,975.3120730,66.0875700,0.0000000,0.0000000,0.0000000), --object(cxrf_a51_stairs), (5), createObject(1685,-2038.0683590,989.7731930,65.0726620,0.0000000,0.0000000,11.2500000), --object(blockpallet), (1), createObject(1685,-2035.9099120,989.7781370,65.0705570,0.0000000,0.0000000,292.5000000), --object(blockpallet), (2), createObject(1685,-2037.4310300,987.6982420,65.0715560,0.0000000,0.0000000,315.0000000), --object(blockpallet), (3), createObject(1685,-2033.6291500,989.9110110,65.0683290,0.0000000,0.0000000,348.7500000), --object(blockpallet), (4), createObject(1685,-2034.8221440,990.0823360,66.5705570,0.0000000,0.0000000,0.0000000), --object(blockpallet), (5), createObject(3576,-2055.1967770,968.1505740,85.7043610,0.0000000,0.0000000,337.5000000), --object(dockcrates2_la), (2), createObject(3800,-2074.7329100,827.2661740,83.0121690,0.0000000,0.0000000,0.0000000), --object(acbox4_sfs), (2), createObject(3800,-2074.7111820,827.3502200,84.0924300,0.0000000,0.0000000,348.7500000), --object(acbox4_sfs), (3), createObject(3800,-2074.4343260,825.9672850,83.0121690,0.0000000,0.0000000,11.2500000), --object(acbox4_sfs), (4), createObject(3800,-2073.4250490,827.7520750,83.0098110,0.0000000,0.0000000,348.7500000), --object(acbox4_sfs), (5), createObject(3800,-2074.5834960,828.5795290,83.0121690,0.0000000,0.0000000,0.0000000), --object(acbox4_sfs), (6), createObject(3800,-2074.0961910,828.2593380,84.0924300,0.0000000,0.0000000,337.5000000), --object(acbox4_sfs), (7), createObject(3800,-2073.2683110,826.5010990,83.0121690,0.0000000,0.0000000,337.5000000), --object(acbox4_sfs), (8), createObject(3761,-2027.9643550,1007.4232180,67.8152850,0.0000000,0.0000000,270.0000000), --object(industshelves), (1), createObject(12930,-2118.6835940,981.3808590,96.2505340,0.0000000,0.0000000,348.7500000), --object(sw_pipepile02), (1), createObject(18260,-2115.7817380,974.1570430,97.5185090,0.0000000,0.0000000,90.0000000), --object(crates01), (1), createObject(18260,-2026.2546390,957.1105350,74.1669460,0.0000000,0.0000000,0.0000000), --object(crates01), (2), createObject(2567,-2055.2695310,957.5140380,84.2392810,0.0000000,0.0000000,326.2500000), --object(ab_warehouseshelf), (1), createObject(5262,-2110.6608890,941.2117310,97.8826370,0.0000000,0.0000000,337.5000000), --object(las2dkwar04), (1), createObject(5262,-2053.0825200,898.0971680,80.2748340,0.0000000,0.0000000,135.0000000), --object(las2dkwar04), (2), createObject(5269,-2037.2966310,901.7243650,68.5199890,0.0000000,0.0000000,90.0000000), --object(las2dkwar05), (1), createObject(12930,-2020.5809330,901.5932620,67.0411760,0.0000000,0.0000000,101.2500000), --object(sw_pipepile02), (2), createObject(18260,-2033.2254640,864.1985470,77.6051790,0.0000000,0.0000000,202.5000000), --object(crates01), (3), createObject(925,-2024.2104490,847.2423100,77.0938950,0.0000000,0.0000000,180.0000000), --object(rack2), (1), createObject(930,-2037.8190920,843.3459470,68.1891940,0.0000000,0.0000000,67.5000000), --object(o2_bottles), (1), createObject(964,-2040.1246340,828.6623540,75.3053510,0.0000000,0.0000000,0.0000000), --object(cj_metal_crate), (1), createObject(964,-2069.0815430,828.8169560,83.0156250,0.0000000,0.0000000,270.0000000), --object(cj_metal_crate), (2), createObject(1362,-2071.0764160,822.2797240,83.6141050,0.0000000,0.0000000,0.0000000), --object(cj_firebin), (1), createObject(1431,-2038.0507812,834.8339844,68.2609329,0.0000000,0.0000000,90.0000000), --object(dyn_box_pile), (1), createObject(1431,-2085.5371090,875.6641240,97.3679280,0.0000000,0.0000000,0.0000000), --object(dyn_box_pile), (2), createObject(1685,-2088.1281740,875.1360470,97.5703130,0.0000000,0.0000000,11.2500000), --object(blockpallet), (6), createObject(2567,-2115.3771970,867.0697630,98.7479170,0.0000000,0.0000000,337.5000000), --object(ab_warehouseshelf), (2), createObject(2669,-2125.9792480,900.0916140,98.1605830,0.0000000,0.0000000,22.5000000), --object(cj_chris_crate), (1), createObject(3576,-2086.7824710,860.3251950,98.3129880,0.0000000,0.0000000,348.7500000), --object(dockcrates2_la), (3), createObject(3577,-2111.6557620,902.4375610,97.6028210,0.0000000,0.0000000,348.7500000), --object(dockcrates1_la), (2), createObject(3630,-2123.8066410,929.2462160,97.1462330,0.0000000,0.0000000,0.0000000), --object(crdboxes2_las), (1), createObject(3722,-2112.6015630,838.0637820,89.5550080,0.0000000,0.0000000,326.2500000), --object(laxrf_scrapbox), (1), createObject(3761,-2086.2175290,833.9593510,87.4645770,0.0000000,0.0000000,0.0000000), --object(industshelves), (2), createObject(3761,-2093.5412600,897.0726320,94.1411510,0.0000000,0.0000000,270.0000000), --object(industshelves), (3), createObject(3796,-2084.8796390,898.3679200,80.6314240,0.0000000,0.0000000,112.5000000), --object(acbox1_sfs), (1), createObject(3799,-2085.2282710,879.3915410,80.4900210,0.0000000,0.0000000,348.7500000), --object(acbox2_sfs), (1), createObject(3799,-2088.0993650,881.3215940,80.5198290,0.0000000,0.0000000,0.0000000), --object(acbox2_sfs), (2), createObject(3799,-2088.5979000,878.1690670,80.5161290,0.0000000,0.0000000,0.0000000), --object(acbox2_sfs), (3), createObject(3799,-2087.7326660,879.5207520,82.7514340,0.0000000,0.0000000,45.0000000), --object(acbox2_sfs), (4), createObject(925,-2075.2497560,902.4088750,81.6634670,0.0000000,0.0000000,0.0000000), --object(rack2), (2), createObject(3593,-2064.7592770,902.9346920,77.2867360,0.0000000,0.0000000,101.2500000), --object(la_fuckcar2), (1), createObject(3594,-2068.8999020,901.3842160,77.6827320,13.7510000,1.7189000,303.7500000), --object(la_fuckcar1), (1), createObject(12957,-2117.0966800,1005.3470460,96.8235320,0.0000000,0.0000000,11.2500000), --object(sw_pickupwreck01), (1), createObject(13591,-2115.3994140,1020.2990110,96.1075820,0.0000000,0.0000000,270.0000000), --object(kickcar28), (1), createObject(13749,-2050.6650390,998.9992680,74.6924820,0.0000000,0.0000000,112.5000000), --object(cunte_curvesteps1), (1), createObject(3458,-2095.2387700,995.6712040,87.8876110,0.0000000,20.3257000,0.0000000), --object(vgncarshade1), (2), createObject(16644,-2060.3391110,979.3977050,82.3412700,0.0000000,0.0000000,308.0472000), --object(a51_ventsouth), (5), createObject(3576,-2073.4448240,986.1788330,84.3585970,0.0000000,0.0000000,11.2500000), --object(dockcrates2_la), (4), createObject(3594,-2078.1293950,985.5541990,83.3532710,13.7510000,1.7189000,281.2500000), --object(la_fuckcar1), (2), createObject(3593,-2071.1389160,986.7488400,84.3619460,30.0803000,0.8594000,101.2500000), --object(la_fuckcar2), (2), createObject(925,-2083.5939940,984.5453490,82.1544950,0.0000000,0.0000000,0.0000000), --object(rack2), (3), createObject(925,-2082.5192870,984.5453490,82.1544950,0.0000000,0.0000000,0.0000000), --object(rack2), (4), createObject(944,-2050.8625490,957.4526980,84.8214570,0.0000000,0.0000000,0.0000000), --object(packing_carates04), (1), createObject(944,-2041.0268550,1010.0433960,71.3986210,0.0000000,0.0000000,270.0000000), --object(packing_carates04), (2), createObject(944,-2040.2912600,903.0840450,78.3769760,0.0000000,0.0000000,11.2500000), --object(packing_carates04), (3), createObject(944,-2078.4023440,901.2708130,81.4863510,0.0000000,0.0000000,22.5000000), --object(packing_carates04), (4), createObject(1271,-2077.5507810,901.6024780,82.3974460,0.0000000,0.0000000,0.0000000), --object(gunbox), (1), createObject(3576,-2125.4780270,872.3745730,98.3129880,0.0000000,0.0000000,135.0000000), --object(dockcrates2_la), (5), createObject(3796,-2113.2744140,886.1822510,96.8215330,0.0000000,0.0000000,56.2500000), --object(acbox1_sfs), (2), createObject(3502,-2098.6618650,873.8510740,97.7489550,0.0000000,0.0000000,78.7500000), --object(vgsn_con_tube), (2), createObject(1685,-2090.1281740,875.1360470,97.5703130,0.0000000,0.0000000,0.0000000), --object(blockpallet), (7), createObject(1685,-2089.1281740,875.1360470,99.0202940,0.0000000,0.0000000,0.0000000), --object(blockpallet), (8), createObject(1431,-2110.3896484,894.1162109,97.3679276,0.0000000,0.0000000,90.0000000), --object(dyn_box_pile), (3), createObject(3798,-2071.1132810,997.9743040,82.5997010,0.0000000,0.0000000,348.7500000), --object(acbox3_sfs), (5), createObject(3798,-2073.1352540,998.1624760,82.5563580,0.0000000,0.0000000,0.0000000), --object(acbox3_sfs), (6), createObject(3798,-2072.1066890,998.1813350,84.5997010,0.0000000,0.0000000,0.0000000), --object(acbox3_sfs), (7), createObject(3798,-2065.2917480,992.1864010,82.6266250,0.0000000,0.0000000,337.5000000), --object(acbox3_sfs), (8), createObject(3798,-2037.6165770,1021.3637080,70.4809190,0.0000000,0.0000000,11.2500000), --object(acbox3_sfs), (9), createObject(944,-2021.4050290,1013.9400020,71.1191480,0.0000000,0.0000000,0.0000000), --object(packing_carates04), (5), createObject(3798,-2020.0401610,1023.0986330,70.4809190,0.0000000,0.0000000,22.5000000), --object(acbox3_sfs), (10), createObject(3798,-2022.4206540,1022.9365230,70.4809190,0.0000000,0.0000000,0.0000000), --object(acbox3_sfs), (11), createObject(12930,-2017.9128420,998.9917600,67.9536590,0.0000000,0.0000000,112.5000000), --object(sw_pipepile02), (3), createObject(3576,-2038.3010250,971.0197750,74.0942380,0.0000000,0.0000000,348.7500000), --object(dockcrates2_la), (6), createObject(944,-2036.0645750,965.6759640,73.2550890,0.0000000,0.0000000,337.5000000), --object(packing_carates04), (6), createObject(3577,-2025.9935300,971.3007200,73.3813710,0.0000000,0.0000000,101.2500000), --object(dockcrates1_la), (3), createObject(3576,-2018.1046140,963.9880370,74.0626140,0.0000000,0.0000000,0.0000000), --object(dockcrates2_la), (7), createObject(3576,-2020.2457280,981.2571410,65.7979350,0.0000000,0.0000000,90.0001000), --object(dockcrates2_la), (8), createObject(2567,-2028.5949710,983.2409670,66.0398030,0.0000000,0.0000000,225.0000000), --object(ab_warehouseshelf), (3), createObject(3576,-2021.8789060,854.3308720,77.5246660,0.0000000,0.0000000,22.5000000), --object(dockcrates2_la), (9), createObject(3796,-2032.6607670,851.3948360,76.0375750,0.0000000,0.0000000,236.2501000), --object(acbox1_sfs), (3), createObject(3798,-2023.4582520,861.3258060,76.0285340,0.0000000,0.0000000,0.0000000), --object(acbox3_sfs), (12), createObject(3798,-2022.2336430,863.0994260,76.0285340,0.0000000,0.0000000,11.2500000), --object(acbox3_sfs), (13), createObject(3798,-2022.1014400,862.0264280,78.0285340,0.0000000,0.0000000,337.5000000), --object(acbox3_sfs), (14), createObject(3798,-2028.0371090,866.9626460,76.0285340,0.0000000,0.0000000,11.2500000), --object(acbox3_sfs), (15), createObject(3798,-2020.9726560,861.0734250,76.0285340,0.0000000,0.0000000,78.7500000), --object(acbox3_sfs), (16), createObject(925,-2022.8557130,831.6768190,68.7752230,0.0000000,0.0000000,157.5000000), --object(rack2), (5), createObject(18260,-2054.2397460,827.6750490,76.8785400,0.0000000,0.0000000,180.0000000), --object(crates01), (4), createObject(18260,-2049.6169430,827.1655270,76.8785400,0.0000000,0.0000000,0.0000000), --object(crates01), (5), createObject(2567,-2063.8330080,823.8186040,84.9432300,0.0000000,0.0000000,337.5000000), --object(ab_warehouseshelf), (4), createObject(3576,-2098.7626950,832.3020630,87.3833010,0.0000000,0.0000000,281.2500000), --object(dockcrates2_la), (10), createObject(3577,-2099.7126460,842.2139280,86.6731340,0.0000000,0.0000000,348.7500000), --object(dockcrates1_la), (4), createObject(18260,-2111.0063480,829.4550170,87.4599150,0.0000000,0.0000000,135.0000000), --object(crates01), (6), createObject(3576,-2116.4001460,840.3907470,87.3793950,0.0000000,0.0000000,146.2500000), --object(dockcrates2_la), (11), createObject(964,-2124.9233400,887.5407710,96.8203130,0.0000000,0.0000000,258.7500000), --object(cj_metal_crate), (3), createObject(964,-2119.5952150,900.1011350,96.8203130,0.0000000,0.0000000,258.7500000), --object(cj_metal_crate), (4), createObject(964,-2102.3515630,864.1671750,96.8203130,0.0000000,0.0000000,191.2500000), --object(cj_metal_crate), (5), createObject(964,-2112.6223140,930.6615600,95.7500000,0.0000000,0.0000000,191.2501000), --object(cj_metal_crate), (6), createObject(964,-2123.5576170,946.0164790,95.9063720,0.0000000,0.0000000,180.0000000), --object(cj_metal_crate), (7), createObject(3458,-2120.4833980,954.0330200,94.0516510,0.0000000,359.6992000,270.0000000), --object(vgncarshade1), (3), createObject(964,-2118.9304200,959.9880980,95.5488740,0.0000000,0.0000000,180.0000000), --object(cj_metal_crate), (8), createObject(964,-2124.8474120,971.4088130,95.9453130,0.0000000,0.0000000,191.2501000), --object(cj_metal_crate), (9), createObject(964,-2121.6015630,1009.8393550,95.9453130,0.0000000,0.0000000,180.0000000), --object(cj_metal_crate), (10), createObject(3576,-2124.3574220,992.6018070,97.4379880,0.0000000,0.0000000,135.0000000), --object(dockcrates2_la), (12), createObject(964,-2115.0068360,999.0845950,95.9453130,0.0000000,0.0000000,180.0000000), --object(cj_metal_crate), (11), createObject(3577,-2122.9650880,1001.0607300,96.7278210,0.0000000,0.0000000,11.2500000), --object(dockcrates1_la), (5), createObject(3576,-2124.0598140,1019.6877440,97.4379880,0.0000000,0.0000000,90.0000000), --object(dockcrates2_la), (13), createObject(964,-2117.3725590,917.6123660,95.7744220,0.0000000,0.0000000,180.0000000), --object(cj_metal_crate), (12), createObject(964,-2103.9355470,890.0236210,92.3671880,0.0000000,0.0000000,180.0000000), --object(cj_metal_crate), (13), createObject(964,-2078.2204590,893.0227050,80.6015630,0.0000000,0.0000000,101.2501000), --object(cj_metal_crate), (14), createObject(964,-2066.2023930,883.3419190,76.7265630,0.0000000,0.0000000,112.5001000), --object(cj_metal_crate), (15), createObject(964,-2027.0026860,889.8088990,66.2109380,0.0000000,0.0000000,112.5001000), --object(cj_metal_crate), (16), createObject(964,-2044.4376220,885.9365230,70.0234380,0.0000000,0.0000000,90.0001000), --object(cj_metal_crate), (17), createObject(964,-2039.3725590,888.5961910,77.4921880,0.0000000,0.0000000,67.5001000), --object(cj_metal_crate), (18), createObject(964,-2048.1538090,955.8497920,84.2116850,0.0000000,0.0000000,78.7500000), --object(cj_metal_crate), (19), createObject(964,-2049.8659670,971.3533940,84.2116850,0.0000000,0.0000000,101.2501000), --object(cj_metal_crate), (20), createObject(964,-2033.6228030,972.5374150,72.5957640,0.0000000,0.0000000,90.0001000), --object(cj_metal_crate), (21), createObject(964,-2030.6590580,992.5177000,67.3913730,0.0000000,0.0000000,180.0000000), --object(cj_metal_crate), (22), createObject(964,-2022.4837650,1009.0687870,70.4843750,0.0000000,0.0000000,191.2501000), --object(cj_metal_crate), (23), createObject(964,-2023.9837650,1009.0687870,70.4843750,0.0000000,0.0000000,180.0000000), --object(cj_metal_crate), (24), createObject(964,-2022.9837650,1009.0687870,71.4843750,0.0000000,0.0000000,0.0001000), --object(cj_metal_crate), (25), createObject(964,-2064.2526860,987.0647580,82.3907930,0.0000000,0.0000000,45.0001000), --object(cj_metal_crate), (26), createObject(964,-2085.9428710,993.9290770,86.0741420,17.1887000,0.0000000,90.0001000), --object(cj_metal_crate), (27), createObject(964,-2100.8916020,997.4085080,91.6114880,17.1887000,0.0000000,90.0001000), --object(cj_metal_crate), (28), createObject(3594,-2123.6711430,938.5108640,96.5425570,1.7189000,0.8594000,302.0312000), --object(la_fuckcar1), (3), createObject(3593,-2125.9323730,977.0281980,96.5054700,0.0000000,0.0000000,123.7499000), --object(la_fuckcar2), (3), createObject(3576,-2077.1208500,879.9982910,82.0942380,0.0000000,0.0000000,0.0000000), --object(dockcrates2_la), (14), createObject(3576,-2063.2058110,878.5596920,78.2192380,0.0000000,0.0000000,213.7500000), --object(dockcrates2_la), (15), createObject(3576,-2023.3627930,885.8065800,67.7036130,0.0000000,0.0000000,168.7500000), --object(dockcrates2_la), (16), createObject(13749,-2134.5852050,1020.5214840,86.2136920,0.0000000,0.0000000,236.2501000), --object(cunte_curvesteps1), (2), createObject(11544,-2129.8623050,1002.2404170,94.7694170,0.0000000,0.0000000,180.0000000), --object(des_ntfrescape2), (5), createObject(2669,-2128.3161620,1001.9129640,94.4300990,0.0000000,0.0000000,90.0000000), --object(cj_chris_crate), (2), createObject(2669,-2128.3161620,1004.9129640,94.4300990,0.0000000,0.0000000,90.0000000), --object(cj_chris_crate), (3), createObject(2669,-2128.3161620,998.7630620,94.4300990,0.0000000,0.0000000,90.0000000), --object(cj_chris_crate), (4), createObject(3361,-2046.5229490,1024.4367680,68.6469650,0.0000000,0.0000000,180.0000000), --object(cxref_woodstair), (6), createObject(3361,-2054.7470700,1024.4367680,64.6219640,0.0000000,0.0000000,180.0000000), --object(cxref_woodstair), (7), createObject(3361,-2062.9472660,1024.4367680,60.5719600,0.0000000,0.0000000,180.0000000), --object(cxref_woodstair), (8), createObject(3361,-2013.0136720,831.9137570,59.7069590,0.0000000,0.0000000,0.0000000), --object(cxref_woodstair), (9), createObject(3361,-2008.6633300,835.7638550,55.6319540,0.0000000,0.0000000,90.0000000), --object(cxref_woodstair), (10), createObject(3361,-2008.6633300,841.8386840,51.5819510,0.0000000,0.0000000,90.0000000), --object(cxref_woodstair), (11), createObject(3361,-2008.6633300,850.0383910,47.5819510,0.0000000,0.0000000,90.0000000), --object(cxref_woodstair), (12), createObject(3361,-2008.6633300,856.0136110,43.5819510,0.0000000,0.0000000,90.0000000), --object(cxref_woodstair), (13), createObject(3576,-2018.9680180,844.4179080,63.2691460,0.0000000,0.0000000,270.0000000), --object(dockcrates2_la), (17), createObject(3796,-2020.8710940,837.8791500,61.7790220,0.0000000,0.0000000,33.7500000), --object(acbox1_sfs), (4), createObject(18260,-2036.1866460,825.5372310,69.2865140,0.0000000,0.0000000,202.5000000), --object(crates01), (7), createObject(964,-2037.9768070,840.0319820,67.7133180,0.0000000,0.0000000,90.0000000), --object(cj_metal_crate), (29), createObject(1431,-2038.0507810,836.8342290,68.2609330,0.0000000,0.0000000,90.0000000), --object(dyn_box_pile), (4), createObject(944,-2037.4458010,867.3646240,76.7917710,0.0000000,0.0000000,22.5000000), --object(packing_carates04), (7), createObject(944,-2049.6870120,888.1489260,78.1269610,0.0000000,0.0000000,0.0000000), --object(packing_carates04), (8), createObject(944,-2067.3564450,877.1604000,77.3863370,0.0000000,0.0000000,0.0000000), --object(packing_carates04), (9), createObject(3761,-2091.3383790,866.4814450,98.8192900,0.0000000,0.0000000,281.2500000), --object(industshelves), (4), createObject(3593,-2118.9387210,878.5255740,97.4054720,0.0000000,0.0000000,236.2500000), --object(la_fuckcar2), (4), createObject(3594,-2095.2502440,882.1550290,92.8438950,0.8594000,355.7028000,33.7500000), --object(la_fuckcar1), (4), createObject(3594,-2104.4965820,897.4176640,92.9983670,0.8594000,355.7028000,101.2500000), --object(la_fuckcar1), (5), createObject(12930,-2025.9687500,1013.3479000,71.0396270,0.0000000,0.0000000,67.5000000), --object(sw_pipepile02), (4), createObject(3576,-2031.7423100,839.1106570,69.2059940,0.0000000,0.0000000,315.0000000), --object(dockcrates2_la), (18), createObject(18260,-2067.2902830,957.6578370,60.2245600,0.0000000,6.8755000,348.7501000), --object(crates01), (8), createObject(18260,-2110.9111330,912.8804930,77.7827150,354.8434000,2.5783000,281.2501000), --object(crates01), (9), createObject(18260,-2018.9061280,921.3096920,45.9585650,354.8434000,0.0000000,270.0001000), --object(crates01), (10), createObject(3593,-2072.7509770,928.0162960,62.5737040,6.0161000,357.4217000,101.2500000), --object(la_fuckcar2), (5), createObject(5262,-2084.4096680,908.5418700,67.7212520,5.1566000,347.9679000,101.2500000), --object(las2dkwar04), (3), createObject(5262,-2098.7653810,959.9534300,72.0743410,352.2651000,354.8434000,292.5000000), --object(las2dkwar04), (4), createObject(2567,-2083.0439450,935.6265260,69.5253980,0.0000000,0.0000000,90.0000000), --object(ab_warehouseshelf), (5), createObject(3576,-2042.0402830,923.6992190,52.7597850,0.0000000,7.7349000,348.7500000), --object(dockcrates2_la), (19), createObject(3576,-2061.1845700,945.7440190,59.7239650,353.1245000,351.4056000,180.0000000), --object(dockcrates2_la), (20), createObject(3576,-2101.1960450,937.3267820,74.3136980,4.2972000,355.7028000,180.0000000), --object(dockcrates2_la), (21), createObject(12930,-2052.9350590,923.5173950,56.2435340,4.2972000,358.2811000,112.5000000), --object(sw_pipepile02), (5), createObject(5262,-2030.2122800,936.0751340,48.6620220,353.9839000,345.3896000,191.2500000), --object(las2dkwar04), (5), createObject(5262,-2100.5866700,923.1427610,77.0251770,356.5623000,16.3293000,0.0000000), --object(las2dkwar04), (6), createObject(944,-2077.7570800,939.8647460,62.8139610,0.0000000,8.5944000,0.0000000), --object(packing_carates04), (10), createObject(944,-2054.0527340,932.9673460,57.0645560,0.0000000,4.2972000,0.0000000), --object(packing_carates04), (11), createObject(944,-2040.6977540,915.9682010,52.5156940,0.0000000,6.8755000,337.5000000), --object(packing_carates04), (12), createObject(944,-2088.4106450,948.3261720,69.7854390,0.0000000,6.8755000,22.5000000), --object(packing_carates04), (13), createObject(12985,-2111.9313960,924.4412230,88.6493680,0.0000000,0.0000000,90.0000000), --object(cos_sbanksteps05), (1), createObject(3761,-2108.3083500,928.1296390,92.6313480,55.8633000,0.0000000,0.0001000), --object(industshelves), (5), createObject(9766,-2046.0820310,924.5140380,80.9075780,349.7903000,0.0000000,180.0000000), --object(scaff3_sfw), (2), createObject(3799,-2064.2714840,998.7568360,79.9221880,0.0000000,24.0642000,56.2500000), --object(acbox2_sfs), (5), createObject(3576,-2096.7038570,891.6152950,93.8553850,0.0000000,0.0000000,236.2501000), --object(dockcrates2_la), (22), createObject(18260,-2033.3713380,874.9393920,63.3496740,0.0000000,0.0000000,22.5001000), --object(crates01), (11), } for k,v in ipairs(cobras) do setElementDimension(v,5000) setElementDoubleSided ( v, true ) setObjectBreakable(v, false) end weapons = { [1] = {2, 3, 4, 5, 6, 7, 8, 9}, [2] = {22, 23, 24}, [3] = {25, 26, 27}, [4] = {28, 29, 32}, [5] = {30, 31}, [6] = {33, 34}, [7] = {35, 36, 37,38}, [8] = {16, 17, 18, 39}, [9] = {41, 42, 43}, [10] = {10, 11, 12, 13, 14, 15}, [11] = {44, 45, 46}, [12] = {40}, } restrictedWeapons = {} function onClientPreRender() if getElementData(localPlayer,"isPlayerInDM") then local weapon = getPedWeapon(localPlayer) local slot = getPedWeaponSlot(localPlayer) if (restrictedWeapons[weapon]) then local weapons = {} for i=1, 30 do if (getControlState("next_weapon")) then slot = slot + 1 else slot = slot - 1 end if (slot == 13) then slot = 0 elseif (slot == -1) then slot = 12 end local w = getPedWeapon(localPlayer, slot) if (((w ~= 0 and slot ~= 0) or (w == 0 and slot == 0)) and not restrictedWeapons[w]) then setPedWeaponSlot(localPlayer, slot) break end end end end end addEventHandler("onClientPreRender", root, onClientPreRender) function onClientPlayerWeaponFire(weapon) if (restrictedWeapons[weapon]) then return end end addEventHandler("onClientPlayerWeaponFire", localPlayer, onClientPlayerWeaponFire) ---- dont forget to make exports for these ......... function setWeaponDisabled(id, bool) if (id == 0) then return end restrictedWeapons[id] = bool end function isWeaponDisabled(id) return restrictedWeapons[id] end function setWeaponSlotDisabled(slot, bool) if (not weapons[slot]) then return end for k, v in ipairs(weapons[slot]) do setWeaponDisabled(v, bool) end end
local path = require 'lib.path' local Fonts = { path = path.prjoin('res', 'composer', 'fonts'), fonts = { card_name = {file = 'card-name.ttf', family = 'MatrixSmallCaps'}, edition = {file = 'edition.ttf', family = 'StoneSerif-Semibold'}, effect = {file = 'effect.ttf', family = 'MatrixBook'}, flavor_text = {file = 'flavor-text.ttf', family = 'ITCStoneSerifLTItalic'}, link_rating = {file = 'link-rating.otf', family = 'CodeTalker'}, monster_desc = { file = 'monster-desc.ttf', family = 'ITCStoneSerifSmallCapsBold' }, signature = {file = 'signature.ttf', family = 'Stone Serif'}, values = {file = 'values.ttf', family = 'MatrixBoldSmallCaps'} } } function Fonts.get_file(id) return path.join(Fonts.path, Fonts.fonts[id].file) end function Fonts.get_family(id, size) if size then return ('%s %s'):format(Fonts.fonts[id].family, size) else return Fonts.fonts[id].family end end return Fonts
SILE.registerCommand("color", function(options, content) local color = options.color or "black" color = SILE.colorparser(color) SILE.typesetter:pushHbox({ outputYourself= function (self, typesetter, line) SILE.outputter:setColor(color) end }); SILE.process(content) SILE.typesetter:pushHbox({ outputYourself= function (self, typesetter, line) SILE.outputter:setColor({ r = 0, g =0, b = 0}) end }); end, "Changes the active ink color to the color <color>.");
project "BulletInverseDynamics" kind "StaticLib" includedirs { "..", } files { "IDMath.cpp", "MultiBodyTree.cpp", "details/MultiBodyTreeInitCache.cpp", "details/MultiBodyTreeImpl.cpp", }
return function() local InspectAndBuyFolder = script.Parent.Parent local SetEquippedAssets = require(InspectAndBuyFolder.Actions.SetEquippedAssets) local EquippedAssets = require(script.Parent.EquippedAssets) local MOCK_ASSET = { assetId = "123" } local MOCK_ASSET2 = { assetId = "456" } local function countKeys(t) local count = 0 for _ in pairs(t) do count = count + 1 end return count end describe("SetEquippedAssets", function() it("should set a list of assets as equipped", function() local equippedAssets = { [1] = MOCK_ASSET, [2] = MOCK_ASSET2, } local newState = EquippedAssets(nil, SetEquippedAssets(equippedAssets)) expect(newState[MOCK_ASSET.assetId]).to.equal(true) expect(newState[MOCK_ASSET2.assetId]).to.equal(true) expect(newState["TEST"]).to.never.equal(true) expect(countKeys(newState)).to.equal(2) end) end) end
local ServerScriptService = game:GetService("ServerScriptService") local domainsFolder = ServerScriptService:WaitForChild("FunctionalDomains", 1) local module = { CarAndDriver = require(domainsFolder:WaitForChild("CarAndDriver", 2)), exNihilo = require(domainsFolder:WaitForChild("ExNihilo")), LightManager = require(domainsFolder:WaitForChild("LightManager")), spieler = require(domainsFolder:WaitForChild("Spieler")) } return module
DOTA2_AI_FUN_SPEW = false LinkLuaModifier("modifier_heros_bow_always_allow_attack", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_item_fun_heros_bow_debuff", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_angelic_alliance_spell_lifesteal", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_economizer_spell_lifesteal", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_heros_bow_minus_armor", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_economizer_ultimate", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_ragnarok_cleave", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_angelic_alliance_maximum_speed", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_angelic_alliance_death_drop", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_item_fun_magic_hammer_root", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_heros_bow_active", "fun_item_modifiers_lua.lua", LUA_MODIFIER_MOTION_HORIZONTAL) local function CheckStringInTable(s, t) for i = 1, #t do if s == t[i] then return true end end return false end local function ResetAbilityCharge(ability) --For if one of these abilities no longer have charges in the future local abilityName = ability:GetName() local caster = ability:GetCaster() local buff if abilityName == 'bloodseeker_rupture' then buff:SetStackCount(2) elseif abilityName == 'sniper_shrapnel' then buff = caster:FindModifierByName("modifier_sniper_shrapnel_charge_counter") if caster:FindAbilityByName("special_bonus_unique_sniper_2") and caster:FindAbilityByName("special_bonus_unique_sniper_2"):GetLevel() > 0 then buff:SetStackCount(7) else buff:SetStackCount(3) end elseif abilityName == 'gyrocopter_homing_missile' then buff = caster:FindModifierByName(ability:GetIntrinsicModifierName()) if caster:FindAbilityByName("special_bonus_unique_gyrocopter_1") and caster:FindAbilityByName("special_bonus_unique_gyrocopter_1"):GetLevel() > 0 then buff:SetStackCount(3) end elseif abilityName == 'shadow_demon_demonic_purge' then buff = caster:FindModifierByName(ability:GetIntrinsicModifierName()) if caster:HasScepter() then buff:SetStackCount(3) end elseif abilityName == 'ember_spirit_fire_remnant' then buff = caster:FindModifierByName(ability:GetIntrinsicModifierName()) buff:SetStackCount(3) elseif abilityName == 'earth_spirit_stone_caller' then buff = caster:FindModifierByName(ability:GetIntrinsicModifierName()) buff:SetStackCount(6) elseif abilityName == 'ancient_apparition_cold_feet' then buff = caster:FindModifierByName(ability:GetIntrinsicModifierName()) if caster:FindAbilityByName("special_bonus_unique_ancient_apparition_1") and caster:FindAbilityByName("special_bonus_unique_ancient_apparition_1"):GetLevel() > 0 then buff:SetStackCount(4) end elseif abilityName == 'obsidian_destroyer_astral_imprisonment' then buff = caster:FindModifierByName(ability:GetIntrinsicModifierName()) if caster:HasScepter() then buff:SetStackCount(2) end elseif abilitiesName == 'death_prophet_spirit_siphon' then buff = caster:FindModifierByName('modifier_death_prophet_spirit_siphon_charge_counter') buff:SetStackCount(ability:GetLevel()) elseif abilitiesName == 'broodmother_spin_web' then buff = caster:FindModifierByName('modifier_broodmother_spin_web_charge_counter') buff:SetStackCount(ability:GetLevel()) end end local bannedItems = { "item_black_king_bar", "item_arcane_boots", "item_hand_of_midas", "item_helm_of_the_dominator", "item_sphere", "item_necronomicon", "item_necronomicon_2", "item_necronomicon_3", "item_pipe", "item_refresher", "item_refresher_shard", "item_meteor_hammer", "item_aeon_disk", "chen_hand_of_god", "invoker_sun_strike", "spectre_haunt", "furion_wrath_of_nature", "rattletrap_rocket_flare", "zuus_thundergods_wrath", "zuus_cloud", "silencer_global_silence", "pet_summoner_critters", "ramza_arithmetician_arithmeticks_CT", "ramza_arithmetician_arithmeticks_multiple_of_5", "ramza_arithmetician_arithmeticks_multiple_of_4", "ramza_arithmetician_arithmeticks_multiple_of_3", "ramza_arithmetician_arithmeticks_level", "ramza_arithmetician_arithmeticks_exp", "ramza_geomancer_geomancy_magma_surge" } local chargedAbilities = { "bloodseeker_rupture", "sniper_shrapnel", "gyrocopter_homing_missile", "shadow_demon_demonic_purge", "ember_spirit_fire_remnant", "earth_spirit_stone_caller", "ancient_apparition_cold_feet", "obsidian_destroyer_astral_imprisonment", "broodmother_spin_web", "death_prophet_spirit_siphon"} function ResetCooldown(keys) local caster = keys.caster if not caster:HasModifier("modifier_imbalanced_economizer") then return end local bIsAA = keys.ability:GetName() == "item_fun_angelic_alliance" local abilityCount = keys.caster:GetAbilityCount() local abilityName = keys.event_ability:GetAbilityName() local allModifiers = caster:FindAllModifiers() local fileHandle -- reset ability cooldowns for i = 0, abilityCount-1 do local indexedAbility = caster:GetAbilityByIndex(i) if indexedAbility then local indexedAbilityName = indexedAbility:GetAbilityName() local indexedAbilityLevel = indexedAbility:GetLevel() if indexedAbilityLevel > 0 and CheckStringInTable(indexedAbilityName, chargedAbilities) then ResetAbilityCharge(indexedAbility) end if (not CheckStringInTable(indexedAbilityName, bannedItems) or bIsAA) and not indexedAbility:IsCooldownReady() then indexedAbility:EndCooldown() end end end -- reset item cooldowns for j,i in ipairs(tItemInventorySlotTable) do local item = caster:GetItemInSlot(i) if item then local name = item:GetAbilityName() if (not CheckStringInTable(indexedAbilityName, bannedItems) or bIsAA) and not item:IsCooldownReady() then item:EndCooldown() end end end -- if triggered ability is charged one, give an extra charge if CheckStringInTable(abilityName, chargedAbilities) then ResetAbilityCharge(keys.event_ability) end -- add a short duration modifier so the triggered ability won't go into cooldown if bIsAA then keys.ability:ApplyDataDrivenModifier(caster, caster, "modifier_item_fun_angelic_alliance_cdr_short", {duration = 0.01}) elseif not CheckStringInTable(abilityName, bannedItems) then keys.ability:ApplyDataDrivenModifier(caster, caster, "modifier_" .. keys.ability:GetName() .. "_cdr_short", {duration = 0.01}) end if fileHandle then fileHandle:close() end end local isEscutcheonRunning = false function EscutcheonReverseDamageReincarnate(keys) if isEscutcheonRunning then return end isEscutcheonRunning = true local caster = keys.caster local damage = keys.damage local ability = keys.ability local reverseChance = ability:GetSpecialValueFor("damage_reverse") local reincarnate_time = ability:GetSpecialValueFor("reincarnate_time") local respawnPosition = caster:GetAbsOrigin() local casterGold = caster:GetGold() local cooldown = ability:GetCooldown(0) --caster:SetHealth(100) if math.random() < reverseChance/100 then caster:SetHealth(caster:GetHealth() + 2*damage) end if ability:IsCooldownReady() and caster:GetHealth() == 0 and caster:GetTimeUntilRespawn() == 0 then local respawnPosition = caster:GetAbsOrigin() local casterGold = caster:GetGold() ability:StartCooldown(cooldown) caster:SetHealth(1) caster:Kill(caster, nil) caster:SetGold(casterGold, false) caster:SetTimeUntilRespawn(reincarnate_time) caster:SetRespawnPosition(respawnPosition) local model = "models/props_gameplay/tombstoneb01.vmdl" local grave = Entities:CreateByClassname("prop_dynamic") grave:SetModel(model) grave:SetAbsOrigin(respawnPosition) Timers:CreateTimer(reincarnate_time, function() grave:RemoveSelf() end) end isEscutcheonRunning = false end function EscutcheonReincarnateFinish(keys) caster = keys.caster caster:SetBuybackEnabled(true) end function OrbOfOmnipotenceStopSound(keys) StopSoundEvent("Hero_ObsidianDestroyer.AstralImprisonment", keys.target) end function EAARestoreManaRefresh(keys) local caster = keys.caster local abilityCount = keys.caster:GetAbilityCount() local bIsAA = keys.ability:GetName() == "item_fun_angelic_alliance" if bIsAA then caster:AddNewModifier(caster, keys.ability, "modifier_angelic_alliance_maximum_speed", {Duration = 0.2}) end if not caster:HasModifier("modifier_imbalanced_economizer") then return end for i = 0, abilityCount-1 do local indexedAbility = caster:GetAbilityByIndex(i) if indexedAbility and (bIsAA or not CheckStringInTable(indexedAbility, bannedItems)) then local indexedAbilityName = indexedAbility:GetAbilityName() local indexedAbilityLevel = indexedAbility:GetLevel() if indexedAbilityLevel > 0 and CheckStringInTable(indexedAbilityName, chargedAbilities) then ResetAbilityCharge(indexedAbility) end if not indexedAbility:IsCooldownReady() then indexedAbility:EndCooldown() end end end -- reset item cooldowns for j,i in ipairs(tItemInventorySlotTable) do local item = caster:GetItemInSlot(i) if item and (bIsAA or not CheckStringInTable(item, bannedItems)) and not item:IsCooldownReady() then item:EndCooldown() end end end function AngelicAllianceAngelDown(keys) ProjectileManager:ProjectileDodge(keys.caster) local target_point = keys.target_points[1] keys.caster:SetAbsOrigin(target_point) FindClearSpaceForUnit(keys.caster, target_point, false) keys.ability:ApplyDataDrivenModifier(keys.caster, keys.caster, "modifier_item_fun_angelic_alliance_out", {duration = keys.ability:GetSpecialValueFor('invulnerable_time')}) end function AASpellLifestealApply(keys) keys.ability.iCounter = keys.ability.iCounter or 0 if keys.ability.iCounter%10 == 0 then keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_angelic_alliance_spell_lifesteal", {Duration = 1.5}) keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_angelic_alliance_death_drop", {Duration = 1.5}) keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_economizer_ultimate", {Duration = 1.5}) end keys.ability.iCounter = keys.ability.iCounter+1 end function EconomizerSpellLifestealApply(keys) keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_economizer_spell_lifesteal", {Duration = 1.5}) end function HerosBowOnHit(keys) if keys.target:TriggerSpellAbsorb( keys.ability ) then return end keys.target:Purge(true, false, false, false, false) if keys.target:IsInvulnerable() or keys.target:IsMagicImmune() then return end keys.target:AddNewModifier(keys.caster, keys.ability, "modifier_item_fun_heros_bow_debuff", {Duration = keys.ability:GetSpecialValueFor("duration")}) keys.target:EmitSound("Hero_FacelessVoid.TimeLockImpact") damageTable = { victim = keys.target, attacker = keys.caster, damage = keys.ability:GetSpecialValueFor("light_arrow_damage_mult")*keys.caster:GetAttackDamage(), damage_type = DAMAGE_TYPE_PURE, ability = keys.ability } ApplyDamage(damageTable) if keys.caster:IsRangedAttacker() then keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_heros_bow_always_allow_attack", {Duration = keys.ability:GetSpecialValueFor("duration")*CalculateStatusResist(keys.target)}) ExecuteOrderFromTable({ UnitIndex = keys.caster:entindex(), OrderType = DOTA_UNIT_ORDER_ATTACK_TARGET, TargetIndex = keys.target:entindex()}) end end function HerosBowOnSpellStart(keys) if keys.caster:GetTeam() == keys.target:GetTeam() then local fSpeed = keys.ability:GetSpecialValueFor("push_speed") keys.target:AddNewModifier(keys.caster, keys.ability, "modifier_heros_bow_active", {Duration = keys.ability:GetSpecialValueFor("push_distance")/fSpeed, fSpeedHorizontal = fSpeed}) return end ProjectileManager:CreateTrackingProjectile({ Target = keys.target, Source = keys.caster, Ability = keys.ability, EffectName = "particles/econ/items/enchantress/enchantress_virgas/ench_impetus_virgas.vpcf", iMoveSpeed = keys.ability:GetSpecialValueFor("projectile_speed"), vSourceLoc= keys.caster:GetAbsOrigin(), -- Optional (HOW) bDrawsOnMinimap = false, -- Optional bDodgeable = false, -- Optional bIsAttack = false, -- Optional bVisibleToEnemies = true, -- Optional bReplaceExisting = false, -- Optional flExpireTime = GameRules:GetGameTime() + 20, -- Optional but recommended bProvidesVision = true, -- Optional iVisionRadius = 400, -- Optional iVisionTeamNumber = keys.caster:GetTeamNumber() -- Optional }) keys.caster:EmitSound("Hero_Enchantress.Impetus") end function DarksideDamage(keys) local caster = keys.caster local ability = keys.ability local radius = ability:GetSpecialValueFor("darkside_aoe") local damage = ability:GetSpecialValueFor("darkside_damage")*0.01*caster:GetMaxHealth() local selfDamage = ability:GetSpecialValueFor("darkside_life_cost")*0.01*caster:GetMaxHealth() local enemies = FindUnitsInRadius(caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, FIND_ANY_ORDER, false) local damageTable = {attacker = caster, damage = damage, damage_type = DAMAGE_TYPE_PURE, ability = ability} for _, unit in pairs(enemies) do damageTable.victim = unit ApplyDamage(damageTable) end damageTable.damage = selfDamage damageTable.victim = caster ApplyDamage(damageTable) end --[[ function MagicHammerManaBreak(keys) local attacker = keys.attacker local target = keys.target local ability = keys.ability local mana_break_damage = ability:GetSpecialValueFor("mana_break_damage") local mana_break = ability:GetSpecialValueFor("mana_break") local currentMana = target:GetMana() local damage damageTable = {attacker = attacker, victim = target, damage_type = DAMAGE_TYPE_PHYSICAL, ability = ability} if currentMana > 0 and not target:IsMagicImmune() then if currentMana > mana_break then target:SetMana(currentMana-mana_break) damageTable.damage = mana_break*mana_break_damage ApplyDamage(damageTable) else target:SetMana(0) damageTable.damage = currentMana*mana_break_damage ApplyDamage(damageTable) end end end ]]-- function MagicHammerSpellStart(keys) local iParticle = ParticleManager:CreateParticle("particles/econ/events/ti7/shivas_guard_active_ti7.vpcf", PATTACH_ABSORIGIN_FOLLOW, keys.caster) ParticleManager:SetParticleControl(iParticle, 1, Vector(900,4,350)) local tEffectedTargets = {} local iRootDuration = keys.ability:GetSpecialValueFor("root_duration") for i = 1, 26 do Timers:CreateTimer(0.1*i, function() local tTargets = FindUnitsInRadius(keys.caster:GetTeam(), keys.caster:GetAbsOrigin(), nil, 35*i, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_BASIC+DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_NONE, FIND_CLOSEST, false) AddFOWViewer(keys.caster:GetTeam(), keys.caster:GetAbsOrigin(), 900, keys.ability:GetSpecialValueFor("vision_duration"), false) for k, v in ipairs(tTargets) do if not tEffectedTargets[v:entindex()] then tEffectedTargets[v:entindex()] = true v:AddNewModifier(keys.caster, keys.ability, "modifier_item_fun_magic_hammer_root", {Duration = iRootDuration*CalculateStatusResist(v)}) v:EmitSound("Hero_NyxAssassin.ManaBurn.Target") end end if i == 26 then tEffectedTargets = nil end end) end end function MagicHammerRootBegin(keys) keys.target.iMagicHammerRootParticle = ParticleManager:CreateParticle("particles/econ/items/oracle/oracle_fortune_ti7/oracle_fortune_ti7_purge.vpcf", PATTACH_ABSORIGIN_FOLLOW, keys.target) ParticleManager:SetParticleControlEnt(keys.target.iMagicHammerRootParticle, 1, keys.target, PATTACH_POINT_FOLLOW, "attach_hitloc", keys.target:GetOrigin(), true) end function MagicHammerRootEnd(keys) if keys.target.iMagicHammerRootParticle then ParticleManager:DestroyParticle(keys.target.iMagicHammerRootParticle, true) keys.target.iMagicHammerRootParticle = nil end end function GenjiGloveMinibash(keys) if not keys.target:IsBuilding() and not keys.caster:IsIllusion() then keys.target:AddNewModifier(keys.caster, keys.ability, "modifier_bashed", {Duration = keys.ability:GetSpecialValueFor("bash_stun")*CalculateStatusResist(keys.target)}) keys.target:EmitSound("DOTA_Item.MKB.Minibash") ParticleManager:CreateParticle("particles/generic_gameplay/generic_minibash.vpcf", PATTACH_OVERHEAD_FOLLOW, keys.target) ApplyDamage({attacker = keys.caster, victim = keys.target, ability = keys.ability, damage_type = DAMAGE_TYPE_PURE, damage = keys.ability:GetSpecialValueFor("extra_damage")}) end end function BloodSwordCritApply(keys) if not keys.target:IsBuilding() and keys.target:GetTeamNumber() ~= keys.attacker:GetTeamNumber() then keys.ability:ApplyDataDrivenModifier(keys.caster, keys.caster, "modifier_item_fun_blood_sword_crit", {}) end end function BloodSwordLifestealApply(keys) local attacker = keys.attacker local target = keys.target local ability = keys.ability if not target:IsBuilding() and target:GetTeam() ~= attacker:GetTeam() and attacker:HasModifier("modifier_item_fun_blood_sword_extra_attack") then ability:ApplyDataDrivenModifier(attacker, attacker, "modifier_item_fun_blood_sword_extra_lifesteal", {duration = 0.03}) end end function BloodSwordExtraCritParticle(keys) keys.target:EmitSound("Hero_PhantomAssassin.CoupDeGrace.Arcana") local nFXIndex = ParticleManager:CreateParticle( "particles/econ/items/phantom_assassin/phantom_assassin_arcana_elder_smith/phantom_assassin_crit_arcana_swoop.vpcf", PATTACH_CUSTOMORIGIN, nil ) ParticleManager:SetParticleControlEnt( nFXIndex, 0, keys.target, PATTACH_POINT_FOLLOW, "attach_hitloc", keys.target:GetOrigin(), true ) ParticleManager:SetParticleControl( nFXIndex, 1, keys.target:GetOrigin() ) ParticleManager:SetParticleControlForward( nFXIndex, 1, -keys.attacker:GetForwardVector() ) ParticleManager:SetParticleControlEnt( nFXIndex, 10, keys.target, PATTACH_ABSORIGIN_FOLLOW, nil, keys.target:GetOrigin(), true ) ParticleManager:ReleaseParticleIndex( nFXIndex ) end function BloodSwordExtraAttack(keys) if not keys.attacker.IsExtraAttacking and not keys.attacker:IsRangedAttacker() and not keys.attacker:HasModifier("modifier_phantom_assassin_stiflingdagger_caster") then StartAnimation(keys.attacker, {duration = 0.2, activity=ACT_DOTA_ATTACK, rate=7}) Timers:CreateTimer(0.04, function () keys.attacker.IsExtraAttacking = true if not keys.target:IsBuilding() and keys.target:GetTeamNumber() ~= keys.attacker:GetTeamNumber() then keys.ability:ApplyDataDrivenModifier(keys.attacker, keys.attacker, "modifier_item_fun_blood_sword_extra_crit", {}) end keys.attacker:PerformAttack(keys.target, true, true, true, false, true, false, true) Timers:CreateTimer(0.04, function () keys.attacker.IsExtraAttacking = nil end) end) end end function HerosbowCreated(keys) if keys.caster:IsRangedAttacker() then keys.ability.sOriginalProjectileName = keys.caster:GetRangedProjectileName() keys.caster:SetRangedProjectileName('particles/units/heroes/hero_enchantress/enchantress_impetus.vpcf') end end function HerosbowDestroy(keys) if keys.caster:IsRangedAttacker() then keys.caster:SetRangedProjectileName(keys.ability.sOriginalProjectileName) end end function HerosBowReduceArmor(keys) if keys.caster:IsIllusion() then return end keys.target:AddNewModifier(keys.caster, keys.ability, "modifier_item_fun_heros_bow_armor_reduction", {Duration = keys.ability:GetSpecialValueFor("armor_reduction_duration")*CalculateStatusResist(keys.target)}) end function Economizer2UltimateSpellLifestealApply(keys) keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_economizer_spell_lifesteal", {Duration = 1.5}) keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_economizer_ultimate", {Duration = 1.5}) end function RagnarokCleaveApply(keys) if keys.ability.hModifier and not keys.ability.hModifier:IsNull() then keys.ability.hModifier:Destroy() keys.ability.hModifier = nil end if keys.caster:IsRangedAttacker() or keys.caster:IsIllusion() then return end keys.ability.hModifier = keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_ragnarok_cleave", {Duration = 1.5}) end function RagnarokMaimApply(keys) if keys.target:IsBuilding() or keys.caster:IsIllusion() then return end keys.target:EmitSound("DOTA_Item.Maim") keys.ability:ApplyDataDrivenModifier(keys.caster, keys.target, "modifier_item_fun_ragnarok_2_ultra_maim", {Duration = keys.ability:GetSpecialValueFor("maim_duration")*CalculateStatusResist(keys.target)}) end function AAChangePurchaser(keys) if keys.itemname == "item_fun_angelic_alliance" then local hPicker = EntIndexToHScript(keys.HeroEntityIndex) local hItem = EntIndexToHScript(keys.ItemEntityIndex) if not hPicker.bIsPick then hPicker.bIsPick = true hItem:RemoveSelf() hPicker:AddItemByName("item_fun_angelic_alliance") Timers:CreateTimer(0.04, function () hPicker.bIsPick = nil end) end end end ListenToGameEvent("dota_item_picked_up", AAChangePurchaser, nil) function TerraBladeProjectileHit(keys) if keys.caster:IsIllusion() then return end ApplyDamage({ damage_type=DAMAGE_TYPE_PURE, damage = keys.caster:GetAverageTrueAttackDamage(keys.caster), attacker = keys.caster, victim = keys.target, ability = keys.ability, damage_flags = DOTA_DAMAGE_FLAG_NO_SPELL_AMPLIFICATION, }) end function BloodSwordApplySatanic(keys) keys.ability.hSatanicModifier = keys.caster:AddNewModifier(keys.caster, keys.ability, "modifier_item_satanic", {}) end function BloodSwordRemoveSatanic(keys) keys.ability.hSatanicModifier:Destroy() keys.ability.hSatanicModifier = nil end function GetFunItems(keys) print('has fun item!') keys.caster:FindModifierByName('modifier_plant_tree').bHasFunItem = true end function BloodSwordActivated(keys) keys.ability:ApplyDataDrivenModifier(keys.caster, keys.caster, 'modifier_item_fun_blood_sword_extra_attack', {Duration = keys.ability:GetSpecialValueFor('duration')}) keys.caster:EmitSound('DOTA_Item.Satanic.Activate') end function OrbOfOmnipotenceStart(keys) keys.caster:EmitSound('Hero_ObsidianDestroyer.AstralImprisonment.Cast') local iParticle = ParticleManager:CreateParticle('particles/units/heroes/hero_obsidian_destroyer/obsidian_destroyer_sanity_eclipse_area.vpcf', PATTACH_ABSORIGIN, keys.caster) local iRadius = keys.ability:GetSpecialValueFor('stop_aoe') ParticleManager:SetParticleControl(iParticle, 1, Vector(iRadius, 0, 0)) ParticleManager:SetParticleControl(iParticle, 2, Vector(iRadius, 0, 0)) ParticleManager:SetParticleControl(iParticle, 3, Vector(iRadius, 0, 0)) end function MagicHammerManaBreakCastRangeApply(keys) keys.caster:AddNewModifier(keys.caster, keys.ability, 'modifier_magic_hammer_mana_break',{Duration = 1}) keys.caster:AddNewModifier(keys.caster, keys.ability, 'modifier_special_bonus_cast_range',{Duration = 1}) end
-- Simple MV shell command. -- local args = {...} if #args < 2 then error("usage: mv SOURCE DESTINATION") return false end fs.move(shell.resolvePath(args[1]), shell.resolvePath(args[2]))
require 'nn' require 'image' require 'csvigo' require 'hdf5' require 'cudnn' require 'cunn' require 'cutorch' local function _read_data_handle( _filename ) -- the file is a csv file local csv_file_handle = csvigo.load({path = _filename, mode = 'large'}) local _n_lines = #csv_file_handle; local _data ={} local _line_idx = 2 --skip the first line local _sample_idx = 0 while _line_idx <= _n_lines do _sample_idx = _sample_idx + 1 _data[_sample_idx] = {}; _data[_sample_idx].img_filename = csv_file_handle[ _line_idx ][ 1 ] _data[_sample_idx].n_point = tonumber(csv_file_handle[ _line_idx ][ 3 ]) _data[_sample_idx].y_A = {} _data[_sample_idx].y_B = {} _data[_sample_idx].x_A = {} _data[_sample_idx].x_B = {} _data[_sample_idx].ordianl_relation = {} _line_idx = _line_idx + 1 for point_idx = 1 , _data[_sample_idx].n_point do _data[_sample_idx].y_A[point_idx] = tonumber(csv_file_handle[ _line_idx ][ 1 ]) _data[_sample_idx].x_A[point_idx] = tonumber(csv_file_handle[ _line_idx ][ 2 ]) _data[_sample_idx].y_B[point_idx] = tonumber(csv_file_handle[ _line_idx ][ 3 ]) _data[_sample_idx].x_B[point_idx] = tonumber(csv_file_handle[ _line_idx ][ 4 ]) -- Important! if csv_file_handle[ _line_idx ][ 5 ] == '>' then _data[_sample_idx].ordianl_relation[point_idx] = 1; elseif csv_file_handle[ _line_idx ][ 5 ] == '<' then _data[_sample_idx].ordianl_relation[point_idx] = -1; elseif csv_file_handle[_line_idx][ 5 ] == '=' then -- important! _data[_sample_idx].ordianl_relation[point_idx] = 0; end _line_idx = _line_idx + 1 end end return _sample_idx, _data; end local function _evaluate_correctness_our(_batch_output, _batch_target, WKDR, WKDR_eq, WKDR_neq) local n_gt_correct = torch.Tensor(n_thresh):fill(0); local n_gt = 0; local n_lt_correct = torch.Tensor(n_thresh):fill(0); local n_lt = 0; local n_eq_correct = torch.Tensor(n_thresh):fill(0); local n_eq = 0; for point_idx = 1, _batch_target.n_point do x_A = _batch_target.x_A[point_idx] y_A = _batch_target.y_A[point_idx] x_B = _batch_target.x_B[point_idx] y_B = _batch_target.y_B[point_idx] z_A = _batch_output[{1, 1, y_A, x_A}] z_B = _batch_output[{1, 1, y_B, x_B}] ground_truth = _batch_target.ordianl_relation[point_idx]; -- the ordianl_relation is in the form of 1 and -1 for thresh_idx = 1, n_thresh do local _classify_res = 1; if z_A - z_B > thresh[thresh_idx] then _classify_res = 1 elseif z_A - z_B < -thresh[thresh_idx] then _classify_res = -1 elseif z_A - z_B <= thresh[thresh_idx] and z_A - z_B >= -thresh[thresh_idx] then _classify_res = 0; end if _classify_res == 0 and ground_truth == 0 then n_eq_correct[thresh_idx] = n_eq_correct[thresh_idx] + 1; elseif _classify_res == 1 and ground_truth == 1 then n_gt_correct[thresh_idx] = n_gt_correct[thresh_idx] + 1; elseif _classify_res == -1 and ground_truth == -1 then n_lt_correct[thresh_idx] = n_lt_correct[thresh_idx] + 1; end end if ground_truth > 0 then n_gt = n_gt + 1; elseif ground_truth < 0 then n_lt = n_lt + 1; elseif ground_truth == 0 then n_eq = n_eq + 1; end end for i = 1 , n_thresh do WKDR[{i}] = 1 - (n_eq_correct[i] + n_lt_correct[i] + n_gt_correct[i]) / (n_eq + n_lt + n_gt) WKDR_eq[{i}] = 1 - n_eq_correct[i] / n_eq WKDR_neq[{i}] = 1 - (n_lt_correct[i] + n_gt_correct[i]) / (n_lt + n_gt) end end function crop_resize_input(img) local crop = cmd_params.crop local img_original_height = img:size(2) local img_original_width = img:size(3) local cropped_input = img[{{},{crop, img_original_height-crop}, {crop, img_original_width - crop}}] return image.scale(cropped_input,network_input_width ,network_input_height) end function inpaint_pad_output_our(output, img_original_width, img_original_height) local crop = cmd_params.crop local resize_height = img_original_height - 2*crop + 1 local resize_width = img_original_width - 2*crop + 1 local resize_output = image.scale( output[{1,1,{}}]:double(), resize_width, resize_height) local padded_output = torch.Tensor(1, img_original_height, img_original_width); padded_output[{{},{crop, img_original_height-crop}, {crop, img_original_width - crop}}]:copy(resize_output) -- pad left and right for i = 1 , crop do padded_output[{1,{crop, img_original_height - crop}, i}]:copy(resize_output[{{},1}]) padded_output[{1,{crop, img_original_height - crop}, img_original_width - i + 1}]:copy(resize_output[{{},resize_width}]) end -- pad top and down for i = 1 , crop do padded_output[{1,i, {}}]:copy(padded_output[{1,crop,{}}]) padded_output[{1,img_original_height - i + 1, {}}]:copy(padded_output[{1,resize_height + crop - 1,{}}]) end return padded_output end function metric_error(gtz, z) local fmse = torch.mean(torch.pow(gtz - z, 2)) local fmselog = torch.mean(torch.pow(torch.log(gtz) - torch.log(z), 2)) local flsi = torch.mean( torch.pow(torch.log(z) - torch.log(gtz) + torch.mean(torch.log(gtz) - torch.log(z)) , 2 ) ) local fabsrel = torch.mean( torch.cdiv(torch.abs( z - gtz ), gtz )) local fsqrrel = torch.mean( torch.cdiv(torch.pow( z - gtz ,2), gtz )) return fmse, fmselog, flsi, fabsrel, fsqrrel end function normalize_output_depth_with_NYU_mean_std( input ) local std_of_NYU_training = 0.6148231626 local mean_of_NYU_training = 2.8424594402 local transformed_weifeng_z = input:clone() transformed_weifeng_z = transformed_weifeng_z - torch.mean(transformed_weifeng_z); transformed_weifeng_z = transformed_weifeng_z / torch.std(transformed_weifeng_z); transformed_weifeng_z = transformed_weifeng_z * std_of_NYU_training; transformed_weifeng_z = transformed_weifeng_z + mean_of_NYU_training; -- remove and replace the depth value that are negative if torch.sum(transformed_weifeng_z:lt(0)) > 0 then -- fill it with the minimum of the non-negative plus a eps so that it won't be 0 transformed_weifeng_z[transformed_weifeng_z:lt(0)] = torch.min(transformed_weifeng_z[transformed_weifeng_z:gt(0)]) + 0.00001 end return transformed_weifeng_z end ----------------------------------------------[[ --[[ Main Entry ]]-- ------------------------------------------------ cmd = torch.CmdLine() cmd:text('Options') cmd:option('-num_iter',1,'number of training iteration') cmd:option('-prev_model_file','','Absolute / relative path to the previous model file. Resume training from this file') cmd:option('-vis', false, 'visualize output') cmd:option('-output_folder','./output_imgs','image output folder') cmd:option('-mode','validate','mode: test or validate') cmd:option('-valid_set', '45_NYU_validate_imgs_points_resize_240_320.csv', 'validation file name'); cmd:option('-test_set','654_NYU_MITpaper_test_imgs_orig_size_points.csv', 'test file name'); cmd:option('-crop',10, 'cropping size') cmd:option('-thresh',-1, 'threhold for determing WKDR. Obtained from validations set.') cmd_params = cmd:parse(arg) if cmd_params.mode == 'test' then csv_file_name = '../../data/' .. cmd_params.test_set -- test set elseif cmd_params.mode == 'validate' then csv_file_name = '../../data/' .. cmd_params.valid_set -- validation set end preload_t7_filename = string.gsub(csv_file_name, "csv", "t7") f=io.open(preload_t7_filename,"r") if f == nil then print('loading csv file...') n_sample, data_handle = _read_data_handle( csv_file_name ) torch.save(preload_t7_filename, data_handle) else io.close(f) print('loading pre load t7 file...') data_handle = torch.load(preload_t7_filename) n_sample = #data_handle end print("Hyper params: ") print("csv_file_name:", csv_file_name); print("N test samples:", n_sample); n_iter = math.min( n_sample, cmd_params.num_iter ) print(string.format('n_iter = %d',n_iter)) -- Load the model prev_model_file = cmd_params.prev_model_file model = torch.load(prev_model_file) model:evaluate() print("Model file:", prev_model_file) network_input_height = 240 network_input_width = 320 _batch_input_cpu = torch.Tensor(1,3,network_input_height,network_input_width) n_thresh = 140; thresh = torch.Tensor(n_thresh); for i = 1, n_thresh do thresh[i] = 0.1 + i * 0.01; end local WKDR = torch.Tensor(n_iter, n_thresh):fill(0) local WKDR_eq = torch.Tensor(n_iter, n_thresh):fill(0) local WKDR_neq = torch.Tensor(n_iter, n_thresh):fill(0) local fmse = torch.Tensor(n_iter):fill(0) local fmselog = torch.Tensor(n_iter):fill(0) local flsi = torch.Tensor(n_iter):fill(0) local fabsrel = torch.Tensor(n_iter):fill(0) local fsqrrel = torch.Tensor(n_iter):fill(0) ------------------------------- --[[ The validation is done without cropping The test is done with cropping ]] ------------------------------- for i = 1, n_iter do -- read image, scale it to the input size local img = image.load(data_handle[i].img_filename) local img_original_height = img:size(2) local img_original_width = img:size(3) if cmd_params.mode == 'test' then -- only crop it when testing, because there is a white boundary, also need to resize it to network input size _batch_input_cpu[{1,{}}]:copy( crop_resize_input(img) ) elseif cmd_params.mode == 'validate' then -- no need to crop it, just resize it, because there is no white boundary in the validation image! _batch_input_cpu[{1,{}}]:copy( image.scale(img,network_input_width ,network_input_height)) end local _single_data = {}; _single_data[1] = data_handle[i] -- forward local batch_output = model:forward(_batch_input_cpu:cuda()); cutorch.synchronize() local temp = batch_output if torch.type(batch_output) == 'table' then batch_output = batch_output[1] end local original_size_output = torch.Tensor(1,1,img_original_height, img_original_width) if cmd_params.mode == 'test' then --image.scale(src, width, height, [mode]) Scale it to the original size! original_size_output[{1,1,{}}]:copy( inpaint_pad_output_our(batch_output, img_original_width, img_original_height) ) -- evaluate on the original size! _evaluate_correctness_our(original_size_output, _single_data[1], WKDR[{i,{}}], WKDR_eq[{i,{}}], WKDR_neq[{i,{}}]); local gtz_h5_handle = hdf5.open(paths.dirname(data_handle[i].img_filename) .. '/' .. i ..'_depth.h5', 'r') local gtz = gtz_h5_handle:read('/depth'):all() gtz_h5_handle:close() assert(gtz:size(1) == 480) assert(gtz:size(2) == 640) -- transform the output depth with training mean and std transformed_weifeng_z_orig_size = normalize_output_depth_with_NYU_mean_std( original_size_output[{1,1,{}}] ) -- evaluate the data at the cropped area local metric_test_crop = 16 transformed_weifeng_z_orig_size = transformed_weifeng_z_orig_size:sub(metric_test_crop,img_original_height-metric_test_crop,metric_test_crop,img_original_width-metric_test_crop) gtz = gtz:sub(metric_test_crop,img_original_height-metric_test_crop,metric_test_crop,img_original_width-metric_test_crop) -- metric error fmse[i], fmselog[i], flsi[i], fabsrel[i], fsqrrel[i] = metric_error(gtz, transformed_weifeng_z_orig_size) elseif cmd_params.mode == 'validate' then -- resize it to the original input size original_size_output[{1,1,{}}]:copy( image.scale(batch_output[{1,1,{}}]:double(), img_original_width ,img_original_height) ) -- no need to perform padding because the input is not cropped! _evaluate_correctness_our(original_size_output, _single_data[1], WKDR[{i,{}}], WKDR_eq[{i,{}}], WKDR_neq[{i,{}}]); end collectgarbage() collectgarbage() collectgarbage() collectgarbage() collectgarbage() if cmd_params.vis then local local_image = torch.Tensor(1,img_original_height,img_original_width) local local_image2 = torch.Tensor(3,img_original_height,img_original_width) local output_image = torch.Tensor(3, img_original_height,img_original_width * 2) local_image:copy(original_size_output:double()) local_image = local_image:add( - torch.min(local_image) ) local_image = local_image:div( torch.max(local_image:sub(1,-1, 20, img_original_height - 20, 20, img_original_width - 20)) ) output_image[{1,{1,img_original_height},{img_original_width + 1,img_original_width * 2}}]:copy(local_image) output_image[{2,{1,img_original_height},{img_original_width + 1,img_original_width * 2}}]:copy(local_image) output_image[{3,{1,img_original_height},{img_original_width + 1,img_original_width * 2}}]:copy(local_image) local_image2:copy(image.load(data_handle[i].img_filename)) output_image[{{1},{1,img_original_height},{1,img_original_width}}]:copy(local_image2[{1,{}}]) output_image[{{2},{1,img_original_height},{1,img_original_width}}]:copy(local_image2[{2,{}}]) output_image[{{3},{1,img_original_height},{1,img_original_width}}]:copy(local_image2[{3,{}}]) image.save(cmd_params.output_folder.. '/' .. i .. '.png', output_image) end end -- get averaged WKDR and so on WKDR = torch.mean(WKDR,1) WKDR_eq = torch.mean(WKDR_eq,1) WKDR_neq = torch.mean(WKDR_neq,1) overall_summary = torch.Tensor(n_thresh, 4) -- find the best threshold on the validation set according to our criteria, and use it as the threshold on the test set. min_max = 100; min_max_i = 1; for i = 1 , n_thresh do overall_summary[{i,1}] = thresh[i] overall_summary[{i,2}] = WKDR[{1,i}] overall_summary[{i,3}] = WKDR_eq[{1,i}] overall_summary[{i,4}] = WKDR_neq[{1,i}] if math.max(WKDR_eq[{1,i}], WKDR_neq[{1,i}]) < min_max then min_max = math.max(WKDR_eq[{1,i}], WKDR_neq[{1,i}]) min_max_i = i; end end -- print the final output if cmd_params.thresh < 0 then print(overall_summary) print("====================================================================") if min_max_i > 1 then if min_max_i < n_thresh then print(overall_summary[{{min_max_i-1,min_max_i+1},{}}]) end end else print("Result:\n") for i = 1 , n_thresh do if overall_summary[{i,1}] == cmd_params.thresh then print(" Thresh\tWKDR\tWKDR_eq\tWKDR_neq") print(overall_summary[{{i},{}}]) end end end if cmd_params.mode == 'test' then print("====================================================================") print(string.format('rmse:\t%f',math.sqrt(torch.mean(fmse)))) print(string.format('rmselog:%f',math.sqrt(torch.mean(fmselog)))) print(string.format('lsi:\t%f',math.sqrt(torch.mean(flsi)))) print(string.format('absrel:\t%f',torch.mean(fabsrel))) print(string.format('sqrrel:\t%f',torch.mean(fsqrrel))) end
local events = {} local commands = {} local timers = {} local binds = {} local xmlFiles = {} local loadedDff = {} local loadedCol = {} local checkArguments_ = checkArguments SandboxHooks = {} function _unloadEverything() -- unload all events for _, eventInfo in ipairs(events) do removeEventHandler(unpack(eventInfo)) end -- unload all commands for _, commandInfo in ipairs(commands) do removeCommandHandler(unpack(commandInfo)) end -- destroy all timers for _, timer in ipairs(timers) do if (isTimer(timer)) then killTimer(timer) end end -- unload all binds for _, bindInfo in ipairs(binds) do unbindKey(unpack(bindInfo)) end -- unload all xml files for _, xml in ipairs(xmlFiles) do xmlUnloadFile(xml) end -- restore all models for modelId, _ in pairs(loadedDff) do engineRestoreModel(modelId) end -- restore all collisions for modelId, _ in pairs(loadedCol) do engineRestoreCOL(modelId) end -- reset variables events = {} commands = {} timers = {} binds = {} xmlFiles = {} loadedDff = {} loadedCol = {} end -- can be replaced with getTimers() function SandboxHooks.setTimer(...) local timer = setTimer(...) if (timer) then table.insert(timers, timer) return end return false end function SandboxHooks.setElementData(element, key, value) -- don't sync data setElementData(element, key, value, false) end function SandboxHooks.addEventHandler(eventName, attachedToElement, handler, ...) if (not checkArguments_("suf", eventName, attachedToElement, handler)) then return false end -- TODO: check if eventHandler is already added to prevent errors from being logged if (addEventHandler(eventName, attachedToElement, handler, ...)) then table.insert(events, {eventName, attachedToElement, handler}) return true end return false end function SandboxHooks.removeEventHandler(eventName, attachedToElement, handler) if (not checkArguments_("suf", eventName, attachedToElement, handler)) then return false end if (removeEventHandler(eventName, attachedToElement, handler)) then for i, eventInfo in ipairs(binds) do if (eventName == eventInfo[1] and attachedToElement == eventInfo[2] and handler == eventInfo[3]) then table.remove(events, i) break end end return true end return false end function SandboxHooks.addCommandHandler(commandName, handler, ...) if (not checkArguments_("sf", commandName, handler)) then return false end if (addCommandHandler(commandName, handler, ...)) then table.insert(commands, {commandName, handler}) return true end return false end function SandboxHooks.removeCommandHandler(commandName, handler) if (not checkArguments_("sf", commandName, handler)) then return false end if (removeCommandHandler(commandName, handler)) then for i, commandInfo in ipairs(commands) do if (commandName == commandInfo[1] and handler == commandInfo[2]) then table.remove(commands, i) break end end return true end return false end function SandboxHooks.bindKey(key, keyState, handler, ...) if (not checkArguments_("ss", key, keyState)) then return false end if (type(handler) ~= "function" and type(handler) ~= "string") then return false end if (exports.ddc_core:table_find(g_Sandbox:getReservedBinds(), key:lower())) then return false end if (bindKey(key, keyState, handler, ...)) then table.insert(binds, {key, keyState, handler}) return true end return false end function SandboxHooks.unbindKey(key, keyState, handler) if (not checkArguments_("ss", key, keyState)) then return false end if (type(handler) ~= "function" and type(handler) ~= "string") then return false end if (exports.ddc_core:table_find(g_Sandbox:getReservedBinds(), key:lower())) then return false end if (unbindKey(key, keyState, handler)) then for i, bindInfo in ipairs(binds) do if (key == bindInfo[1] and keyState == bindInfo[2] and handler == bindInfo[3]) then table.remove(binds, i) break end end return true end return false end -- does not allow remote paths function SandboxHooks.playSound(filePath, isLooped, isThrottled) if (not checkArguments_("s", filePath)) then return false end local filePath = tostring(g_Sandbox:getDownloadUrl())..tostring(g_Sandbox:getResourceName()).."/"..tostring(filePath) local sound = playSound(filePath, isLooped, isThrottled) if (sound) then setElementParent(sound, g_Sandbox:getMapElement()) return sound end return false end -- does not allow remote paths function SandboxHooks.playSound3D(filePath, x, y, z, ...) if (not checkArguments_("siii", filePath, x, y, z)) then return false end local filePath = tostring(g_Sandbox:getDownloadUrl())..tostring(g_Sandbox:getResourceName()).."/"..tostring(filePath) local sound = playSound3D(filePath, x, y, z, ...) if (sound) then setElementParent(sound, g_Sandbox:getMapElement()) return sound end return false end function SandboxHooks.createColCircle(x, y, z, radus) if (not checkArguments_("iiii", x, y, z, radus)) then return false end local colshape = createColCircle(x, y, z, radus) if (colshape) then setElementParent(colshape, g_Sandbox:getMapElement()) setElementDimension(colshape, getElementDimension(localPlayer)) return colshape end return false end function SandboxHooks.createColCuboid(x, y, z, width, depth, height) if (not checkArguments_("iiiiii", x, y, z, width, depth, height)) then return false end local colshape = createColCuboid(x, y, z, width, depth, height) if (colshape) then setElementParent(colshape, g_Sandbox:getMapElement()) setElementDimension(colshape, getElementDimension(localPlayer)) return colshape end return false end function SandboxHooks.createColPolygon(x, y, x2, y2, x3, y3, x4, y4, ...) if (not checkArguments_("iiiiiiii", x, y, z, width, depth, height)) then return false end local colshape = createColPolygon(x, y, x2, y2, x3, y3, x4, y4, ...) if (colshape) then setElementParent(colshape, g_Sandbox:getMapElement()) setElementDimension(colshape, getElementDimension(localPlayer)) return colshape end return false end function SandboxHooks.createColRectangle(x, y, width, height) if (not checkArguments_("iiii", x, y, width, height)) then return false end local colshape = createColRectangle(x, y, width, height) if (colshape) then setElementParent(colshape, g_Sandbox:getMapElement()) setElementDimension(colshape, getElementDimension(localPlayer)) return colshape end return false end function SandboxHooks.createColSphere(x, y, z, radus) if (not checkArguments_("iiii", x, y, z, radus)) then return false end local colshape = createColSphere(x, y, z, radus) if (colshape) then setElementParent(colshape, g_Sandbox:getMapElement()) setElementDimension(colshape, getElementDimension(localPlayer)) return colshape end return false end function SandboxHooks.createColTube(x, y, z, radus, height) if (not checkArguments_("iiiii", x, y, z, radus, height)) then return false end local colshape = createColTube(x, y, z, radus, height) if (colshape) then setElementParent(colshape, g_Sandbox:getMapElement()) setElementDimension(colshape, getElementDimension(localPlayer)) return colshape end return false end function SandboxHooks.dxCreateFont(filePath, ...) local filePath = g_Sandbox:getFileHashFromName(filePath) local font = filePath and dxCreateFont(filePath, ...) or false if (font) then setElementParent(font, g_Sandbox:getMapElement()) return font end return false end function SandboxHooks.dxCreateShader(filePath, ...) local filePath = g_Sandbox:getFileHashFromName(filePath) local shader, technique = false, false if (filePath) then shader, technique = dxCreateShader(filePath, ...) if (shader) then setElementParent(shader, g_Sandbox:getMapElement()) end end return shader, technique end function SandboxHooks.dxCreateTexture(filePath, ...) local filePath = g_Sandbox:getFileHashFromName(filePath) local texture = filePath and dxCreateTexture(filePath, ...) or false if (texture) then setElementParent(texture, g_Sandbox:getMapElement()) return texture end return false end function SandboxHooks.dxDrawImage(x, y, width, height, filePath, ...) if (not checkArguments_("iiii", x, y, width, height)) then return false end if (type(filePath) ~= "number" or type(filePath) ~= "userdata") then return false end local filePath = g_Sandbox:getFileHashFromName(filePath) or filePath return dxDrawImage(x, y, width, height, filePath, ...) end function SandboxHooks.dxDrawImageSection(x, y, width, height, u, v, uSze, vSze, filePath, ...) if (not checkArguments_("iiiiiiii", x, y, width, height, u, v, uSze, vSze)) then return false end if (type(filePath) ~= "number" or type(filePath) ~= "userdata") then return false end local filePath = g_Sandbox:getFileHashFromName(filePath) or filePath return dxDrawImageSection(x, y, width, height, u, v, uSze, vSze, filePath, ...) end function SandboxHooks.createEffect(...) local effect = createEffect(...) if (effect) then setElementParent(effect, g_Sandbox:getMapElement()) return effect end return false end function SandboxHooks.createElement(...) local element = createElement(...) if (element) then setElementParent(element, g_Sandbox:getMapElement()) return element end return false end function SandboxHooks.engineLoadCOL(filePath) local filePath = g_Sandbox:getFileHashFromName(filePath) local col = filePath and engineLoadCOL(filePath) or false if (col) then setElementParent(col, g_Sandbox:getMapElement()) return col end return false end function SandboxHooks.engineReplaceCOL(col, modelId) if (not col or type(col) ~= "userdata") then return false end if (engineReplaceCOL(col, modelId)) then loadedCol[modelId] = true return true end return false end function SandboxHooks.engineLoadDFF(filePath) local filePath = g_Sandbox:getFileHashFromName(filePath) local dff = filePath and engineLoadDFF(filePath) or false if (dff) then setElementParent(dff, g_Sandbox:getMapElement()) return dff end return false end function SandboxHooks.engineReplaceModel(dff, modelId, useAlpha) if (not dff or type(dff) ~= "userdata") then return false end if (engineReplaceModel(dff, modelId, useAlpha)) then loadedDff[modelId] = true return true end return false end function SandboxHooks.engineLoadTXD(filePath, ...) local filePath = g_Sandbox:getFileHashFromName(filePath) local txd = filePath and engineLoadTXD(filePath, ...) or false if (txd) then setElementParent(txd, g_Sandbox:getMapElement()) return txd end return false end function SandboxHooks.engineImportTXD(txd, modelId) if (not txd or type(txd) ~= "userdata") then return false end return engineImportTXD(txd, modelId) end function SandboxHooks.createMarker(...) local marker = createMarker(...) if (marker) then setElementParent(marker, g_Sandbox:getMapElement()) setElementDimension(marker, getElementDimension(localPlayer)) return marker end return false end function SandboxHooks.createObject(...) local object = createObject(...) if (object) then setElementParent(object, g_Sandbox:getMapElement()) setElementDimension(object, getElementDimension(localPlayer)) return object end return false end function SandboxHooks.createPed(...) local ped = createPed(...) if (ped) then setElementParent(ped, g_Sandbox:getMapElement()) setElementDimension(ped, getElementDimension(localPlayer)) return ped end return false end function SandboxHooks.createPickup(...) local pickup = createPickup(...) if (pickup) then setElementParent(pickup, g_Sandbox:getMapElement()) setElementDimension(pickup, getElementDimension(localPlayer)) return pickup end return false end function SandboxHooks.createLight(...) local light = createLight(...) if (light) then setElementParent(light, g_Sandbox:getMapElement()) setElementDimension(light, getElementDimension(localPlayer)) return light end return false end function SandboxHooks.createSearchLight(...) local searchLight = createSearchLight(...) if (searchLight) then setElementParent(searchLight, g_Sandbox:getMapElement()) setElementDimension(searchLight, getElementDimension(localPlayer)) return searchLight end return false end function SandboxHooks.createVehicle(...) local vehicle = createVehicle(...) if (vehicle) then setElementParent(vehicle, g_Sandbox:getMapElement()) setElementDimension(vehicle, getElementDimension(localPlayer)) return vehicle end return false end function SandboxHooks.createWater(...) local water = createWater(...) if (water) then setElementParent(water, g_Sandbox:getMapElement()) setElementDimension(water, getElementDimension(localPlayer)) return water end return false end function SandboxHooks.xmlLoadFile(filePath) local filePath = g_Sandbox:getFileHashFromName(filePath) or false if (not filePath) then return false end local xml = xmlLoadFile(filePath) if (xml) then table.insert(xmlFiles, xml) return xml end return false end function SandboxHooks.xmlUnloadFile(xml) if (xmlUnloadFile(xml)) then for i, xml_ in ipairs(xmlFiles) do if (xml_ == xml) then table.remove(xmlFiles, i) break end end return true end return false end
Abilities = { HyperspaceInhibitor = { colour = {1,0,.7,1}, }, Hyperspace = { colour = {1,0,1,1}, }, Cloak = { colour = {0.4,0.5,1,0.9,}, }, DefenseField = { colour = {0,1,1,1}, }, } Multipliers = { SensorDistortion = { colour = {1,1,1,1}, }, WeaponAccuracy = { colour = {1,0,.7,1}, }, WeaponDamage = { colour = {1,0,0,1}, }, Speed = { colour = {1,1,1,1}, }, ResourceCollectionRate = { colour = {1,1,0,1}, }, HealthRegenerationRate = { colour = {1,1,1,1}, }, CloakingStrength = { colour = {0.4,0.5,1,0.9,}, }, MaxShield = { colour = {0.4,1,0.5,0.9}, }, ResourceCapacity = { colour = {1,.7,0,1}, }, }
local function register_mappings(mappings, default_options) for mode, mode_mappings in pairs(mappings) do for _, mapping in pairs(mode_mappings) do local options = #mapping == 3 and table.remove(mapping) or default_options local prefix, cmd = unpack(mapping) pcall(vim.api.nvim_set_keymap, mode, prefix, cmd, options) end end end -- NOTE: <leader> prefixed mappings are in whichkey-settings.lua local mappings = { i = { -- Terminal window navigation { "<C-h>", "<C-\\><C-N><C-w>h" }, { "<C-j>", "<C-\\><C-N><C-w>j" }, { "<C-l>", "<C-\\><C-N><C-w>l" }, { "<C-k>", "<C-\\><C-N><C-w>k" }, -- moving text { "∆", "<ESC>:m .+1<CR>==gi" }, -- <Option-j> { "˚", "<ESC>:m .-2<CR>==gi" }, -- <Option-k> }, n = { -- Normal mode -- Better window movement { "<C-h>", "<C-w>h", { silent = true } }, { "<C-j>", "<C-w>j", { silent = true } }, { "<C-k>", "<C-w>k", { silent = true } }, { "<C-l>", "<C-w>l", { silent = true } }, -- Resize with arrows { "<C-Up>", ":resize -2<CR>", { silent = true } }, { "<C-Down>", ":resize +2<CR>", { silent = true } }, { "<C-Left>", ":vertical resize -2<CR>", { silent = true } }, { "<C-Right>", ":vertical resize +2<CR>", { silent = true } }, -- escape clears highlighting { "<ESC>", ":noh<CR><ESC>" }, -- hop words { "s", ":HopWord<CR>" }, { "S", ":HopLine<CR>" }, -- yank to end of line on Y { "Y", "y$" }, -- lsp mappings { "K", "<CMD>lua vim.lsp.buf.hover()<CR>" }, { "<C-k>", "<CMD>lua vim.lsp.buf.signature_help()<CR>" }, { "[d", "<CMD>lua vim.diagnostic.goto_prev({ float = { border = 'rounded' }})<CR>" }, { "]d", "<CMD>lua vim.diagnostic.goto_next({ float = { border = 'rounded' }})<CR>" }, { "gD", "<CMD>lua vim.lsp.buf.declaration()<CR>" }, { "gd", "<CMD>lua vim.lsp.buf.definition()<CR>" }, { "gr", "<CMD>lua vim.lsp.buf.references()<CR>" }, { "gi", "<CMD>lua vim.lsp.buf.implementation()<CR>" }, }, t = { -- Terminal mode -- Terminal window navigation { "<C-h>", "<C-\\><C-N><C-w>h" }, { "<C-j>", "<C-\\><C-N><C-w>j" }, { "<C-k>", "<C-\\><C-N><C-w>k" }, { "<C-l>", "<C-\\><C-N><C-w>l" }, -- map escape to normal mode in terminal { "<Esc>", [[ <C-\><C-n> ]] }, { "jj", [[ <C-\><C-n> ]] }, }, v = { -- Visual/Select mode -- Better indenting { "<", "<gv" }, { ">", ">gv" }, -- hop words { "s", "<CMD>lua require'hop'.hint_words()<CR>" }, -- moving text { "∆", ":m '>+1<CR>gv=gv" }, -- <Option-j> { "˚", ":m '<-2<CR>gv=gv" }, -- <Option-k> }, x = {}, } register_mappings(mappings, { silent = true, noremap = true }) -- hop in motion local actions = { "d", "c", "<", ">", "y" } for _, a in ipairs(actions) do vim.api.nvim_set_keymap("n", a .. "s", a .. "<CMD>lua require'hop'.hint_char1()<CR>", {}) end vim.cmd([[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]) vim.cmd([[ augroup format_on_save autocmd! autocmd BufWritePre * lua vim.lsp.buf.formatting_sync() augroup end ]])
local stageselectstate = states.state:extend() function stageselectstate:begin() loader.load("assets/misc/select.png", "mugshots", "texture") loader.load("assets/sfx/cursor_move.ogg", "cursor_move", "sound") loader.load("assets/sfx/selected.ogg", "selected", "sound") megautils.loadStage(self, "assets/maps/stage_select.lua") megautils.add(stageSelect()) megautils.add(fade(false):setAfter(fade.remove)) view.x, view.y = 0, 0 mmMusic.playFromFile("assets/sfx/music/select_loop.ogg", "assets/sfx/music/select_intro.ogg") end function stageselectstate:update(dt) megautils.update(self, dt) end function stageselectstate:stop() megautils.unload(self) end function stageselectstate:draw() megautils.draw(self) end megautils.cleanFuncs["unload_stageselect"] = function() stageSelect = nil megautils.cleanFuncs["unload_stageselect"] = nil end stageSelect = entity:extend() function stageSelect:new() stageSelect.super.new(self) self.transform.y = 8 self.transform.x = 24 self:addToGroup("freezable") self.quad = love.graphics.newQuad(81, 296, 15, 7, 96, 303) self.megaQuad = love.graphics.newQuad(0, 0, 32, 32, 96, 303) self.stickQuad = love.graphics.newQuad(32*2, 0, 32, 32, 96, 303) self.tex = loader.get("mugshots") self.timer = 0 self.oldX = self.transform.x self.oldY = self.transform.y self.oldNewX = 0 self.oldNewY = 0 self.x = 1 self.y = 1 self.transform.x = self.oldX + self.x*80 self.transform.y = self.oldY + self.y*80 self.blink = false self.stop = false end function stageSelect:update(dt) local oldx, oldy = self.x, self.y if control.leftPressed then self.x = self.x-1 elseif control.rightPressed then self.x = self.x+1 elseif control.upPressed then self.y = self.y-1 elseif control.downPressed then self.y = self.y+1 end self.x = math.wrap(self.x, 0, 2) self.y = math.wrap(self.y, 0, 2) if oldx ~= self.x or oldy ~= self.y then mmSfx.play("cursor_move") local newx, newy = 0, 0 if self.x == 0 and self.y == 0 then newx = 1 newy = 0 elseif self.x == 1 and self.y == 0 then newx = 0 newy = 1 elseif self.x == 2 and self.y == 0 then newx = 1 newy = 1 elseif self.x == 0 and self.y == 1 then newx = 0 newy = 2 elseif self.x == 1 and self.y == 1 then newx = 0 newy = 0 elseif self.x == 2 and self.y == 1 then newx = 1 newy = 2 elseif self.x == 0 and self.y == 2 then newx = 0 newy = 3 elseif self.x == 1 and self.y == 2 then newx = 1 newy = 3 elseif self.x == 2 and self.y == 2 then newx = 0 newy = 4 end self.megaQuad:setViewport(newx*32, newy*32, 32, 32) end self.timer = math.wrap(self.timer+1, 0, 14) self.blink = ternary(self.timer < 7, true, false) self.transform.x = self.oldX + self.x*80 self.transform.y = self.oldY + self.y*72 if (control.startPressed or control.jumpPressed) and not self.stop then if self.x == 2 and self.y == 1 then mmMusic.stopMusic() mmSfx.play("selected") megautils.add(fade(false, 4, {255, 255, 255}, function(s) if globals.defeats.stickMan then megautils.gotoState("states/stages/demostate.lua") else globals.bossIntroBoss = "stick" megautils.gotoState("states/menus/bossintrostate.lua") end megautils.remove(s, true) end)) self.stop = true end elseif control.selectPressed and not self.stop then self.stop = true megautils.gotoState("states/menus/menustate.lua") mmMusic.stopMusic() end end function stageSelect:allDefeated() for k, v in pairs(globals.defeats) do if not v then return false end end return true end function stageSelect:draw() if not self:allDefeated() then love.graphics.draw(self.tex, self.megaQuad, 112, 88) end --else --Draw Dr. Wily icon here --end if not globals.defeats.stickMan then love.graphics.draw(self.tex, self.stickQuad, 192, 88) end if self.blink and not self.stop then love.graphics.draw(self.tex, self.quad, self.transform.x, self.transform.y) love.graphics.draw(self.tex, self.quad, self.transform.x+32, self.transform.y) love.graphics.draw(self.tex, self.quad, self.transform.x, self.transform.y+40) love.graphics.draw(self.tex, self.quad, self.transform.x+32, self.transform.y+40) end end return stageselectstate
if debug.setcstacklimit then -- to work with Lua 5.4 debug.setcstacklimit(30000) end local function ack(m, n) if m == 0 then return n + 1 end if n == 0 then return ack(m - 1, 1) end return ack(m - 1, ack(m, n - 1)) end local res = ack(3,10) print(res) assert(res == 8189)
--# selene: allow(unused_variable) ---@diagnostic disable: unused-local -- Determine the machine's location and useful information about that location -- -- This module provides functions for getting current location information and tracking location changes. It expands on the earlier version of the module by adding the ability to create independant locationObjects which can enable/disable location tracking independant of other uses of Location Services by Hammerspoon, adds region monitoring for exit and entry, and adds the retrieval of geocoding information through the `hs.location.geocoder` submodule. -- -- This module is backwards compatible with its predecessor with the following changes: -- * [hs.location.get](#get) - no longer requires that you invoke [hs.location.start](#start) before using this function. The information returned will be the last cached value, which is updated internally whenever additional WiFi networks are detected or lost (not necessarily joined). When update tracking is enabled with the [hs.location.start](#start) function, calculations based upon the RSSI of all currently seen networks are preformed more often to provide a more precise fix, but it's still based on the WiFi networks near you. In many cases, the value retrieved when the WiFi state is changed should be sufficiently accurate. -- * [hs.location.servicesEnabled](#servicesEnabled) - replaces `hs.location.services_enabled`. While the earlier function is included for backwards compatibility, it will display a deprecation warning to the console the first time it is invoked and may go away completely in the future. -- -- The following labels are used to describe tables which are used by functions and methods as parameters or return values in this module and in `hs.location.geocoder`. These tables are described as follows: -- -- * `locationTable` - a table specifying location coordinates containing one or more of the following key-value pairs: -- * `latitude` - a number specifying the latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator. When not specified in a table being used as an argument, this defaults to 0.0. -- * `longitude` - a number specifying the longitude in degrees. Measurements are relative to the zero meridian, with positive values extending east of the meridian and negative values extending west of the meridian. When not specified in a table being used as an argument, this defaults to 0.0. -- * `altitude` - a number indicating altitude above (positive) or below (negative) sea-level. When not specified in a table being used as an argument, this defaults to 0.0. -- * `horizontalAccuracy` - a number specifying the radius of uncertainty for the location, measured in meters. If negative, the `latitude` and `longitude` keys are invalid and should not be trusted. When not specified in a table being used as an argument, this defaults to 0.0. -- * `verticalAccuracy` - a number specifying the accuracy of the altitude value in meters. If negative, the `altitude` key is invalid and should not be trusted. When not specified in a table being used as an argument, this defaults to -1.0. -- * `course` - a number specifying the direction in which the device is traveling. If this value is negative, then the value is invalid and should not be trusted. On current Macintosh models, this will almost always be a negative number. When not specified in a table being used as an argument, this defaults to -1.0. -- * `speed` - a number specifying the instantaneous speed of the device in meters per second. If this value is negative, then the value is invalid and should not be trusted. On current Macintosh models, this will almost always be a negative number. When not specified in a table being used as an argument, this defaults to -1.0. -- * `timestamp` - a number specifying the time at which this location was determined. This number is the number of seconds since January 1, 1970 at midnight, GMT, and is a floating point number, so you should use `math.floor` on this number before using it as an argument to Lua's `os.date` function. When not specified in a table being used as an argument, this defaults to the current time. -- -- * `regionTable` - a table specifying a circular region containing one or more of the following key-value pairs: -- * `identifier` - a string for use in identifying the region. When not specified in a table being used as an argument, a new value is generated with `hs.host.uuid`. -- * `latitude` - a number specifying the latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator. When not specified in a table being used as an argument, this defaults to 0.0. -- * `longitude` - a number specifying the latitude in degrees. Positive values indicate latitudes north of the equator. Negative values indicate latitudes south of the equator. When not specified in a table being used as an argument, this defaults to 0.0. -- * `radius` - a number specifying the radius (measured in meters) that defines the region’s outer boundary. When not specified in a table being used as an argument, this defaults to 0.0. -- * `notifyOnEntry` - a boolean specifying whether or not a callback with the "didEnterRegion" message should be generated when the machine enters the region. When not specified in a table being used as an argument, this defaults to true. -- * `notifyOnExit` - a boolean specifying whether or not a callback with the "didExitRegion" message should be generated when the machine exits the region. When not specified in a table being used as an argument, this defaults to true. ---@class hs.location local M = {} hs.location = M -- Adds a region to be monitored by Location Services -- -- Parameters: -- * `regionTable` - a region table as described in the module header -- -- Returns: -- * if the region table was able to be added to Location Services for monitoring, returns the locationObject; otherwise returns nil -- -- Notes: -- * This method activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. -- * If the `identifier` key is not provided, a new UUID string is generated and used as the identifier. -- * If the `identifier` key matches an already monitored region, this region will replace the existing one. function M:addMonitoredRegion(regionTable, ...) end -- Returns a string describing the authorization status of Hammerspoon's use of Location Services. -- -- Parameters: -- * None -- -- Returns: -- * a string matching one of the following: -- * "undefined" - The user has not yet made a choice regarding whether Hammerspoon can use location services. -- * "restricted" - Hammerspoon is not authorized to use location services. The user cannot change this status, possibly due to active restrictions such as parental controls being in place. -- * "denied" - The user explicitly denied the use of location services for Hammerspoon or location services are currently disabled in System Preferences. -- * "authorized" - Hammerspoon is authorized to use location services. -- -- Notes: -- * The first time you use a function which requires Location Services, you will be prompted to grant Hammerspoon access. If you wish to change this permission after the initial prompt, you may do so from the Location Services section of the Security & Privacy section in the System Preferences application. ---@return string function M.authorizationStatus() end -- Sets or removes the callback function for this locationObject -- -- Parameters: -- * a function, or nil to remove the current function, which will be invoked as a callback for messages generated by this locationObject. The callback function should expect 3 or 4 arguments as follows: -- * the locationObject itself -- * a string specifying the message generated by the locationObject: -- * "didChangeAuthorizationStatus" - the user has changed the authorization status for Hammerspoon's use of Location Services. The third argument will be a string as described in the [hs.location.authorizationStatus](#authorizationStatus) function. -- * "didUpdateLocations" - the current location has changed or been refined. This message will only occur if location tracking has been enabled with [hs.location:startTracking](#startTracking). The third argument will be a table containing one or more locationTables as array elements. The most recent location update is contained in the last element of the array. -- * "didFailWithError" - there was an error retrieving location information. The third argument will be a string describing the error that occurred. -- * "didStartMonitoringForRegion" - a new region has successfully been added to the regions being monitored. The third argument will be the regionTable for the region which was just added. -- * "monitoringDidFailForRegion" - an error occurred while trying to add a new region to the list of monitored regions. The third argument will be the regionTable for the region that could not be added, and the fourth argument will be a string containing an error message describing why monitoring for the region failed. -- * "didEnterRegion" - the current location has entered a region with the `notifyOnEntry` field set to true specified with the [hs.location:addMonitoredRegion](#addMonitoredRegion) method. The third argument will be the regionTable for the region entered. -- * "didExitRegion" - the current location has exited a region with the `notifyOnExit` field set to true specified with the [hs.location:addMonitoredRegion](#addMonitoredRegion) method. The third argument will be the regionTable for the region exited. -- -- Returns: -- * the locationObject function M:callback(fn) end -- Returns the string identifier for the current region -- -- Parameters: -- * None -- -- Returns: -- * the string identifier for the region that the current location is within, or nil if the current location is not within a currently monitored region or location services cannot be enabled for Hammerspoon. -- -- Notes: -- * This method activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. function M:currentRegion() end -- Measures the distance between two points of latitude and longitude -- -- Parameters: -- * `from` - A locationTable as described in the module header -- * `to` - A locationTable as described in the module header -- -- Returns: -- * A number containing the distance between `from` and `to` in meters. The measurement is made by tracing a line that follows an idealised curvature of the earth -- -- Notes: -- * This function does not require Location Services to be enabled for Hammerspoon. function M.distance(from, to, ...) end -- Enable callbacks for location changes/refinements for this locationObject -- -- Parameters: -- * None -- -- Returns: -- * the distance the specified location is from the current location in meters or nil if Location Services cannot be enabled for Hammerspoon. The measurement is made by tracing a line that follows an idealised curvature of the earth -- -- Notes: -- * This function activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. function M:distanceFrom(locationTable, ...) end -- Returns a number giving the current daylight savings time offset -- -- Parameters: -- * None -- -- Returns: -- * The number of minutes of daylight savings offset, zero if there is no offset -- -- Notes: -- * This value is derived from the currently configured system timezone, it does not use Location Services ---@return number function M.dstOffset() end -- Returns a table representing the current location -- -- Parameters: -- * None -- -- Returns: -- * If successful, a locationTable as described in the module header, otherwise nil. -- -- Notes: -- * This function activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. -- * If access to Location Services is enabled for Hammerspoon, this function will return the most recent cached data for the computer's location. -- * Internally, the Location Services cache is updated whenever additional WiFi networks are detected or lost (not necessarily joined). When update tracking is enabled with the [hs.location.start](#start) function, calculations based upon the RSSI of all currently seen networks are preformed more often to provide a more precise fix, but it's still based on the WiFi networks near you. function M.get() end -- Returns the current location -- -- Parameters: -- * None -- -- Returns: -- * If successful, a locationTable as described in the module header, otherwise nil. -- -- Notes: -- * This function activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. -- * If access to Location Services is enabled for Hammerspoon, this function will return the most recent cached data for the computer's location. -- * Internally, the Location Services cache is updated whenever additional WiFi networks are detected or lost (not necessarily joined). When update tracking is enabled with the [hs.location.start](#start) function, calculations based upon the RSSI of all currently seen networks are preformed more often to provide a more precise fix, but it's still based on the WiFi networks near you. function M:location() end -- Returns a table containing the regionTables for the regions currently being monitored for this locationObject -- -- Parameters: -- * None -- -- Returns: -- * if Location Services can be enabled for Hammerspoon, returns a table containing regionTables for each region which is being monitored for this locationObject; otherwise nil -- -- Notes: -- * This method activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. function M:monitoredRegions() end -- Create a new location object which can receive callbacks independant of other Hammerspoon use of Location Services. -- -- Parameters: -- * None -- -- Returns: -- * a locationObject -- -- Notes: -- * The locationObject created will receive callbacks independant of all other locationObjects and the legacy callback functions created with [hs.location.register](#register). It can also receive callbacks for region changes which are not available through the legacy callback mechanism. function M.new() end -- Registers a callback function to be called when the system location is updated -- -- Parameters: -- * `tag` - A string containing a unique tag, used to identify the callback later -- * `fn` - A function to be called when the system location is updated. The function should expect a single argument which will be a locationTable as described in the module header. -- * `distance` - An optional number containing the minimum distance in meters that the system should have moved, before calling the callback. Defaults to 0 -- -- Returns: -- * None function M.register(tag, fn, distance, ...) end -- Removes a monitored region from Location Services -- -- Parameters: -- * `identifier` - a string which should contain the identifier of the region to remove from monitoring -- -- Returns: -- * if the region identifier matches a currently monitored region, returns the locationObject; if it does not match a currently monitored region, returns false; returns nil if an error occurs or if Location Services is not currently active (no function or method which activates Location Services has been invoked yet) or enabled for Hammerspoon. -- -- Notes: -- * This method activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. -- * If the `identifier` key is not provided, a new UUID string is generated and used as the identifier. -- * If the `identifier` key matches an already monitored region, this region will replace the existing one. function M:removeMonitoredRegion(identifier, ...) end -- Gets the state of OS X Location Services -- -- Parameters: -- * None -- -- Returns: -- * True if Location Services are enabled, otherwise false ---@return boolean function M.servicesEnabled() end -- Begins location tracking using OS X's Location Services so that registered callback functions can be invoked as the computer location changes. -- -- Parameters: -- * None -- -- Returns: -- * True if the operation succeeded, otherwise false -- -- Notes: -- * This function activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. ---@return boolean function M.start() end -- Enable callbacks for location changes/refinements for this locationObject -- -- Parameters: -- * None -- -- Returns: -- * the locationObject -- -- Notes: -- * This function activates Location Services for Hammerspoon, so the first time you call this, you may be prompted to authorise Hammerspoon to use Location Services. function M:startTracking() end -- Stops location tracking. Registered callback functions will cease to receive notification of location changes. -- -- Parameters: -- * None -- -- Returns: -- * None function M.stop() end -- Disable callbacks for location changes/refinements for this locationObject -- -- Parameters: -- * None -- -- Returns: -- * the locationObject function M:stopTracking() end -- Returns the time of official sunrise for the supplied location -- -- Parameters: -- * `latitude` - A number containing a latitude -- * `longitude` - A number containing a longitude -- * `offset` - A number containing the offset from UTC (in hours) for the given latitude/longitude. -- * `date` - An optional table containing date information (equivalent to the output of ```os.date("*t")```). Defaults to the current date -- -- Returns: -- * A number containing the time of sunrise (represented as seconds since the epoch) for the given date. If no date is given, the current date is used. If the sun doesn't rise on the given day, the string "N/R" is returned. -- -- Notes: -- * You can turn the return value into a more useful structure, with ```os.date("*t", returnvalue)``` -- * For compatibility with the locationTable object returned by [hs.location.get](#get), this function can also be invoked as `hs.location.sunrise(locationTable, offset[, date])`. function M.sunrise(latitude, longitude, offset, date, ...) end -- Returns the time of official sunset for the supplied location -- -- Parameters: -- * `latitude` - A number containing a latitude -- * `longitude` - A number containing a longitude -- * `offset` - A number containing the offset from UTC (in hours) for the given latitude/longitude. -- * `date` - An optional table containing date information (equivalent to the output of ```os.date("*t")```). Defaults to the current date -- -- Returns: -- * A number containing the time of sunset (represented as seconds since the epoch) for the given date. If no date is given, the current date is used. If the sun doesn't set on the given day, the string "N/S" is returned. -- -- Notes: -- * You can turn the return value into a more useful structure, with ```os.date("*t", returnvalue)``` -- * For compatibility with the locationTable object returned by [hs.location.get](#get), this function can also be invoked as `hs.location.sunset(locationTable, offset[, date])`. function M.sunset(latitude, longitude, offset, date, ...) end -- Unregisters a callback -- -- Parameters: -- * `tag` - A string containing the unique tag a callback was registered with -- -- Returns: -- * None function M.unregister(tag, ...) end
object_tangible_furniture_all_wod_seed_jar = object_tangible_furniture_all_shared_wod_seed_jar:new { } ObjectTemplates:addTemplate(object_tangible_furniture_all_wod_seed_jar, "object/tangible/furniture/all/wod_seed_jar.iff")
slot0 = class("ShipHuntingRangeView", import("...base.BaseSubView")) slot0.getUIName = function (slot0) return "ShipHuntingRangeView" end slot0.OnInit = function (slot0) slot0.huntingRange = slot0._tf setActive(slot0.huntingRange, false) slot0.curLevel = slot0.huntingRange:Find("frame/current_level") slot0.showLevel = slot0.huntingRange:Find("frame/level/Text") slot0.tips = slot0.huntingRange:Find("frame/tips") slot0.closeBtn = slot0.huntingRange:Find("frame/close_btn") slot0.helpBtn = slot0.huntingRange:Find("frame/help") slot0.cellRoot = slot0.huntingRange:Find("frame/range") slot0.onSelected = false end slot0.SetShareData = function (slot0, slot1) slot0.shareData = slot1 end slot0.GetShipVO = function (slot0) if slot0.shareData and slot0.shareData.shipVO then return slot0.shareData.shipVO end return nil end slot0.DisplayHuntingRange = function (slot0) slot0.onSelected = true slot1 = slot0:GetShipVO() setActive(slot0.huntingRange, true) slot0:UpdateHuntingRange(slot1, slot1:getHuntingLv()) setText(slot0.curLevel, "Lv." .. slot1:getHuntingLv()) setText(slot0.tips, i18n("ship_hunting_level_tips")) onButton(slot0, slot0.closeBtn, function () slot0:HideHuntingRange() end, SFX_CANCEL) onButton(slot0, slot0.helpBtn, function () pg.MsgboxMgr.GetInstance():ShowMsgBox({ type = MSGBOX_TYPE_HELP, helps = pg.gametip.help_shipinfo_hunting.tip }) end, SFX_PANEL) pg.UIMgr.GetInstance().BlurPanel(slot2, slot0.huntingRange) end slot0.UpdateHuntingRange = function (slot0, slot1, slot2) for slot7 = 0, slot0.cellRoot.childCount - 1, 1 do setActive(slot0:findTF("activate", slot3:GetChild(slot7)), false) end _.each(slot4, function (slot0) if slot0:GetChild(slot0[1] * 7 + slot0[2] + math.floor(24.5)) and slot3 ~= 24 then setActive(slot1:findTF("activate", slot4), true) end end) setActive(slot0.huntingRange.Find(slot5, "frame/last"), slot2 > 1) setActive(slot0.huntingRange:Find("frame/next"), slot2 < #slot1:getConfig("hunting_range")) setText(slot0.showLevel, "Lv." .. slot2) onButton(slot0, slot5, function () if slot0 - 1 == 0 then slot0 = #slot1:getConfig("hunting_range") end slot2:UpdateHuntingRange(slot2.UpdateHuntingRange, slot0) end, SFX_PANEL) onButton(slot0, slot0.huntingRange.Find("frame/next"), function () if slot0 + 1 == #slot1:getConfig("hunting_range") + 1 then slot0 = 1 end slot2:UpdateHuntingRange(slot2.UpdateHuntingRange, slot0) end, SFX_PANEL) end slot0.HideHuntingRange = function (slot0) setActive(slot0.huntingRange, false) pg.UIMgr.GetInstance():UnblurPanel(slot0.huntingRange, slot0._tf) slot0.onSelected = false end slot0.OnDestroy = function (slot0) slot0:HideHuntingRange() slot0.shareData = nil end return slot0
RENDER_ENTS = RENDER_ENTS or {} for i,v in pairs(RENDER_ENTS) do if v:IsValid() then v:Remove() end end table.Empty(RENDER_ENTS) for k, v in pairs(hook.GetTable()) do for k2,v2 in pairs(v) do if k2 == "render_ents" then hook.Remove(k, k2) end end end local function is_entity_visible(self) if self.last_visible then return self.last_visible > 0 end self.render_ents_pixvis = self.render_ents_pixvis or util.GetPixelVisibleHandle() local vis = util.PixelVisible(self:GetPos(), self:BoundingRadius() * 2, self.render_ents_pixvis) self.last_visible = vis return vis > 0 end local function create_ent(mdl, rendergroup, parent) local ent = ClientsideModel(mdl, rendergroup) table.insert(RENDER_ENTS, ent) ent:Spawn() ent:SetLOD(0) ent.parent = parent ent.root_parent = parent.root_parent or parent ent.bone = 0 ent.parent.matrix = ent.parent.matrix or Matrix() ent.matrix = Matrix() * ent.parent.matrix function ent:CheckVisibility() if is_entity_visible(self.root_parent) then self.draw_me = true return true end self.draw_me = false return false end function ent:UpdateMatrix() self:EnableMatrix("RenderMultiply", self.matrix) end function ent:GetPosAng() -- if we don't call this function mat will return nil (?) self.parent:GetBonePosition(self.bone) local mat = self.parent:GetBoneMatrix(self.bone) if mat then mat = mat * ent.matrix return mat:GetTranslation(), mat:GetAngles() end return self.parent:GetPos(), self.parent:GetAngles() end return ent end local ENT = LocalPlayer() local max = 1500 for i = 1, 200 do local parent = ENT for i = 1, math.random(1, 20) do local ent = create_ent("models/props_junk/PopCan01a.mdl", RENDERGROUP_OPAQUE, parent) ent.bone = math.random(1, parent:GetBoneCount()) ent.matrix:Translate(VectorRand()*5) ent.matrix:Rotate(VectorRand():Angle()) ent:UpdateMatrix() parent = ent if #RENDER_ENTS == max then break end end if #RENDER_ENTS == max then break end end ENT.render_ents_RenderOverride = ENT.render_ents_RenderOverride or function(self) self:DrawModel() end function ENT:RenderOverride() self:render_ents_RenderOverride() for i, ent in ipairs(RENDER_ENTS) do if ent:CheckVisibility() then local pos, ang = ent:GetPosAng() ent:SetPos(pos) ent:SetAngles(ang) ent:InvalidateBoneCache() end end end hook.Add("PostRender", "render_ents", function() for i, ent in ipairs(RENDER_ENTS) do ent.root_parent.last_visible = nil ent:SetNoDraw(not ent.draw_me) end end)
fx_version "adamant" game "gta5" author "Wolf" description "Emprego de Pedreiro inspirado no BGO do MTA" version "1.0.0" client_scripts { "@vrp/lib/utils.lua", "config.lua", "kclient.lua" } server_script { "@vrp/lib/utils.lua", "kserver.lua" }
DoReady.Shaman.Enhancement.MythicPlus.Tyrannical.Legendarys = { [1] = 335895, [2] = 354647, [3] = 356218, [4] = 335897, [5] = 356250, [6] = 336734, [7] = 335902, [8] = 336738, [9] = 336735, } DoReady.Shaman.Enhancement.MythicPlus.Tyrannical.Talents = { [1] = 334046, [2] = 201900, [3] = 260878, [4] = 333974, [5] = 30884, [6] = 197214, [7] = 262624, } DoReady.Shaman.Elemental.MythicPlus.Tyrannical.Legendarys = { [1] = 336215, [2] = 356218, [3] = 336063, [4] = 354647, [5] = 336734, [6] = 356250, [7] = 336738, [8] = 356789, [9] = 336730, [10] = 336739, } DoReady.Shaman.Elemental.MythicPlus.Tyrannical.Talents = { [1] = 333919, [2] = 273221, [3] = 260878, [4] = 192249, [5] = 108281, [6] = 117013, [7] = 191634, } DoReady.Shaman.Restoration.MythicPlus.Tyrannical.Legendarys = { [1] = 356789, [2] = 336739, [3] = 336735, [4] = 356250, [5] = 336734, [6] = 335889, [7] = 354647, [8] = 356218, [9] = 335893, [10] = 336730, } DoReady.Shaman.Restoration.MythicPlus.Tyrannical.Talents = { [1] = 200071, [2] = 108283, [3] = 260878, [4] = 207401, [5] = 30884, [6] = 157153, [7] = 114052, }
require "core.utils.prequire" require "core.impatient" require "core.options" require "core.keymaps" require "core.plugins" require "core.colorscheme" require "core.autocommands" require "core.commands"
local status_ok, _ = pcall(require, "nvim-treesitter.configs") if not status_ok then return end require("nvim-treesitter.configs").setup({ highlight = { enable = true, custom_captures = { -- Highlight the @foo.bar capture group with the "Identifier" highlight group. ["foo.bar"] = "Identifier", }, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, }, indent = { enable = true, disable = { "python" }, }, rainbow = { enable = true, -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean max_file_lines = nil, -- Do not enable for files with more than n lines, int -- colors = {}, -- table of hex strings -- termcolors = {} -- table of colour name strings }, }) vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
EditorEnableSoundEnvironment = EditorEnableSoundEnvironment or class(MissionScriptEditor) function EditorEnableSoundEnvironment:create_element(...) EditorEnableSoundEnvironment.super.create_element(self, ...) self._element.class = "ElementEnableSoundEnvironment" self._element.values.enable = true self._element.values.elements = {} end function EditorEnableSoundEnvironment:_build_panel() self:_create_panel() self:BuildUnitsManage("elements", nil, nil, {check_unit = function(unit) return unit:type() == Idstring("sound") end}) self:BooleanCtrl("enable", {help = "if enable is true then the sound area will be enabled otherwise it will be disabled"}) end
--[[ Copyright (c) 2011-2012 qeeplay.com http://dualface.github.com/quick-cocos2d-x/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]] --[[-- Bootstrap for client. ### Auto registered global module Module | Descripton ------ | ---------- [framework.client.device](framework.client.device.html) | Query information about the system [framework.client.transition](framework.client.transition.html) | Actions, Transformations and Effects [framework.client.display](framework.client.display.html) | Create scene, layer, sprite [framework.client.audio](framework.client.audio.html) | Play music, sound effect [framework.client.ui](framework.client.ui.html) | Create menu, label, widgets [framework.client.network](framework.client.network.html) | ... [framework.client.luaoc](framework.client.luaoc.html) | Call Objective-C from Lua, iOS platform only [framework.client.luaj](framework.client.luaj.html) | Call Java from Lua, Android platform only <br /> ### More client modules Module | Descripton ------ | ---------- [framework.client.crypto](framework.client.crypto.html) | Crypto [framework.client.network](framework.client.network.html) | Network [framework.client.scheduler](framework.client.scheduler.html) | Scheduler ]] __FRAMEWORK_ENVIRONMENT__ = "client" require("framework.shared.debug") require("framework.shared.functions") echoInfo("") echoInfo("# DEBUG = "..DEBUG) echoInfo("#") device = require("framework.client.device") transition = require("framework.client.transition") display = require("framework.client.display") audio = require("framework.client.audio") ui = require("framework.client.ui") network = require("framework.client.network") if device.platform == "android" then -- luaj = require("framework.client.luaj") jit.off() elseif device.platform == "ios" then luaoc = require("framework.client.luaoc") end --[[-- @ignore ]] local timeCount = 0 local function showMemoryUsage(dt) timeCount = timeCount + dt echoInfo(string.format("MEMORY USED: %0.2f KB, UPTIME: %04.2fs", collectgarbage("count"), timeCount)) end if DEBUG_FPS then CCDirector:sharedDirector():setDisplayStats(true) end if DEBUG_MEM then CCDirector:sharedDirector():getScheduler():scheduleScriptFunc(showMemoryUsage, 10.0, false) end
registerNpc(393, { walk_speed = 275, run_speed = 640, scale = 200, r_weapon = 1092, l_weapon = 0, level = 109, hp = 138, attack = 624, hit = 361, def = 768, res = 238, avoid = 170, attack_spd = 100, is_magic_damage = 1, ai_type = 130, give_exp = 440, drop_type = 384, drop_money = 0, drop_item = 99, union_number = 99, need_summon_count = 0, sell_tab0 = 0, sell_tab1 = 0, sell_tab2 = 0, sell_tab3 = 0, can_target = 0, attack_range = 1500, npc_type = 10, hit_material_type = 0, face_icon = 0, summon_mob_type = 0, quest_type = 0, height = 0 }); function OnInit(entity) return true end function OnCreate(entity) return true end function OnDelete(entity) return true end function OnDead(entity) end function OnDamaged(entity) end
-- coding: UTF-8 local M = require "modules.string_rc" -- settings -- local DELAY = 0.15e6 -- 0.15 sec (in microseconds); to avoid flickering local PROGRESS_WIDTH = 30 -- /settings -- local CHAR_SOLID = ("").char(9608) --> █ local CHAR_DOTTED = ("").char(9617) --> ░ local progress = {} local mt_progress = { __index=progress } function progress.newprogress(msg, max_value) local self = setmetatable({}, mt_progress) self._visible = false self._max_value = max_value or 0 self._title = M.title_short self._message = msg self._start = far.FarClock() return self end function progress:show() if not self._visible then self._visible = true far.AdvControl("ACTL_SETPROGRESSSTATE", "TBPS_INDETERMINATE") end if self._bar == nil then far.Message(self._message, self._title, "") else far.Message(self._message.."\n"..self._bar, self._title, "") end end function progress:hide() if self._visible then far.AdvControl("ACTL_PROGRESSNOTIFY") far.AdvControl("ACTL_SETPROGRESSSTATE", "TBPS_NOPROGRESS") panel.RedrawPanel(nil, 1) panel.RedrawPanel(nil, 0) self._visible = false end end function progress:update(val) if (far.FarClock() - self._start) < DELAY then return end if self._max_value > 0 then local percent = math.floor(val * 100 / self._max_value) local pv = { Completed=percent; Total=100 } far.AdvControl("ACTL_SETPROGRESSVALUE", 0, pv) local len = math.floor(percent * PROGRESS_WIDTH / 100) self._bar = CHAR_SOLID:rep(len) .. CHAR_DOTTED:rep(PROGRESS_WIDTH - len) end self:show() end function progress.aborted() -- function, not method return win.ExtractKey() == "ESCAPE" end return progress
return {'elroy','elroys'}
local settings = UT.getSettings() if not settings.skillPoints then do return end end _G.CloneClass(SkillTreeManager) function SkillTreeManager:_verify_loaded_data(...) SkillTreeManager.orig._verify_loaded_data(self, settings.skillPoints - managers.experience:current_level()) end
-- incredible-gmod.ru local menu local pages = {} local itemsPerPage = 5 for page_id = 1, 3 do -- generate empty pages for debug (you should get real pages from the server or from somewhere else) pages[page_id] = {} for item_id = 1, itemsPerPage do pages[page_id][item_id] = { somePageData = "just a test", uid = page_id .."_".. item_id, debug_uid = true } end end local page_id = 1 concommand.Add("pages_menu", function(ply) if IsValid(menu) then menu:Remove() end menu = vgui.Create("DFrame") menu:SetSize(420, math.min(720, ScrH())) menu:Center() menu:MakePopup() menu:SetTitle("Pages menu - Page #".. page_id) menu.Think = function(me) if input.IsKeyDown(KEY_ESCAPE) then return me:Remove() end end menu.search = menu:Add("DTextEntry") menu.search:Dock(TOP) menu.search:SetPlaceholderText("Search...") menu.search:SetTall(24) menu.search.OnEnter = function(me) local userinput = me:GetText() local userinput_lower = userinput:lower() menu.controls:SetVisible(userinput == "") if menu.controls:IsVisible() then menu:setPage(page_id) else menu:clearPage() end local visible = 0 for page_id, page in ipairs(pages) do for item_id, item in ipairs(page) do if item.uid:lower():find(userinput_lower, 1, true) then menu:addPageItem(item) visible = visible + 1 if visible >= itemsPerPage then return end end end end end menu.search.OnLoseFocus = menu.search.OnEnter menu.content = menu:Add("EditablePanel") menu.content:Dock(FILL) menu.content:DockMargin(0, 8, 0, 8) menu.controls = menu:Add("EditablePanel") menu.controls:Dock(BOTTOM) menu.controls:SetTall(32) local polyMargin = 8 menu.controls.right = menu.controls:Add("DButton") menu.controls.right:Dock(RIGHT) menu.controls.right:SetWide(menu.controls:GetTall()) menu.controls.right:DockMargin(4, 0, 0, 0) menu.controls.right:SetText("") menu.controls.right.PaintOver = function(me, w, h) surface.SetDrawColor(50, 50, 50, (me:IsHovered() and me:GetDisabled() == false) and 255 or 215) draw.NoTexture() surface.DrawPoly({ {x = polyMargin, y = polyMargin}, {x = w - polyMargin, y = h * 0.5}, {x = polyMargin, y = h - polyMargin} }) end menu.controls.right.DoClick = function(me) menu:nextPage() end menu.controls.left = menu.controls:Add("DButton") menu.controls.left:Dock(RIGHT) menu.controls.left:SetWide(menu.controls:GetTall()) menu.controls.left:DockMargin(4, 0, 0, 0) menu.controls.left:SetText("") menu.controls.left.PaintOver = function(me, w, h) surface.SetDrawColor(50, 50, 50, (me:IsHovered() and me:GetDisabled() == false) and 255 or 215) draw.NoTexture() surface.DrawPoly({ {x = polyMargin, y = h * 0.5}, {x = w - polyMargin, y = polyMargin}, {x = w - polyMargin, y = h - polyMargin} }) end menu.controls.left.DoClick = function(me) menu:prevPage() end menu.controls.input = menu.controls:Add("DTextEntry") menu.controls.input:Dock(RIGHT) menu.controls.input:SetWide(menu.controls:GetTall() * 3) menu.controls.input:SetPlaceholderText("Page number...") menu.controls.input:SetText(page_id) menu:InvalidateLayout(true) local item_tall = menu.content:GetTall() / itemsPerPage - (4 * 0.8) menu.addPageItem = function(me, item) local item_p = me.content:Add("DButton") item_p:SetTall(item_tall) item_p:Dock(TOP) item_p:DockMargin(0, 0, 0, 4) item_p:SetText(item.debug_uid and ("UID: ".. item.uid) or "") end menu.isPageExists = function(me, id) return tobool(pages[id]) end menu.clearPage = function(me) for i, child in ipairs(me.content:GetChildren()) do child:Remove() end end menu.setPage = function(me, id) local page = pages[id] if page == nil then return false end me.controls.right:SetDisabled(id >= #pages) me.controls.left:SetDisabled(id <= 1) page_id = id me.controls.input:SetText(id) me:clearPage() for i, item in ipairs(page) do me:addPageItem(item) end return true end menu.nextPage = function(me) return me:setPage(page_id + 1) end menu.prevPage = function(me) return me:setPage(page_id - 1) end menu:setPage(page_id) end)
local Coin = require 'entity/Coin' return function() return Coin('res/gold_coin.png', 50) end
dofile("test_setup.lua") LuaReload.SetHandleGlobalModules(true) local file1 = [=[ GlobalModule = {} local iter = 0 function GlobalModule.Func() log("> Hello, I'm the original version of the function, and I return 1000 + iter", iter, debug.getinfo(1).func) iter = iter + 1 return 1000 + iter end print("XXX GlobalModule: ", GlobalModule) ]=] local file2 = [=[ GlobalModule = {} local iter = 0 function GlobalModule.Func() log("> Hello, I'm the new version of the function, and I return 2000 + iter", iter, debug.getinfo(1).func) iter = iter + 1 return 2000 + iter end print("XXX GlobalModule new: ", GlobalModule) ]=] local iter = DoFileString(file1) assert(GlobalModule.Func() == 1001) assert(GlobalModule.Func() == 1002) ReloadFileString(file2) assert(GlobalModule.Func() == 2003) assert(GlobalModule.Func() == 2004)
---------------------------------------------------------- PIPE FUNCTIONS ------------------------------------------------------------ local function tintPipeCovers(pipe_covers, tint) --SHOULD NOT HAVE TO DO THIS - hr_version IS ONLY MISSING WHEN A MOD EDITS THE PIPE IN DATA REEEEEEEEEEEE --like Industrial Revolution 2 version 2.1.2 if not pipe_covers then return end local directions = { "north", "east", "south", "west", } for _, direction in pairs(directions) do local directionLayer1 = pipe_covers[direction].layers[1] directionLayer1.tint = tint if directionLayer1.hr_version then directionLayer1.hr_version.tint = tint end end end local function tintPictures(pictures, tint) --SHOULD NOT HAVE TO DO THIS - hr_version IS ONLY MISSING WHEN A MOD EDITS THE PIPE IN DATA REEEEEEEEEEEE --like Industrial Revolution 2 version 2.1.2 if not pictures then return end local directions = { "up", "right", "down", "left", } for _, direction in pairs(directions) do local pictureDirection = pictures[direction] if pictureDirection then local tableToTint = (pictureDirection.layers and pictureDirection.layers[1]) or pictures[direction] tableToTint.tint = tint if tableToTint.hr_version then pictureDirection.hr_version.tint = tint end end end end ---------------------------------------------------------- DIMENSIONAL PIPE ---------------------------------------------------------- -- Tier 1 -- local tint1 = {1,1,0.4} local dpE1 = table.deepcopy(data.raw["pipe-to-ground"]["pipe-to-ground"]) dpE1.name = "DimensionalPipe1" dpE1.icons = {{icon=dpE1.icon, tint=tint1}} dpE1.minable = {mining_time = 0.5} dpE1.flags = {} dpE1.fast_replaceable_group = nil dpE1.fluid_box.pipe_connections[2].max_underground_distance = 1 tintPipeCovers(dpE1.fluid_box.pipe_covers, tint1) tintPictures(dpE1.pictures, tint1) data:extend{dpE1} -- Tier 2 -- local tint2 = {1,0.4,0.4} local dpE2 = table.deepcopy(dpE1) dpE2.name = "DimensionalPipe2" dpE2.icons = {{icon=dpE1.icon, tint=tint2}} dpE2.fluid_box.base_area = 10 tintPipeCovers(dpE2.fluid_box.pipe_covers, tint2) tintPictures(dpE2.pictures, tint2) data:extend{dpE2} local dpT2 = {} dpT2.name = "DimensionalPipe2" dpT2.type = "technology" dpT2.icons = dpE2.icons dpT2.icon_size = data.raw["pipe-to-ground"]["pipe-to-ground"].icon_size dpT2.unit = { count=1200, time=3, ingredients={ {"DimensionalSample", 1} } } dpT2.prerequisites = {"MFDeploy"} dpT2.effects = { {type="nothing", effect_description={"description.DimensionalPipe2"}}, } data:extend{dpT2} -- Tier 3 -- local tint3 = {0.4,0.6,1} local dpE3 = table.deepcopy(dpE2) dpE3.name = "DimensionalPipe3" dpE3.icons = {{icon=dpE1.icon, tint=tint3}} dpE3.fluid_box.base_area = 50 tintPipeCovers(dpE3.fluid_box.pipe_covers, tint3) tintPictures(dpE3.pictures, tint3) data:extend{dpE3} local dpT3 = {} dpT3.name = "DimensionalPipe3" dpT3.type = "technology" dpT3.icons = dpE3.icons dpT3.icon_size = data.raw["pipe-to-ground"]["pipe-to-ground"].icon_size dpT3.unit = { count=10, time=60, ingredients={ {"DimensionalSample", 200}, {"DimensionalCrystal", 1} } } dpT3.prerequisites = {"DimensionalPipe2"} dpT3.effects = { {type="nothing", effect_description={"description.DimensionalPipe3"}}, } data:extend{dpT3}
require("Navigator") StateMachine = require("StateMachine") print("CTEST_FULL_OUTPUT") -- Define application-wide data -- function myinit() print("Setting up scenegraph") navtransform = osg.PositionAttitudeTransform() --navtransform:addChild(osgLua.loadObjectFile('cessna.osg')) print("Attaching to scene") StateMachine.getScene():addChild(navtransform) end ---------------------- osgnav state ---------------------------- -- Define the osgnav "state" -- osgnav = {} osgnav.position = osg.Vec3d(0, 0, 0) -- When entering "osgnav" function osgnav:enter() -- Set up the state print("Setting up position interface") local wand = gadget.PositionInterface("VJWand") print("Setting up digital interface") local button = gadget.DigitalInterface("VJButton0") local button2 = gadget.DigitalInterface("VJButton1") print("Creating navigator") self.nav = Navigator.create(maxspeed) Navigator.useWandTranslation(self.nav, wand, button) os.exit(0) -- Set up the events self.events = { [function() return button2.justPressed end] = StateMachine.createStateTransition(simplerotation); } end -- When updating "osgnav" function osgnav:update(dt) self.position = self.position - self.nav:getTranslation(dt, self.position) navtransform:setPosition(self.position) end -- osgnav:leave is undefined - no specific action we wish to carry out. ----------- simplerotation state -------------- -- Define the simplerotation "state" simplerotation = {} simplerotation.degrees = 0 -- When entering "simplerotation" function simplerotation:enter() local button = gadget.DigitalInterface("VJButton2") self.events = { [function() return button.justPressed end] = StateMachine.createStateTransition(osgnav); } end -- When updating "simplerotation" function simplerotation:update(dt) degreesPerSec = 3 simplerotation.degrees = simplerotation.degrees + degreesPerSec * dt navtransform:setAttitude(osg.Quat(simplerotation.degrees, osg.Vec3d(0, 1, 0)) ) end -- simplerotation:leave is undefined - no specific action we wish to carry out. ------------------ Start up the app ----------------------- print("Loading config files into kernel") vrjKernel.loadConfigFile("standalone.jconf") StateMachine.setInitFunction(myinit) StateMachine.setStartingState(osgnav) StateMachine.runApp()
--[[-------- A simple module with examples. Even without markdown formatting, blank lines are respected. @module usage ]] local usage = {} local helper --- a local helper function. -- @local function helper () end ---------- -- A simple vector class. -- -- Supports arithmetic operations. -- @usage -- v = Vector.new {10,20,30} -- assert (v == Vector{10,20,30}) -- @type Vector local Vector = {} usage.Vector = {} ---------- -- Create a vector from an array `t`. -- `Vector` is also callable! function Vector.new (t) end -- note that @function may have modifiers. Currently -- we aren't doing anything with them, but LDoc no longer -- complains (issue #45). Note also that one needs -- explicit @param tags with explicit @function; 'static' -- methods must have a @constructor or a @static tag. ---------- -- Create a vector from a string. -- @usage -- v = Vector.parse '[1,2,3]' -- assert (v == Vector.new {1,2,3}) -- @function[kind=ctor] parse -- @static -- @param s function Vector.parse (s) end -------- -- Compare two vectors for equality. function Vector:__eq (v) end ---------- -- Add another vector, array or scalar `v` to this vector. -- Returns new `Vector` -- @usage assert(Vector.new{1,2,3}:add(1) == Vector{2,3,4}) function Vector:add (v) end ---------- -- set vector options. `opts` is a `Vector.Opts` table. function Vector:options (opts) end --[[----------------- @table Vector.Opts Options table format for `Vector:options` * `autoconvert`: try to convert strings to numbers * `adder`: function used to perform addition and subtraction * `multiplier`: function used to perform multiplication and division @usage v = Vector {{1},{2}} v:options {adder = function(x,y) return {x[1]+y[1]} end} assert(v:add(1) == Vector{{2},{3}}) ]] return usage
-------------------------------------------------------------------------------- -- Ящик с реле (ЯР-27) -------------------------------------------------------------------------------- Metrostroi.DefineSystem("YAR_27") function TRAIN_SYSTEM:Initialize() -- Реле дверей (РД) self.Train:LoadSystem("RD","Relay","REV-821",{ close_time = 1.75 }) -- Реле включения освещения (РВО) self.Train:LoadSystem("RVO","Relay","REV-814T",{ open_time = 4.0 }) -- Реле времени торможения (РВ3) self.Train:LoadSystem("RVZ","Relay","REV-813T",{ open_time = 2.3 }) -- Реле тока (РТ2) self.Train:LoadSystem("RT2","Relay","REV-830",{ trigger_level = 120 }) -- A -- Реле контроля тормозного тока (РКТТ) FIXME: see konspekt page 55 self.Train:LoadSystem("RKTT","Relay","R-52B") -- Реле реверсировки (РР) self.Train:LoadSystem("RR","Relay","RPU-116T") end function TRAIN_SYSTEM:Think() local Train = self.Train -- RT2 relay operation Train.RT2:TriggerInput("Set",Train.Electric.IRT2) end
-- This key table is taken from my lua-getch library -- a default key table, that resolves most common terminal key press escape codes. local key_table = { [10] = "enter", [9] = "tab", [127] = "backspace", [27] = { [27] = "escape", [91] = { [65] = "up", [66] = "down", [67] = "right", [68] = "left", [70] = "end", [72] = "pos1", [50] = { [126] = "insert" }, [51] = { [126] = "delete" }, [53] = { [126] = "pageup" }, [54] = { [126] = "pagedown" } } } } -- add key combinations to key_table local exclude = {[3]=true, [9]=true, [10]=true, [13]=true, [17]=true, [19]=true, [26]=true} for i=1, 26 do if not exclude[i] then -- can't get these ctrl-codes via a terminal(e.g. ctrl-c) key_table[i] = "ctrl-"..string.char(i+96) end key_table[27][i+64] = "alt-"..string.char(i+96) -- e.g. alt-a key_table[27][i+96] = "alt-"..string.char(i+96) -- e.g. alt-shift-a end return key_table
local varm_util = require("modules/varm_util") local node_reqs = {} -- ('Read RTC Time' Node) function node_reqs.ensure_support_methods(node, proj_state) -- Import the 'misc', 'rtc', and 'pwr' standard periph libs, -- and make sure that a global 'RTC_TimeTypeDef' exists. if not varm_util.import_std_periph_lib('misc', proj_state.base_dir) or not varm_util.import_std_periph_lib('rtc', proj_state.base_dir) or not varm_util.import_std_periph_lib('pwr', proj_state.base_dir) then return nil end -- Ensure that a global 'RTC_TimeTypeDef' struct is defined. if not varm_util.copy_block_into_file( 'static/node_code/rtc_read_time/src/global_h.insert', proj_state.base_dir .. 'src/global.h', 'SYS_GLOBAL_RTC_TIME_STRUCT_START:', 'SYS_GLOBAL_RTC_TIME_STRUCT_DONE:', '/ SYS_GLOBAL_VAR_DEFINES:') then return nil end return true end -- ('Read RTC Time' Node) function node_reqs.append_node(node, node_graph, proj_state) local node_text = ' // ("RTC Read Time" node)\n' node_text = node_text .. ' NODE_' .. node.node_ind .. ':\n' -- Get the current time. node_text = node_text .. ' RTC_WaitForSynchro();\n' node_text = node_text .. ' RTC_GetTime(RTC_Format_BIN, &global_rtc_time_struct);\n' -- Store it if necessary. if node.options.seconds_read_var ~= '(None)' then node_text = node_text .. ' ' .. node.options.seconds_read_var .. ' = global_rtc_time_struct.RTC_Seconds;\n' end if node.options.minutes_read_var ~= '(None)' then node_text = node_text .. ' ' .. node.options.minutes_read_var .. ' = global_rtc_time_struct.RTC_Minutes;\n' end if node.options.hours_read_var ~= '(None)' then node_text = node_text .. ' ' .. node.options.hours_read_var .. ' = global_rtc_time_struct.RTC_Hours;\n' end -- (Done) if node.output and node.output.single then node_text = node_text .. ' goto NODE_' .. node.output.single .. ';\n' else return nil end node_text = node_text .. ' // (End "RTC Read Time" node)\n\n' if not varm_util.code_node_lode(node, node_text, proj_state) then return nil end return true end return node_reqs
local const = {} const.HTTP_METHODS = {} const.HTTP_METHODS.GET = "GET" const.HTTP_METHODS.HEAD = "HEAD" const.HTTP_METHODS.POST = "POST" const.HTTP_METHODS.PUT = "PUT" const.HTTP_METHODS.DELETE = "DELETE" const.HTTP_METHODS.OPTIONS = "OPTIONS" -- subset of total content-type -- reference:https://stackoverflow.com/questions/23714383/what-are-all-the-possible-values-for-http-content-type-header const.extension2content_type = { jpg = "image/jpeg", gif = "image/gif", png = "image/png", tiff = "image/tiff", css = "text/css", csv = "text/csv", html = "text/html", js = "text/javascript (obsolete)", xml = "text/xml", json = "application/json", pdf = "application/pdf", ogg = "application/ogg", zip = "application/zip", } return const
-- don't use require; that will pick up luarocks-installed module, not checkout local fennel = dofile("fennel.lua") table.insert(package.loaders or package.searchers, fennel.searcher) local generate = fennel.dofile("generate.fnl") local view = fennel.dofile("fennelview.fnl") -- Allow deterministic re-runs of generated things. local seed = os.getenv("SEED") or os.time() print("SEED=" .. seed) math.randomseed(seed) local pass, fail, err = 0, 0, 0 -- one global to store values in during tests _G.tbl = {} ---- core language tests ---- local cases = { calculations = { ["(+ 1 2 (- 1 2))"]=2, ["(* 1 2 (/ 1 2))"]=1, ["(+ 1 2 (^ 1 2))"]=4, ["(% 1 2 (- 1 2))"]=0, -- 1 arity results ["(- 1)"]=-1, ["(/ 2)"]=1/2, -- ["(// 2)"]=1//2, -- 0 arity results ["(+)"]=0, ["(*)"]=1, }, booleans = { ["(or false nil true 12 false)"]=true, ["(or 11 true false)"]=11, ["(and true 12 \"hey\")"]="hey", ["(and 43 table false)"]=false, ["(not true)"]=false, ["(not 39)"]=false, ["(not nil)"]=true, -- 1 arity results ["(or 5)"]=5, ["(and 5)"]=5, -- 0 arity results ["(or)"]=false, ["(and)"]=true, }, comparisons = { ["(> 2 0)"]=true, ["(> 2 0 -1)"]=true, ["(<= 5 1 91)"]=false, ["(> -4 89)"]=false, ["(< -4 89)"]=true, ["(>= 22 (+ 21 1))"]=true, ["(<= 88 32)"]=false, ["(not= 33 1)"]=true, ["(= 1 1 2 2)"]=false, ["(not= 6 6 9)"]=true, ["(let [f (fn [] (tset tbl :dbl (+ 1 (or (. tbl :dbl) 0))) 1)]\ (< 0 (f) 2) (. tbl :dbl))"]=1, }, parsing = { ["\"\\\\\""]="\\", ["\"abc\\\"def\""]="abc\"def", ["\"abc\\240\""]="abc\240", ["\"abc\n\\240\""]="abc\n\240", ["150_000"]=150000, }, functions = { -- regular function ["((fn [x] (* x 2)) 26)"]=52, -- nested functions ["(let [f (fn [x y f2] (+ x (f2 y)))\ f2 (fn [x y] (* x (+ 2 y)))\ f3 (fn [f] (fn [x] (f 5 x)))]\ (f 9 5 (f3 f2)))"]=44, -- closures can set vars they close over ["(var a 11) (let [f (fn [] (set a (+ a 2)))] (f) (f) a)"]=15, -- partial application ["(let [add (fn [x y] (+ x y)) inc (partial add 1)] (inc 99))"]=100, ["(let [add (fn [x y z] (+ x y z)) f2 (partial add 1 2)] (f2 6))"]=9, ["(let [add (fn [x y] (+ x y)) add2 (partial add)] (add2 99 2))"]=101, -- functions with empty bodies return nil ["(if (= nil ((fn [a]) 1)) :pass :fail)"]="pass", -- basic lambda ["((lambda [x] (+ x 2)) 4)"]=6, -- vararg lambda ["((lambda [x ...] (+ x 2)) 4)"]=6, -- lambdas perform arity checks ["(let [(ok e) (pcall (lambda [x] (+ x 2)))]\ (string.match e \"Missing argument x\"))"]="Missing argument x", -- lambda arity checks skip argument names starting with ? ["(let [(ok val) (pcall (λ [?x] (+ (or ?x 1) 8)))] (and ok val))"]=9, -- method calls work ["(: :hello :find :e)"]=2, -- method calls don't double side effects ["(var a 0) (let [f (fn [] (set a (+ a 1)) :hi)] (: (f) :find :h)) a"]=1, }, conditionals = { -- basic if ["(let [x 1 y 2] (if (= (* 2 x) y) \"yep\"))"]="yep", -- if can contain side-effects ["(var x 12) (if true (set x 22) 0) x"]=22, -- else branch works ["(if false \"yep\" \"nope\")"]="nope", -- else branch runs on nil ["(if non-existent 1 (* 3 9))"]=27, -- else works with temporaries ["(let [x {:y 2}] (if false \"yep\" (< 1 x.y 3) \"uh-huh\" \"nope\"))"]="uh-huh", -- when is for side-effects ["(var [a z] [0 0]) (when true (set a 192) (set z 12)) (+ z a)"]=204, -- when treats nil as falsey ["(var a 884) (when nil (set a 192)) a"]=884, -- when body does not run on false ["(when (= 12 88) (os.exit 1)) false"]=false, -- make sure bad code isn't emitted when an always-true -- condition exists in the middle of an if ["(if false :y true :x :trailing :condition)"]="x", }, core = { -- comments ["74 ; (require \"hey.dude\")"]=74, -- comments go to the end of the line ["(var x 12) ;; (set x 99)\n x"]=12, -- calling built-in lua functions ["(table.concat [\"ab\" \"cde\"] \",\")"]="ab,cde", -- table lookup ["(let [t []] (table.insert t \"lo\") (. t 1))"]="lo", -- nested table lookup ["(let [t [[21]]] (+ (. (. t 1) 1) (. t 1 1)))"]=42, -- table lookup base case ["(let [x 17] (. 17))"]=17, -- table lookup with literal ["(+ (. {:a 93 :b 4} :a) (. [1 2 3] 2))"]=95, -- table lookup with literal using matching-key-and-variable shorthand ["(let [k 5 t {: k}] t.k)"]=5, -- set works with multisyms ["(let [t {}] (set t.a :multi) (. t :a))"]="multi", -- set works on parent scopes ["(var n 0) (let [f (fn [] (set n 96))] (f) n)"]=96, -- set-forcibly! works on local & let vars ["(local a 3) (let [b 2] (set-forcibly! a 7) (set-forcibly! b 6) (+ a b))"]=13, -- local names with dashes in them ["(let [my-tbl {} k :key] (tset my-tbl k :val) my-tbl.key)"]="val", -- functions inside each ["(var i 0) (each [_ ((fn [] (pairs [1])))] (set i 1)) i"]=1, -- let with nil value ["(let [x 3 y nil z 293] z)"]=293, -- nested let inside loop ["(var a 0) (for [_ 1 3] (let [] (table.concat []) (set a 33))) a"]=33, -- set can be used as expression ["(var x 1) (let [_ (set x 92)] x)"]=92, -- tset can be used as expression ["(let [t {} _ (tset t :a 84)] (. t :a))"]=84, -- Setting multivalue vars ["(do (var a nil) (var b nil) (local ret (fn [] a)) (set (a b) (values 4 5)) (ret))"]=4, -- Tset doesn't screw up with table literal ["(do (tset {} :a 1) 1)"]=1, -- # is valid symbol constituent character ["(local x#x# 90) x#x#"]=90, -- : works on literal tables ["(: {:foo (fn [self] (.. self.bar 2)) :bar :baz} :foo)"]="baz2", }, ifforms = { ["(do (fn myfn [x y z] (+ x y z)) (myfn 1 (if 1 2 3) 4))"]=7, ["(do (fn myfn [x y z] (+ x y z)) (myfn 1 (if 1 (values 2 5) 3) 4))"]=7, ["(let [x (if false 3 (values 2 5))] x)"]=2, ["(if (values 1 2) 3 4)"]=3, ["(if (values 1) 3 4)"]=3, ["(do (fn myfn [x y z] (+ x y z)) (myfn 1 4 (if 1 2 3)))"]=7, }, destructuring = { -- regular tables ["(let [[a b c d] [4 2 43 7]] (+ (* a b) (- c d)))"]=44, -- mismatched count ["(let [[a b c] [4 2]] (or c :missing))"]="missing", ["(let [[a b] [9 2 49]] (+ a b))"]=11, -- recursively ["(let [[a [b c] d] [4 [2 43] 7]] (+ (* a b) (- c d)))"]=44, -- multiple values ["(let [(a b) ((fn [] (values 4 2)))] (+ a b))"]=6, -- multiple values recursively ["(let [(a [b [c] d]) ((fn [] (values 4 [2 [1] 9])))] (+ a b c d))"]=16, -- multiple values without function wrapper ["(let [(a [b [c] d]) (values 4 [2 [1] 9])] (+ a b c d))"]=16, -- global destructures tables ["(global [a b c d] [4 2 43 7]) (+ (* a b) (- c d))"]=44, -- global works with multiple values ["(global (a b) ((fn [] (values 4 29)))) (+ a b)"]=33, -- local keyword ["(local (-a -b) ((fn [] (values 4 29)))) (+ -a -b)"]=33, -- rest args ["(let [[a b & c] [1 2 3 4 5]] (+ a (. c 2) (. c 3)))"]=10, -- rest args on lambda ["((lambda [[a & b]] (+ a (. b 2))) [90 99 4])"]=94, -- all vars get flagged as var ["(var [a [b c]] [1 [2 3]]) (set a 2) (set c 8) (+ a b c)"]=12, -- fn args ["((fn dest [a [b c] [d]] (+ a b c d)) 5 [9 7] [2])"]=23, -- each ["(var x 0) (each [_ [a b] (ipairs [[1 2] [3 4]])] (set x (+ x (* a b)))) x"]=14, -- key/value destructuring ["(let [{:a x :b y} {:a 2 :b 4}] (+ x y))"]=6, -- key/value destructuring with the same names ["(let [{: a : b} {:a 3 :b 5}] (+ a b))"]=8, -- nesting k/v and sequential ["(let [{:a [x y z]} {:a [1 2 4]}] (+ x y z))"]=7, -- Local shadowing in let form ["(let [x 1 x (if (= x 1) 2 3)] x)"]=2, }, loops = { -- numeric loop ["(var x 0) (for [y 1 5] (set x (+ x 1))) x"]=5, -- numeric loop with step ["(var x 0) (for [y 1 20 2] (set x (+ x 1))) x"]=10, -- while loop ["(var x 0) (while (< x 7) (set x (+ x 1))) x"]=7, -- each loop iterates over tables ["(let [t {:a 1 :b 2} t2 {}]\ (each [k v (pairs t)]\ (tset t2 k v))\ (+ t2.a t2.b))"]=3, }, edge = { -- IIFE in if statement required ["(let [(a b c d e f g) (if (= (+ 1 1) 2) (values 1 2 3 4 5 6 7))] (+ a b c d e f g))"]=28, -- IIFE in if statement required v2 ["(let [(a b c d e f g) (if (= (+ 1 1) 3) nil\ ((or unpack table.unpack) [1 2 3 4 5 6 7]))]\ (+ a b c d e f g))"]=28, -- IIFE if test v3 ["(length [(if (= (+ 1 1) 2) (values 1 2 3 4 5) (values 1 2 3))])"]=5, -- IIFE if test v4 ["(select \"#\" (if (= 1 (- 3 2)) (values 1 2 3 4 5) :onevalue))"]=5, -- Values special in array literal ["(length [(values 1 2 3 4 5)])"]=5, ["(let [x (if 3 4 5)] x)"]=4, ["(do (local c1 20) (local c2 40) (fn xyz [A B] (and A B)) (xyz (if (and c1 c2) true false) 52))"]=52 }, macros = { -- built-in macros ["(let [x [1]]\ (doto x (table.insert 2) (table.insert 3)) (table.concat x))"]="123", -- arrow threading ["(-> (+ 85 21) (+ 1) (- 99))"]=8, ["(->> (+ 85 21) (+ 1) (- 99))"]=-8, -- nil-safe forms ["(-?> {:a {:b {:c :z}}} (. :a) (. :b) (. :c))"]="z", ["(-?> {:a {:b {:c :z}}} (. :a) (. :missing) (. :c))"]=nil, ["(-?>> :w (. {:w :x}) (. {:x :y}) (. {:y :z}))"]="z", ["(-?>> :w (. {:w :x}) (. {:x :missing}) (. {:y :z}))"]=nil, -- just a boring old set+fn combo ["(require-macros \"test-macros\")\ (defn1 hui [x y] (global z (+ x y))) (hui 8 4) z"]=12, -- macros with mangled names ["(require-macros \"test-macros\")\ (->1 9 (+ 2) (* 11))"]=121, -- macros loaded in function scope shouldn't leak to other functions ["((fn [] (require-macros \"test-macros\") (global x1 (->1 99 (+ 31)))))\ (pcall (fn [] (global x1 (->1 23 (+ 1)))))\ x1"]=130, -- special form [ [[(eval-compiler (tset _SPECIALS "reverse-it" (fn [ast scope parent opts] (tset ast 1 "do") (for [i 2 (math.ceil (/ (length ast) 2))] (let [a (. ast i) b (. ast (- (length ast) (- i 2)))] (tset ast (- (length ast) (- i 2)) a) (tset ast i b))) (_SPECIALS.do ast scope parent opts)))) (reverse-it 1 2 3 4 5 6)]]]=1, -- nesting quote can only happen in the compiler ["(eval-compiler (set tbl.nest ``nest))\ (tostring tbl.nest)"]="(quote, nest)", -- inline macros ["(macros {:plus (fn [x y] `(+ ,x ,y))}) (plus 9 9)"]=18, -- Vararg in quasiquote ["(macros {:x (fn [] `(fn [...] (+ 1 1)))}) ((x))"]=2, -- Threading macro with single function, with and without parens ["(-> 1234 (string.reverse) (string.upper))"]="4321", ["(-> 1234 string.reverse string.upper)"]="4321", -- Auto-gensym ["(macros {:m (fn [y] `(let [xa# 1] (+ xa# ,y)))}) (m 4)"]=5, }, hashfn = { -- Basic hashfn ["(#(+ $1 $2) 3 4)"]=7, -- Ignore arguments hashfn ["(#(+ $3 $4) 1 1 3 4)"]=7, -- One argument ["(#(+ $1 45) 1)"]=46, -- Immediately returned argument ["(+ (#$ 1) (#$2 2 3))"]=4, -- With let ["(let [f #(+ $1 45)] (f 1))"]=46, -- Complex body ["(let [f #(do (local a 1) (local b (+ $1 $1 a)) (+ a b))] (f 1))"]=4, -- Basic hashfn ($) ["(#(+ $ 2) 3)"]=5, -- Mixed $ types ["(let [f #(+ $ $1 $2)] (f 1 2))"]=4, -- Multisyms containing $ arguments ["(#$.foo {:foo :bar})"]="bar", ["(#$2.foo.bar.baz nil {:foo {:bar {:baz :quux}}})"]="quux", }, methodcalls = { -- multisym method call ["(let [x {:foo (fn [self arg1] (.. self.bar arg1)) :bar :baz}] (x:foo :quux))"]="bazquux", -- multisym method call on property ["(let [x {:y {:foo (fn [self arg1] (.. self.bar arg1)) :bar :baz}}] (x.y:foo :quux))"]="bazquux", }, match = { -- basic literal ["(match (+ 1 6) 7 8)"]=8, -- actually return the one that matches ["(match (+ 1 6) 7 8 8 1 9 2)"]=8, -- string literals? and values that come from locals? ["(let [s :hey] (match s :wat :no :hey :yes))"]="yes", -- tables please ["(match [:a :b :c] [a b c] (.. b :eee))"]="beee", -- tables with literals in them ["(match [:a :b :c] [1 t d] :no [a b :d] :NO [a b :c] b)"]="b", -- nested tables ["(match [:a [:b :c]] [a b :c] :no [:a [:b c]] c)"]="c", -- non-sequential tables ["(match {:a 1 :b 2} {:c 3} :no {:a n} n)"]=1, -- nested non-sequential ["(match [:a {:b 8}] [a b :c] :no [:a {:b b}] b)"]=8, -- unification ["(let [k :k] (match [5 :k] :b :no [n k] n))"]=5, -- length mismatch ["(match [9 5] [a b c] :three [a b] (+ a b))"]=14, -- 3rd arg may be nil here ["(match [9 5] [a b ?c] :three [a b] (+ a b))"]="three", -- no double-eval ["(var x 1) (fn i [] (set x (+ x 1)) x) (match (i) 4 :N 3 :n 2 :y)"]="y", -- multi-valued ["(match (values 5 9) 9 :no (a b) (+ a b))"]=14, -- multi-valued with nil ["(match (values nil :nonnil) (true _) :no (nil b) b)"]="nonnil", -- error values ["(match (io.open \"/does/not/exist\") (nil msg) :err f f)"]="err", -- last clause becomes default ["(match [1 2 3] [3 2 1] :no [2 9 1] :NO :default)"]="default", -- intra-pattern unification ["(match [1 2 3] [x y x] :no [x y z] :yes)"]="yes", ["(match [1 2 1] [x y x] :yes)"]="yes", ["(match (values 1 [1 2]) (x [x x]) :no (x [x y]) :yes)"]="yes", -- external unification ["(let [x 95] (match [52 85 95] [x y z] :nope [a b x] :yes))"]="yes", -- deep nested unification ["(match [1 2 [[3]]] [x y [[x]]] :no [x y z] :yes)"]="yes", ["(match [1 2 [[1]]] [x y [z]] (. z 1))"]=1, -- _ wildcard ["(match [1 2] [_ _] :wildcard)"]="wildcard", ["(match nil _ :yes nil :no)"]="yes", -- rest args ["(match [1 2 3] [a & b] (+ a (. b 1) (. b 2)))"]=6, ["(match [1] [a & b] (# b))"]=0, -- guard clause ["(match {:sieze :him} \ (tbl ? (. tbl :no)) :no \ (tbl ? (. tbl :sieze)) :siezed)"]="siezed", -- multiple guard clauses ["(match {:sieze :him} \ (tbl ? tbl.sieze tbl.no) :no \ (tbl ? tbl.sieze (= tbl.sieze :him)) :siezed2)"]="siezed2", -- guards with patterns inside ["(match [{:sieze :him} 5] \ ([f 4] ? f.sieze (= f.sieze :him)) 4\ ([f 5] ? f.sieze (= f.sieze :him)) 5)"]=5, ["(match [1] [a & b] (length b))"]=0, -- multisym ["(let [x {:y :z}] (match :z x.y 1 _ 0))"]=1, -- never unify underscore ["(let [_ :bar] (match :foo _ :should-match :foo :no))"]="should-match", } } for name, tests in pairs(cases) do print("Running tests for " .. name .. "...") for code, expected in pairs(tests) do local ok, res = pcall(fennel.eval, code, {allowedGlobals = false}) if not ok then err = err + 1 print(" Error: " .. res .. " in: ".. fennel.compile(code)) else if expected ~= res then fail = fail + 1 print(" Expected " .. view(res) .. " to be " .. view(expected)) else pass = pass + 1 end end end end ---- fennelview tests ---- local function count(t) local c = 0 for _ in pairs(t) do c = c + 1 end return c end local function table_equal(a, b, deep_equal) local miss_a, miss_b = {}, {} for k in pairs(a) do if deep_equal(a[k], b[k]) then a[k], b[k] = nil, nil end end for k, v in pairs(a) do if type(k) ~= "table" then miss_a[view(k)] = v end end for k, v in pairs(b) do if type(k) ~= "table" then miss_b[view(k)] = v end end return (count(a) == count(b)) or deep_equal(miss_a, miss_b) end local function deep_equal(a, b) if (a ~= a) or (b ~= b) then return true end -- don't fail on nan if type(a) == type(b) then if type(a) == "table" then return table_equal(a, b, deep_equal) end return tostring(a) == tostring(b) end end print("Running tests for fennelview...") for _ = 1, 16 do local item = generate() local ok, viewed = pcall(view, item) if ok then local ok2, round_tripped = pcall(fennel.eval, viewed) if(ok2) then if deep_equal(item, round_tripped) then pass = pass + 1 else print("Expected " .. viewed .. " to round-trip thru view/eval: " .. tostring(round_tripped)) fail = fail + 1 end else print(" Error loading viewed item: " .. viewed, round_tripped) err = err + 1 end else print(" Error viewing " .. tostring(item)) err = err + 1 end end ---- tests for compilation failures ---- local compile_failures = { ["(f"]="expected closing delimiter %) in unknown:1", ["\n\n(+))"]="unexpected closing delimiter %) in unknown:3", ["(fn)"]="expected vector arg list", ["(fn [12])"]="expected symbol for function parameter", ["(fn [:huh] 4)"]="expected symbol for function parameter", ["(fn [false] 4)"]="expected symbol for function parameter", ["(fn [nil] 4)"]="expected symbol for function parameter", ["(lambda [x])"]="missing body", ["(let [x 1])"]="missing body", ["(let [x 1 y] 8)"]="expected even number of name/value bindings", ["(let [[a & c d] [1 2]] c)"]="rest argument in final position", ["(set a 19)"]="error in 'set' unknown:1: expected local var a", ["(set [a b c] [1 2 3]) (+ a b c)"]="expected local var", ["(let [x 1] (set-forcibly! x 2) (set x 3) x)"]="expected local var", ["(not true false)"]="expected one argument", ["\n\n(let [x.y 9] nil)"]="unknown:3: did not expect multi", ["()"]="expected a function to call", ["(789)"]="789.*cannot call literal value", ["(fn [] [...])"]="unexpected vararg", -- line numbers ["(set)"]="Compile error in 'set' unknown:1: expected name and value", ["(let [b 9\nq (.)] q)"]="2: expected table argument", ["(do\n\n\n(each \n[x 34 (pairs {})] 21))"]="4: expected iterator symbol", ["(fn []\n(for [32 34 32] 21))"]="2: expected iterator symbol", ["\n\n(let [f (lambda []\n(local))] (f))"]="4: expected name and value", ["(do\n\n\n(each \n[x (pairs {})] (when)))"]="when' unknown:5:", -- macro errors have macro names in them ["\n(when)"]="Compile error in .when. unknown:2", -- strict about unknown global reference ["(hey)"]="unknown global", ["(fn global-caller [] (hey))"]="unknown global", ["(let [bl 8 a bcd] nil)"]="unknown global", ["(let [t {:a 1}] (+ t.a BAD))"]="BAD", ["(each [k v (pairs {})] (BAD k v))"]="BAD", ["(global good (fn [] nil)) (good) (BAD)"]="BAD", -- shadowing built-ins ["(global + 1)"]="overshadowed", ["(global // 1)"]="overshadowed", ["(global let 1)"]="overshadowed", ["(global - 1)"]="overshadowed", ["(let [global 1] 1)"]="overshadowed", ["(fn global [] 1)"]="overshadowed", -- symbol capture detection ["(macros {:m (fn [y] `(let [x 1] (+ x ,y)))}) (m 4)"]= "tried to bind x without gensym", ["(macros {:m (fn [t] `(fn [xabc] (+ xabc 9)))}) ((m 4))"]= "tried to bind xabc without gensym", ["(macros {:m (fn [t] `(each [mykey (pairs ,t)] (print mykey)))}) (m [])"]= "tried to bind mykey without gensym", -- legal identifier rules ["(let [:x 1] 1)"]="unable to bind", ["(let [false 1] 9)"]="unable to bind false", ["(let [nil 1] 9)"]="unable to bind nil", ["(local 47 :forty-seven)"]="unable to bind 47", ["(global 48 :forty-eight)"]="unable to bind 48", ["(let [t []] (set t.47 :forty-seven))"]= "can't start multisym segment with digit: t.47", ["(let [t []] (set t.:x :y))"]="malformed multisym: t.:x", ["(let [t []] (set t:.x :y))"]="malformed multisym: t:.x", ["(let [t []] (set t::x :y))"]="malformed multisym: t.:x", -- other ["(match [1 2 3] [a & b c] nil)"]="rest argument in final position", ["(x(y))"]="expected whitespace before opening delimiter %(", ["(x[1 2])"]="expected whitespace before opening delimiter %[", ["(let [x {:foo (fn [self] self.bar) :bar :baz}] x:foo)"]= "multisym method calls may only be in call position", ["(let [x {:y {:foo (fn [self] self.bar) :bar :baz}}] x:y:foo)"]= "method call must be last component of multisym: x:y:foo", } print("Running tests for compile errors...") for code, expected_msg in pairs(compile_failures) do local ok, msg = pcall(fennel.compileString, code, {allowedGlobals = {"pairs"}}) if(ok) then fail = fail + 1 print(" Expected failure when compiling " .. code .. ": " .. msg) elseif(not msg:match(expected_msg)) then fail = fail + 1 print(" Expected " .. expected_msg .. " when compiling " .. code .. " but got " .. msg) else pass = pass + 1 end end ---- mangling and unmangling ---- -- Mapping from any string to Lua identifiers. (in practice, will only be from -- fennel identifiers to lua, should be general for programatically created -- symbols) local mangling_tests = { ['a'] = 'a', ['a_3'] = 'a_3', ['3'] = '__fnl_global__3', -- a fennel symbol would usually not be a number ['a-b-c'] = '__fnl_global__a_2db_2dc', ['a_b-c'] = '__fnl_global__a_5fb_2dc', } print("Running tests for mangling / unmangling...") for k, v in pairs(mangling_tests) do local manglek = fennel.mangle(k) local unmanglev = fennel.unmangle(v) if v ~= manglek then print(" Expected fennel.mangle(" .. k .. ") to be " .. v .. ", got " .. manglek) fail = fail + 1 else pass = pass + 1 end if k ~= unmanglev then print(" Expected fennel.unmangle(" .. v .. ") to be " .. k .. ", got " .. unmanglev) fail = fail + 1 else pass = pass + 1 end end ---- quoting and unquoting ---- local quoting_tests = { ['`:abcde'] = {"return \"abcde\"", "simple string quoting"}, [',a'] = {"return unquote(a)", "unquote outside quote is simply passed thru"}, ['`[1 2 ,(+ 1 2) 4]'] = { "return {1, 2, (1 + 2), 4}", "unquote inside quote leads to evaluation" }, ['(let [a (+ 2 3)] `[:hey ,(+ a a)])'] = { "local a = (2 + 3)\nreturn {\"hey\", (a + a)}", "unquote inside other forms" }, ['`[:a :b :c]'] = { "return {\"a\", \"b\", \"c\"}", "quoted sequential table" }, ['`{:a 5 :b 9}'] = { { ["return {[\"a\"]=5, [\"b\"]=9}"] = true, ["return {[\"b\"]=9, [\"a\"]=5}"] = true, }, "quoted keyed table" } } print("Running tests for quote / unquote...") for k, v in pairs(quoting_tests) do local compiled = fennel.compileString(k, {allowedGlobals=false}) local accepted, ans = v[1] if type(accepted) ~= 'table' then ans = accepted accepted = {} accepted[ans] = true end local message = v[2] local errorformat = "While testing %s\n" .. "Expected fennel.compileString(\"%s\") to be \"%s\" , got \"%s\"" if accepted[compiled] then pass = pass + 1 else print(errorformat:format(message, k, ans, compiled)) fail = fail + 1 end end ---- misc one-off tests ---- if pcall(fennel.eval, "(->1 1 (+ 4))", {allowedGlobals = false}) then fail = fail + 1 print(" Expected require-macros not leak into next evaluation.") else pass = pass + 1 end if pcall(fennel.eval, "`(hey)", {allowedGlobals = false}) then fail = fail + 1 print(" Expected quoting lists to fail at runtime.") else pass = pass + 1 end if pcall(fennel.eval, "`[hey]", {allowedGlobals = false}) then fail = fail + 1 print(" Expected quoting syms to fail at runtime.") else pass = pass + 1 end if not pcall(fennel.eval, "(.. hello-world :w)", {env = {["hello-world"] = "hi"}}) then fail = fail + 1 print(" Expected global mangling to work.") else pass = pass + 1 end local g = {["hello-world"] = "hi", tbl = _G.tbl, -- tragically lua 5.1 does not have metatable-aware pairs so we fake it here pairs = function(t) local mt = getmetatable(t) if(mt and mt.__pairs) then return mt.__pairs(t) else return pairs(t) end end} g._G = g if(not pcall(fennel.eval, "(each [k (pairs _G)] (tset tbl k true))", {env = g}) or not _G.tbl["hello-world"]) then fail = fail + 1 print(" Expected wrapped _G to support env iteration.") else pass = pass + 1 end do local e = {} if (not pcall(fennel.eval, "(global x-x 42)", {env = e}) or not pcall(fennel.eval, "x-x", {env = e})) then fail = fail + 1 print(" Expected mangled globals to be accessible across eval invocations.") else pass = pass + 1 end end print(string.format("\n%s passes, %s failures, %s errors.", pass, fail, err)) if(fail > 0 or err > 0) then os.exit(1) end
-- Load setting local suffocation_damage = tonumber(minetest.settings:get("real_suffocation_damage")) or 10 local function is_truthy(val) return val ~= nil and val ~= false and val ~= 0 and val ~= "" end local function should_suffocate(def) --[[ Here comes the HUGE conditional deciding whether we use suffocation. We want to catch as many nodes as possible while avoiding bad nodes. We care mostly about physical properties, we don't care about visual appearance. Here's what it checks and why: - Walkable: Must be walkable, which means player can get stuck inside. If player can move freely, suffocation does not make sense - Drowning and damage: If node has set any of those explicitly, it probably knows why. We don't want to mess with it. - collision_box, node_box: Checks whether we deal with full-sized standard cubes, since only care about those. Everything else is probably too small for suffocation to seem real. - disable_suffocation group: If set to 1, we bail out. This makes it possible for nodes to defend themselves against hacking. :-) ]] local groups = def.groups or {} return (def.walkable == nil or def.walkable == true) and (def.drowning == nil or def.drowning == 0) and (def.damage_per_second == nil or def.damage_per_second <= 0) and (def.collision_box == nil or def.collision_box.type == "regular") and (def.node_box == nil or def.node_box.type == "regular") and not is_truthy(groups.disable_suffocation) and not is_truthy(groups.door) end -- Checks all nodes and adds suffocation (drowning damage) for suitable nodes local function add_suffocation() -- For debugging output local suffocate_nodes = {} local no_suffocate_nodes = {} -- Check ALL the nodes! for itemstring, def in pairs(minetest.registered_nodes) do if should_suffocate(def) then -- Add “real_suffocation” group so other mods know this node was touched by this mod local marked_groups = table.copy(def.groups) marked_groups.real_suffocation = 1 -- Let's hack the node! minetest.override_item(itemstring, { drowning = suffocation_damage, groups = marked_groups }) table.insert(suffocate_nodes, itemstring) else table.insert(no_suffocate_nodes, itemstring) end end minetest.log("info", "[real_suffocation] Suffocation has been hacked into "..#suffocate_nodes.." nodes.") minetest.log("verbose", "[real_suffocation] Nodes with suffocation: "..dump(suffocate_nodes)) minetest.log("verbose", "[real_suffocation] Suffocation has not been hacked into "..#no_suffocate_nodes.." nodes: "..dump(no_suffocate_nodes)) end -- Skip the rest if suffocation damage is 0, no point in overwriting stuff if suffocation_damage > 0 then -- This is a minor hack to make sure our loop runs after all nodes have been registered minetest.after(0, add_suffocation) end
local listMgr = require 'vm.list' local sourceMgr = require 'vm.source' local newClass = require 'emmy.class' local newType = require 'emmy.type' local newTypeUnit = require 'emmy.typeUnit' local newAlias = require 'emmy.alias' local newParam = require 'emmy.param' local newReturn = require 'emmy.return' local newField = require 'emmy.field' local newGeneric = require 'emmy.generic' local newArrayType = require 'emmy.arrayType' local newTableType = require 'emmy.tableType' local newFuncType = require 'emmy.funcType' local mt = {} mt.__index = mt mt.__name = 'emmyMgr' function mt:flushClass(name) local list = self._class[name] if not list then return end local version = listMgr.getVersion() if version == list.version then return end for srcId in pairs(list) do if not listMgr.get(srcId) then list[srcId] = nil end end if not next(list) then self._class[name] = nil return end list.version = version end function mt:eachClassByName(name, callback) self:flushClass(name) local list = self._class[name] if not list then return end for k, class in pairs(list) do if k ~= 'version' then local res = callback(class) if res ~= nil then return res end end end end function mt:eachClass(...) local n = select('#', ...) if n == 1 then local callback = ... for name in pairs(self._class) do local res = self:eachClassByName(name, callback) if res ~= nil then return res end end else local name, callback = ... return self:eachClassByName(name, callback) end end function mt:getClass(name) self:flushClass(name) local list = self._class[name] local version = listMgr.getVersion() if not list then list = { version = version, } self._class[name] = list end return list end function mt:newClass(name, extends, source) local list = self:getClass(name) list[source.id] = newClass(self, name, extends, source) return list[source.id] end function mt:addClass(source) local className = source[1][1] local extends = source[2] and source[2][1] local class = self:newClass(className, extends, source) return class end function mt:addType(source) local typeObj = newType(self, source) for i, obj in ipairs(source) do local typeUnit = newTypeUnit(self, obj) local className = obj[1] if className then local list = self:getClass(className) list[source.id] = typeUnit end typeUnit:setParent(typeObj) typeObj._childs[i] = typeUnit obj:set('emmy.typeUnit', typeUnit) end return typeObj end function mt:addArrayType(source) local typeObj = self:addType(source) local arrayTypeObj = newArrayType(self, source, typeObj) return arrayTypeObj end function mt:addTableType(source, keyType, valueType) local typeObj = newTableType(self, source, keyType, valueType) return typeObj end function mt:addFunctionType(source) local typeObj = newFuncType(self, source) return typeObj end function mt:addAlias(source, typeObj) local aliasName = source[1][1] local aliasObj = newAlias(self, source) aliasObj:bindType(typeObj) local list = self:getClass(aliasName) list[source.id] = aliasObj for i = 3, #source do aliasObj:addEnum(source[i]) end return aliasObj end function mt:addParam(source, bind) local paramObj = newParam(self, source) if bind.type == 'emmy.generic' then paramObj:bindGeneric(bind) else paramObj:bindType(bind) self:eachClass(bind:getType(), function (class) if class.type == 'emmy.alias' then class:eachEnum(function (enum) paramObj:addEnum(enum) end) end end) end for i = 3, #source do paramObj:addEnum(source[i]) end paramObj:setOption(source.option) return paramObj end function mt:addReturn(source, bind, name) local returnObj = newReturn(self, source, name) if bind then if bind.type == 'emmy.generic' then returnObj:bindGeneric(bind) else returnObj:bindType(bind) end end return returnObj end function mt:addField(source, typeObj, value) local fieldObj = newField(self, source) fieldObj:bindType(typeObj) fieldObj:bindValue(value) return fieldObj end function mt:addGeneric(defs) local genericObj = newGeneric(self, defs) return genericObj end function mt:remove() end function mt:count() local count = 0 for _, list in pairs(self._class) do for k in pairs(list) do if k ~= 'version' then count = count + 1 end end end return count end return function () ---@class emmyMgr local self = setmetatable({ _class = {}, }, mt) local source = sourceMgr.dummy() self:newClass('any', nil, source) self:newClass('string', 'any', source) self:newClass('number', 'any', source) self:newClass('integer', 'number', source) self:newClass('boolean', 'any', source) self:newClass('table', 'any', source) self:newClass('function', 'any', source) self:newClass('nil', 'any', source) self:newClass('userdata', 'any', source) self:newClass('thread', 'any', source) return self end
local llthreads = require "llthreads" local chan = require "chan" local ch1 = chan.new("ch1", 4) assert(ch1:send(1, 0)) assert(ch1:send(2, 0)) assert(ch1:send(3, 0)) assert(ch1:send(4, 0)) assert(not ch1:send(5, 0)) for i = 1, 4 do local v = ch1:recv(0) assert(v - i == 0) end assert(ch1:recv(0) == nil) local ch2 = chan.new("ch2") assert(not ch2:send(1, 0)) local code = [[ local chan = require "chan" local ch = chan.get("ch2") ch:recv() ]] local t = {} for i = 1, 4 do t[i] = llthreads.new(code) t[i]:start() end for i = 1, 4 do assert(ch2:send(i, 0)) end assert(not ch2:send(1, 0)) for i = 1, 4 do t[i]:join() end
--[[ GUI FRAMEWORK by RedPolygon --]] -- VARIABLES local GUI = {} GUI.modules = {} GUI.version = "0.2" -- FUNCTIONS -- Create new main object function GUI.new() local main = { calc = {} } main.objects = {} main.x, main.y = 0, 0 main.w, main.h = love.graphics.getWidth(), love.graphics.getHeight() main.calc.x, main.calc.y = main.x, main.y return setmetatable( main, {__index = GUI} ) end -- Add a child object function GUI:addChild( module, data ) if type(module) == "string" then -- Create new element and insert it if not GUI.modules[module] then error("No such module: "..module) end table.insert( self.objects, 1, GUI.modules[module]:new( self, data ) ) local object = self.objects[1] object:update() -- Add specified child objects if data.objects then for i = 1, #data.objects do object:addChild( data.objects[1][1], data.objects[1][2] ) end end object.mt = object.mt or {} object.mt.__index = object.mt.__index and object.mt.__index(object) or object object.mt.__newindex = object.mt.__newindex and object.mt.__newindex(object) or object return setmetatable( {}, object.mt ) elseif type(module) == "table" then -- Clone existing element table.insert( self.objects, 1, module ) return setmetatable( {}, {__index = self.objects[1], __newindex = self.objects[1]} ) end end -- Draw child objects function GUI:drawObjects() for i = #self.objects, 1, -1 do -- Reverse loop self.objects[i]:draw() end end GUI.draw = GUI.drawObjects -- Execute event functions function GUI:event( event, ... ) for _, v in ipairs(self.objects) do if type( v[event] ) == "function" then v[event](v, ...) end if v.objects then v:event( event, ... ) end end end -- Find elements by ID function GUI:find(id) if type(id) == "number" then -- Find by index return setmetatable( {}, self.objects[id].mt ) elseif type(id) == "string" then -- Find by id for _, v in ipairs(self.objects) do if v.id == id then return setmetatable( {}, v.mt ) end end return {} end end -- LOAD MODULES local modules = require "ui/guiModules" for k, v in pairs(modules) do GUI.modules[k] = setmetatable( modules[k], {__index = GUI} ) end -- RETURN return setmetatable( GUI, {__call = GUI.new} )
max_dist = 1000000 function func_calculate_overlapping(mask1, mask2) -- mask2 is ground truth local beg_i = 0 local last_i = 0 if mask1[1] > mask2[1] then beg_i = mask1[1] else beg_i = mask2[1] end if mask1[2] > mask2[2] then last_i = mask2[2] else last_i = mask1[2] end if beg_i > last_i then return 0 else return (last_i - beg_i + 1)/(mask2[2] - mask2[1] + 1) end end function func_calculate_iou(mask1, mask2) local beg_i = 0 local last_i = 0 local beg_u = 0 local last_u = 0 if mask1[1] > mask2[1] then beg_i = mask1[1] beg_u = mask2[1] else beg_i = mask2[1] beg_u = mask1[1] end if mask1[2] > mask2[2] then last_i = mask2[2] last_u = mask1[2] else last_i = mask1[2] last_u = mask2[2] end if beg_i > last_i then return 0 else return (last_i - beg_i)/(last_u - beg_u) end end function func_follow_iou(mask, gt_mask, available_objects, iou_table) local result_table = torch.Tensor(iou_table:size()):fill(0) local iou = 0 local new_iou = 0 local index = 0 for i = 1, table.getn(gt_mask) do if available_objects[i] == 1 then iou = func_calculate_iou(mask, gt_mask[i]) result_table[i] = iou else result_table[i] = -1 end end new_iou, index = torch.max(result_table, 1) -- from tensor to numeric type new_iou = new_iou[1] index = index[1] iou = iou_table[index] return iou, new_iou, result_table, index end function func_calculate_dist(mask1, mask2) local dist = max_dist if mask1[1] >= mask2[2] then dist = mask1[1] - mask2[2] + 1 elseif mask1[2] <= mask2[1] then dist = mask2[1] - mask1[2] else dist = 0 end return dist end function func_follow_dist_iou(mask, gt_mask, available_objects, iou_table,dist_table) local result_iou_table = torch.Tensor(iou_table:size()):fill(0) local result_dist_table = torch.Tensor(dist_table:size()):fill(0) local iou = 0 local new_iou = 0 local dist = max_dist local old_dist = max_dist local index = 0 for i = 1, table.getn(gt_mask) do if available_objects[i] == 1 then iou = func_calculate_iou(mask, gt_mask[i]) result_iou_table[i] = iou if iou == 0 then dist = func_calculate_dist(mask, gt_mask[i]) result_dist_table[i] = dist else result_dist_table[i] = 0 end else result_iou_table[i] = -1 result_dist_table[i] = max_dist+1 end end new_iou, index = torch.max(result_iou_table, 1) -- from tensor to numeric type new_iou = new_iou[1] index = index[1] if new_iou == 0 then new_dist, index = torch.min(result_dist_table, 1) new_dist = new_dist[1] index = index[1] else new_dist = 0 end iou = iou_table[index] dist = dist_table[index] return dist, new_dist, result_dist_table, iou, new_iou, result_iou_table, index end function func_find_max_iou(mask, gt_mask) local result_table = torch.Tensor(#gt_mask):fill(0) local iou = 0 local index = 0 for i = 1, table.getn(gt_mask) do iou = func_calculate_iou(mask, gt_mask[i]) result_table[i] = iou end iou, index = torch.max(result_table, 1) -- from tensor to numeric type index = index[1] iou = iou[1] if iou == 0 then -- if iou = zero, map to no gt index = 0 end return iou, index end
-- Gets data on the PPM/PGM/PBM family. -- Contributed by Carsten Dominik <dominik@strw.LeidenUniv.nl> local function size (stream, options) local header = stream:read(1024) if not header or header:len() < 9 then return nil, nil, "PNM file header missing" end local without_comments = header:gsub("\n#[^\n]*", "\n") -- PNM file of some sort local _, _, n, x, y = without_comments:find("^(P[1-7])%s+(%d+)%s+(%d+)") if not n then return nil, nil, "bad PNM header" end x, y = tonumber(x), tonumber(y) if n == "P1" or n == "P4" then return x, y, "image/x-portable-bitmap" elseif n == "P2" or n == "P5" then return x, y, "image/x-portable-graymap" elseif n == "P3" or n == "P6" then return x, y, "image/x-portable-pixmap" elseif n == "P7" then -- John Bradley's XV thumbnail pics (thanks to inwap@jomis.Tymnet.COM) _, _, x, y = header:find("IMGINFO:(%d+)x(%d+)") if not x then return nil, nil, "bad XV thumbnail header" end return tonumber(x), tonumber(y), "image/x-xv-thumbnail" else assert(false, "this should never happen") end end return size -- vi:ts=4 sw=4 expandtab
local util = require 'lspconfig.util' return { default_config = { cmd = { 'salt_lsp_server' }, filetypes = { 'sls' }, root_dir = util.find_git_ancestor, single_file_support = true, }, docs = { description = [[ Language server for Salt configuration files. https://github.com/dcermak/salt-lsp The language server can be installed with `pip`: ```sh pip install salt-lsp ``` ]], default_config = { root_dir = [[root_pattern('.git')]], }, }, }
local class = require "class" local type = type local assert = assert local ipairs = ipairs local fmt = string.format local tconcat = table.concat local Set = class("Set") function Set:ctor(opt) self.type = "set" self.comment = opt.comment -- 注释 self.primary = opt.primary -- 主键 self.default = opt.default -- 默认值 self.values = opt.values -- 枚举值 self.name = opt.name -- 字段名 end -- 验证字段传值有效 function Set:verify(x) if type(x) ~= 'string' then return false end for _, v in ipairs(self.values) do if x == v then return true end end return false end -- 是否为自增 function Set:isAutoIncrement() return false end -- 是否为主键 function Set:isPrimary() return self.primary end -- 字段位置记录 function Set:setIndex(index) self.index = index end -- 将字段转DDL语句 function Set:toSqlDefine() local DDL = {" "} DDL[#DDL+1] = fmt([[`%s`]], assert(type(self.name) == 'string' and self.name ~= '' and self.name, "Invalid field name")) if type(self.values) == 'string' then DDL[#DDL+1] = fmt([[SET('%s')]], self.values) elseif type(self.values) == 'table' and #self.values > 0 then local list = {} for _, v in ipairs(self.values) do list[#list+1] = fmt([['%s']], v) end DDL[#DDL+1] = fmt([[SET('%s')]], tconcat(list, ", ")) else error("Invalid `SET` field values.") end if self:isPrimary() then assert(not self.null, "The `primary` field must be `non-NULL`.") end if self.default then DDL[#DDL+1] = fmt("DEFAULT '%s'", assert(type(self.default) == 'string' and utf8.len(self.default) <= self.length and self.default, fmt("`%s` field has invalid default value.", self.name))) end if self.comment then DDL[#DDL+1] = fmt("COMMENT '%s'", self.comment) end return tconcat(DDL, " ") end return function (meta) return Set:new(assert(meta)) end
local draw = function (self, screen, color) love.graphics.draw( self.sprite, self.x, self.y, 0, screen.scale, screen.scale ) local w = self.sprite:getWidth() local h = self.sprite:getHeight() love.graphics.printf( self.text, self.x + 32, self.y + 32, w * screen.scale - 64, 'left') love.graphics.printf( '[c] to close', self.x, self.y + h*screen.scale - 32, w * screen.scale, 'center') end local update = function () end return function (text) local textBox = {} textBox.text = text textBox.sprite = love.graphics.newImage('assets/textBox.png') textBox.sprite:setFilter('nearest', 'nearest') textBox.x = 0 textBox.y = 2 * 32 textBox.draw = draw textBox.update = update return textBox end
local BODY_TEXTURE_NAME = "body" local shaders = {} local isVisible = false local function replaceTexture(vehicle, textureName, texture) if not isElement(vehicle) or type(textureName) ~= "string" or not isElement(texture) then return false end local shader = shaders[vehicle] if isElement(shader) then destroyElement(shader) shader = nil end if not isElement(shader) then -- Создание нового шейдера shader = dxCreateShader("texture_replace.fx") end -- Не удалось создать шейдер if not shader then return false end engineApplyShaderToWorldTexture(shader, textureName, vehicle) shader:setValue("gTexture", texture) shaders[vehicle] = shader return true end bindKey("m", "down", function () if isVisible then for k, v in pairs(shaders) do if isElement(v) then destroyElement(v) end end shaders = {} else local texture = dxCreateTexture("image.png") for k, vehicle in pairs(getElementsByType("vehicle")) do replaceTexture(vehicle, BODY_TEXTURE_NAME, texture) end destroyElement(texture) end isVisible = not isVisible end)
local utils = require("utils") local drawing = require("utils.drawing") local atlases = require("atlases") local drawableSprite = require("structs.drawable_sprite") local matrixLib = require("utils.matrix") local drawableNinePatch = {} local drawableNinePatchMt = {} drawableNinePatchMt.__index = {} function drawableNinePatchMt.__index:getSpriteSize(sprite) if self.useRealSize then return sprite.meta.realWidth, sprite.meta.realHeight end return sprite.meta.width, sprite.meta.height end function drawableNinePatchMt.__index:cacheNinePatchMatrix() local sprite = drawableSprite.fromTexture(self.texture, {}) if sprite and sprite.meta then if not sprite.meta.ninePatchMatrix then local hideOverflow = self.hideOverflow local realSize = self.useRealSize local tileWidth, tileHeight = self.tileWidth, self.tileHeight local spriteWidth, spriteHeight = self:getSpriteSize(sprite) local widthInTiles, heightInTiles = math.ceil(spriteWidth / tileWidth), math.ceil(spriteHeight / tileHeight) local matrix = matrixLib.filled(nil, widthInTiles, heightInTiles) for x = 1, widthInTiles do for y = 1, heightInTiles do matrix:set(x, y, sprite:getRelativeQuad((x - 1) * tileWidth, (y - 1) * tileHeight, tileWidth, tileHeight, hideOverflow, realSize)) end end sprite.meta.ninePatchMatrix = matrix return matrix else return sprite.meta.ninePatchMatrix end end end function drawableNinePatchMt.__index:getMatrix() return self:cacheNinePatchMatrix() end local function getMatrixSprite(atlas, texture, x, y, matrix, quadX, quadY) local sprite = drawableSprite.fromTexture(texture, {x = x, y = y, atlas = atlas}) sprite:setJustification(0.0, 0.0) sprite.quad = matrix:get(quadX, quadY) return sprite end local function getRelativeQuadSprite(atlas, texture, x, y, quadX, quadY, quadWidth, quadHeight, hideOverflow, realSize) local sprite = drawableSprite.fromTexture(texture, {x = x, y = y, atlas = atlas}) sprite:setJustification(0.0, 0.0) sprite:useRelativeQuad(quadX, quadY, quadWidth, quadHeight, hideOverflow, realSize) return sprite end function drawableNinePatchMt.__index:addCornerQuads(sprites, atlas, texture, x, y, width, height, matrix, spriteWidth, spriteHeight) local borderLeft, borderRight, borderTop, borderBottom = self.borderLeft, self.borderRight, self.borderTop, self.borderBottom local offsetX = self.drawWidth - borderRight local offsetY = self.drawHeight - borderBottom local hideOverflow = self.hideOverflow local realSize = self.useRealSize -- Top Left if width > 0 and height > 0 and borderLeft > 0 and borderTop > 0 then table.insert(sprites, getRelativeQuadSprite(atlas, texture, x, y, 0, 0, borderLeft, borderTop, hideOverflow, realSize)) end -- Top Right if width > borderLeft and height >= 0 and borderRight > 0 and borderTop > 0 then table.insert(sprites, getRelativeQuadSprite(atlas, texture, x + offsetX, y, spriteWidth - borderRight, 0, borderRight, borderTop, hideOverflow, realSize)) end -- Bottom Left if width > 0 and height > borderBottom then table.insert(sprites, getRelativeQuadSprite(atlas, texture, x, y + offsetY, 0, spriteHeight - borderBottom, borderLeft, borderBottom, hideOverflow, realSize)) end -- Bottom Right if width > borderRight and height > borderBottom then table.insert(sprites, getRelativeQuadSprite(atlas, texture, x + offsetX, y + offsetY, spriteWidth - borderRight, spriteHeight - borderBottom, borderLeft, borderBottom, hideOverflow, realSize)) end end function drawableNinePatchMt.__index:addEdgeQuads(sprites, atlas, texture, x, y, width, height, matrix, spriteWidth, spriteHeight) local borderLeft, borderRight, borderTop, borderBottom = self.borderLeft, self.borderRight, self.borderTop, self.borderBottom local oppositeOffsetX = width - borderRight local oppositeOffsetY = height - borderBottom local repeatMode = self.borderMode local hideOverflow = self.hideOverflow local realSize = self.useRealSize if repeatMode == "random" then local matrixWidth, matrixHeight = matrix:size() local tileWidth, tileHeight = self.tileWidth, self.tileHeight local widthInTiles, heightInTiles = math.ceil(width / tileWidth), math.ceil(height / tileHeight) -- Vertical for ty = 2, heightInTiles - 1 do local offsetY = (ty - 1) * tileHeight table.insert(sprites, getMatrixSprite(atlas, texture, x, y + offsetY, matrix, 1, math.random(2, matrixHeight - 1))) table.insert(sprites, getMatrixSprite(atlas, texture, x + oppositeOffsetX, y + offsetY, matrix, matrixWidth, math.random(2, matrixHeight - 1))) end -- Horizontal for tx = 2, widthInTiles - 1 do local offsetX = (tx - 1) * tileWidth table.insert(sprites, getMatrixSprite(atlas, texture, x + offsetX, y, matrix, math.random(2, matrixWidth - 1), 1)) table.insert(sprites, getMatrixSprite(atlas, texture, x + offsetX, y + oppositeOffsetY, matrix, math.random(2, matrixHeight - 1), matrixHeight)) end elseif repeatMode == "repeat" then local widthNoBorder, heightNoBorder = spriteWidth - borderLeft - borderRight, spriteHeight - borderTop - borderBottom local processedX, processedY = borderLeft, borderTop -- Vertical while processedY < height - borderRight do local quadHeight = math.min(height - borderBottom - processedY, heightNoBorder) local spriteLeft = getRelativeQuadSprite(atlas, texture, x, y + processedY, 0, borderTop, borderLeft, quadHeight, hideOverflow, realSize) local spriteRight = getRelativeQuadSprite(atlas, texture, x + oppositeOffsetX, y + processedY, spriteWidth - borderRight, borderBottom, borderRight, quadHeight, hideOverflow, realSize) table.insert(sprites, spriteLeft) table.insert(sprites, spriteRight) processedY += heightNoBorder end -- Horizontal while processedX < width - borderBottom do local quadWidth = math.min(width - borderRight - processedX, widthNoBorder) local spriteTop = getRelativeQuadSprite(atlas, texture, x + processedX, y, borderLeft, 0, quadWidth, borderTop, hideOverflow, realSize) local spriteBottom = getRelativeQuadSprite(atlas, texture, x + processedX, y + oppositeOffsetY, borderRight, spriteHeight - borderBottom, quadWidth, borderBottom, hideOverflow, realSize) table.insert(sprites, spriteTop) table.insert(sprites, spriteBottom) processedX += widthNoBorder end end end function drawableNinePatchMt.__index:addMiddleQuads(sprites, atlas, texture, x, y, width, height, matrix, spriteWidth, spriteHeight) local repeatMode = self.fillMode if repeatMode == "random" then local matrixWidth, matrixHeight = matrix:size() local tileWidth, tileHeight = self.tileWidth, self.tileHeight local widthInTiles, heightInTiles = math.ceil(width / tileWidth), math.ceil(height / tileHeight) for ty = 2, heightInTiles - 1 do for tx = 2, widthInTiles - 1 do local offsetX = (tx - 1) * tileWidth local offsetY = (ty - 1) * tileHeight table.insert(sprites, getMatrixSprite(atlas, texture, x + offsetX, y + offsetY, matrix, math.random(2, matrixWidth - 1), math.random(2, matrixHeight - 1))) end end elseif repeatMode == "repeat" then local borderLeft, borderRight, borderTop, borderBottom = self.borderLeft, self.borderRight, self.borderTop, self.borderBottom local oppositeOffsetX = width - borderRight local oppositeOffsetY = height - borderBottom local widthNoBorder, heightNoBorder = spriteWidth - borderLeft - borderRight, spriteHeight - borderTop - borderBottom local processedX, processedY = borderLeft, borderTop local hideOverflow = self.hideOverflow local realSize = self.useRealSize while processedY < height - borderBottom do while processedX < width - borderRight do local quadWidth = math.min(width - borderRight - processedX, widthNoBorder) local quadHeight = math.min(height - borderBottom - processedY, heightNoBorder) local sprite = getRelativeQuadSprite(atlas, texture, x + processedX, y + processedY, borderLeft, borderTop, quadWidth, quadHeight, hideOverflow, realSize) table.insert(sprites, sprite) processedX += widthNoBorder end processedX = borderLeft processedY += heightNoBorder end end end function drawableNinePatchMt.__index:getDrawableSprite() local sprites = {} local matrix = self:getMatrix() local texture = self.texture local atlas = self.atlas local x, y = self.drawX, self.drawY local width, height = self.drawWidth, self.drawHeight local dummySprite = drawableSprite.fromTexture(self.texture, {atlas = self.atlas}) local spriteWidth, spriteHeight = self:getSpriteSize(dummySprite) if not matrix then return sprites end local drawBorder = self.mode == "border" or self.mode == "fill" local drawMiddle = self.mode == "fill" if drawBorder then self:addCornerQuads(sprites, atlas, texture, x, y, width, height, matrix, spriteWidth, spriteHeight) self:addEdgeQuads(sprites, atlas, texture, x, y, width, height, matrix, spriteWidth, spriteHeight) end if drawMiddle then self:addMiddleQuads(sprites, atlas, texture, x, y, width, height, matrix, spriteWidth, spriteHeight) end return sprites end function drawableNinePatchMt.__index:draw() local sprites = self:getDrawableSprite() for _, sprite in ipairs(sprites) do sprite:draw() end end function drawableNinePatch.fromTexture(texture, options, drawX, drawY, drawWidth, drawHeight) local ninePatch = { _type = "drawableNinePatch" } options = options or {} if type(options) == "string" then options = { mode = options } end local atlas = options.atlas or "Gameplay" local spriteMeta = atlases.getResource(texture, atlas) if not spriteMeta then return end ninePatch.atlas = atlas ninePatch.texture = texture ninePatch.useRealSize = options.useRealSize or false ninePatch.hideOverflow = options.hideOverflow or true ninePatch.mode = options.mode or "fill" ninePatch.borderMode = options.borderMode or "repeat" ninePatch.fillMode = options.fillMode or "repeat" ninePatch.drawX = drawX or 0 ninePatch.drawY = drawY or 0 ninePatch.drawWidth = drawWidth or 0 ninePatch.drawHeight = drawHeight or 0 ninePatch.tileSize = options.tileSize or 8 ninePatch.tileWidth = options.tileWidth or ninePatch.tileSize ninePatch.tileHeight = options.tileHeight or ninePatch.tileSize ninePatch.borderLeft = options.borderLeft or options.border or ninePatch.tileWidth ninePatch.borderRight = options.borderRight or options.border or ninePatch.tileWidth ninePatch.borderTop = options.borderTop or options.border or ninePatch.tileHeight ninePatch.borderBottom = options.borderBottom or options.border or ninePatch.tileHeight return setmetatable(ninePatch, drawableNinePatchMt) end return drawableNinePatch
td = GetTileAtPosition(25, 25) td2 = GetTileAtPosition(25, 27) td3 = GetTileAtPosition(25, 29) ts = TileSet() lazyBasicAssert(0, GetTileSetCount(ts), "TileSet count 1") ts = AddTileToSet(ts, td) lazyBasicAssert(1, GetTileSetCount(ts), "TileSet count 2") ts = AddTileToSet(ts, td2) lazyBasicAssert(2, GetTileSetCount(ts), "TileSet count 3") lazyBasicAssert(true, IsTileInSet(ts, td), "TileSet membership 1") lazyBasicAssert(true, IsTileInSet(ts, td2), "TileSet membership 2") lazyBasicAssert(false, IsTileInSet(ts, td3), "TileSet membership 3") tiles = GetTilesFromSet(ts) lazyBasicAssert(2, #tiles, "TileSet count") for _, t in ipairs(tiles) do -- t.color = {0, 1, 0} end ts = RemoveTileFromSet(ts, td) lazyBasicAssert(1, GetTileSetCount(ts), "TileSet removal 1") lazyBasicAssert(false, IsTileInSet(ts, td), "TileSet removal 2") lazyBasicAssert(true, IsTileInSet(ts, td2), "TileSet removal 3") ts = RemoveTileFromSet(ts, td2) lazyBasicAssert(0, GetTileSetCount(ts), "TileSet removal 4") lazyBasicAssert(false, IsTileInSet(ts, td2), "TileSet removal 5") td:SetAttributeInt("intVal", 5682) td:SetAttributeFloat("floatVal", 3.14) td:SetAttributeString("strVal", "Hello!") lazyBasicAssert(5682, td:GetAttributeInt("intVal"), "Integer attribute") lazyBasicAssert("3.14", string.format("%.2f", td:GetAttributeFloat("floatVal")), "Float attribute") lazyBasicAssert("Hello!", td:GetAttributeString("strVal"), "String attribute") -- resulting tags: -- td A B C -- td2 B C -- td3 C td:AddTag("A") td:AddTag("B") td:AddTag("B") td2:AddTag("B") td2:AddTag("C") td3:AddTag("C") td:AddTag("C") td:AddTag("D") td:RemoveTag("D") td:RemoveTag("D") tags = td:GetTags() lazyBasicAssert(4, #tags, "Tag count") lazyBasicAssert("ground", tags[1], "Tag retrieval 1") lazyBasicAssert("A", tags[2], "Tag retrieval 2") lazyBasicAssert("B", tags[3], "Tag retrieval 3") lazyBasicAssert("C", tags[4], "Tag retrieval 4") tiles = GetTilesTagged("B, C") lazyBasicAssert(2, #tiles, "Multi-tag count") tileIndices = {tiles[1].i, tiles[2].i} lazyBasicAssert(td.i, tileIndices, "Tile retrieval by tag 1") lazyBasicAssert(td2.i, tileIndices, "Tile retrieval by tag 2") tiles = GetTilesTagged("C") lazyBasicAssert(3, #tiles, "Tag count 2") tileIndices = {tiles[1].i, tiles[2].i, tiles[3].i} lazyBasicAssert(td.i, tileIndices, "Tile retrieval by tag 3") lazyBasicAssert(td2.i, tileIndices, "Tile retrieval by tag 4") lazyBasicAssert(td3.i, tileIndices, "Tile retrieval by tag 5") reg = Region() AddTileToRegion(reg, GetTileAtIndex(0)) AddTileToRegion(reg, GetTileAtIndex(1)) AddTileToRegion(reg, GetTileAtPosition(1, 1)) AddTileToRegion(reg, GetTileAtPosition(3, 2)) reg:AddTag("Q") lazyBasicAssert(reg:HasTags("Q"), true, "Region tag check") lazyBasicAssert(GetTileAtIndex(0):HasTags("Q"), false, "Region tags not propagated") lazyBasicAssert(#GetTileAtIndex(0).memberRegions, 1, "Tile membership count") lazyBasicAssert(GetTileAtIndex(0).memberRegions[1].i, reg.i, "Tile membership check") SetIntRegister("A", 5682) SetFloatRegister("B", 3.14) SetStringRegister("C", "Hello!") SetTileRegister("D", td) SetTileSetRegister("E", ts) lazyBasicAssert(GetIntRegister("A"), 5682, "Integer register check") lazyBasicAssert(string.format("%.2f", GetFloatRegister("B")), string.format("%.2f", 3.14), "Float register check") lazyBasicAssert(GetStringRegister("C"), "Hello!", "String register check") lazyBasicAssert(GetTileRegister("D"), td, "Tile register check") lazyBasicAssert(GetTileSetRegister("E"), ts, "TileSet register check") lazyBasicAssert(GetIntRegister("F"), 0, "Null integer register check") lazyBasicAssert(string.format("%.2f", GetFloatRegister("F")), string.format("%.2f", 0.0), "Null integer register check") lazyBasicAssert(GetStringRegister("F"), "", "Null string register check") lazyBasicAssert(GetTileRegister("F"), nil, "Null Tile register check") lazyBasicAssert(GetTileSetRegister("F"), nil, "Null TileSet set register check") tdStart = GetTileAtIndex(0) tdEnd = GetTileAtIndex(1024) path = FindSimplePath(tdStart, tdEnd) for _, t in pairs(path) do t.color = {0.0, 0.0, 1.0} end tdStart.color = {0.0, 1.0, 0.0} tdEnd.color = {1.0, 0.0, 0.0} hc = HasAllTags("B, ground") hc_tagged = hc:GetPassingTiles() lazyBasicAssert(hc_tagged.isSet, true, "Constraints returning sets") lazyBasicAssert(#hc_tagged:toList(), 2, "Has tags constraint in isolation 1") hc2 = HasAllTags("A") hc_tagged2 = hc2:GetPassingTiles() lazyBasicAssert(#hc_tagged2:toList(), 1, "Has tags constraint in isolation 2") hc_tag_combine = hc_tagged:intersection(hc_tagged2) lazyBasicAssert(#hc_tag_combine:toList(), 1, "Tag constraint combinations") lazyBasicAssert(hc_tag_combine:toList()[1].i, td.i, "Constraint outcome") hc3 = HasNoneOfTags("Non-Existent, A") lazyBasicAssert(true, hc3:CheckTile(td3.i), "Has none of tags constraint positive") hc4 = HasNoneOfTags("A, B, C") lazyBasicAssert(false, hc4:CheckTile(td3.i), "Has none of tags constraint negative") ac = HasAttributes("open", GreaterThan, 0) openTiles = ac:GetPassingTiles() openTileList = openTiles:toList() lazyBasicAssert(305, #openTileList, "Attribute queries") hc = HasAllTags("sky") hc_tagged = hc:GetPassingTiles() lazyBasicAssert(#hc_tagged:toList(), #openTileList, "Attributes matching lengths") td = GetTileAtIndex(0) circle1 = td:GetCircle(0) lazyBasicAssert(#circle1, 1, "Circle radius of 0") circle2 = td:GetCircle(1) lazyBasicAssert(#circle2, 3, "Corner circle radius of 1") circle3 = td:GetCircle(2) lazyBasicAssert(#circle3, 7, "Corner circle radius of 2") circle4 = td2:GetCircle(1) lazyBasicAssert(#circle4, 7, "Circle radius of 1") circle5 = td2:GetCircle(2) lazyBasicAssert(#circle5, 19, "Circle radius of 2") td = nil td2 = nil td3 = nil tdStart = nil tdEnd = nil path = nil tiles = nil tags = nil ts = nil ts2 = nil mems = nil hc = nil hc_tagged = nil hc2 = nil hc_tagged2 = nil hc_tag_combine = nil hc3 = nil hc4 = nil ac = nil collectgarbage() -- just to make sure this doesn't trigger segfaults
local utils = require "go-tools.utils" local M = {} local gotests = "gotests" local function run_gotests(cmd) require("go-tools.runner").run(gotests, function() vim.fn.jobstart(cmd, { on_stdout = function(_, _, _) utils.log "Unit tests was generated" end, on_stderr = function(_, _, _) utils.log "Failed to generate unit tests" end, }) end) end function M.add_test() local function_name = require("go-tools.utils.treesitter").get_current_function() if not function_name then utils.log "Function not found" return end local fpath = vim.fn.expand "%" local cmd = { gotests, "-w", "-only", function_name, fpath } run_gotests(cmd) end function M.add_tests() local fpath = vim.fn.expand "%" local cmd = { gotests, "-all", "-w", fpath } run_gotests(cmd) end function M.run_test() if not utils.is_test_file(vim.fn.expand "%:p") then utils.log "No tests found. Current file is not a test file." return end local function_name = require("go-tools.utils.treesitter").get_current_function() if not function_name then utils.log "Not test function found" return end utils.log("Run test: " .. function_name) require("go-tools.cmd").cmd("go", "test -v -run ^" .. function_name .. " " .. vim.fn.expand "%:p:h") end function M.run_tests() local fpath = vim.fn.expand "%:p" if not utils.is_test_file(fpath) then utils.log "No tests found. Current file is not a test file." return end utils.log("Run test: " .. fpath) require("go-tools.cmd").cmd("go", "test -v -run ^ " .. fpath) end return M
-- Docs: https://docs.zenbot.gg/#/class?id=spellslotobj local Menu = module.load('IntKatarina', 'menu'); local e = { slot = player:spellSlot(2), last = 0, range = 725, Dagger = { } }; e.is_ready = function() return e.slot.state == 0 end e.GetBestDagger = function() local closer = nil; for _, objs in pairs(e.Dagger) do if objs then closer = objs end end return closer end e.IsUnderEnemyTurret = function(pos) if not pos then return end for turret in objManager.iturrets do if turret and turret.isEnemy and turret.isTurret and turret.valid then if pos:dist(turret.pos) <= 915 then return true end else turret = nil end end return false end e.CastE = function(position) if e.is_ready() then if (((player.health / player.maxHealth) * 100) <= Menu.combo['Combo.E.Saver']:get() and not player:spellSlot(0).state ~= 0 and not player:spellSlot(1).state ~= 0) then return end if (e.IsUnderEnemyTurret(position) and Menu.combo['Combo.E.Turret']:get() and ((player.health / player.maxHealth) * 100) >= Menu.combo['Combo.R.Turret.MinHP']:get()) then player:castSpell("pos", 2, position) elseif not (e.IsUnderEnemyTurret(position)) then player:castSpell("pos", 2, position) end end end e.on_create_obj = function(obj) if obj then if obj.name:find("W_Indicator_Ally") then e.Dagger[obj.ptr] = obj end end end e.on_delete_obj = function(obj) if obj then e.Dagger[obj.ptr] = nil end end e.on_draw = function() if e.slot.level > 0 and e.is_ready() then graphics.draw_circle(player.pos, e.range, 1, graphics.argb(255, 255, 255, 200), 40) end end return e
workspace "Basics of ray tracing" configurations { "Debug", "Release" } language "C++" architecture "x64" systemversion "latest" toolset "v142" optimize "Speed" buildoptions { "/openmp" } filter "configurations:Debug" defines { "DEBUG" } symbols "On" filter "configurations:Release" defines { "NDEBUG" } optimize "On" targetdir ("bin/%{prj.name}/%{cfg.longname}") objdir ("obj/%{prj.name}/%{cfg.longname}") group "01. Ray generation" project "Ray generation lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } project "Ray generation app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "Ray generation lib" files { "src/ray_generation_main.cpp" } project "Ray generation tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "src" } files { "tests/test_utils.h" } links "Ray generation lib" debugargs { "--benchmark-samples", "25" } files {"tests/ray_generation_tests.cpp"} group "02. Moller-Trumbore algorithm" project "Moller-Trumbore algorithm lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} project "Moller-Trumbore algorithm app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "Moller-Trumbore algorithm lib" files { "src/mt_algorithm_main.cpp" } project "Moller-Trumbore algorithm tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "src" } files { "tests/test_utils.h" } links "Moller-Trumbore algorithm lib" debugargs { "--benchmark-samples", "25" } files {"tests/mt_algorithm_tests.cpp"} group "03. Lighting" project "Lighting lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} project "Lighting app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "Lighting lib" files { "src/lighting_main.cpp" } project "Lighting tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "src" } files { "tests/test_utils.h" } links "Lighting lib" debugargs { "--benchmark-samples", "25" } files {"tests/lighting_tests.cpp"} group "04. Shadow rays" project "ShadowRays lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} files {"src/shadow_rays.h", "src/shadow_rays.cpp"} project "ShadowRays app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "ShadowRays lib" files { "src/shadow_rays_main.cpp" } project "ShadowRays tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "src" } files { "tests/test_utils.h" } links "ShadowRays lib" debugargs { "--benchmark-samples", "25" } files {"tests/shadow_rays_tests.cpp"} group "05. Reflection" project "Reflection lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} files {"src/shadow_rays.h", "src/shadow_rays.cpp"} files {"src/reflection.h", "src/reflection.cpp"} project "Reflection app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "Reflection lib" files { "src/reflection_main.cpp" } project "Reflection tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "src" } files { "tests/test_utils.h" } links "Reflection lib" debugargs { "--benchmark-samples", "25" } files {"tests/reflection_tests.cpp"} group "06. Refraction" project "Refraction lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} files {"src/shadow_rays.h", "src/shadow_rays.cpp"} files {"src/reflection.h", "src/reflection.cpp"} files {"src/refraction.h", "src/refraction.cpp"} project "Refraction app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "Refraction lib" files { "src/refraction_main.cpp" } project "Refraction tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "src" } files { "tests/test_utils.h" } links "Refraction lib" debugargs { "--benchmark-samples", "5" } files {"tests/refraction_tests.cpp"} group "07. Anti-aliasing" project "AntiAliasing lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} files {"src/shadow_rays.h", "src/shadow_rays.cpp"} files {"src/reflection.h", "src/reflection.cpp"} files {"src/refraction.h", "src/refraction.cpp"} files {"src/anti_aliasing.h", "src/anti_aliasing.cpp"} project "AntiAliasing app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "AntiAliasing lib" files { "src/anti_aliasing_main.cpp" } project "AntiAliasing tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "src" } files { "tests/test_utils.h" } links "AntiAliasing lib" debugargs { "--benchmark-samples", "25" } files {"tests/anti_aliasing_tests.cpp"} group "08. AABB" project "AABB lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} files {"src/shadow_rays.h", "src/shadow_rays.cpp"} files {"src/reflection.h", "src/reflection.cpp"} files {"src/refraction.h", "src/refraction.cpp"} files {"src/anti_aliasing.h", "src/anti_aliasing.cpp"} files {"src/aabb.h", "src/aabb.cpp"} project "AABB app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "AABB lib" files { "src/aabb_main.cpp" } project "AABB tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "lib/tinyobjloader" } includedirs { "src" } files { "tests/test_utils.h" } links "AABB lib" debugargs { "--benchmark-samples", "5" } files {"tests/aabb_tests.cpp"} group "09. BVH" project "BVH lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} files {"src/shadow_rays.h", "src/shadow_rays.cpp"} files {"src/reflection.h", "src/reflection.cpp"} files {"src/refraction.h", "src/refraction.cpp"} files {"src/anti_aliasing.h", "src/anti_aliasing.cpp"} files {"src/aabb.h", "src/aabb.cpp"} files {"src/bvh.h", "src/bvh.cpp"} project "BVH app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "BVH lib" files { "src/bvh_main.cpp" } project "BVH tests" kind "ConsoleApp" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/catch2/single_include/catch2" } includedirs { "src" } files { "tests/test_utils.h" } links "BVH lib" debugargs { "--benchmark-samples", "25" } files {"tests/bvh_tests.cpp"} group "10. Denoising" project "Denoising lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} files {"src/shadow_rays.h", "src/shadow_rays.cpp"} files {"src/reflection.h", "src/reflection.cpp"} files {"src/refraction.h", "src/refraction.cpp"} files {"src/anti_aliasing.h", "src/anti_aliasing.cpp"} files {"src/aabb.h", "src/aabb.cpp"} files {"src/bvh.h", "src/bvh.cpp"} files {"src/denoising.h", "src/denoising.cpp"} project "Denoising app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "Denoising lib" files { "src/denoising_main.cpp" } group "11. MyScene" project "MyScene lib" kind "StaticLib" includedirs { "lib/stb" } includedirs { "lib/linalg" } includedirs { "lib/tinyobjloader" } includedirs { "src/" } files {"src/MyScene.h", "src/MyScene.cpp" } files {"src/ray_generation.h", "src/ray_generation.cpp" } files {"src/mt_algorithm.h", "src/mt_algorithm.cpp"} files {"src/lighting.h", "src/lighting.cpp"} files {"src/shadow_rays.h", "src/shadow_rays.cpp"} files {"src/reflection.h", "src/reflection.cpp"} files {"src/refraction.h", "src/refraction.cpp"} files {"src/anti_aliasing.h", "src/anti_aliasing.cpp"} files {"src/aabb.h", "src/aabb.cpp"} files {"src/bvh.h", "src/bvh.cpp"} files {"src/denoising.h", "src/denoising.cpp"} project "MyScene app" kind "ConsoleApp" includedirs { "lib/linalg" } includedirs { "src" } links "MyScene lib" files { "src/MyScene.cpp" }
--[[ This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:26' using the latest game version. NOTE: This file should only be used as IDE support; it should NOT be distributed with addons! **************************************************************************** CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC. **************************************************************************** ]] ZO_DyeingToolFill = ZO_DyeingToolBase:Subclass() function ZO_DyeingToolFill:New(...) return ZO_DyeingToolBase.New(self, ...) end function ZO_DyeingToolFill:Initialize(owner) ZO_DyeingToolBase.Initialize(self, owner) end function ZO_DyeingToolFill:Activate(fromTool, suppressSounds) if fromTool and not suppressSounds then PlaySound(SOUNDS.DYEING_TOOL_FILL_SELECTED) end end function ZO_DyeingToolFill:GetHighlightRules(dyeableSlot, dyeChannel) return nil, dyeChannel end function ZO_DyeingToolFill:OnLeftClicked(restyleSlotData, dyeChannel) local slots = ZO_Dyeing_GetSlotsForRestyleSet(restyleSlotData:GetRestyleMode(), restyleSlotData:GetRestyleSetIndex()) for i, dyeableSlotData in ipairs(slots) do if not dyeableSlotData:ShouldBeHidden() then dyeableSlotData:SetPendingDyes(zo_replaceInVarArgs(dyeChannel, self.owner:GetSelectedDyeId(), dyeableSlotData:GetPendingDyes())) end end self.owner:OnPendingDyesChanged(nil) PlaySound(SOUNDS.DYEING_TOOL_FILL_USED) end function ZO_DyeingToolFill:OnSavedSetLeftClicked(_, dyeChannel) for dyeSetIndex = 1, GetNumSavedDyeSets() do SetSavedDyeSetDyes(dyeSetIndex, zo_replaceInVarArgs(dyeChannel, self.owner:GetSelectedDyeId(), GetSavedDyeSetDyes(dyeSetIndex))) end self.owner:OnSavedSetSlotChanged(nil) PlaySound(SOUNDS.DYEING_TOOL_FILL_USED) end function ZO_DyeingToolFill:GetCursorType() return MOUSE_CURSOR_FILL end function ZO_DyeingToolFill:GetToolActionString() return SI_DYEING_TOOL_DYE_ALL_TOOLTIP end
alpha_wolf_invisibility_oaa = class(AbilityBaseClass) LinkLuaModifier("modifier_alpha_invisibility_oaa_buff", "abilities/neutrals/oaa_alpha_wolf_invisibility.lua", LUA_MODIFIER_MOTION_NONE) function alpha_wolf_invisibility_oaa:OnSpellStart() local caster = self:GetCaster() local duration = self:GetSpecialValueFor("duration") local fade_time = self:GetSpecialValueFor("fade_time") -- Sound caster:EmitSound("Hero_BountyHunter.WindWalk") -- Apply a buff after fade time Timers:CreateTimer(fade_time, function() caster:AddNewModifier(caster, self, "modifier_alpha_invisibility_oaa_buff", { duration = duration } ) end) end -------------------------------------------------------------------------------- modifier_alpha_invisibility_oaa_buff = class(ModifierBaseClass) function modifier_alpha_invisibility_oaa_buff:IsHidden() return false end function modifier_alpha_invisibility_oaa_buff:IsDebuff() return false end function modifier_alpha_invisibility_oaa_buff:IsPurgable() return false end function modifier_alpha_invisibility_oaa_buff:OnCreated() local particle = ParticleManager:CreateParticle("particles/generic_hero_status/status_invisibility_start.vpcf", PATTACH_ABSORIGIN, self:GetParent()) ParticleManager:ReleaseParticleIndex(particle) end function modifier_alpha_invisibility_oaa_buff:DeclareFunctions() local funcs = { MODIFIER_PROPERTY_INVISIBILITY_LEVEL, MODIFIER_EVENT_ON_ABILITY_EXECUTED, MODIFIER_EVENT_ON_ATTACK, } return funcs end function modifier_alpha_invisibility_oaa_buff:GetModifierInvisibilityLevel() if IsClient() then return 1 end end if IsServer() then function modifier_alpha_invisibility_oaa_buff:OnAbilityExecuted(event) if event.unit ~= self:GetParent() then return end self:Destroy() end function modifier_alpha_invisibility_oaa_buff:OnAttack(event) if event.attacker ~= self:GetParent() then return end self:Destroy() end function modifier_alpha_invisibility_oaa_buff:CheckState() local state = { [MODIFIER_STATE_INVISIBLE] = true, [MODIFIER_STATE_NO_UNIT_COLLISION] = true } return state end end function modifier_alpha_invisibility_oaa_buff:GetPriority() return MODIFIER_PRIORITY_ULTRA end
--- -- Overrides and extensions to Lua's `string` library. --- --- -- Converts first letter of string to uppercase if it isn't already. --- function string.capitalize(self) return (string.gsub(self, '^%l', string.upper)) end --- -- Returns a new string with any Premake pattern tokens (i.e. `*`) expanded to Lua patterns. -- -- TODO: Just a placeholder at the moment; needs implementation. -- TODO: Move this to C; gets called a lot. -- -- @param value -- The string value which may contain patterns. -- @returns -- Two values: the input string with Premake pattern tokens expanded, and a boolean -- indicating whether or not patterns are present (`true` if so, `false` otherwise), -- suitable for passing as the `plain` argument to Lua string matching functions. --- function string.expandWildcards(value) return value, true end --- -- Find the last occurrence of a pattern in a string. --- function string.findLast(self, pattern, plain) local i = 0 repeat local next = string.find(self, pattern, i + 1, plain) if next then i = next end until (not next) if i > 0 then return i end end --- -- Split a string on each occurrence of a pattern, up to `limit` times. -- -- @returns -- An array of string results. --- function string.split(self, pattern, plain, limit) local result = {} local pos = 0 local count = 0 local iter = function() return string.find(self, pattern, pos, plain) end for start, stop in iter do table.insert(result, string.sub(self, pos, start - 1)) pos = stop + 1 count = count + 1 if limit ~= nil and count == limit then break end end table.insert(result, string.sub(self, pos)) return result end --- -- Splits the string at the provided pattern, and returns two results: the -- string before the split, and the one after. -- -- @returns -- Two values: the string before the pattern, and the string after. --- function string.splitOnce(self, pattern, plain) local start, stop = string.find(self, pattern, pos, plain) if start == nil then return self else return string.sub(self, 1, start - 1), string.sub(self, stop + 1) end end return string
local assert_error = require("lapis.application").assert_error local assert_valid = require("lapis.validate").assert_valid local csrf = require "lapis.csrf" local format = require "utils.text_formatter" local generate = require "utils.generate" local process = require "utils.request_processor" local Announcements = require "models.announcements" local Boards = require "models.boards" local Posts = require "models.posts" local Threads = require "models.threads" return { before = function(self) -- Get all board data self.boards = Boards:get_boards() -- Get current board data for _, board in ipairs(self.boards) do if board.short_name == self.params.board then self.board = board break end end -- Board not found if not self.board or self.params.page and not tonumber(self.params.page) then self:write({ redirect_to = self:build_url() }) return end -- Get announcements self.announcements = Announcements:get_board_announcements(self.board.id) -- Page title self.page_title = string.format( "/%s/ - %s", self.board.short_name, self.board.name ) -- Flag comments as required or not self.comment_flag = self.board.thread_comment -- Generate CSRF token self.csrf_token = csrf.generate_token(self) -- Current page self.params.page = self.params.page or 1 -- Get threads self.threads, self.pages = Threads:get_page_threads( self.board.id, self.board.threads_per_page, self.params.page ) -- Get posts for _, thread in ipairs(self.threads) do -- Get posts visible on the board index thread.posts = Posts:get_index_posts(thread.id) -- Get hidden posts thread.hidden = Posts:count_hidden_posts(thread.id) -- Get op local op = thread.posts[#thread.posts] if not op then assert_error(false, { "err_orphaned", { thread.id } }) end thread.url = self:format_url(self.thread_url, self.board.short_name, op.post_id) -- Format comments for _, post in ipairs(thread.posts) do -- OP gets a thread tag if post.post_id == op.post_id then post.thread = post.post_id end post.name = post.name or self.board.anon_name post.reply = self: format_url(self.reply_url, self.board.short_name, op.post_id, post.post_id) post.link = self: format_url(self.post_url, self.board.short_name, op.post_id, post.post_id) post.remix = self: format_url(self.remix_url, self.board.short_name, op.post_id, post.post_id) post.timestamp = os.date("%Y-%m-%d (%a) %H:%M:%S", post.timestamp) post.file_size = math.floor(post.file_size / 1024) post.file_dimensions = "" if post.file_width > 0 and post.file_height > 0 then post.file_dimensions = string.format(", %dx%d", post.file_width, post.file_height) end if not post.file_duration or post.file_duration == "0" then post.file_duration = "" else post.file_duration = string.format(", %s", post.file_duration) end if post.file_path then local name, ext = post.file_path:match("^(.+)(%..+)$") ext = string.lower(ext) -- Get thumbnail URL if post.file_type == "audio" then if post == thread.posts[#thread.posts] then post.thumb = self:format_url(self.static_url, "op_audio.png") else post.thumb = self:format_url(self.static_url, "post_audio.png") end elseif post.file_type == "image" then if post.file_spoiler then if post == thread.posts[#thread.posts] then post.thumb = self:format_url(self.static_url, "op_spoiler.png") else post.thumb = self:format_url(self.static_url, "post_spoiler.png") end else if ext == ".webm" or ext == ".svg" then post.thumb = self:format_url(self.files_url, self.board.short_name, 's' .. name .. '.png') else post.thumb = self:format_url(self.files_url, self.board.short_name, 's' .. post.file_path) end end end post.file_path = self:format_url(self.files_url, self.board.short_name, post.file_path) end -- Process comment if post.comment then local comment = post.comment comment = format.sanitize(comment) comment = format.quote(comment, self, self.board, post) comment = format.green_text(comment) comment = format.blue_text(comment) comment = format.spoiler(comment) comment = format.new_lines(comment) post.comment = comment else post.comment = "" end end end end, on_error = function(self) self.errors = generate.errors(self.i18n, self.errors) return { render = "board"} end, GET = function() return { render = "board" } end, POST = function(self) -- Validate CSRF token csrf.assert_token(self) local board_url = self:format_url(self.board_url, self.board.short_name) -- Submit new thread if self.params.submit then -- Validate user input assert_valid(self.params, { { "name", max_length=255 }, { "subject", max_length=255 }, { "options", max_length=255 }, { "comment", max_length=self.text_size } }) -- Validate post local post = assert_error(process.create_thread(self.params, self.session, self.board)) return { redirect_to = self:format_url(self.post_url, self.board.short_name, post.post_id, post.post_id) } end -- Delete thread if self.params.delete and self.params.thread_id then -- Validate user input assert_valid(self.params, { { "post_id", exists=true } }) -- Validate deletion assert_error(process.delete_thread(self.params, self.session, self.board)) return { redirect_to = board_url } end -- Delete post if self.params.delete and not self.params.thread_id then -- Validate user input assert_valid(self.params, { { "post_id", exists=true } }) -- Validate deletion assert_error(process.delete_post(self.params, self.session, self.board)) return { redirect_to = board_url } end -- Report post if self.params.report then -- Validate user input assert_valid(self.params, { { "board", exists=true }, { "post_id", exists=true } }) -- Validate report assert_error(process.report_post(self.params, self.board)) return { redirect_to = board_url } end -- Admin commands if self.session.admin or self.session.mod then -- Sticky thread if self.params.sticky then assert_error(process.sticky_thread(self.params, self.board)) return { redirect_to = board_url } end -- Lock thread if self.params.lock then assert_error(process.lock_thread(self.params, self.board)) return { redirect_to = board_url } end -- Save thread if self.params.save then assert_error(process.save_thread(self.params, self.board)) return { redirect_to = board_url } end -- Override thread if self.params.override then assert_error(process.override_thread(self.params, self.board)) return { redirect_to = board_url } end -- Ban user if self.params.ban then assert_error(process.ban_user(self.params, self.board)) return { redirect_to = board_url } end end return { redirect_to = board_url } end }
--[[ Streamline by Alleris Streamlines the RoM UI by removing unnecessary clicks and generally tries to make things easier on you. Use /sl, /streamline, or the AddonManager addon to access the config screen. Currently supported options --------------------------- Mail: * Open mailbox automatically when talking to a mailbox * Take mail item on click and deletes the mail if there's no body text Stores: * Open store automatically when talking to a store NPC * Automatically repair when you open a store * Don't close recipe window after purchasing one Quests: * Accept a quest automatically (when it's clicked on, if the NPC has more than one) Enabled by default as the quest dialog will be in your quest list anyway. * Option to not auto-accept billboard quests * Complete a quest automatically (when it's clicked on, if the NPC has more than one). Disabled by default as you can miss bits of story because of it. * Show the NPC quest dialog upon acception/completion of a quest. Skills: * Add a "Max" button to the skill upgrade dialog (looks like '>>') * One-click class swapping * When you click on one of your crafting skills, that skill will show up even if you had another crafting skill open. The is different from the default, which only closes the one you have open. Messages: * Remove all orange (mainly system) messages from all windows but the combat log * Remove the XP and TP messages from all windows but the combat log * Remove skill levelup messages from all windows but the combat log * Remove LFP, LFG, LFM messages from the general chat window * Remove WTB, WTS, WTT messages from the general chat window Banners: * Hide the message scroller (text still shows up in the chat frame) * Hide the red warning message when a skill is unusable and optionally redirect output to the combat log * Hide the bug message popups and redirect output to general chat * Hide the scroll banner and redirect output to general chat * Hide the zone changed banner and redirect output to general chat Paid Items: * Auto-accept teleport from the teleport NPCs (uses money!) * Auto-accept 15min horse rental (uses money!) Other: * Stop auto-move when you start talking to an NPC or gathering * Hide your skill hotkeys on the action bars (especially usefull when your hotkeys use Shift, Control, or Alt, as all you see is "SHIF...") * Adds a button to the quest book that lets you minimize and restore the list of quests * Show craft skill level in the crafting frame Released under the Creative Commons License By-Nc-Sa: http://creativecommons.org/licenses/by-nc-sa/3.0/ Thanks for code samples to: - Anahel of HudBars2 - vEEcEE of ClassSwap - novayuna of pbInfo --]] local Sol = LibStub("Sol") local STREAMLINE_MINIMAP_ZOOMS = { 1, 1.25, 1.5, 1.75, 2, 2.5, 3, 3.5, 4, 4.5, 5 } local DEFAULT_MINIMAP_ZOOMS = { 2, 2.5, 3, 3.5, 4 } Streamline = {} Streamline.Strings = {} Streamline.Strings.AddonName = "Streamline" Streamline.Strings.IconPath = "Interface/Addons/Streamline/Textures/streamlineIcon.tga" Streamline.Strings.Author = "Alleris" Streamline.Strings.Version = "v1.51" -- Init -- Streamline.OnLoad = function(frame) frame:RegisterEvent("VARIABLES_LOADED") frame:RegisterEvent("CASTING_START") frame:RegisterEvent("CHAT_MSG_SYSTEM") frame:RegisterEvent("EXCHANGECLASS_SHOW") frame:RegisterEvent("HOUSES_MAID_SPEAK") frame:RegisterEvent("MAIL_INBOX_UPDATE") frame:RegisterEvent("PLAYER_LIFESKILL_CHANGED") frame:RegisterEvent("SHOW_QUESTDETAIL_FROM_BOOK") frame:RegisterEvent("SHOW_QUESTDETAIL_FROM_NPC") frame:RegisterEvent("SHOW_QUESTLIST") frame:RegisterEvent("SHOW_REQUEST_DIALOG") frame:RegisterEvent("STORE_OPEN") frame:RegisterEvent("USE_CRAFTFRAME_SKILL") end Streamline.OnEvent = function(frame, _event, _arg1) -- Check for events firing before Streamline_Settings has loaded if not Streamline_Settings and _event ~= "VARIABLES_LOADED" then return end if Streamline[_event] then Streamline[_event](_arg1) end end -- Setup config screen, and make settings take effect Streamline.VARIABLES_LOADED = function() if Streamline_SavedSettings then Streamline_Settings = Streamline_SavedSettings end Sol.config.CheckSettings("Streamline", Streamline.DefaultSettings, nil, true) Streamline.SetLanguage(Streamline_Settings.Language) Streamline.LoadConfigStrings() Sol.config.CreateSlashToHandleConfig(Streamline.Strings.AddonName, StreamlineConfigFrame, "sl") Sol.config.SetupDropdown(StreamlineConfig_DropdownLanguage, Streamline.Languages, Streamline_Settings.Language) Sol.config.SetupDropdown(StreamlineConfig_DropdownOpenBankKey, Streamline.MetaKeys, Streamline_Settings.OpenBankKey) Sol.config.SetupDropdown(StreamlineConfig_DropdownEnterHouseKey, Streamline.MetaKeys, Streamline_Settings.EnterHouseKey) Sol.config.SetupDropdown(StreamlineConfig_DropdownChangeClassAtMaidKey, Streamline.MetaKeys, Streamline_Settings.ChangeClassAtMaidKey) Streamline.RegisterWithAddonManager() StreamlineMinimizeQuestListButton:SetText("<") Streamline.RecheckSettings() end Streamline.RegisterWithAddonManager = function() if AddonManager then local addon = { name = Streamline.Strings.AddonName, description = Streamline.Strings.AddonDesc, icon = Streamline.Strings.IconPath, category = "Interface", configFrame = StreamlineConfigFrame, slashCommands = "/sl", miniButton = StreamlineMiniButton, version = Streamline.Strings.Version, author = Streamline.Strings.Author, disableScript = Streamline.Disable, enableScript = Streamline.Enable } if AddonManager.RegisterAddonTable then AddonManager.RegisterAddonTable(addon) else AddonManager.RegisterAddon(addon.name, addon.description, addon.icon, addon.category, addon.configFrame, addon.slashCommands, addon.miniButton, addon.onClickScript) end else Sol.io.Print("Streamline loaded: /sl") end end Streamline.SetLanguage = function(langIndex) Sol.util.LoadFile("Streamline/Locale/Streamline.loc." .. Streamline.Languages[langIndex].code .. ".lua") end Streamline.Disable = function() Streamline_SavedSettings = Streamline_Settings SaveVariables("Streamline_SavedSettings") Streamline.RecheckSettings() end Streamline.Enable = function() Streamline_Settings = Streamline_SavedSettings Streamline_SavedSettings = nil Streamline.RecheckSettings() end -- Do whatever is needed to make all Streamline settings take effect Streamline.RecheckSettings = function() Streamline.SetLanguage(Streamline_Settings.Language) Streamline.LoadConfigStrings() if Streamline_Settings.ShowMaxSkillButton then Streamline.ShowSkill() else Streamline.HideSkill() end Sol.util.SetVisible(StreamlineMinimizeQuestListButton, Streamline_Settings.AddMinQuestListButton) Sol.util.SetVisible(StreamlineCraftSkillLabel, Streamline_Settings.ShowCraftLevelInDialog) Streamline.CheckHooks() Streamline.SetHotkeysVisible(not Streamline_Settings.HideHotkeys) if Streamline_Settings.AddExtraMinimapZooms then g_minimapZooms = STREAMLINE_MINIMAP_ZOOMS else g_minimapZooms = DEFAULT_MINIMAP_ZOOMS end end -- Hook any functions that need to be hooked, based on Streamline settings Streamline.CheckHooks = function() for hook, hookDependencies in pairs(Streamline.Hooks) do local found = false for i, dependency in ipairs(hookDependencies) do if Streamline_Settings[dependency] then local origFn = hook.fn local newFn = Sol.util.TernaryOp(hook.frame, Streamline[tostring(hook.frame) .. "_" .. hook.fn], Streamline[hook.fn]) local frame = hook.frame and _G[hook.frame] -- harmless if already hooked Sol.hooks.Hook(Streamline.Strings.AddonName, origFn, newFn, frame) found = true break end end if not found then Sol.hooks.UnHook(Streamline.Strings.AddonName, hook.fn, hook.frame) end end end -- End Init -- -- [[ General ]] -- -- Allows opening of more than 2 windows at a time Streamline.ToggleUIFrame = function(frame) if ( not frame ) then return end if frame:IsVisible() then frame:Hide() else frame:Show() end end Streamline.SitOrStand = function() if Streamline_Settings.StopMovingOnClick then MoveForwardStop() end Sol.hooks.GetOriginalFn(Streamline.Strings.AddonName, "SitOrStand")() end -- The only time you're moving when this event's fired is when you begin gathering Streamline.CASTING_START = function() if Streamline_Settings.StopMovingOnClick then MoveForwardStop() end end -- [[ End General ]] -- -- [[ Quests ]] -- -- Targeted NPC Name is needed for the "Accept quests except bulletin board" option -- Sometimes bulletin boards aren't selected so we can't use UnitName("target") Streamline.NPCName = nil -- Event is fired when talking to an NPC, except when the NPC has only a single available quest Streamline.SHOW_QUESTLIST = function(npcName) Streamline.NPCName = npcName if Streamline_Settings.StopMovingOnClick then MoveForwardStop() end -- Speak options are the list of options you're presented when talking to an NPC -- We don't want to chose an option if the NPC has any quests, though if GetNumSpeakOption() > 0 and GetNumQuest(1) == 0 and GetNumQuest(2) == 0 and GetNumQuest(3) == 0 then if (Streamline_Settings.OpenStores and GetSpeakOption(1) == Streamline.Strings.StoreText) or (Streamline_Settings.OpenMail and GetSpeakOption(1) == Streamline.Strings.MailText) or (GetSpeakOption(1) == Streamline.Strings.GuildDefenceText) or (GetSpeakOption(1) == Streamline.Strings.GuildAttackText) or (GetSpeakOption(1) == Streamline.Strings.GuildLuckText) or (GetSpeakOption(1) == Streamline.Strings.GuildTPText) or (GetSpeakOption(1) == Streamline.Strings.GuildXPText) or (GetSpeakOption(1) == Streamline.Strings.GuildHPText) then -- Second parameter is which option you want to pick. First doesn't matter. SpeakFrame_SpeakOption(1, 1) elseif GetSpeakOption(1) == Streamline.Strings.GuildRideText then SpeakFrame_SpeakOption(1, GetNumSpeakOption()) elseif Streamline_Settings.EnterHouse and GetSpeakOption(1) == Streamline.Strings.EnterHouseText and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.EnterHouseKey]) then -- Enter house SpeakFrame_SpeakOption(1, 1) elseif Streamline_Settings.OpenBank and not BankFrame:IsVisible() and GetSpeakOption(4) == Streamline.Strings.BankText and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.OpenBankKey]) then -- Open bank box SpeakFrame_SpeakOption(1, 4) end end end Streamline.HOUSES_MAID_SPEAK = function() if Streamline_Settings.ChangeClassAtMaid and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.ChangeClassAtMaidKey]) then -- Change class SpeakFrame_ListDialogOption(1, 5) elseif Streamline_Settings.EnterHouse and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.EnterHouseKey]) then -- Enter house SpeakFrame_ListDialogOption(1, 6) elseif Streamline_Settings.OpenBank and not BankFrame:IsVisible() and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.OpenBankKey]) then -- Open bank box SpeakFrame_ListDialogOption(1, 4) end end -- Event's fired when a specific quest is displayed at an NPC Streamline.SHOW_QUESTDETAIL_FROM_NPC = function(npcName) if Streamline_Settings.StopMovingOnClick then MoveForwardStop() end if npcName and type(npcName) == "string" then Streamline.NPCName = npcName end if Streamline_Settings.CompleteQuests then CompleteQuest() end if Streamline_Settings.AcceptQuests and (not Streamline_Settings.DontAcceptDailies or (Streamline.NPCName and type(npcName) == "string" and not Streamline.NPCName:find(Streamline.Strings.BulletinBoard))) then AcceptQuest() end end local isLikelyQuestbookFullResetEvent = false local questBookSelectedIndex = 1 local questBookPrevSelectedIndex = 1 Streamline.SHOW_QUESTDETAIL_FROM_BOOK = function(index) if not Streamline_Settings.DontResetQuestBook or not UI_QuestBook:IsVisible() then return end -- When a new items goes in the bag, this event is triggered for each -- quest in the quest book. So if we see all quests in a row triggered, -- we know this is the cause. On the last one, switch back to whatever -- was selected before they triggered. if index == 1 then questBookPrevSelectedIndex = questBookSelectedIndex isLikelyQuestbookFullResetEvent = true elseif isLikelyQuestbookFullResetEvent and index == GetNumQuestBookButton_QuestBook() then if isLikelyQuestbookFullResetEvent then isLikelyQuestbookFullResetEvent = false ViewQuest_QuestBook(questBookPrevSelectedIndex) end else if index ~= questBookSelectedIndex + 1 then isLikelyQuestbookFullResetEvent = false end end questBookSelectedIndex = index end Streamline.ToggleQuestList = function() if UI_QuestBook_QuestList:IsVisible() then UI_QuestBook_QuestList:Hide() UI_QuestBookQuestNPCTrackButton:Hide() UI_QuestBook:SetWidth(500) StreamlineMinimizeQuestListButton:SetText(">") else UI_QuestBook_QuestList:Show() UI_QuestBookQuestNPCTrackButton:Show() UI_QuestBook:SetWidth(780) StreamlineMinimizeQuestListButton:SetText("<") end end -- [[ End Quests ]] -- -- [[ Stores ]] -- Streamline.STORE_OPEN = function() if Streamline_Settings.Repair then ClickRepairAllButton() end end -- [[ End Stores ]] -- -- [[ House ]] -- Streamline.SpeakFrame_SpeakOption = function(unknown, index) BankFrame:Hide() MailFrame:Hide() Sol.hooks.GetOriginalFn(Streamline.Strings.AddonName, "SpeakFrame_SpeakOption")(unknown, index) end -- One-click class swap. Event is fired when Class change window is shown. Streamline.EXCHANGECLASS_SHOW = function() if Streamline_Settings.ChangeClass then -- Taken from ClassSwap. Hey, if it works... This requires on less click, though. -- Thanks go to vEEcEE ExchangeClass(EXCHANGECLASS_SUBCLASS, EXCHANGECLASS_MAINCLASS) if Streamline_Settings.LeaveHouseAfterChange then SpeakFrame_Show() SpeakFrame_LoadListDialog() for i = 1, GetNumSpeakOption() do local name, id = GetSpeakOption(i) if name == Streamline.Strings.LeaveHouse then SpeakFrame_ListDialogOption(id, i) end end end end end -- [[ End House ]] -- -- [[ Mail ]] -- -- Called when a bag item is clicked on Streamline.BagItemButton_OnClick = function(frame, button, ignoreShift) -- Add item to mail and send it if a name's entered if Streamline_Settings.ClickSendAttachment and MailFrame:IsVisible() and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.ClickSendAttachmentKey]) then PickupBagItem(frame.index) ClickSendMailItemButton() if SendMailNameEditBox:GetText() and SendMailNameEditBox:GetText() ~= "" then SendMailFrame_SendMail() end return end -- Send item as guild contribution if Streamline_Settings.ContributeToGuild and GuildFrame:IsVisible() and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.ContributeToGuildKey]) then PickupBagItem(frame.index) GCB_GetContributionItem(1) GCB_OnOK() return end -- Sell items on AH if Streamline_Settings.AuctionOnClick and (AuctionFrame:IsVisible() or (AA_AuctionFrame and AA_AuctionFrame:IsVisible())) and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.AuctionOnClickKey]) then PickupBagItem(frame.index) ClickAuctionItemButton() local callback = function() AuctionSellCreateButton_OnClick() end Sol.timers.ScheduleTimer(Streamline.Strings.AddonName, 0.5, callback) return end -- Move item to the other free bag if Streamline_Settings.SwitchBagsOnClick and Sol.util.IsMetaKeyDown(Streamline.MetaKeys[Streamline_Settings.SwitchBagsOnClickKey]) then local bagIndex = Sol.util.TernaryOp(frame.index <= 90, 1, 0) local slot = Sol.data.items.FindEmptyBagSlot(bagIndex) if slot then PickupBagItem(frame.index) PickupBagItem(slot) end return end Sol.hooks.GetOriginalFn(Streamline.Strings.AddonName, "BagItemButton_OnClick")(frame, button, ignoreShift) end -- Event's fired when you read a message or get new mail Streamline.MAIL_INBOX_UPDATE = function() -- To make sure we don't delete mail other than the one we just took -- an item from, check how long it's been since you took an item local MAIL_UPDATE_TIME = 2 if Streamline.itemTakenAt and Streamline_Settings.DeleteMail and os.difftime(os.time(), Streamline.itemTakenAt) <= MAIL_UPDATE_TIME then OpenMail_Delete() end end -- When you take an item from a msg in your mailbox or open the mbox Streamline.OpenMailFrame_Show = function(...) local _, _, _, COD, _, moneyAmt, _, _, items = GetInboxHeaderInfo(InboxFrame.openMailIndex) Sol.hooks.GetOriginalFn(Streamline.Strings.AddonName, "Show", OpenMailFrame)(...) Streamline.itemTakenAt = nil if not COD and ((items and items > 0) or (moneyAmt and moneyAmt > 0)) then if Streamline_Settings.TakeMail then TakeInboxItem(InboxFrame.openMailIndex) end if GetInboxText(InboxFrame.openMailIndex) == "" then Streamline.itemTakenAt = os.time() end end end -- [[ End Mail ]] -- -- [[ Pay items ]] -- -- Event's fired pretty much anytime orange text appears in the chat frame Streamline.CHAT_MSG_SYSTEM = function(msg) if not msg or not Streamline.Strings or not Streamline.Strings.AcceptedQuest then return end local accepted = Sol.string.StartsWith(msg, Streamline.Strings.AcceptedQuest) local completed = Sol.string.StartsWith(msg, Streamline.Strings.CompletedQuest) local learnedRecipe = string.match(msg, Streamline.Strings.LearnedRecipe) if completed then SpeakFrame_CompleteQuest() end if accepted then SpeakFrame_AcceptQuest() end -- Reopens the recipe purchase window. The recipes don't get updated until -- the user clicks on the npc again, so we use other ways to show which -- recipe was bought. -- TODO: Hook FSF_Update, I guess, to do this better; also, refactor if learnedRecipe and Streamline_Settings.DontCloseRecipeWindow then FSF_OnEvent(FormulaStoreFrame, "FSF_OPEN") for i = 1, MAX_FORMULA_ITEM do local item = _G["FSF_List_Item" .. i] local nameWidget = _G["FSF_List_Item" .. i .."Name"] local name = nameWidget:GetText() if name == learnedRecipe then nameWidget:SetText(Streamline.Strings.Purchased) end end end -- We can show the NPC window after accepting a quest, if Streamline_Settings.ReDisplayQuestDialog and accepted and (GetNumQuest(1) + GetNumQuest(3) > 1) then -- Only redisplay if a quest is left* SpeakFrame_Show() SpeakFrame_Clear() SpeakFrame_LoadQuest() -- Remove any quests that are in the quest log now (if we only removed the one -- that we just got, then on next click it would be back) for i = #g_SpeakFrameData.option, 1, -1 do local opt = g_SpeakFrameData.option[i] for q = 1, GetNumQuestBookButton_QuestBook() do local _, _, questName = GetQuestInfo(q) -- Some names will have " (Complete)" attached local completeIndex = questName:find(Streamline.Strings.Complete) if completeIndex then questName = questName:sub(1, completeIndex - 3) -- take into account " (" end if opt.title == questName then table.remove(g_SpeakFrameData.option, i) break end end end SpeakOption_UpdateItems() end end Streamline.SHOW_REQUEST_DIALOG = function(msg) if (Streamline_Settings.AcceptTeleport and msg:find(Streamline.Strings.Teleport)) or (Streamline_Settings.Accept15MinHorse and msg:find(Streamline.Strings.Horse15Min)) or (Streamline_Settings.Accept2HourHorse and msg:find(Streamline.Strings.Horse2Hour)) then if StaticPopup1:IsVisible() then StaticPopup_EnterPressed(StaticPopup1) StaticPopup1:Hide() end end end -- [[ Pay items ]] -- -- [[ Skills ]] -- -- Set visibilty of all 80 action bar hotkeys Streamline.SetHotkeysVisible = function(visible) local actionBarFrames = { "MainActionBarFrame", "BottomActionBarFrame", "RightActionBarFrame", "LeftActionBarFrame", } for _, barName in ipairs(actionBarFrames) do for i = 1, 20 do local hotkeyName = barName .. "Button" .. i .. "Hotkey" Sol.util.SetVisible(_G[hotkeyName], visible) end end end Streamline.ShowSkill = function() defaultSkillupWidth = SkillLevelUpFrame:GetWidth() SkillLevelUpFrame:SetWidth(305) StreamlineMaxSkillFrame:Show() end Streamline.HideSkill = function() SkillLevelUpFrame:SetWidth(250) StreamlineMaxSkillFrame:Hide() end -- Event's fired when you use on of your craft skills to open the crafting window Streamline.USE_CRAFTFRAME_SKILL = function(index) if Streamline_Settings.ShowCorrectCraftDialog and not UI_CraftFrame:IsVisible() then ToggleUIFrame(UI_CraftFrame) end if UI_CraftFrame:IsVisible() then Streamline.UpdateCraftSkillLabel() end end Streamline.PLAYER_LIFESKILL_CHANGED = function() if UI_CraftFrame:IsVisible() then Streamline.UpdateCraftSkillLabel() end end Streamline.UpdateCraftSkillLabel = function() local CraftTypeID, CraftTypeName = GetCraftItemType(UI_CraftFrame.SelectCraftType) local shortName = nil for _, group in ipairs(Crafting_Groups) do for _, craft in ipairs(group.Items) do if craft.Name == CraftTypeName then shortName = craft.ID end end end if shortName then local skillLevel = Sol.math.Round(GetPlayerCurrentSkillValue(shortName), 2) StreamlineCraftSkillLabel:SetText(skillLevel) end end -- [[ End Skills ]] -- Streamline_OnUpdate = function(frame, elapsedTime) -- Used for timing end
object_tangible_furniture_decorative_wod_pro_sm_tree_04 = object_tangible_furniture_decorative_shared_wod_pro_sm_tree_04:new { } ObjectTemplates:addTemplate(object_tangible_furniture_decorative_wod_pro_sm_tree_04, "object/tangible/furniture/decorative/wod_pro_sm_tree_04.iff")
local size = 16 local border = 4 local distance = size + border local PLUGIN = PLUGIN or {}; local PANEL = {} function PANEL:Init() self:SetPos(ScrW() * 0.375, ScrH() * 0.125); self:SetSize(ScrW() * nut.config.menuWidth, ScrH() * nut.config.menuHeight); self:MakePopup(); self.activeEntity = nil; end function PANEL:SetEntity(entity, title, isAddCloseButton) self:SetupFrame(title, isAddCloseButton); local noticePanel = self:Add("nut_NoticePanel"); noticePanel:Dock(TOP); noticePanel:DockMargin(5, 5, 5, 0); noticePanel:SetType(7); noticePanel:SetText(PLUGIN:GetPluginLanguage("craft_menu_tip1")); local noticePanel = self:Add("nut_NoticePanel"); noticePanel:Dock(TOP); noticePanel:DockMargin(5, 5, 5, 0); noticePanel:SetType(4); noticePanel:SetText(PLUGIN:GetPluginLanguage("craft_menu_tip2")); self.list = vgui.Create("AdvNut_ScrollPanel", self); self.list:Dock(FILL); self.list:DockMargin(10, 0, 10, 10); self.list:SetDrawBackground(false); self.categories = {} self.nextBuy = 0 self:SetActiveEntity(entity); self:BuildItems(); end; function PANEL:SetupFrame(title, isAddCloseButton) if(title) then self:AddTitle(PLUGIN:GetPluginLanguage("crafting").." - "..title); else self:AddTitle(PLUGIN:GetPluginLanguage("crafting")); end; if(isAddCloseButton) then self:AddCloseButton(); end; end; function PANEL:BuildItems() nut.schema.Call("CraftingPrePopulateItems", self); self.list:Clear(); local canCraftingRecipes = {}; for class, recipe in SortedPairs(RECIPES:GetAll()) do if(RECIPES:HaveRecipe(LocalPlayer(), class) and recipe.workbenchType == self.activeEntity) then canCraftingRecipes[class] = recipe; end; end; if (table.Count(canCraftingRecipes) <= 0) then local label = vgui.Create("DLabel", self); label:Dock(FILL); label:SetText(PLUGIN:GetPluginLanguage("norecipes")); label:SetColor(color_black); label:SetFont("nut_TargetFont"); label:SetContentAlignment(5); else for class, recipe in SortedPairs(canCraftingRecipes) do local category = recipe.category local category2 = string.lower(category) if (!self.categories[category2]) then local category3 = vgui.Create("AdvNut_CategoryList", self.list); category3:Dock(TOP) category3:SetLabel(category) category3:DockMargin(5, 5, 5, 5) category3:SetPadding(5) category3:InvalidateLayout(true); local list = vgui.Create("DIconLayout") category3:SetContents(list); list:SetSpaceX(5); list:SetSpaceY(5); list.Paint = function(list, w, h) surface.SetDrawColor(0, 0, 0, 0) surface.DrawRect(0, 0, w, h) end; self:CreateItemIcon(list, recipe, class); nut.schema.Call("CraftingCategoryCreated", category3) self.categories[category2] = {list = list, category = category3, panel = panel} else self:CreateItemIcon(self.categories[category2].list, recipe, class); nut.schema.Call("CraftingItemCreated", recipe, icon); end; end end; nut.schema.Call("CraftingPostPopulateItems", self) end; function PANEL:CreateItemIcon(panel, recipe, class) local icon = vgui.Create("SpawnIcon", panel); local isCraft = RECIPES:CanCraft(LocalPlayer(), class); icon:SetSize(nut.config.iconSize * 0.8, nut.config.iconSize * 0.8); icon:SetModel(recipe.model or "models/props_lab/box01a.mdl") icon.PaintOver = function(icon, w, h) if (isCraft) then AdvNut.util.DrawOutline(icon, 1, Color(10, 10, 10, 255)); else AdvNut.util.DrawOutline(icon, 1, Color(255, 10, 10, 255)); end; end; local function RecipeTableParsing(recipe) local parsingString = ""; for itemID, count in SortedPairsByValue(recipe) do local itemTable = nut.item.Get(itemID) if(count <= 0) then parsingString = string.format(parsingString.." - %s - %d\n"); else if (itemTable) then parsingString = string.format(parsingString.." * %s - %dx\n", itemTable.name, count); else parsingString = string.format(parsingString.." * %s - %dx\n", PLUGIN:GetPluginLanguage("notexist", itemID), count); end; end; end; return parsingString; end; local request = RecipeTableParsing(recipe.items); local result = RecipeTableParsing(recipe.result); icon:SetToolTip(PLUGIN:GetPluginLanguage("crft_text", recipe.name, recipe.desc, request, result)); if(isCraft) then icon.DoClick = function(panel) if (icon.disabled) then return; end net.Start("nut_CraftItem") net.WriteString(class) net.SendToServer() icon.disabled = true icon:SetAlpha(70) timer.Simple(nut.config.buyDelay, function() if (IsValid(icon)) then icon.disabled = false; icon:SetAlpha(255); end end); end end; end; function PANEL:SetActiveEntity(entity) if(entity) then self.activeEntity = entity:GetClass(); else self.activeEntity = nil; end; end; vgui.Register("nut_Crafting", PANEL, "AdvNut_BaseForm"); local PLUGIN = PLUGIN; function PLUGIN:CreateMenuButtons(menu, addButton) if (self.menuEnabled) then addButton("crafting", PLUGIN:GetPluginLanguage("crafting"), function() nut.gui.crafting = vgui.Create("nut_Crafting", menu) nut.gui.crafting:SetSize(AdvNut.util.GetCurrentMenuSize()); nut.gui.crafting:SetPos(AdvNut.util.GetCurrentMenuPos()); nut.gui.crafting:SetEntity(); menu:SetCurrentMenu(nut.gui.crafting); end) end end
-- Shaman Raven.classConditions.SHAMAN = { ["Lightning Shield Missing"] = { -- valid for Enhancement specialization only tests = { ["Player Status"] = { enable = true, inCombat = true }, ["Spell Ready"] = { enable = true, spell = 192106, }, -- "Lightning Shield" ["Any Buffs"] = { enable = true, toggle = true, unit = "player", auras = { 192106 }, }, }, }, }
nightsisterreturnScreenPlay = ScreenPlay:new { numberOfActs = 1, } registerScreenPlay("nightsisterreturnScreenPlay", true) function nightsisterreturnScreenPlay:start() if (isZoneEnabled("dungeon2")) then self:spawnMobiles() self:spawnSceneObjects() end end function nightsisterreturnScreenPlay:spawnSceneObjects() end function nightsisterreturnScreenPlay:spawnMobiles() local pCollector1 = spawnMobile("dungeon2", "teleporter", 120, 23.7, 0.1, 0.2, -90, 14201104) local collector1 = LuaCreatureObject(pCollector1) collector1:setOptionsBitmask(264) collector1:setCustomObjectName("\\#FF0000Exit Dungeon") createObserver(OBJECTRADIALUSED, "nightsisterreturnScreenPlay", "returnNightsister", pCollector1) if (pCollecter1~= nil) then return end end function nightsisterreturnScreenPlay:returnNightsister(pCollector, pPlayer)--current local player = LuaSceneObject(pPlayer) player:switchZone("dungeon2", 59.7, 0.8, -43.1, 14200887) return 0 end
----------------------------------------------- -- key.lua -- Represents a key when it is in the world ----------------------------------------------- local Item = require 'items/item' local Prompt = require 'prompt' local utils = require 'utils' local Gamestate = require 'vendor/gamestate' local Key = {} Key.__index = Key --- -- Creates a new key object -- @return the key object created function Key.new(node, collider) local key = {} setmetatable(key, Key) key.name = node.name key.type = node.type key.image = love.graphics.newImage('images/keys/'..node.name..'.png') key.image_q = love.graphics.newQuad( 0, 0, 24, 24, key.image:getWidth(),key.image:getHeight() ) key.foreground = node.properties.foreground key.info = node.properties.info if collider then key.collider = collider key.bb = collider:addRectangle(node.x, node.y, node.width, node.height) key.bb.node = key collider:setPassive(key.bb) end key.position = {x = node.x, y = node.y} key.width = node.width key.height = node.height key.touchedPlayer = nil return key end --- -- Draws the key to the screen -- @return nil function Key:draw() love.graphics.draw(self.image, self.image_q, self.position.x, self.position.y) end function Key:keypressed( button, player ) if button ~= 'INTERACT' then return end local itemNode = utils.require ('items/keys/'..self.name) local item = Item.new(itemNode, self.quantity) if player.inventory:hasKey(self.name) or player.inventory:addItem(item) then self.containerLevel:saveRemovedNode(self) self.containerLevel:removeNode(self) end if not self.fromChest then local message = self.info or {'You found the {{red}}"'..item.description..'"{{white}} key!'} player.character.state = 'acquire' local callback = function(result) self.prompt = nil player.freeze = false player.invulnerable = false if self.name == 'greendale' then Gamestate.stack("credits", self.containerLevel) end end local options = {'Exit'} player.freeze = true player.invulnerable = true self.position = { x = player.position.x + 10 ,y = player.position.y - 10 } self.prompt = Prompt.new(message, callback, options, self) end end --- -- Called when the key begins colliding with another node -- @return nil function Key:collide(node, dt, mtv_x, mtv_y) if node and node.character then self.touchedPlayer = node end end --- -- Called when the key finishes colliding with another node -- @return nil function Key:collide_end(node, dt) if node and node.character then self.touchedPlayer = nil end end --- -- Updates the key and allows the player to pick it up. function Key:update(dt) local x1,y1,x2,y2 = self.bb:bbox() self.bb:moveTo( self.position.x + (x2-x1)/2, self.position.y + (y2-y1)/2) end return Key
function Weld(x,y) local W = Instance.new("Weld") W.Part0 = x W.Part1 = y local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()*CJ local C1 = y.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = x end function Get(A) if A.className == "Part" then Weld(script.Parent.Handle, A) A.Anchored = false else local C = A:GetChildren() for i=1, #C do Get(C[i]) end end end function Finale() Get(script.Parent) end script.Parent.Equipped:connect(Finale) script.Parent.Unequipped:connect(Finale) Finale()
local json = require("cjson") -- local http = require "resty.http" local _M = {} -- 将字符串转换为table,如果转换失败,则返回nil _M.json_decode = function(str) local ok, t = pcall(json.decode, str) if not ok then return nil end return t end -- 将字符串转换为json,如果转换失败,则返回nil _M.json_encode = function(str) local ok, t = pcall(json.encode, str) if not ok then return nil end return t end -- 将文件读入到字符串内,不要读取大文件 _M.read_file_str = function(filename) local f = io.input(filename) local data = {} repeat line = io.read() if nil == line then break end table.insert(data, line) until(false) return table.concat(data, '\n') end -- _M.new_limit_req = function(sharedict, rate, brust) -- return limit_req.new(sharedict, rate, brust) -- end -- local httpc = http.new(); -- _M.request_uri = function(host, params) -- return httpc:request_uri(host, params) -- end _M.get_file_body = function(filename) local f = assert(io.open(filename, 'r')) local string = f:read("*all") f:close() return string end return _M
includes("core_test")
AddCSLuaFile("crosshair/cl_init.lua")
--[[ © CloudSixteen.com do not share, re-distribute or modify without permission of its author (kurozael@gmail.com). Clockwork was created by Conna Wiles (also known as kurozael.) http://cloudsixteen.com/license/clockwork.html --]] local Clockwork = Clockwork; local CloseDermaMenus = CloseDermaMenus; local IsValid = IsValid; local pairs = pairs; local ScrH = ScrH; local ScrW = ScrW; local string = string; local table = table; local vgui = vgui; local math = math; local gui = gui; local PANEL = {}; -- Called when the panel is initialized. function PANEL:Init() self:SetTitle(Clockwork.storage:GetName()); self:SetDeleteOnClose(false); -- Called when the button is clicked. function self.btnClose.DoClick(button) CloseDermaMenus(); self:Close(); self:Remove(); gui.EnableScreenClicker(false); Clockwork.kernel:RunCommand("StorageClose"); end; self.containerPanel = vgui.Create("cwPanelList", self); self.containerPanel:SetPadding(4); self.containerPanel:SetSpacing(4); self.containerPanel:SizeToContents(); self.containerPanel:EnableVerticalScrollbar(); if (!Clockwork.storage:GetIsOneSided()) then self.inventoryPanel = vgui.Create("cwPanelList", self); self.inventoryPanel:SetPadding(4); self.inventoryPanel:SetSpacing(4); self.inventoryPanel:SizeToContents(); self.inventoryPanel:EnableVerticalScrollbar(); end; Clockwork.kernel:SetNoticePanel(self); end; -- A function to rebuild a panel. function PANEL:RebuildPanel(storagePanel, storageType, usedWeight, weight, usedSpace, space, cash, inventory) storagePanel:Clear(true); storagePanel.cash = cash; storagePanel.weight = weight; storagePanel.usedWeight = usedWeight; storagePanel.space = space; storagePanel.usedSpace = usedSpace; storagePanel.inventory = inventory; storagePanel.storageType = storageType; Clockwork.plugin:Call("PlayerPreRebuildStorage", storagePanel); local modelIcon = vgui.Create("DModelPanel", storagePanel); modelIcon:SetSize(100, 250); local sequence; if (storageType == "Container") then local ent = Clockwork.storage:GetEntity(); if (IsValid(ent)) then modelIcon:SetModel(ent:GetModel()) sequence = ent:GetSequence(); end; else local player = Clockwork.Client; modelIcon:SetModel(player:GetModel()); sequence = player:GetSequence(); end; local bone = modelIcon:GetEntity():LookupBone("ValveBiped.Bip01_Head1") local position = Vector(0, 0, 10); if (bone) then position = modelIcon:GetEntity():GetBonePosition(bone); end; modelIcon:SetLookAt(position - Vector(0, 0, 15)); modelIcon:GetEntity():SetSequence(sequence); function modelIcon:LayoutEntity(entity) return self:RunAnimation(); end; storagePanel:AddItem(modelIcon); local categories = {}; local usedWeight = (cash * Clockwork.config:Get("cash_weight"):Get()); local usedSpace = (cash * Clockwork.config:Get("cash_space"):Get()); local itemsList = {}; if (Clockwork.storage:GetNoCashWeight()) then usedWeight = 0; end; if (Clockwork.storage:GetNoCashSpace()) then usedSpace = 0; end; for k, v in pairs(storagePanel.inventory) do for k2, v2 in pairs(v) do if ((storageType == "Container" and Clockwork.storage:CanTakeFrom(v2)) or (storageType == "Inventory" and Clockwork.storage:CanGiveTo(v2))) then local itemCategory = v2("category"); if (itemCategory) then itemsList[itemCategory] = itemsList[itemCategory] or {}; itemsList[itemCategory][#itemsList[itemCategory] + 1] = v2; usedWeight = usedWeight + math.max(v2("storageWeight", v2("weight")), 0); usedSpace = usedSpace + math.max(v2("storageSpace", v2("space")), 0); end; end; end; end; for k, v in pairs(itemsList) do categories[#categories + 1] = { itemsList = v, category = k }; end; table.sort(categories, function(a, b) return a.category < b.category; end); if (!storagePanel.usedWeight) then storagePanel.usedWeight = usedWeight; end; if (!storagePanel.usedSpace) then storagePanel.usedSpace = usedSpace; end; Clockwork.plugin:Call( "PlayerStorageRebuilt", storagePanel, categories ); local numberWang = nil; local cashForm = nil; local button = nil; if (Clockwork.config:Get("cash_enabled"):Get() and storagePanel.cash > 0) then numberWang = vgui.Create("DNumberWang", storagePanel); cashForm = vgui.Create("DForm", storagePanel); button = vgui.Create("DButton", storagePanel); button:SetText(L("StorageTransfer")); button.Stretch = true; -- Called when the button is clicked. function button.DoClick(button) if (storageType == "Inventory") then Clockwork.kernel:RunCommand("StorageGiveCash", numberWang:GetValue()); else Clockwork.kernel:RunCommand("StorageTakeCash", numberWang:GetValue()); end; end; numberWang.Stretch = true; numberWang:SetDecimals(0); numberWang:SetMinMax(0, storagePanel.cash); numberWang:SetValue(storagePanel.cash); numberWang:SizeToContents(); cashForm:SetPadding(5); cashForm:SetName(L("Cash")); cashForm:AddItem(numberWang); cashForm:AddItem(button); end; local informationForm = vgui.Create("DForm", storagePanel); informationForm:SetPadding(5); informationForm:SetName(L("Weight")); local storageWeight = vgui.Create("cwStorageWeight", storagePanel); storageWeight:SetWeight(weight); storageWeight:SetUsedWeight(usedWeight); informationForm:AddItem(storageWeight); storagePanel:AddItem(informationForm); if (Clockwork.inventory:UseSpaceSystem() and storagePanel.usedSpace > 0) then local informationForm = vgui.Create("DForm", storagePanel); informationForm:SetPadding(5); informationForm:SetName(L("Space")); local storageSpace = vgui.Create("cwStorageSpace", storagePanel); storageSpace:SetSpace(space); storageSpace:SetUsedSpace(usedSpace); informationForm:AddItem(storageSpace); storagePanel:AddItem(informationForm); end; if (cashForm) then storagePanel:AddItem(cashForm); end; if (#categories > 0) then for k, v in pairs(categories) do local collapsibleCategory = Clockwork.kernel:CreateCustomCategoryPanel(v.category, storagePanel); collapsibleCategory:SetCookieName(storageType..v.category); storagePanel:AddItem(collapsibleCategory); local categoryList = vgui.Create("DPanelList", collapsibleCategory); categoryList:EnableHorizontal(true); categoryList:SetAutoSize(true); categoryList:SetPadding(4); categoryList:SetSpacing(4); collapsibleCategory:SetContents(categoryList); table.sort(v.itemsList, function(a, b) return a("itemID") < b("itemID"); end); for k2, v2 in pairs(v.itemsList) do CURRENT_ITEM_DATA = { itemTable = v2, storageType = storagePanel.storageType }; categoryList:AddItem( vgui.Create("cwStorageItem", categoryList) ); end; end; end; end; -- A function to rebuild the panel. function PANEL:Rebuild() self:RebuildPanel(self.containerPanel, "Container", nil, Clockwork.storage:GetWeight(), nil, Clockwork.storage:GetSpace(), Clockwork.storage:GetCash(), Clockwork.storage:GetInventory() ); if (!Clockwork.storage:GetIsOneSided()) then local inventory = Clockwork.inventory:GetClient(); local maxWeight = Clockwork.player:GetMaxWeight(); local weight = Clockwork.inventory:CalculateWeight(inventory); local maxSpace = Clockwork.player:GetMaxSpace(); local space = Clockwork.inventory:CalculateSpace(inventory); local cash = Clockwork.player:GetCash(); self:RebuildPanel(self.inventoryPanel, "Inventory", weight, maxWeight, space, maxSpace, cash, inventory ); end; end; -- Called each frame. function PANEL:Think() self:SetSize(ScrW() * 0.5, ScrH() * 0.75); self:SetPos((ScrW() / 2) - (self:GetWide() / 2), (ScrH() / 2) - (self:GetTall() / 2)); if (IsValid(self.inventoryPanel) and Clockwork.player:GetCash() != self.inventoryPanel.cash) then self:Rebuild(); end; end; -- Called when the layout should be performed. function PANEL:PerformLayout(w, h) DFrame.PerformLayout(self); if (!Clockwork.storage:GetIsOneSided()) then self.inventoryPanel:StretchToParent(nil, 28, nil, 4); self.inventoryPanel:AlignRight(0); self.inventoryPanel:SetWide(self:GetWide() / 2); end; self.containerPanel:SetWide(self:GetWide() / 2); self.containerPanel:StretchToParent(nil, 28, nil, 4); self.containerPanel:AlignLeft(0); end; vgui.Register("cwStorage", PANEL, "DFrame"); local PANEL = {}; -- Called when the panel is initialized. function PANEL:Init() local itemData = self:GetParent().itemData or CURRENT_ITEM_DATA; self:SetSize(56, 56); self.itemTable = itemData.itemTable; self.storageType = itemData.storageType; self.spawnIcon = Clockwork.kernel:CreateMarkupToolTip(vgui.Create("cwSpawnIcon", self)); -- Called when the spawn icon is clicked. function self.spawnIcon.DoClick(spawnIcon) if (!self.nextCanClick or CurTime() >= self.nextCanClick) then if (self.storageType == "Inventory") then Clockwork.kernel:RunCommand("StorageGiveItem", self.itemTable("uniqueID"), self.itemTable("itemID")); else Clockwork.kernel:RunCommand("StorageTakeItem", self.itemTable("uniqueID"), self.itemTable("itemID")); end; self.nextCanClick = CurTime() + 1; end; end; local model, skin = Clockwork.item:GetIconInfo(self.itemTable); self.spawnIcon:SetModel(model, skin); self.spawnIcon:SetToolTip(""); self.spawnIcon:SetSize(56, 56); self.cachedInfo = {model = model, skin = skin}; end; -- Called each frame. function PANEL:Think() self.spawnIcon:SetMarkupToolTip(Clockwork.item:GetMarkupToolTip(self.itemTable)); self.spawnIcon:SetColor(self.itemTable("color")); --[[ Check if the model or skin has changed and update the spawn icon. --]] local model, skin = Clockwork.item:GetIconInfo(self.itemTable); if (model != self.cachedInfo.model or skin != self.cachedInfo.skin) then self.spawnIcon:SetModel(model, skin); self.cachedInfo.model = model self.cachedInfo.skin = skin; end; end; vgui.Register("cwStorageItem", PANEL, "DPanel"); local PANEL = {}; function PANEL:SetWeight(weight) self.weight = weight; end; function PANEL:GetWeight() return self.weight or 0 end; function PANEL:SetUsedWeight(usedWeight) self.usedWeight = usedWeight; end; function PANEL:GetUsedWeight() return self.usedWeight or 0; end; -- Called when the panel is initialized. function PANEL:Init() local colorWhite = Clockwork.option:GetColor("white"); self.spaceUsed = vgui.Create("DPanel", self); self.spaceUsed:SetPos(1, 1); self.panel = self:GetParent(); self.weightLabel = vgui.Create("DLabel", self); self.weightLabel:SetText("N/A"); self.weightLabel:SetTextColor(colorWhite); self.weightLabel:SizeToContents(); self.weightLabel:SetExpensiveShadow(1, Color(0, 0, 0, 150)); -- Called when the panel should be painted. function self.spaceUsed.Paint(spaceUsed) local maximumWeight = math.floor(self:GetWeight()); local usedWeight = math.floor(self:GetUsedWeight()); local color = Color(100, 100, 100, 255); local width = math.Clamp((spaceUsed:GetWide() / maximumWeight) * usedWeight, 0, spaceUsed:GetWide()); local red = math.Clamp((255 / maximumWeight) * usedWeight, 0, 255) ; if (color) then color.r = math.min(color.r - 25, 255); color.g = math.min(color.g - 25, 255); color.b = math.min(color.b - 25, 255); end; Clockwork.kernel:DrawSimpleGradientBox(0, 0, 0, spaceUsed:GetWide(), spaceUsed:GetTall(), color); Clockwork.kernel:DrawSimpleGradientBox(0, 0, 0, width, spaceUsed:GetTall(), Color(139, 215, 113, 255)); end; end; -- Called each frame. function PANEL:Think() self.spaceUsed:SetSize(self:GetWide() - 2, self:GetTall() - 2); self.weightLabel:SetText(math.floor(self:GetUsedWeight()).."/"..math.floor(self:GetWeight()).."kg"); self.weightLabel:SetPos(self:GetWide() / 2 - self.weightLabel:GetWide() / 2, self:GetTall() / 2 - self.weightLabel:GetTall() / 2); self.weightLabel:SizeToContents(); end; vgui.Register("cwStorageWeight", PANEL, "DPanel"); local PANEL = {}; function PANEL:SetSpace(space) self.maxSpace = space; end; function PANEL:GetSpace() return self.maxSpace or 0 end; function PANEL:SetUsedSpace(usedSpace) self.usedSpace = usedSpace; end; function PANEL:GetUsedSpace() return self.usedSpace or 0; end; -- Called when the panel is initialized. function PANEL:Init() local colorWhite = Clockwork.option:GetColor("white"); self.spaceUsed = vgui.Create("DPanel", self); self.spaceUsed:SetPos(1, 1); self.panel = self:GetParent(); self.space = vgui.Create("DLabel", self); self.space:SetText("N/A"); self.space:SetTextColor(colorWhite); self.space:SizeToContents(); self.space:SetExpensiveShadow(1, Color(0, 0, 0, 150)); -- Called when the panel should be painted. function self.spaceUsed.Paint(spaceUsed) local maximumSpace = math.floor(self:GetSpace()); local usedSpace = math.floor(self:GetUsedSpace()); local color = Color(100, 100, 100, 255); local width = math.Clamp((spaceUsed:GetWide() / maximumSpace) * usedSpace, 0, spaceUsed:GetWide()); local red = math.Clamp((255 / maximumSpace) * usedSpace, 0, 255) ; if (color) then color.r = math.min(color.r - 25, 255); color.g = math.min(color.g - 25, 255); color.b = math.min(color.b - 25, 255); end; Clockwork.kernel:DrawSimpleGradientBox(0, 0, 0, spaceUsed:GetWide(), spaceUsed:GetTall(), color); Clockwork.kernel:DrawSimpleGradientBox(0, 0, 0, width, spaceUsed:GetTall(), Color(139, 215, 113, 255)); end; end; -- Called each frame. function PANEL:Think() self.spaceUsed:SetSize(self:GetWide() - 2, self:GetTall() - 2); self.space:SetText(math.floor(self:GetUsedSpace()).."/"..math.floor(self:GetSpace()).."l"); self.space:SetPos(self:GetWide() / 2 - self.space:GetWide() / 2, self:GetTall() / 2 - self.space:GetTall() / 2); self.space:SizeToContents(); end; vgui.Register("cwStorageSpace", PANEL, "DPanel"); Clockwork.datastream:Hook("StorageStart", function(data) if (Clockwork.storage:IsStorageOpen()) then CloseDermaMenus(); Clockwork.storage.panel:Close(); Clockwork.storage.panel:Remove(); end; gui.EnableScreenClicker(true); Clockwork.storage.noCashWeight = data.noCashWeight; Clockwork.storage.noCashSpace = data.noCashSpace; Clockwork.storage.isOneSided = data.isOneSided; Clockwork.storage.inventory = {}; Clockwork.storage.weight = Clockwork.config:Get("default_inv_weight"):Get(); Clockwork.storage.space = Clockwork.config:Get("default_inv_space"):Get(); Clockwork.storage.entity = data.entity; Clockwork.storage.name = data.name; Clockwork.storage.cash = 0; Clockwork.storage.panel = vgui.Create("cwStorage"); Clockwork.storage.panel:Rebuild(); Clockwork.storage.panel:MakePopup(); Clockwork.kernel:RegisterBackgroundBlur(Clockwork.storage:GetPanel(), SysTime()); end); Clockwork.datastream:Hook("StorageCash", function(data) if (Clockwork.storage:IsStorageOpen()) then Clockwork.storage.cash = data; Clockwork.storage:GetPanel():Rebuild(); end; end); Clockwork.datastream:Hook("StorageWeight", function(data) if (Clockwork.storage:IsStorageOpen()) then Clockwork.storage.weight = data; Clockwork.storage:GetPanel():Rebuild(); end; end); Clockwork.datastream:Hook("StorageSpace", function(data) if (Clockwork.storage:IsStorageOpen()) then Clockwork.storage.space = data; Clockwork.storage:GetPanel():Rebuild(); end; end); Clockwork.datastream:Hook("StorageClose", function(data) if (Clockwork.storage:IsStorageOpen()) then Clockwork.kernel:RemoveBackgroundBlur(Clockwork.storage:GetPanel()); CloseDermaMenus(); Clockwork.storage:GetPanel():Close(); Clockwork.storage:GetPanel():Remove(); gui.EnableScreenClicker(false); Clockwork.storage.inventory = nil; Clockwork.storage.weight = nil; Clockwork.storage.space = nil; Clockwork.storage.entity = nil; Clockwork.storage.name = nil; end; end); Clockwork.datastream:Hook("StorageTake", function(data) if (Clockwork.storage:IsStorageOpen()) then Clockwork.inventory:RemoveUniqueID( Clockwork.storage.inventory, data.uniqueID, data.itemID ); Clockwork.storage:GetPanel():Rebuild(); end; end); Clockwork.datastream:Hook("StorageGive", function(data) if (Clockwork.storage:IsStorageOpen()) then local itemTable = Clockwork.item:FindByID(data.index); if (itemTable) then for k, v in pairs(data.itemList) do Clockwork.inventory:AddInstance( Clockwork.storage.inventory, Clockwork.item:CreateInstance(data.index, v.itemID, v.data) ); end; Clockwork.storage:GetPanel():Rebuild(); end; end; end);
--newTile: called to initalise and return a new tile function new_tile(colour,type,type2) local t = {} -- states: -- "vertical" = vertical powerup -- "horizontal" = horizontal powerup -- "explosion" = explosion powerup -- "remover" = hypercube powerup thing t.type = type or nil t.type2 = type2 or nil -- Animation variables t.anim = {} t.anim.colour = {0.7,0.7,0.7} --colour used for animations (will be overwritten if tile has a colour) t.anim.velocity = 0 -- velocity of gem (when falling) t.anim.size = 1 -- size of gem (used for animations too) t.anim.x = 0 -- x pos for swap animation t.anim.y = 0 -- y pos for swap animation t.anim.status = "" -- string for current animation use t.anim.glow = 0 -- rotation of glow (explosion powerup) t.anim.glowOn = true -- true if glow should grow -- True if matched and needs to be removed t.matched = false -- True if tile was checked for match in current analyze (so far only used for powerup shizzle) t.analyzed = false -- True if tile was involved in swapping (used for powerups) t.wasSwapped = false -- If passed a colour then use that else choose one at random if (colour) then t.colour = colour else if (type == "remover") then t.colour = nil else local col = love.math.random(1,7) if (col == 1) then t.colour = "red" elseif (col == 2) then t.colour = "orange" elseif (col == 3) then t.colour = "yellow" elseif (col == 4) then t.colour = "green" elseif (col == 5) then t.colour = "blue" elseif (col == 6) then t.colour = "purple" elseif (col == 7) then t.colour = "white" end end end --Set animation colour if (t.colour == "red") then t.anim.colour = {1,0.3,0.3} elseif (t.colour == "orange") then t.anim.colour = {1,0.5,0.3} elseif (t.colour == "yellow") then t.anim.colour = {1,1,0.3} elseif (t.colour == "green") then t.anim.colour = {0.2,1,0.4} elseif (t.colour == "blue") then t.anim.colour = {0.2,0.4,1} elseif (t.colour == "purple") then t.anim.colour = {0.9,0.3,1} elseif (t.colour == "white") then t.anim.colour = {1,1,1} else t.anim.colour = {0.8,0.8,0.8} end -- Get image based on states if (t.type == "remover") then t.img = _G["tile_remover"] elseif (t.type) then t.img = _G["tile_"..t.colour.."_"..t.type] else t.img = _G["tile_"..t.colour] end return t end --new_placeholder: called to initalise and return a new tile placeholder (invisible) function new_placeholder() --Should be able to remove anim in future? return {anim = {x = 0, y = 0, size = 1}, colour = "invisible"} end
-- vim: set foldmethod=marker foldlevel=0: local status_ok, ls = pcall(require, "luasnip") if not status_ok then return end local s = ls.snippet local sn = ls.snippet_node local isn = ls.indent_snippet_node local t = ls.text_node local i = ls.insert_node local f = ls.function_node local c = ls.choice_node local d = ls.dynamic_node local r = ls.restore_node local fmt = require("luasnip.extras.fmt").fmt local get_comment_format = function () local commentstring = vim.bo.commentstring if string.sub(commentstring, -1) == "%s" then c = string.sub(commentstring, -2) return { c, c, c, "" } end -- Default return { "#", "#", "#", "" } end local get_comment_char = function () return string.gsub(get_comment_format()[1], '%s+', '') end local get_comment_separator = function () local prefix = get_comment_char() .. ' ' local textwidth = vim.bo.textwidth return prefix .. string.rep('-', textwidth - #prefix) end -- all {{{ ls.add_snippets("all", { s({ trig = 'vml', dscr = 'Foldmarker modeline' }, { f(get_comment_char), t({" vim: set foldmethod=marker foldlevel=0:", ""}), }), s({ trig = 'scc', dscr = 'Separator comment' }, { f(get_comment_separator), t({"", ""}), }), s({ trig = 'pcc', dscr = 'Primary comment' }, { f(get_comment_separator), t({"", ""}), i(1, "Comment Text"), }), s({ trig = 'fcc', dscr = 'Foldable section' }, { f(get_comment_char), t(" "), i(1, "Section Text"), t({" {{{", "", "", "", ""}), f(get_comment_char), t({" }}}"}), }), s('date', { f(function () return vim.fn.strftime("%Y-%m-%d") end) }), s('ddate', { f(function () return vim.fn.strftime("%B %d, %Y") end) }), s(':cmd', { t('⌘') }), s(':alt', { t('⌥') }), s(':shift', { t('⇧') }), s(':esc', { t('⎋') }), s(':caps', { t('⇪') }), s(':ret', { t('⏎') }), s(':del', { t('⌫') }), s(':tab', { t('⇥') }), s(':shrug', { t('¯\\_(ツ)_/¯') }), }) -- }}} -- html {{{ ls.add_snippets("html", { s("html5", { fmt([[<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>{title}</title> </head> <body> {body} </body> </html>]], { title = i(2, "Title"), body = i(1), }) }) }) -- }}} -- javascript {{{ ls.add_snippets("javascript", { s("iife", { fmt([[ (function () { [] })(); ]], { i(1) }, { delimiters = "[]" }) }), s("edl", { t("// eslint-disable-line") }), s("edn", { t("// eslint-disable-next-line") }), }) ls.filetype_extend("typescript", { "javascript" }) ls.filetype_extend("typescriptreact", { "javascript" }) ls.filetype_extend("javascriptreact", { "javascript" }) -- }}} -- javascript {{{ ls.add_snippets("markdown", { s("code", { t("```"), i(1, "bash"), t({ "", "" }), i(2, "echo hello"), t({ "", "```" }) }), s("a", fmt("[{1}]({2})", { i(1, "text"), i(2, "https://"), })), s("img", fmt("![{1}]({2})", { i(1, "alt"), i(2, "https://"), })), }) -- }}}
local user, id = unpack(ARGV); user = cjson.decode(user); local apikey = redis.call('GET', 'USER:'..user.id..':APIKEY'); -- Get the deaddrop -- local dd = redis.call('HGETALL', 'dd:' .. id); local ddId = redis.call('HGET', 'dd:' .. id, 'user'); local ddLocation = redis.call('HGET', 'dd:' .. id, 'location'); local ddLocationType = redis.call('HGET', 'dd:' .. id, 'type'); -- Verify that you own it if (tonumber(ddId) ~= tonumber(user.id)) then return {"nope", false, 403}; end -- Delete it redis.call('DEL', 'dd:'..id); -- find the dd:id:hash key and delete it local hash = redis.sha1hex(ddLocation .. ":" .. ddLocationType .. ":" .. apikey); redis.call('DEL', 'dd:id:' .. hash); -- Remove the dead drop from the user redis.call('SREM', 'USER:' .. user.id .. ':DEADDROPS', id); redis.call('ZREM', 'USER:' .. user.id .. ':DEADDROP:locations', id); -- Remove events local events = redis.call('ZRANGE','DEADDROP:'..id..':EVENTS',0,-1); redis.call('DEL', unpack(events)); redis.call('DEL', 'DEADDROP:'..id..':EVENTS'); return {false, '', 200};
function do_beep(duration, frequency) beeper.beep(duration, frequency) end print("functions loaded")
local profile_util = require("profile_util") local arg_parser = require("lib.LuaArgParser.arg_parser") local api_util = require("api_util") local util = require("util") ---@class PhobosProfilesInternal : PhobosProfiles local phobos_profiles = { internal = { all_profiles = {}, profiles_by_name = {}, main_args_config = nil, -- set by main.lua main_help_config = nil, -- set by main.lua -- the exact string that was passed in as an argument to the program -- (after going through a Path.new(filename):str() roundtrip - implementation details) current_profile_file = nil, -- set by main.lua current_root_dir = nil, -- set by main.lua }, } local all_profiles = phobos_profiles.internal.all_profiles local profiles_by_name = phobos_profiles.internal.profiles_by_name function phobos_profiles.add_profile(params) local profile = api_util.api_call(function() local root_dir = params.root_dir params.root_dir = params.root_dir or phobos_profiles.internal.current_root_dir local profile = profile_util.new_profile(params) params.root_dir = root_dir -- add the profile api_util.assert(not profiles_by_name[profile.name], "Attempt to add 2 profiles with the name '"..profile.name.."'." ) profiles_by_name[profile.name] = profile all_profiles[#all_profiles+1] = profile return profile end) return profile end function phobos_profiles.include(params) api_util.api_call(function() profile_util.include(params) end) end function phobos_profiles.exclude(params) api_util.api_call(function() profile_util.exclude(params) end) end function phobos_profiles.include_copy(params) api_util.api_call(function() profile_util.include_copy(params) end) end function phobos_profiles.exclude_copy(params) api_util.api_call(function() profile_util.exclude_copy(params) end) end function phobos_profiles.include_delete(params) api_util.api_call(function() profile_util.include_delete(params) end) end function phobos_profiles.exclude_delete(params) api_util.api_call(function() profile_util.exclude_delete(params) end) end function phobos_profiles.get_current_root_dir() return phobos_profiles.internal.current_root_dir end function phobos_profiles.get_all_optimizations() return profile_util.get_all_optimizations() end function phobos_profiles.parse_extra_args(extra_args, config) ---@diagnostic disable-next-line:redefined-local return phobos_profiles.custom_parse_extra_args(extra_args, function(extra_args) local args, err_or_index = arg_parser.parse(extra_args, config) if not args or args.help then if args then -- set it to nil if it was an index, making it an error message or nil -- which is what custom_parse_extra_args expects err_or_index = nil end local help_config = phobos_profiles.internal.main_help_config local usage = help_config.usage help_config.usage = nil local help = arg_parser.get_help_string(config, help_config) help_config.usage = usage return nil, err_or_index, help end return args end) end function phobos_profiles.custom_parse_extra_args(extra_args, custom_parse_function) local args, err, help = custom_parse_function(extra_args) if args == nil then if err then print("Invalid extra args: "..err.."\n") end print(arg_parser.get_help_string( phobos_profiles.internal.main_args_config, phobos_profiles.internal.main_help_config )) if help then print("\nExtra args for profiles file '"..phobos_profiles.internal.current_profile_file.."':\n"..help) end if err then util.abort() else os.exit(true) end end return args end return phobos_profiles
local enums = require("consts.celeste_enums") local bonfire = {} bonfire.name = "bonfire" bonfire.depth = -5 bonfire.justification = {0.5, 1.0} bonfire.fieldInformation = { mode = { options = enums.bonfire_modes, editable = false } } bonfire.placements = { name = "bonfire", data = { mode = "Lit" } } function bonfire.texture(room, entity) local mode = string.lower(entity.mode or "lit") if mode == "lit" then return "objects/campfire/fire08" elseif mode == "smoking" then return "objects/campfire/smoking04" else return "objects/campfire/fire00" end end return bonfire
dcPin = 1 currentStatus = "off" -- set pin to output and set it to low to start with for safety gpio.mode(dcPin, gpio.OUTPUT) gpio.write(dcPin, gpio.LOW) wifi.setmode(wifi.STATION) wifi.sta.config("hive13int", "hive13int") print(wifi.sta.getip()) srv = net.createServer(net.TCP) srv:listen(80, function(conn) conn:on("receive",function(client, payload) local buf = "" local _, _, method, path, vars = string.find(payload, "([A-Z]+) (.+)?(.+) HTTP") if (method == nil) then _, _, method, path = string.find(payload, "([A-Z]+) (.+) HTTP") end local _GET = {} if (vars ~= nil) then for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do _GET[k] = v end print(_GET.turn) end if(_GET.turn == "on") then currentStatus = "on" gpio.write(dcPin, gpio.HIGH) print("turning on") elseif(_GET.turn == "off") then currentStatus = "off" gpio.write(dcPin, gpio.LOW); print("turning off") end buf = buf.."<h1>Dust Collector Control</h1><br />" buf = buf.."<h3>The dust collector is currently "..currentStatus.."</h3>" buf = buf.."<a href='?turn=on'>Turn on</a><br />" buf = buf.."<a href='?turn=off'>Turn off</a><br />" client:send(buf) client:close() collectgarbage() end) end)
grondorn_muse_missions = { { missionType = "escort", primarySpawns = { { npcTemplate = "bandmember_quest_grondorn", npcName = "Vincol Dunker" } }, secondarySpawns = { }, itemSpawns = { }, rewards = { { rewardType = "credits", amount = 150 } } }, { missionType = "deliver", primarySpawns = { { npcTemplate = "bandleader_quest_grondorn", npcName = "Pytor Tuko" } }, secondarySpawns = { }, itemSpawns = { { itemTemplate = "object/tangible/mission/quest_item/grondorn_muse_q2_needed.iff", itemName = "" } }, rewards = { { rewardType = "credits", amount = 250 } } } } npcMapGrondornMuse = { { spawnData = { npcTemplate = "grondorn_muse", x = 6838.2, z = 315.0, y = -5767.7, direction = -99, cellID = 0, position = STAND }, npcNumber = 1, stfFile = "@static_npc/corellia/grondorn_muse", missions = grondorn_muse_missions }, } GrondornMuse = ThemeParkLogic:new { npcMap = npcMapGrondornMuse, className = "GrondornMuse", screenPlayState = "grondorn_muse_task", planetName = "corellia", distance = 800, } registerScreenPlay("GrondornMuse", true) grondorn_muse_mission_giver_conv_handler = mission_giver_conv_handler:new { themePark = GrondornMuse } grondorn_muse_mission_target_conv_handler = mission_target_conv_handler:new { themePark = GrondornMuse }
fanned_rawl = Creature:new { objectName = "@mob/creature_names:fanned_rawl", socialGroup = "rawl", faction = "", level = 10, chanceHit = 0.28, damageMin = 90, damageMax = 110, baseXp = 356, baseHAM = 810, baseHAMmax = 990, armor = 0, resists = {0,0,0,0,0,0,0,-1,-1}, meatType = "meat_reptilian", meatAmount = 25, hideType = "hide_scaley", hideAmount = 15, boneType = "bone_mammal", boneAmount = 7, milk = 0, tamingChance = 0.25, ferocity = 3, pvpBitmask = ATTACKABLE, creatureBitmask = PACK, optionsBitmask = AIENABLED, diet = CARNIVORE, templates = {"object/mobile/fanned_rawl_hue.iff"}, controlDeviceTemplate = "object/intangible/pet/fanned_rawl_hue.iff", hues = { 0, 1, 2, 3, 4, 5, 6, 7 }, lootGroups = {}, weapons = {}, conversationTemplate = "", attacks = { {"posturedownattack",""}, {"mildpoison",""} } } CreatureTemplates:addCreatureTemplate(fanned_rawl, "fanned_rawl")
-- notify highlights local lush = require "lush" local base = require "nano.base" local M = {} M = lush(function() return { NotifyERRORBorder { base.CriticalI }, NotifyWARNBorder { base.Popout }, NotifyINFOBorder { base.Salient }, NotifyDEBUGBorder { base.Faded }, NotifyTRACEBorder { base.Faded }, NotifyERRORIcon { base.CriticalI }, NotifyWARNIcon { base.Popout }, NotifyINFOIcon { base.Salient }, NotifyDEBUGIcon { base.Faded }, NotifyTRACEIcon { base.Faded }, NotifyERRORTitle { base.CriticalI }, NotifyWARNTitle { base.Popout }, NotifyINFOTitle { base.Salient }, NotifyDEBUGTitle { base.Faded }, NotifyTRACETitle { base.Faded }, NotifyERRORBody { base.Normal }, NotifyWARNBody { base.Normal }, NotifyINFOBody { base.Normal }, NotifyDEBUGBody { base.Normal }, NotifyTRACEBody { base.Normal }, } end) return M
-- mapget, map downloader implemented in Lua -- Copyright (C) 2015 Pavel Dolgov -- See the LICENSE file for terms of use. describe("mapget", function() it("requires main module", function() local mapget = assert(require 'mapget') end) it("downloads tile", function() local mapget = assert(require 'mapget') local options = { map_type = 'map', v = '4.40.1', x = '55', y = '79', z = '7', scale = '1', lang = 'ru_RU', } local data = assert(mapget.getTile(options)) end) it("downloads tile correctly", function() local mapget = assert(require 'mapget') local magick = assert(require 'magick') local options = { map_type = 'map', v = '4.40.1', x = '55', y = '79', z = '7', scale = '1', lang = 'ru_RU', } local data = assert(mapget.getTile(options)) local output = io.open("data", "w") output:write(data) output:close() local img = assert(magick.load_image("data")) for x = 0, img:get_width() do for y = 0, img:get_height() do local r, g, b, a = img:get_pixel(x, y) -- ocean: must be blue assert( (r >= 0.65 and r <= 0.67) and (g >= 0.81 and g <= 0.83) and (b >= 0.90 and b <= 0.91) ) end end img:destroy() end) end)
local Quadrangle = require "quadrangle" local class = require "class" local Rectangle = class.extends(Quadrangle,"Rectangle") function Rectangle.new(x,y,width,height) return Rectangle.newObject(x,y,width,height,0,math.pi/2)--Rectangle:superClass().new(x,y,width,height) end function Rectangle:print() print(self:name() .. "{") print("\tx = " .. self.x) print("\ty = " .. self.y) print("\twidth = " .. self.width) print("\theight = " .. self.height .."\n}") end return Rectangle
local socket = require("socket") local party = { users = 1, max = 1, lastAlive = os.time(), lastReceive = 0, lastMouse = 0, lastBlocksUpdate = 0, mousePositions = {}, lastMousePositions = {}, name = "borsuczyna" } party.joinParty = function(host, port) party.server, err = socket.connect(host, port) party.server:setoption('keepalive', true) party.server:send("setName," .. party.name) party.server:settimeout(0) end party.sendAllBlocks = function() if not party.server then return end party.server:send("takeMyBlocks,"..serpent.dump(blocks.blocks)) end party.messageReceived = function(message) if message[1] == "Kick" then print("Kicked from party, reason: " .. message[2]) party.server = nil elseif message[1] == "clients" then party.users = tostring(message[2] or 1) party.max = tostring(message[4] or 1) elseif message[1] == "mouse_position" then if tonumber(message[5]) then party.mousePositions[tonumber(message[5])] = {tonumber(message[2]), tonumber(message[3]), message[4]} end elseif message[1] == "send_me_blocks" then party.sendAllBlocks() end end party.render = function() for k,v in pairs(party.lastMousePositions) do local x, y = render.getScreenFromWorldPosition(v[1], v[2]) dxDrawImage(x, y, 25, 25, "data/themes/" .. themes.current .. "/cursor.png") local w = fonts.getWidth("regular", 16, party.mousePositions[k][3]) dxDrawRectangle(x + 30, y, w + 6, 23, {25, 25, 25, 155}) fonts.drawText("regular", 16, party.mousePositions[k][3], x + 33, y + 3, w + 10, 250) end end party.onBlocksCodeReceived = function(message) local header = "START_OF_THE_BLOCKS" local footer = "END_OF_THE_BLOCKS" local code = message:sub(message:find(header)+#header, #message) code = code:sub(1, code:find(footer)-1) if code:sub(1, 1) == "," then code = code:sub(2, #code) end blocks.blocks = loadstring(code)() end party.onBlockCodeReceived = function(message) local header = "START_OF_THE_BLOCKS" local footer = "END_OF_THE_BLOCKS" local code = message:sub(message:find(header)+#header, #message) code = code:sub(1, code:find(footer)-1) if code:sub(1, 1) == "," then code = code:sub(2, #code) end local id = tonumber(code:sub(1, code:find(",")-1)) code = code:sub(code:find(",")+1, #code) local x, y = (blocks.blocks[id] and blocks.blocks[id].x or false), (blocks.blocks[id] and blocks.blocks[id].y or false) blocks.blocks[id] = loadstring(code)() blocks.smoothPosition[id] = {x=blocks.blocks[id].x, y=blocks.blocks[id].y} if x and y then blocks.blocks[id].x = x blocks.blocks[id].y = y end end party.updateBlocks = function() if not party.server then return end party.server:send("takeMyBlocks,"..serpent.dump(blocks.blocks)) end party.updateBlock = function(id) if not party.server or not blocks.blocks[id] then return end if tickCount - party.lastBlocksUpdate > 50 then party.server:send("updateBlock,"..id..","..serpent.dump(blocks.blocks[id])) party.lastBlocksUpdate = tickCount end end party.update = function(dt) if not party.server then return end -- Keep alive if os.time() - party.lastAlive > 1 then --party.server:send("Alive!") party.lastAlive = os.time() end -- Send mouse position if tickCount - party.lastMouse > 50 then local cx, cy = love.mouse.getPosition() cx, cy = render.getWorldFromScreenPosition(cx, cy) party.server:send("sendall,mouse_position,"..math.floor(cx)..","..math.floor(cy)) party.lastMouse = tickCount end -- Receive message if tickCount - party.lastReceive > 50 then s, status, message = party.server:receive(50000) if message and message:len() > 0 then for k in message:gmatch('([^|]+)') do local msg = {} for e in k:gmatch('([^,]+)') do table.insert(msg, e) end if msg[1] == "blocks" then party.onBlocksCodeReceived(message) elseif msg[1] == "block" then party.onBlockCodeReceived(message) end party.messageReceived(msg) end end party.lastReceive = tickCount end for k,v in pairs(party.mousePositions) do if not party.lastMousePositions[k] then party.lastMousePositions[k] = {0, 0} end party.lastMousePositions[k][1] = party.lastMousePositions[k][1] + (party.mousePositions[k][1] - party.lastMousePositions[k][1])*(dt*10) party.lastMousePositions[k][2] = party.lastMousePositions[k][2] + (party.mousePositions[k][2] - party.lastMousePositions[k][2])*(dt*10) end end --party.joinParty("3.91.157.194", 9999) return party
--[=[ Doubly-linked lists of Lua values. Written by Cosmin Apreutesei. Public Domain. In this implementation items must be Lua tables for which fields `_prev` and `_next` are reserved for linking. list() -> list create a new list list:clear() clear the list list:insert_first(t) add an item at beginning of the list list:insert_last(t) add an item at the end of the list list:insert_after([anchor, ]t) add an item after another item (or at the end) list:insert_before([anchor, ]t) add an item before another item (or at the beginning) list:remove(t) -> t remove a specific item (and return it) list:removel_last() -> t remove and return the last item, if any list:remove_first() -> t remove and return the first item, if any list:next([current]) -> t next item after some item (or first item) list:prev([current]) -> t previous item after some item (or last item) list:items() -> iterator<item> iterate items list:reverse_items() -> iterator<item> iterate items in reverse list:copy() -> new_list copy the list ]=] if not ... then require'linkedlist_test'; return end local list = {} list.__index = list function list:new() return setmetatable({length = 0}, self) end setmetatable(list, {__call = list.new}) function list:clear() self.length = 0 self.first = nil self.last = nil end function list:insert_first(t) assert(t) if self.first then self.first._prev = t t._next = self.first self.first = t else self.first = t self.last = t end self.length = self.length + 1 end function list:insert_after(anchor, t) if not t then anchor, t = nil, anchor end if not anchor then anchor = self.last end assert(t) if anchor then assert(t ~= anchor) if anchor._next then anchor._next._prev = t t._next = anchor._next else self.last = t end t._prev = anchor anchor._next = t self.length = self.length + 1 else self:insert_first(t) end end function list:insert_last(t) self:insert_after(nil, t) end function list:insert_before(anchor, t) if not t then anchor, t = nil, anchor end if not anchor then anchor = self.first end anchor = anchor and anchor._prev assert(t) if anchor then self:insert_after(anchor, t) else self:insert_first(t) end end function list:remove(t) assert(t) if t._next then if t._prev then t._next._prev = t._prev t._prev._next = t._next else assert(t == self.first) t._next._prev = nil self.first = t._next end elseif t._prev then assert(t == self.last) t._prev._next = nil self.last = t._prev else assert(t == self.first and t == self.last) self.first = nil self.last = nil end t._next = nil t._prev = nil self.length = self.length - 1 return t end function list:remove_last() if not self.last then return end return self:remove(self.last) end function list:remove_first() if not self.first then return end return self:remove(self.first) end --iterating function list:next(last) if last then return last._next else return self.first end end function list:items() return self.next, self end function list:prev(last) if last then return last._prev else return self.last end end function list:reverse_items() return self.prev, self end --utils function list:copy() local list = self:new() for item in self:items() do list:push(item) end return list end return list
pair = "name = Anna" key, value = string.match(pair, "(%a+)%s*=%s*(%a+)") print(key, value)
minetest.register_alias("dye:light_red", "dye:pink") minetest.register_alias("dye:medium_orange", "dye:brown") minetest.register_alias("unifieddyes:black", "dye:black") minetest.register_alias("unifieddyes:dark_grey", "dye:dark_grey") minetest.register_alias("unifieddyes:grey", "dye:grey") minetest.register_alias("unifieddyes:light_grey", "dye:light_grey") minetest.register_alias("unifieddyes:white", "dye:white") minetest.register_alias("unifieddyes:grey_0", "dye:black") minetest.register_alias("unifieddyes:grey_4", "dye:dark_grey") minetest.register_alias("unifieddyes:grey_8", "dye:grey") minetest.register_alias("unifieddyes:grey_11", "dye:light_grey") minetest.register_alias("unifieddyes:grey_15", "dye:white") minetest.register_alias("unifieddyes:white_paint", "dye:white") minetest.register_alias("unifieddyes:titanium_dioxide", "dye:white") minetest.register_alias("unifieddyes:lightgrey_paint", "dye:light_grey") minetest.register_alias("unifieddyes:grey_paint", "dye:grey") minetest.register_alias("unifieddyes:darkgrey_paint", "dye:dark_grey") minetest.register_alias("unifieddyes:carbon_black", "dye:black") minetest.register_alias("unifieddyes:brown", "dye:brown")
local event = require("__flib__.event") local gui = require("__flib__.gui") local migration = require("__flib__.migration") local translation = require("__flib__.translation") local constants = require("scripts.constants") local global_data = require("scripts.global-data") local migrations = require("scripts.migrations") local on_tick = require("scripts.on-tick") local player_data = require("scripts.player-data") local qis_gui = require("scripts.gui.qis") local string = string -- ----------------------------------------------------------------------------- -- COMMANDS commands.add_command("QuickItemSearch", {"qis-message.command-help"}, function(e) local player = game.get_player(e.player_index) if e.parameter == "refresh-player-data" then local player_table = global.players[e.player_index] if player_table.gui then qis_gui.destroy(player, player_table) end player_data.refresh(player, player_table) else player.print{"qis-message.invalid-parameter"} end end ) -- ----------------------------------------------------------------------------- -- EVENT HANDLERS -- on_tick handler is kept in scripts.on-tick -- BOOTSTRAP event.on_init(function() gui.init() translation.init() global_data.init() for i in pairs(game.players) do player_data.init(i) end gui.build_lookup_tables() end) event.on_load(function() on_tick.update() gui.build_lookup_tables() end) event.on_configuration_changed(function(e) if migration.on_config_changed(e, migrations) then -- flib module migrations gui.check_filter_validity() translation.init() -- deregister on_tick on_tick.update() -- update translation data global_data.build_prototypes() -- refresh all player information for i, player in pairs(game.players) do local player_table = global.players[i] if player_table.gui then qis_gui.destroy(player, player_table) end player_data.refresh(player, player_table) end end end) -- GUI gui.register_handlers() event.register(constants.nav_arrow_events, function(e) local player_table = global.players[e.player_index] local gui_data = player_table.gui if gui_data then if gui_data.state == "select_result" then qis_gui.move_result(player_table, constants.results_nav_offsets[string.gsub(e.input_name, "qis%-nav%-", "")]) elseif gui_data.state == "select_request_type" then qis_gui.move_request_type(player_table) end end end) event.register(constants.nav_confirm_events, function(e) local player_table = global.players[e.player_index] local gui_data = player_table.gui if gui_data then if gui_data.state == "select_result" then qis_gui.confirm_result(e.player_index, gui_data, e.input_name) elseif gui_data.state == "select_request_type" then qis_gui.confirm_request_type(e.player_index, player_table) end end end) event.register("qis-search", function(e) local player = game.get_player(e.player_index) local player_table = global.players[e.player_index] if not player.opened then qis_gui.toggle(player, player_table) end end) event.on_lua_shortcut(function(e) if e.prototype_name == "qis-search" then local player = game.get_player(e.player_index) local player_table = global.players[e.player_index] qis_gui.toggle(player, player_table) end end) -- PLAYER event.on_player_created(function(e) player_data.init(e.player_index) end) event.on_player_joined_game(function(e) local player_table = global.players[e.player_index] if player_table.flags.translate_on_join then player_table.flags.translate_on_join = false player_data.start_translations(e.player_index) end end) event.on_player_left_game(function(e) if translation.is_translating(e.player_index) then translation.cancel(e.player_index) global.players[e.player_index].flags.translate_on_join = true end end) event.register( { defines.events.on_player_ammo_inventory_changed, defines.events.on_player_armor_inventory_changed, defines.events.on_player_gun_inventory_changed, defines.events.on_player_main_inventory_changed }, function(e) local player = game.get_player(e.player_index) local player_table = global.players[e.player_index] if player.controller_type == defines.controllers.character and player_table.flags.has_temporary_requests then player_data.check_temporary_requests(player, player_table) end end ) event.on_player_removed(function(e) global.players[e.player_index] = nil end) event.register("qis-quick-trash-all", function(e) local player = game.get_player(e.player_index) local player_table = global.players[e.player_index] player_data.quick_trash_all(player, player_table) end) -- SETTINGS event.on_runtime_mod_setting_changed(function(e) if string.sub(e.setting, 1, 4) == "qis-" then player_data.update_settings(game.get_player(e.player_index), global.players[e.player_index]) end end) -- TRANSLATIONS event.on_string_translated(function(e) local names, finished = translation.process_result(e) if names then local player_table = global.players[e.player_index] local translations = player_table.translations local internal_names = names.items for i=1,#internal_names do local internal_name = internal_names[i] translations[internal_name] = e.translated and e.result or internal_name end end if finished then local player = game.get_player(e.player_index) local player_table = global.players[e.player_index] -- show message if needed if player_table.flags.show_message_after_translation then player.print{'qis-message.can-open-gui'} end -- update flags player_table.flags.can_open_gui = true player_table.flags.translate_on_join = false player_table.flags.show_message_after_translation = false -- enable shortcut player.set_shortcut_available("qis-search", true) end end)
return { id = "ingotAdurite", name = "Adurite Ingot", desc = "Warm to the touch; Emanates raw power. Makes great melee equipment.", tier = 7, spriteSheet = "materials", spriteCoords = Vector2.new(8,2), recipe = { oreAdurite = 15, }, craftQuantity = 5, tags = { "material", } }
--- === BonjourLauncher.recipes === --- --- Sample recipes for various service types that you can use with the BonjourLauncher spoon. --- --- This submodule includes sample templates for a variety of advertised services which may be of interest when used with the BonjourLauncher spoon. Each template can be displayed in the Hammerspoon console for reference by typing `help.spoon.BonjourLauncher.recipes.*name*` into the console input field, or added as is to the active templates of the BonjourLauncher by doing the following either in the Hammerspoon console or in your configuration `init.ua` file: --- --- hs.loadSpoon("BonjourLauncher") --- spoon.BonjourLauncher:addRecipes(*name*) --- --- where *name* is one of the variables described within this submodule. local image = require("hs.image") local canvas = require("hs.canvas") local urlevent = require("hs.urlevent") local module = {} --- BonjourLauncher.recipes.SSH --- Variable --- Display computers and servers advertising Secure Shell services advertised with the `_ssh._tcp.` service type. This is advertised by MacOS machines with Remote Login enabled in the Sharing panel of System Preferences. --- --- SSH connections are initiated by the URL `ssh://%hostname%:%port%`, which usually opens up a Terminal window with the SSH session, and assumes that the username matches your username on your Mac. At present there is no way to prompt for a different username at the time of connection -- you will need to modify your `~/.ssh/config` file if a different username is required for a specific host. See `man ssh_config` in a terminal window. --- --- The template can be added to your BonjourLauncer with `spoon.BonjourLauncher:addRecipes("SSH")` after the spoon has loaded, and is defined as follows: --- --- { --- image = hs.image.imageFromAppBundle("com.apple.Terminal"), --- label = "SSH", --- type = "_ssh._tcp.", --- text = "%name%", --- subText = "%hostname%:%port% (%address4%/%address6%)", --- url = "ssh://%hostname%:%port%", --- } --- --- Notes: --- * On Linux servers, you can advertise this by installing Avahi and saving the following in `/etc/avahi/services/ssh.service`: --- --- ~~~ --- <?xml version="1.0" standalone='no'?> --- <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> --- <service-group> --- <name replace-wildcards="yes">%h</name> --- <service> --- <type>_ssh._tcp</type> --- <port>22</port> --- </service> --- </service-group> --- ~~~ --- module.SSH = { image = image.imageFromAppBundle("com.apple.Terminal"), label = "SSH", type = "_ssh._tcp.", text = "%name%", subText = "%hostname%:%port% (%address4%/%address6%)", url = "ssh://%hostname%:%port%", } --- BonjourLauncher.recipes.SMB --- Variable --- Display computers and servers advertising Windows or Samba file server services advertised with the `_smb._tcp.` service type. Most Apple Macintosh computers and Laptops will also advertise file sharing with this service type. --- --- SMB connections are initiated by the URL `smb://%hostname%:%port%`, which usually opens up a dialog in the Finder which may prompt you for login credentials. --- --- The template can be added to your BonjourLauncer with `spoon.BonjourLauncher:addRecipes("SMB")` after the spoon has loaded, and is defined as follows: --- --- { --- image = hs.image.imageFromName("NSNetwork"), --- label = "SMB", --- type = "_smb._tcp.", --- text = "%name%", --- subText = "smb://%hostname%:%port%", --- url = "smb://%hostname%:%port%", --- } --- --- Notes: --- * On Linux servers, Samba advertises this by default if Avahi is installed. module.SMB = { image = image.imageFromName("NSNetwork"), label = "SMB", type = "_smb._tcp.", text = "%name%", subText = "smb://%hostname%:%port%", url = "smb://%hostname%:%port%", } --- BonjourLauncher.recipes.AFP --- Variable --- Display computers and servers advertising AppleShare file server services advertised with the `_afpovertcp._tcp.` service type. This was the default with earlier versions of MacOS and is still used by Apple AirPort and Time Machine file servers. --- --- AppleShare connections are initiated by the URL `afp://%hostname%:%port%`, which usually opens up a dialog in the Finder which may prompt you for login credentials. --- --- The template can be added to your BonjourLauncer with `spoon.BonjourLauncher:addRecipes("AFP")` after the spoon has loaded, and is defined as follows: --- --- { --- image = hs.canvas.new{ h = 128, w = 128 }:appendElements( --- { type="image", image = hs.image.imageFromName("NSNetwork"), imageAlpha = 0.5 }, --- { type="image", image = hs.image.imageFromName("NSTouchBarColorPickerFont") } --- ):imageFromCanvas(), --- label = "AFP", --- type = "_afpovertcp._tcp.", --- text = "%name%", --- subText = "afp://%hostname%:%port%", --- url = "afp://%hostname%:%port%", --- } --- module.AFP = { image = canvas.new{ h = 128, w = 128 }:appendElements( { type="image", image = image.imageFromName("NSNetwork"), imageAlpha = 0.5 }, { type="image", image = image.imageFromName("NSTouchBarColorPickerFont") } ):imageFromCanvas(), label = "AFP", type = "_afpovertcp._tcp.", text = "%name%", subText = "afp://%hostname%:%port%", url = "afp://%hostname%:%port%", } --- BonjourLauncher.recipes.VNC --- Variable --- Display computers and servers advertising screen sharing or VNC services advertised with the `_rfb._tcp.` service type. This is advertised by MacOS machines with Screen Sharing enabled in the Sharing panel of System Preferences. --- --- Screen Sharing connections are initiated by the URL `vnc://%hostname%:%port%`, which usually opens up Screen Sharing which will prompt you for login credentials. --- --- The template can be added to your BonjourLauncer with `spoon.BonjourLauncher:addRecipes("VNC")` after the spoon has loaded, and is defined as follows: --- --- { --- image = hs.image.imageFromAppBundle("com.apple.ScreenSharing"), --- label = "VNC", --- type = "_rfb._tcp.", --- text = "%name%", --- subText = "vnc://%hostname%:%port%", --- url = "vnc://%hostname%:%port%", --- } --- --- Notes: --- * The built in MacOS Screen Sharing application works with MacOS Screen Sharing clients as well as more traditional VNC implementations that do not implement encryption. This does *not* include the RealVNC implementation that is commonly included with Raspberry Pi's Raspbian installations. --- --- * See also [BonjourLauncher.recipes.VNC_RealVNC_Alternate](#VNC_RealVNC_Alternate) for an example that can use an alternate launcher for RealVNC clients. Note that you sould use only one of these recipes, as they share the same label. --- --- * On Linux servers, some X Windows installations provide built in VNC support while others require you to configure your own with third party software (e.g. RealVNC or TigerVNC to name just a couple). Determining how to set this up is beyond the scope of these instructions, but if you find that whatever solution you have available does *not* provide ZeroConf or Bonjour advertisements, you can do so yourself by installing Avahi and saving the following in `/etc/avahi/services/vnc.service` (change 5900 to match the port number your windowing environment uses for VNC, commonly a number between 5900 and 5910 inclusive, but theoretically any available port on the machine): --- --- ~~~ --- <?xml version="1.0" standalone='no'?> --- <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> --- <service-group> --- <name replace-wildcards="yes">%h</name> --- <service> --- <type>_rfb._tcp</type> --- <port>5900</port> --- </service> --- </service-group> --- ~~~ --- module.VNC = { image = image.imageFromAppBundle("com.apple.ScreenSharing"), label = "VNC", type = "_rfb._tcp.", text = "%name%", subText = "vnc://%hostname%:%port%", url = "vnc://%hostname%:%port%", } --- BonjourLauncher.recipes.VNC_RealVNC_Alternate --- Variable --- Display computers and servers advertising screen sharing or VNC services advertised with the `_rfb._tcp.` service type. This is advertised by MacOS machines with Screen Sharing enabled in the Sharing panel of System Preferences. --- --- This version of a template for `_rfb._tcp.` differs from [BonjourLauncher.recipes.VNC](#VNC) in that it uses a function which examines the text records for the service to determine which launcher to use for the chosen server: because RealVNC uses an encryption scheme that is not recognized by the macOS Screen Sharing application, if a text record indicating that RealVNC is in use is detected, an alternate launcher is used. --- --- The template can be added to your BonjourLauncer with `spoon.BonjourLauncher:addRecipes("VNC_RealVNC_Alternate")` after the spoon has loaded, and is defined as follows: --- --- { --- image = hs.image.imageFromAppBundle("com.apple.ScreenSharing"), --- label = "VNC", --- type = "_rfb._tcp.", --- text = "%name%", --- subText = "vnc://%hostname%:%port%", --- url = "vnc://%hostname%:%port%", -- used in fn when RealVNC not set ; see below --- cmd = "open -a \"VNC Viewer\" --args %hostname%:%port%", -- used in fn when RealVNC set; see below --- fn = function(svc, choice) --- local tr = svc:txtRecord() --- if tr and tr.RealVNC then --- hs.execute(choice.cmd) --- else --- hs.urlevent.openURL(choice.url) --- end --- end, --- } --- --- Note that `fn` is defined, so it will be invoked in favor of `url` or `cmd` by the BonjourLauncer spoon when a VNC service is selected; however, the second argument to the function invoked will include all key-value pairs with string values from the template, so the function can utilizes the `url` and `cmd` keys based on its own logic to determine which applies. --- --- Notes: --- * This variant was developed to address the fact that the macOS Screen Sharing application does not recognize the encryption used by the RealVNC implemntataion found in the Raspbian distribution installed on most Raspberry Pi computers. By adding text record to the Avahi advertisement from the Raspberry Pi, we can determine whether or not to utilize the built in screen sharing app or launch the RealVNC client to view the specified service. --- --- * See also [BonjourLauncher.recipes.VNC](#VNC) for a simpler implementation if you are only connecting to other Mac computers or if none of your servers require RealVNC's specific viewer application. --- --- * To create the advertisement on the Raspbian installation which includes the text record entry we need to make this template work, install Avahi on your Raspbian machine and save the following as `/etc/avahi/services/vnc.service`: --- --- ~~~ --- <?xml version="1.0" standalone='no'?> --- <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> --- <service-group> --- <name replace-wildcards="yes">%h</name> --- <service> --- <type>_rfb._tcp</type> --- <port>5900</port> --- <txt-record>RealVNC=True</txt-record> --- </service> --- </service-group> --- ~~~ --- module.VNC_RealVNC_Alternate = { image = image.imageFromAppBundle("com.apple.ScreenSharing"), label = "VNC", type = "_rfb._tcp.", text = "%name%", subText = "vnc://%hostname%:%port%", url = "vnc://%hostname%:%port%", -- used in fn when RealVNC not set ; see below cmd = "open -a \"VNC Viewer\" --args %hostname%:%port%", -- used in fn when RealVNC set; see below fn = function(svc, choice) local tr = svc:txtRecord() if tr and tr.RealVNC then hs.execute(choice.cmd) else urlevent.openURL(choice.url) end end, } return module
function startRappel(x, y, z, gz) local r = getPedRotation(source) local seat = getPedOccupiedVehicleSeat(source) if (seat==0 or seat==2) then -- left hand side r = r + 90 else r = r - 90 end setPedRotation(source, r) local slot = getPedWeaponSlot(source) local invisible = createObject (1337, x, y, z, 0, 0, r) setElementAlpha(invisible, 0) setElementData(source, "realinvehicle", 0, false) removePedFromVehicle(source) attachElements(source, invisible) moveObject(invisible, 2000, x, y, gz, 0, 0, 0) exports.pool:allocateElement(invisible) setTimer(stopRappel, 2000, 1, invisible, source, slot) exports.global:applyAnimation(source, "PARACHUTE", "PARA_float", true, 1.0, false, false) for key, value in ipairs(exports.global:getNearbyElements(invisible, "player", 100)) do triggerClientEvent(value, "createRope", value, x, y, z, gz) end end addEvent("startRappel", true) addEventHandler("startRappel", getRootElement(), startRappel) function stopRappel(object, player, slot) detachElements(player, object) exports.global:removeAnimation(player) setPedWeaponSlot(player, slot) destroyElement(object) end
local f f = function(...) return #{ ... } end local dont_bubble dont_bubble = function() local _accum_0 = { } local _len_0 = 1 for x in (function(...) return print(...) end)("hello") do _accum_0[_len_0] = x _len_0 = _len_0 + 1 end return _accum_0 end local k do local _accum_0 = { } local _len_0 = 1 for x in (function(...) return print(...) end)("hello") do _accum_0[_len_0] = x _len_0 = _len_0 + 1 end k = _accum_0 end local j do local _accum_0 = { } local _len_0 = 1 for i = 1, 10 do _accum_0[_len_0] = function(...) return print(...) end _len_0 = _len_0 + 1 end j = _accum_0 end local m m = function(...) local _accum_0 = { } local _len_0 = 1 local _list_0 = { ... } for _index_0 = 1, #_list_0 do local x = _list_0[_index_0] if f(...) > 4 then _accum_0[_len_0] = x _len_0 = _len_0 + 1 end end return _accum_0 end local _ _ = function(...) local x do local _accum_0 = { } local _len_0 = 1 local _list_0 = { ... } for _index_0 = 1, #_list_0 do local i = _list_0[_index_0] _accum_0[_len_0] = i _len_0 = _len_0 + 1 end x = _accum_0 end local y do local _accum_0 = { } local _len_0 = 1 local _list_0 = { ... } for _index_0 = 1, #_list_0 do local x = _list_0[_index_0] _accum_0[_len_0] = x _len_0 = _len_0 + 1 end y = _accum_0 end local z do local _accum_0 = { } local _len_0 = 1 for x in hallo do if f(...) > 4 then _accum_0[_len_0] = x _len_0 = _len_0 + 1 end end z = _accum_0 end local a do local _accum_0 = { } local _len_0 = 1 for i = 1, 10 do _accum_0[_len_0] = ... _len_0 = _len_0 + 1 end a = _accum_0 end local b do local _accum_0 = { } local _len_0 = 1 for i = 1, 10 do _accum_0[_len_0] = function(...) return print(...) end _len_0 = _len_0 + 1 end b = _accum_0 end end