content
stringlengths 5
1.05M
|
|---|
local typedefs = require "kong.db.schema.typedefs"
local Schema = require "kong.db.schema"
local url = require "socket.url"
local nonzero_timeout = Schema.define {
type = "integer",
between = { 1, math.pow(2, 31) - 2 },
}
return {
name = "services",
primary_key = { "id" },
endpoint_key = "name",
fields = {
{ id = typedefs.uuid, },
{ created_at = typedefs.auto_timestamp_s },
{ updated_at = typedefs.auto_timestamp_s },
{ name = typedefs.name },
{ retries = { type = "integer", default = 5, between = { 0, 32767 } }, },
-- { tags = { type = "array", array = { type = "string" } }, },
{ protocol = typedefs.protocol { required = true, default = "http" } },
{ host = typedefs.host { required = true } },
{ port = typedefs.port { required = true, default = 80 }, },
{ path = typedefs.path },
{ connect_timeout = nonzero_timeout { default = 60000 }, },
{ write_timeout = nonzero_timeout { default = 60000 }, },
{ read_timeout = nonzero_timeout { default = 60000 }, },
{ tags = typedefs.tags },
-- { load_balancer = { type = "foreign", reference = "load_balancers" } },
},
entity_checks = {
{ conditional = { if_field = "protocol",
if_match = { one_of = { "tcp", "tls" }},
then_field = "path",
then_match = { eq = ngx.null }}},
},
shorthands = {
{ url = function(sugar_url)
local parsed_url = url.parse(tostring(sugar_url))
if not parsed_url then
return
end
return {
protocol = parsed_url.scheme,
host = parsed_url.host,
port = tonumber(parsed_url.port) or
parsed_url.port or
(parsed_url.scheme == "http" and 80) or
(parsed_url.scheme == "https" and 443) or
nil,
path = parsed_url.path,
}
end },
}
}
|
return {
["Date"] = 1006498997,
["Fatal"] = "Unknown variable \"bar\"",
["Stack"] = {
[1] = {
["code"] = "x = MoreObject(\"345\\n\")",
["file"] = "TopClass.py",
["line"] = 23
},
[2] = {
["code"] = "foo = bar",
["file"] = "MoreClass.py",
["line"] = 58
}
},
["User"] = "ed"
}
|
local Template = require "oil.dtests.Template"
local template = Template{"Client"} -- master process name
Server = [=====================================================================[
orb = oil.dtests.init{
port = 2809,
tcpoptions = {timeout=.1}
}
if oil.dtests.flavor.cooperative then
socket = require "cothread.socket"
else
socket = require "socket.core"
end
obj = {}
function obj:open(port)
local p = socket.tcp()
p:bind("*", port)
p:listen()
end
if oil.dtests.flavor.corba then
obj.__type = orb:loadidl"interface Ports { void open(in short port); };"
end
orb:newservant(obj, "object")
orb:run()
--[Server]=====================================================================]
Client = [=====================================================================[
checks = oil.dtests.checks
orb = oil.dtests.init{ options = { tcp = {timeout=1} } }
obj = oil.dtests.resolve("Server", 2809, "object")
host = oil.dtests.hosts.Server
obj:open(2808)
if oil.dtests.flavor.corba then
local idl = require "oil.corba.idl"
ref, type = "corbaloc::"..host..":2808/FakeObject", "Ports"
else
ref, type = "return 'FakeObject', '"..host.."', 2808\0"
end
obj = orb:newproxy(ref, nil, type)
ok, ex = pcall(obj.open, obj, 80)
assert(ok == false)
assert(ex.error == "timeout")
orb:shutdown()
--[Client]=====================================================================]
return template:newsuite()
|
local framework = Nexus:ClassManager("Framework")
local _draw = framework:Class("Draw")
local PANEL = {}
surface.CreateFont("Nexus.PingSystem.Players.Buddies.Title", {
font = "Lato",
size = 24,
weight = 500
})
surface.CreateFont("Nexus.PingSystem.Players.Buddies.Name", {
font = "Lato",
size = 28,
weight = 800
})
surface.CreateFont("Nexus.PingSystem.Players.Buddies.Desc", {
font = "Lato",
size = 22,
weight = 500
})
local muted = Material("ping_system/muted.png", "smooth")
local unmuted = Material("ping_system/unmuted.png", "smooth")
function PANEL:Init()
self:DockPadding(16, 16, 16, 16)
self.Scroll = self:Add("DScrollPanel")
self.Scroll:Dock(FILL)
self.Scroll:DockMargin(0, 0, 0, 0)
self.Title = self.Scroll:Add("DLabel")
self.Title:Dock(TOP)
self.Title:DockMargin(0, 0, 0, 16)
self.Title:SetText("You can command these people")
self.Title:SetFont("Nexus.PingSystem.Players.Buddies.Title")
self.Title:SetTextColor(color_white)
self.Title:SizeToContents()
self.Layout = self.Scroll:Add("DIconLayout")
self.Layout:Dock(FILL)
self.Layout:SetSpaceX(8)
self.Layout:SetSpaceY(8)
local players = {}
for i, v in pairs(player.GetAll()) do
if (v == LocalPlayer()) then continue end
if (!PIS.Gamemode:GetCommandCondition()(LocalPlayer(), v)) then continue end
table.insert(players, v)
end
for i, v in pairs(players) do
local panel = self.Layout:Add("DButton")
panel:SetText("")
panel:SetTall(64)
panel.Paint = function(pnl, w, h)
local border = pnl:IsHovered() and 2 or 1
local outer = {
{ x = 0, y = 0 },
{ x = w, y = 0 },
{ x = w, y = h * 0.7 },
{ x = w - 16, y = h },
{ x = 0, y = h }
}
local inner = {
{ x = border, y = border },
{ x = w - border, y = border },
{ x = w - border, y = h * 0.7 - border },
{ x = w - border - 16, y = h - border },
{ x = border, y = h - border }
}
draw.NoTexture()
surface.SetDrawColor(Color(0, 0, 0, 100))
surface.DrawPoly(inner)
_draw:Call("MaskExclude", function()
surface.SetDrawColor(color_white)
surface.DrawPoly(inner)
end, function()
surface.SetDrawColor(pnl:IsHovered() and PIS.Config.HighlightColor or Color(83, 83, 83))
surface.DrawPoly(outer)
end)
local x = 8 + pnl.Avatar:GetWide() + 8
draw.SimpleText(v:Nick(), "Nexus.PingSystem.Players.Buddies.Name", x, h / 2 + 3, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM)
draw.SimpleText(PIS.Gamemode:GetSubtitleDisplay()(v), "Nexus.PingSystem.Players.Buddies.Desc", x, h / 2, Color(224, 224, 222), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
end
panel.OnCursorEntered = function(pnl)
surface.PlaySound("ping_system/hover.wav")
end
panel.Avatar = panel:Add("AvatarImage")
panel.Avatar:SetPlayer(v, 128)
panel.Avatar:Dock(LEFT)
panel.Avatar:DockMargin(8, 8, 8, 8)
panel.Avatar:SetWide(48)
end
end
function PANEL:PerformLayout(w, h)
for i, v in pairs(self.Layout:GetChildren()) do
v:SetWide(self.Layout:GetWide() / 2 - 4)
end
end
function PANEL:Paint(w, h)
if (#self.Layout:GetChildren() == 0) then
_draw:Call("ShadowText", "You can't command anyone :(", "Nexus.PingSystem.Players.Buddies.Name", w / 2, 72, Color(212, 212, 218), TEXT_ALIGN_CENTER)
end
end
vgui.Register("Nexus.PingSystem.Players.Commands", PANEL)
|
require("a")
b = 0
for j,val in ipairs(table_name) do
j += 2
j += 3
end
print("a)
|
--PRISON LIFE - KICK GUI--
local jakeskickgui = Instance.new("ScreenGui")
local main = Instance.new("Frame")
local title = Instance.new("TextLabel")
local kick = Instance.new("TextButton")
local kicktext = Instance.new("TextBox")
local title_2 = Instance.new("TextLabel")
local close = Instance.new("TextButton")
local openmain = Instance.new("Frame")
local open = Instance.new("TextButton")
--Properties:
jakeskickgui.Name = "jakeskickgui"
jakeskickgui.Parent = game.CoreGui
main.Name = "main"
main.Parent = jakeskickgui
main.BackgroundColor3 = Color3.new(0, 0, 0)
main.Position = UDim2.new(0.276372612, 0, 0.55282557, 0)
main.Size = UDim2.new(0, 234, 0, 146)
main.Active = true
main.Draggable = true
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local function RemoveSpaces(String)
return String:gsub("%s+", "") or String
end
local function FindPlayer(String)
String = RemoveSpaces(String)
for _, _Player in pairs(Players:GetPlayers()) do
if _Player.Name:lower():match('^'.. String:lower()) then
return _Player
end
end
return nil
end
title.Name = "title"
title.Parent = main
title.BackgroundColor3 = Color3.new(1, 1, 1)
title.Size = UDim2.new(0, 234, 0, 31)
title.Font = Enum.Font.GothamBold
title.Text = "Prison Life Kick Player"
title.TextColor3 = Color3.new(0, 0, 0)
title.TextSize = 14
kick.Name = "kick"
kick.Parent = main
kick.BackgroundColor3 = Color3.new(1, 1, 1)
kick.Position = UDim2.new(0.0726495758, 0, 0.534832001, 0)
kick.Size = UDim2.new(0, 200, 0, 33)
kick.Font = Enum.Font.GothamBlack
kick.Text = "KICK"
kick.TextColor3 = Color3.new(0, 0, 0)
kick.TextSize = 14
kick.MouseButton1Down:connect(function()
game:GetService("StarterGui"):SetCore("SendNotification", {
Title = "Player will be kicked!";
Text = "Please wait up to 30 secs!!";
})
local kick = FindPlayer(kicktext.Text)
for i,v in pairs(game.Players:GetChildren()) do
if v.Name == (kick.Name) then
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Start",
v
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
local tbl_main =
{
"Vote"
}
game:GetService("Workspace").Remote.votekick:InvokeServer(unpack(tbl_main))
game:GetService("StarterGui"):SetCore("SendNotification", {
Title = "If Player is not kicked";
Text = "Please try again in 1 min and 30 secs!!";
})
wait(13)
game:GetService("StarterGui"):SetCore("SendNotification", {
Title = "Player Should be kicked";
Text = "If not please wait and try again!!";
})
end
end
end)
kicktext.Name = "kicktext"
kicktext.Parent = main
kicktext.BackgroundColor3 = Color3.new(1, 1, 1)
kicktext.Position = UDim2.new(0.0726495758, 0, 0.254595488, 0)
kicktext.Size = UDim2.new(0, 200, 0, 30)
kicktext.Font = Enum.Font.Gotham
kicktext.Text = "PlayerName"
kicktext.TextColor3 = Color3.new(0, 0, 0)
kicktext.TextSize = 14
title_2.Name = "title"
title_2.Parent = main
title_2.BackgroundColor3 = Color3.new(1, 1, 1)
title_2.Position = UDim2.new(0, 0, 0.801369846, 0)
title_2.Size = UDim2.new(0, 234, 0, 29)
title_2.Font = Enum.Font.GothamBlack
title_2.Text = "Made By Jake11price"
title_2.TextColor3 = Color3.new(0, 0, 0)
title_2.TextSize = 14
close.Name = "close"
close.Parent = main
close.BackgroundColor3 = Color3.new(0, 0, 0)
close.Position = UDim2.new(0.85042733, 0, 0, 0)
close.Size = UDim2.new(0, 35, 0, 31)
close.Font = Enum.Font.GothamBold
close.Text = "X"
close.TextColor3 = Color3.new(1, 0, 0)
close.TextScaled = true
close.TextSize = 14
close.TextWrapped = true
close.MouseButton1Down:connect(function()
main.Visible = false
openmain.Visible = true
end)
openmain.Name = "openmain"
openmain.Parent = jakeskickgui
openmain.BackgroundColor3 = Color3.new(0, 0, 0)
openmain.Position = UDim2.new(0.00431832112, 0, 0.886977911, 0)
openmain.Size = UDim2.new(0, 100, 0, 27)
openmain.Visible = false
open.Name = "open"
open.Parent = openmain
open.BackgroundColor3 = Color3.new(0, 0, 0)
open.Size = UDim2.new(0, 100, 0, 27)
open.Font = Enum.Font.GothamBold
open.Text = "OPEN"
open.TextColor3 = Color3.new(1, 1, 1)
open.TextSize = 14
open.MouseButton1Down:connect(function()
openmain.Visible = false
main.Visible = true
end)
|
return {
version = "1.1",
luaversion = "5.1",
tiledversion = "0.16.0",
orientation = "orthogonal",
renderorder = "right-down",
width = 36,
height = 36,
tilewidth = 16,
tileheight = 16,
nextobjectid = 79,
properties = {},
tilesets = {
{
name = "tileset",
firstgid = 1,
filename = "../../tileset.tsx",
tilewidth = 16,
tileheight = 16,
spacing = 0,
margin = 0,
image = "../art/tileset.png",
imagewidth = 320,
imageheight = 320,
tileoffset = {
x = 0,
y = 0
},
properties = {},
terrains = {
{
name = "Wall",
tile = 0,
properties = {}
},
{
name = "Markings",
tile = 40,
properties = {}
},
{
name = "Plain Wall",
tile = 80,
properties = {}
}
},
tilecount = 400,
tiles = {
{
id = 0,
terrain = { -1, -1, -1, 0 }
},
{
id = 1,
terrain = { -1, -1, 0, -1 }
},
{
id = 2,
terrain = { -1, 0, 0, 0 }
},
{
id = 3,
terrain = { 0, -1, 0, 0 }
},
{
id = 4,
terrain = { -1, -1, 0, 0 }
},
{
id = 5,
terrain = { 0, -1, 0, -1 }
},
{
id = 7,
terrain = { 0, 0, 0, 0 }
},
{
id = 8,
terrain = { 0, 0, 0, 0 }
},
{
id = 20,
terrain = { -1, 0, -1, -1 }
},
{
id = 21,
terrain = { 0, -1, -1, -1 }
},
{
id = 22,
terrain = { 0, 0, -1, 0 }
},
{
id = 23,
terrain = { 0, 0, 0, -1 }
},
{
id = 24,
terrain = { -1, 0, -1, 0 }
},
{
id = 25,
terrain = { 0, 0, -1, -1 }
},
{
id = 27,
terrain = { 0, 0, 0, 0 }
},
{
id = 28,
terrain = { 0, 0, 0, 0 }
},
{
id = 40,
terrain = { 2, 2, 2, 1 }
},
{
id = 41,
terrain = { 2, 2, 1, 2 }
},
{
id = 42,
terrain = { 2, 2, 1, 1 }
},
{
id = 43,
terrain = { 1, 2, 1, 2 }
},
{
id = 44,
terrain = { 2, 1, 1, 1 }
},
{
id = 45,
terrain = { 1, 2, 1, 1 }
},
{
id = 60,
terrain = { 2, 1, 2, 2 }
},
{
id = 61,
terrain = { 1, 2, 2, 2 }
},
{
id = 62,
terrain = { 2, 1, 2, 1 }
},
{
id = 63,
terrain = { 1, 1, 2, 2 }
},
{
id = 64,
terrain = { 1, 1, 2, 1 }
},
{
id = 65,
terrain = { 1, 1, 1, 2 }
},
{
id = 80,
terrain = { 2, 2, 2, 2 }
},
{
id = 81,
terrain = { 1, 1, 1, 1 }
},
{
id = 100,
terrain = { 2, 2, 2, 2 }
},
{
id = 101,
terrain = { 2, 2, 2, 2 }
},
{
id = 120,
terrain = { 2, 2, 2, 2 }
},
{
id = 121,
terrain = { 2, 2, 2, 2 }
}
}
}
},
layers = {
{
type = "tilelayer",
name = "background",
x = 0,
y = 0,
width = 36,
height = 36,
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 121, 122, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 121, 102, 101, 122, 102, 122, 121, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 101, 121, 81, 81, 81, 121, 81, 81, 121, 101, 121, 81, 81, 81, 81, 122, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 122, 81, 81, 102, 102, 81, 121, 101, 81, 102, 101, 81, 81, 101, 122, 101, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 122, 122, 101, 102, 81, 81, 81, 102, 81, 121, 101, 102, 122, 81, 81, 121, 81, 81, 102, 81, 81, 81, 121, 102, 122, 81, 81, 81, 81, 81,
81, 81, 81, 81, 102, 102, 122, 122, 121, 121, 122, 122, 122, 121, 81, 81, 121, 122, 81, 81, 81, 121, 121, 81, 122, 81, 81, 81, 102, 121, 101, 81, 81, 81, 81, 81,
81, 81, 81, 81, 121, 81, 81, 102, 121, 102, 81, 81, 81, 121, 81, 81, 102, 122, 101, 102, 81, 102, 101, 101, 121, 81, 121, 101, 122, 102, 122, 81, 81, 81, 81, 48,
81, 81, 81, 81, 81, 81, 122, 101, 102, 81, 81, 81, 81, 81, 81, 81, 122, 81, 81, 102, 121, 122, 81, 81, 121, 101, 102, 121, 121, 101, 101, 102, 101, 81, 81, 68,
81, 81, 81, 81, 81, 81, 121, 101, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 122, 81, 81, 88,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 122, 121, 101, 122, 102, 81, 81, 81, 81, 81, 81, 81, 81, 81, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 102, 81, 122, 122, 122, 101, 101, 101, 81, 81, 102, 102, 81, 81, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 101, 81, 81, 121, 101, 102, 102, 121, 102, 122, 81, 81, 81, 81, 81, 81, 81, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 102, 81, 81, 81, 121, 101, 102, 81, 102, 122, 121, 102, 122, 121, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 101, 101, 102, 122, 121, 121, 102, 122, 121, 81, 81, 81, 81, 81, 122, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 121, 81, 122, 102, 101, 102, 102, 121, 122, 121, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 102, 102, 101, 121, 102, 122, 122, 101, 102, 101, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 122, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 101, 121, 41, 43, 43, 43, 42, 81, 81, 41, 43, 43, 43, 42, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 102, 81, 63, 82, 84, 82, 44, 122, 102, 63, 85, 82, 82, 44, 81, 81, 102, 81, 102, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 102, 81, 63, 82, 82, 85, 44, 102, 121, 63, 82, 82, 84, 44, 81, 81, 121, 121, 101, 81, 81, 81, 81, 81, 81, 81, 81, 81, 226, 227, 81, 81, 81,
81, 81, 102, 121, 81, 63, 83, 82, 82, 44, 102, 122, 63, 82, 83, 82, 44, 81, 81, 122, 101, 81, 81, 81, 81, 81, 81, 81, 81, 226, 226, 226, 226, 226, 226, 81,
81, 81, 102, 81, 81, 63, 82, 82, 82, 44, 81, 81, 63, 82, 82, 82, 44, 81, 81, 122, 81, 81, 81, 81, 81, 81, 81, 81, 81, 226, 227, 227, 227, 227, 226, 81,
81, 81, 122, 81, 81, 63, 82, 85, 82, 44, 81, 81, 63, 82, 82, 85, 44, 81, 81, 122, 81, 81, 81, 81, 226, 246, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
81, 81, 81, 81, 81, 61, 64, 64, 64, 62, 81, 81, 61, 64, 64, 64, 62, 81, 81, 81, 81, 81, 81, 81, 226, 246, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 226, 246, 226, 226, 226, 247, 226, 226, 226, 226, 226, 226,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 246, 247, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81
}
},
{
type = "tilelayer",
name = "decor",
x = 0,
y = 0,
width = 36,
height = 36,
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 50, 51, 0, 50, 51, 0, 50, 51, 0, 50, 51, 0, 50, 51, 0, 50, 51, 0, 50, 51, 0, 50, 51, 0, 50, 51, 0, 50, 51, 0, 0, 0, 0,
0, 0, 0, 70, 71, 0, 70, 71, 0, 70, 71, 0, 70, 71, 0, 70, 71, 0, 70, 71, 0, 70, 71, 0, 70, 71, 0, 70, 71, 0, 70, 71, 0, 0, 0, 0,
0, 0, 0, 90, 91, 0, 90, 91, 0, 90, 91, 0, 90, 91, 0, 90, 91, 0, 90, 91, 0, 90, 91, 0, 90, 91, 0, 90, 91, 0, 90, 91, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, 283, 283, 283, 283, 282, 283, 283, 283, 283, 283, 282, 283, 284, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 50, 51, 0, 0, 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, 50, 51, 0, 302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 70, 71, 0, 0, 0, 0, 0, 70, 71, 0, 0, 0, 0, 0, 70, 71, 0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 90, 91, 0, 0, 0, 0, 0, 90, 91, 0, 0, 0, 0, 0, 90, 91, 0, 302, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
},
{
type = "tilelayer",
name = "platforms",
x = 0,
y = 0,
width = 36,
height = 36,
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0,
0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0,
0, 0, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 47, 47, 47, 47, 47, 0, 0, 47, 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
},
{
type = "tilelayer",
name = "walls",
x = 0,
y = 0,
width = 36,
height = 36,
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
29, 29, 29, 9, 9, 8, 28, 28, 9, 28, 28, 9, 28, 8, 9, 8, 9, 9, 8, 28, 8, 28, 9, 28, 9, 8, 8, 8, 29, 8, 28, 28, 9, 8, 28, 9,
29, 29, 28, 28, 28, 9, 29, 8, 8, 8, 8, 28, 28, 29, 8, 28, 9, 29, 8, 8, 29, 8, 9, 28, 9, 9, 28, 28, 29, 8, 8, 9, 29, 8, 9, 8,
28, 24, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 23, 29,
9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 29,
8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 9,
9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 28,
9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 9,
8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 9,
28, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 8,
8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 26,
29, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
28, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
9, 4, 5, 5, 7, 0, 0, 0, 27, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
8, 24, 26, 26, 22, 0, 0, 0, 21, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 23, 8, 9, 24, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 23, 9,
9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 8, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 28,
29, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 28, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 28,
28, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 26, 26, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 9,
8, 6, 0, 0, 0, 1, 5, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 23,
29, 6, 0, 0, 0, 25, 8, 8, 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25,
9, 6, 0, 0, 0, 25, 29, 29, 8, 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3,
9, 6, 0, 0, 0, 21, 26, 26, 26, 26, 22, 0, 0, 0, 0, 1, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 23,
8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 9, 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25,
28, 6, 0, 0, 0, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 8, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 5, 5, 5, 5, 3,
9, 6, 0, 0, 0, 21, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 3, 9, 9, 28, 28, 29,
8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 3, 9, 9, 9, 8, 28, 8,
9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 28, 28, 8, 8, 8, 8, 29,
9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 28, 8, 8, 8, 8, 8, 8, 8,
29, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 25, 24, 26, 26, 26, 26, 26, 26, 23,
26, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 5, 5, 3, 6, 0, 0, 0, 0, 0, 0, 25,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 26, 26, 26, 22, 0, 0, 0, 0, 0, 0, 21,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5, 5, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 5, 5, 7, 0, 0,
8, 29, 8, 4, 2, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 8, 8, 4, 5, 5,
28, 29, 9, 8, 4, 5, 5, 5, 5, 5, 3, 4, 5, 5, 5, 5, 5, 3, 9, 28, 29, 28, 28, 28, 29, 28, 28, 8, 8, 9, 9, 28, 9, 9, 29, 9
}
},
{
type = "tilelayer",
name = "overlay",
x = 0,
y = 0,
width = 36,
height = 36,
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
encoding = "lua",
data = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 301, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 223, 244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 223, 264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}
},
{
type = "objectgroup",
name = "objects",
visible = true,
opacity = 1,
offsetx = 0,
offsety = 0,
properties = {},
objects = {
{
id = 2,
name = "initial_spawn",
type = "spawn",
shape = "rectangle",
x = 160,
y = 496,
width = 32,
height = 48,
rotation = 0,
visible = true,
properties = {}
},
{
id = 6,
name = "lower_level",
type = "exit",
shape = "rectangle",
x = -16,
y = 480,
width = 32,
height = 48,
rotation = 0,
visible = true,
properties = {
["target"] = "lower_chamber.lower_level"
}
},
{
id = 8,
name = "upper_level",
type = "exit",
shape = "rectangle",
x = 560,
y = 160,
width = 32,
height = 48,
rotation = 0,
visible = true,
properties = {
["target"] = "tomb.entry"
}
},
{
id = 23,
name = "",
type = "crate",
shape = "rectangle",
x = 16,
y = 480,
width = 16,
height = 16,
rotation = 0,
visible = true,
properties = {}
},
{
id = 24,
name = "",
type = "crate",
shape = "rectangle",
x = 16,
y = 496,
width = 16,
height = 16,
rotation = 0,
visible = true,
properties = {}
},
{
id = 25,
name = "",
type = "crate",
shape = "rectangle",
x = 16,
y = 512,
width = 16,
height = 16,
rotation = 0,
visible = true,
properties = {}
},
{
id = 34,
name = "",
type = "scarab",
shape = "polyline",
x = 128,
y = 240,
width = 0,
height = 0,
rotation = 0,
visible = true,
polyline = {
{ x = 0, y = 0 },
{ x = 176, y = 0 },
{ x = 176, y = 48 },
{ x = 240, y = 48 },
{ x = 240, y = 0 },
{ x = 400, y = 0 }
},
properties = {
["hitpoints"] = 3
}
},
{
id = 38,
name = "",
type = "scarab",
shape = "polyline",
x = 240,
y = 336,
width = 0,
height = 0,
rotation = 0,
visible = true,
polyline = {
{ x = 0, y = 0 },
{ x = 32, y = 0 },
{ x = 64, y = 32 },
{ x = 64, y = 64 },
{ x = -160, y = 64 },
{ x = -160, y = 32 },
{ x = 0, y = 32 },
{ x = 0, y = 0 }
},
properties = {
["clockwise"] = true,
["hitpoints"] = 2
}
},
{
id = 46,
name = "",
type = "scarab",
shape = "polyline",
x = 176,
y = 336,
width = 0,
height = 0,
rotation = 0,
visible = true,
polyline = {
{ x = 0, y = 0 },
{ x = 0, y = 16 },
{ x = -96, y = 16 },
{ x = -96, y = -48 },
{ x = -48, y = -48 },
{ x = 0, y = 0 }
},
properties = {
["clockwise"] = true
}
},
{
id = 51,
name = "blaster",
type = "upgrade",
shape = "rectangle",
x = 496,
y = 480,
width = 32,
height = 32,
rotation = 0,
visible = true,
properties = {}
},
{
id = 52,
name = "side_chamber",
type = "exit",
shape = "rectangle",
x = 560,
y = 496,
width = 32,
height = 48,
rotation = 0,
visible = true,
properties = {
["target"] = "arena.entrance"
}
},
{
id = 54,
name = "",
type = "scarab",
shape = "polyline",
x = 32,
y = 192,
width = 0,
height = 0,
rotation = 0,
visible = true,
polyline = {
{ x = 0, y = 0 },
{ x = 0, y = -144 },
{ x = 48, y = -144 }
},
properties = {
["hitpoints"] = 4
}
},
{
id = 56,
name = "",
type = "crate",
shape = "rectangle",
x = 416,
y = 448,
width = 16,
height = 16,
rotation = 0,
visible = true,
properties = {
["alien"] = true
}
},
{
id = 58,
name = "",
type = "blast_door",
shape = "rectangle",
x = 544,
y = 160,
width = 16,
height = 48,
rotation = 0,
visible = true,
properties = {}
},
{
id = 60,
name = "high_jump",
type = "upgrade",
shape = "rectangle",
x = 96,
y = 496,
width = 32,
height = 32,
rotation = 0,
visible = true,
properties = {}
},
{
id = 65,
name = "need_better_jump",
type = "trigger",
shape = "rectangle",
x = 339,
y = 447,
width = 66.5,
height = 45,
rotation = 0,
visible = true,
properties = {}
},
{
id = 69,
name = "need_blaster",
type = "trigger",
shape = "rectangle",
x = 20.5,
y = 471.5,
width = 57.5,
height = 91.5,
rotation = 0,
visible = true,
properties = {
["on_contains"] = true
}
},
{
id = 73,
name = "approaching_blaster",
type = "trigger",
shape = "rectangle",
x = 480,
y = 464,
width = 64,
height = 80,
rotation = 0,
visible = true,
properties = {
["on_contains"] = true
}
},
{
id = 76,
name = "shoot_tutorial",
type = "trigger",
shape = "rectangle",
x = 16,
y = 448,
width = 144,
height = 112,
rotation = 0,
visible = true,
properties = {
["on_contains"] = true
}
}
}
}
}
}
|
local obj = {}
obj.__index = obj
-- Metadata
obj.name = "Take a break"
obj.version = "1.0"
obj.author = "Pavel Makhov"
obj.homepage = "https://github.com/fork-my-spoons/take-a-break.spoon"
obj.license = "MIT - https://opensource.org/licenses/MIT"
obj.indicator = nil
obj.iconPath = hs.spoons.resourcePath("icons")
obj.timer = nil
obj.refreshTimer = nil
obj.notificationType = nil
local function showAlert()
hs.alert.show("It's time to take a break!", {
fillColor = {hex = '#E5E9F0'},
textColor = {hex = '#3B4252'},
radius = 8,
fadeInDuration = 0.5,
fadeOutDuration = 0.5
})
end
function obj:notifyIn(mins)
obj.indicator:setTitle(mins)
obj.timer = hs.timer.doAfter(mins * 60, function()
if obj.notificationType == 'alert' then
showAlert()
else
hs.notify.new(function() end,
{
autoWithdraw = true,
title = "Take A Break",
informativeText = "It's time to take a break!",
hasActionButton = false,
contentImage = hs.image.imageFromPath(obj.iconPath .. '/coffee-cup.png')
}):send()
end
obj.indicator:setTitle(nil)
obj.timer = nil
end)
obj.refreshTimer = hs.timer.doEvery(60, function()
if obj.timer ~= nil and obj.timer:running() then
if obj.timer:nextTrigger() < 0 then
obj.timer = nil
obj.refreshTimer = nil
obj.indicator:setTitle(nil)
else
obj.indicator:setTitle(math.ceil((obj.timer:nextTrigger()/60)))
end
end
end)
end
function obj:buildMenu()
local menu = {
{title = 'Take a break in:', disabled = true},
{image = hs.image.imageFromPath(obj.iconPath .. '/15m.png'):setSize({w=20,h=20}):template(true), title = '15 minutes', fn = function() obj:notifyIn(15) end},
{image = hs.image.imageFromPath(obj.iconPath .. '/30m.png'):setSize({w=20,h=20}):template(true), title = '30 minutes', fn = function() obj:notifyIn(30) end},
{image = hs.image.imageFromPath(obj.iconPath .. '/45m.png'):setSize({w=20,h=20}):template(true), title = '45 minutes', fn = function() obj:notifyIn(45) end},
{title = '-'}
}
if obj.timer ~= nil then
table.insert(menu, {title = 'Cancel', fn = function()
obj.timer = nil
obj.refreshTimer = nil
obj.indicator:setTitle(nil)
end})
end
return menu
end
function obj:init()
self.indicator = hs.menubar.new()
self.indicator:setIcon(hs.image.imageFromPath(self.iconPath .. '/coffee-cup.png'):setSize({w=16,h=16}), true)
self.indicator:setMenu(self.buildMenu)
end
function obj:setup(args)
self.notificationType = args.notificationType or 'alert'
end
return obj
|
local COMMAND = Clockwork.command:New("CharGiveExemptFlags");
COMMAND.tip = "Gives exempt flags to a character.";
COMMAND.text = "<string Name> <string Flag(s)>";
COMMAND.access = "s";
COMMAND.arguments = 2;
function COMMAND:OnRun(player, arguments)
local target = Clockwork.player:FindByID(arguments[1]);
if (target) then
local exemptflags = target:GetCharacterData("ExemptFlags");
if (string.find(arguments[2], "a") or string.find(arguments[2], "s")
or string.find(arguments[2], "o")) then
Clockwork.player:Notify(player, "You cannot give 'o', 'a' or 's' flags!");
return;
end;
if(exemptflags and exemptflags != "") then
for x = 0, string.len(arguments[2]) do
if(!string.find(exemptflags, string.sub(arguments[2], x, x))) then
exemptflags = exemptflags..string.sub(arguments[2], x, x);
end
end
target:SetCharacterData("ExemptFlags", exemptflags);
else
target:SetCharacterData("ExemptFlags", arguments[2]);
end
Clockwork.player:GiveFlags(target, arguments[2]);
Clockwork.player:NotifyAll(player:Name().." gave "..target:Name().." '"..arguments[2].."' flags.");
else
Clockwork.player:Notify(player, arguments[1].." is not a valid character!");
end;
end;
COMMAND:Register();
|
local G3DTools = class("G3DTools")
function G3DTools:ctor()
end
function G3DTools:camera()
-- return GameObject.Find("/Canvas/UiCamera")
return g_system:currentUnitySceneCamera()
-- return Camera.current
end
function G3DTools:lerpColor(src, dst, factor)
factor = Mathf.SmoothStep(0,1,factor)
local r = Mathf.Lerp(src.r, dst.r, factor)
local g = Mathf.Lerp(src.g, dst.g, factor)
local b = Mathf.Lerp(src.b, dst.b, factor)
local a = Mathf.Lerp(src.a, dst.a, factor)
return Color(r,g,b,a)
end
function G3DTools:screenToWorldPoint(pt)
local camera = self:camera()
return camera:ScreenToWorldPoint(Vector3(pt.x, pt.y, 0))
end
--设置unity的layer
--需要所有子孙, 不是儿子
function G3DTools:setChildrenLayer(go, value)
go.layer = value
for i=1, go.transform.childCount do
local sub = go.transform:GetChild(i-1)
self:setChildrenLayer(sub.gameObject, value)
end
end
function G3DTools:setParticlePlay(go)
local components = go:GetComponentsInChildren(typeof(ParticleSystem))
for i=1,components.Length do
local ps = components[i-1]
ps:Play()
end
end
function G3DTools:setParticleSpeed(go, speed)
local components = go:GetComponentsInChildren(typeof(ParticleSystem))
-- local components = go:GetComponents( typeof(ParticleSystem) )
for i=1,components.Length do
local ps = components[i-1]
ps.main.simulationSpeed = speed
end
end
function G3DTools:setParticleUseUnscaledTime(go, useUnscaledTime)
local components = go:GetComponents( typeof(ParticleSystem) )
for i=1,components.Length do
local ps = components[i-1]
ps.main.useUnscaledTime = useUnscaledTime
end
end
return G3DTools
|
--[[
s:UI Configuration
Martin Karer / Sezz, 2014
http://www.sezz.at
--]]
local S = Apollo.GetPackage("Gemini:Addon-1.1").tPackage:GetAddon("SezzUI");
local Apollo = Apollo;
-----------------------------------------------------------------------------
S.DB = {
Colors = {
Classes = {
[GameLib.CodeEnumClass.Engineer] = "A41A31",
[GameLib.CodeEnumClass.Esper] = "74DDFF",
[GameLib.CodeEnumClass.Medic] = "FFFFFF",
[GameLib.CodeEnumClass.Stalker] = "DDD45F",
[GameLib.CodeEnumClass.Spellslinger] = "826FAC",
[GameLib.CodeEnumClass.Warrior] = "AB855E",
},
},
Modules = {
-- Auras
Buffs = {
Filter = {
[70391] = true, -- Authentication Dividends
}
},
-- Auction House
AutoLootMail = {
bEnabled = true,
},
AuctionHouse = {
bEnabled = true,
-- GUI
strFont = "CRB_Pixel", -- Nameplates
strFontLarge = "CRB_ButtonHeader",
},
-- Crit Line
CritLine = {},
-- Action Bars
ActionBars = {
buttonSize = 36,
buttonPadding = 2,
barPadding = 10, -- Menu needs atleast 10 because the toggle is ignored by ContainsMouse()
},
},
-- Hide Windows from Window Management
-- This should disable/override user customization (Interface Options / Window)
NoWindowManagement = {
[Apollo.GetString("MiniMap_Title")] = true,
[Apollo.GetString("CRB_QuestTracker")] = true,
[Apollo.GetString("HUDAlert_VacuumLoot")] = true,
[Apollo.GetString("MarketplaceAuction_AuctionHouse")] = true,
},
-- Module Debugging
-- Disable to filter the messages in GeminiConsole
["debug"] = {
-- ["Modules"] = false, -- Module Prototype
["Modules/Chat"] = false, -- Chat Module
["Modules/Automation"] = false, -- Automation Module
-- ["Modules/MiniMap"] = false, -- Minimap Module
-- ["Modules/Tooltips"] = false, -- Tooltips Module
-- ["Modules/ActionBars"] = false, -- ActionBars Module
["Modules/DataText"] = false, -- DataText Module
["RandomCraft"] = false,
["ArtworkRemover"] = false,
["PowerBar"] = false,
["ConsoleVariables"] = false,
},
};
|
--- === Defaults ===
---
--- Definitions of default events and entities
---
-- luacov: disable
local Defaults = {}
Defaults.__index = Defaults
Defaults.__name = "default"
Defaults.events = {}
Defaults.entities = {}
if not _G.requirePackage then
function _G.requirePackage(name, isInternal)
local luaVersion = _VERSION:match("%d+%.%d+")
local location = not isInternal and "/deps/share/lua/"..luaVersion.."/" or "/"
local spoonPath = debug.getinfo(2, "S").source:sub(2):match("(.*/)"):sub(1, -2)
local packagePath = spoonPath..location..name..".lua"
return dofile(packagePath)
end
end
local File = _G.requirePackage("file", true)
local SmartFolder = _G.requirePackage("smart-folder", true)
local entities = {
ActivityMonitor = _G.requirePackage("entities/activity-monitor", true),
AppStore = _G.requirePackage("entities/app-store", true),
Books = _G.requirePackage("entities/books", true),
Calendar = _G.requirePackage("entities/calendar", true),
Calculator = _G.requirePackage("entities/calculator", true),
Contacts = _G.requirePackage("entities/contacts", true),
Dictionary = _G.requirePackage("entities/dictionary", true),
DiskUtility = _G.requirePackage("entities/disk-utility", true),
FaceTime = _G.requirePackage("entities/facetime", true),
Finder = _G.requirePackage("entities/finder", true),
GoogleChrome = _G.requirePackage("entities/google-chrome", true),
Home = _G.requirePackage("entities/home", true),
iTunes = _G.requirePackage("entities/itunes", true),
Maps = _G.requirePackage("entities/maps", true),
Mail = _G.requirePackage("entities/mail", true),
Messages = _G.requirePackage("entities/messages", true),
News = _G.requirePackage("entities/news", true),
Notes = _G.requirePackage("entities/notes", true),
PhotoBooth = _G.requirePackage("entities/photo-booth", true),
Photos = _G.requirePackage("entities/photos", true),
Preview = _G.requirePackage("entities/preview", true),
QuickTimePlayer = _G.requirePackage("entities/quicktime-player", true),
Reminders = _G.requirePackage("entities/reminders", true),
Safari = _G.requirePackage("entities/Safari", true),
Siri = _G.requirePackage("entities/siri", true),
Spotify = _G.requirePackage("entities/spotify", true),
Stickies = _G.requirePackage("entities/stickies", true),
SystemPreferences = _G.requirePackage("entities/system-preferences", true),
Terminal = _G.requirePackage("entities/terminal", true),
TextEdit = _G.requirePackage("entities/text-edit", true),
VoiceMemos = _G.requirePackage("entities/voice-memos", true),
}
--- Defaults.createFileEvents()
--- Method
--- Defines the initial set of actions with predefined keybindings for `file` mode
---
--- Parameters:
--- * None
---
--- Returns:
--- * A list of `file` workflow events
function Defaults.createFileEvents()
local finderAppLocation = "/System/Library/CoreServices/Finder.app/Contents/Applications"
local function openFinderAppEvent(name)
return function()
hs.execute("open "..finderAppLocation.."/"..name..".app")
return true
end
end
local recentsSavedSearchPath =
"/System/Library/CoreServices/Finder.app/Contents/Resources/MyLibraries/myDocuments.cannedSearch/Resources/search.savedSearch"
local Recents = SmartFolder:new(recentsSavedSearchPath)
local fileEvents = {
{ nil, "a", File:new("/Applications"), { "Files", "Applications" } },
{ nil, "d", File:new("~/Downloads"), { "Files", "Downloads" } },
{ nil, "h", File:new("~"), { "Files", "$HOME" } },
{ nil, "m", File:new("~/Movies"), { "Files", "Movies" } },
{ nil, "p", File:new("~/Pictures"), { "Files", "Pictures" } },
{ nil, "t", File:new("~/.Trash"), { "Files", "Trash" } },
{ nil, "v", File:new("/Volumes"), { "Files", "Volumes" } },
{ { "cmd" }, "a", openFinderAppEvent("Airdrop"), { "Files", "Airdrop" } },
{ { "cmd" }, "c", openFinderAppEvent("Computer"), { "Files", "Computer" } },
{ { "cmd" }, "i", openFinderAppEvent("iCloud\\ Drive"), { "Files", "iCloud Drive" } },
{ { "cmd" }, "n", openFinderAppEvent("Network"), { "Files", "Network" } },
{ { "cmd" }, "r", Recents, { "Files", "Recents" } },
{ { "shift" }, "a", openFinderAppEvent("All My Files"), { "Files", "All My Files" } },
{ { "shift" }, "d", File:new("~/Desktop"), { "Files", "Desktop" } },
{ { "cmd", "shift" }, "d", File:new("~/Documents"), { "Files", "Documents" } },
}
return fileEvents
end
--- Defaults.createEntityEvents()
--- Method
--- Defines the initial set of actions with predefined keybindings for `entity` and `select` mode
---
--- Parameters:
--- * None
---
--- Returns:
--- * A list of `entity` workflow events
--- * A list of `select` workflow events
function Defaults.createEntityEvents()
local entityEvents = {
{ nil, "a", entities.AppStore, { "Entities", "App Store" } },
{ nil, "b", entities.Books, { "Entities", "Books" } },
{ nil, "c", entities.Calendar, { "Entities", "Calendar" } },
{ nil, "d", entities.Dictionary, { "Entities", "Dictionary" } },
{ nil, "f", entities.Finder, { "Entities", "Finder" } },
{ nil, "g", entities.GoogleChrome, { "Entities", "Google Chrome" } },
{ nil, "h", entities.Home, { "Entities", "Home" } },
{ nil, "i", entities.iTunes, { "Entities", "iTunes" } },
{ nil, "m", entities.Messages, { "Entities", "Messages" } },
{ nil, "n", entities.Notes, { "Entities", "Notes" } },
{ nil, "p", entities.Preview, { "Entities", "Preview" } },
{ nil, "q", entities.QuickTimePlayer, { "Entities", "QuickTime Player" } },
{ nil, "r", entities.Reminders, { "Entities", "Reminders" } },
{ nil, "s", entities.Safari, { "Entities", "Safari" } },
{ nil, "t", entities.Terminal, { "Entities", "Terminal" } },
{ nil, "v", entities.VoiceMemos, { "Entities", "Voice Memos" } },
{ nil, ",", entities.SystemPreferences, { "Entities", "System Preferences" } },
{ { "cmd" }, "d", entities.DiskUtility, { "Entities", "Disk Utility" } },
{ { "alt", "cmd" }, "s", entities.Siri, { "Entities", "Siri" } },
{ { "shift" }, "a", entities.ActivityMonitor, { "Entities", "Activity Monitor" } },
{ { "shift" }, "c", entities.Calculator, { "Entities", "Calculator" } },
{ { "shift" }, "f", entities.FaceTime, { "Entities", "FaceTime" } },
{ { "shift" }, "m", entities.Maps, { "Entities", "Maps" } },
{ { "shift" }, "n", entities.News, { "Entities", "News" } },
{ { "shift" }, "p", entities.PhotoBooth, { "Entities", "Photo Booth" } },
{ { "shift" }, "s", entities.Spotify, { "Entities", "Spotify" } },
{ { "shift" }, "t", entities.TextEdit, { "Entities", "Text Edit" } },
{ { "shift", "cmd" }, "c", entities.Contacts, { "Entities", "Contacts" } },
{ { "shift", "cmd" }, "p", entities.Photos, { "Entities", "Photos" } },
{ { "shift", "cmd" }, "m", entities.Mail, { "Entities", "Mail" } },
{ { "shift", "cmd" }, "s", entities.Stickies, { "Entities", "Stickies" } },
}
local entitySelectEvents = {
{ nil, "d", entities.Dictionary, { "Entities", "Select a Dictionary window" } },
{ nil, "f", entities.Finder, { "Select Events", "Select a Finder window" } },
{ nil, "g", entities.GoogleChrome, { "Select Events", "Select a Google Chrome tab or window" } },
{ nil, "m", entities.Messages, { "Select Events", "Select a Messages conversation" } },
{ nil, "n", entities.Notes, { "Select Events", "Select a Note" } },
{ nil, "p", entities.Preview, { "Select Events", "Select a Preview window" } },
{ nil, "q", entities.QuickTimePlayer, { "Select Events", "QuickTime Player" } },
{ nil, "s", entities.Safari, { "Select Events", "Select a Safari tab or window" } },
{ nil, "t", entities.Terminal, { "Select Events", "Select a Terminal window" } },
{ nil, ",", entities.SystemPreferences, { "Entities", "Select a System Preferences pane" } },
{ { "shift" }, "t", entities.TextEdit, { "Select Events", "Select a Text Edit window" } },
}
return entityEvents, entitySelectEvents
end
--- Defaults.createUrlEvents()
--- Method
--- Defines the initial set of actions with predefined keybindings for `url` mode
---
--- Parameters:
--- * None
---
--- Returns:
--- * A list of `url` workflow events
--- * A table of `url` entities
function Defaults.createUrlEvents(URL)
local urls = {
Amazon = URL:new("https://amazon.com"),
Facebook = URL:new("https://facebook.com"),
GitHub = URL:new("https://github.com"),
GMail = URL:new("https://mail.google.com"),
Google = URL:new("https://google.com"),
GoogleMaps = URL:new("https://maps.google.com"),
HackerNews = URL:new("https://news.ycombinator.com"),
LinkedIn = URL:new("https://linkedin.com"),
Messenger = URL:new("https://messenger.com"),
Netflix = URL:new("https://netflix.com"),
Reddit = URL:new("https://reddit.com"),
Wikipedia = URL:new("https://wikipedia.org"),
Weather = URL:new("https://weather.com"),
Yelp = URL:new("https://yelp.com"),
YouTube = URL:new("https://youtube.com"),
Zillow = URL:new("https://zillow.com"),
}
urls.Facebook.paths = {
{ name = "Facebook", path = "https://www.facebook.com" },
{ name = "FB Messages", path = "/messages" },
{ name = "FB Marketplace", path = "/marketplace" },
{ name = "FB watch", path = "/watch" },
}
urls.HackerNews.paths = {
{ name = "Hacker News", path = "https://news.ycombinator.com" },
{ name = "New", path = "/newest" },
{ name = "Threads", path = "/threads" },
{ name = "Past", path = "/front" },
{ name = "Comments", path = "/newcomments" },
{ name = "Ask", path = "/ask" },
{ name = "Show", path = "/show" },
{ name = "Jobs", path = "/jobs" },
{ name = "Submit", path = "/submit" },
}
urls.LinkedIn.paths = {
{ name = "LinkedIn", path = "https://linkedin.com" },
{ name = "My Network", path = "/mynetwork/" },
{ name = "Jobs", path = "/jobs/" },
{ name = "Messaging", path = "/messaging/" },
{ name = "Notifications", path = "/notifications/" },
}
urls.Google.paths = {
{ name = "Google Search", path = "https://google.com" },
{ name = "Google Image Search", path = "https://www.google.com/imghp" },
{ name = "Google Account", path = "https://myaccount.google.com" },
{ name = "Google Calendar", path = "https://www.google.com/calendar" },
{ name = "Google Contacts", path = "https://contacts.google.com" },
{ name = "Google Drive", path = "https://drive.google.com" },
{ name = "Google Maps", path = "https://maps.google.com" },
{ name = "Google Play Store", path = "https://play.google.com" },
{ name = "Google News", path = "https://news.google.com" },
{ name = "Google Photos", path = "https://photos.google.com" },
{ name = "Google Shopping", path = "https://www.google.com/shopping" },
{ name = "Google Translate", path = "https://translate.google.com" },
{ name = "GMail", path = "https://mail.google.com" },
{ name = "YouTube", path = "https://www.youtube.com" },
}
urls.YouTube.paths = {
{ name = "YouTube", path = "https://youtube.com" },
{ name = "Trending", path = "/feed/trending" },
{ name = "Subscriptions", path = "/feed/subscriptions" },
{ name = "Library", path = "/feed/library" },
{ name = "History", path = "/feed/history" },
{ name = "Watch Later", path = "/playlist?list=WL" },
}
local urlEvents = {
{ nil, "a", urls.Amazon, { "URL Events", "Amazon" } },
{ nil, "f", urls.Facebook, { "URL Events", "Facebook" } },
{ nil, "g", urls.Google, { "URL Events", "Google" } },
{ nil, "h", urls.HackerNews, { "URL Events", "Hacker News" } },
{ nil, "l", urls.LinkedIn, { "URL Events", "LinkedIn" } },
{ nil, "m", urls.Messenger, { "URL Events", "Facebook Messenger" } },
{ nil, "n", urls.Netflix, { "URL Events", "Netflix" } },
{ nil, "r", urls.Reddit, { "URL Events", "Reddit" } },
{ nil, "w", urls.Wikipedia, { "URL Events", "Wikipedia" } },
{ nil, "y", urls.YouTube, { "URL Events", "YouTube" } },
{ nil, "z", urls.Zillow, { "URL Events", "Zillow" } },
{ { "shift" }, "g", urls.GitHub, { "URL Events", "GitHub" } },
{ { "shift" }, "m", urls.GoogleMaps, { "URL Events", "Google Maps" } },
{ { "shift" }, "w", urls.Weather, { "URL Events", "Weather" } },
{ { "shift" }, "y", urls.Yelp, { "URL Events", "Yelp" } },
{ { "cmd", "shift" }, "m", urls.GMail, { "URL Events", "Gmail" } },
}
return urlEvents, urls
end
--- Defaults.createVolumeEvents()
--- Method
--- Defines the initial set of actions with predefined keybindings for `volume` mode
---
--- Parameters:
--- * None
---
--- Returns:
--- * A list of `volume` workflow events
function Defaults.createVolumeEvents()
local function turnVolumeDown()
local newVolume = hs.audiodevice.current().volume - 10
hs.audiodevice.defaultOutputDevice():setVolume(newVolume)
end
local function turnVolumeUp()
local newVolume = hs.audiodevice.current().volume + 10
hs.audiodevice.defaultOutputDevice():setVolume(newVolume)
end
local function toggleMute()
local isMuted = hs.audiodevice.defaultOutputDevice():muted()
hs.audiodevice.defaultOutputDevice():setMuted(isMuted)
return true
end
local volumeEvents = {
{ nil, "j", turnVolumeDown, { "Volume Control Mode", "Turn Volume Down" } },
{ nil, "k", turnVolumeUp, { "Volume Control Mode", "Turn Volume Up" } },
{ nil, "m", toggleMute, { "Volume Control Mode", "Mute or Unmute Volume" } },
}
local function createVolumeToPercentageEvent(percentage)
return function()
hs.audiodevice.defaultOutputDevice():setVolume(percentage)
return true
end
end
for number = 0, 9 do
local percent = number * 100 / 9
table.insert(volumeEvents, {
nil,
tostring(number),
createVolumeToPercentageEvent(percent),
{ "Volume Control Mode", "Set Volume to "..tostring(math.floor(percent)).."%" },
})
end
return volumeEvents
end
--- Defaults.createBrightnessEvents()
--- Method
--- Defines the initial set of actions with predefined keybindings for `brightness` mode
---
--- Parameters:
--- * None
---
--- Returns:
--- * A list of `brightness` workflow events
function Defaults.createBrightnessEvents()
local function turnBrightnessDown()
local newBrightness = hs.brightness.get() - 10
hs.brightness.set(newBrightness)
end
local function turnBrightnessUp()
local newBrightness = hs.brightness.get() + 10
hs.brightness.set(newBrightness)
end
local function createBrightnessToPercentageEvent(percentage)
return function()
hs.brightness.set(math.floor(percentage))
return true
end
end
local brightnessEvents = {
{ nil, "j", turnBrightnessDown, { "Brightness Control Mode", "Turn Brightness Down" } },
{ nil, "k", turnBrightnessUp, { "Brightness Control Mode", "Turn Brightness Up" } },
}
for number = 0, 9 do
local percent = number * 100 / 9
table.insert(brightnessEvents, {
nil,
tostring(number),
createBrightnessToPercentageEvent(percent),
{ "Brightness Control Mode", "Set Brightness to "..tostring(math.floor(percent)).."%" },
})
end
return brightnessEvents
end
--- Defaults.createNormalEvents()
--- Method
--- Defines the initial set of actions with predefined keybindings for `normal` mode
---
--- Parameters:
--- * None
---
--- Returns:
--- * A list of `normal` workflow events
function Defaults.createNormalEvents(Ki)
local actions = {}
function actions.logout()
Ki.state:exitMode()
hs.timer.doAfter(0, function()
hs.focus()
local answer = hs.dialog.blockAlert("Log out from your computer?", "", "Log out", "Cancel")
if answer == "Log out" then
hs.osascript.applescript([[ tell application "System Events" to log out ]])
end
end)
end
function actions.startScreenSaver()
hs.osascript.applescript([[
tell application "System Events" to start current screen saver
]])
return true
end
function actions.sleep()
Ki.state:exitMode()
hs.osascript.applescript([[ tell application "Finder" to sleep ]])
end
function actions.restart()
Ki.state:exitMode()
hs.timer.doAfter(0, function()
hs.focus()
local answer = hs.dialog.blockAlert("Restart your computer?", "", "Restart", "Cancel")
if answer == "Restart" then
hs.osascript.applescript([[ tell application "Finder" to restart ]])
end
end)
end
function actions.shutdown()
Ki.state:exitMode()
hs.timer.doAfter(0, function()
hs.focus()
local answer = hs.dialog.blockAlert("Shut down your computer?", "", "Shut Down", "Cancel")
if answer == "Shut Down" then
hs.osascript.applescript([[ tell application "System Events" to shut down ]])
end
end)
end
local normalEvents = {
{ { "ctrl" }, "l", actions.logout, { "Normal Mode", "Log Out" } },
{ { "ctrl" }, "q", actions.shutdown, { "Normal Mode", "Shut Down" } },
{ { "ctrl" }, "r", actions.restart, { "Normal Mode", "Restart" } },
{ { "ctrl" }, "s", actions.sleep, { "Normal Mode", "Sleep" } },
{ { "cmd", "ctrl" }, "s", actions.startScreenSaver, { "Normal Mode", "Enter Screen Saver" } },
}
return normalEvents
end
--- Defaults.create(Ki) -> events, entities
--- Method
--- Creates the default Ki events and entities
---
--- Parameters:
--- * Ki - the Ki object
---
--- Returns:
--- * A table containing events for `url`, `select`, `entity`, `volume`, `brightness`, and `normal` modes
--- * A table containing all default desktop entity objects
function Defaults.create(Ki)
local urlEvents, urlEntities = Defaults.createUrlEvents(Ki.URL)
local entityEvents, entitySelectEvents = Defaults.createEntityEvents()
local fileEvents = Defaults.createFileEvents()
local volumeEvents = Defaults.createVolumeEvents()
local brightnessEvents = Defaults.createBrightnessEvents()
local normalEvents = Defaults.createNormalEvents(Ki)
local events = {
url = urlEvents,
select = entitySelectEvents,
entity = entityEvents,
file = fileEvents,
volume = volumeEvents,
brightness = brightnessEvents,
normal = normalEvents,
}
return events, entities, urlEntities
end
return Defaults
|
return {
id = "flowercrown",
name = "Flower Crown",
description = "Im so happy!",
type = "hat",
rarity = 2,
hidden = false,
}
|
local Vehicle = {
rootPath = "plugins.cyber_engine_tweaks.mods.cityhack.",
objectType = "vehicleCarBaseObject",
objectTypeBike = "vehicleBikeBaseObject",
objectTypeAV = "vehicleAVBaseObject"
}
local Util = require(Vehicle.rootPath.."hacks.modules.utility")
function Vehicle.SetAsPlayerVehicle()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
local getTargetPS = getTarget:GetVehiclePS()
getTargetPS:SetIsPlayerVehicle(1)
end
function Vehicle.Doors(state)
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) or Util.IsA(Vehicle.objectTypeAV, getTarget) then
local getTargetPS = getTarget:GetVehiclePS()
if state == "open" then
getTargetPS:OpenAllRegularVehDoors()
elseif state == "close" then
getTargetPS:CloseAllVehDoors()
elseif state == "lock" then
getTargetPS:LockAllVehDoors()
elseif state == "unlock" then
getTargetPS:UnlockAllVehDoors()
end
return true
else
return false
end
end
function Vehicle.Windows(state)
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) then
local getTargetPS = getTarget:GetVehiclePS()
if state == "open" then
getTargetPS:OpenAllVehWindows()
elseif state == "close" then
getTargetPS:CloseAllVehWindows()
end
return true
else
return false
end
end
function Vehicle.DetachAll()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) then
getTarget:DetachAllParts()
return true
else
return false
end
end
function Vehicle.Destroy()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) then
local getTargetPS = getTarget:GetVehiclePS()
local getTargetVC = getTarget:GetVehicleComponent()
getTargetVC:DestroyVehicle()
getTargetVC:LoadExplodedState()
getTargetVC:ExplodeVehicle(getPlayer)
getTargetPS:ForcePersistentStateChanged()
return true
else
return false
end
end
function Vehicle.Repair()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) or Util.IsA(Vehicle.objectTypeBike, getTarget) then
local getTargetPS = getTarget:GetVehiclePS()
local getTargetVC = getTarget:GetVehicleComponent()
getTarget:DestructionResetGrid()
getTarget:DestructionResetGlass()
getTargetVC:RepairVehicle()
getTargetPS:ForcePersistentStateChanged()
return true
else
return false
end
end
function Vehicle.HonkFlash()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) or Util.IsA(Vehicle.objectTypeBike, getTarget) then
local getTargetVC = getTarget:GetVehicleComponent()
getTargetVC:HonkAndFlash()
return true
else
return false
end
end
function Vehicle.Lights(state)
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) or Util.IsA(Vehicle.objectTypeBike, getTarget) or Util.IsA(Vehicle.objectTypeAV, getTarget) then
local getTargetVC = getTarget:GetVehicleComponent()
local getTargetVCPS = getTargetVC:GetVehicleControllerPS()
getTargetVCPS:SetLightMode(state)
return true
else
return false
end
end
function Vehicle.Engine(state)
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) or Util.IsA(Vehicle.objectTypeBike, getTarget) or Util.IsA(Vehicle.objectTypeAV, getTarget) then
local getTargetVC = getTarget:GetVehicleComponent()
local getTargetVCPS = getTargetVC:GetVehicleControllerPS()
if state == "on" then
getTargetVCPS:SetState(2)
elseif state == "off" then
getTargetVCPS:SetState(1)
end
return true
else
return false
end
end
function Vehicle.Reset()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) or Util.IsA(Vehicle.objectTypeBike, getTarget) then
local getTargetVC = getTarget:GetVehicleComponent()
getTargetVC:ResetVehicle()
end
end
function Vehicle.SetGod()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) or Util.IsA(Vehicle.objectTypeBike, getTarget) then
local getTargetVC = getTarget:GetVehicleComponent()
getTargetVC:SetImmortalityMode()
return true
else
return false
end
end
function Vehicle.ToggleSummonMode()
local vehicleSystem = Game.GetVehicleSystem()
vehicleSystem:ToggleSummonMode()
return true
end
function Vehicle.CycleAppearance()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) or Util.IsA(Vehicle.objectTypeBike, getTarget) then
getTarget:ScheduleAppearanceChange("Randomize")
return true
else
return false
end
end
function Vehicle.Despawn()
local player = Game.GetPlayer()
local target = Game.GetTargetingSystem():GetLookAtObject(player, false, false)
local vehicleSystem = Game.GetVehicleSystem()
local id = target:GetRecord():GetID()
print(id)
vehicleSystem.DespawnPlayerVehicle(id)
--print(Game.GetTargetingSystem():GetLookAtObject(Game.GetPlayer(), false, false):GetRecord())
end
function Vehicle.DumpPS()
local getPlayer = Game.GetPlayer()
local getTarget = Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false)
if Util.IsA(Vehicle.objectType, getTarget) then
local getTargetPS = getTarget:GetVehiclePS()
print(Dump(getTargetPS, false))
end
end
return Vehicle
-- Game.GetTargetingSystem():GetLookAtObject(getPlayer, false, false):GetVehiclePS():SetDoorState(0, 1)
|
--[[====================================
=
= ccui.EditBox 扩展
=
========================================]]
local constant_uisystem = g_constant_conf.constant_uisystem
local config_delay_destroy_edit_tag = 10000
local CCEditBoxExt, Super = tolua_get_class('CCEditBoxExt')
--override 创建的时候不用考虑基类初始化
function CCEditBoxExt:Create()
return cc.ScrollView:create():CastTo(self):_init()
end
--override
function CCEditBoxExt:_init()
Super._init(self)
self._bEnableMultiline = false
self._hAlign = cc.TEXT_ALIGNMENT_RIGHT
self._vAlign = cc.VERTICAL_TEXT_ALIGNMENT_CENTER
self._edit = nil
self._editText = nil
self._isEnableRawText = true
-- child node
self.nodeText = cc.Node:create()
self.nodeText:setAnchorPoint(ccp(0, 0))
self.txt = cc.RichLabel:Create('', 25, 0, 0)
self.txt:enableRawText(true)
self.txtPlaceholder = cc.RichLabel:Create('', 25, 0, 0)
self.txtPlaceholder:enableRawText(true)
self.txtPlaceholder:SetAlignment(cc.TEXT_ALIGNMENT_RIGHT)
self.btn = cc.Layer:Create()
self.btn:setAnchorPoint(ccp(0, 0))
self:addChild(self.nodeText)
self:addChild(self.btn)
self.nodeText:addChild(self.txt)
self.nodeText:addChild(self.txtPlaceholder)
self.btn:HandleTouchMove(true, true, true, '10w')
self.btn.OnClick = function()
self:_onEdit()
end
return self
end
if g_uisystem.is_text_left_to_right_order() then
local oldInit = CCEditBoxExt._init
function CCEditBoxExt:_init()
local ret = oldInit(self)
ret._hAlign = cc.TEXT_ALIGNMENT_LEFT
ret.txtPlaceholder:SetAlignment(cc.TEXT_ALIGNMENT_LEFT)
return ret
end
end
--override
function CCEditBoxExt:_registerInnerEvent()
self:_regInnerEvent('OnEditBegan')
self:_regInnerEvent('OnEditEnded')
self:_regInnerEvent('OnEditChanged')
self:_regInnerEvent('OnEditReturn')
end
function CCEditBoxExt:_onEdit()
if self._edit then
return
end
-- 如果是password输入框,开始编辑的时候把原文本填入输入框
if self._flag == cc.EDITBOX_INPUT_FLAG_PASSWORD then
self.txt:SetString(self._editText)
end
local cw, ch = self:GetContentSize()
local edit = ccui.EditBox:Create(CCSize(cw, ch), constant_uisystem.default_transparent_img_path)
self:addChild(edit)
edit:SetPosition('50%', '50%')
edit:setAnchorPoint(ccp(0.5, 0.5))
edit.newHandler.OnEditBegan = function(text)
if not self:IsValid() then
return
end
self.eventHandler:Trigger('OnEditBegan', text)
end
edit.newHandler.OnEditEnded = function(text)
if not self:IsValid() then
return
end
self:SetText(text)
self.eventHandler:Trigger('OnEditEnded', text)
end
edit.newHandler.OnEditChanged = function(text)
if not self:IsValid() then
return
end
self:SetText(text)
self.eventHandler:Trigger('OnEditChanged', text)
end
edit.newHandler.OnEditReturn = function(text)
if not self:IsValid() then
return
end
-- 避免 _edit 为 nil
self:stopActionByTag(config_delay_destroy_edit_tag)
self:DelayCallWithTag(0, config_delay_destroy_edit_tag, function()
self.nodeText:setVisible(true)
self._edit:removeFromParent()
self._edit = nil
--不支持富文本格式
if not self._isEnableRawText then
text = string.replace_four_utf_char_emoj(text)
else
text = string.filter_four_utf_char(text)
end
self:SetText(text)
self.eventHandler:Trigger('OnEditReturn', text)
end)
end
local function _getScale(node)
local curScale = 1
while node ~= nil do
curScale = curScale * node:getScaleY()
node = node:getParent()
end
return curScale
end
edit:setFontSize(self._fontSize * _getScale(self))
edit:setFontColor(self.txt:getTextColor())
edit:setPlaceholderFontSize(self._fontSize)
edit:setPlaceholderFontColor(self.txtPlaceholder:getTextColor())
edit:setMaxLength(self._nMaxLength)
edit:setReturnType(self._returnType)
edit:setInputMode(self._inputMode)
edit:setInputFlag(self._flag)
local input_text = self.txt:getString()
if not self._isEnableRawText then
input_text = string.change_rich_label_emoj_to_utf8(input_text)
end
edit:SetText(input_text)
self._edit = edit
self:DelayCall(0, function()
self.nodeText:setVisible(false)
edit:touchDownAction(edit, 2)
end)
end
--override
function CCEditBoxExt:SetContentSize(sw, sh)
local sz = cc.ScrollView.SetContentSize(self, sw, sh)
self:_updateTextPos()
return sz
end
function CCEditBoxExt:SetText(text, ...)
self._editText = text
if self._flag == cc.EDITBOX_INPUT_FLAG_PASSWORD then
text = self.txt:SetString(string.rep("*", #text))
else
text = self.txt:SetString(text, ...)
end
self.txt:setVisible(#text > 0)
self.txtPlaceholder:setVisible(#text == 0)
self:_updateTextPos()
return text
end
function CCEditBoxExt:EnableMultiLine(bEnbale)
self._bEnableMultiline = bEnbale
self:_updateTextPos()
end
function CCEditBoxExt:setFontColor(color)
self.txt:setTextColor(color)
end
function CCEditBoxExt:setFontSize(fontSize)
self._fontSize = fontSize
self.txt:SetFontSize(fontSize)
end
function CCEditBoxExt:SetPlaceHolder(...)
return self.txtPlaceholder:SetString(...)
end
function CCEditBoxExt:setPlaceholderFontColor(color)
self.txtPlaceholder:setTextColor(color)
end
function CCEditBoxExt:setPlaceholderFontSize(fontSize)
self.txtPlaceholder:SetFontSize(fontSize)
end
function CCEditBoxExt:setAlignment(hAlign, vAlign)
self._hAlign = hAlign
self._vAlign = vAlign
end
function CCEditBoxExt:_updateTextPos()
local contentSize
local sw, sh = self:GetContentSize()
self.txtPlaceholder:setMaxLineWidth(sw)
if self._bEnableMultiline then
self.txt:setMaxLineWidth(sw)
contentSize = CCSize(sw, math.max(sh, self.txt:getContentSize().height))
else
self.txt:setMaxLineWidth(0)
contentSize = CCSize(sw, sh)
end
self:setContentSize(contentSize)
self.nodeText:setContentSize(contentSize)
self.btn:SetContentSize(sw, sh)
self:ResetContentOffset()
self:ScrollToTop()
local pos = {x = '50%', y = '50%'}
local anchor = {x = 0.5, y = 0.5}
if self._hAlign == cc.TEXT_ALIGNMENT_LEFT then
pos.x = 0
anchor.x = 0
elseif self._hAlign == cc.TEXT_ALIGNMENT_RIGHT then
pos.x = '100%'
anchor.x = 1
else
assert(self._hAlign == cc.TEXT_ALIGNMENT_CENTER)
end
if self._vAlign == cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM then
pos.y = 0
anchor.y = 0
elseif self._vAlign == cc.VERTICAL_TEXT_ALIGNMENT_TOP then
pos.y = '100%'
anchor.y = 1
else
assert(self._vAlign == cc.VERTICAL_TEXT_ALIGNMENT_CENTER)
end
if self._bEnableMultiline then
self.txt:setHorizontalAlignment(self._hAlign)
end
self.txt:setAnchorPoint(anchor)
self.txt:SetPosition(pos.x, pos.y)
self.txtPlaceholder:setAnchorPoint(anchor)
self.txtPlaceholder:SetPosition(pos.x, pos.y)
end
function CCEditBoxExt:setMaxLength(nMaxLength)
self._nMaxLength = nMaxLength
end
function CCEditBoxExt:setReturnType(returnType)
self._returnType = returnType
end
function CCEditBoxExt:setInputMode(inputMode)
self._inputMode = inputMode
end
function CCEditBoxExt:setInputFlag(inputFlag)
self._flag = inputFlag
end
function CCEditBoxExt:getText()
return self._editText
end
function CCEditBoxExt:getPlaceHolder()
return self.txtPlaceholder:getString()
end
function CCEditBoxExt:EnableRawText(isEnabled)
self._isEnableRawText = isEnabled
self.txt:enableRawText(isEnabled)
end
CCEditBoxExt.SetString = CCEditBoxExt.SetText
CCEditBoxExt.GetString = CCEditBoxExt.getText
|
--[[
MTA Role Play (mta-rp.pl)
Autorzy poniższego kodu:
- Patryk Adamowicz <patrykadam.dev@gmail.com>
Discord: PatrykAdam#1293
Link do githuba: https://github.com/PatrykAdam/mtarp
--]]
local screenX, screenY = guiGetScreenSize()
local scaleX, scaleY = math.max(0.5, (screenX / 1920)), math.max(0.5, (screenY / 1080))
local counter = {}
counter.W, counter.H = 359 * scaleX, 295 * scaleX
counter.X, counter.Y = screenX - counter.W - 20 * scaleX, screenY - counter.H - 80 * scaleY
counter.tipW, counter.tipH = 147 * scaleX, 107 * scaleX
counter.tipX, counter.tipY = counter.X + counter.W/2 - counter.tipW + 16 * scaleX, counter.Y + 160 * scaleX
counter.minangle = -9
counter.iconW, counter.iconH = 38 * scaleX, 31 * scaleX
counter.engineX, counter.engineY = counter.X + (counter.W - counter.iconW * 4)/2, counter.Y + 125 * scaleX - counter.iconH/2
counter.handbrakeX, counter.handbrakeY = counter.engineX + counter.iconW, counter.engineY
counter.lightX, counter.lightY = counter.handbrakeX + counter.iconW, counter.handbrakeY
counter.emergencyX, counter.emergencyY = counter.lightX + counter.iconW, counter.lightY
counter.signW, counter.signH = 33 * scaleX, 27 * scaleX
counter.leftsignX, counter.leftsignY = counter.X + counter.W/2 - counter.signW - 5 * scaleX, counter.lightY + counter.signH
counter.rightsignX, counter.rightsignY = counter.X + counter.W/2 + 5 * scaleX, counter.lightY + counter.signH
counter.fuelX, counter.fuelY = counter.X + 225 * scaleX, counter.Y + 160 * scaleX
counter.numberW, counter.numberH = 132 * scaleX, 55 * scaleX
counter.numberX, counter.numberY = counter.X + 108 * scaleX, counter.Y + 233 * scaleX
counter.font = dxCreateFont( "assets/Speed-Crazy.ttf", 20 * scaleX )
counter.active = false
function counter.onRender()
if not isPedInVehicle( localPlayer ) or getPedOccupiedVehicle( localPlayer ) == false then counter.active = false return removeEventHandler( "onClientRender", root, counter.onRender ) end
local vehicle = getPedOccupiedVehicle( localPlayer )
dxDrawImage( counter.X, counter.Y, counter.W, counter.H, "assets/licznik.png" )
if getElementHealth( vehicle ) <= 300 then
dxDrawImage( counter.engineX, counter.engineY, counter.iconW, counter.iconH, "assets/dmgsilnik.png" )
else
dxDrawImage( counter.engineX, counter.engineY, counter.iconW, counter.iconH, getVehicleEngineState( vehicle ) and "assets/onsilnik.png" or "assets/silnik.png" )
end
dxDrawImage( counter.handbrakeX, counter.handbrakeY, counter.iconW, counter.iconH, getElementData(vehicle, "vehicle:manual") and "assets/onreczny.png" or "assets/reczny.png" )
dxDrawImage( counter.lightX, counter.lightY, counter.iconW, counter.iconH, getVehicleOverrideLights( vehicle ) == 2 and "assets/onswiatla.png" or "assets/swiatla.png" )
local leftState, rightState, emergencyState = 0, 0, 0
if getElementData(vehicle, "i:left") then
leftState = indicatorData[getIndicatorID(vehicle)].state
elseif getElementData(vehicle, "i:right") then
rightState = indicatorData[getIndicatorID(vehicle)].state
elseif getElementData(vehicle, "i:emergency") then
emergencyState = indicatorData[getIndicatorID(vehicle)].state
end
dxDrawImage( counter.emergencyX, counter.emergencyY, counter.iconW, counter.iconH, emergencyState == 0 and "assets/awaryjne.png" or "assets/onawaryjne.png" )
dxDrawImage( counter.leftsignX, counter.leftsignY, counter.signW, counter.signH, leftState == 0 and "assets/lewy.png" or "assets/onlewy.png" )
dxDrawImage( counter.rightsignX, counter.rightsignY, counter.signW, counter.signH, rightState == 0 and "assets/prawy.png" or "assets/onprawy.png" )
dxDrawImage( counter.fuelX, counter.fuelY, counter.iconW, counter.iconH, getElementData(vehicle, "vehicle:fuel") < 5.0 and "assets/onpaliwo.png" or "assets/paliwo.png" )
dxDrawText( string.format("%012d", getElementData(vehicle, "vehicle:mileage")), counter.numberX, counter.numberY, counter.numberX + counter.numberW, counter.numberY + counter.numberH, tocolor(255, 255, 255), 1.0, counter.font, "center", "top" )
dxDrawText( string.format("%d/%d L", getElementData(vehicle, "vehicle:fuel"), getVehicleMaxFuel(getElementModel(vehicle))), counter.numberX, counter.numberY + 27.5 * scaleX, counter.numberX + counter.numberW, 0, tocolor(255, 255, 255), 1.0, counter.font, "center", "top" )
local speed = getElementSpeed(vehicle, 1)
if speed > 260 then
speed = 260
end
dxDrawImage( counter.tipX, counter.tipY, counter.tipW, counter.tipH, "assets/wskaznik.png", counter.minangle + (speed * 0.95), 56 * scaleX, -(38 * scaleX))
end
function counter.show(player, seat)
if localPlayer ~= player then return end
if getVehicleOccupant( getPedOccupiedVehicle( player ) ) and seat == 0 and not counter.active then
addEventHandler( "onClientRender", root, counter.onRender )
counter.active = true
end
end
function counter.hide()
if localPlayer ~= player then return end
removeEventHandler( "onClientRender", root, counter.onRender )
counter.active = false
end
addEventHandler( "onClientVehicleEnter", root, counter.show )
addEventHandler( "onClientVehicleExit", root, counter.hide )
addEventHandler( "onClientVehicleStartExit", root, counter.hide )
addEventHandler( "onClientPlayerVehicleExit", root, counter.hide )
addEventHandler( "onClientResourceStop", resourceRoot, counter.hide )
|
require "DamageLib"
require "2DGeometry"
require "MapPositionGOS"
require "PremiumPrediction"
require "GGPrediction"
local EnemyHeroes = {}
local AllyHeroes = {}
local EnemySpawnPos = nil
local AllySpawnPos = nil
--[[ AutoUpdate deactivated until proper rank.
do
local Version = 1.0
local Files = {
Lua = {
Path = SCRIPT_PATH,
Name = "dnsMages.lua",
Url = "https://raw.githubusercontent.com/fkndns/dnsMages/main/dnsMages.lua"
},
Version = {
Path = SCRIPT_PATH,
Name = "dnsActivator.version",
Url = "https://raw.githubusercontent.com/fkndns/dnsMages/main/dnsMages.version" -- check if Raw Adress correct pls.. after you have create the version file on Github
}
}
local function AutoUpdate()
local function DownloadFile(url, path, fileName)
DownloadFileAsync(url, path .. fileName, function() end)
while not FileExist(path .. fileName) do end
end
local function ReadFile(path, fileName)
local file = io.open(path .. fileName, "r")
local result = file:read()
file:close()
return result
end
DownloadFile(Files.Version.Url, Files.Version.Path, Files.Version.Name)
local textPos = myHero.pos:To2D()
local NewVersion = tonumber(ReadFile(Files.Version.Path, Files.Version.Name))
if NewVersion > Version then
DownloadFile(Files.Lua.Url, Files.Lua.Path, Files.Lua.Name)
print("New dnsMarksmen Version. Press 2x F6") -- <-- you can change the massage for users here !!!!
else
print(Files.Version.Name .. ": No Updates Found") -- <-- here too
end
end
AutoUpdate()
end
--]]
local ItemHotKey = {[ITEM_1] = HK_ITEM_1, [ITEM_2] = HK_ITEM_2, [ITEM_3] = HK_ITEM_3, [ITEM_4] = HK_ITEM_5, [ITEM_5] = HK_ITEM_6, [ITEM_6] = HK_ITEM_7, [ITEM_7] = HK_ITEM_7,}
local function GetInventorySlotItem(itemID)
assert(type(itemID) == "number", "GetInventorySlotItem: wrong argument types (<number> expected)")
for _, j in pairs({ITEM_1, ITEM_2, ITEM_3, ITEM_4, ITEM_5, ITEM_6}) do
if myHero:GetItemData(j).itemID == itemID and myHero:GetSpellData(j).currentCd == 0 then return j end
end
return nil
end
local function IsNearEnemyTurret(pos, distance)
--PrintChat("Checking Turrets")
local turrets = _G.SDK.ObjectManager:GetTurrets(GetDistance(pos) + 1000)
for i = 1, #turrets do
local turret = turrets[i]
if turret and GetDistance(turret.pos, pos) <= distance+915 and turret.team == 300-myHero.team then
--PrintChat("turret")
return turret
end
end
end
local function IsUnderEnemyTurret(pos)
--PrintChat("Checking Turrets")
local turrets = _G.SDK.ObjectManager:GetTurrets(GetDistance(pos) + 1000)
for i = 1, #turrets do
local turret = turrets[i]
if turret and GetDistance(turret.pos, pos) <= 915 and turret.team == 300-myHero.team then
--PrintChat("turret")
return turret
end
end
end
function GetDifference(a,b)
local Sa = a^2
local Sb = b^2
local Sdif = (a-b)^2
return math.sqrt(Sdif)
end
function GetDistanceSqr(Pos1, Pos2)
local Pos2 = Pos2 or myHero.pos
local dx = Pos1.x - Pos2.x
local dz = (Pos1.z or Pos1.y) - (Pos2.z or Pos2.y)
return dx^2 + dz^2
end
function DrawTextOnHero(hero, text, color)
local pos2D = hero.pos:To2D()
local posX = pos2D.x - 50
local posY = pos2D.y
Draw.Text(text, 28, posX + 50, posY - 15, color)
end
function GetDistance(Pos1, Pos2)
return math.sqrt(GetDistanceSqr(Pos1, Pos2))
end
function IsImmobile(unit)
local MaxDuration = 0
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff and buff.count > 0 then
local BuffType = buff.type
if BuffType == 5 or BuffType == 11 or BuffType == 22 or BuffType == 23 or BuffType == 25 or BuffType == 30 or buff.name == "recall" then
local BuffDuration = buff.duration
if BuffDuration > MaxDuration then
MaxDuration = BuffDuration
end
end
end
end
return MaxDuration
end
function IsCleanse(unit)
local MaxDuration = 0
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff and buff.count > 0 then
local BuffType = buff.type
if BuffType == 5 or BuffType == 8 or BuffType == 9 or BuffType == 12 or BuffType == 22 or BuffType == 23 or BuffType == 25 or BuffType == 32 then
local BuffDuration = buff.duration
if BuffDuration > MaxDuration then
MaxDuration = BuffDuration
end
end
end
end
return MaxDuration
end
function IsChainable(unit)
local MaxDuration = 0
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff and buff.count > 0 then
local BuffType = buff.type
if BuffType == 5 or BuffType == 8 or BuffType == 9 or BuffType == 12 or BuffType == 22 or BuffType == 23 or BuffType == 25 or BuffType == 32 or BuffType == 10 then
local BuffDuration = buff.duration
if BuffDuration > MaxDuration then
MaxDuration = BuffDuration
end
end
end
end
return MaxDuration
end
function GetEnemyHeroes()
for i = 1, Game.HeroCount() do
local Hero = Game.Hero(i)
if Hero.isEnemy then
table.insert(EnemyHeroes, Hero)
PrintChat(Hero.name)
end
end
--PrintChat("Got Enemy Heroes")
end
function GetEnemyBase()
for i = 1, Game.ObjectCount() do
local object = Game.Object(i)
if not object.isAlly and object.type == Obj_AI_SpawnPoint then
EnemySpawnPos = object
break
end
end
end
function GetAllyBase()
for i = 1, Game.ObjectCount() do
local object = Game.Object(i)
if object.isAlly and object.type == Obj_AI_SpawnPoint then
AllySpawnPos = object
break
end
end
end
function GetAllyHeroes()
for i = 1, Game.HeroCount() do
local Hero = Game.Hero(i)
if Hero.isAlly and Hero.charName ~= myHero.charName then
table.insert(AllyHeroes, Hero)
PrintChat(Hero.name)
end
end
--PrintChat("Got Enemy Heroes")
end
function GetBuffStart(unit, buffname)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff.name == buffname and buff.count > 0 then
return buff.startTime
end
end
return nil
end
function GetBuffExpire(unit, buffname)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff.name == buffname and buff.count > 0 then
return buff.expireTime
end
end
return nil
end
function GetBuffDuration(unit, buffname)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff.name == buffname and buff.count > 0 then
return buff.duration
end
end
return 0
end
function GetBuffStacks(unit, buffname)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff.name == buffname and buff.count > 0 then
return buff.count
end
end
return 0
end
local function GetWaypoints(unit) -- get unit's waypoints
local waypoints = {}
local pathData = unit.pathing
table.insert(waypoints, unit.pos)
local PathStart = pathData.pathIndex
local PathEnd = pathData.pathCount
if PathStart and PathEnd and PathStart >= 0 and PathEnd <= 20 and pathData.hasMovePath then
for i = pathData.pathIndex, pathData.pathCount do
table.insert(waypoints, unit:GetPath(i))
end
end
return waypoints
end
local function GetUnitPositionNext(unit)
local waypoints = GetWaypoints(unit)
if #waypoints == 1 then
return nil -- we have only 1 waypoint which means that unit is not moving, return his position
end
return waypoints[2] -- all segments have been checked, so the final result is the last waypoint
end
local function GetUnitPositionAfterTime(unit, time)
local waypoints = GetWaypoints(unit)
if #waypoints == 1 then
return unit.pos -- we have only 1 waypoint which means that unit is not moving, return his position
end
local max = unit.ms * time -- calculate arrival distance
for i = 1, #waypoints - 1 do
local a, b = waypoints[i], waypoints[i + 1]
local dist = GetDistance(a, b)
if dist >= max then
return Vector(a):Extended(b, dist) -- distance of segment is bigger or equal to maximum distance, so the result is point A extended by point B over calculated distance
end
max = max - dist -- reduce maximum distance and check next segments
end
return waypoints[#waypoints] -- all segments have been checked, so the final result is the last waypoint
end
function GetTarget(range)
if _G.SDK then
return _G.SDK.TargetSelector:GetTarget(range, _G.SDK.DAMAGE_TYPE_MAGICAL);
else
return _G.GOS:GetTarget(range,"AD")
end
end
function CalcRDmg(unit)
local Damage = 0
local Distance = GetDistance(myHero.pos, unit.pos)
local MathDist = math.floor(math.floor(Distance)/100)
local level = myHero:GetSpellData(_R).level
local BaseQ = ({25, 35, 45})[level] + 0.15 * myHero.bonusDamage
local QMissHeal = ({25, 30, 35})[level] / 100 * (unit.maxHealth - unit.health)
local dist = myHero.pos:DistanceTo(unit.pos)
if Distance < 100 then
Damage = BaseQ + QMissHeal
elseif Distance >= 1500 then
Damage = BaseQ * 10 + QMissHeal
else
Damage = ((((MathDist * 6) + 10) / 100) * BaseQ) + BaseQ + QMissHeal
end
return CalcPhysicalDamage(myHero, unit, Damage)
end
function GotBuff(unit, buffname)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
--PrintChat(buff.name)
if buff.name == buffname and buff.count > 0 then
return buff.count
end
end
return 0
end
function BuffActive(unit, buffname)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff.name == buffname and buff.count > 0 then
return true
end
end
return false
end
function IsReady(spell)
return myHero:GetSpellData(spell).currentCd == 0 and myHero:GetSpellData(spell).level > 0 and myHero:GetSpellData(spell).mana <= myHero.mana and Game.CanUseSpell(spell) == 0
end
function Mode()
if _G.SDK then
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_COMBO] then
return "Combo"
elseif _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_HARASS] or Orbwalker.Key.Harass:Value() then
return "Harass"
elseif _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LANECLEAR] or Orbwalker.Key.Clear:Value() then
return "LaneClear"
elseif _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LASTHIT] or Orbwalker.Key.LastHit:Value() then
return "LastHit"
elseif _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_FLEE] then
return "Flee"
end
else
return GOS.GetMode()
end
end
function GetItemSlot(unit, id)
for i = ITEM_1, ITEM_7 do
if unit:GetItemData(i).itemID == id then
return i
end
end
return 0
end
function IsFacing(unit)
local V = Vector((unit.pos - myHero.pos))
local D = Vector(unit.dir)
local Angle = 180 - math.deg(math.acos(V*D/(V:Len()*D:Len())))
if math.abs(Angle) < 80 then
return true
end
return false
end
function IsMyHeroFacing(unit)
local V = Vector((myHero.pos - unit.pos))
local D = Vector(myHero.dir)
local Angle = 180 - math.deg(math.acos(V*D/(V:Len()*D:Len())))
if math.abs(Angle) < 80 then
return true
end
return false
end
function SetMovement(bool)
if _G.PremiumOrbwalker then
_G.PremiumOrbwalker:SetAttack(bool)
_G.PremiumOrbwalker:SetMovement(bool)
elseif _G.SDK then
_G.SDK.Orbwalker:SetMovement(bool)
_G.SDK.Orbwalker:SetAttack(bool)
end
end
local function CheckHPPred(unit, SpellSpeed)
local speed = SpellSpeed
local range = myHero.pos:DistanceTo(unit.pos)
local time = range / speed
if _G.SDK and _G.SDK.Orbwalker then
return _G.SDK.HealthPrediction:GetPrediction(unit, time)
elseif _G.PremiumOrbwalker then
return _G.PremiumOrbwalker:GetHealthPrediction(unit, time)
end
end
local function IsValid(unit)
if (unit and unit.valid and unit.isTargetable and unit.alive and unit.visible and unit.networkID and unit.pathing and unit.health > 0) then
return true;
end
return false;
end
local function ClosestPointOnLineSegment(p, p1, p2)
local px = p.x
local pz = p.z
local ax = p1.x
local az = p1.z
local bx = p2.x
local bz = p2.z
local bxax = bx - ax
local bzaz = bz - az
local t = ((px - ax) * bxax + (pz - az) * bzaz) / (bxax * bxax + bzaz * bzaz)
if (t < 0) then
return p1, false
end
if (t > 1) then
return p2, false
end
return {x = ax + t * bxax, z = az + t * bzaz}, true
end
local function ValidTarget(unit, range)
if (unit and unit.valid and unit.isTargetable and unit.alive and unit.visible and unit.networkID and unit.pathing and unit.health > 0) then
if range then
if GetDistance(unit.pos) <= range then
return true;
end
else
return true
end
end
return false;
end
local function GetEnemyCount(range, pos)
local pos = pos.pos
local count = 0
for i, hero in pairs(EnemyHeroes) do
local Range = range * range
if GetDistanceSqr(pos, hero.pos) < Range and IsValid(hero) then
count = count + 1
end
end
return count
end
local function GetAllyCount(range, pos)
local pos = pos.pos
local count = 0
for i, hero in pairs(AllyHeroes) do
local Range = range * range
if GetDistanceSqr(pos, hero.pos) < Range and IsValid(hero) then
count = count + 1
end
end
return count
end
local function GetMinionCount(checkrange, range, pos)
local minions = _G.SDK.ObjectManager:GetEnemyMinions(checkrange)
local pos = pos.pos
local count = 0
for i = 1, #minions do
local minion = minions[i]
local Range = range * range
if GetDistanceSqr(pos, minion.pos) < Range and IsValid(minion) then
count = count + 1
end
end
return count
end
local function GetMinionCountLinear(checkrange, range, pos)
local minions = _G.SDK.ObjectManager:GetEnemyMinions(checkrange)
local count = 0
for i = 1, #minions do
local minion = minions[i]
local spellLine = ClosestPointOnLineSegment(minion.pos, myHero.pos, pos)
if GetDistance(minion.pos, spellLine) <= range and ValidTarget(minion) then
count = count + 1
end
end
return count
end
local function dnsTargetSelector(unit, range)
local fullDamUnit = (unit.totalDamage + unit.ap * 0.7)
local healthPercentUnit = (unit.health / unit.maxHealth)
local unitStrength = fullDamUnit / healthPercentUnit
local dtarget = nil
if dtarget ~= nil then
local fullDamdtarget = (dtarget.totalDamage + dtarget.ap * 0.7)
local healthPercentdtarget = (dtarget.health / dtarget.maxHealth)
local dtargetStrength = fullDamdtarget / healthPercentdtarget
end
if ValidTarget(unit, range) then
--PrintChat("target")
if dtarget == nil or unitStrength > dtargetStrength then
dtarget = unit
PrintChat(dtarget.charName)
end
end
return dtarget
end
function GetTurretShot(unit)
local turrets = _G.SDK.ObjectManager:GetTurrets(GetDistance(unit.pos) + 1000)
for i = 1, #turrets do
local turret = turrets[i]
if turret and turret.activeSpell.valid and turret.activeSpell.target == unit.handle and not turret.activeSpell.isStopped and turret.team == 300-myHero.team then
--PrintChat("turret shot")
return true
else
return false
end
end
end
local function GetWDmg(unit)
local Wdmg = getdmg("W", unit, myHero, 1)
local W2dmg = getdmg("W", unit, myHero, 2)
local buff = GetBuffData(unit, "kaisapassivemarker")
if buff and buff.count == 4 then
return (Wdmg+W2dmg)
else
return Wdmg
end
end
local function CastSpellMM(spell,pos,range,delay)
local castSpell = {state = 0, tick = GetTickCount(), casting = GetTickCount() - 1000, mouse = mousePos}
local range = range or math.huge
local delay = delay or 250
local ticker = GetTickCount()
if castSpell.state == 0 and GetDistance(myHero.pos,pos) < range and ticker - castSpell.casting > delay + Game.Latency() then
castSpell.state = 1
castSpell.mouse = mousePos
castSpell.tick = ticker
end
if castSpell.state == 1 then
if ticker - castSpell.tick < Game.Latency() then
local castPosMM = pos:ToMM()
Control.SetCursorPos(castPosMM.x,castPosMM.y)
Control.KeyDown(spell)
Control.KeyUp(spell)
castSpell.casting = ticker + delay
DelayAction(function()
if castSpell.state == 1 then
Control.SetCursorPos(castSpell.mouse)
castSpell.state = 0
end
end,Game.Latency()/1000)
end
if ticker - castSpell.casting > Game.Latency() then
Control.SetCursorPos(castSpell.mouse)
castSpell.state = 0
end
end
end
local function HitChanceConvert(menVal)
if menVal == 1 then
return 0
elseif menVal == 2 then
return 0.25
elseif menVal == 3 then
return 0.5
elseif menVal == 4 then
return 0.75
elseif menVal == 5 then
return 1
end
end
function GGCast(spell, target, spellprediction, hitchance)
if not (target or spellprediction) then
return false
end
if spellprediction == nil then
if target == nil then
Control.KeyDown(spell)
Control.KeyUp(spell)
return true
end
_G.Control.CastSpell(spell, target)
return true
end
if target == nil then
return false
end
spellprediction:GetPrediction(target, myHero)
if spellprediction:CanHit(hitchance or HITCHANCE_HIGH) and GetDistance(spellprediction.CastPosition, myHero.pos) < spellprediction.Range and GetDistance(spellprediction.CastPosition, target.pos) < 250 then
_G.Control.CastSpell(spell, spellprediction.CastPosition)
return true
end
return false
end
function dnsCast(spell, pos, prediction, hitchance)
local hitchance = hitchance or 0.1
if pos == nil and prediction == nil then
Control.KeyDown(spell)
Control.KeyUp(spell)
elseif prediction == nil then
if pos.pos:ToScreen().onScreen then
_G.Control.CastSpell(spell, pos)
else
CastSpellMM(spell, pos)
end
else
if prediction.type == "circular" then
local pred = _G.PremiumPrediction:GetPrediction(myHero, pos, prediction)
if pred.CastPos and pred.HitChance >= hitchance and GetDistance(pred.CastPos, myHero.pos) <= prediction.range then
if pred.CastPos:ToScreen().onScreen then
_G.Control.CastSpell(spell, pred.CastPos)
else
CastSpellMM(spell, pred.CastPos)
end
end
elseif prediction.type == "linear" then
local pred = _G.PremiumPrediction:GetPrediction(myHero, pos, prediction)
if pred.CastPos and pred.HitChance >= hitchance and GetDistance(pred.CastPos, myHero.pos) <= prediction.range then
if pred.CastPos:ToScreen().onScreen then
_G.Control.CastSpell(spell, pred.CastPos)
else
local CastSpot = myHero.pos:Extended(pred.CastPos, 800)
_G.Control.CastSpell(spell, CastSpot)
end
end
elseif prediction.type == "conic" then
local pred = _G.PremiumPrediction:GetPrediction(myHero, pos, prediction)
if pred.CastPos and pred.HitChance >= hitchance and GetDistance(pred.CastPos, myHero.pos) <= prediction.range then
if pred.CastPos:ToScreen().onScreen then
_G.Control.CastSpell(spell, pred.CastPos)
else
return
end
end
end
end
end
class "Manager"
function Manager:__init()
if myHero.charName == "Kaisa" then
DelayAction(function () self:LoadKaisa() end, 1.05)
end
if myHero.charName == "Caitlyn" then
DelayAction(function() self:LoadCaitlyn() end, 1.05)
end
if myHero.charName == "Tristana" then
DelayAction(function() self:LoadTristana() end, 1.05)
end
if myHero.charName == "Jinx" then
DelayAction(function() self:LoadJinx() end, 1.05)
end
if myHero.charName == "Senna" then
DelayAction(function() self:LoadSenna() end, 1.05)
end
end
function Manager:LoadKaisa()
Kaisa:Spells()
Kaisa:Menu()
Callback.Add("Tick", function() Kaisa:Tick() end)
Callback.Add("Draw", function() Kaisa:Draws() end)
if _G.SDK then
_G.SDK.Orbwalker:OnPreAttack(function(...) Kaisa:OnPreAttack(...) end)
_G.SDK.Orbwalker:OnPostAttackTick(function(...) Kaisa:OnPostAttackTick(...) end)
_G.SDK.Orbwalker:OnPostAttack(function(...) Kaisa:OnPostAttack(...) end)
end
end
function Manager:LoadCaitlyn()
Caitlyn:Spells()
Caitlyn:Menu()
--
--GetEnemyHeroes()
Callback.Add("Tick", function() Caitlyn:Tick() end)
Callback.Add("Draw", function() Caitlyn:Draw() end)
if _G.SDK then
_G.SDK.Orbwalker:OnPreAttack(function(...) Caitlyn:OnPreAttack(...) end)
_G.SDK.Orbwalker:OnPostAttackTick(function(...) Caitlyn:OnPostAttackTick(...) end)
_G.SDK.Orbwalker:OnPostAttack(function(...) Caitlyn:OnPostAttack(...) end)
end
end
function Manager:LoadTristana()
Tristana:Spells()
Tristana:Menu()
--
--GetEnemyHeroes()
Callback.Add("Tick", function() Tristana:Tick() end)
Callback.Add("Draw", function() Tristana:Draw() end)
if _G.SDK then
_G.SDK.Orbwalker:OnPreAttack(function(...) Tristana:OnPreAttack(...) end)
_G.SDK.Orbwalker:OnPostAttackTick(function(...) Tristana:OnPostAttackTick(...) end)
_G.SDK.Orbwalker:OnPostAttack(function(...) Tristana:OnPostAttack(...) end)
end
end
function Manager:LoadJinx()
Jinx:Spells()
Jinx:Menu()
Callback.Add("Tick", function() Jinx:Tick() end)
Callback.Add("Draw", function() Jinx:Draws() end)
end
function Manager:LoadSenna()
Senna:Spells()
Senna:Menu()
Callback.Add("Tick", function() Senna:Tick() end)
Callback.Add("Draw", function() Senna:Draws() end)
end
class "Kaisa"
local EnemyLoaded = false
local MinionsAround = count
local KaisaImg = "https://www.proguides.com/public/media/rlocal/champion/thumbnail/145.png"
local KaisaQImg = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/KaisaQ.png"
local KaisaWImg = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/KaisaW.png"
local KaisaEImg = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/KaisaE.png"
local KaisaRImg = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/KaisaR.png"
function Kaisa:Menu()
-- menu
self.Menu = MenuElement({type = MENU, id = "Kaisa", name = "dnsKai'Sa", leftIcon = KaisaImg})
-- q spell
self.Menu:MenuElement({id = "QSpell", name = "Q", type = MENU, leftIcon = KaisaQImg})
self.Menu.QSpell:MenuElement({id = "QCombo", name = "Combo", value = true, leftIcon = KaisaQImg})
self.Menu.QSpell:MenuElement({id = "QSpace1", name = "", type = SPACE})
self.Menu.QSpell:MenuElement({id = "QHarass", name = "Harass", value = false, leftIcon = KaisaQImg})
self.Menu.QSpell:MenuElement({id = "QHarassMana", name = "Harass Mana %", value = 40, min = 0, max = 100, identifier = "%", leftIcon = KaisaQImg})
self.Menu.QSpell:MenuElement({id = "QSpace2", name = "", type = SPACE})
self.Menu.QSpell:MenuElement({id = "QLaneClear", name = "LaneClear", value = true, leftIcon = KaisaQImg})
self.Menu.QSpell:MenuElement({id = "QLaneClearCount", name = "LaneClear when Q can hit atleast", value = 4, min = 1, max = 9, step = 1, leftIcon = KaisaQImg})
self.Menu.QSpell:MenuElement({id = "QLaneClearMana", name = "LaneClear Mana %", value = 60, min = 0, max = 100, identifier = "%", leftIcon = KaisaQImg})
self.Menu.QSpell:MenuElement({id = "QSpace3", name = "", type = SPACE})
-- w spell
self.Menu:MenuElement({id = "WSpell", name = "W", type = MENU, leftIcon = KaisaWImg})
self.Menu.WSpell:MenuElement({id = "WCombo", name = "Combo", value = true, leftIcon = KaisaWImg})
self.Menu.WSpell:MenuElement({id = "WSpace1", name = "", type = SPACE})
self.Menu.WSpell:MenuElement({id = "WHarass", name = "Harass", value = false, leftIcon = KaisaWImg})
self.Menu.WSpell:MenuElement({id = "WHarassMana", name = "Harass Mana %", value = 40, min = 0, max = 100, identifier = "%", leftIcon = KaisaWImg})
self.Menu.WSpell:MenuElement({id = "WSpace2", name = "", type = SPACE})
self.Menu.WSpell:MenuElement({id = "WLastHit", name = "LastHit Cannon when out of AA Range", value = true, leftIcon = KaisaWImg})
self.Menu.WSpell:MenuElement({id = "WSpace3", name = "", type = SPACE})
self.Menu.WSpell:MenuElement({id = "WKS", name = "KS", value = true, leftIcon = KaisaWImg})
self.Menu.WSpell:MenuElement({id = "WSpace4", name = "", type = SPACE})
-- e spell
self.Menu:MenuElement({id = "ESpell", name = "E", type = MENU, leftIcon = KaisaEImg})
self.Menu.ESpell:MenuElement({id = "ECombo", name = "Combo", value = true, leftIcon = KaisaEImg})
self.Menu.ESpell:MenuElement({id = "ESpace1", name = "", type = SPACE})
self.Menu.ESpell:MenuElement({id = "EFlee", name = "Flee", value = true, leftIcon = KaisaEImg})
self.Menu.ESpell:MenuElement({id = "ESpace2", name = "", type = SPACE})
self.Menu.ESpell:MenuElement({id = "EPeel", name = "Autopeel Meeledivers", value = true, leftIcon = KaisaEImg})
self.Menu.ESpell:MenuElement({id = "ESpace3", name = "", type = SPACE})
-- r spell
self.Menu:MenuElement({id = "RSpell", name = "R", type = MENU, leftIcon = KaisaRImg})
self.Menu.RSpell:MenuElement({id = "Sorry", name = "R is an automatical thingy", type = SPACE, leftIcon = KaisaRImg})
self.Menu.RSpell:MenuElement({id = "Sorry2", name = "I'm really sorry", type = SPACE, leftIcon = KaisaRImg})
-- draws
self.Menu:MenuElement({id = "Draws", name = "Draws", type = MENU})
self.Menu.Draws:MenuElement({id = "EnableDraws", name = "Enable", value = false})
self.Menu.Draws:MenuElement({id = "DrawsSpace1", name = "", type = SPACE})
self.Menu.Draws:MenuElement({id = "QDraw", name = "Q Range", value = false, leftIcon = KaisaQImg})
self.Menu.Draws:MenuElement({id = "WDraw", name = "W Range", value = false, leftIcon = KaisaWImg})
self.Menu.Draws:MenuElement({id = "RDraw", name = "R Range", value = false, leftIcon = KaisaRImg})
-- ranged helper
self.Menu:MenuElement({id = "rangedhelper", name = "Use RangedHelper", value = false})
end
function Kaisa:Draws()
if self.Menu.Draws.EnableDraws:Value() then
if self.Menu.Draws.QDraw:Value() then
Draw.Circle(myHero.pos, 600 + myHero.boundingRadius, 1, Draw.Color(255, 255, 0, 0))
end
if self.Menu.Draws.WDraw:Value() then
Draw.Circle(myHero.pos, 3000, 1, Draw.Color(255, 0, 255, 0))
end
if self.Menu.Draws.RDraw:Value() and myHero:GetSpellData(_R).level <= 1 then
Draw.Circle(myHero.pos, 1500, 1, Draw.Color(255, 255, 255, 255))
end
if self.Menu.Draws.RDraw:Value() and myHero:GetSpellData(_R).level == 2 then
Draw.Circle(myHero.pos, 2250, 1, Draw.Color(255, 255, 255, 255))
end
if self.Menu.Draws.RDraw:Value() and myHero:GetSpellData(_R).level == 3 then
Draw.Circle(myHero.pos, 3000, 1, Draw.Color(255, 255, 255, 255))
end
end
end
function Kaisa:CastingChecks()
if CastingW or CastingE or CastingR then
return false
else
return true
end
end
function Kaisa:Spells()
WSpellData = {speed = 1750, range = 1400, delay = 0.4, radius = 65, collision = {"minion"}, type = "linear"}
end
function Kaisa:Tick()
if _G.JustEvade and _G.JustEvade:Evading() or (_G.ExtLibEvade and _G.ExtLibEvade.Evading) or Game.IsChatOpen() or myHero.dead then return end
target = GetTarget(1400)
if target and ValidTarget(target) then
--PrintChat(target.pos:To2D())
--PrintChat(mousePos:To2D())
GaleMouseSpot = self:RangedHelper(target)
else
_G.SDK.Orbwalker.ForceMovement = nil
end
AARange = _G.SDK.Data:GetAutoAttackRange(myHero)
CastingQ = myHero.activeSpell.name == "KaisaQ"
CastingW = myHero.activeSpell.name == "KaisaW"
CastingE = myHero.activeSpell.name == "KaisaE"
CastingR = myHero.activeSpell.name == "KaisaR"
self:Logic()
self:Auto()
self:LastHit()
self:LaneClear()
if EnemyLoaded == false then
local CountEnemy = 0
for i, enemy in pairs(EnemyHeroes) do
CountEnemy = CountEnemy + 1
end
if CountEnemy < 1 then
GetEnemyHeroes()
else
EnemyLoaded = true
PrintChat("Enemy Loaded")
end
end
end
function Kaisa:CanUse(spell, mode)
local ManaPercent = myHero.mana / myHero.maxMana * 100
if mode == nil then
mode = Mode()
end
if spell == _Q then
if mode == "Combo" and IsReady(spell) and self.Menu.QSpell.QCombo:Value() then
return true
end
if mode == "Harass" and IsReady(spell) and self.Menu.QSpell.QHarass:Value() and ManaPercent > self.Menu.QSpell.QHarassMana:Value() then
return true
end
if mode == "LaneClear" and IsReady(spell) and self.Menu.QSpell.QLaneClear:Value() and ManaPercent > self.Menu.QSpell.QLaneClearMana:Value() then
return true
end
elseif spell == _W then
if mode == "Combo" and IsReady(spell) and self.Menu.WSpell.WCombo:Value() then
return true
end
if mode == "Harass" and IsReady(spell) and self.Menu.WSpell.WHarass:Value() and ManaPercent > self.Menu.WSpell.WHarassMana:Value() then
return true
end
if mode == "LastHit" and IsReady(spell) and self.Menu.WSpell.WLastHit:Value() then
return true
end
if mode == "KS" and IsReady(spell) and self.Menu.WSpell.WKS:Value() then
return true
end
elseif spell == _E then
if mode == "Combo" and IsReady(spell) and self.Menu.ESpell.ECombo:Value() then
return true
end
if mode == "Flee" and IsReady(spell) and self.Menu.ESpell.EFlee:Value() then
return true
end
if mode == "ChargePeel" and IsReady(spell) and self.Menu.ESpell.EPeel:Value() then
return true
end
end
return false
end
function Kaisa:Auto()
-- enemy loop
for i, enemy in pairs(EnemyHeroes) do
--w ks
local WRange = 2000 + myHero.boundingRadius + enemy.boundingRadius
if ValidTarget(enemy, WRange) and self:CanUse(_W, "KS") and self:CastingChecks() and not _G.SDK.Attack:IsActive() then
local WDamage = GetWDmg(enemy)
local pred = _G.PremiumPrediction:GetPrediction(myHero, enemy, WSpellData)
if pred.CastPos and pred.HitChance >= 0.7 and enemy.health <= WDamage then
Control.CastSpell(HK_W, pred.CastPos)
end
end
-- e peel
local Bedrohungsreichweite = 250 + myHero.boundingRadius + enemy.boundingRadius
if ValidTarget(enemy, Bedrohungsreichweite) and IsFacing(enemy) and not IsMyHeroFacing(enemy) and self:CanUse(_E, "ChargePeel") and self:CastingChecks() and not _G.SDK.Attack:IsActive() and enemy.activeSpell.target == myHero.handle then
Control.CastSpell(HK_E)
end
end
end
function Kaisa:Logic()
if target == nil then
return
end
local QRange = 600 + myHero.boundingRadius + target.boundingRadius
local WRange = 1400 + myHero.boundingRadius + target.boundingRadius
local ERange = 525 + 300 + myHero.boundingRadius + target.boundingRadius
if Mode() == "Combo" and target then
if ValidTarget(target, QRange) and self:CanUse(_Q, "Combo") and self:CastingChecks() and not _G.SDK.Attack:IsActive() then
Control.CastSpell(HK_Q)
end
if ValidTarget(target, WRange) and self:CanUse(_W, "Combo") and self:CastingChecks() and not _G.SDK.Attack:IsActive() then
local pred = _G.PremiumPrediction:GetPrediction(myHero, target, WSpellData)
if pred.CastPos and pred.HitChance >= 0.7 and GetBuffStacks(target, "kaisapassivemarker") >= 3 then
Control.CastSpell(HK_W, pred.CastPos)
end
end
if ValidTarget(target, ERange) and self:CanUse(_E, "Combo") and self:CastingChecks() and not _G.SDK.Attack:IsActive() then
if GetDistance(target.pos) > 550 + myHero.boundingRadius + target.boundingRadius and IsMyHeroFacing(target) then
Control.CastSpell(HK_E)
end
end
elseif Mode() == "Harass" and target then
if ValidTarget(target, QRange) and self:CanUse(_Q, "Harass") and self:CastingChecks() and not _G.SDK.Attack:IsActive() and not IsUnderEnemyTurret(myHero.pos) then
Control.CastSpell(HK_Q)
end
if ValidTarget(target, WRange) and self:CanUse(_W, "Harass") and self:CastingChecks() and not _G.SDK.Attack:IsActive() and not IsUnderEnemyTurret(myHero.pos) then
local pred = _G.PremiumPrediction:GetPrediction(myHero, target, WSpellData)
if pred.CastPos and pred.HitChance > 0.5 then
Control.CastSpell(HK_W, pred.CastPos)
end
end
elseif Mode() == "Flee" and target then
if ValidTarget(target, ERange) and self:CanUse(_E, "Flee") and self:CastingChecks() and not _G.SDK.Attack:IsActive() and not IsMyHeroFacing(enemy) then
Control.CastSpell(HK_E)
end
end
end
function Kaisa:LastHit()
if self:CanUse(_W, "LastHit") and (Mode == "LastHit" or Mode() == "LaneClear" or Mode() == "Harass") then
local minions = _G.SDK.ObjectManager:GetEnemyMinions(1400)
for i = 1, #minions do
local minion = minions[i]
if GetDistance(minion.pos) > 525 + myHero.boundingRadius and ValidTarget(minion, 1400 + myHero.boundingRadius) and (minion.charName == "SRU_ChaosMinionSiege" or minion.charName == "SRU_OrderMinionSiege") then
local WDamage = GetWDmg(minion)
if WDamage >= minion.health and self:CastingChecks() and not _G.SDK.Attack:IsActive() then
local pred = _G.PremiumPrediction:GetPrediction(myHero, minion, WSpellData)
if pred.CastPos and pred.HitChance >= 0.20 then
Control.CastSpell(HK_W, pred.CastPos)
end
end
end
end
end
end
function Kaisa:LaneClear()
local count = 0
if self:CanUse(_Q, "LaneClear") and Mode() == "LaneClear" then
local minions = _G.SDK.ObjectManager:GetEnemyMinions(600)
for i = 1, #minions do
local minion = minions[i]
if ValidTarget(minion, 600 + myHero.boundingRadius + minion.boundingRadius) then
count = count + 1
end
if MinionsAround >= self.Menu.QSpell.QLaneClearCount:Value() then
Control.CastSpell(HK_Q)
end
end
end
MinionsAround = count
end
function Kaisa:RangedHelper(unit)
local AARange = 525 + target.boundingRadius
local EAARangel = _G.SDK.Data:GetAutoAttackRange(unit)
local MoveSpot = nil
local RangeDif = AARange - EAARangel
local ExtraRangeDist = RangeDif
local ExtraRangeChaseDist = RangeDif - 100
local ScanDirection = Vector((myHero.pos-mousePos):Normalized())
local ScanDistance = GetDistance(myHero.pos, unit.pos) * 0.8
local ScanSpot = myHero.pos - ScanDirection * ScanDistance
local MouseDirection = Vector((unit.pos-ScanSpot):Normalized())
local MouseSpotDistance = EAARangel + ExtraRangeDist
if not IsFacing(unit) then
MouseSpotDistance = EAARangel + ExtraRangeChaseDist
end
if MouseSpotDistance > AARange then
MouseSpotDistance = AARange
end
local MouseSpot = unit.pos - MouseDirection * (MouseSpotDistance)
local MouseDistance = GetDistance(unit.pos, mousePos)
local GaleMouseSpotDirection = Vector((myHero.pos-MouseSpot):Normalized())
local GalemouseSpotDistance = GetDistance(myHero.pos, MouseSpot)
if GalemouseSpotDistance > 300 then
GalemouseSpotDistance = 300
end
local GaleMouseSpoty = myHero.pos - GaleMouseSpotDirection * GalemouseSpotDistance
MoveSpot = MouseSpot
if MoveSpot then
if GetDistance(myHero.pos, MoveSpot) < 50 or IsUnderEnemyTurret(MoveSpot) then
_G.SDK.Orbwalker.ForceMovement = nil
elseif self.Menu.rangedhelper:Value() and GetDistance(myHero.pos, unit.pos) <= AARange-50 and (Mode() == "Combo" or Mode() == "Harass") and self:CastingChecks() and MouseDistance < 750 then
_G.SDK.Orbwalker.ForceMovement = MoveSpot
else
_G.SDK.Orbwalker.ForceMovement = nil
end
end
return GaleMouseSpoty
end
function Kaisa:OnPostAttack(args)
end
function Kaisa:OnPostAttackTick(args)
end
function Kaisa:OnPreAttack(args)
end
function OnLoad()
Manager()
end
class "Caitlyn"
local EnemyLoaded = false
local EnemiesAround = count
local MinionsLaneClear = laneclearcount
local RAround = rcount
local CaitIcon = "https://www.proguides.com/public/media/rlocal/champion/thumbnail/51.png"
local CaitQIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/CaitlynPiltoverPeacemaker.png"
local CaitWIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/CaitlynYordleTrap.png"
local CaitEIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/CaitlynEntrapment.png"
local CaitRIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/CaitlynAceintheHole.png"
function Caitlyn:Menu()
self.Menu = MenuElement({type = MENU, id = "Caitlyn", name = "dnsCaitlyn", leftIcon = CaitIcon})
self.Menu:MenuElement({id = "QSpell", name = "Q", type = MENU, leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QCombo", name = "Combo", value = true, leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QComboHitChance", name = "HitChance", value = 0.5, min = 0.1, max = 1.0, step = 0.1, leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QHarass", name = "Harass", value = false, leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QHarassHitChance", name = "HitChance", value = 0.5, min = 0.1, max = 1.0, step = 0.1, leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QHarassMana", name = "Mana %", value = 40, min = 0, max = 100, identifier = "%", leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QLaneClear", name = "LaneClear", value = false, leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QLaneClearCount", name = "if HitCount is atleast", value = 5, min = 1, max = 9, step = 1, leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QLaneClearMana", name = "Mana %", value = 60, min = 0, max = 100, identifier = "%", leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QLastHit", name = "LastHit", value = true, leftIcon = CaitQIcon})
self.Menu.QSpell:MenuElement({id = "QKS", name = "KS", value = true, leftIcon = CaitQIcon})
self.Menu:MenuElement({id = "WSpell", name = "W", type = MENU, leftIcon = CaitWIcon})
self.Menu.WSpell:MenuElement({id = "WImmo", name = "Auto W immobile Targets", value = true, leftIcon = CaitWIcon})
self.Menu:MenuElement({id = "ESpell", name = "E", type = MENU, leftIcon = CaitEIcon})
self.Menu.ESpell:MenuElement({id = "ECombo", name = "Combo", value = true, leftIcon = CaitEIcon})
self.Menu.ESpell:MenuElement({id = "EComboHitChance", name = "HitChance", value = 1, min = 0.1, max = 1.0, step = 0.1, leftIcon = CaitEIcon})
self.Menu.ESpell:MenuElement({id = "EHarass", name = "Harass", value = false, leftIcon = CaitEIcon})
self.Menu.ESpell:MenuElement({id = "EHarassHitChance", name = "HitChance", value = 1, min = 0.1, max = 1.0, step = 0.1, leftIcon = CaitEIcon})
self.Menu.ESpell:MenuElement({id = "EHarassMana", name = "Mana %", value = 60, min = 0, max = 100, identifier = "%", leftIcon = CaitEIcon})
self.Menu.ESpell:MenuElement({id = "EGap", name = "Peel Meele Champs", value = true, leftIcon = CaitEIcon})
self.Menu:MenuElement({id = "RSpell", name = "R", type = MENU, leftIcon = CaitRIcon})
self.Menu.RSpell:MenuElement({id = "RKS", name = "KS", value = true, leftIcon = CaitRIcon})
self.Menu:MenuElement({id = "MakeDraw", name = "Nubody nees dravvs", type = MENU, leftIcon = CaitRIcon})
self.Menu.MakeDraw:MenuElement({id = "UseDraws", name = "U wanna hav dravvs?", value = false})
self.Menu.MakeDraw:MenuElement({id = "QDraws", name = "U wanna Q-Range dravvs?", value = false, leftIcon = CaitQIcon})
self.Menu.MakeDraw:MenuElement({id = "RDraws", name = "U wanna R-Range dravvs?", value = false, leftIcon = CaitRIcon})
self.Menu:MenuElement({id = "rangedhelper", name = "Use RangedHelper", value = false})
end
function Caitlyn:Spells()
QSpellData = {speed = 2200, range = 1300, delay = 0.625, radius = 50, collision = {}, type = "linear"}
WSpellData = {speed = math.huge, range = 800, delay = 0.25, radius = 65, collision = {}, type = "circular"}
ESpellData = {speed = 1600, range = 750, delay = 0.15, radius = 65, collision = {"minion"}, type = "linear"}
end
function Caitlyn:CastingChecks()
if not CastingQ or CastingW or CastingR then
return true
else
return false
end
end
function Caitlyn:Draw()
if self.Menu.MakeDraw.UseDraws:Value() then
if self.Menu.MakeDraw.QDraws:Value() then
Draw.Circle(myHero.pos, 1300, 1, Draw.Color(237, 255, 255, 255))
end
if self.Menu.MakeDraw.RDraws:Value() then
Draw.Circle(myHero.pos, 3500, 1, Draw.Color(237, 255, 255, 255))
end
end
end
function Caitlyn:Tick()
if _G.JustEvade and _G.JustEvade:Evading() or (_G.ExtLibEvade and _G.ExtLibEvade.Evading) or Game.IsChatOpen() or myHero.dead then return end
target = GetTarget(1400)
if target and ValidTarget(target) then
--PrintChat(target.pos:To2D())
--PrintChat(mousePos:To2D())
GaleMouseSpot = self:RangedHelper(target)
else
_G.SDK.Orbwalker.ForceMovement = nil
end
CastingQ = myHero.activeSpell.name == "CaitlynPiltoverPeacemaker"
CastingW = myHero.activeSpell.name == "CaitlynYordleTrap"
CastingE = myHero.activeSpell.name == "CaitlynEntrapment"
CastingR = myHero.activeSpell.name == "CaitlynAceintheHole"
self:Logic()
self:KS()
self:LastHit()
self:LaneClear()
if EnemyLoaded == false then
local CountEnemy = 0
for i, enemy in pairs(EnemyHeroes) do
CountEnemy = CountEnemy + 1
end
if CountEnemy < 1 then
GetEnemyHeroes()
else
EnemyLoaded = true
PrintChat("Enemy Loaded")
end
end
end
function Caitlyn:KS()
local rtarget = nil
local count = 0
for i, enemy in pairs(EnemyHeroes) do
local QRange = 1300 + enemy.boundingRadius
local RRange = 3500 + enemy.boundingRadius
local EPeelRange = 250 + enemy.boundingRadius
local WRange = 800 + enemy.boundingRadius
if GetDistance(enemy.pos) < 800 then
count = count + 1
--PrintChat(EnemiesAround)
end
if ValidTarget(enemy, RRange) and self:CanUse(_R,"KS") and GetDistance(myHero.pos, enemy.pos) > 900 + myHero.boundingRadius + enemy.boundingRadius and EnemiesAround == 0 and not IsUnderEnemyTurret(myHero.pos) and self:CastingChecks() and not _G.SDK.Attack:IsActive() then
local RDamage = getdmg("R", enemy, myHero, myHero:GetSpellData(_R).level)
if enemy.health <= RDamage then
rtarget = enemy
end
local rcount = 0
if rtarget ~= nil then
for j, enemy2 in pairs(EnemyHeroes) do
local RLine = ClosestPointOnLineSegment(enemy2.pos, myHero.pos, rtarget.pos)
if GetDistance(RLine, enemy2.pos) <= 500 then
rcount = rcount + 1
end
end
end
RAround = rcount
if RAround == 1 then
if enemy.pos:ToScreen().onScreen then
Control.CastSpell(HK_R, enemy.pos)
else
local MMSpot = Vector(enemy.pos):ToMM()
local MouseSpotBefore = mousePos
Control.SetCursorPos(MMSpot.x, MMSpot.y)
Control.KeyDown(HK_R); Control.KeyUp(HK_R)
DelayAction(function() Control.SetCursorPos(MouseSpotBefore) end, 0.20)
end
end
end
if ValidTarget(enemy, QRange) and self:CanUse(_Q, "KS") then
local QDamage = getdmg("Q", enemy, myHero, myHero:GetSpellData(_Q).level)
local pred = _G.PremiumPrediction:GetPrediction(myHero, enemy, QSpellData)
if pred.CastPos and _G.PremiumPrediction.HitChance.High(pred.HitChance) and enemy.health < QDamage and GetDistance(pred.CastPos) > 650 + myHero.boundingRadius + enemy.boundingRadius and Caitlyn:CastingChecks() and not _G.SDK.Attack:IsActive() then
Control.CastSpell(HK_Q, pred.CastPos)
end
end
if ValidTarget(enemy, WRange) and self:CanUse(_W, "TrapImmo") and self:CastingChecks() and not _G.SDK.Attack:IsActive() and (IsImmobile(enemy) > 0.5 or enemy.ms <= enemy.ms * 0.25) and not BuffActive(enemy, "caitlynyordletrapdebuff") then
local pred = _G.PremiumPrediction:GetPrediction(myHero, enemy, WSpellData)
if pred.CastPos and pred.HitChance >= 1 then
Control.CastSpell(HK_W, pred.CastPos)
end
end
if ValidTarget(enemy, EPeelRange) and self:CanUse(_E, "NetGap") and self:CastingChecks() and not _G.SDK.Attack:IsActive() and IsFacing(enemy) and not IsMyHeroFacing(enemy) and enemy.activeSpell.target == myHero.handle then
Control.CastSpell(HK_E, enemy)
end
if enemy and ValidTarget(enemy, 1300 + myHero.boundingRadius + enemy.boundingRadius) and (GetBuffDuration(enemy, "CaitlynEntrapmentMissile") > 0 or GetBuffDuration(enemy, "caitlynyordletrapdebuff") > 0) then
_G.SDK.Orbwalker.ForceTarget = enemy
else
_G.SDK.Orbwalker.ForceTarget = nil
end
end
EnemiesAround = count
end
function Caitlyn:CanUse(spell, mode)
local ManaPercent = myHero.mana / myHero.maxMana * 100
if mode == nil then
mode = Mode()
end
if spell == _Q then
if mode == "Combo" and IsReady(spell) and self.Menu.QSpell.QCombo:Value() then
return true
end
if mode == "Harass" and IsReady(spell) and self.Menu.QSpell.QHarass:Value() and ManaPercent > self.Menu.QSpell.QHarassMana:Value() then
return true
end
if mode == "LaneClear" and IsReady(spell) and self.Menu.QSpell.QLaneClear:Value() and ManaPercent > self.Menu.QSpell.QLaneClearMana:Value() then
return true
end
if mode == "KS" and IsReady(spell) and self.Menu.QSpell.QKS:Value() then
return true
end
if mode == "LastHit" and IsReady(spell) and self.Menu.QSpell.QLastHit:Value() then
return true
end
elseif spell == _W then
if mode == "TrapImmo" and IsReady(spell) and self.Menu.WSpell.WImmo:Value() then
return true
end
elseif spell == _E then
if mode == "Combo" and IsReady(spell) and self.Menu.ESpell.ECombo:Value() then
return true
end
if mode == "Harass" and IsReady(spell) and self.Menu.ESpell.EHarass:Value()and ManaPercent > self.Menu.ESpell.EHarassMana:Value() then
return true
end
if mode == "NetGap" and IsReady(spell) and self.Menu.ESpell.EGap:Value() then
return true
end
elseif spell == _R then
if mode == "KS" and IsReady(spell) and self.Menu.RSpell.RKS:Value() then
return true
end
end
return false
end
function Caitlyn:Logic()
if target == nil then
return
end
local maxQRange = 1300 + target.boundingRadius
local minQRange = 650 + target.boundingRadius
local ERange = 750 + target.boundingRadius
if Mode() == "Combo" and target then
if self:CanUse(_Q, "Combo") and ValidTarget(target, maxQRange) and Caitlyn:CastingChecks() and not _G.SDK.Attack:IsActive() and GetDistance(myHero.pos, target.pos) > minQRange then
local pred = _G.PremiumPrediction:GetPrediction(myHero, target, QSpellData)
if pred.CastPos and pred.HitChance > self.Menu.QSpell.QComboHitChance:Value() then
Control.CastSpell(HK_Q, pred.CastPos)
end
elseif self:CanUse(_Q, "Combo") and ValidTarget(target, maxQRange) and Caitlyn:CastingChecks() and (GetBuffDuration(target, "CaitlynEntrapmentMissile") >= 0.5 or GetBuffDuration(target, "caitlynyordletrapdebuff") >= 0.5) then
Control.CastSpell(HK_Q, target.pos)
end
if self:CanUse(_E, "Combo") and ValidTarget(target, ERange) and self:CastingChecks() and not _G.SDK.Attack:IsActive() then
local pred = _G.PremiumPrediction:GetPrediction(myHero, target, ESpellData)
if pred.CastPos and pred.HitChance > self.Menu.ESpell.EComboHitChance:Value() then
Control.CastSpell(HK_E, pred.CastPos)
end
elseif self:CanUse(_E, "Combo") and ValidTarget(target, ERange) and self:CastingChecks() and not _G.SDK.Attack:IsActive() and GetBuffDuration(target, "caitlynyordletrapdebuff") >= 0.5 then
local pred = _G.PremiumPrediction:GetPrediction(myHero, target, ESpellData)
if pred.CastPos and pred.HitChance > 0.5 then
Control.CastSpell(HK_E, pred.CastPos)
end
end
elseif Mode() == "Harass" and target then
if self:CanUse(_Q, "Harass") and ValidTarget(target, maxQRange) and self:CastingChecks() and not _G.SDK.Attack:IsActive() and GetDistance(myHero.pos, target.pos) > minQRange and not IsUnderEnemyTurret(myHero.pos) then
local pred = _G.PremiumPrediction:GetPrediction(myHero, target, QSpellData)
if pred.CastPos and pred.HitChance > self.Menu.QSpell.QHarassHitChance:Value() then
Control.CastSpell(HK_Q, pred.CastPos)
end
elseif self:CanUse(_Q, "Harass") and ValidTarget(target, maxQRange) and self:CastingChecks() and not _G.SDK.Attack:IsActive() and (GetBuffDuration(target, "CaitlynEntrapmentMissile") >= 0.5 or GetBuffDuration(target, "caitlynyordletrapdebuff") >= 0.5) and not IsUnderEnemyTurret(myHero.pos) then
Control.CastSpell(HK_Q, target.pos)
end
if self:CanUse(_E, "Harass") and ValidTarget(target, ERange) and self:CastingChecks() and not _G.SDK.Attack:IsActive() and not IsUnderEnemyTurret(myHero.pos) then
local pred = _G.PremiumPrediction:GetPrediction(myHero, target, ESpellData)
if pred.CastPos and pred.HitChance > self.Menu.ESpell.EHarassHitChanceHitChance:Value() then
Control.CastSpell(HK_E, pred.CastPos)
end
elseif self:CanUse(_E, "Harass") and ValidTarget(target, ERange) and self:CastingChecks() and not _G.SDK.Attack:IsActive() and GetBuffDuration(target, "caitlynyordletrapdebuff") >= 0.5 and not IsUnderEnemyTurret(myHero.pos) then
local pred = _G.PremiumPrediction:GetPrediction(myHero, target, ESpellData)
if pred.CastPos and pred.HitChance > 0.5 then
Control.CastSpell(HK_E, pred.CastPos)
end
end
end
end
function Caitlyn:LastHit()
if self:CanUse(_Q, "LastHit") and (Mode() == "LastHit" or Mode() == "Harass") then
local minions = _G.SDK.ObjectManager:GetEnemyMinions(1300)
for i = 1, #minions do
local minion = minions[i]
local QDam = getdmg("Q", minion, myHero, myHero:GetSpellData(_Q).level)
local EDam = getdmg("E", minion, myHero, myHero:GetSpellData(_E).level)
if GetDistance(minion.pos) > 650 and ValidTarget(minion, 1300) and (minion.charName == "SRU_ChaosMinionSiege" or minion.charName == "SRU_OrderMinionSiege") and self:CastingChecks() and not _G.SDK.Attack:IsActive() then
local pred = _G.PremiumPrediction:GetPrediction(myHero, minion, QSpellData)
if QDam >= minion.health and pred.CastPos and pred.HitChance > 0.20 then
Control.CastSpell(HK_Q, pred.CastPos)
end
end
end
end
end
function Caitlyn:LaneClear()
if self:CanUse(_Q, "LaneClear") and Mode() == "LaneClear" then
local minions = _G.SDK.ObjectManager:GetEnemyMinions(1300)
for i = 1, #minions do
local minion = minions[i]
if ValidTarget(minion, 1300 + myHero.boundingRadius) then
mainminion = minion
end
local laneclearcount = 0
for j = 1, #minions do
local minion2 = minions[j]
local MinionNear = ClosestPointOnLineSegment(minion2.pos, myHero.pos, mainminion.pos)
if GetDistance(MinionNear, minion2.pos) < 120 then
laneclearcount = laneclearcount + 1
end
end
MinionsLaneClear = laneclearcount
if MinionsLaneClear >= self.Menu.QSpell.QLaneClearCount:Value() then
Control.CastSpell(HK_Q, mainminion.pos)
end
end
end
end
function Caitlyn:RangedHelper(unit)
local AARange = 625 + target.boundingRadius
local EAARangel = _G.SDK.Data:GetAutoAttackRange(unit)
local MoveSpot = nil
local RangeDif = AARange - EAARangel
local ExtraRangeDist = RangeDif
local ExtraRangeChaseDist = RangeDif - 100
local ScanDirection = Vector((myHero.pos-mousePos):Normalized())
local ScanDistance = GetDistance(myHero.pos, unit.pos) * 0.8
local ScanSpot = myHero.pos - ScanDirection * ScanDistance
local MouseDirection = Vector((unit.pos-ScanSpot):Normalized())
local MouseSpotDistance = EAARangel + ExtraRangeDist
if not IsFacing(unit) then
MouseSpotDistance = EAARangel + ExtraRangeChaseDist
end
if MouseSpotDistance > AARange then
MouseSpotDistance = AARange
end
local MouseSpot = unit.pos - MouseDirection * (MouseSpotDistance)
local MouseDistance = GetDistance(unit.pos, mousePos)
local GaleMouseSpotDirection = Vector((myHero.pos-MouseSpot):Normalized())
local GalemouseSpotDistance = GetDistance(myHero.pos, MouseSpot)
if GalemouseSpotDistance > 300 then
GalemouseSpotDistance = 300
end
local GaleMouseSpoty = myHero.pos - GaleMouseSpotDirection * GalemouseSpotDistance
MoveSpot = MouseSpot
if MoveSpot then
if GetDistance(myHero.pos, MoveSpot) < 50 or IsUnderEnemyTurret(MoveSpot) then
_G.SDK.Orbwalker.ForceMovement = nil
elseif self.Menu.rangedhelper:Value() and GetDistance(myHero.pos, unit.pos) <= AARange-50 and (Mode() == "Combo" or Mode() == "Harass") and self:CastingChecks() and MouseDistance < 750 then
_G.SDK.Orbwalker.ForceMovement = MoveSpot
else
_G.SDK.Orbwalker.ForceMovement = nil
end
end
return GaleMouseSpoty
end
function Caitlyn:OnPostAttack(args)
end
function Caitlyn:OnPostAttackTick(args)
end
function Caitlyn:OnPreAttack(args)
end
function OnLoad()
Manager()
end
class "Tristana"
local EnemyLoaded = false
local TristIcon = "https://www.proguides.com/public/media/rlocal/champion/thumbnail/18.png"
local TristQIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/TristanaQ.png"
local TristWIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/TristanaW.png"
local TristEIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/TristanaE.png"
local TristRIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/TristanaR.png"
function Tristana:Menu()
self.Menu = MenuElement({type = MENU, id = "dnsTristana", name = "dnsTristana", leftIcon = TristIcon})
-- main menu
self.Menu:MenuElement({id = "combo", name = "Combo", type = MENU})
self.Menu:MenuElement({id = "harass", name = "Harass", type = MENU})
self.Menu:MenuElement({id = "laneclear", name = "LaneClear", type = MENU})
self.Menu:MenuElement({id = "auto", name = "Auto", type = MENU})
self.Menu:MenuElement({id = "draws", name = "Draws", type = MENU})
self.Menu:MenuElement({id = "rangedhelper", name = "Use RangedHelper", value = false})
-- combo
self.Menu.combo:MenuElement({id = "qcombo", name = "Use Q in Combo", value = true, leftIcon = TristQIcon})
self.Menu.combo:MenuElement({id = "qcomboe", name = "Only Q when E", value = true, leftIcon = TristQIcon})
self.Menu.combo:MenuElement({id = "ecombo", name = "Use E in Combo", value = true, leftIcon = TristEIcon})
-- harass
self.Menu.harass:MenuElement({id = "qharass", name = "Use Q in Harass", value = true, leftIcon = TristQIcon})
self.Menu.harass:MenuElement({id = "qharasse", name = "Only Q when E", value = true, leftIcon = TristQIcon})
self.Menu.harass:MenuElement({id = "qharassmana", name = "Q Harass Mana", value = 40, min = 5, max = 95, step = 5, identifier = "%", leftIcon = TristQIcon})
self.Menu.harass:MenuElement({id = "eharass", name = "Use E in Harass", value = true, leftIcon = TristEIcon})
self.Menu.harass:MenuElement({id = "eharassmana", name = "E Harass Mana", value = 40, min = 5, max = 95, step = 5, identifier = "%", leftIcon = TristEIcon})
-- laneclear
self.Menu.laneclear:MenuElement({id = "qlaneclear", name = "Use Q in LaneClear", value = true, leftIcon = TristQIcon})
self.Menu.laneclear:MenuElement({id = "qlaneclearcount", name = "Q LaneClear Minions", value = 6, min = 1, max = 9, step = 1, leftIcon = TristQIcon})
self.Menu.laneclear:MenuElement({id = "qlaneclearmana", name = "Q LaneClear Mana", value = 60, min = 5, max = 95, step = 5, identifier = "%", leftIcon = TristQIcon})
-- auto
self.Menu.auto:MenuElement({id = "rks", name = "Use R to KS", value = true, leftIcon = TristRIcon})
self.Menu.auto:MenuElement({id = "wrks", name = "Use W + R to KS", value = true, leftIcon = TristWIcon})
self.Menu.auto:MenuElement({id = "wrksspace", name = "To Use WRKS, normal RKS needs to be ticked", type = SPACE, leftIcon = TristRIcon})
self.Menu.auto:MenuElement({id = "rpeel", name = "Use R to Peel", value = true, leftIcon = TristRIcon})
self.Menu.auto:MenuElement({id = "rpeelhp", name = "If HP is lower then", value = 40, min = 5, max = 95, step = 5, identifier = "%", leftIcon = TristRIcon})
-- draws
self.Menu.draws:MenuElement({id = "qtimer", name = "Draw Q Timer", value = false, leftIcon = TristQIcon})
self.Menu.draws:MenuElement({id = "wdraw", name = "Draw W Range", value = false, leftIcon = TristWIcon})
self.Menu.draws:MenuElement({id = "anydraw", name = "Draw AA/E/R Range", value = false, leftIcon = TristEIcon})
end
function Tristana:Draw()
local anyrange = 517 + (8 * myHero.levelData.lvl) + myHero.boundingRadius
-- w draws
if self.Menu.draws.wdraw:Value() then
Draw.Circle(myHero.pos, 850 + myHero.boundingRadius, 2, Draw.Color(255, 23, 230, 220))
end
-- q timer
local QBuffDuration = GetBuffDuration(myHero, "TristanaQ")
if self.Menu.draws.qtimer:Value() and BuffActive(myHero, "TristanaQ") then
DrawTextOnHero(myHero, QBuffDuration, Draw.Color(255, 23, 230, 220))
end
--AAER draw
if self.Menu.draws.anydraw:Value() then
Draw.Circle(myHero.pos, anyrange, 2, Draw.Color(255, 49, 203, 100))
end
end
function Tristana:Spells()
WSpellData = {speed = 1100, range = 850 + myHero.boundingRadius, delay = 0.25, radius = 350, collision = {}, type = "circular" }
end
function Tristana:Tick()
if _G.JustEvade and _G.JustEvade:Evading() or (_G.ExtLibEvade and _G.ExtLibEvade.Evading) or Game.IsChatOpen() or myHero.dead then return end
target = GetTarget(1400)
AARange = _G.SDK.Data:GetAutoAttackRange(myHero)
if target and ValidTarget(target) then
--PrintChat(target.pos:To2D())
--PrintChat(mousePos:To2D())
GaleMouseSpot = self:RangedHelper(target)
else
_G.SDK.Orbwalker.ForceMovement = nil
end
-- casting checks
CastingQ = myHero.activeSpell.name == "TristanaQ"
CastingW = myHero.activeSpell.name == "TristanaW"
CastingE = myHero.activeSpell.name == "TristanaE"
CastingR = myHero.activeSpell.name == "TristanaR"
self:Auto()
self:Logic()
self:LaneClear()
if EnemyLoaded == false then
local CountEnemy = 0
for i, enemy in pairs(EnemyHeroes) do
CountEnemy = CountEnemy + 1
end
if CountEnemy < 1 then
GetEnemyHeroes()
else
EnemyLoaded = true
PrintChat("Enemy Loaded")
end
end
end
function Tristana:CastingChecks()
if not CastingE and not CastingR then
return true
else
return false
end
end
function Tristana:CanUse(spell, mode)
local ManaPercent = myHero.mana / myHero.maxMana * 100
local HPPercent = myHero.health / myHero.maxHealth
if mode == nil then
mode = Mode()
end
if spell == _Q then
if mode == "Combo" and IsReady(_Q) and self.Menu.combo.qcombo:Value() then
return true
end
if mode == "Harass" and IsReady(_Q) and self.Menu.harass.qharass:Value() and ManaPercent >= self.Menu.harass.qharassmana:Value() then
return true
end
if mode == "LaneClear" and IsReady(_Q) and self.Menu.laneclear.qlaneclear:Value() and ManaPercent >= self.Menu.laneclear.qlaneclearmana:Value() then
return true
end
elseif spell == _W then
if mode == "WRKS" and IsReady(_W) and self.Menu.auto.wrks:Value() then
return true
end
elseif spell == _E then
if mode == "Combo" and IsReady(_E) and self.Menu.combo.ecombo:Value() then
return true
end
if mode == "Harass" and IsReady(_E) and self.Menu.harass.eharass:Value() and ManaPercent >= self.Menu.harass.eharassmana:Value() then
return true
end
if mode == "Tower" and IsReady(_E) and self.Menu.laneclear.etower:Value() and ManaPercent >= self.Menu.laneclear.etowermana:Value() then
return true
end
elseif spell == _R then
if mode == "KS" and IsReady(_R) and self.Menu.auto.rks:Value() then
return true
end
if mode == "WRKS" and IsReady(_R) and self.Menu.auto.wrks:Value() then
return true
end
if mode == "Peel" and IsReady(_R) and self.Menu.auto.rpeel:Value() and HPPercent <= self.Menu.auto.rpeelhp:Value() / 100 then
return true
end
end
return false
end
function Tristana:EDMG(unit)
local eLvl = myHero:GetSpellData(_E).level
if eLvl > 0 then
local raw = ({ 154, 176, 198, 220, 242 })[eLvl]
local m = ({ 1.1, 1.65, 2.2, 2.75, 3.3 })[eLvl]
local bonusDmg = (m * myHero.bonusDamage) + (1.1 * myHero.ap)
local FullDmg = raw + bonusDmg
return CalcPhysicalDamage(myHero, unit, FullDmg)
end
end
function Tristana:Auto()
for i, enemy in pairs(EnemyHeroes) do
local WRange = 850 + myHero.boundingRadius + enemy.boundingRadius
local AAERRange = 517 + (8 * myHero.levelData.lvl) + myHero.boundingRadius + enemy.boundingRadius
-- rks
if enemy and ValidTarget(enemy, AAERRange) and self:CanUse(_R, "KS") and self:CastingChecks() and myHero.attackData.state ~= 2 then
local EDamage = self:EDMG(enemy)
local RDamage = getdmg("R", enemy, myHero, myHero:GetSpellData(_R).level)
if GetBuffStacks(enemy, "tristanaecharge") >= 3 and enemy.health <= RDamage + EDamage or enemy.health <= RDamage then
Control.CastSpell(HK_R, enemy)
end
end
--wrks
if enemy and ValidTarget(enemy, AAERRange + WRange - 100) and GetDistance(enemy.pos, myHero.pos) > AAERRange + 50 and self:CanUse(_R, "WRKS") and self:CanUse(_W, "WRKS") and self:CastingChecks() and myHero.attackData.state ~= 2 then
local EDamage = self:EDMG(enemy)
local RDamage = getdmg("R", enemy, myHero, myHero:GetSpellData(_R).level)
if (GetBuffStacks(enemy, "tristanaecharge") >= 3 and enemy.health <= RDamage + EDamage or enemy.health <= RDamage) then
local Direction = Vector((enemy.pos-myHero.pos):Normalized())
local WSpot = enemy.pos - Direction * (AAERRange - 50)
Control.CastSpell(HK_W, WSpot)
end
end
-- r peel
if enemy and ValidTarget(enemy, 250 + myHero.boundingRadius + enemy.boundingRadius) and self:CanUse(_R, "Peel") and IsFacing(enemy) and not IsMyHeroFacing(enemy) and self:CastingChecks() and enemy.activeSpell.target == myHero.handle and enemy.activeSpell.valid and enemy.activeSpell.spellWasCast then
Control.CastSpell(HK_R, enemy)
end
-- force target
if enemy and ValidTarget(enemy, AAERRange) and GetBuffDuration(enemy, "tristanaechargesound") > 0 then
_G.SDK.Orbwalker.ForceTarget = enemy
else
_G.SDK.Orbwalker.ForceTarget = nil
end
end
end
function Tristana:Logic()
if target == nil then return end
local WRange = 850 + myHero.boundingRadius + target.boundingRadius
local AAERRange = 517 + (8 * myHero.levelData.lvl) + myHero.boundingRadius + target.boundingRadius
if Mode() == "Combo" and target then
if target and ValidTarget(target, AAERRange) and self:CanUse(_E, "Combo") and myHero.attackData.state ~= 2 and self:CastingChecks() then
Control.CastSpell(HK_E, target)
end
if target and ValidTarget(target, AAERRange) and self:CanUse(_Q, "Combo") and self.Menu.combo.qcomboe:Value() and GetBuffDuration(target, "tristanaechargesound") >= 0.5 and self:CastingChecks() and myHero.attackData.state == 2 then
Control.CastSpell(HK_Q)
elseif target and ValidTarget(target, AAERRange) and self:CanUse(_Q, "Combo") and not self.Menu.combo.qcomboe:Value() and self:CastingChecks() and myHero.attackData.state == 2 then
Control.CastSpell(HK_Q)
end
end
if Mode() == "Harass" and target then
if target and ValidTarget(target, AAERRange) and self:CanUse(_E, "Harass") and myHero.attackData.state ~= 2 and self.CastingChecks() then
Control.CastSpell(HK_E, target)
end
if target and ValidTarget(target, AAERRange) and self:CanUse(_Q, "Harass") and self.Menu.harass.qharasse.Value() and GetBuffDuration(target, "tristanaechargesound") >= 0.5 and self:CastingChecks() and myHero.attackData.state == 2 then
Control.CastSpell(HK_Q)
elseif target and ValidTarget(target, AAERRange) and self:CanUse(_Q, "Harass") and not self.Menu.harass.qharasse.Value() and self:CastingChecks() and myHero.attackData.state == 2 then
Control.CastSpell(HK_Q)
end
end
end
function Tristana:LaneClear()
local qcount = 0
if Mode() == "LaneClear" then
local minions = _G.SDK.ObjectManager:GetEnemyMinions(1300)
for i = 1, #minions do
local minion = minions[i]
local WRange = 850 + myHero.boundingRadius + minion.boundingRadius
local AAERRange = 517 + (8 * myHero.levelData.lvl) + myHero.boundingRadius + minion.boundingRadius
--laneclear q
if minion and ValidTarget(minion, AAERRange + 100) and self:CanUse(_Q, "LaneClear") then
qcount = qcount + 1
--PrintChat(qcount)
end
if qcount >= self.Menu.laneclear.qlaneclearcount:Value() and myHero.attackData.state == 2 then
Control.CastSpell(HK_Q)
end
end
end
end
function Tristana:RangedHelper(unit)
local AARange = 517 + (8 * myHero.levelData.lvl) + myHero.boundingRadius + target.boundingRadius
local EAARangel = _G.SDK.Data:GetAutoAttackRange(unit)
local MoveSpot = nil
local RangeDif = AARange - EAARangel
local ExtraRangeDist = RangeDif
local ExtraRangeChaseDist = RangeDif - 100
local ScanDirection = Vector((myHero.pos-mousePos):Normalized())
local ScanDistance = GetDistance(myHero.pos, unit.pos) * 0.8
local ScanSpot = myHero.pos - ScanDirection * ScanDistance
local MouseDirection = Vector((unit.pos-ScanSpot):Normalized())
local MouseSpotDistance = EAARangel + ExtraRangeDist
if not IsFacing(unit) then
MouseSpotDistance = EAARangel + ExtraRangeChaseDist
end
if MouseSpotDistance > AARange then
MouseSpotDistance = AARange
end
local MouseSpot = unit.pos - MouseDirection * (MouseSpotDistance)
local MouseDistance = GetDistance(unit.pos, mousePos)
local GaleMouseSpotDirection = Vector((myHero.pos-MouseSpot):Normalized())
local GalemouseSpotDistance = GetDistance(myHero.pos, MouseSpot)
if GalemouseSpotDistance > 300 then
GalemouseSpotDistance = 300
end
local GaleMouseSpoty = myHero.pos - GaleMouseSpotDirection * GalemouseSpotDistance
MoveSpot = MouseSpot
if MoveSpot then
if GetDistance(myHero.pos, MoveSpot) < 50 or IsUnderEnemyTurret(MoveSpot) then
_G.SDK.Orbwalker.ForceMovement = nil
elseif self.Menu.rangedhelper:Value() and GetDistance(myHero.pos, unit.pos) <= AARange-50 and (Mode() == "Combo" or Mode() == "Harass") and self:CastingChecks() and MouseDistance < 750 then
_G.SDK.Orbwalker.ForceMovement = MoveSpot
else
_G.SDK.Orbwalker.ForceMovement = nil
end
end
return GaleMouseSpoty
end
function Tristana:OnPostAttack(args)
end
function Tristana:OnPostAttackTick(args)
end
function Tristana:OnPreAttack(args)
end
function OnLoad()
Manager()
end
class "Jinx"
local EnemyLoaded = false
-- ranges
local BaseAARange = 580
local AARange = 0
local QRange = 0
local QCheckRange = 0
local WRange = 1450
local ERange = 900
local RRange = 20000
-- buffs
local powpow = "jinxqicon"
local fishbones = "JinxQ"
-- icons
local ChampIcon = "https://www.proguides.com/public/media/rlocal/champion/thumbnail/222.png"
local QIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/JinxQ.png"
local WIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/JinxW.png"
local EIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/JinxE.png"
local RIcon = "https://www.proguides.com/public/media/rlocal/champion/ability/thumbnail/JinxR.png"
-- counts
local ComboTimer = 0
local Timer = Game.Timer()
local QLaneClearCount = nil
function Jinx:Menu()
self.Menu = MenuElement({type = MENU, id = "jinx", name = "dnsJinx", leftIcon = ChampIcon})
-- Combo
self.Menu:MenuElement({id = "combo", name = "Combo", type = MENU})
self.Menu.combo:MenuElement({id = "qcombo", name = "Use [Q] in Combo", value = true, leftIcon = QIcon})
self.Menu.combo:MenuElement({id = "wcombo", name = "Use [W] in Combo", value = true, leftIcon = WIcon})
self.Menu.combo:MenuElement({id = "wcombohc", name = "[W] HitChance", value = 2, drop = {"Normal", "High", "Immobile"}, leftIcon = WIcon})
self.Menu.combo:MenuElement({id = "wcomboaa", name = "Use [W] only if Target is out of [AA] Range", value = true, leftIcon = WIcon})
self.Menu.combo:MenuElement({id = "ecombo", name = "Use [E] in Combo", value = true, leftIcon = EIcon})
self.Menu.combo:MenuElement({id = "ecombohc", name = "[E] HitChance", value = 2, drop = {"Normal", "High", "Immobile"}, leftIcon = EIcon})
self.Menu.combo:MenuElement({id = "rcombo", name = "Use [R] in Combo", value = true, leftIcon = RIcon})
self.Menu.combo:MenuElement({id = "rcombohc", name = "[R] HitChance", value = 2, drop = {"Normal", "High", "Immobile"}, leftIcon = RIcon})
self.Menu.combo:MenuElement({id = "rcombocount", name = "[R] HitCount", value = 3, min = 1, max = 5, step = 1, leftIcon = RIcon})
self.Menu.combo:MenuElement({id = "rcomboaa", name = "Use [R] if Target is out of [AA] Range", value = true, leftIcon = RIcon})
self.Menu.combo:MenuElement({id = "rcomborange", name = "[R] Range", value = 3000, min = 500, max = 20000, step = 500, leftIcon = RIcon})
self.Menu.combo:MenuElement({id ="rsemi", name = "Semi [R] Key", value = false, key = string.byte("T"), leftIcon = RIcon})
-- lasthit
self.Menu:MenuElement({id = "lasthit", name = "LastHit", type = MENU})
self.Menu.lasthit:MenuElement({id = "wlasthit", name = "Use [W] to LastHit Cannon out of [AA] Range", value = true, leftIcon = WIcon})
self.Menu.lasthit:MenuElement({id = "wlasthitmana", name = "[W] Mana", value = 20, min = 5, max = 100, step = 5, leftIcon = WIcon})
-- laneclear
self.Menu:MenuElement({id = "laneclear", name = "LaneClear", type = MENU})
self.Menu.laneclear:MenuElement({id = "qlaneclear", name = "Use [Q2] in LaneClear (BETA)", value = true, leftIcon = QIcon})
self.Menu.laneclear:MenuElement({id = "qlaneclearcount", name = "[Q2] HitCount", value = 3, min = 1, max = 7, step = 1, leftIcon = QIcon})
self.Menu.laneclear:MenuElement({id = "qlaneclearmana", name = "[Q2] Mana", value = 40, min = 5, max = 100, step = 5, leftIcon = QIcon})
-- auto
self.Menu:MenuElement({id = "auto", name = "Auto", type = MENU})
self.Menu.auto:MenuElement({id = "wauto", name = "[W] KS", value = true, leftIcon = WIcon})
self.Menu.auto:MenuElement({id = "eauto", name = "[E] Dash/Runedown Interrupt (BETA)", value = true, leftIcon = EIcon})
self.Menu.auto:MenuElement({id = "rauto", name = "[R] KS", value = true, leftIcon = RIcon})
self.Menu.auto:MenuElement({id = "rautorange", name = "[R] KS Range", value = 3000, min = 500, max = 20000, step = 500, leftIcon = RIcon})
-- draws
self.Menu:MenuElement({id = "draws", name = "Draws", type = MENU})
self.Menu.draws:MenuElement({id = "rangetoggle", name = "Print [Q] state on Hero", value = true, leftIcon = QIcon})
self.Menu.draws:MenuElement({id = "qdraw", name = "Draw [AA] Range", value = false, leftIcon = QIcon})
self.Menu.draws:MenuElement({id = "wdraw", name = "Draw [W] Range", value = false, leftIcon = WIcon})
self.Menu.draws:MenuElement({id = "edraw", name = "Draw [E] Range", value = false, leftIcon = EIcon})
-- range helper
self.Menu:MenuElement({id = "movehelper", name = "RangeHelper", value = false})
end
function Jinx:Draws()
if self.Menu.draws.rangetoggle:Value() and myHero:GetSpellData(_Q).level > 0 then
if BuffActive(myHero, powpow) then
DrawTextOnHero(myHero, "POW-POW", Draw.Color(255, 229, 73, 156))
elseif BuffActive(myHero, fishbones) then
DrawTextOnHero(myHero, "FISHBONES", Draw.Color(255, 114, 139, 240))
end
end
if self.Menu.draws.qdraw:Value() then
Draw.Circle(myHero, AARange, 2, Draw.Color(255, 255, 0, 0))
end
if self.Menu.draws.wdraw:Value() then
Draw.Circle(myHero, WRange, 2, Draw.Color(255, 0, 255, 0))
end
if self.Menu.draws.edraw:Value() then
Draw.Circle(myHero, ERange, 2, Draw.Color(255, 255, 255, 0))
end
end
function Jinx:Spells()
WSpell = {speed = 3300, delay = 0.6, range = WRange, radius = 50, collision = {"minion"}, type = "linear"}
ESpell = {speed = math.huge, delay = 0.9, range = ERange, radius = 50, collision = {}, type = "circular"}
RSpell = {speed = 1950, delay = 0.6, range = RRange, radius = 50, collision = {}, type = "linear"}
W = GGPrediction:SpellPrediction({Type = GGPrediction.SPELLTYPE_LINE, Speed = 3300, Delay = 0.6, Radius = 60, Range = 1450, Collision = true, MaxCollision = 0, CollisionTypes = {GGPrediction.COLLISION_MINION}})
E = GGPrediction:SpellPrediction({Type = GGPrediction.SPELLTYPE_CIRCLE, Speed = math.huge, Delay = 0.9, Radius = 60, Range = 900, Collision = false})
R = GGPrediction:SpellPrediction({Type = GGPrediction.SPELLTYPE_LINE, Speed = 1950, Delay = 0.6, Radius = 60, Range = 20000, Collision = true, MaxCollision = 0, CollisionTypes = {GGPrediction.COLLISION_ENEMYHERO}})
end
function Jinx:Tick()
if _G.JustEvade and _G.JustEvade:Evading() or (_G.ExtLibEvade and _G.ExtLibEvade.Evading) or Game.IsChatOpen() or myHero.dead then return end
target = GetTarget(AARange)
if ValidTarget(target) then
GaleMouseSpot = self:MoveHelper(target)
else
_G.SDK.Orbwalker.ForceMovement = nil
end
self:GetQRange()
self:GetAARange()
CastingQ = myHero.activeSpell.name == "JinxQ"
CastingW = myHero.activeSpell.name == "JinxW"
CastingE = myHero.activeSpell.name == "JinxE"
CastingR = myHero.activeSpell.name == "JinxR"
if EnemyLoaded == false then
local CountEnemy = 0
for i, enemy in pairs(EnemyHeroes) do
CountEnemy = CountEnemy + 1
end
if CountEnemy < 1 then
GetEnemyHeroes()
else
EnemyLoaded = true
PrintChat("Enemy Loaded")
end
end
self:Logic()
self:Auto()
self:Minions()
end
function Jinx:CastingChecks()
if not CastingQ and not CastingW and not CastingE and not CastingR then
return true
else
return false
end
end
function Jinx:SmoothChecks()
if self:CastingChecks() and not _G.SDK.Attack:IsActive() and _G.SDK.Cursor.Step == 0 and _G.SDK.Spell:CanTakeAction({q = 0, w = 0.73, e = 0.33, r = 0.73}) then
return true
else
return false
end
end
function Jinx:CanUse(spell, mode)
if mode == nil then
mode = Mode()
end
if spell == _Q then
if mode == "Combo" and IsReady(_Q) and self.Menu.combo.qcombo:Value() then
return true
end
if mode == "LastHit" and IsReady(_Q) and self.Menu.lasthit.qlasthit:Value() and myHero.mana / myHero.maxMana >= self.Menu.lasthit.qlasthitmana:Value() / 100 then
return true
end
if mode == "LaneClear" and IsReady(_Q) and self.Menu.laneclear.qlaneclear:Value() and myHero.mana / myHero.maxMana >= self.Menu.laneclear.qlaneclearmana:Value() / 100 then
return true
end
end
if spell == _W then
if mode == "Combo" and IsReady(_W) and self.Menu.combo.wcombo:Value() then
return true
end
if mode == "LastHit" and IsReady(_W) and self.Menu.lasthit.wlasthit:Value() and myHero.mana / myHero.maxMana >= self.Menu.lasthit.wlasthitmana:Value() / 100 then
return true
end
if mode == "Auto" and IsReady(_W) and self.Menu.auto.wauto:Value() then
return true
end
end
if spell == _E then
if mode == "Combo" and IsReady(_E) and self.Menu.combo.ecombo:Value() then
return true
end
if mode == "Auto" and IsReady(_E) and self.Menu.auto.eauto:Value() then
return true
end
end
if spell == _R then
if mode == "Combo" and IsReady(_R) and self.Menu.combo.rcombo:Value() then
return true
end
if mode == "Auto" and IsReady(_R) and self.Menu.auto.rauto:Value() then
return true
end
end
end
function Jinx:Logic()
if Mode() == "Combo" then
self:QCombo()
self:WCombo()
self:ECombo()
end
end
function Jinx:Auto()
for i, enemy in pairs(EnemyHeroes) do
if Mode() == "Combo" then
self:RCombo(enemy)
end
self:WKS(enemy)
self:EInterrupt(enemy)
self:RKS(enemy)
self:SemiR(enemy)
end
end
function Jinx:Minions()
local minions = _G.SDK.ObjectManager:GetEnemyMinions(WRange)
for i = 1, #minions do
local minion = minions[i]
if Mode() == "LastHit" then
self:WLastHit(minion)
end
if Mode() == "LaneClear" then
self:QLaneClear(minion)
end
end
end
-- functions --
function Jinx:QCombo()
local qtarget = GetTarget(QCheckRange)
if qtarget == nil then return end
if ValidTarget(qtarget, QCheckRange) and self:CanUse(_Q, "Combo") and self:SmoothChecks() and GetDistance(myHero.pos, qtarget.pos) > BaseAARange and BuffActive(myHero, powpow) then
Control.CastSpell(HK_Q)
end
if ValidTarget(qtarget, BaseAARange) and self:CanUse(_Q, "Combo") and self:SmoothChecks() and BuffActive(myHero, fishbones) then
Control.CastSpell(HK_Q)
end
end
function Jinx:WCombo()
local wtarget = GetTarget(WRange)
if wtarget == nil then return end
if ValidTarget(wtarget, WRange) and self:CanUse(_W, "Combo") and self:SmoothChecks() then
if self.Menu.combo.wcomboaa:Value() then
if GetDistance(myHero.pos, wtarget.pos) > AARange then
GGCast(HK_W, wtarget, W, self.Menu.combo.wcombohc:Value()+1)
end
else
GGCast(HK_W, wtarget, W, self.Menu.combo.wcombohc:Value()+1)
end
end
end
function Jinx:ECombo()
local etarget = GetTarget(ERange)
if etarget == nil then return end
if ValidTarget(etarget, ERange) and self:CanUse(_E, "Combo") and self:SmoothChecks() then
GGCast(HK_E, etarget, E, self.Menu.combo.ecombohc:Value()+1)
end
end
function Jinx:RCombo(enemy)
if ValidTarget(enemy, self.Menu.combo.rcomborange:Value()) and self:CanUse(_R, "Combo") and GetEnemyCount(400, enemy) >= self.Menu.combo.rcombocount:Value() and self:SmoothChecks() then
if self.Menu.combo.rcomboaa:Value() then
if enemy.pos:ToScreen().onScreen then
GGCast(HK_R, enemy, R)
else
R:GetPrediction(enemy, myHero)
if R:CanHit(HITCHANCE_HIGH) and GetDisntance(R.CastPosition, myHero.pos) <= R.Range then
local Direction = Vector((myHero.pos-R.CastPosition):Normalized())
local CastSpot = myHero.pos - Direction * 800
GGCast(HK_R, CastSpot)
end
end
else
if enemy.pos:ToScreen().onScreen then
GGCast(HK_R, enemy, R)
else
R:GetPrediction(enemy, myHero)
if R:CanHit(HITCHANCE_HIGH) and GetDistance(R.CastPosition, myHero.pos) <= R.Range then
local Direction = Vector((myHero.pos-R.CastPosition):Normalized())
local CastSpot = myHero.pos - Direction * 800
GGCast(HK_R, CastSpot)
end
end
end
end
end
function Jinx:WKS(enemy)
if ValidTarget(enemy, WRange) and self:CanUse(_W, "Auto") and self:SmoothChecks() then
local WDam = getdmg("W", enemy, myHero)
if enemy.health < WDam then
GGCast(HK_W, enemy, W)
end
end
end
function Jinx:EInterrupt(enemy)
if ValidTarget(enemy, ERange) and self:CanUse(_E, "Auto") and self:SmoothChecks() then
if GetDistance(myHero.pos, enemy.pos) <= 200 and enemy.activeSpell.valid and enemy.activeSpell.spellWasCast and enemy.activeSpell.target == myHero.handle then
GGCast(HK_E, enemy, E)
elseif enemy.pathing.isDashing then
if GetDistance(myHero.pos, enemy.pathing.endPos) < GetDistance(myHero.pos, enemy.pos) then
GGCast(HK_E, enemy, E)
end
end
end
end
function Jinx:RKS(enemy)
if ValidTarget(enemy, self.Menu.auto.rautorange:Value()) and self:CanUse(_R, "Auto") and self:SmoothChecks() and self:EnemiesAround(enemy) == 0 then
local RDam = CalcRDmg(enemy)
if enemy.health < RDam then
if enemy.pos:ToScreen().onScreen then
GGCast(HK_R, enemy, R)
else
R:GetPrediction(enemy, myHero)
if R:CanHit(HITCHANCE_HIGH) and GetDistance(R.CastPosition, myHero.pos) <= R.Range then
local Direction = Vector((myHero.pos-R.CastPosition):Normalized())
local CastSpot = myHero.pos - Direction * 800
GGCast(HK_R, CastSpot)
end
end
end
end
end
function Jinx:SemiR(enemy)
if ValidTarget(enemy, RRange) and self.Menu.combo.rsemi:Value() and GetDistance(enemy.pos, mousePos) <= 400 and self:SmoothChecks() then
if enemy.pos:ToScreen().onScreen then
GGCast(HK_R, enemy, R)
else
R:GetPrediction(enemy, myHero)
if R:CanHit(HITCHANCE_HIGH) and GetDistance(R.CastPosition, myHero.pos) <= R.Range then
local Direction = Vector((myHero.pos-R.CastPosition):Normalized())
local CastSpot = myHero.pos - Direction * 800
GGCast(HK_R, CastSpot)
end
end
end
end
function Jinx:WLastHit(minion)
if ValidTarget(minion, WRange) and self:CanUse(_W, "LastHit") and self:SmoothChecks() and (minion.charName == "SRU_ChaosMinionSiege" or minion.charName == "SRU_OrderMinionSiege") and GetDistance(myHero.pos, minion.pos) >= QCheckRange then
local WDam = getdmg("W", minion, myHero, myHero:GetSpellData(_Q).level)
if minion.health <= WDam then
local minions2 = _G.SDK.ObjectManager:GetEnemyMinions(WRange)
for i = 1, #minions2 do
local minion2 = minions2[i]
local Line = ClosestPointOnLineSegment(minion2.pos, myHero.pos, minion.pos)
if GetDistance(minion2.pos, Line) <= 120 then
return
else
Control.CastSpell(HK_W, minion)
end
end
end
end
end
function Jinx:QLaneClear(minion)
if ValidTarget(minion, QCheckRange) and self:CanUse(_Q, "LaneClear") and self:SmoothChecks() and BuffActive(myHero, powpow) then
local minions2 = _G.SDK.ObjectManager:GetEnemyMinions(QCheckRange)
local count = 0
for i = 1, #minions2 do
local minion2 = minions2[i]
if GetDistance(minion.pos, minion2.pos) <= 250 then
count = count + 1
end
end
QLaneClearCount = count
if QLaneClearCount >= self.Menu.laneclear.qlaneclearcount:Value() then
Control.CastSpell(HK_Q)
else
if BuffActive(myHero, fishbones) and IsReady(_Q) then
Control.CastSpell(HK_Q)
end
end
end
if myHero.mana / myHero.maxMana <= self.Menu.laneclear.qlaneclearmana:Value() and BuffActive(myHero, fishbones) and IsReady(_Q) then
Control.CastSpell(HK_Q)
end
end
function Jinx:EnemiesAround(enemy)
local count = 0
if GetDistance(myHero.pos, enemy.pos) <= 700 then
count = count + 1
end
return count
end
function Jinx:GetQRange()
if myHero:GetSpellData(_Q).level > 0 and IsReady(_Q) then
QRange = 75 + 25 * myHero:GetSpellData(_Q).level
QCheckRange = BaseAARange + QRange
end
end
function Jinx:GetAARange()
if BuffActive(myHero, fishbones) then
AARange = BaseAARange + QRange
else
AARange = BaseAARange
end
end
function Jinx:MoveHelper(unit)
local EAARangel = _G.SDK.Data:GetAutoAttackRange(unit)
local MoveSpot = nil
local RangeDif = AARange - EAARangel
local ExtraRangeDist = RangeDif
local ExtraRangeChaseDist = RangeDif - 100
local ScanDirection = Vector((myHero.pos-mousePos):Normalized())
local ScanDistance = GetDistance(myHero.pos, unit.pos) * 0.8
local ScanSpot = myHero.pos - ScanDirection * ScanDistance
local MouseDirection = Vector((unit.pos-ScanSpot):Normalized())
local MouseSpotDistance = EAARangel + ExtraRangeDist
if not IsFacing(unit) then
MouseSpotDistance = EAARangel + ExtraRangeChaseDist
end
if MouseSpotDistance > BaseAARange then
MouseSpotDistance = BaseAARange
end
local MouseSpot = unit.pos - MouseDirection * (MouseSpotDistance)
local MouseDistance = GetDistance(unit.pos, mousePos)
local GaleMouseSpotDirection = Vector((myHero.pos-MouseSpot):Normalized())
local GalemouseSpotDistance = GetDistance(myHero.pos, MouseSpot)
if GalemouseSpotDistance > 300 then
GalemouseSpotDistance = 300
end
local GaleMouseSpoty = myHero.pos - GaleMouseSpotDirection * GalemouseSpotDistance
MoveSpot = MouseSpot
if MoveSpot then
if GetDistance(myHero.pos, MoveSpot) < 50 or IsUnderEnemyTurret(MoveSpot) then
_G.SDK.Orbwalker.ForceMovement = nil
elseif self.Menu.movehelper:Value() and GetDistance(myHero.pos, unit.pos) <= AARange-50 and (Mode() == "Combo" or Mode() == "Harass") and self:CastingChecks() and MouseDistance < 750 then
_G.SDK.Orbwalker.ForceMovement = MoveSpot
else
_G.SDK.Orbwalker.ForceMovement = nil
end
end
return GaleMouseSpoty
end
class "Senna"
local EnemyLoaded = false
local AllyLoaded = false
local lastSpell = GetTickCount()
local SIcon = "https://static.u.gg/assets/lol/riot_static/11.10.1/img/champion/Senna.png"
local QIcon = "https://static.u.gg/assets/lol/riot_static/11.10.1/img/spell/SennaQ.png"
local WIcon = "https://static.u.gg/assets/lol/riot_static/11.10.1/img/spell/SennaW.png"
local EIcon = "https://static.u.gg/assets/lol/riot_static/11.10.1/img/spell/SennaE.png"
local RIcon = "https://static.u.gg/assets/lol/riot_static/11.10.1/img/spell/SennaR.png"
function Senna:Menu()
self.Menu = MenuElement({type = MENU, id = "senna", name = "dnsSenna", leftIcon = SIcon})
self.Menu:MenuElement({id = "combo", name = "Combo", type = MENU})
self.Menu.combo:MenuElement({id = "qcombo", name = "Use [Q] in Combo", value = true, leftIcon = QIcon})
self.Menu.combo:MenuElement({id = "wcombo", name = "Use [W] in Combo", value = true, leftIcon = WIcon})
self.Menu.combo:MenuElement({id = "ecombo", name = "Use [E] to cancle Attacks", value = true, leftIcon = EIcon})
self.Menu.combo:MenuElement({id = "ecombohp", name = "[E] HP", value = 40, min = 5, max = 95, step = 5, identifier = "%", leftIcon = EIcon})
self.Menu:MenuElement({id = "auto", name = "Auto", type = MENU})
self.Menu.auto:MenuElement({id = "qheal", name = "Auto [Q] low allys", value = true, leftIcon = QIcon})
self.Menu.auto:MenuElement({id = "qhealhp", name = "[Q] HP <", value = 60, min = 5, max = 95, step = 5, identifier = "%", leftIcon = QIcon})
self.Menu.auto:MenuElement({id = "qhealallies", name = "[Q] Allies", type = MENU, leftIcon = QIcon})
self.Menu.auto:MenuElement({id = "qks", name = "Use [Q] to KS", value = true, leftIcon = QIcon})
self.Menu.auto:MenuElement({id = "qks2", name = "Use [Q] + [Ward] to KS", value = true, leftIcon = QIcon})
self.Menu.auto:MenuElement({id = "wimmo", name = "Use [W] on immobile Targets", value = true, leftIcon = WIcon})
self.Menu.auto:MenuElement({id = "rsave", name = "Use [R] to shield allys", value = true, leftIcon = RIcon})
self.Menu.auto:MenuElement({id = "rsavehp", name = "[R] HP <", value = 40, min = 5, max = 95, step = 5, identifier = "%", leftIcon = RIcon})
self.Menu.auto:MenuElement({id = "rsaveallies", name = "[R] Allies", type = MENU, leftIcon = RIcon})
self.Menu.auto:MenuElement({id = "rks", name = "Use [R] to KS", value = true, leftIcon = RIcon})
self.Menu:MenuElement({id = "laneclear", name = "LaneClear", type = MENU})
self.Menu.laneclear:MenuElement({id = "qlaneclear", name = "Use [Q] in LaneClear", value = true, leftIcon = QIcon})
self.Menu.laneclear:MenuElement({id = "qlaneclearcount", name = "[Q] HitCount >=", value = 3, min = 1, max = 9, step = 1, leftIcon = QIcon})
self.Menu.laneclear:MenuElement({id = "qlaneclearmana", name = "[Q] Mana >=", value = 40, min = 5, max = 95, step = 5, identifier = "%", leftIcon = QIcon})
self.Menu:MenuElement({id = "misc", name = "Misc", type = MENU})
self.Menu.misc:MenuElement({id = "movementhelper", name = "RangeHelper", value = true})
self.Menu:MenuElement({id = "draws", name = "Draws", type = MENU})
self.Menu.draws:MenuElement({id = "qdraw", name = "Draw [Q] Range", value = false, leftIcon = QIcon})
self.Menu.draws:MenuElement({id = "wdraw", name = "Draw [W] Range", value = false, leftIcon = WIcon})
end
function Senna:ActiveMenu()
for i, ally in pairs(AllyHeroes) do
self.Menu.auto.qhealallies:MenuElement({id = ally.charName, name = ally.charName, value = true})
self.Menu.auto.rsaveallies:MenuElement({id = ally.charName, name = ally.charName, value = true})
end
end
function Senna:Spells()
Q = {range = myHero.range + myHero.boundingRadius, radius = 100}
Q2 = {range = 1300, radius = 75, delay = 0.33, speed = math.huge, collision = {}, type = "linear"}
W = {range = 1200, radius = 50, delay = 0.25, speed = 1200, collision = {"minion"}, type = "linear"}
R = {range = 20000, radius = 30, delay = 1, speed = 20000, collision = {}, type = "circular"}
end
function Senna:Draws()
if self.Menu.draws.qdraw:Value() then
Draw.Circle(myHero, Q.range, 2, Draw.Color(255, 255, 255, 0))
end
if self.Menu.draws.wdraw:Value() then
Draw.Circle(myHero, W.range, 2, Draw.Color(255, 0, 255, 0))
end
end
function Senna:Tick()
if _G.JustEvade and _G.JustEvade:Evading() or (_G.ExtLibEvade and _G.ExtLibEvade.Evading) or Game.IsChatOpen() or myHero.dead then return end
target = GetTarget(myHero.range + myHero.boundingRadius)
if target and ValidTarget(target) then
GaleMouseSpot = self:MoveHelper(target)
else
_G.SDK.Orbwalker.ForceMovement = nil
end
Q.range = myHero.range + myHero.boundingRadius + myHero.boundingRadius
CastingQ = myHero.activeSpell.name == "SennaQ"
CastingW = myHero.activeSpell.name == "SennaW"
CastingE = myHero.activeSpell.name == "SennaE"
CastingR = myHero.activeSpell.name == "SennaR"
if EnemyLoaded == false then
local CountEnemy = 0
for i, enemy in pairs(EnemyHeroes) do
CountEnemy = CountEnemy + 1
end
if CountEnemy < 1 then
GetEnemyHeroes()
else
EnemyLoaded = true
PrintChat("Enemy Loaded")
end
end
if AllyLoaded == false then
local CountAlly = 0
for i, ally in pairs(AllyHeroes) do
CountAlly = CountAlly + 1
end
if CountAlly < 1 then
GetAllyHeroes()
else
AllyLoaded = true
PrintChat("Ally Loaded")
self:ActiveMenu()
end
end
self:Auto()
self:Logic()
self:Minions()
end
function Senna:CastingChecks()
if not CastingQ and not CastingW and not CastingE and not CastingR and _G.SDK.Spell:CanTakeAction({q = 0.55, w = 0.4, e = 1.15, r = 1.15}) and _G.SDK.Cursor.Step == 0 and not _G.SDK.Orbwalker:IsAutoAttacking() then
return true
else
return false
end
end
function Senna:CanUse(spell, mode)
if mode == nil then
mode = Mode()
end
if spell == _Q then
if mode == "Combo" and IsReady(_Q) and self.Menu.combo.qcombo:Value() then
return true
end
if mode == "Heal" and IsReady(_Q) and self.Menu.auto.qheal:Value() then
return true
end
if mode == "KS" and IsReady(_Q) and self.Menu.auto.qks:Value() then
return true
end
if mode == "Ward" and IsReady(_Q) and self.Menu.auto.qks2:Value() then
return true
end
if mode == "LaneClear" and IsReady(spell) and self.Menu.laneclear.qlaneclear:Value() and myHero.mana / myHero.maxMana >= self.Menu.laneclear.qlaneclearmana:Value() / 100 then
return true
end
end
if spell == _W then
if mode == "Combo" and IsReady(_W) and self.Menu.combo.wcombo:Value() then
return true
end
if mode == "Immo" and IsReady(_W) and self.Menu.auto.wimmo:Value() then
return true
end
end
if spell == _E then
if mode == "Combo" and IsReady(_E) and self.Menu.combo.ecombo:Value() then
return true
end
end
if spell == _R then
if mode == "Save" and IsReady(_R) and self.Menu.auto.rsave:Value() then
return true
end
if mode == "KS" and IsReady(_R) and self.Menu.auto.rks:Value() then
return true
end
end
return false
end
function Senna:Auto()
for i, enemy in pairs(EnemyHeroes) do
self:QKS(enemy)
self:QKS1(enemy)
self:QKS2(enemy)
self:WImmo(enemy)
self:RKS(enemy)
if Mode() == "Combo" then
self:ECombo(enemy)
end
for j, ally in pairs(AllyHeroes) do
self:AutoHeal(enemy, ally)
self:RSave(enemy, ally)
end
end
end
function Senna:Logic()
if Mode() == "Combo" then
self:QCombo()
self:WCombo()
end
end
function Senna:Minions()
local minions = _G.SDK.ObjectManager:GetEnemyMinions(1400)
for i = 1, #minions do
local minion = minions[i]
if Mode() == "LaneClear" then
self:QLaneClear(minion)
end
end
end
-- functions --
function Senna:QCombo()
local qtarget = GetTarget(Q.range)
if ValidTarget(qtarget) and self:CanUse(_Q, "Combo") and self:CastingChecks() then
_G.Control.CastSpell(HK_Q, qtarget)
end
end
function Senna:WCombo()
local wtarget = GetTarget(W.range)
if ValidTarget(wtarget) and self:CanUse(_W, "Combo") and self:CastingChecks() then
dnsCast(HK_W, wtarget, W, 0.05)
end
end
function Senna:ECombo(enemy)
if ValidTarget(enemy) and self:CanUse(_E, "Combo") and self:CastingChecks() and enemy.activeSpell.valid and not enemy.activeSpell.isStopped and myHero.health / myHero. maxHealth <= self.Menu.combo.ecombohp:Value() / 100 then
if enemy.activeSpell.target == myHero.handle then
dnsCast(HK_E)
end
end
end
function Senna:AutoHeal(enemy, ally)
if ValidTarget(ally, Q.range) and self:CanUse(_W, "Heal") and self:CastingChecks() and ally.health / ally.maxHealth <= self.Menu.auto.qhealhp:Value() / 100 and ValidTarget(enemy) and GetDistance(enemy.pos, ally.pos) <= 1000 and self.Menu.auto.qhealallies[ally.charName]:Value() then
dnsCast(HK_Q, ally)
end
end
function Senna:QKS(enemy)
if ValidTarget(enemy, Q.range) and self:CanUse(_Q, "KS") and self:CastingChecks() then
local qdam = getdmg("Q", enemy, myHero, myHero:GetSpellData(_Q).level)
if qdam >= enemy.health then
dnsCast(HK_Q, enemy)
end
end
end
function Senna:QKS1(enemy)
if ValidTarget(enemy, Q2.range) and GetDistance(myHero.pos, enemy.pos) > Q.range and self:CanUse(_Q, "KS") and self:CastingChecks() then
local qdam = getdmg("Q", enemy, myHero, myHero:GetSpellData(_Q).level)
if qdam > enemy.health then
local pred = _G.PremiumPrediction:GetPrediction(myHero, enemy, Q2)
if pred.CastPos and pred.HitChance >= 0 then
local minions = _G.SDK.ObjectManager:GetMinions(Q.range)
for i = 1, #minions do
local minion = minions[i]
if ValidTarget(minion) then
local targetPos = myHero.pos:Extended(pred.CastPos, Q2.range)
local minionPos = myHero.pos:Extended(minion.pos, Q2.range)
if GetDistance(targetPos, minionPos) <= Q2.radius then
_G.Control.CastSpell(HK_Q, minion)
end
end
end
local heroes = _G.SDK.ObjectManager:GetHeroes(Q.range)
for j = 1, #heroes do
local hero = heroes[i]
if ValidTarget(hero) then
local targetPos = myHero.pos:Extended(pred.CastPos, Q2.range)
local heroPos = myHero.pos:Extended(hero.pos, Q2.range)
if GetDistance(targetPos, heroPos) <= Q2.radius then
_G.Control.CastSpell(HK_Q, hero)
end
end
end
end
end
end
end
function Senna:GetWardStone()
if GetItemSlot(myHero, 3863) > 0 then
return GetItemSlot(myHero, 3863)
elseif GetItemSlot(myHero, 3864) > 0 then
return GetItemSlot(myHero, 3864)
elseif GetItemSlot(myHero, 3855) > 0 then
return GetItemSlot(myHero, 3855)
elseif GetItemSlot(myHero, 3856) > 0 then
return GetItemSlot(myHero, 3856)
else
return 0
end
end
function Senna:QKS2(enemy)
local YellowTrinket = GetItemSlot(myHero, 3340)
local WardStone = self:GetWardStone()
local PinkWard = GetItemSlot(myHero, 2055)
local WardStoneAmmo = myHero:GetItemData(WardStone).ammo
if ValidTarget(enemy, Q2.range) and GetDistance(myHero.pos, enemy.pos) > Q.range and self:CanUse(_Q, "Ward") and self:CastingChecks() then
PrintChat(myHero:GetItemData(YellowTrinket).stacks)
local qdam = getdmg("Q", enemy, myHero, myHero:GetSpellData(_Q).level)
if qdam >= enemy.health then
local pred = _G.PremiumPrediction:GetPrediction(myHero, enemy, Q2)
if pred.CastPos and pred.HitChance >= 0 then
local wardPos = myHero.pos:Extended(pred.CastPos, 500)
if WardStone > 0 and WardStoneAmmo > 0 then
Control.CastSpell(ItemHotKey[WardStone], wardPos)
DelayAction(function() Control.CastSpell(HK_Q, wardPos) end, 0.15)
elseif YellowTrinket > 0 and myHero:GetSpellData(YellowTrinket).currentCd == 0 then
Control.CastSpell(ItemHotKey[YellowTrinket], wardPos)
DelayAction(function() Control.CastSpell(HK_Q, wardPos) end, 0.15)
elseif PinkWard > 0 then
Control.CastSpell(ItemHotKey[PinkWard], wardPos)
DelayAction(function() Control.CastSpell(HK_Q, wardPos) end, 0.15)
end
end
end
end
end
function Senna:WImmo(enemy)
if ValidTarget(enemy, W.range) and self:CanUse(_W, "Immo") and self:CastingChecks() then
if IsImmobile(enemy) >= 0.5 then
dnsCast(HK_W, enemy, W, 1)
elseif enemy.pathing and enemy.pathing.isDashing then
if GetDistance(enemy.pos, myHero.pos) > GetDistance(enemy.pathing.endPos, myHero.pos) then
dnsCast(HK_W, enemy, W, 1)
end
end
end
end
function Senna:RSave(enemy, ally)
if ValidTarget(ally, R.range) and self:CanUse(_R, "Save") and self:CastingChecks() and enemy.activeSpell.valid and not enemy.activeSpell.isStopped and ally.health / ally.maxHealth <= self.Menu.auto.rsavehp:Value() / 100 and self.Menu.auto.rsaveallies[ally.charName]:Value() then
if enemy.activeSpell.target == ally.handle then
dnsCast(HK_R, ally, R, 0.05)
else
local placementPos = enemy.activeSpell.placementPos
local startPos = enemy.activeSpell.startPos
local width = ally.boundingRadius + 50
if enemy.activeSpell.width > 0 then width = width + enemy.activeSpell.width end
local spellLine = ClosestPointOnLineSegment(ally.pos, startPos, placementPos)
if GetDistance(ally.pos, spellLine) <= width then
dnsCast(HK_R, ally, R, 0.05)
end
end
end
end
function Senna:RKS(enemy)
if ValidTarget(enemy, R.range) and self:CanUse(_R, "KS") and self:CastingChecks() then
local rdam = getdmg("R", enemy, myHero, myHero:GetSpellData(_R).level)
if rdam >= enemy.health then
dnsCast(HK_R, enemy, R, 0.05)
end
end
end
function Senna:QLaneClear(minion)
if ValidTarget(minion, Q.range) and self:CanUse(_Q, "LaneClear") and self:CastingChecks() then
local minionPos = myHero.pos:Extended(minion.pos, 1300)
if GetMinionCountLinear(1400, Q2.radius, minionPos) >= self.Menu.laneclear.qlaneclearcount:Value() then
dnsCast(HK_Q, minion)
end
end
end
function Senna:MoveHelper(unit)
local EAARangel = unit.range + unit.boundingRadius
local AARange = myHero.range + myHero.boundingRadius
local MoveSpot = nil
local RangeDif = AARange - EAARangel
local ExtraRangeDist = RangeDif
local ExtraRangeChaseDist = RangeDif - 100
local ScanDirection = Vector((myHero.pos-mousePos):Normalized())
local ScanDistance = GetDistance(myHero.pos, unit.pos) * 0.8
local ScanSpot = myHero.pos - ScanDirection * ScanDistance
local MouseDirection = Vector((unit.pos-ScanSpot):Normalized())
local MouseSpotDistance = EAARangel + ExtraRangeDist
if not IsFacing(unit) then
MouseSpotDistance = EAARangel + ExtraRangeChaseDist
end
if MouseSpotDistance > AARange then
MouseSpotDistance = AARange
end
local MouseSpot = unit.pos - MouseDirection * (MouseSpotDistance)
local MouseDistance = GetDistance(unit.pos, mousePos)
local GaleMouseSpotDirection = Vector((myHero.pos-MouseSpot):Normalized())
local GalemouseSpotDistance = GetDistance(myHero.pos, MouseSpot)
if GalemouseSpotDistance > 300 then
GalemouseSpotDistance = 300
end
local GaleMouseSpoty = myHero.pos - GaleMouseSpotDirection * GalemouseSpotDistance
MoveSpot = MouseSpot
if MoveSpot then
if GetDistance(myHero.pos, MoveSpot) < 50 or IsUnderEnemyTurret(MoveSpot) then
_G.SDK.Orbwalker.ForceMovement = nil
elseif self.Menu.misc.movementhelper:Value() and GetDistance(myHero.pos, unit.pos) <= AARange-50 and (Mode() == "Combo" or Mode() == "Harass") and self:CastingChecks() and MouseDistance < 750 then
_G.SDK.Orbwalker.ForceMovement = MoveSpot
else
_G.SDK.Orbwalker.ForceMovement = nil
end
end
return GaleMouseSpoty
end
function OnLoad()
Manager()
end
|
-- See LICENSE for terms
if LuaRevision > 1001586 then
return
end
if not g_AvailableDlc.kerwin then
print("Fix InDome Buildings Pack Logos: DLC not installed!")
return
end
local function StartupCode()
if not CurrentModOptions:GetProperty("EnableMod") then
return
end
MissionLogoPresetMap.CCP1Logo_1.entity_name = "DecCCP1Logo_01"
MissionLogoPresetMap.CCP1Logo_2.entity_name = "DecCCP1Logo_02"
end
OnMsg.CityStart = StartupCode
OnMsg.LoadGame = StartupCode
-- fires every time the new game screen changes (flying rocket logo)
OnMsg.GameTimeStart = StartupCode
|
-- Must be installedIntel Power Gadget.dmg
local obj = {}
obj.__index = obj
-- Metadata
obj.name = "IntelTemperature"
obj.version = "1.0"
obj.author = "DengShiLin <DengShiLin0218@gmail.com>"
obj.homepage = "https://github.com/slin_0218/Hammerspoon-config"
obj.license = "MIT - https://opensource.org/licenses/MIT"
function obj:init()
self.menubar = hs.menubar.new(false)
end
function obj:start()
obj.menubar:returnToMenuBar()
obj:rescan()
end
function obj:stop()
obj.menubar:removeFromMenuBar()
obj.timer:stop()
end
function obj:toggle()
if obj.timer:running()
then
obj:stop()
else
obj:start()
end
end
-- 获取当前脚本路径
local function script_path()
local str = debug.getinfo(2, "S").source:sub(2)
return str:match("(.*/)")
end
local function getCpuTemperature()
local intel = hs.execute(script_path() .. '/PowerGadgetAPI')
local title = hs.styledtext.new(intel, {font={size=13.0}})
obj.menubar:setTitle(title)
end
function obj:rescan()
if obj.timer
then
obj.timer:stop()
obj.timer = nil
end
obj.timer = hs.timer.doEvery(2, getCpuTemperature)
obj.timer:fire()
end
return obj
|
-----------------------------------------------------
if SERVER then
resource.AddSingleFile("sound/death.wav") --death sound xD
util.AddNetworkString("doZombieGesture")
--config
local infectious = {"npc_zombie"} --which npcs can infect the player?
local chance = 1 --the chance of the player getting infected (for each claw strike).
local function timersStop(ply)
timer.Remove("zombie_Infected_" .. ply:SteamID())
timer.Remove("zombie_HealthIncrease_" .. ply:SteamID())
end
local function turnZombie(ply)
--weapons
ply:StripWeapons() --priority so we don't see weapons in our hands at the start.
ply:Give("zombie_claws")
--rest
ply:SetHealth(0)
ply:Freeze(true)
ply:SetJumpPower(0)
ply:SetNWBool("isZombie", true)
ply:SetRunSpeed(ply:GetWalkSpeed())
ply:SendLua('surface.PlaySound("death.wav")')
timer.Simple(2.7, function()
if not ply:IsValid() then return end
ply:ScreenFade(SCREENFADE.IN, color_white, 0.1, 0.1)
timer.Simple(0.2, function()
if ply:IsValid() then
ply:ScreenFade(SCREENFADE.IN, color_white, 2, 1)
end
end)
end)
net.Start("doZombieGesture")
net.WriteEntity(ply)
net.WriteInt(ACT_HL2MP_ZOMBIE_SLUMP_RISE, 32)
net.Broadcast()
timer.Create("zombie_HealthIncrease_" .. ply:SteamID(), 0.001, 300, function()
ply:SetHealth(ply:Health() + 1)
end)
timer.Simple(3.5, function()
if ply:IsValid() then
ply:Freeze(false)
end
end)
timer.Remove("zombie_Infected_" .. ply:SteamID())
end
hook.Add("PlayerFootstep", "zombie_ChangeFootstep", function(ply)
if ply:GetNWBool("isZombie") then
ply:EmitSound("npc/zombie/foot" .. math.random(1, 3) .. ".wav")
return true
end
end)
hook.Add("PlayerUse", "zombie_DisableUse", function(ply, ent) return not ply:GetNWBool("isZombie") end)
hook.Add("EntityTakeDamage", "zombie_InfectVictim", function(target, dmg)
local attacker = dmg:GetAttacker()
if target:IsPlayer() and not target:GetNWBool("isZombie") and not timer.Exists("zombie_Infected_" .. target:SteamID()) then
if attacker:IsNPC() and table.HasValue(infectious, attacker:GetClass()) or attacker:IsPlayer() and attacker:GetNWBool("isZombie") then
if math.random(1, chance) == 1 then
target:PrintMessage(HUD_PRINTCENTER, "You've become infected.")
timer.Create("zombie_Infected_" .. target:SteamID(), 1, 0, function()
if target:Alive() then
if math.random(1, 10) == 1 then
target:EmitSound("ambient/voices/cough" .. math.random(1, 4) .. ".wav", 60)
end
target:TakeDamage(1)
end
end)
end
end
end
end)
hook.Add("PlayerDeath", "zombie_InfectEnd", function(victim, wep, attacker)
if victim:IsPlayer() then
if victim:GetNWBool("isZombie") then
timersStop(victim)
victim:SetNWBool("isZombie", false)
return
elseif timer.Exists("zombie_Infected_" .. victim:SteamID()) then
victim.riseInfo = {
pos = victim:GetPos(),
model = victim:GetModel()
}
end
if attacker:GetNWBool("isZombie") then
net.Start("doZombieGesture")
net.WriteEntity(attacker)
net.WriteInt(ACT_GMOD_GESTURE_TAUNT_ZOMBIE, 32)
net.Broadcast()
attacker:SetHealth(attacker:Health() + math.random(25, 50))
end
end
end)
hook.Add("PlayerSpawn", "zombie_InfectedRise", function(ply)
if ply.riseInfo then
timer.Simple(0.1, function()
if not ply:IsValid() then return end
ply:SetModel(ply.riseInfo.model)
timer.Simple(0.1, function()
if ply:IsValid() then
ply:SetPos(ply.riseInfo.pos)
ply.riseInfo = nil
turnZombie(ply)
end
end)
end)
end
end)
hook.Add("Think", "zombie_InfectedRelationship", function()
for k, v in pairs(ents.FindByClass("npc_*")) do
if table.HasValue(infectious, v:GetClass()) then
for _, ply in pairs(player.GetAll()) do
if ply:GetNWBool("isZombie") then
v:AddEntityRelationship(ply, D_NU, 99)
else
v:AddEntityRelationship(ply, D_HT, 99)
end
end
end
end
end)
hook.Add("PlayerDisconnected", "zombie_InfectEnd", function(asshole)
timersStop(asshole)
end)
hook.Add("playerCanChangeTeam", "zombie_DisableJob", function(ply)
return not ply:GetNWBool("isZombie"), "You can't change jobs as a zombie!"
end)
concommand.Add("turnZombie", function(ply)
if ply:IsAdmin() then
local target = ply:GetEyeTrace().Entity
if target:IsPlayer() and target:Alive() and not target:GetNWBool("isZombie") then
turnZombie(target)
else
ply:PrintMessage(HUD_PRINTCONSOLE, "Invalid target.")
end
else
ply:PrintMessage(HUD_PRINTCONSOLE, "You need to be an admin to run this command.")
end
end)
else
hook.Add("CalcView", "zombie_ThirdPerson", function(ply, pos, ang, fov)
if ply:GetNWBool("isZombie") then
local view = {}
view.origin = pos - (ang:Forward() * 100)
view.ang = ang
view.fov = fov
view.drawviewer = true
return view
end
end)
net.Receive("doZombieGesture", function()
net.ReadEntity():AnimRestartGesture(GESTURE_SLOT_CUSTOM, net.ReadInt(32), true)
end)
end
hook.Add("CalcMainActivity", "zombie_ChangeAnim", function(ply)
if ply:GetNWBool("isZombie") then
local seq = "zombie_walk_01"
if ply:Crouching() then
seq = "zombie_cwalk_01"
end
return true, ply:LookupSequence(seq)
end
end)
|
return {'waxcoat','waxinelichtje','waxine','waxinelichtjes','waxcoats'}
|
local ck = require "resty.cookie"
local uuid = require 'resty.jit-uuid'
local stream = require('/var/www/cpiapps/docker/openresty/stream')
local rmq = require('/var/www/cpiapps/docker/openresty/rmq')
local streamUuid = ngx.var.uri:gsub("/", "")
if streamUuid == "" then
ngx.exit(ngx.HTTP_NOT_FOUND)
end
stream.redisConnect(ngx.var.redisHost, ngx.var.redisPort);
local redirectUrl = stream.getRedirectUrl(streamUuid);
if redirectUrl == ngx.null then
ngx.exit(ngx.HTTP_NOT_FOUND)
end
local hitInfo = {
agent = ngx.var.http_user_agent,
streamUuid = streamUuid,
referrer = ngx.var.http_referer,
ip = ngx.var.remote_addr,
uuid = uuid.generate_v4()
}
rmq.rmqConnect(ngx.var.rmqHost, ngx.var.rmqPort, ngx.var.rmqUsername, ngx.var.rmqPass, ngx.var.rmqVhost)
rmq.rmqSend(hitInfo, "/exchange/hit")
local cookie, err = ck:new()
local hostUuid, err = cookie:get("stream:" .. streamUuid)
if hostUuid then
return ngx.redirect(redirectUrl)
end
hostUuid = uuid.generate_v4()
local ok, err = cookie:set({
key = "stream:" .. streamUuid,
value = hostUuid,
path = "/",
httponly = true,
expires = ngx.cookie_time(ngx.time() + 60 * 60 * 24)
})
local hostInfo = {
agent = ngx.var.http_user_agent,
streamUuid = streamUuid,
referrer = ngx.var.http_referer,
ip = ngx.var.remote_addr,
uuid = hostUuid
}
rmq.rmqSend(hostInfo, "/exchange/host")
rmq.rmqSend({
agent = ngx.var.http_user_agent,
streamUuid = streamUuid,
referrer = ngx.var.http_referer,
ip = ngx.var.remote_addr,
hostUuid = hostUuid
}, "/exchange/lead")
return ngx.redirect(redirectUrl)
|
local utils = require("utils")
local entityHandler = require("entities")
local triggerHandler = require("triggers")
local decalHandler = require("decals")
local layerHandlers = {}
layerHandlers.layerHandlers = {
entities = entityHandler,
triggers = triggerHandler,
decalsFg = decalHandler,
decalsBg = decalHandler
}
function layerHandlers.getHandler(layer)
return layerHandlers.layerHandlers[layer]
end
return layerHandlers
|
-- example config for novnc sandbox, which is created on top of external debian/ubuntu chroot, prepared by debian-setup.cfg.lua
-- using debian-sandbox.cfg.lua config file as base
-- tested with ubuntu 18.04 chroot, created with download-ubuntu-chroot.sh script
-- you need to install the following packages inside ubuntu chroot: python (v2.7), x11vnc, socat, git
-- redefine defaults.recalculate function, that will be called by base config
defaults.recalculate_orig=defaults.recalculate
function defaults.recalculate()
-- redefine some parameters
tunables.datadir=loader.path.combine(loader.workdir,"userdata-novnc")
defaults.recalculate_orig()
defaults.mounts.resolvconf_mount=defaults.mounts.direct_resolvconf_mount
end
defaults.recalculate()
-- load base config
dofile(loader.path.combine(loader.workdir,"debian-sandbox.cfg.lua"))
-- remove some unneded features and mounts
loader.table.remove_value(sandbox.features,"dbus")
loader.table.remove_value(sandbox.features,"gvfs_fix")
loader.table.remove_value(sandbox.features,"pulse")
-- remove some mounts from base config
loader.table.remove_value(sandbox.setup.mounts,defaults.mounts.devsnd_mount)
loader.table.remove_value(sandbox.setup.mounts,defaults.mounts.devdri_mount)
loader.table.remove_value(sandbox.setup.mounts,defaults.mounts.sys_mount)
loader.table.remove_value(sandbox.setup.mounts,defaults.mounts.devinput_mount)
loader.table.remove_value(sandbox.setup.mounts,defaults.mounts.devshm_mount)
loader.table.remove_value(sandbox.setup.mounts,defaults.mounts.sbin_ro_mount)
-- modify PATH env
table.insert(sandbox.setup.env_set,{"PATH","/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"})
-- remove unshare_ipc bwrap param or x11vnc will not work
loader.table.remove_value(sandbox.bwrap,defaults.bwrap.unshare_ipc)
novnc_install={
exec="/bin/bash",
path="/home/sandboxer",
args={"-c","set -e\
rm -rf ./novnc\
git clone https://github.com/novnc/noVNC.git novnc\
###uncomment next line if you have any problems with the latest commit\
###( cd novnc && git reset --hard 36bfcb0714ddeb0107933589bc4fc108ad54cd8d )\
git clone https://github.com/novnc/websockify novnc/utils/websockify\
###uncomment next line if you have any problems with the latest commit\
###( cd novnc/utils/websockify && git reset --hard f0bdb0a621a4f3fb328d1410adfeaff76f088bfd )\
sed -i 's|encs.push(encodings.pseudoEncodingQualityLevel0 + 6)|encs.push(encodings.pseudoEncodingQualityLevel0 + 2)|g' novnc/core/rfb.js\
sed -i 's|encs.push(encodings.pseudoEncodingCompressLevel0 + 2)|encs.push(encodings.pseudoEncodingCompressLevel0 + 6)|g' novnc/core/rfb.js\
sed -i 's|encs.push(encodings.pseudoEncodingCursor)|if(!this._viewOnly)encs.push(encodings.pseudoEncodingCursor)|g' novnc/core/rfb.js\
echo \"<head><meta http-equiv=\\\"refresh\\\" content=\\\"0; url=./vnc.html?view_only=1&show_dot=1&resize=scale\\\"/></head>\" > novnc/index.html\
"
},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=false,
}
view_only_pwd_script="view_pass=`< /dev/urandom tr -cd '[:alnum:]' | head -c12`\
echo __BEGIN_VIEWONLY__ > /tmp/x11vnc.passwd\
echo \"$view_pass\" >> /tmp/x11vnc.passwd\
echo \"*** View-only mode ***\"\
echo \"view-only password: $view_pass\"\
"
full_access_pwd_script="pass=`< /dev/urandom tr -cd '[:alnum:]' | head -c12`\
view_pass=`< /dev/urandom tr -cd '[:alnum:]' | head -c12`\
echo \"$pass\" > /tmp/x11vnc.passwd\
echo __BEGIN_VIEWONLY__ >> /tmp/x11vnc.passwd\
echo \"$view_pass\" >> /tmp/x11vnc.passwd\
echo \"*** full-access mode ***\"\
echo \"password: $pass\"\
echo \"view-only password: $view_pass\"\
"
view_only_vnc_script="0</dev/null &>$HOME/x11vnc.log x11vnc -passwdfile rm:/tmp/x11vnc.passwd -shared -viewonly -forever -localhost -nossl -noclipboard -nosetclipboard -threads -safer &\
vncpid=$!\
"
full_access_vnc_script="0</dev/null &>$HOME/x11vnc.log x11vnc -passwdfile rm:/tmp/x11vnc.passwd -shared -forever -localhost -nossl -noclipboard -nosetclipboard -threads -safer &\
vncpid=$!\
"
script_header="set -m\
wait_with_timeout () {\
local child_pid=$1\
local comm_wait=100\
while [[ -d /proc/$child_pid ]]\
do\
[[ $comm_wait -lt 1 ]] && return 1\
sleep 0.025\
comm_wait=$((comm_wait-1))\
done\
return 0\
}\
teardown () {\
trap '' TERM HUP INT\
echo asking vnc server to terminate && kill -SIGINT $vncpid\
echo asking novnc to terminate; kill -SIGINT $novncpid\
echo waiting for vnc server\
wait_with_timeout $vncpid\
echo waiting for novnc\
wait_with_timeout $novncpid\
echo terminating vnc server && pkill -g $vncpid -SIGKILL\
echo terminating novnc && pkill -g $novncpid -SIGKILL\
exit 0\
}\
trap 'teardown' TERM HUP INT\
[[ -f $HOME/keys/cert && -f $HOME/keys/key ]] && cat $HOME/keys/cert $HOME/keys/key > $HOME/keys/cert+key\
"
novnc_script="if [[ -f $HOME/keys/cert+key ]]; then\
0</dev/null &>$HOME/novnc.log ./novnc/utils/launch.sh --ssl-only --listen 63003 --cert $HOME/keys/cert+key &\
else\
0</dev/null &>$HOME/novnc.log ./novnc/utils/launch.sh --listen 63002 &\
fi\
novncpid=$!\
wait $novncpid\
echo novnc process was unexpectedly terminated\
teardown\
"
novnc_view_only={
exec="/bin/bash",
path="/home/sandboxer",
args={"-c", script_header .. view_only_pwd_script .. view_only_vnc_script .. novnc_script},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=true,
exclusive=true,
term_on_interrupt=true,
desktop={
name = "noVNC service (view-only)",
comment = "noVNC, sandbox uid "..config.sandbox_uid,
icon = loader.path.combine(tunables.datadir,"/home/sandboxer/novnc/app/images/icons","novnc-64x64.png"),
terminal = true,
startupnotify = false,
},
}
novnc_full_access={
exec="/bin/bash",
path="/home/sandboxer",
args={"-c", script_header .. full_access_pwd_script .. full_access_vnc_script .. novnc_script},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=true,
exclusive=true,
term_on_interrupt=true,
desktop={
name = "noVNC service (full access)",
comment = "noVNC, sandbox uid "..config.sandbox_uid,
icon = loader.path.combine(tunables.datadir,"/home/sandboxer/novnc/app/images/icons","novnc-64x64.png"),
terminal = true,
startupnotify = false,
},
}
acmesh_install={
exec="/bin/bash",
path="/home/sandboxer",
args={"-c","set -e\
rm -rf ./acme.sh\
git clone https://github.com/Neilpang/acme.sh.git acme.sh\
pushd ./acme.sh\
./acme.sh --install --nocron\
popd\
rm -rf ./acme.sh\
"},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=false,
}
acmesh_upgrade={
exec="/bin/bash",
path="/home/sandboxer",
args={"--login","-c","$HOME/.acme.sh/acme.sh --upgrade"},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=false,
}
function concat_nil(str,k)
if k ~= nil then
return str .. k
else
return str
end
end
-- you must provide domain as argument for issuing LetsEcnrypt certificate
-- example: sandboxer novnc-debian-sandbox.cfg.lua acmesh_issue example.com
-- also, you must forward port 80 traffic from your domain to local port 63000, and port 443 traffic to local port 63001
acmesh_issue={
exec="/bin/bash",
path="/home/sandboxer",
args={"--login","-c",concat_nil("mkdir -p $HOME/keys && $HOME/.acme.sh/acme.sh --cert-file $HOME/keys/cert --key-file $HOME/keys/key --ca-file $HOME/keys/ca --fullchain-file $HOME/keys/fullchain --keylength 4096 --accountkeylength 4096 --issue --standalone --tlsport 63001 --httpport 63000 -d ",loader.args[1])},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=false,
}
acmesh_test_issue={
exec="/bin/bash",
path="/home/sandboxer",
args={"--login","-c",concat_nil("mkdir -p $HOME/keys && $HOME/.acme.sh/acme.sh --cert-file $HOME/keys/cert --key-file $HOME/keys/key --ca-file $HOME/keys/ca --fullchain-file $HOME/keys/fullchain --keylength 4096 --accountkeylength 4096 --staging --issue --standalone --tlsport 63001 --httpport 63000 -d ",loader.args[1])},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=false,
}
acmesh_renew={
exec="/bin/bash",
path="/home/sandboxer",
args={"--login","-c","$HOME/.acme.sh/acme.sh --renew-all --standalone --tlsport 63001 --httpport 63000"},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=false,
}
acmesh_test_renew={
exec="/bin/bash",
path="/home/sandboxer",
args={"--login","-c","$HOME/.acme.sh/acme.sh --force --renew-all --staging --standalone --tlsport 63001 --httpport 63000"},
term_signal=defaults.signals.SIGTERM,
attach=true,
pty=false,
}
|
local class = require 'class'
local game = class('LightZeroSumGame')
function game:__init(sim, obs)
self.simulator = sim
if not obs then
error("Require obs param")
end
self.nPlayers = 2
self.state = self.simulator:new_state(obs)
self.r_t = torch.Tensor(self.nPlayers)
self.c_t = torch.Tensor(self.nPlayers)
self.lastRewards = self.r_t:clone()
self:reset()
end
function game:reset()
self.state:reset()
self.r_t:zero()
self.c_t:fill(1)
end
function game:player()
return self.state:player()
end
function game:act(action)
self.simulator:step(self.state, action, self.lastRewards)
self.r_t:addcmul(self.lastRewards, self.c_t)
if self.state.terminal then
self.c_t:mul(0)
self.state:reset()
end
local player = self:player()
local o_t = self.state:update_observation()
local r_t = self.r_t[player]
local c_t = self.c_t[player]
self.c_t[player] = 1
self.r_t[player] = 0
return o_t, r_t, c_t
end
return {LightZeroSum = game}
|
local ffi = require("ffi")
local libc = require("libc")
ffi.cdef[[
struct libv4l_dev_ops {
void * (*init)(int fd);
void (*close)(void *dev_ops_priv);
int (*ioctl)(void *dev_ops_priv, int fd, unsigned long int request, void *arg);
ssize_t (*read)(void *dev_ops_priv, int fd, void *buffer, size_t n);
ssize_t (*write)(void *dev_ops_priv, int fd, const void *buffer, size_t n);
/* For future plugin API extension, plugins implementing the current API
must set these all to NULL, as future versions may check for these */
void (*reserved1)(void);
void (*reserved2)(void);
void (*reserved3)(void);
void (*reserved4)(void);
void (*reserved5)(void);
void (*reserved6)(void);
void (*reserved7)(void);
};
]]
|
-----------------------------------
-- Area: Lower Delkfutt's Tower
-- NPC: Cermet Door
-- Cermet Door for Sandy Ambassador
-- San d'Orian Mission 3.3 "Appointment to Jeuno"
-- !pos 636 16 20 184
-----------------------------------
local ID = require("scripts/zones/Lower_Delkfutts_Tower/IDs")
require("scripts/globals/keyitems")
require("scripts/globals/missions")
require("scripts/globals/npc_util")
-----------------------------------
function onTrade(player, npc, trade)
if
player:getCurrentMission(SANDORIA) == tpz.mission.id.sandoria.APPOINTMENT_TO_JEUNO and
player:getCharVar("MissionStatus") == 4 and
npcUtil.tradeHas(trade, 549) -- Delkfutt Key
then
player:startEvent(0)
end
end
function onTrigger(player, npc)
local currentMission = player:getCurrentMission(SANDORIA)
if currentMission == tpz.mission.id.sandoria.APPOINTMENT_TO_JEUNO and player:getCharVar("MissionStatus") == 4 and not player:hasKeyItem(tpz.ki.DELKFUTT_KEY) then
player:messageSpecial(ID.text.THE_DOOR_IS_FIRMLY_SHUT_OPEN_KEY)
elseif currentMission == tpz.mission.id.sandoria.APPOINTMENT_TO_JEUNO and player:getCharVar("MissionStatus") == 4 and player:hasKeyItem(tpz.ki.DELKFUTT_KEY) then
player:startEvent(0)
else
player:messageSpecial(ID.text.DOOR_FIRMLY_SHUT)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
if csid == 0 then
player:setCharVar("MissionStatus", 5)
if not player:hasKeyItem(tpz.ki.DELKFUTT_KEY) then
npcUtil.giveKeyItem(player, tpz.ki.DELKFUTT_KEY)
player:confirmTrade()
end
end
end
|
GLib.Rendering.MatrixPushOperation = GLib.Enum (
{
Override = 1,
PreMultiply = 2,
PostMultiply = 3
}
)
|
local mod = DBM:NewMod(686, "DBM-Party-MoP", 3, 312)
local L = mod:GetLocalizedStrings()
local sndWOP = mod:SoundMM("SoundWOP")
mod:SetRevision(("$Revision: 9656 $"):sub(12, -3))
mod:SetCreatureID(56884)
mod:SetZone()
mod:RegisterCombat("combat")
mod:RegisterEventsInCombat(
"SPELL_AURA_APPLIED",
"SPELL_CAST_START",
"UNIT_SPELLCAST_SUCCEEDED boss1",
"SPELL_DAMAGE",
"SPELL_MISSED"
)
local warnRingofMalice = mod:NewSpellAnnounce(131521, 3)
local warnGrippingHatred = mod:NewSpellAnnounce(115002, 2)
local warnHazeofHate = mod:NewTargetAnnounce(107087, 4)
local warnRisingHate = mod:NewCastAnnounce(107356, 4, 5)
local specWarnGrippingHatred= mod:NewSpecialWarningSwitch("ej5817")
local specWarnHazeofHate = mod:NewSpecialWarningYou(107087)
local specWarnRisingHate = mod:NewSpecialWarningInterrupt(107356, not mod:IsHealer())
local specWarnDarkH = mod:NewSpecialWarningMove(112933)
local timerRingofMalice = mod:NewBuffActiveTimer(15, 131521)
local timerGrippingHartedCD = mod:NewNextTimer(45.5, 115002)
mod:AddBoolOption("InfoFrame", true)
local Hate = EJ_GetSectionInfo(5827)
function mod:OnCombatStart(delay)
if self.Options.InfoFrame then
DBM.InfoFrame:SetHeader(Hate)
DBM.InfoFrame:Show(5, "playerpower", 5, ALTERNATE_POWER_INDEX)
end
end
function mod:OnCombatEnd()
if self.Options.InfoFrame then
DBM.InfoFrame:Hide()
end
end
function mod:SPELL_AURA_APPLIED(args)
if args.spellId == 131521 then
warnRingofMalice:Show()
timerRingofMalice:Start()
elseif args.spellId == 107087 then
warnHazeofHate:Show(args.destName)
if args:IsPlayer() then
specWarnHazeofHate:Show()
sndWOP:Play("ex_mop_zhgg")--憎恨過高
end
elseif args.spellId == 107356 then
warnRisingHate:Show()
specWarnRisingHate:Show(args.destName)
end
end
function mod:SPELL_CAST_START(args)
if args.spellId == 115002 and self:AntiSpam(5, 2) then
warnGrippingHatred:Show()
specWarnGrippingHatred:Show()
timerGrippingHartedCD:Start()
sndWOP:Play("ex_mop_zqkd")--紫球快打
end
end
function mod:UNIT_SPELLCAST_SUCCEEDED(uId, _, _, _, spellId)
if spellId == 125891 then
DBM:EndCombat(self)
end
end
function mod:SPELL_DAMAGE(_, _, _, _, destGUID, _, _, _, spellId, _, _, _, overkill)
if spellId == 112933 and destGUID == UnitGUID("player") and self:AntiSpam(3, 2) then
specWarnDarkH:Show()
if not mod:IsTank() then
sndWOP:Play("runaway")--快躲開
end
end
end
mod.SPELL_MISSED = mod.SPELL_DAMAGE
|
img_open(":memory:")
|
class 'PanauDrivers'
function PanauDrivers:__init()
self.markers = true
self.flooder = true
self.locationsVisible = true
self.locationsAutoHide = true
self.locations = {}
self.availableJob = nil
self.availableJobKey = 0
self.taskscomplatedcount = 0
self.job = nil
self.jobUpdateTimer = Timer()
self.opcolor = Color( 251, 184, 41 )
self.jobcolor = Color( 192, 255, 192 )
if LocalPlayer:GetValue( "Lang" ) and LocalPlayer:GetValue( "Lang" ) == "ENG" then
self:Lang()
else
self.rewardtip = "Награда: $"
self.vehicletip = "Транспорт: "
self.delivto = "Доставить к "
self.target = "● Цель: "
self.taskstartedtxt = "Задание начато!"
self.taskfailedtxt = "Задание провалено!"
self.taskcompletedtxt = "Задание выполнено!"
self.taskcomplatedcounttxt = "Заданий выполнено: "
end
self.window = Rectangle.Create()
self.window:SetColor( Color( 0, 0, 0, 200 ) )
self.window:SetSize( Vector2( 300, 110 ))
self.window:SetPositionRel( Vector2( 0.5, 0.8 ) - self.window:GetSizeRel()/2 )
self.window:SetVisible( false )
self.descriptionLabel = Label.Create( self.window )
self.descriptionLabel:SetDock( GwenPosition.Fill )
self.windowL1 = Label.Create( self.descriptionLabel, "job description" )
self.windowL2 = Label.Create( self.descriptionLabel, "job money" )
self.windowL3 = Label.Create( self.descriptionLabel, "job vehicle" )
self.windowButton = Rectangle.Create( self.window, "job start" )
self.StartJobLabel = Label.Create( self.windowButton, "job start" )
self.descriptionLabel:SetMargin( Vector2( 5, 10 ), Vector2( 5, 5 ) )
self.windowL2:SetText( self.rewardtip .. "777" )
self.windowL2:SetTextColor( self.opcolor )
self.windowL2:SetSize( Vector2( 290, 16 ))
self.windowL2:SetTextSize( 15 )
self.windowL3:SetText( self.vehicletip .. "Вилка" )
self.windowL3:SetSize( Vector2( 290, 16 ))
self.windowL3:SetPosition( Vector2( 0, self.windowL2:GetPosition().y + 20 ))
self.windowL1:SetText( "-" )
self.windowL1:SetSize( Vector2( 290, 30 ) )
self.windowL1:SetPosition( Vector2( 0, self.windowL3:GetPosition().y + 15 ) )
self.StartJobLabel:SetText( "Нажмите J, чтобы начать задание" )
self.StartJobLabel:SetDock( GwenPosition.Top )
self.StartJobLabel:SetTextSize( 15 )
self.StartJobLabel:SetMargin( Vector2( 0, 6 ), Vector2() )
self.StartJobLabel:SetAlignment( GwenPosition.CenterH )
self.StartJobLabel:SizeToContents()
self.windowButton:SetColor( Color( 255, 255, 255, 30 ) )
self.windowButton:SetDock( GwenPosition.Top )
self.windowButton:SetHeight( 25 )
Network:Subscribe( "Locations", self, self.Locations )
Network:Subscribe( "Jobs", self, self.Jobs )
Network:Subscribe( "JobStart", self, self.JobStart )
Network:Subscribe( "JobFinish", self, self.JobFinish )
Network:Subscribe( "JobsUpdate", self, self.JobsUpdate )
Network:Subscribe( "JobCancel", self, self.JobCancel )
Events:Subscribe( "Lang", self, self.Lang )
Events:Subscribe( "Render", self, self.Render )
Events:Subscribe( "Render", self, self.GameRender )
Events:Subscribe( "GameRenderOpaque", self, self.GameRenderOpaque )
if not self.LocalPlayerInputEvent then
self.LocalPlayerInputEvent = Events:Subscribe( "LocalPlayerInput", self, self.LocalPlayerInput )
end
if not self.KeyUpEvent then
self.KeyUpEvent = Events:Subscribe( "KeyUp", self, self.KeyUp )
end
end
function PanauDrivers:Lang()
if self.StartJobLabel then
self.StartJobLabel:SetText( "Press J to start task" )
end
self.rewardtip = "Reward: $"
self.vehicletip = "Vehicle: "
self.delivto = "Deliver to "
self.target = "● Objective: "
self.taskstartedtxt = "Task started!"
self.taskfailedtxt = "Task failed!"
self.taskcompletedtxt = "Task completed!"
self.taskcomplatedcounttxt = "Tasks completed: "
end
function PanauDrivers:Locations( args )
self.locations = args
end
function PanauDrivers:Jobs( args )
self.jobsTable = args
end
function PanauDrivers:JobsUpdate( args )
if self.jobsTable then
self.jobsTable[args[1]] = args[2]
end
end
function PanauDrivers:JobStart( args )
self.job = args
Waypoint:SetPosition(self.locations[self.job.destination].position)
if self.locationsAutoHide == true then
Events:Fire( "CastCenterText", { text = self.taskstartedtxt, time = 6, color = Color( 0, 255, 0 ) } )
self.sound = ClientSound.Create(AssetLocation.Game, {
bank_id = 25,
sound_id = 47,
position = Camera:GetPosition(),
angle = Camera:GetAngle()
})
self.sound:SetParameter(0,1)
self.locationsVisible = false
if not self.PreTickEvent then
self.jobCompleteTimer = Timer()
self.PreTickEvent = Events:Subscribe( "PreTick", self, self.PreTick )
end
end
if self.LocalPlayerInputEvent then
Events:Unsubscribe( self.LocalPlayerInputEvent )
self.LocalPlayerInputEvent = nil
end
if self.KeyUpEvent then
Events:Unsubscribe( self.KeyUpEvent )
self.KeyUpEvent = nil
end
end
function PanauDrivers:JobFinish( args )
if self.job != nil then
self.markers = true
Events:Fire( "CastCenterText", { text = self.taskcompletedtxt, time = 6, color = Color( 0, 255, 0 ) } )
self.sound = ClientSound.Create(AssetLocation.Game, {
bank_id = 25,
sound_id = 45,
position = Camera:GetPosition(),
angle = Camera:GetAngle()
})
self.sound:SetParameter(0,1)
self.flooder = true
Waypoint:Remove()
self.job = nil
self.taskscomplatedcount = self.taskscomplatedcount + 1
Game:ShowPopup( self.taskcomplatedcounttxt .. self.taskscomplatedcount, true )
end
if self.locationsAutoHide == true then
self.locationsVisible = true
end
if self.PreTickEvent then
Events:Unsubscribe( self.PreTickEvent )
self.PreTickEvent = nil
self.jobCompleteTimer = nil
end
if not self.LocalPlayerInputEvent then
self.LocalPlayerInputEvent = Events:Subscribe( "LocalPlayerInput", self, self.LocalPlayerInput )
end
if not self.KeyUpEvent then
self.KeyUpEvent = Events:Subscribe( "KeyUp", self, self.KeyUp )
end
end
function PanauDrivers:JobCancel( args )
if self.job != nil then
self.markers = true
Events:Fire( "CastCenterText", { text = self.taskfailedtxt, time = 6, color = Color.Red } )
self.sound = ClientSound.Create(AssetLocation.Game, {
bank_id = 25,
sound_id = 46,
position = Camera:GetPosition(),
angle = Camera:GetAngle()
})
self.sound:SetParameter(0,1)
self.flooder = true
Waypoint:Remove()
self.job = nil
end
if self.locationsAutoHide == true then
self.locationsVisible = true
end
if self.PreTickEvent then
Events:Unsubscribe( self.PreTickEvent )
self.PreTickEvent = nil
self.jobCompleteTimer = nil
end
if not self.LocalPlayerInputEvent then
self.LocalPlayerInputEvent = Events:Subscribe( "LocalPlayerInput", self, self.LocalPlayerInput )
end
if not self.KeyUpEvent then
self.KeyUpEvent = Events:Subscribe( "KeyUp", self, self.KeyUp )
end
end
function PanauDrivers:PreTick( args )
if self.jobCompleteTimer and self.jobCompleteTimer:GetSeconds() > 1 and self.job != nil and LocalPlayer:GetVehicle() != nil then
self.jobCompleteTimer:Restart()
pVehicle = LocalPlayer:GetVehicle()
jDist = self.locations[self.job.destination].position:Distance( pVehicle:GetPosition() )
if jDist < 20 then
Network:Send( "CompleteJob", nil )
end
end
end
function PanauDrivers:KeyUp( a )
if Game:GetState() ~= GUIState.Game then return end
local args = {}
args.job = self.availableJobKey
if a.key == string.byte("J") and args.job != 0 then
Network:Send( "TakeJob", args )
self.StartJobLabel:SetTextColor( Color( 255, 0, 0 ) )
else
self.StartJobLabel:SetTextColor( Color( 255, 255, 255 ) )
self.flooder = true
end
end
function PanauDrivers:LocalPlayerInput( a )
if Game:GetState() ~= GUIState.Game then return end
local args = {}
args.job = self.availableJobKey
if Game:GetSetting(GameSetting.GamepadInUse) == 1 then
if self.flooder then
if a.input == Action.EquipBlackMarketBeacon and args.job != 0 then
Network:Send( "TakeJob", args )
self.StartJobLabel:SetTextColor( Color( 255, 0, 0 ) )
self.flooder = false
else
self.StartJobLabel:SetTextColor( Color( 255, 255, 255 ) )
end
end
end
end
function PanauDrivers:DrawLocation(k, v, dist, dir, jobDistance)
if self.locationsVisible == true and dist <= 100 and self.job == nil then
t2 = Transform3()
local upAngle = Angle(0, math.pi/2, 0)
local textAlpha = 255
if dist >= 10 then
textAlpha = - dist * 2.55
end
t2:Translate(v.position):Rotate(upAngle)
Render:SetTransform(t2)
Render:DrawCircle( Vector3.Zero, 3, Color( 255, 255, 255, textAlpha ) )
end
end
function PanauDrivers:DrawLocation2(k, v, dist, dir, jobDistance)
if dist >= 100 then return end
local pos = v.position + Vector3( 0, 3, 0 )
local angle = Angle( Camera:GetAngle().yaw, 0, math.pi ) * Angle( math.pi, 0, 0 )
local textSize = 100
local textScale = 0.005
local textAlpha = 255
if dist >= 10 then
textAlpha = - dist * 2.55
end
local text = v.name
local textBoxScale = Render:GetTextSize( text, textSize )
local t = Transform3()
t:Translate( pos )
t:Scale( textScale )
t:Rotate( angle )
t:Translate( -Vector3( textBoxScale.x, textBoxScale.y, 0 )/2 )
Render:SetTransform( t )
if self.job == nil then
if self.locationsVisible == true then
Render:DrawText( Vector3( 0, 0, 0 ), text, Color( 255, 255, 255, textAlpha ), textSize ) end
if self.locationsVisible == true then
if self.job == nil then
local arrowColor = Color( 0, 0, 0 , 128 )
if jobDistance < 1000 then
arrowColor = Color( 64, 255, 128, 58 )
elseif jobDistance < 2000 then
arrowColor = Color( 128, 255, 196, 58 )
elseif jobDistance < 4000 then
arrowColor = Color( 128, 255, 0, 58 )
elseif jobDistance < 6000 then
arrowColor = Color( 255, 255, 0, 58 )
elseif jobDistance < 8000 then
arrowColor = Color( 255, 128, 0, 58 )
elseif jobDistance < 10000 then
arrowColor = Color( 255, 128, 0, 58 )
elseif jobDistance < 14000 then
arrowColor = Color( 255, 0, 0, 58 )
else
arrowColor = Color( 128, 0, 255, 58 )
end
Render:ResetTransform()
end
end
end
Render:ResetTransform()
if dist <= 5 and self.job == nil then
local theJob = self.jobsTable[k]
if self.jobUpdateTimer:GetSeconds() > 1 then
self.windowL1:SetText( self.delivto .. theJob.description )
self.windowL1:SetTextColor( self.jobcolor )
self.windowL2:SetText( self.rewardtip .. tostring(theJob.reward) )
self.windowL2:SetTextColor( self.opcolor )
self.windowL3:SetText( self.vehicletip .. Vehicle.GetNameByModelId(theJob.vehicle) )
self.jobUpdateTimer:Restart()
end
if Game:GetState() ~= GUIState.Game then return end
if LocalPlayer:GetValue( "SystemFonts" ) then
self.windowL2:SetFont( AssetLocation.SystemFont, "Impact")
self.StartJobLabel:SetFont( AssetLocation.SystemFont, "Impact")
end
self.window:SetVisible( true )
self.availableJobKey = k
self.availableJob = theJob
end
end
function PanauDrivers:Render()
if LocalPlayer:GetWorld() ~= DefaultWorld then return end
if not LocalPlayer:GetValue( "JobsVisible" ) then return end
if self.sound then
self.sound:SetPosition( Camera:GetPosition() )
self.sound:SetParameter( 0, Game:GetSetting(GameSetting.MusicVolume) / 100 )
end
if Game:GetState() ~= GUIState.Game then return end
if self.jobsTable != nil then
for k, v in ipairs(self.locations) do
local camPos = Camera:GetPosition()
local jobToRender = self.jobsTable[k]
if v.position.x > camPos.x - 1028 and v.position.x < camPos.x + 1028 and v.position.z > camPos.z - 1028 and v.position.z < camPos.z + 1028 and jobToRender.direction != nil then
local mapPos = Render:WorldToMinimap( Vector3( v.position.x, v.position.y, v.position.z ) )
if self.markers and LocalPlayer:GetValue( "JobsMarkersVisible" ) then
Render:DrawCircle( mapPos, Render.Size.x / 450, Color( 0, 0, 0, Game:GetSetting(4) * 2.25 ) )
Render:DrawCircle( mapPos, Render.Size.x / 650, Color( 255, 255, 255, Game:GetSetting(4) * 2.25 ) )
Render:FillCircle( mapPos, Render.Size.x / 650, Color( 255, 255, 255, Game:GetSetting(4) * 2.25 / 4 ) )
end
end
end
end
if self.job != nil then
self.markers = false
if LocalPlayer:GetValue( "SystemFonts" ) then
Render:SetFont( AssetLocation.SystemFont, "Impact" )
end
local textPos = Vector2( Render.Width / 2, Render.Height * 0.07 )
local text = self.target .. self.delivto .. self.job.description
textPos = textPos - Vector2( Render:GetTextWidth( text ) / 2, 0 )
Render:DrawText( textPos + Vector2.One, text, Color( 0, 0, 0, 80 ) )
Render:DrawText( textPos, text, Color( 192, 255, 192 ))
destPos = self.locations[self.job.destination].position
destDist = Vector3.Distance(destPos, LocalPlayer:GetPosition())
if destDist < 500 then
t2 = Transform3()
local upAngle = Angle( 0, math.pi/2, 0)
t2:Translate(destPos):Rotate(upAngle)
Render:SetTransform(t2)
Render:DrawCircle( Vector3( 0, 0, 0 ), 10, Color( 64, 255, 64, 64 ) )
end
pVehicle = LocalPlayer:GetVehicle()
if pVehicle != nil then
local multiArrow = 1
while (multiArrow > 0) do
arrowDir = pVehicle:GetPosition() - destPos
arrowDir:Normalize()
arrowDir = arrowDir + Vector3( 0, .1, 0 )
arrowDir.y = -arrowDir.y
arrowDir.z = -arrowDir.z
arrowDir.x = -arrowDir.x
local arrowAxis = Vector3( 0, 1, 0 )
if (multiArrow == 3) then
arrowAxis = Vector3( 0, 0, 1 )
end
if (multiArrow == 2) then
arrowAxis = Vector3( 1, 0, 0 )
end
dirCp = arrowDir:Cross( arrowAxis )
dirCn = arrowAxis:Cross( arrowDir )
Render:ResetTransform()
arrowScale = Render.Height * .05
arrow1 = dirCp * arrowScale * 2
arrow2 = dirCn * arrowScale * 2
arrow3 = Vector3( 0, 0, 0 ) - ( arrowDir * arrowScale * 2 )
shaft1 = dirCp * arrowScale
shaft2 = dirCn * arrowScale
shaft3 = shaft1 + ( arrowDir * arrowScale * 2 )
shaft4 = shaft2 + ( arrowDir * arrowScale * 2 )
local ang = Camera:GetAngle():Inverse()
arrow1 = ang * arrow1
arrow2 = ang * arrow2
arrow3 = ang * arrow3
shaft1 = ang * shaft1
shaft2 = ang * shaft2
shaft3 = ang * shaft3
shaft4 = ang * shaft4
center = Vector2( Render.Width / 2, Render.Height / 3 )
arrow1 = Vector2( -arrow1.x, arrow1.y) + center
arrow2 = Vector2( -arrow2.x, arrow2.y) + center
arrow3 = Vector2( -arrow3.x, arrow3.y) + center
shaft1 = Vector2( -shaft1.x, shaft1.y ) + center
shaft2 = Vector2( -shaft2.x, shaft2.y ) + center
shaft3 = Vector2( -shaft3.x, shaft3.y ) + center
shaft4 = Vector2( -shaft4.x, shaft4.y ) + center
local arrowColor = Color( 5, 255, 64, 128 )
Render:FillTriangle( arrow1, arrow2, arrow3, arrowColor )
Render:FillTriangle( shaft1, shaft2, shaft3, arrowColor )
Render:FillTriangle( shaft2, shaft3, shaft4, arrowColor )
multiArrow = multiArrow - 1
end
end
end
end
function PanauDrivers:GameRender()
if LocalPlayer:GetWorld() ~= DefaultWorld then return end
if not LocalPlayer:GetValue( "JobsVisible" ) then return end
availableJob = nil
self.window:SetVisible( false )
if Game:GetState() ~= GUIState.Game then return end
if self.jobsTable != nil then
for k, v in ipairs(self.locations) do
local camPos = Camera:GetPosition()
local jobToRender = self.jobsTable[k]
if v.position.x > camPos.x - 1028 and v.position.x < camPos.x + 1028 and v.position.z > camPos.z - 1028 and v.position.z < camPos.z + 1028 and jobToRender.direction != nil then
if LocalPlayer:GetValue( "SystemFonts" ) then
Render:SetFont( AssetLocation.SystemFont, "Impact" )
end
self:DrawLocation2( k, v, v.position:Distance2D( Camera:GetPosition()), jobToRender.direction, jobToRender.distance )
end
end
end
end
function PanauDrivers:GameRenderOpaque()
if LocalPlayer:GetWorld() ~= DefaultWorld then return end
if Game:GetState() ~= GUIState.Game then return end
if not LocalPlayer:GetValue( "JobsVisible" ) then return end
if self.jobsTable != nil then
for k, v in ipairs(self.locations) do
local camPos = Camera:GetPosition()
local jobToRender = self.jobsTable[k]
if v.position.x > camPos.x - 1028 and v.position.x < camPos.x + 1028 and v.position.z > camPos.z - 1028 and v.position.z < camPos.z + 1028 and jobToRender.direction != nil then
if LocalPlayer:GetValue( "SystemFonts" ) then
Render:SetFont( AssetLocation.SystemFont, "Impact" )
end
self:DrawLocation( k, v, v.position:Distance2D( Camera:GetPosition()), jobToRender.direction, jobToRender.distance )
end
end
end
end
panaudrivers = PanauDrivers()
|
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
TriggerEvent('es:addGroupCommand', 'menu', 'admin', function(source)
TriggerClientEvent('bm_spectate:openMenu', source)
end)
TriggerEvent('es:addGroupCommand', 'ping', 'user', function(source)
TriggerClientEvent('chatMessage', source, 'PING', {255, 255, 0}, "Tienes "..GetPlayerPing(source).."ms de ping")
end)
RegisterServerEvent('bm_adminSystemv2:banUser')
AddEventHandler('bm_adminSystemv2:banUser', function(jugador, duracion, razon)
local license,identifier,liveid,xblid,discord,playerip
local target = tonumber(jugador)
local duree = tonumber(duracion)
local reason = razon
if reason == "" then
reason = "Has sido baneado del servidor"
end
if target and target > 0 then
local ping = GetPlayerPing(target)
if duree and duree < 365 then
local user = ESX.GetPlayerFromId(target)
local sourceplayername = GetPlayerName(source)
local targetplayername = GetPlayerName(target)
for k,v in ipairs(GetPlayerIdentifiers(target))do
if string.sub(v, 1, string.len("license:")) == "license:" then
license = v
elseif string.sub(v, 1, string.len("steam:")) == "steam:" then
identifier = v
elseif string.sub(v, 1, string.len("live:")) == "live:" then
liveid = v
elseif string.sub(v, 1, string.len("xbl:")) == "xbl:" then
xblid = v
elseif string.sub(v, 1, string.len("discord:")) == "discord:" then
discord = v
elseif string.sub(v, 1, string.len("ip:")) == "ip:" then
playerip = v
end
end
if user.getGroup() ~= 'Developer' or user.getGroup() ~= "Dueño" then
if duree > 0 then
TriggerEvent('baneos:banPlayer', source,license,identifier,liveid,xblid,discord,playerip,targetplayername,sourceplayername,duree,reason,0) --Timed ban here
DropPlayer(target, "Has sido baneado del servidor motivo: " .. reason)
else
TriggerEvent('baneos:banPlayer', source,license,identifier,liveid,xblid,discord,playerip,targetplayername,sourceplayername,duree,reason,1) --Perm ban here
DropPlayer(target, "Has sido baneado permanentemente del servidor motivo: " .. reason)
end
else
TriggerEvent('bansql:sendMessage', source, "No puedes banear a alguien de tanto nivel")
end
else
TriggerEvent('bansql:sendMessage', source, "Tiempo invalido")
end
else
TriggerEvent('bansql:sendMessage', source, "ID Invalida")
end
end)
|
--[[
Designed and written in it's entirety by Kironte (roblox.com/users/49703460/profile).
Made for the Roblox Neural Network Library.
For documentation and the open source license, refer to: github.com/Kironte/Roblox-Neural-Network-Library
Last updated 10/13/2020
]]
local Package = script:FindFirstAncestorOfClass("Folder")
local Base = require(Package.BaseRedirect)
local Optimizer = require(Package.Optimizer)
--local Adam = Base.new("Adam")
local Adam = Base.newExtends("Adam",Optimizer)
function Adam.new(decayConstant1,decayConstant2,epsilon)
--local obj = Adam:make()
local obj = Adam:super()
obj.Epsilon = epsilon or 10^(-7)
obj.DecayConstant1 = decayConstant1 or 0.9
obj.DecayConstant2 = decayConstant2 or 0.999
obj.FirstMoment = {}
obj.SecondMoment = {}
return obj
end
function Adam:Calculate(node,inputValue,gradient,id)
local network = self.Network
local backProp = network:GetBackPropagator()
local learningRate = node:GetLearningRate()
local gradient = gradient or backProp:GetGradient(node)
inputValue = inputValue or 1
id = id or node:GetID()
--Initialize
self.FirstMoment[id] = self.FirstMoment[id] or {Moment = 0, Time = 1}
self.SecondMoment[id] = self.SecondMoment[id] or {Moment = 0}
--Calculate new moments
local timeStep = self.FirstMoment[id].Time
self.FirstMoment[id].Moment = (1 - self.DecayConstant1) * gradient + self.DecayConstant1 * self.FirstMoment[id].Moment
self.SecondMoment[id].Moment = (1 - self.DecayConstant2) * gradient^2 + self.DecayConstant2 * self.SecondMoment[id].Moment
local firstMoment,secondMoment = self.FirstMoment[id].Moment,self.SecondMoment[id].Moment
--Compute biased moments
local biasedFirstMoment = firstMoment / (1 - self.DecayConstant1^timeStep)
local biasedSecondMoment = secondMoment / (1 - self.DecayConstant2^timeStep)
local newChange = -learningRate * biasedFirstMoment / (math.sqrt(biasedSecondMoment) + self.Epsilon) * inputValue
self.FirstMoment[id].Time += 1
return newChange
end
return Adam
|
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by shuieryin.
--- DateTime: 12/01/2018 10:17 PM
---
function kMeansInitCentroids(X, K)
--KMEANSINITCENTROIDS This function initializes K centroids that are to be
--used in K-Means on the dataset X
-- centroids = KMEANSINITCENTROIDS(X, K) returns K initial centroids to be
-- used with the K-Means on the dataset X
local m = X:size(1)
local n = X:size(2)
-- You should return this values correctly
local centroids = torch.zeros(K, n)
-- ====================== YOUR CODE HERE ======================
-- Instructions: You should set centroids to randomly chosen examples from
-- the dataset X
-- Initialize the centroids to be random examples
-- Randomly reorder the indices of examples
-- =============================================================
return centroids
end
|
-- init
local library = loadstring(game:HttpGet("https://raw.githubusercontent.com/GreenDeno/Venyx-UI-Library/main/source.lua"))()
local venyx = library.new("SS", 5013109572)
-- themes
local themes = {
Background = Color3.fromRGB(24, 24, 24),
Glow = Color3.fromRGB(0, 0, 0),
Accent = Color3.fromRGB(10, 10, 10),
LightContrast = Color3.fromRGB(20, 20, 20),
DarkContrast = Color3.fromRGB(14, 14, 14),
TextColor = Color3.fromRGB(255, 255, 255)
}
-- first page
local page = venyx:addPage("LocalPlayer", 5012544693)
local section1 = page:addSection("Section 1")
local section2 = page:addSection("Section 2")
local teleport = venyx:addPage("Teleport", 5012543246)
local planets = teleport:addSection("Planets")
planets:addButton("Teleport to Earth", function()
game:GetService("TeleportService"):Teleport(5000143962)
end)
planets:addButton("Teleport to ISS", function()
game:GetService("TeleportService"):Teleport(5977563976)
end)
planets:addButton("Teleport to Moon", function()
game:GetService("TeleportService"):Teleport(5534753074)
end)
planets:addButton("Teleport to Mars", function()
game:GetService("TeleportService"):Teleport(6119982580)
end)
planets:addButton("Teleport to Ceres", function()
game:GetService("TeleportService"):Teleport(6669650377)
end)
-- third page
local Settings = venyx:addPage("Settings", 5012544693)
local colors = Settings:addSection("Colors")
local other = Settings:addSection("Other")
for theme, color in pairs(themes) do -- all in one theme changer, i know, im cool
colors:addColorPicker(theme, color, function(color3)
venyx:setTheme(theme, color3)
end)
end
other:addKeybind("Toggle Keybind", Enum.KeyCode.RightAlt, function()
venyx:toggle()
end, function()
end)
other:addButton("Delete Gui", function()
game.CoreGui["SS"]:Destroy()
end)
-- load
venyx:SelectPage(venyx.pages[1], true)
|
local skynet = require "skynet"
skynet.start(function()
print("Log server start")
local service = skynet.newservice("service_mgr")
skynet.monitor "simplemonitor"
local log = skynet.newservice("globallog")
skynet.exit()
end)
|
return function()
local onNextEvent = require(script.Parent.onNextEvent)
it("should stop listening after the event fires", function()
local bindable = Instance.new("BindableEvent")
local callCount = 0
onNextEvent(bindable.Event, function()
callCount = callCount + 1
end)
bindable:Fire()
bindable:Fire()
expect(callCount).to.equal(1)
end)
end
|
local SLAXML = require "slaxml"
local xml_parser = {}
local root = {}
local ele_list = {}
local function start_element(name, nsURI, nsPrefix)
local ele = {}
table.insert(ele_list, ele)
end
local function attribute(name, value, nsURI, nsPrefix)
local ele = ele_list[#ele_list]
local prop = ele["prop"] or {}
prop[name] = value
ele["prop"] = prop
end
local function close_element(name, nsURI)
local ele = ele_list[#ele_list]
if #ele_list > 1 then
local ele_p = ele_list[#ele_list - 1]
ele_p[name] = ele
else
root[name] = ele
end
table.remove(ele_list, #ele_list)
end
local function text(t)
local ele = ele_list[#ele_list]
ele["value"] = t
end
local function comment(content)
end
local function pi(target, content)
end
function xml_parser:parse_xml_text(t)
local parser = SLAXML:parser{
startElement = start_element,
attribute = attribute,
closeElement = close_element,
text = text,
comment = comment,
pi = pi,
}
print('parse_text:', t)
parser:parse(t, {stripWhitespace=true})
return root
end
return xml_parser
|
-- Nmobs cow.lua
-- Copyright Duane Robertson (duane@duanerobertson.com), 2017
-- Distributed under the LGPLv2.1 (https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)
-- The nodebox and textures are copied from Cute Cubic Mobs
-- https://github.com/Napiophelios/ccmobs
-- and are distributed as Public Domain (WTFPL).
nmobs.register_mob({
diurnal = true,
hit_dice = 3,
looks_for = {'default:dirt_with_grass'},
media_prefix = 'ccmobs',
name = 'cow',
nodebox = {
{-0.3125, -0.25, -0.4375, 0.3125, 0.3125, 0.1875},
{-0.1875, -0.0625, 0.1875, 0.1875, 0.1875, 0.25},
{-0.1875, -0.125, 0.25, 0.1875, 0.125, 0.5625},
{-0.3125, 0.125, 0.25, 0.3125, 0.1875, 0.375},
{-0.1875, -0.1875, 0.25, 0.1875, 0.1875, 0.4375},
{-0.125, -0.25, 0.1875, 0.125, 0.1875, 0.3125},
{-0.25, -0.5, -0.0625, -0.0625, -0.1875, 0.125},
{0.0625, -0.5, -0.0625, 0.25, -0.0625, 0.125},
{-0.25, -0.5, -0.375, -0.0625, -0.1875, -0.1875},
{0.0625, -0.5, -0.375, 0.25, -0.25, -0.1875},
{-0.0276272, -0.1875, -0.478997, 0.0376734, 0.1875, -0.4375},
{-0.125, 0.1875, 0.1875, 0.125, 0.25, 0.375}
},
size = 1.5,
sound = 'ccmobs_cow',
tames = {'farming:wheat'},
})
|
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local mod = E:GetModule('NamePlates')
local LSM = E.Libs.LSM
local ipairs, next, pairs, rawget, rawset, select = ipairs, next, pairs, rawget, rawset, select
local setmetatable, tostring, tonumber, type, unpack = setmetatable, tostring, tonumber, type, unpack
local gsub, tinsert, tremove, sort, wipe = gsub, tinsert, tremove, sort, wipe
local GetInstanceInfo = GetInstanceInfo
local GetLocale = GetLocale
local GetRaidTargetIndex = GetRaidTargetIndex
local GetSpecializationInfo = GetSpecializationInfo
local GetSpellCharges = GetSpellCharges
local GetSpellCooldown = GetSpellCooldown
local GetSpellInfo = GetSpellInfo
local GetTalentInfo = GetTalentInfo
local GetTime = GetTime
local IsResting = IsResting
local PowerBarColor = PowerBarColor
local UnitAffectingCombat = UnitAffectingCombat
local UnitExists = UnitExists
local UnitHealth = UnitHealth
local UnitHealthMax = UnitHealthMax
local UnitInVehicle = UnitInVehicle
local UnitIsOwnerOrControllerOfUnit = UnitIsOwnerOrControllerOfUnit
local UnitIsPVP = UnitIsPVP
local UnitIsQuestBoss = UnitIsQuestBoss
local UnitIsTapDenied = UnitIsTapDenied
local UnitIsUnit = UnitIsUnit
local UnitLevel = UnitLevel
local UnitPower = UnitPower
local UnitPowerMax = UnitPowerMax
local UnitThreatSituation = UnitThreatSituation
local UnitCanAttack = UnitCanAttack
local hooksecurefunc = hooksecurefunc
local C_Timer_NewTimer = C_Timer.NewTimer
local C_SpecializationInfo_GetPvpTalentSlotInfo = C_SpecializationInfo.GetPvpTalentSlotInfo
local unitExists = E.oUF.Private.unitExists
local FallbackColor = {r=1, b=1, g=1}
mod.TriggerConditions = {
reactions = {'hated', 'hostile', 'unfriendly', 'neutral', 'friendly', 'honored', 'revered', 'exalted'},
raidTargets = {'star', 'circle', 'diamond', 'triangle', 'moon', 'square', 'cross', 'skull'},
frameTypes = {
['FRIENDLY_PLAYER'] = 'friendlyPlayer',
['FRIENDLY_NPC'] = 'friendlyNPC',
['ENEMY_PLAYER'] = 'enemyPlayer',
['ENEMY_NPC'] = 'enemyNPC',
['PLAYER'] = 'player'
},
roles = {
['TANK'] = 'tank',
['HEALER'] = 'healer',
['DAMAGER'] = 'damager'
},
keys = {
Modifier = IsModifierKeyDown,
Shift = IsShiftKeyDown,
Alt = IsAltKeyDown,
Control = IsControlKeyDown,
LeftShift = IsLeftShiftKeyDown,
LeftAlt = IsLeftAltKeyDown,
LeftControl = IsLeftControlKeyDown,
RightShift = IsRightShiftKeyDown,
RightAlt = IsRightAltKeyDown,
RightControl = IsRightControlKeyDown,
},
tankThreat = {
[0] = 3, 2, 1, 0
},
threat = {
[-3] = 'offTank',
[-2] = 'offTankBadTransition',
[-1] = 'offTankGoodTransition',
[0] = 'good',
[1] = 'badTransition',
[2] = 'goodTransition',
[3] = 'bad'
},
difficulties = {
-- dungeons
[1] = 'normal',
[2] = 'heroic',
[8] = 'mythic+',
[23] = 'mythic',
[24] = 'timewalking',
-- raids
[7] = 'lfr',
[17] = 'lfr',
[14] = 'normal',
[15] = 'heroic',
[16] = 'mythic',
[33] = 'timewalking',
[3] = 'legacy10normal',
[4] = 'legacy25normal',
[5] = 'legacy10heroic',
[6] = 'legacy25heroic',
}
}
do -- E.CreatureTypes; Do *not* change the value, only the key (['key'] = 'value').
local c, locale = {}, GetLocale()
if locale == 'frFR' then
c['Aberration'] = 'Aberration'
c['Bête'] = 'Beast'
c['Bestiole'] = 'Critter'
c['Démon'] = 'Demon'
c['Draconien'] = 'Dragonkin'
c['Élémentaire'] = 'Elemental'
c['Nuage de gaz'] = 'Gas Cloud'
c['Géant'] = 'Giant'
c['Humanoïde'] = 'Humanoid'
c['Machine'] = 'Mechanical'
c['Non spécifié'] = 'Not specified'
c['Totem'] = 'Totem'
c['Mort-vivant'] = 'Undead'
c['Mascotte sauvage'] = 'Wild Pet'
c['Familier pacifique'] = 'Non-combat Pet'
elseif locale == 'deDE' then
c['Anomalie'] = 'Aberration'
c['Wildtier'] = 'Beast'
c['Kleintier'] = 'Critter'
c['Dämon'] = 'Demon'
c['Drachkin'] = 'Dragonkin'
c['Elementar'] = 'Elemental'
c['Gaswolke'] = 'Gas Cloud'
c['Riese'] = 'Giant'
c['Humanoid'] = 'Humanoid'
c['Mechanisch'] = 'Mechanical'
c['Nicht spezifiziert'] = 'Not specified'
c['Totem'] = 'Totem'
c['Untoter'] = 'Undead'
c['Ungezähmtes Tier'] = 'Wild Pet'
c['Haustier'] = 'Non-combat Pet'
elseif locale == 'koKR' then
c['돌연변이'] = 'Aberration'
c['야수'] = 'Beast'
c['동물'] = 'Critter'
c['악마'] = 'Demon'
c['용족'] = 'Dragonkin'
c['정령'] = 'Elemental'
c['가스'] = 'Gas Cloud'
c['거인'] = 'Giant'
c['인간형'] = 'Humanoid'
c['기계'] = 'Mechanical'
c['기타'] = 'Not specified'
c['토템'] = 'Totem'
c['언데드'] = 'Undead'
c['야생 애완동물'] = 'Wild Pet'
c['애완동물'] = 'Non-combat Pet'
elseif locale == 'ruRU' then
c['Аберрация'] = 'Aberration'
c['Животное'] = 'Beast'
c['Существо'] = 'Critter'
c['Демон'] = 'Demon'
c['Дракон'] = 'Dragonkin'
c['Элементаль'] = 'Elemental'
c['Газовое облако'] = 'Gas Cloud'
c['Великан'] = 'Giant'
c['Гуманоид'] = 'Humanoid'
c['Механизм'] = 'Mechanical'
c['Не указано'] = 'Not specified'
c['Тотем'] = 'Totem'
c['Нежить'] = 'Undead'
c['дикий питомец'] = 'Wild Pet'
c['Спутник'] = 'Non-combat Pet'
elseif locale == 'zhCN' then
c['畸变'] = 'Aberration'
c['野兽'] = 'Beast'
c['小动物'] = 'Critter'
c['恶魔'] = 'Demon'
c['龙类'] = 'Dragonkin'
c['元素生物'] = 'Elemental'
c['气体云雾'] = 'Gas Cloud'
c['巨人'] = 'Giant'
c['人型生物'] = 'Humanoid'
c['机械'] = 'Mechanical'
c['未指定'] = 'Not specified'
c['图腾'] = 'Totem'
c['亡灵'] = 'Undead'
c['野生宠物'] = 'Wild Pet'
c['非战斗宠物'] = 'Non-combat Pet'
elseif locale == 'zhTW' then
c['畸變'] = 'Aberration'
c['野獸'] = 'Beast'
c['小動物'] = 'Critter'
c['惡魔'] = 'Demon'
c['龍類'] = 'Dragonkin'
c['元素生物'] = 'Elemental'
c['氣體雲'] = 'Gas Cloud'
c['巨人'] = 'Giant'
c['人型生物'] = 'Humanoid'
c['機械'] = 'Mechanical'
c['不明'] = 'Not specified'
c['圖騰'] = 'Totem'
c['不死族'] = 'Undead'
c['野生寵物'] = 'Wild Pet'
c['非戰鬥寵物'] = 'Non-combat Pet'
elseif locale == 'esES' then
c['Desviación'] = 'Aberration'
c['Bestia'] = 'Beast'
c['Alma'] = 'Critter'
c['Demonio'] = 'Demon'
c['Dragon'] = 'Dragonkin'
c['Elemental'] = 'Elemental'
c['Nube de Gas'] = 'Gas Cloud'
c['Gigante'] = 'Giant'
c['Humanoide'] = 'Humanoid'
c['Mecánico'] = 'Mechanical'
c['No especificado'] = 'Not specified'
c['Tótem'] = 'Totem'
c['No-muerto'] = 'Undead'
c['Mascota salvaje'] = 'Wild Pet'
c['Mascota no combatiente'] = 'Non-combat Pet'
elseif locale == 'esMX' then
c['Desviación'] = 'Aberration'
c['Bestia'] = 'Beast'
c['Alma'] = 'Critter'
c['Demonio'] = 'Demon'
c['Dragón'] = 'Dragonkin'
c['Elemental'] = 'Elemental'
c['Nube de Gas'] = 'Gas Cloud'
c['Gigante'] = 'Giant'
c['Humanoide'] = 'Humanoid'
c['Mecánico'] = 'Mechanical'
c['Sin especificar'] = 'Not specified'
c['Totém'] = 'Totem'
c['No-muerto'] = 'Undead'
c['Mascota salvaje'] = 'Wild Pet'
c['Mascota mansa'] = 'Non-combat Pet'
elseif locale == 'ptBR' then
c['Aberração'] = 'Aberration'
c['Fera'] = 'Beast'
c['Bicho'] = 'Critter'
c['Demônio'] = 'Demon'
c['Dracônico'] = 'Dragonkin'
c['Elemental'] = 'Elemental'
c['Gasoso'] = 'Gas Cloud'
c['Gigante'] = 'Giant'
c['Humanoide'] = 'Humanoid'
c['Mecânico'] = 'Mechanical'
c['Não especificado'] = 'Not specified'
c['Totem'] = 'Totem'
c['Renegado'] = 'Undead'
c['Mascote Selvagem'] = 'Wild Pet'
c['Mascote não-combatente'] = 'Non-combat Pet'
elseif locale == 'itIT' then
c['Aberrazione'] = 'Aberration'
c['Bestia'] = 'Beast'
c['Animale'] = 'Critter'
c['Demone'] = 'Demon'
c['Dragoide'] = 'Dragonkin'
c['Elementale'] = 'Elemental'
c['Nube di Gas'] = 'Gas Cloud'
c['Gigante'] = 'Giant'
c['Umanoide'] = 'Humanoid'
c['Meccanico'] = 'Mechanical'
c['Non Specificato'] = 'Not specified'
c['Totem'] = 'Totem'
c['Non Morto'] = 'Undead'
c['Mascotte selvatica'] = 'Wild Pet'
c['Animale Non combattente'] = 'Non-combat Pet'
else -- enUS
c['Aberration'] = 'Aberration'
c['Beast'] = 'Beast'
c['Critter'] = 'Critter'
c['Demon'] = 'Demon'
c['Dragonkin'] = 'Dragonkin'
c['Elemental'] = 'Elemental'
c['Gas Cloud'] = 'Gas Cloud'
c['Giant'] = 'Giant'
c['Humanoid'] = 'Humanoid'
c['Mechanical'] = 'Mechanical'
c['Not specified'] = 'Not specified'
c['Totem'] = 'Totem'
c['Undead'] = 'Undead'
c['Wild Pet'] = 'Wild Pet'
c['Non-combat Pet'] = 'Non-combat Pet'
end
E.CreatureTypes = c
end
function mod:StyleFilterAuraWait(frame, button, varTimerName, timeLeft, mTimeLeft)
if button and not button[varTimerName] then
local updateIn = timeLeft-mTimeLeft
if updateIn > 0 then
-- also add a tenth of a second to updateIn to prevent the timer from firing on the same second
button[varTimerName] = C_Timer_NewTimer(updateIn+0.1, function()
if frame and frame:IsShown() then
mod:StyleFilterUpdate(frame, 'FAKE_AuraWaitTimer')
end
if button and button[varTimerName] then
button[varTimerName] = nil
end
end)
end end end
function mod:StyleFilterAuraCheck(frame, names, auras, mustHaveAll, missing, minTimeLeft, maxTimeLeft)
local total, count = 0, 0
for name, value in pairs(names) do
if value then --only if they are turned on
total = total + 1 --keep track of the names
if auras.createdIcons and auras.createdIcons > 0 then
for i = 1, auras.createdIcons do
local button = auras[i]
if button and button:IsShown() then
if (button.name and button.name == name) or (button.spellID and button.spellID == tonumber(name)) then
local hasMinTime = minTimeLeft and minTimeLeft ~= 0
local hasMaxTime = maxTimeLeft and maxTimeLeft ~= 0
local timeLeft = (hasMinTime or hasMaxTime) and button.expiration and (button.expiration - GetTime())
local minTimeAllow = not hasMinTime or (timeLeft and timeLeft > minTimeLeft)
local maxTimeAllow = not hasMaxTime or (timeLeft and timeLeft < maxTimeLeft)
if timeLeft then -- if we use a min/max time setting; we must create a delay timer
if hasMinTime then mod:StyleFilterAuraWait(frame, button, 'hasMinTimer', timeLeft, minTimeLeft) end
if hasMaxTime then mod:StyleFilterAuraWait(frame, button, 'hasMaxTimer', timeLeft, maxTimeLeft) end
end
if minTimeAllow and maxTimeAllow then
count = count + 1 --keep track of how many matches we have
end end end end end end end
if total == 0 then
return nil --If no auras are checked just pass nil, we dont need to run the filter here.
else
return ((mustHaveAll and not missing) and total == count) -- [x] Check for all [ ] Missing: total needs to match count
or ((not mustHaveAll and not missing) and count > 0) -- [ ] Check for all [ ] Missing: count needs to be greater than zero
or ((not mustHaveAll and missing) and count == 0) -- [ ] Check for all [x] Missing: count needs to be zero
or ((mustHaveAll and missing) and total ~= count) -- [x] Check for all [x] Missing: count must not match total
end
end
function mod:StyleFilterCooldownCheck(names, mustHaveAll)
local total, count = 0, 0
local _, gcd = GetSpellCooldown(61304)
for name, value in pairs(names) do
if GetSpellInfo(name) then --check spell name valid, GetSpellCharges/GetSpellCooldown will return nil if not known by your class
if value == 'ONCD' or value == 'OFFCD' then --only if they are turned on
total = total + 1 --keep track of the names
local charges = GetSpellCharges(name)
local _, duration = GetSpellCooldown(name)
if (charges and charges == 0 and value == 'ONCD') --charges exist and the current number of charges is 0 means that it is completely on cooldown.
or (charges and charges > 0 and value == 'OFFCD') --charges exist and the current number of charges is greater than 0 means it is not on cooldown.
or (charges == nil and (duration > gcd and value == 'ONCD')) --no charges exist and the duration of the cooldown is greater than the GCD spells current cooldown then it is on cooldown.
or (charges == nil and (duration <= gcd and value == 'OFFCD')) then --no charges exist and the duration of the cooldown is at or below the current GCD cooldown spell then it is not on cooldown.
count = count + 1
--print(((charges and charges == 0 and value == 'ONCD') and name..' (charge) passes because it is on cd') or ((charges and charges > 0 and value == 'OFFCD') and name..' (charge) passes because it is offcd') or ((charges == nil and (duration > gcd and value == 'ONCD')) and name..'passes because it is on cd.') or ((charges == nil and (duration <= gcd and value == 'OFFCD')) and name..' passes because it is off cd.'))
end end end end
if total == 0 then
return nil
else
return (mustHaveAll and total == count) or (not mustHaveAll and count > 0)
end
end
function mod:StyleFilterFinishedFlash(requested)
if not requested then self:Play() end
end
function mod:StyleFilterSetupFlash(FlashTexture)
FlashTexture.anim = FlashTexture:CreateAnimationGroup('Flash')
FlashTexture.anim.fadein = FlashTexture.anim:CreateAnimation('ALPHA', 'FadeIn')
FlashTexture.anim.fadein:SetFromAlpha(0)
FlashTexture.anim.fadein:SetToAlpha(1)
FlashTexture.anim.fadein:SetOrder(2)
FlashTexture.anim.fadeout = FlashTexture.anim:CreateAnimation('ALPHA', 'FadeOut')
FlashTexture.anim.fadeout:SetFromAlpha(1)
FlashTexture.anim.fadeout:SetToAlpha(0)
FlashTexture.anim.fadeout:SetOrder(1)
FlashTexture.anim:SetScript('OnFinished', mod.StyleFilterFinishedFlash)
end
function mod:StyleFilterPlateStyled(frame)
if frame and frame.Name and not frame.Name.__owner then
frame.Name.__owner = frame
hooksecurefunc(frame.Name, 'SetFormattedText', mod.StyleFilterNameChanged)
end
end
function mod:StyleFilterNameChanged()
if not self.__owner or not self.__owner.NameColorChanged then return end
local nameText = self:GetText()
if nameText and nameText ~= "" then
local unitName = self.__owner.unitName and gsub(self.__owner.unitName,'([%(%)%.%%%+%-%*%?%[%^%$])','%%%1')
if unitName then self:SetText(gsub(nameText,'|c[fF][fF]%x%x%x%x%x%x%s-('..unitName..')','%1')) end
end
end
function mod:StyleFilterBorderLock(backdrop, switch)
backdrop.ignoreBorderColors = switch --but keep the backdrop updated
end
function mod:StyleFilterSetChanges(frame, actions, HealthColorChanged, PowerColorChanged, BorderChanged, FlashingHealth, TextureChanged, ScaleChanged, AlphaChanged, NameColorChanged, PortraitShown, NameOnlyChanged, VisibilityChanged)
if VisibilityChanged then
frame.StyleChanged = true
frame.VisibilityChanged = true
mod:DisablePlate(frame) -- disable the plate elements
frame:ClearAllPoints() -- lets still move the frame out cause its clickable otherwise
frame:Point('TOP', E.UIParent, 'BOTTOM', 0, -500)
return --We hide it. Lets not do other things (no point)
end
if HealthColorChanged then
frame.StyleChanged = true
frame.HealthColorChanged = actions.color.healthColor
frame.Health:SetStatusBarColor(actions.color.healthColor.r, actions.color.healthColor.g, actions.color.healthColor.b, actions.color.healthColor.a)
frame.Cutaway.Health:SetStatusBarColor(actions.color.healthColor.r * 1.5, actions.color.healthColor.g * 1.5, actions.color.healthColor.b * 1.5, actions.color.healthColor.a)
end
if PowerColorChanged then
frame.StyleChanged = true
frame.PowerColorChanged = true
frame.Power:SetStatusBarColor(actions.color.powerColor.r, actions.color.powerColor.g, actions.color.powerColor.b, actions.color.powerColor.a)
frame.Cutaway.Power:SetStatusBarColor(actions.color.powerColor.r * 1.5, actions.color.powerColor.g * 1.5, actions.color.powerColor.b * 1.5, actions.color.powerColor.a)
end
if BorderChanged then
frame.StyleChanged = true
frame.BorderChanged = true
mod:StyleFilterBorderLock(frame.Health.backdrop, true)
frame.Health.backdrop:SetBackdropBorderColor(actions.color.borderColor.r, actions.color.borderColor.g, actions.color.borderColor.b, actions.color.borderColor.a)
if frame.Power.backdrop and (frame.frameType and mod.db.units[frame.frameType].power and mod.db.units[frame.frameType].power.enable) then
mod:StyleFilterBorderLock(frame.Power.backdrop, true)
frame.Power.backdrop:SetBackdropBorderColor(actions.color.borderColor.r, actions.color.borderColor.g, actions.color.borderColor.b, actions.color.borderColor.a)
end
end
if FlashingHealth then
frame.StyleChanged = true
frame.FlashingHealth = true
if not TextureChanged then
frame.FlashTexture:SetTexture(LSM:Fetch('statusbar', mod.db.statusbar))
end
frame.FlashTexture:SetVertexColor(actions.flash.color.r, actions.flash.color.g, actions.flash.color.b)
if not frame.FlashTexture.anim then
mod:StyleFilterSetupFlash(frame.FlashTexture)
end
frame.FlashTexture.anim.fadein:SetToAlpha(actions.flash.color.a)
frame.FlashTexture.anim.fadeout:SetFromAlpha(actions.flash.color.a)
frame.FlashTexture:Show()
E:Flash(frame.FlashTexture, actions.flash.speed * 0.1, true)
end
if TextureChanged then
frame.StyleChanged = true
frame.TextureChanged = true
frame.Highlight.texture:SetTexture(LSM:Fetch('statusbar', actions.texture.texture))
frame.Health:SetStatusBarTexture(LSM:Fetch('statusbar', actions.texture.texture))
if FlashingHealth then
frame.FlashTexture:SetTexture(LSM:Fetch('statusbar', actions.texture.texture))
end
end
if ScaleChanged then
frame.StyleChanged = true
frame.ScaleChanged = true
mod:ScalePlate(frame, actions.scale)
end
if AlphaChanged then
frame.StyleChanged = true
frame.AlphaChanged = true
mod:PlateFade(frame, mod.db.fadeIn and 1 or 0, frame:GetAlpha(), actions.alpha / 100)
end
if NameColorChanged then
frame.StyleChanged = true
frame.NameColorChanged = true
mod.StyleFilterNameChanged(frame.Name)
frame.Name:SetTextColor(actions.color.nameColor.r, actions.color.nameColor.g, actions.color.nameColor.b, actions.color.nameColor.a)
end
if PortraitShown then
frame.StyleChanged = true
frame.PortraitShown = true
mod:Update_Portrait(frame)
frame.Portrait:ForceUpdate()
end
if NameOnlyChanged then
frame.StyleChanged = true
frame.NameOnlyChanged = true
mod:DisablePlate(frame, true)
end
end
function mod:StyleFilterUpdatePlate(frame, nameOnly)
mod:UpdatePlate(frame) -- enable elements back
if frame.frameType then
if mod.db.units[frame.frameType].health.enable then
frame.Health:ForceUpdate()
end
if mod.db.units[frame.frameType].power.enable then
frame.Power:ForceUpdate()
end
end
if mod.db.threat.enable and mod.db.threat.useThreatColor and not UnitIsTapDenied(frame.unit) then
frame.ThreatIndicator:ForceUpdate() -- this will account for the threat health color
end
if not nameOnly then
mod:PlateFade(frame, mod.db.fadeIn and 1 or 0, 0, 1) -- fade those back in so it looks clean
end
end
function mod:StyleFilterClearChanges(frame, HealthColorChanged, PowerColorChanged, BorderChanged, FlashingHealth, TextureChanged, ScaleChanged, AlphaChanged, NameColorChanged, PortraitShown, NameOnlyChanged, VisibilityChanged)
frame.StyleChanged = nil
if VisibilityChanged then
frame.VisibilityChanged = nil
mod:StyleFilterUpdatePlate(frame)
frame:ClearAllPoints() -- pull the frame back in
frame:Point('CENTER')
end
if HealthColorChanged then
frame.HealthColorChanged = nil
frame.Health:SetStatusBarColor(frame.Health.r, frame.Health.g, frame.Health.b)
frame.Cutaway.Health:SetStatusBarColor(frame.Health.r * 1.5, frame.Health.g * 1.5, frame.Health.b * 1.5, 1)
end
if PowerColorChanged then
frame.PowerColorChanged = nil
local color = E.db.unitframe.colors.power[frame.Power.token] or PowerBarColor[frame.Power.token] or FallbackColor
if color then
frame.Power:SetStatusBarColor(color.r, color.g, color.b)
frame.Cutaway.Power:SetStatusBarColor(color.r * 1.5, color.g * 1.5, color.b * 1.5, 1)
end
end
if BorderChanged then
frame.BorderChanged = nil
mod:StyleFilterBorderLock(frame.Health.backdrop)
frame.Health.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
if frame.Power.backdrop and (frame.frameType and mod.db.units[frame.frameType].power and mod.db.units[frame.frameType].power.enable) then
mod:StyleFilterBorderLock(frame.Power.backdrop)
frame.Power.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
end
end
if FlashingHealth then
frame.FlashingHealth = nil
E:StopFlash(frame.FlashTexture)
frame.FlashTexture:Hide()
end
if TextureChanged then
frame.TextureChanged = nil
frame.Highlight.texture:SetTexture(LSM:Fetch('statusbar', mod.db.statusbar))
frame.Health:SetStatusBarTexture(LSM:Fetch('statusbar', mod.db.statusbar))
end
if ScaleChanged then
frame.ScaleChanged = nil
mod:ScalePlate(frame, frame.ThreatScale or 1)
end
if AlphaChanged then
frame.AlphaChanged = nil
mod:PlateFade(frame, mod.db.fadeIn and 1 or 0, (frame.FadeObject and frame.FadeObject.endAlpha) or 0.5, 1)
end
if NameColorChanged then
frame.NameColorChanged = nil
frame.Name:UpdateTag()
frame.Name:SetTextColor(1, 1, 1, 1)
end
if PortraitShown then
frame.PortraitShown = nil
mod:Update_Portrait(frame)
frame.Portrait:ForceUpdate()
end
if NameOnlyChanged then
frame.NameOnlyChanged = nil
mod:StyleFilterUpdatePlate(frame, true)
end
end
function mod:StyleFilterThreatUpdate(frame, unit)
mod.ThreatIndicator_PreUpdate(frame.ThreatIndicator, frame.unit)
if unitExists(unit) then
local feedbackUnit = frame.ThreatIndicator.feedbackUnit
if feedbackUnit and (feedbackUnit ~= unit) and unitExists(feedbackUnit) then
frame.ThreatStatus = UnitThreatSituation(feedbackUnit, unit)
else
frame.ThreatStatus = UnitThreatSituation(unit)
end
end
end
function mod:StyleFilterConditionCheck(frame, filter, trigger)
local passed -- skip StyleFilterPass when triggers are empty
-- Health
if trigger.healthThreshold then
local healthUnit = (trigger.healthUsePlayer and 'player') or frame.unit
local health, maxHealth = UnitHealth(healthUnit), UnitHealthMax(healthUnit)
local percHealth = (maxHealth and (maxHealth > 0) and health/maxHealth) or 0
local underHealthThreshold = trigger.underHealthThreshold and (trigger.underHealthThreshold ~= 0) and (trigger.underHealthThreshold > percHealth)
local overHealthThreshold = trigger.overHealthThreshold and (trigger.overHealthThreshold ~= 0) and (trigger.overHealthThreshold < percHealth)
if underHealthThreshold or overHealthThreshold then passed = true else return end
end
-- Power
if trigger.powerThreshold then
local powerUnit = (trigger.powerUsePlayer and 'player') or frame.unit
local power, maxPower = UnitPower(powerUnit, frame.PowerType), UnitPowerMax(powerUnit, frame.PowerType)
local percPower = (maxPower and (maxPower > 0) and power/maxPower) or 0
local underPowerThreshold = trigger.underPowerThreshold and (trigger.underPowerThreshold ~= 0) and (trigger.underPowerThreshold > percPower)
local overPowerThreshold = trigger.overPowerThreshold and (trigger.overPowerThreshold ~= 0) and (trigger.overPowerThreshold < percPower)
if underPowerThreshold or overPowerThreshold then passed = true else return end
end
-- Level
if trigger.level then
local myLevel = UnitLevel('player')
local level = (frame.unit == 'player' and myLevel) or UnitLevel(frame.unit)
local curLevel = (trigger.curlevel and trigger.curlevel ~= 0 and (trigger.curlevel == level))
local minLevel = (trigger.minlevel and trigger.minlevel ~= 0 and (trigger.minlevel <= level))
local maxLevel = (trigger.maxlevel and trigger.maxlevel ~= 0 and (trigger.maxlevel >= level))
local matchMyLevel = trigger.mylevel and (level == myLevel)
if curLevel or minLevel or maxLevel or matchMyLevel then passed = true else return end
end
-- Resting
if trigger.isResting then
if IsResting() then passed = true else return end
end
-- Quest Boss
if trigger.questBoss then
if UnitIsQuestBoss(frame.unit) then passed = true else return end
end
-- Require Target
if trigger.requireTarget then
if UnitExists('target') then passed = true else return end
end
-- Player Combat
if trigger.inCombat or trigger.outOfCombat then
local inCombat = UnitAffectingCombat('player')
if (trigger.inCombat and inCombat) or (trigger.outOfCombat and not inCombat) then passed = true else return end
end
-- Unit Combat
if trigger.inCombatUnit or trigger.outOfCombatUnit then
local inCombat = UnitAffectingCombat(frame.unit)
if (trigger.inCombatUnit and inCombat) or (trigger.outOfCombatUnit and not inCombat) then passed = true else return end
end
-- Player Target
if trigger.isTarget or trigger.notTarget then
if (trigger.isTarget and frame.isTarget) or (trigger.notTarget and not frame.isTarget) then passed = true else return end
end
-- Unit Target
if trigger.targetMe or trigger.notTargetMe then
if (trigger.targetMe and frame.isTargetingMe) or (trigger.notTargetMe and not frame.isTargetingMe) then passed = true else return end
end
-- Unit Focus
if trigger.isFocus or trigger.notFocus then
if (trigger.isFocus and frame.isFocused) or (trigger.notFocus and not frame.isFocused) then passed = true else return end
end
-- Unit Pet
if trigger.isPet or trigger.isNotPet then
if (trigger.isPet and frame.isPet or trigger.isNotPet and not frame.isPet) then passed = true else return end
end
-- Unit Player Controlled
if trigger.isPlayerControlled or trigger.isNotPlayerControlled then
local playerControlled = frame.isPlayerControlled and not frame.isPlayer
if (trigger.isPlayerControlled and playerControlled or trigger.isNotPlayerControlled and not playerControlled) then passed = true else return end
end
-- Unit Owned By Player
if trigger.isOwnedByPlayer or trigger.isNotOwnedByPlayer then
local ownedByPlayer = UnitIsOwnerOrControllerOfUnit("player", frame.unit)
if (trigger.isOwnedByPlayer and ownedByPlayer or trigger.isNotOwnedByPlayer and not ownedByPlayer) then passed = true else return end
end
-- Unit PvP
if trigger.isPvP or trigger.isNotPvP then
local isPvP = UnitIsPVP(frame.unit)
if (trigger.isPvP and isPvP or trigger.isNotPvP and not isPvP) then passed = true else return end
end
-- Unit Tap Denied
if trigger.isTapDenied or trigger.isNotTapDenied then
local tapDenied = UnitIsTapDenied(frame.unit)
if (trigger.isTapDenied and tapDenied) or (trigger.isNotTapDenied and not tapDenied) then passed = true else return end
end
-- Player Vehicle
if trigger.inVehicle or trigger.outOfVehicle then
local inVehicle = UnitInVehicle('player')
if (trigger.inVehicle and inVehicle) or (trigger.outOfVehicle and not inVehicle) then passed = true else return end
end
-- Unit Vehicle
if trigger.inVehicleUnit or trigger.outOfVehicleUnit then
if (trigger.inVehicleUnit and frame.inVehicle) or (trigger.outOfVehicleUnit and not frame.inVehicle) then passed = true else return end
end
-- Player Can Attack
if trigger.playerCanAttack or trigger.playerCanNotAttack then
local canAttack = UnitCanAttack("player", frame.unit)
if (trigger.playerCanAttack and canAttack) or (trigger.playerCanNotAttack and not canAttack) then passed = true else return end
end
-- Classification
if trigger.classification.worldboss or trigger.classification.rareelite or trigger.classification.elite or trigger.classification.rare or trigger.classification.normal or trigger.classification.trivial or trigger.classification.minus then
if trigger.classification[frame.classification] then passed = true else return end
end
-- Group Role
if trigger.role.tank or trigger.role.healer or trigger.role.damager then
if trigger.role[mod.TriggerConditions.roles[E.myrole]] then passed = true else return end
end
-- Unit Type
if trigger.nameplateType and trigger.nameplateType.enable then
if trigger.nameplateType[mod.TriggerConditions.frameTypes[frame.frameType]] then passed = true else return end
end
-- Creature Type
if trigger.creatureType and trigger.creatureType.enable then
if trigger.creatureType[E.CreatureTypes[frame.creatureType]] then passed = true else return end
end
-- Key Modifier
if trigger.keyMod and trigger.keyMod.enable then
for key, value in pairs(trigger.keyMod) do
local isDown = mod.TriggerConditions.keys[key]
if value and isDown then
if isDown() then passed = true else return end
end
end
end
-- Reaction (or Reputation) Type
if trigger.reactionType and trigger.reactionType.enable then
if trigger.reactionType[mod.TriggerConditions.reactions[(trigger.reactionType.reputation and frame.repReaction) or frame.reaction]] then passed = true else return end
end
-- Threat
if trigger.threat and trigger.threat.enable then
if trigger.threat.good or trigger.threat.goodTransition or trigger.threat.badTransition or trigger.threat.bad or trigger.threat.offTank or trigger.threat.offTankGoodTransition or trigger.threat.offTankBadTransition then
if not mod.db.threat.enable then -- force grab the values we need :3
mod:StyleFilterThreatUpdate(frame, frame.unit)
end
local checkOffTank = trigger.threat.offTank or trigger.threat.offTankGoodTransition or trigger.threat.offTankBadTransition
local status = (checkOffTank and frame.ThreatOffTank and frame.ThreatStatus and -frame.ThreatStatus) or (not checkOffTank and ((frame.ThreatIsTank and mod.TriggerConditions.tankThreat[frame.ThreatStatus]) or frame.ThreatStatus)) or nil
if trigger.threat[mod.TriggerConditions.threat[status]] then passed = true else return end
end
end
-- Raid Target
if trigger.raidTarget.star or trigger.raidTarget.circle or trigger.raidTarget.diamond or trigger.raidTarget.triangle or trigger.raidTarget.moon or trigger.raidTarget.square or trigger.raidTarget.cross or trigger.raidTarget.skull then
if trigger.raidTarget[mod.TriggerConditions.raidTargets[frame.RaidTargetIndex]] then passed = true else return end
end
-- Class and Specialization
if trigger.class and next(trigger.class) then
local Class = trigger.class[E.myclass]
if not Class or (Class.specs and next(Class.specs) and not Class.specs[E.myspec and GetSpecializationInfo(E.myspec)]) then
return
else
passed = true
end
end
-- Instance Type
if trigger.instanceType.none or trigger.instanceType.scenario or trigger.instanceType.party or trigger.instanceType.raid or trigger.instanceType.arena or trigger.instanceType.pvp then
local _, Type, Difficulty = GetInstanceInfo()
if trigger.instanceType[Type] then
passed = true
-- Instance Difficulty
if Type == 'raid' or Type == 'party' then
local D = trigger.instanceDifficulty[(Type == 'party' and 'dungeon') or Type]
for _, value in pairs(D) do
if value and not D[mod.TriggerConditions.difficulties[Difficulty]] then return end
end
end
else return end
end
-- Talents
if trigger.talent.enabled then
local pvpTalent = trigger.talent.type == 'pvp'
local selected, complete
for i = 1, (pvpTalent and 4) or 7 do
local Tier = 'tier'..i
local Talent = trigger.talent[Tier]
if trigger.talent[Tier..'enabled'] and Talent.column > 0 then
if pvpTalent then
-- column is actually the talentID for pvpTalents
local slotInfo = C_SpecializationInfo_GetPvpTalentSlotInfo(i)
selected = (slotInfo and slotInfo.selectedTalentID) == Talent.column
else
selected = select(4, GetTalentInfo(i, Talent.column, 1))
end
if (selected and not Talent.missing) or (Talent.missing and not selected) then
complete = true
if not trigger.talent.requireAll then
break -- break when not using requireAll because we matched one
end
elseif trigger.talent.requireAll then
complete = false -- fail because requireAll
break
end end end
if complete then passed = true else return end
end
-- Casting
if trigger.casting then
local b, c = frame.Castbar, trigger.casting
-- Spell
if c.spells and next(c.spells) then
for _, value in pairs(c.spells) do
if value then -- only run if at least one is selected
local castingSpell = c.spells[tostring(b.spellID)] or c.spells[b.spellName]
if (c.notSpell and not castingSpell) or (castingSpell and not c.notSpell) then passed = true else return end
break -- we can execute this once on the first enabled option then kill the loop
end
end
end
-- Status
if c.isCasting or c.isChanneling or c.notCasting or c.notChanneling then
if (c.isCasting and b.casting) or (c.isChanneling and b.channeling)
or (c.notCasting and not b.casting) or (c.notChanneling and not b.channeling) then passed = true else return end
end
-- Interruptible
if c.interruptible or c.notInterruptible then
if (b.casting or b.channeling) and ((c.interruptible and not b.notInterruptible)
or (c.notInterruptible and b.notInterruptible)) then passed = true else return end
end
end
-- Cooldown
if trigger.cooldowns and trigger.cooldowns.names and next(trigger.cooldowns.names) then
local cooldown = mod:StyleFilterCooldownCheck(trigger.cooldowns.names, trigger.cooldowns.mustHaveAll)
if cooldown ~= nil then -- ignore if none are set to ONCD or OFFCD
if cooldown then passed = true else return end
end
end
-- Buffs
if frame.Buffs and trigger.buffs and trigger.buffs.names and next(trigger.buffs.names) then
local buff = mod:StyleFilterAuraCheck(frame, trigger.buffs.names, frame.Buffs, trigger.buffs.mustHaveAll, trigger.buffs.missing, trigger.buffs.minTimeLeft, trigger.buffs.maxTimeLeft)
if buff ~= nil then -- ignore if none are selected
if buff then passed = true else return end
end
end
-- Debuffs
if frame.Debuffs and trigger.debuffs and trigger.debuffs.names and next(trigger.debuffs.names) then
local debuff = mod:StyleFilterAuraCheck(frame, trigger.debuffs.names, frame.Debuffs, trigger.debuffs.mustHaveAll, trigger.debuffs.missing, trigger.debuffs.minTimeLeft, trigger.debuffs.maxTimeLeft)
if debuff ~= nil then -- ignore if none are selected
if debuff then passed = true else return end
end
end
-- Name or GUID
if trigger.names and next(trigger.names) then
for _, value in pairs(trigger.names) do
if value then -- only run if at least one is selected
local name = trigger.names[frame.unitName] or trigger.names[frame.npcID]
if (not trigger.negativeMatch and name) or (trigger.negativeMatch and not name) then passed = true else return end
break -- we can execute this once on the first enabled option then kill the loop
end
end
end
-- Plugin Callback
if mod.StyleFilterCustomCheck then
local custom = mod:StyleFilterCustomCheck(frame, filter, trigger)
if custom ~= nil then -- ignore if nil return
if custom then passed = true else return end
end
end
-- Pass it along
if passed then
mod:StyleFilterPass(frame, filter.actions)
end
end
function mod:StyleFilterPass(frame, actions)
local healthBarEnabled = (frame.frameType and mod.db.units[frame.frameType].health.enable) or (mod.db.displayStyle ~= 'ALL') or (frame.isTarget and mod.db.alwaysShowTargetHealth)
local powerBarEnabled = frame.frameType and mod.db.units[frame.frameType].power and mod.db.units[frame.frameType].power.enable
local healthBarShown = healthBarEnabled and frame.Health:IsShown()
mod:StyleFilterSetChanges(frame, actions,
(healthBarShown and actions.color and actions.color.health), --HealthColorChanged
(healthBarShown and powerBarEnabled and actions.color and actions.color.power), --PowerColorChanged
(healthBarShown and actions.color and actions.color.border and frame.Health.backdrop), --BorderChanged
(healthBarShown and actions.flash and actions.flash.enable and frame.FlashTexture), --FlashingHealth
(healthBarShown and actions.texture and actions.texture.enable), --TextureChanged
(healthBarShown and actions.scale and actions.scale ~= 1), --ScaleChanged
(actions.alpha and actions.alpha ~= -1), --AlphaChanged
(actions.color and actions.color.name), --NameColorChanged
(actions.usePortrait), --PortraitShown
(actions.nameOnly), --NameOnlyChanged
(actions.hide) --VisibilityChanged
)
end
function mod:StyleFilterClear(frame)
if frame and frame.StyleChanged then
mod:StyleFilterClearChanges(frame, frame.HealthColorChanged, frame.PowerColorChanged, frame.BorderChanged, frame.FlashingHealth, frame.TextureChanged, frame.ScaleChanged, frame.AlphaChanged, frame.NameColorChanged, frame.PortraitShown, frame.NameOnlyChanged, frame.VisibilityChanged)
end
end
function mod:StyleFilterSort(place)
if self[2] and place[2] then
return self[2] > place[2] --Sort by priority: 1=first, 2=second, 3=third, etc
end
end
function mod:VehicleFunction(_, unit)
unit = unit or self.unit
self.inVehicle = UnitInVehicle(unit) or nil
end
mod.StyleFilterEventFunctions = { -- a prefunction to the injected ouf watch
['PLAYER_TARGET_CHANGED'] = function(self)
self.isTarget = self.unit and UnitIsUnit(self.unit, 'target') or nil
end,
['PLAYER_FOCUS_CHANGED'] = function(self)
self.isFocused = self.unit and UnitIsUnit(self.unit, 'focus') or nil
end,
['RAID_TARGET_UPDATE'] = function(self)
self.RaidTargetIndex = self.unit and GetRaidTargetIndex(self.unit) or nil
end,
['UNIT_TARGET'] = function(self, _, unit)
unit = unit or self.unit
self.isTargetingMe = UnitIsUnit(unit..'target', 'player') or nil
end,
['UNIT_ENTERED_VEHICLE'] = mod.VehicleFunction,
['UNIT_EXITED_VEHICLE'] = mod.VehicleFunction,
['VEHICLE_UPDATE'] = mod.VehicleFunction
}
function mod:StyleFilterSetVariables(nameplate)
for _, func in pairs(mod.StyleFilterEventFunctions) do
func(nameplate)
end
end
function mod:StyleFilterClearVariables(nameplate)
nameplate.isTarget = nil
nameplate.isFocused = nil
nameplate.inVehicle = nil
nameplate.isTargetingMe = nil
nameplate.RaidTargetIndex = nil
nameplate.ThreatScale = nil
nameplate.ThreatStatus = nil
nameplate.ThreatOffTank = nil
nameplate.ThreatIsTank = nil
end
mod.StyleFilterTriggerList = {} -- configured filters enabled with sorted priority
mod.StyleFilterTriggerEvents = {} -- events required by the filter that we need to watch for
mod.StyleFilterPlateEvents = { -- events watched inside of ouf, which is called on the nameplate itself
['NAME_PLATE_UNIT_ADDED'] = 1 -- rest is populated from `StyleFilterDefaultEvents` as needed
}
mod.StyleFilterDefaultEvents = { -- list of events style filter uses to populate plate events
'MODIFIER_STATE_CHANGED',
'PLAYER_FOCUS_CHANGED',
'PLAYER_TARGET_CHANGED',
'PLAYER_UPDATE_RESTING',
'RAID_TARGET_UPDATE',
'SPELL_UPDATE_COOLDOWN',
'UNIT_AURA',
'UNIT_DISPLAYPOWER',
'UNIT_ENTERED_VEHICLE',
'UNIT_EXITED_VEHICLE',
'UNIT_FACTION',
'UNIT_FLAGS',
'UNIT_HEALTH',
'UNIT_HEALTH_FREQUENT',
'UNIT_MAXHEALTH',
'UNIT_NAME_UPDATE',
'UNIT_PET',
'UNIT_POWER_FREQUENT',
'UNIT_POWER_UPDATE',
'UNIT_TARGET',
'UNIT_THREAT_LIST_UPDATE',
'UNIT_THREAT_SITUATION_UPDATE',
'VEHICLE_UPDATE',
}
function mod:StyleFilterWatchEvents()
for _, event in ipairs(mod.StyleFilterDefaultEvents) do
mod.StyleFilterPlateEvents[event] = mod.StyleFilterTriggerEvents[event] and true or nil
end
end
function mod:StyleFilterConfigure()
wipe(mod.StyleFilterTriggerList)
wipe(mod.StyleFilterTriggerEvents)
for filterName, filter in pairs(E.global.nameplate.filters) do
local t = filter.triggers
if t and E.db.nameplates and E.db.nameplates.filters then
if E.db.nameplates.filters[filterName] and E.db.nameplates.filters[filterName].triggers and E.db.nameplates.filters[filterName].triggers.enable then
tinsert(mod.StyleFilterTriggerList, {filterName, t.priority or 1})
-- NOTE: 0 for fake events, 1 to override StyleFilterWaitTime
mod.StyleFilterTriggerEvents.FAKE_AuraWaitTimer = 0 -- for minTimeLeft and maxTimeLeft aura trigger
mod.StyleFilterTriggerEvents.NAME_PLATE_UNIT_ADDED = 1
mod.StyleFilterTriggerEvents.PLAYER_TARGET_CHANGED = 1
if t.casting then
if next(t.casting.spells) then
for _, value in pairs(t.casting.spells) do
if value then
mod.StyleFilterTriggerEvents.FAKE_Casting = 0
break
end end end
if (t.casting.interruptible or t.casting.notInterruptible)
or (t.casting.isCasting or t.casting.isChanneling or t.casting.notCasting or t.casting.notChanneling) then
mod.StyleFilterTriggerEvents.FAKE_Casting = 0
end
end
if t.reactionType and t.reactionType.enable then
mod.StyleFilterTriggerEvents.UNIT_FACTION = 1
end
if t.keyMod and t.keyMod.enable then
mod.StyleFilterTriggerEvents.MODIFIER_STATE_CHANGED = 1
end
if t.targetMe or t.notTargetMe then
mod.StyleFilterTriggerEvents.UNIT_TARGET = 1
end
if t.isFocus or t.notFocus then
mod.StyleFilterTriggerEvents.PLAYER_FOCUS_CHANGED = 1
end
if t.isResting then
mod.StyleFilterTriggerEvents.PLAYER_UPDATE_RESTING = 1
end
if t.isPet then
mod.StyleFilterTriggerEvents.UNIT_PET = 1
end
if t.isTapDenied or t.isNotTapDenied then
mod.StyleFilterTriggerEvents.UNIT_FLAGS = true
end
if t.raidTarget then
mod.StyleFilterTriggerEvents.RAID_TARGET_UPDATE = 1
end
if t.unitInVehicle then
mod.StyleFilterTriggerEvents.UNIT_ENTERED_VEHICLE = 1
mod.StyleFilterTriggerEvents.UNIT_EXITED_VEHICLE = 1
mod.StyleFilterTriggerEvents.VEHICLE_UPDATE = 1
end
if t.healthThreshold then
mod.StyleFilterTriggerEvents.UNIT_HEALTH = true
mod.StyleFilterTriggerEvents.UNIT_MAXHEALTH = true
mod.StyleFilterTriggerEvents.UNIT_HEALTH_FREQUENT = true
end
if t.powerThreshold then
mod.StyleFilterTriggerEvents.UNIT_POWER_UPDATE = true
mod.StyleFilterTriggerEvents.UNIT_POWER_FREQUENT = true
mod.StyleFilterTriggerEvents.UNIT_DISPLAYPOWER = true
end
if t.threat and t.threat.enable then
mod.StyleFilterTriggerEvents.UNIT_THREAT_SITUATION_UPDATE = true
mod.StyleFilterTriggerEvents.UNIT_THREAT_LIST_UPDATE = true
end
if t.inCombat or t.outOfCombat or t.inCombatUnit or t.outOfCombatUnit then
mod.StyleFilterTriggerEvents.UNIT_THREAT_LIST_UPDATE = true
mod.StyleFilterTriggerEvents.UNIT_FLAGS = true
end
if t.names and next(t.names) then
for _, value in pairs(t.names) do
if value then
mod.StyleFilterTriggerEvents.UNIT_NAME_UPDATE = 1
break
end end end
if t.cooldowns and t.cooldowns.names and next(t.cooldowns.names) then
for _, value in pairs(t.cooldowns.names) do
if value == 'ONCD' or value == 'OFFCD' then
mod.StyleFilterTriggerEvents.SPELL_UPDATE_COOLDOWN = 1
break
end end end
if t.buffs and t.buffs.names and next(t.buffs.names) then
for _, value in pairs(t.buffs.names) do
if value then
mod.StyleFilterTriggerEvents.UNIT_AURA = true
break
end end end
if t.debuffs and t.debuffs.names and next(t.debuffs.names) then
for _, value in pairs(t.debuffs.names) do
if value then
mod.StyleFilterTriggerEvents.UNIT_AURA = true
break
end end end
end end end
mod:StyleFilterWatchEvents()
if next(mod.StyleFilterTriggerList) then
sort(mod.StyleFilterTriggerList, mod.StyleFilterSort) -- sort by priority
else
for nameplate in pairs(mod.Plates) do
mod:StyleFilterClear(nameplate)
end
end
end
function mod:StyleFilterUpdate(frame, event)
local hasEvent = frame and mod.StyleFilterTriggerEvents[event]
if not hasEvent then return
elseif hasEvent == true then -- skip on 1 or 0
if not frame.StyleFilterWaitTime then
frame.StyleFilterWaitTime = GetTime()
elseif GetTime() > (frame.StyleFilterWaitTime + 0.1) then
frame.StyleFilterWaitTime = nil
else
return --block calls faster than 0.1 second
end
end
mod:StyleFilterClear(frame)
for filterNum in ipairs(mod.StyleFilterTriggerList) do
local filter = E.global.nameplate.filters[mod.StyleFilterTriggerList[filterNum][1]]
if filter then
mod:StyleFilterConditionCheck(frame, filter, filter.triggers)
end
end
end
do -- oUF style filter inject watch functions without actually registering any events
local update = function(frame, event, ...)
if mod.StyleFilterEventFunctions[event] then
mod.StyleFilterEventFunctions[event](frame, event, ...)
end
mod:StyleFilterUpdate(frame, event)
end
local oUF_event_metatable = {
__call = function(funcs, frame, ...)
for _, func in next, funcs do
func(frame, ...)
end
end,
}
local oUF_fake_register = function(frame, event, remove)
local curev = frame[event]
if curev then
local kind = type(curev)
if kind == 'function' and curev ~= update then
frame[event] = setmetatable({curev, update}, oUF_event_metatable)
elseif kind == 'table' then
for index, infunc in next, curev do
if infunc == update then
if remove then
tremove(curev, index)
end
return
end end
tinsert(curev, update)
end
else
frame[event] = (not remove and update) or nil
end
end
local styleFilterIsWatching = function(frame, event)
local curev = frame[event]
if curev then
local kind = type(curev)
if kind == 'function' and curev == update then
return true
elseif kind == 'table' then
for _, infunc in next, curev do
if infunc == update then
return true
end end
end
end end
function mod:StyleFilterEventWatch(frame)
for _, event in ipairs(mod.StyleFilterDefaultEvents) do
local holdsEvent = styleFilterIsWatching(frame, event)
if mod.StyleFilterPlateEvents[event] then
if not holdsEvent then
oUF_fake_register(frame, event)
end
elseif holdsEvent then
oUF_fake_register(frame, event, true)
end end end
end
function mod:StyleFilterRegister(nameplate, event, unitless, func)
if not nameplate:IsEventRegistered(event) then
nameplate:RegisterEvent(event, func or E.noop, unitless)
end
end
-- events we actually register on plates when they aren't added
function mod:StyleFilterEvents(nameplate)
mod:StyleFilterRegister(nameplate,'MODIFIER_STATE_CHANGED', true)
mod:StyleFilterRegister(nameplate,'PLAYER_FOCUS_CHANGED', true)
mod:StyleFilterRegister(nameplate,'PLAYER_TARGET_CHANGED', true)
mod:StyleFilterRegister(nameplate,'PLAYER_UPDATE_RESTING', true)
mod:StyleFilterRegister(nameplate,'RAID_TARGET_UPDATE', true)
mod:StyleFilterRegister(nameplate,'SPELL_UPDATE_COOLDOWN', true)
mod:StyleFilterRegister(nameplate,'UNIT_ENTERED_VEHICLE')
mod:StyleFilterRegister(nameplate,'UNIT_EXITED_VEHICLE')
mod:StyleFilterRegister(nameplate,'UNIT_FLAGS')
mod:StyleFilterRegister(nameplate,'UNIT_TARGET')
mod:StyleFilterRegister(nameplate,'UNIT_THREAT_LIST_UPDATE')
mod:StyleFilterRegister(nameplate,'UNIT_THREAT_SITUATION_UPDATE')
mod:StyleFilterRegister(nameplate,'VEHICLE_UPDATE', true)
mod:StyleFilterEventWatch(nameplate)
end
-- Shamelessy taken from AceDB-3.0 and stripped down by Simpy
local function copyDefaults(dest, src)
for k, v in pairs(src) do
if type(v) == 'table' then
if not rawget(dest, k) then rawset(dest, k, {}) end
if type(dest[k]) == 'table' then copyDefaults(dest[k], v) end
elseif rawget(dest, k) == nil then
rawset(dest, k, v)
end
end
end
local function removeDefaults(db, defaults)
setmetatable(db, nil)
for k,v in pairs(defaults) do
if type(v) == 'table' and type(db[k]) == 'table' then
removeDefaults(db[k], v)
if next(db[k]) == nil then db[k] = nil end
elseif db[k] == defaults[k] then
db[k] = nil
end
end
end
function mod:StyleFilterClearDefaults()
for filterName, filterTable in pairs(E.global.nameplate.filters) do
if G.nameplate.filters[filterName] then
local defaultTable = E:CopyTable({}, E.StyleFilterDefaults)
E:CopyTable(defaultTable, G.nameplate.filters[filterName])
removeDefaults(filterTable, defaultTable)
else
removeDefaults(filterTable, E.StyleFilterDefaults)
end
end
end
function mod:StyleFilterCopyDefaults(tbl)
copyDefaults(tbl, E.StyleFilterDefaults)
end
function mod:StyleFilterInitialize()
for _, filterTable in pairs(E.global.nameplate.filters) do
mod:StyleFilterCopyDefaults(filterTable)
end
end
|
---@class ScriptedAnimations
C_ScriptedAnimations = {}
---@return ScriptedAnimationEffect scriptedAnimationEffects
function C_ScriptedAnimations.GetAllScriptedAnimationEffects() end
---@class ScriptedAnimationBehavior
local ScriptedAnimationBehavior = {}
ScriptedAnimationBehavior.None = 0
ScriptedAnimationBehavior.TargetShake = 1
ScriptedAnimationBehavior.TargetKnockBack = 2
ScriptedAnimationBehavior.SourceRecoil = 3
ScriptedAnimationBehavior.SourceCollideWithTarget = 4
ScriptedAnimationBehavior.UIParentShake = 5
---@class ScriptedAnimationFlags
local ScriptedAnimationFlags = {}
ScriptedAnimationFlags.UseTargetAsSource = 1
---@class ScriptedAnimationTrajectory
local ScriptedAnimationTrajectory = {}
ScriptedAnimationTrajectory.AtSource = 0
ScriptedAnimationTrajectory.AtTarget = 1
ScriptedAnimationTrajectory.Straight = 2
ScriptedAnimationTrajectory.CurveLeft = 3
ScriptedAnimationTrajectory.CurveRight = 4
ScriptedAnimationTrajectory.CurveRandom = 5
ScriptedAnimationTrajectory.HalfwayBetween = 6
---@class ScriptedAnimationEffect
---@field id number
---@field visual number
---@field visualScale number
---@field duration number
---@field trajectory ScriptedAnimationTrajectory
---@field yawRadians number
---@field pitchRadians number
---@field rollRadians number
---@field offsetX number
---@field offsetY number
---@field offsetZ number
---@field animation number
---@field animationSpeed number
---@field alpha number
---@field useTargetAsSource bool
---@field startBehavior ScriptedAnimationBehavior|nil
---@field startSoundKitID number|nil
---@field finishEffectID number|nil
---@field finishBehavior ScriptedAnimationBehavior|nil
---@field finishSoundKitID number|nil
---@field startAlphaFade number|nil
---@field startAlphaFadeDuration number|nil
---@field endAlphaFade number|nil
---@field endAlphaFadeDuration number|nil
---@field animationStartOffset number|nil
---@field loopingSoundKitID number|nil
---@field particleOverrideScale number|nil
local ScriptedAnimationEffect = {}
|
--- Turbo.lua Linux Epoll module
--
-- Copyright John Abrahamsen 2011, 2012, 2013 < JhnAbrhmsn@gmail.com >
--
-- "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."
local ffi = require "ffi"
require "turbo.cdef"
-- Defines for epoll_ctl.
local epoll = {
EPOLL_CTL_ADD = 1,
EPOLL_CTL_DEL = 2,
EPOLL_CTL_MOD = 3,
EPOLL_EVENTS = {
EPOLLIN = 0x001,
EPOLLPRI = 0x002,
EPOLLOUT = 0x004,
EPOLLERR = 0x008,
EPOLLHUP = 0x0010,
}
}
--- Create a new epoll fd. Returns the fd of the created epoll instance and -1
-- and errno on error.
-- @return epoll fd on success, else -1 and errno.
function epoll.epoll_create()
local fd = ffi.C.epoll_create(124)
if fd == -1 then
return -1, ffi.errno()
end
return fd
end
--- Control a epoll fd.
-- @param epfd Epoll fd to control
-- @param op Operation for the target fd:
-- EPOLL_CTL_ADD
-- Register the target file descriptor fd on the epoll instance referred to
-- by the file descriptor epfd and associate the event event with the internal
-- file linked to fd.
-- EPOLL_CTL_MOD
-- Change the event event associated with the target file descriptor fd.
-- EPOLL_CTL_DEL
-- Remove (deregister) the target file descriptor fd from the epoll instance
-- referred to by epfd. The epoll_events is ignored and can be nil.
-- @param fd (Number) The fd to control.
-- @param epoll_events (Number) The events bit mask to set. Defined in
-- epoll.EPOLL_EVENTS.
-- @return 0 on success and -1 on error together with errno.
local _event = ffi.new("epoll_event")
function epoll.epoll_ctl(epfd, op, fd, epoll_events)
local rc
ffi.fill(_event, ffi.sizeof(_event), 0)
_event.data.fd = fd
_event.events = epoll_events
rc = ffi.C.epoll_ctl(epfd, op, fd, _event)
if rc == -1 then
return -1, ffi.errno()
end
return rc
end
--- Wait for events on a epoll instance.
-- @param epfd (Number) Epoll fd to wait on.
-- @param timeout (Number) How long to wait if no events occur.
-- @return On success, epoll_event array is returned, on error, -1 and errno
-- are returned.
local _events = ffi.new("struct epoll_event[124]")
function epoll.epoll_wait(epfd, timeout)
local num_events = ffi.C.epoll_wait(epfd, _events, 124, timeout)
if num_events == -1 then
return -1, ffi.errno()
end
return 0, num_events, _events
end
return epoll
|
local config = {}
function config.vim_vista()
vim.g['vista#renderer#enable_icon'] = 1
vim.g.vista_disable_statusline = 1
vim.g.vista_default_executive = 'ctags'
vim.g.vista_echo_cursor_strategy = 'floating_win'
vim.g.vista_vimwiki_executive = 'markdown'
vim.g.vista_executive_for = {
vimwiki = 'markdown',
pandoc = 'markdown',
markdown = 'toc',
typescript = 'nvim_lsp',
}
end
return config
|
-- ERMAGHERD PLS DONT STEEL M8
office1 = nil
office2 = nil
function hookItUpM8()
bildcol = engineLoadCOL("office.col") -- This is the object of the floors that had no collision what so ever, now dey solid as funk, enjoy k
engineReplaceCOL(bildcol, 3781)
bildcol = engineLoadCOL("office2.col") -- This is the structure of the building, I have included the glass and inside walls in this to save doing 3 collsion files, smart adamz k
engineReplaceCOL(bildcol, 4587)
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()),
function()
hookItUpM8()
-- first u lick it, DEN U STICK IT
setTimer(fixPlsM8, 1000, 1)
end
)
function fixPlsM8()
-- Create them, then hide them cus MTA is hella fuk bwoi and needs some work around for this shit
office1 = createObject(3781, 1803.085938, -1294.203125, 34.34375)
office2 = createObject(3781, 1803.085938, -1294.203125, 61.578125)
office3 = createObject(3781, 1803.085938, -1294.203125, 88.8046875)
office4 = createObject(3781, 1803.085938, -1294.203125, 116.03125)
office5 = createObject(4587, 1803.085938, -1294.203125, 71.53125)
setElementAlpha(office1, 0)
setElementAlpha(office2, 0)
setElementAlpha(office3, 0)
setElementAlpha(office4, 0)
setElementAlpha(office5, 0)
end
-- luv from adams 2 shadow
|
return {'hebreeuws','hebreeen','hebreeer','heb','hebbeding','hebbedingetje','hebbelijk','hebbelijkheid','hebben','hebber','hebberig','hebberigheid','hebbes','hebe','hebraica','hebraisme','hebraist','hebzucht','hebzuchtig','hebi','hebriden','hebridenzee','hebridiaan','hebridiaans','hebron','hebe','hebben','hebing','hebreeuwse','hebreeers','hebbedingetjes','hebbelijke','hebbelijker','hebbelijkheden','hebbend','hebbende','hebberige','hebberiger','hebberigste','hebbers','hebraismen','hebt','hebzuchtige','hebzuchtiger','hebzuchtigste','hebbedingen','hebridiaanse','hebis','hebraisten','hebes'}
|
return {
no_consumer = true,
fields = {
url = {required = true, type = "string"},
username = {required = true, type = "string"},
password = {required = true, type = "string"},
userid = {required = true, type = "string"},
clientid = {required = true, type = "string"}
}
}
|
-- Runtime texture atlas generation with cached element canvases? No problem!
-- Huge thanks to Cruor and Vexatos for providing a baseline packing algo!
-- https://github.com/CelestialCartographers/Loenn/blob/e97de93321df9259c6ecc13d2660a6ea0b0d57a9/src/runtime_atlas.lua
local megacanvas = {
debug = {
rects = true,
},
convertBlend = true,
convertBlendShader = love.graphics.newShader([[
vec4 effect(vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords) {
vec4 c = Texel(tex, texture_coords);
return vec4(c.rgb / c.a, c.a) * color;
}
]]),
pool = {},
poolAlive = 0,
poolUsed = 0,
poolNew = 0,
atlases = {},
quads = setmetatable({}, { __mode = "v" }),
quadsAlive = 0,
managedCanvases = setmetatable({}, { __mode = "k" }),
marked = {},
quadFastPadding = 32,
padding = 2
}
-- Love2D exposes a function that can get the theoretical maximum depth. It isn't accurate though.
do
local arrayFeature = love.graphics.getTextureTypes().array
local sizeArray = 2048
local sizeSingle = 4096
megacanvas.widthMax = sizeSingle
megacanvas.heightMax = sizeSingle
if arrayFeature == 1 or arrayFeature == true then
local min = 1
local max = 16
local success, canvas = pcall(love.graphics.newCanvas, sizeArray, sizeArray, max, { type = "array" })
if success then
canvas:release()
min = max
else
while max - min > 1 do
local mid = min + math.ceil((max - min) / 2)
success, canvas = pcall(love.graphics.newCanvas, sizeArray, sizeArray, mid, { type = "array" })
if success then
canvas:release()
min = mid
else
max = mid
end
end
end
success, canvas = pcall(love.graphics.newCanvas, sizeArray, sizeArray, min, { type = "array" })
if success then
canvas:release()
megacanvas.layersMax = min
megacanvas.width = sizeArray
megacanvas.height = sizeArray
else
megacanvas.layersMax = false
megacanvas.width = sizeSingle
megacanvas.height = sizeSingle
end
else
megacanvas.layersMax = false
megacanvas.width = sizeSingle
megacanvas.height = sizeSingle
end
end
local function rect(x, y, width, height)
if width < 0 then
x = x + width
width = -width
end
if height < 0 then
y = y + height
height = -height
end
return {
x = x,
y = y,
width = width,
height = height,
r = x + width,
b = y + height
}
end
local function rectSub(r1, r2)
local tlx = math.max(r1.x, r2.x)
local tly = math.max(r1.y, r2.y)
local brx = math.min(r1.x + r1.width, r2.x + r2.width)
local bry = math.min(r1.y + r1.height, r2.y + r2.height)
if tlx >= brx or tly >= bry then
-- No intersection
return {r1}
end
local remaining = {}
if r2.width < r2.height then
-- Large left rectangle
if tlx > r1.x then
table.insert(remaining, rect(r1.x, r1.y, tlx - r1.x, r1.height))
end
-- Large right rectangle
if brx < r1.x + r1.width then
table.insert(remaining, rect(brx, r1.y, r1.x + r1.width - brx, r1.height))
end
-- Small top rectangle
if tly > r1.y then
table.insert(remaining, rect(tlx, r1.y, brx - tlx, tly - r1.y))
end
-- Small bottom rectangle
if bry < r1.y + r1.height then
table.insert(remaining, rect(tlx, bry, brx - tlx, r1.y + r1.height - bry))
end
else
-- Small left rectangle
if tlx > r1.x then
table.insert(remaining, rect(r1.x, tly, tlx - r1.x, bry - tly))
end
-- Small right rectangle
if brx < r1.x + r1.width then
table.insert(remaining, rect(brx, tly, r1.x + r1.width - brx, bry - tly))
end
-- Large top rectangle
if tly > r1.y then
table.insert(remaining, rect(r1.x, r1.y, r1.width, tly - r1.y))
end
-- Large bottom rectangle
if bry < r1.y + r1.height then
table.insert(remaining, rect(r1.x, bry, r1.width, r1.y + r1.height - bry))
end
end
return remaining
end
local function smallest(rects, width, height)
local best, index
for i = #rects, 1, -1 do
local r = rects[i]
if r and width <= r.width and height <= r.height then
if not best or
(r.width < best.width and r.height < best.height) or
(width < height and r.width <= best.width or r.height <= best.height) then
best = r
index = i
if width == r.width and height == r.height then
break
end
end
end
end
return best, index
end
local function cleanupList(list, alive, deadMax)
if alive and #list - alive < deadMax then
return false
end
-- FIXME: Verify if this is enough to fix the "iterating over cleaned list can give false or nil" bug.
for key, _ in pairs(list) do
if not list[key] then
list[key] = nil
end
end
local removed = false
for i = #list, 1, -1 do
if not list[i] then
table.remove(list, i)
removed = i
end
end
return removed
end
local atlas = {}
local mtAtlas = {
__name = "ui.megacanvases.atlas",
__index = atlas
}
function atlas:init()
self.width = megacanvas.width
self.height = megacanvas.height
self.layers = {}
self.layersMax = megacanvas.layersMax
self:grow(1)
for i = 1, self.layersMax or 1 do
self.layers[i] = {
atlas = self,
index = i,
layer = self.layersMax and i or nil,
taken = {},
spaces = {
rect(0, 0, self.width, self.height)
},
reclaimed = 0,
reclaimedPrev = 0,
reclaimedFrames = 0
}
end
end
function atlas:release()
self.canvas:release()
end
function atlas:grow(count)
if not self.layersMax then
if (self.layersAllocated or 0) < 1 then
self.canvas = love.graphics.newCanvas(self.width, self.height)
self.layersAllocated = 1
end
return
end
local countOld = self.layersAllocated or 0
if count <= countOld then
return
end
self.layersAllocated = count
local canvas = self.canvas
-- Copy all data from VRAM to RAM first, otherwise we might run out of VRAM trying to hold both canvases.
local copies
if canvas then
copies = {}
for i = 1, countOld do
copies[i] = canvas:newImageData(i)
end
canvas:release()
end
canvas = love.graphics.newCanvas(self.width, self.height, count, { type = "array" })
self.canvas = canvas
if copies then
local sX, sY, sW, sH = love.graphics.getScissor()
local canvasPrev = love.graphics.getCanvas()
love.graphics.push()
love.graphics.origin()
love.graphics.setScissor()
love.graphics.setBlendMode("alpha", "premultiplied")
-- Apparently DPI scale agnostic images are a myth with Love2D and its embedded scaling (defaulting to system scale) needs to be undone on draw.
local scale = 1 / love.graphics.getDPIScale()
for i = 1, countOld do
local copyData = copies[i]
local copy = love.graphics.newImage(copyData)
love.graphics.setCanvas(canvas, i)
love.graphics.draw(copy, 0, 0, 0, scale, scale)
copyData:release()
copy:release()
end
love.graphics.setBlendMode("alpha", "alphamultiply")
love.graphics.pop()
love.graphics.setCanvas(canvasPrev)
love.graphics.setScissor(sX, sY, sW, sH)
end
end
function atlas:fit(width, height)
local layers = self.layers
for li = 1, #layers do
local l = layers[li]
local spaces = l.spaces
local space, index = smallest(l.spaces, width, height)
if space then
local taken = rect(space.x, space.y, width, height)
local full = true
if taken.width < taken.height then
--[[
+-----------+-----------+
|taken |taken.r |
| |space.y |
| |s.r - t.r |
| |space.h |
+-----------+ |
|space.x | |
|taken.b | |
|taken.w | |
|s.b - t.b | |
| | |
+-----------------------+
]]
if taken.r < space.r then
spaces[index] = rect(taken.r, space.y, space.r - taken.r, space.height)
index = #spaces + 1
full = false
end
if taken.b < space.b then
spaces[index] = rect(space.x, taken.b, taken.width, space.b - taken.b)
index = #spaces + 1
full = false
end
else
--[[
+-----------+-----------+
|taken |taken.r |
| |space.y |
| |s.r - t.r |
| |taken.h |
+-----------+-----------+
|space.x |
|taken.b |
|space.w |
|s.b - t.b |
| |
+-----------------------+
]]
if taken.r < space.r then
spaces[index] = rect(taken.r, space.y, space.r - taken.r, taken.height)
index = #spaces + 1
full = false
end
if taken.b < space.b then
spaces[index] = rect(space.x, taken.b, space.width, space.b - taken.b)
index = #spaces + 1
full = false
end
end
-- TODO merge adjacent rectangles
-- TODO overlap rectangles
if full then
table.remove(spaces, index)
end
self:grow(l.index)
index = #l.taken + 1
l.taken[index] = taken
taken.index = index
return l, taken
end
end
return false
end
function atlas:cleanup()
local layers = self.layers
for li = 1, #layers do
local l = layers[li]
local reclaimed = l.reclaimed
local reclaimedFrames = l.reclaimedFrames
if reclaimed >= 16 or (reclaimed >= 8 and reclaimed == l.reclaimedPrev) then
reclaimedFrames = reclaimedFrames + 1
else
reclaimedFrames = 0
l.reclaimedPrev = reclaimed
end
if reclaimedFrames < 30 and reclaimed < 32 then
l.reclaimedFrames = reclaimedFrames
else
l.reclaimedFrames = 0
local taken = l.taken
local spaces = {
rect(0, 0, self.width, self.height)
}
for ti = 1, #taken do
local t
-- FIXME: taken shouldn't contain holes yet sometimes it does?!
-- FIXME: Even with cleanupList, t can sometimes be nil (not false but NIL)?!!
repeat
t = taken[ti]
if not t then
table.remove(taken, ti)
end
until t or ti > #taken
if not t then
break
end
t.index = ti
-- In case of debugging emergency, break glass and print(svg .. "</svg>\n")
--[===[
local svg = string.format([[
<svg xmlns="http://www.w3.org/2000/svg" width="%d" viewBox="0 0 %d %d">
]], self.width / 8, self.width, self.height)
local function svgrect(text, r, attrs)
svg = svg .. string.format([[
<rect debug="%s" x="%d" y="%d" width="%d" height="%d" %s/>
]], text, r.x, r.y, r.width, r.height, attrs)
end
svgrect("bg", rect(0, 0, self.width, self.height), [[fill="none" stroke="rgba(0, 0, 0, 1)" stroke-width="1px"]])
for si = 1, #spaces do
svgrect("space " .. tostring(si), spaces[si], [[fill="rgba(0, 0, 255, 0.5)" stroke="rgba(0, 0, 255, 1)" stroke-width="1px"]])
end
for tti = 1, ti - 1 do
svgrect("taken " .. tostring(tti), taken[tti], [[fill="rgba(0, 255, 0, 0.2)" stroke="rgba(0, 255, 0, 1)" stroke-width="1px"]])
end
svgrect("taken " .. tostring(ti), t, [[fill="rgba(0, 255, 0, 1)" stroke="rgba(0, 255, 0, 1)" stroke-width="1px"]])
]===]
for si = #spaces, 1, -1 do
local s = spaces[si]
local result = rectSub(s, t)
table.remove(spaces, si)
for ri = 1, #result do
---svgrect("new " .. tostring(si) .. " " .. tostring(ri), result[ri], [[fill="rgba(255, 0, 0, 0.2)" stroke="rgba(255, 0, 0, 1)" stroke-width="1px"]])
table.insert(spaces, result[ri])
end
end
end
l.spaces = spaces
l.reclaimed = 0
end
end
end
local quad = {}
local mtQuad = {
__name = "ui.megacanvases.megaquad",
__index = quad,
__gc = function(self)
self:release(true, true)
end
}
function quad:init(width, height)
self:release()
if not width then
width = self.width
height = self.height
end
if self.canvas and (self.canvasWidth < width or self.canvasHeight < height) then
megacanvas.pool.free(self.canvas, self.canvasWidth, self.canvasHeight, self.canvasNew)
self.canvas = nil
end
if width > megacanvas.widthMax or height > megacanvas.heightMax then
error(string.format("Requested pooled canvas size too large: %d x %d - maximum allowed is %d x %d", width, height, megacanvas.widthMax, megacanvas.heightMax))
end
if not self.canvas then
self.canvas, self.canvasWidth, self.canvasHeight, self.canvasNew = megacanvas.pool.get(
math.min(megacanvas.widthMax, math.ceil(width / megacanvas.quadFastPadding + 1) * megacanvas.quadFastPadding),
math.min(megacanvas.heightMax, math.ceil(height / megacanvas.quadFastPadding + 1) * megacanvas.quadFastPadding)
)
end
self.width = width
self.height = height
self.large = width > (megacanvas.width - megacanvas.padding) or height > (megacanvas.height - megacanvas.padding)
self.lifetime = 0
end
function quad:release(full, gc)
if self.quad then
local space = self.space
space.reclaimed = true
local layer = self.layer
local taken = layer.taken
table.remove(taken, space.index)
for i = space.index, #taken do
taken[i].index = i
end
layer.spaces[#layer.spaces + 1] = space
layer.reclaimed = layer.reclaimed + 1
self.space = false
self.quad = false
self.layer = false
self.converted = false
end
if self.marked then
megacanvas.marked[self.marked] = false
self.marked = false
end
if full then
local canvas = self.canvas
if canvas then
self.canvas = false
if gc then
-- There's a very high likelihood that the canvas has been GC'd as well if we're here.
-- ... might as well just dispose it entirely. Whoops!
megacanvas.managedCanvases[canvas] = nil
canvas:release()
megacanvas.pool.free(false, self.canvasWidth, self.canvasHeight, self.canvasNew)
else
megacanvas.pool.free(canvas, self.canvasWidth, self.canvasHeight, self.canvasNew)
end
end
local index = self.index
if self.index then
self.index = false
megacanvas.quads[self.index] = false
megacanvas.quadsAlive = megacanvas.quadsAlive - 1
end
end
end
function quad:draw(x, y, r, sx, sy, ox, oy, kx, ky)
self.lifetime = 0
local quad = self.quad
if quad then
local layer = self.layer
local converted = self.converted
if not converted then
love.graphics.setBlendMode("alpha", "premultiplied")
local layer = self.layer
if layer.layer then
love.graphics.drawLayer(layer.atlas.canvas, layer.layer, quad, x, y, r, sx, sy, ox, oy, kx, ky)
else
love.graphics.draw(layer.atlas.canvas, quad, x, y, r, sx, sy, ox, oy, kx, ky)
end
love.graphics.setBlendMode("alpha", "alphamultiply")
else
if layer.layer then
return love.graphics.drawLayer(layer.atlas.canvas, layer.layer, quad, x, y, r, sx, sy, ox, oy, kx, ky)
else
return love.graphics.draw(layer.atlas.canvas, quad, x, y, r, sx, sy, ox, oy, kx, ky)
end
end
return
end
love.graphics.setBlendMode("alpha", "premultiplied")
love.graphics.draw(self.canvas, x, y, r, sx, sy, ox, oy, kx, ky)
love.graphics.setBlendMode("alpha", "alphamultiply")
end
function quad:mark()
if not self.quad and not self.marked and not self.large then
local index = #megacanvas.marked + 1
megacanvas.marked[index] = self
self.marked = index
end
end
function megacanvas.pool.get(width, height)
local pool = megacanvas.pool
::retry::
local best, index = smallest(pool, width, height)
megacanvas.poolUsed = megacanvas.poolUsed + 1
if best then
megacanvas.poolAlive = megacanvas.poolAlive - 1
pool[index] = false
if tostring(best.canvas) == "Canvas: NULL" then
print(debug.traceback("GETTING A RELEASED CANVAS FROM THE POOL!"))
goto retry
end
return best.canvas, best.width, best.height, false
end
megacanvas.poolNew = megacanvas.poolNew + 1
local canvas = love.graphics.newCanvas(width, height)
local mt = getmetatable(canvas)
if not mt.__megacanvasPoolRelease then
mt.__megacanvasPoolRelease = true
local release = mt.__index.release
mt.__index.release = function(self, ...)
if megacanvas.managedCanvases[self] then
print(debug.traceback("RELEASING POOL-MANAGED CANVAS THAT IS STILL IN USE! " .. tostring(canvas)))
end
return release(self, ...)
end
end
megacanvas.managedCanvases[canvas] = true
return canvas, width, height, true
end
function megacanvas.pool.free(canvas, width, height, new)
megacanvas.poolUsed = megacanvas.poolUsed - 1
if new then
megacanvas.poolNew = megacanvas.poolNew - 1
end
if canvas then
if tostring(canvas) == "Canvas: NULL" then
print(debug.traceback("FREEING A RELEASED CANVAS TO THE POOL!"))
return
end
megacanvas.poolAlive = megacanvas.poolAlive + 1
local pool = megacanvas.pool
for i = 1, #pool + 1 do
if not pool[i] then
pool[i] = {
canvas = canvas,
width = width,
height = height,
lifetime = 0
}
break
end
end
end
end
function megacanvas.pool.sort(a, b)
return a.width * a.height < b.width * b.height
end
function megacanvas.pool.cleanup()
local min = 8
local max = 24
local deadMax = 32
local lifetimeMax = 60 * 10
local pool = megacanvas.pool
local alive = megacanvas.poolAlive
if alive >= max or #pool - alive > deadMax then
cleanupList(pool)
alive = #pool
if alive >= max then
table.sort(pool, megacanvas.pool.sort)
for i = 1, #pool - min - 1 do
local canvas = pool[1].canvas
megacanvas.managedCanvases[canvas] = nil
canvas:release()
table.remove(pool, 1)
end
alive = min
end
end
for i = #pool, 1, -1 do
local entry = pool[i]
if entry then
local lifetime = entry.lifetime + 1
if lifetime < lifetimeMax then
entry.lifetime = lifetime
else
local canvas = entry.canvas
megacanvas.managedCanvases[canvas] = nil
canvas:release()
table.remove(pool, i)
alive = alive - 1
end
end
end
megacanvas.poolAlive = alive
end
function megacanvas.newAtlas()
local a = setmetatable({}, mtAtlas)
local index = #megacanvas.atlases + 1
a.index = index
megacanvas.atlases[index] = a
a:init()
return a
end
function megacanvas.new(width, height)
local q = setmetatable({}, mtQuad)
if _G.newproxy then
local proxy = _G.newproxy(true)
getmetatable(proxy).__gc = function()
mtQuad.__gc(q)
end
q.__proxy = proxy
end
local index = #megacanvas.quads + 1
q.index = index
megacanvas.quads[index] = q
megacanvas.quadsAlive = megacanvas.quadsAlive + 1
q:init(width, height)
return q
end
function megacanvas.process()
local lifetimeMax = 60 * 5
local quads = megacanvas.quads
local quadsAlive = true
for i = 1, #quads do
local q = quads[i]
if q then
local lifetime = q.lifetime + 1
if lifetime < lifetimeMax then
q.lifetime = lifetime
else
q:release(true)
quadsAlive = false
end
end
end
local cleaned = cleanupList(quads, quadsAlive and megacanvas.quadsAlive, 32)
if cleaned then
for i = cleaned, #quads do
quads[i].index = i
end
megacanvas.quadsAlive = #quads
end
local atlases = megacanvas.atlases
for ai = 1, #atlases do
atlases[ai]:cleanup()
end
megacanvas.pool.cleanup()
local marked = megacanvas.marked
local markedCount = #marked
if markedCount < 0 then
return
end
local padding = megacanvas.padding
local markedLast = math.max(1, markedCount - 4)
for mi = markedCount, markedLast, -1 do
local q = marked[mi]
if q then
q.marked = false
local widthPadded = q.width + padding * 2
local heightPadded = q.height + padding * 2
for ai = 1, #atlases do
q.layer, q.space = atlases[ai]:fit(widthPadded, heightPadded)
if q.layer then
break
end
end
if not q.layer then
q.layer, q.space = megacanvas.newAtlas():fit(widthPadded, heightPadded)
end
end
end
local sX, sY, sW, sH = love.graphics.getScissor()
local canvasPrev = love.graphics.getCanvas()
love.graphics.push()
love.graphics.origin()
love.graphics.setBlendMode("alpha", "premultiplied")
local shaderPrev
if megacanvas.convertBlend then
love.graphics.getShader()
love.graphics.setShader(megacanvas.convertBlendShader)
end
love.graphics.setColor(1, 1, 1, 1)
for mi = markedCount, markedLast, -1 do
local q = marked[mi]
if q then
marked[mi] = nil
local widthPadded = q.width + padding * 2
local heightPadded = q.height + padding * 2
local layer = q.layer
local space = q.space
local x = space.x
local y = space.y
if layer.layer then
love.graphics.setCanvas(layer.atlas.canvas, layer.layer)
else
love.graphics.setCanvas(layer.atlas.canvas)
end
love.graphics.setScissor(x, y, widthPadded, heightPadded)
love.graphics.clear(0, 0, 0, 0)
x = x + padding
y = y + padding
local quad = love.graphics.newQuad(0, 0, q.width, q.height, q.canvasWidth, q.canvasHeight)
love.graphics.draw(q.canvas, x, y)
megacanvas.pool.free(q.canvas, q.canvasWidth, q.canvasHeight, q.canvasNew)
q.canvas = nil
quad:setViewport(x, y, q.width, q.height, layer.atlas.width, layer.atlas.height)
q.quad = quad
q.converted = megacanvas.convertBlend
end
end
if megacanvas.convertBlend then
love.graphics.setShader(shaderPrev)
end
love.graphics.setBlendMode("alpha", "alphamultiply")
love.graphics.pop()
love.graphics.setCanvas(canvasPrev)
love.graphics.setScissor(sX, sY, sW, sH)
end
function megacanvas.dump(prefix)
local atlases = megacanvas.atlases
local quads = megacanvas.quads
if megacanvas.debug.rects then
local sX, sY, sW, sH = love.graphics.getScissor()
local canvasPrev = love.graphics.getCanvas()
love.graphics.push()
love.graphics.origin()
love.graphics.setScissor()
love.graphics.setLineWidth(1)
local atlases = megacanvas.atlases
for ai = 1, #atlases do
local a = atlases[ai]
local canvas = a.canvas
local layers = a.layers
for li = 1, a.layersAllocated do
local l = layers[li]
if l.layer then
love.graphics.setCanvas(canvas, l.layer)
else
love.graphics.setCanvas(canvas)
end
local spaces = l.spaces
for si = 1, #spaces do
local r = spaces[si]
if r.reclaimed then
love.graphics.setColor(0.5, 0, 0, 0.5)
love.graphics.rectangle("fill", r.x + 0.5, r.y + 0.5, r.width - 1, r.height - 1)
else
love.graphics.setColor(0, 0, 0.5, 0.5)
love.graphics.rectangle("fill", r.x + 0.5, r.y + 0.5, r.width - 1, r.height - 1)
end
end
for si = 1, #spaces do
local r = spaces[si]
if r.reclaimed then
love.graphics.setColor(1, 0, 0, 1)
else
love.graphics.setColor(0, 0, 1, 1)
end
love.graphics.rectangle("line", r.x + 0.5, r.y + 0.5, r.width - 1, r.height - 1)
end
local taken = l.taken
for ti = 1, #taken do
local r = taken[ti]
love.graphics.setColor(0, 1, 0, 1)
love.graphics.rectangle("line", r.x + 0.5, r.y + 0.5, r.width - 1, r.height - 1)
end
end
end
for qi = 1, #quads do
local q = quads[qi]
if q and q.canvas and q.quad then
love.graphics.setCanvas(q.canvas)
love.graphics.setColor(1, 0, 0, 0.5)
love.graphics.rectangle("fill", 0, 0, q.width, q.height)
end
end
love.graphics.pop()
love.graphics.setCanvas(canvasPrev)
love.graphics.setScissor(sX, sY, sW, sH)
end
for ai = 1, #atlases do
local a = atlases[ai]
local canvas = a.canvas
local layers = a.layers
for li = 1, a.layersAllocated or 1 do
local l = layers[li]
local fh = io.open(prefix .. string.format("atlas_%d_layer_%d.png", ai, li), "wb")
if fh then
local id = canvas:newImageData(l.layer)
local fd = id:encode("png")
id:release()
fh:write(fd:getString())
fh:close()
fd:release()
end
end
end
for qi = 1, #quads do
local q = quads[qi]
if q and q.canvas then
local fh = io.open(prefix .. string.format("quad_%d.png", qi), "wb")
if fh then
local id = q.canvas:newImageData()
local fd = id:encode("png")
id:release()
fh:write(fd:getString())
fh:close()
fd:release()
end
end
end
end
return setmetatable(megacanvas, {
__call = function(self, ...)
return self.new(...)
end
})
|
return function (Data)
Data = MultiFilter(Data)
local TableString, ErrMsg = Split(tostring(Data), ";")
if not TableString then
return nil, ErrMsg
end
return TableString
end
|
local DebugOutput = require"Toolbox.Debug.Registry".GetDefaultPipe()
local Import = require"Toolbox.Import"
local Tools = require"Toolbox.Tools"
local type = Tools.Type.GetType
local Object = Import.Module.Relative"Object"
local CanonicalName = Import.Module.Relative"CanonicalName"
local Flat = Import.Module.Relative"Flat"
return Object(
"Nested.Rule", {
Construct = function(self, Pattern)
assert(Pattern ~= nil)
self.Pattern = Pattern
end;
Decompose = function(self, Canonical)
local Name = (
Canonical
and Canonical()
or 1
)
--DebugOutput:Format"Generating rule %s = %s"(Name, type(self.Pattern))
return Flat.Grammar{
[Name] = self.Pattern(Canonical);
}
end;
Copy = function(self)
return -self.Pattern
end;
}
)
|
-- 数值for循环
-- for var=exp1,exp2,exp3 do
-- <执行体>
-- end
-- var 从 exp1 变化到 exp2,每次变化以 exp3 为步长递增 var,并执行一次 "执行体"。exp3 是可选的,如果不指定,默认为1。
for i = 10, 1, -1 do
print(i)
end
-- 泛型for循环
-- 泛型 for 循环通过一个迭代器函数来遍历所有值,类似 java 中的 foreach 语句。
-- 打印数组a的所有值
-- i是数组索引值,v是对应索引的数组元素值。ipairs是Lua提供的一个迭代器函数,用来迭代数组。
a = {"one", "two", "three"}
for i, v in ipairs(a) do
print(i, v)
end
|
project "GLFW"
location "%{wks.location}"
kind "StaticLib"
language "C"
staticruntime "on"
targetdir ("%{PremakeDir.target}")
objdir ("%{PremakeDir.object}")
files
{
"%{PremakeDir.vendor}/include/GLFW/glfw3.h",
"%{PremakeDir.vendor}/include/GLFW/glfw3native.h",
"%{PremakeDir.vendor}/src/glfw_config.h",
"%{PremakeDir.vendor}/src/context.c",
"%{PremakeDir.vendor}/src/init.c",
"%{PremakeDir.vendor}/src/input.c",
"%{PremakeDir.vendor}/src/monitor.c",
"%{PremakeDir.vendor}/src/vulkan.c",
"%{PremakeDir.vendor}/src/window.c"
}
filter "system:linux"
pic "On"
systemversion "latest"
staticruntime "On"
files
{
"%{PremakeDir.vendor}/src/x11_init.c",
"%{PremakeDir.vendor}/src/x11_monitor.c",
"%{PremakeDir.vendor}/src/x11_window.c",
"%{PremakeDir.vendor}/src/xkb_unicode.c",
"%{PremakeDir.vendor}/src/posix_time.c",
"%{PremakeDir.vendor}/src/posix_thread.c",
"%{PremakeDir.vendor}/src/glx_context.c",
"%{PremakeDir.vendor}/src/egl_context.c",
"%{PremakeDir.vendor}/src/osmesa_context.c",
"%{PremakeDir.vendor}/src/linux_joystick.c"
}
defines
{
"_GLFW_X11"
}
filter "system:windows"
systemversion "latest"
staticruntime "On"
files
{
"%{PremakeDir.vendor}/src/win32_init.c",
"%{PremakeDir.vendor}/src/win32_joystick.c",
"%{PremakeDir.vendor}/src/win32_monitor.c",
"%{PremakeDir.vendor}/src/win32_time.c",
"%{PremakeDir.vendor}/src/win32_thread.c",
"%{PremakeDir.vendor}/src/win32_window.c",
"%{PremakeDir.vendor}/src/wgl_context.c",
"%{PremakeDir.vendor}/src/egl_context.c",
"%{PremakeDir.vendor}/src/osmesa_context.c"
}
defines
{
"_GLFW_WIN32",
"_CRT_SECURE_NO_WARNINGS"
}
filter "configurations:Debug"
runtime "Debug"
symbols "on"
filter "configurations:Release"
runtime "Release"
optimize "on"
|
---------------------------------------------------------------------------------------------------
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0105-remote-control-seat.md
-- User story:
-- Use case:
-- Item:
--
-- Description:
-- In case:
-- 1) SDL does not get RC capabilities for SEAT module through RC.GetCapabilities
-- SDL must:
-- 1) Response with success = false and resultCode = UNSUPPORTED_RESOURCE on all valid RPC with module SEAT
-- 2) Does not send RPC request to HMI
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local commonRC = require('test_scripts/RC/commonRC')
--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
-- [[ Local Variables ]]
local capParams = {}
capParams.CLIMATE = commonRC.DEFAULT
capParams.RADIO = commonRC.DEFAULT
capParams.BUTTONS = commonRC.DEFAULT
capParams.SEAT = nil
local hmiRcCapabilities = commonRC.buildHmiRcCapabilities(capParams)
--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", commonRC.preconditions)
runner.Step("Start SDL, HMI (HMI has not SEAT RC capabilities), connect Mobile, start Session", commonRC.start,
{hmiRcCapabilities})
runner.Step("RAI", commonRC.registerAppWOPTU)
runner.Step("Activate App1", commonRC.activateApp)
runner.Title("Test")
runner.Step("GetInteriorVehicleData SEAT(UNSUPPORTED_RESOURCE)", commonRC.rpcDenied,
{ "SEAT", 1, "GetInteriorVehicleData", "UNSUPPORTED_RESOURCE" })
runner.Step("SetInteriorVehicleData SEAT(UNSUPPORTED_RESOURCE)", commonRC.rpcDenied,
{ "SEAT", 1, "SetInteriorVehicleData", "UNSUPPORTED_RESOURCE" })
runner.Title("Postconditions")
runner.Step("Stop SDL", commonRC.postconditions)
|
function onCreate()
for i = 0, getProperty('unspawnNotes.length')-1 do
if getPropertyFromGroup('unspawnNotes', i, 'noteType') == 'Static Note' then
setPropertyFromGroup('unspawnNotes', i, 'texture', 'staticNotes');
setPropertyFromGroup('unspawnNotes', i, 'hitHealth', '0.023');
setPropertyFromGroup('unspawnNotes', i, 'missHealth', '0.4');
setPropertyFromGroup('unspawnNotes', i, 'hitCausesMiss', false);
end
end
end
function noteMiss(id, noteData, noteType, isSustainNote)
if noteType == 'Static Note' then
playSound('hitStatic1')
triggerEvent('Missed Static Note', 'amongUs', 'amongUs')
end
end
function onEvent(name,a,b)
if name == 'Missed Static Note' then
objectPlayAnimation('missStatic', 'missed', true)
end
end
|
local utils = require('Set.utils')
-- Set lets you store unique values of any type
-- @param list {table}
-- @returns {table}
function Set(list)
local self = {}
-- Items presented in Set
-- @type {table}
self.items = {}
-- Current Set length
-- @type {number}
self.size = 0
if type(list) == 'table' then
for _, value in ipairs(list) do
self.items[value] = true
self.size = self.size + 1
end
end
-- Appends value to the Set object
-- @param value {any}
-- @returns {void}
self.insert = function(value)
if not self.items[value] then
self.items[value] = true
self.size = self.size + 1
end
end
-- Checks if value is present in the Set object or not
-- @param value {any}
-- @returns {boolean}
self.has = function(value)
return self.items[value] == true
end
-- Removes all items from the Set object
-- @returns {void}
self.clear = function()
self.items = {}
self.size = 0
end
-- Removes item from the Set object and returns a boolean value asserting wheater item was removed or not
-- @param value {any}
-- @returns {boolean}
self.delete = function(value)
if self.items[value] then
self.items[value] = nil
self.size = self.size - 1
return true
end
return false
end
-- Calls function once for each item present in the Set object without preserve insertion order
-- @param callback {function}
-- @returns {void}
self.each = function(callback)
for key in pairs(self.items) do
callback(key)
end
end
-- Returns true whether all items pass the test provided by the callback function
-- @param callback {function}
-- @returns {boolean}
self.every = function(callback)
for key in pairs(self.items) do
if not callback(key) then
return false
end
end
return true
end
-- Returns a new Set that contains all items from the original Set and all items from the specified Sets
-- @param {Set[]}
-- @returns Set
self.union = function(...)
local args = {...}
local result = Set(utils.to_array(self.items))
for _, set in ipairs(args) do
set.each(function(value)
result.insert(value)
end)
end
return result
end
-- Returns a new Set that contains all elements that are common in all Sets
-- @param {Set[]}
-- @returns Set
self.intersection = function(...)
local args = {...}
local result = Set()
self.each(function(value)
local is_common = true
for _, set in ipairs(args) do
if not set.has(value) then
is_common = false
break
end
end
if is_common then
result.insert(value)
end
end)
return result
end
-- Returns a new Set that contains the items that only exist in the original Set
-- @param {Set[]}
-- @returns Set
self.difference = function(...)
local args = {...}
local result = Set()
self.each(function(value)
local is_common = false
for _, set in ipairs(args) do
if set.has(value) then
is_common = true
break
end
end
if not is_common then
result.insert(value)
end
end)
return result
end
-- Returns a symetric difference of two Sets
-- @param {Set}
-- @returns {Set}
self.symmetric_difference = function(set)
local difference = Set(utils.to_array(self.items))
set.each(function(value)
if difference.has(value) then
difference.delete(value)
else
difference.insert(value)
end
end)
return difference
end
-- Returns true if set has all items present in the subset
-- @param {Set}
-- @returns {boolean}
self.is_superset = function(subset)
return self.every(function(value)
return subset.has(value)
end)
end
return self
end
return Set
|
-- id int 评价id
-- name string 评价名称
-- award tableString[k:#seq|v:#table(id=#1(int),count=#2(int))] 额外奖励
return {
[1] = {
id = 1,
name = "B",
award = {
[1] = {
id = 10102,
count = 1,
},
},
},
[2] = {
id = 2,
name = "A",
award = {
[1] = {
id = 10102,
count = 10,
},
},
},
[3] = {
id = 3,
name = "S",
award = {
[1] = {
id = 10102,
count = 15,
},
},
},
[4] = {
id = 4,
name = "SS",
award = {
[1] = {
id = 10102,
count = 20,
},
},
},
[5] = {
id = 5,
name = "SSS",
award = {
[1] = {
id = 10102,
count = 50,
},
},
},
}
|
-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
--
-- This file is compatible with Lua 5.3
local class = require("class")
require("kaitaistruct")
local str_decode = require("string_decode")
ParamsCallShort = class.class(KaitaiStruct)
function ParamsCallShort:_init(io, parent, root)
KaitaiStruct._init(self, io)
self._parent = parent
self._root = root or self
self:_read()
end
function ParamsCallShort:_read()
self.buf1 = ParamsCallShort.MyStr1(5, self._io, self, self._root)
self.buf2 = ParamsCallShort.MyStr2((2 + 3), true, self._io, self, self._root)
end
ParamsCallShort.MyStr1 = class.class(KaitaiStruct)
function ParamsCallShort.MyStr1:_init(len, io, parent, root)
KaitaiStruct._init(self, io)
self._parent = parent
self._root = root or self
self.len = len
self:_read()
end
function ParamsCallShort.MyStr1:_read()
self.body = str_decode.decode(self._io:read_bytes(self.len), "UTF-8")
end
ParamsCallShort.MyStr2 = class.class(KaitaiStruct)
function ParamsCallShort.MyStr2:_init(len, has_trailer, io, parent, root)
KaitaiStruct._init(self, io)
self._parent = parent
self._root = root or self
self.len = len
self.has_trailer = has_trailer
self:_read()
end
function ParamsCallShort.MyStr2:_read()
self.body = str_decode.decode(self._io:read_bytes(self.len), "UTF-8")
if self.has_trailer then
self.trailer = self._io:read_u1()
end
end
|
-- By xaneh#6591
ESX = nil
local charPed = nil
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
if ESX == nil then
TriggerEvent("esx:getSharedObject", function(obj) ESX = obj end)
Citizen.Wait(200)
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if NetworkIsSessionStarted() then
TriggerEvent('qb-multicharacter:client:chooseChar')
return
end
end
end)
Config = {
PedCoords = {x = -813.97, y = 176.22, z = 76.74, h = -7.5, r = 1.0},
HiddenCoords = {x = -812.23, y = 182.54, z = 76.74, h = 156.5, r = 1.0},
CamCoords = {x = -814.02, y = 179.56, z = 76.74, h = 198.5, r = 1.0},
}
--- CODE
local choosingCharacter = false
local cam = nil
function openCharMenu(bool)
print(bool)
SetNuiFocus(bool, bool)
SendNUIMessage({
action = "ui",
toggle = bool,
})
choosingCharacter = bool
skyCam(bool)
end
RegisterNUICallback('closeUI', function()
openCharMenu(false)
end)
RegisterNUICallback('disconnectButton', function()
SetEntityAsMissionEntity(charPed, true, true)
DeleteEntity(charPed)
TriggerServerEvent('qb-multicharacter:server:disconnect')
end)
RegisterNUICallback('selectCharacter', function(data)
local cData = data.cData
DoScreenFadeOut(10)
TriggerServerEvent('qb-multicharacter:server:loadUserData', cData)
openCharMenu(false)
SetEntityAsMissionEntity(charPed, true, true)
DeleteEntity(charPed)
end)
RegisterNetEvent('qb-multicharacter:client:closeNUI')
AddEventHandler('qb-multicharacter:client:closeNUI', function()
SetNuiFocus(false, false)
end)
local Countdown = 1
RegisterNetEvent('qb-multicharacter:client:chooseChar')
AddEventHandler('qb-multicharacter:client:chooseChar', function()
SetNuiFocus(false, false)
DoScreenFadeOut(10)
Citizen.Wait(1000)
local interior = GetInteriorAtCoords(-814.89, 181.95, 76.85 - 18.9)
LoadInterior(interior)
while not IsInteriorReady(interior) do
Citizen.Wait(1000)
print("[Loading Selector Interior, Please Wait!]")
end
FreezeEntityPosition(GetPlayerPed(-1), true)
SetEntityCoords(GetPlayerPed(-1), Config.HiddenCoords.x, Config.HiddenCoords.y, Config.HiddenCoords.z)
Citizen.Wait(1500)
ShutdownLoadingScreenNui()
NetworkSetTalkerProximity(0.0)
openCharMenu(true)
end)
function selectChar()
openCharMenu(true)
end
RegisterNUICallback('cDataPed', function(data)
local cData = data.cData
SetEntityAsMissionEntity(charPed, true, true)
DeleteEntity(charPed)
if cData ~= nil then
ESX.TriggerCallback('qb-multicharacter:server:getSkin', function(model, data)
model = model ~= nil and tonumber(model) or false
if model ~= nil then
Citizen.CreateThread(function()
RequestModel(model)
while not HasModelLoaded(model) do
Citizen.Wait(0)
end
charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.h, false, true)
SetPedComponentVariation(charPed, 0, 0, 0, 2)
FreezeEntityPosition(charPed, false)
SetEntityInvincible(charPed, true)
PlaceObjectOnGroundProperly(charPed)
SetBlockingOfNonTemporaryEvents(charPed, true)
data = json.decode(data)
TriggerEvent('qb-clothing:client:loadPlayerClothing', data, charPed)
end)
else
Citizen.CreateThread(function()
local randommodels = {
"mp_m_freemode_01",
"mp_f_freemode_01",
}
local model = GetHashKey(randommodels[math.random(1, #randommodels)])
RequestModel(model)
while not HasModelLoaded(model) do
Citizen.Wait(0)
end
charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.h, false, true)
SetPedComponentVariation(charPed, 0, 0, 0, 2)
FreezeEntityPosition(charPed, false)
SetEntityInvincible(charPed, true)
PlaceObjectOnGroundProperly(charPed)
SetBlockingOfNonTemporaryEvents(charPed, true)
end)
end
end, cData.citizenid)
else
Citizen.CreateThread(function()
local randommodels = {
"mp_m_freemode_01",
"mp_f_freemode_01",
}
local model = GetHashKey(randommodels[math.random(1, #randommodels)])
RequestModel(model)
while not HasModelLoaded(model) do
Citizen.Wait(0)
end
charPed = CreatePed(2, model, Config.PedCoords.x, Config.PedCoords.y, Config.PedCoords.z - 0.98, Config.PedCoords.h, false, true)
SetPedComponentVariation(charPed, 0, 0, 0, 2)
FreezeEntityPosition(charPed, false)
SetEntityInvincible(charPed, true)
PlaceObjectOnGroundProperly(charPed)
SetBlockingOfNonTemporaryEvents(charPed, true)
end)
end
end)
RegisterNUICallback('setupCharacters', function()
ESX.TriggerCallback("test:yeet", function(result)
SendNUIMessage({
action = "setupCharacters",
characters = result
})
end)
end)
RegisterNUICallback('removeBlur', function()
SetTimecycleModifier('default')
end)
RegisterNUICallback('createNewCharacter', function(data)
local cData = data
DoScreenFadeOut(150)
if cData.gender == "man" then
cData.gender = 0
elseif cData.gender == "vrouw" then
cData.gender = 1
end
TriggerServerEvent('qb-multicharacter:server:createCharacter', cData)
TriggerServerEvent('qb-multicharacter:server:GiveStarterItems')
Citizen.Wait(500)
end)
RegisterNUICallback('removeCharacter', function(data)
TriggerServerEvent('qb-multicharacter:server:deleteCharacter', data.citizenid)
end)
function skyCam(bool)
SetRainFxIntensity(0.0)
TriggerEvent('qb-weathersync:client:DisableSync')
SetWeatherTypePersist('EXTRASUNNY')
SetWeatherTypeNow('EXTRASUNNY')
SetWeatherTypeNowPersist('EXTRASUNNY')
NetworkOverrideClockTime(12, 0, 0)
if bool then
DoScreenFadeIn(1000)
SetTimecycleModifier('hud_def_blur')
SetTimecycleModifierStrength(1.0)
FreezeEntityPosition(GetPlayerPed(-1), false)
cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -813.46, 178.95, 76.85, 0.0 ,0.0, 174.5, 60.00, false, 0)
SetCamActive(cam, true)
RenderScriptCams(true, false, 1, true, true)
else
SetTimecycleModifier('default')
SetCamActive(cam, false)
DestroyCam(cam, true)
RenderScriptCams(false, false, 1, true, true)
FreezeEntityPosition(GetPlayerPed(-1), false)
end
end
|
--[[
Title: SocketService
Author(s): big
Date: 2019.10.30
Desc:
use the lib:
------------------------------------------------------------
NPL.load("(gl)Mod/WorldShare/service/SocketService.lua")
local SocketService = commonlib.gettable("Mod.WorldShare.service.SocketService")
------------------------------------------------------------
]]
local NetworkMain = commonlib.gettable("MyCompany.Aries.Game.Network.NetworkMain")
local SocketService = commonlib.inherit(commonlib.gettable("System.Core.ToolBase"), commonlib.gettable("Mod.WorldShare.service.SocketService"))
SocketService:Property({"onlineMsgInterval", 5000, "GetOnlineMsgInterval", "SetOnlineMsgInterval", auto = true})
SocketService:Property({"isStartedUDPService", false, "IsUDPStarted", "SetUDPStarted", auto = true})
SocketService:Signal("SocketServiceStarted")
SocketService.externalIPList = nil
SocketService.uuid = ''
-- start socket service
function SocketService:StartUDPService()
if self:IsUDPStarted() then
return false
end
NPL.AddPublicFile("Mod/WorldShare/service/SocketService.lua", 302)
local att = NPL.GetAttributeObject()
-- start udp server
local port = 8099
local i = 0
while not att:GetField("IsUDPServerStarted") and i <= 20 do
att:SetField("EnableUDPServer", port + i)
i = i + 1
end
local ipList = att:GetField("ExternalIPList")
ipList = commonlib.split(ipList, ",")
self.externalIPList = ipList
self.uuid = System.Encoding.guid.uuid()
self:SetUDPStarted(true)
self:SocketServiceStarted()
end
-- send who online msg request
function SocketService:SendUDPWhoOnlineMsg()
Mod.WorldShare.Store:Remove('user/udpServerList')
local att = NPL.GetAttributeObject()
local broadcastAddressList = att:GetField("BroadcastAddressList")
broadcastAddressList = commonlib.split(broadcastAddressList, ",")
local defaultPort = 8099
for i = 0, 20 do
local port = defaultPort + i
-- broadcast all host
local serverAddrList = { "(gl)*" .. port .. ":Mod/WorldShare/service/SocketService.lua" }
for key, value in pairs(broadcastAddressList) do
table.insert(serverAddrList, string.format("(gl)\\\\%s %d:Mod/WorldShare/service/SocketService.lua", value, port))
end
for key, value in pairs(serverAddrList) do
-- send udp msg
NPL.activate(value, { isWorldShareMsg = true, type = "ONLINE", result = "WHO" }, 1, 2, 0)
end
end
end
function SocketService:SendUDPIamOnlineMsg(ip, port)
if not NetworkMain:IsServerStarted() or NetworkMain.tunnelClient then
return false
end
self:SendUDPMsg(
{
type = "ONLINE",
result = "IAM",
username = "nil",
serverName = "nil",
uuid = self.uuid,
worldHost = NetworkMain.server_manager.curHost,
worldPort = NetworkMain.server_manager.curPort
},
ip,
port
)
end
-- send udp msg
function SocketService:SendUDPMsg(params, ip, port)
if type(params) ~= 'table' then
return false
end
params.isWorldShareMsg = true
NPL.activate("(gl)\\\\" .. ip .. " " .. port .. ":Mod/WorldShare/service/SocketService.lua", params , 1, 2, 0)
end
-- receive udp msg
function SocketService:ReceiveUDPMsg(msg)
if type(msg) ~= 'table' or not msg.isUDP or not msg.isWorldShareMsg then
return false
end
if msg.type == 'ONLINE' then
if msg.result == "WHO" then
local ip, port = string.match(msg.nid, "~udp(.+)_(%d+)")
if not ip or not port then
return false
end
self:SendUDPIamOnlineMsg(ip, port)
end
if msg.result == "IAM" then
local udpIp, udpPort = string.match(msg.nid, "~udp(.+)_(%d+)")
if not udpIp or not udpPort then
return false
end
if not msg.uuid or not msg.worldHost or not msg.worldPort then
return false
end
-- exclude self
if msg.uuid == self.uuid then
return false
end
local udpServerList = Mod.WorldShare.Store:Get('user/udpServerList') or {}
for key, item in ipairs(udpServerList) do
if item.uuid == msg.uuid then
return false
end
end
udpServerList[#udpServerList + 1] = { ip = udpIp, port = msg.worldPort, username = msg.username, serverName = msg.serverName, uuid = msg.uuid }
Mod.WorldShare.Store:Set('user/udpServerList', udpServerList)
end
end
end
NPL.this(function()
SocketService:ReceiveUDPMsg(msg)
end)
|
object_mobile_coa_aclo_soldier_hum_m_01 = object_mobile_shared_coa_aclo_soldier_hum_m_01:new {
}
ObjectTemplates:addTemplate(object_mobile_coa_aclo_soldier_hum_m_01, "object/mobile/coa_aclo_soldier_hum_m_01.iff")
|
---@class TradeSkillUI
C_TradeSkillUI = {}
---@param recipeSpellID number
---@param numCasts number
---@param optionalReagents OptionalReagentInfo @ [OPTIONAL]
---@param recipeLevel number @ [OPTIONAL]
---@overload fun(recipeSpellID:number, numCasts:number, recipeLevel:number)
---@overload fun(recipeSpellID:number, numCasts:number)
function C_TradeSkillUI.CraftRecipe(recipeSpellID, numCasts, optionalReagents, recipeLevel) end
---@return number skillLineID
function C_TradeSkillUI.GetAllProfessionTradeSkillLines() end
---@param recipeSpellID number
---@param optionalReagentIndex number
---@param optionalReagents OptionalReagentInfo
---@return string bonusText
function C_TradeSkillUI.GetOptionalReagentBonusText(recipeSpellID, optionalReagentIndex, optionalReagents) end
---@param recipeSpellID number
---@return OptionalReagentSlot slots
function C_TradeSkillUI.GetOptionalReagentInfo(recipeSpellID) end
---@param recipeSpellID number
---@param recipeLevel number @ [OPTIONAL]
---@overload fun(recipeSpellID:number)
---@return TradeSkillRecipeInfo|nil recipeInfo
function C_TradeSkillUI.GetRecipeInfo(recipeSpellID, recipeLevel) end
---@param recipeSpellID number
---@param recipeLevel number @ [OPTIONAL]
---@overload fun(recipeSpellID:number)
---@return number numReagents
function C_TradeSkillUI.GetRecipeNumReagents(recipeSpellID, recipeLevel) end
---@param recipeSpellID number
---@param reagentIndex number
---@param recipeLevel number @ [OPTIONAL]
---@overload fun(recipeSpellID:number, reagentIndex:number)
---@return string|nil, number|nil, number, number reagentName, reagentFileID, reagentCount, playerReagentCount
function C_TradeSkillUI.GetRecipeReagentInfo(recipeSpellID, reagentIndex, recipeLevel) end
---@return number recastTimes
function C_TradeSkillUI.GetRecipeRepeatCount() end
---@param skillLineID number
---@return string professionDisplayName
function C_TradeSkillUI.GetTradeSkillDisplayName(skillLineID) end
---@return number, string, number, number, number, number|nil, string|nil skillLineID, skillLineDisplayName, skillLineRank, skillLineMaxRank, skillLineModifier, parentSkillLineID, parentSkillLineDisplayName
function C_TradeSkillUI.GetTradeSkillLine() end
---@param skillLineID number
---@return string, number, number, number, number|nil skillLineDisplayName, skillLineRank, skillLineMaxRank, skillLineModifier, parentSkillLineID
function C_TradeSkillUI.GetTradeSkillLineInfoByID(skillLineID) end
---@param categoryID number
---@return boolean effectivelyKnown
function C_TradeSkillUI.IsEmptySkillLineCategory(categoryID) end
---@param recipeSpellID number
---@param numCasts number
---@param optionalReagents OptionalReagentInfo @ [OPTIONAL]
---@overload fun(recipeSpellID:number, numCasts:number)
function C_TradeSkillUI.SetRecipeRepeatCount(recipeSpellID, numCasts, optionalReagents) end
---@class OptionalReagentItemFlag
local OptionalReagentItemFlag = {}
OptionalReagentItemFlag.TooltipShowsAsStatModifications = 0
---@class OptionalReagentSlot
---@field requiredSkillRank number
---@field slotText string|nil
---@field options table
local OptionalReagentSlot = {}
|
local Command = require('code_action_menu.lsp_objects.actions.command')
local CodeAction = require('code_action_menu.lsp_objects.actions.code_action')
local function get_buffer_width(buffer_number)
local buffer_lines = vim.api.nvim_buf_get_lines(buffer_number, 0, -1, false)
local longest_line = ''
for _, line in ipairs(buffer_lines) do
if #line > #longest_line then
longest_line = line
end
end
return #longest_line
end
local function get_buffer_height(buffer_number)
local buffer_lines = vim.api.nvim_buf_get_lines(buffer_number, 0, -1, false)
return #buffer_lines
end
local function is_buffer_empty(buffer_number)
local buffer_lines = vim.api.nvim_buf_get_lines(buffer_number, 0, -1, false)
return #buffer_lines == 0 or (#buffer_lines == 1 and #buffer_lines[1] == 0)
end
local function request_servers_for_actions(mode, cb)
if not cb then
local all_actions = {}
for _, data in ipairs(vim.fn.CocAction('codeActions', mode)) do
local action
if type(data.edit) == 'table' or type(data.command) == 'table' then
action = CodeAction:new(data)
else
action = Command:new(data)
end
table.insert(all_actions, action)
end
return all_actions
else
vim.fn.CocActionAsync('codeActions', mode, function(err, res)
if err ~= vim.NIL then
return
end
local all_actions = {}
for _, data in ipairs(res) do
local action
if type(data.edit) == 'table' or type(data.command) == 'table' then
action = CodeAction:new(data)
else
action = Command:new(data)
end
table.insert(all_actions, action)
end
cb(all_actions)
end)
end
end
local function order_actions(action_table, key_a, key_b)
local action_a = action_table[key_a]
local action_b = action_table[key_b]
if action_b:is_preferred() and not action_a:is_preferred() then
return false
elseif action_a:is_disabled() and not action_b:is_disabled() then
return false
else
-- Ordering function needs to return `true` at some point for every element.
return key_a < key_b
end
end
local function get_ordered_action_table_keys(action_table)
vim.validate({ ['action table to sort'] = { action_table, 'table' } })
local keys = {}
for key in pairs(action_table) do
local index = #keys + 1
keys[index] = key
end
table.sort(keys, function(key_a, key_b)
return order_actions(action_table, key_a, key_b)
end)
return keys
end
-- Put preferred actions at start, disabled at end
local function iterate_actions_ordered(action_table)
vim.validate({ ['actions to sort'] = { action_table, 'table' } })
local keys = get_ordered_action_table_keys(action_table)
local index = 0
return function()
index = index + 1
if keys[index] then
return index, action_table[keys[index]]
end
end
end
local function get_action_at_index_ordered(action_table, index)
vim.validate({ ['actions to sort'] = { action_table, 'table' } })
local keys = get_ordered_action_table_keys(action_table)
local key_for_index = keys[index]
return action_table[key_for_index]
end
return {
get_buffer_width = get_buffer_width,
get_buffer_height = get_buffer_height,
is_buffer_empty = is_buffer_empty,
request_servers_for_actions = request_servers_for_actions,
iterate_actions_ordered = iterate_actions_ordered,
get_action_at_index_ordered = get_action_at_index_ordered,
}
|
return function (hue, sat, val)
hue = hue % 6
sat = sat < 0 and 0 or sat > 1 and 1 or sat
val = val < 0 and 0 or val > 1 and 1 or val
local intensity = sat * val
local amount = (1-math.abs((hue%2)-1))*intensity
local r, g, b
if hue < 1 then r,g,b = intensity, amount, 0
elseif hue < 2 then r,g,b = amount, intensity, 0
elseif hue < 3 then r,g,b = 0, intensity, amount
elseif hue < 4 then r,g,b = 0, amount, intensity
elseif hue < 5 then r,g,b = amount, 0, intensity
else r,g,b = intensity, 0, amount
end
local mid = val - intensity
return r+mid, g+mid, b+mid
end
|
--[[ Credit for these translations goes to:
Mordroba
Djidiouf
Fenrirpims
Ikshaar
Avold
Viny
contrebasse
--]]
local L = LibStub("AceLocale-3.0"):NewLocale("TellMeWhen", "frFR", false)
if not L then return end
L["ALPHA"] = "Alpha"
L["ANIM_ACTVTNGLOW"] = "Icône: Activation des bordures"
L["ANIM_COLOR"] = "Couleur / Opacité"
L["ANIM_COLOR_DESC"] = "Configurer la couleur et l'opacité du flash."
L["Bleeding"] = "Saigne"
L["CASTERFORM"] = "Forme de lanceur de sorts"
L["CHOOSENAME_DIALOG"] = "Entrer le nom ou l'id du Sort/Capacité/Objet/Buff/Débuff attribué à cette icône. Vous pouvez ajouter de multiples buffs/débuffs en les séparant avec ';'." -- Needs review
L["CHOOSENAME_DIALOG_PETABILITIES"] = "|cFFFF5959COMPETENCES PET|r devraient utiliser SpellIDs."
L["CMD_OPTIONS"] = "Options"
L["CONDITIONPANEL_ALIVE"] = "Unité est en vie"
L["CONDITIONPANEL_ALIVE_DESC"] = "Le test passera si l'unité est en vie"
L["CONDITIONPANEL_AND"] = "Et"
L["CONDITIONPANEL_ANDOR"] = "Et / Ou"
L["CONDITIONPANEL_COMBAT"] = "Unité est en combat"
L["CONDITIONPANEL_COMBO"] = "Points de combo"
L["CONDITIONPANEL_ECLIPSE_DESC"] = [=[Eclipse fonctionne sur une fourchette de valeurs allant de -100 (éclipse lunaire) à 100 (éclipse solaire).
Entrez -80 si vous voulez faire fonctionner l'icône avec une valeur de 80 en éclipse lunaire.]=]
L["CONDITIONPANEL_EQUALS"] = "Égal à"
L["CONDITIONPANEL_EXISTS"] = "L'unité existe"
L["CONDITIONPANEL_GREATER"] = "Plus Grand Que"
L["CONDITIONPANEL_GREATEREQUAL"] = "Plus Grand Que ou Égal à"
L["CONDITIONPANEL_GROUPTYPE"] = "Type de groupe"
L["CONDITIONPANEL_ICON"] = "Icône affichée"
L["CONDITIONPANEL_ICON_DESC"] = [=[La condition sera remplie si l'icône spécifiée est actuellement affichée avec une transparence supérieure à 0.
Si vous ne voulez pas afficher les icônes cochées, cochez l'option %q dans les réglages de la transparence de l'icône.
Le groupe de l'icône cochée doit aussi être affiché pour cocher l'icône.]=] -- Needs review
L["CONDITIONPANEL_LESS"] = "Moins Que"
L["CONDITIONPANEL_LESSEQUAL"] = "Moins Que ou Égal à"
L["CONDITIONPANEL_NOTEQUAL"] = "Pas Égal à"
L["CONDITIONPANEL_OPERATOR"] = "Opérateur"
L["CONDITIONPANEL_OR"] = "Ou"
L["CONDITIONPANEL_POWER"] = "Puissance"
L["CONDITIONPANEL_POWER_DESC"] = [=[Vérifiera l'énergie du personnage s'il s'agit d'un druide en forme de félin,
sa rage si le personnage est un guerrier, etc.]=]
L["CONDITIONPANEL_PVPFLAG"] = "Unité est taggué PVP"
L["CONDITIONPANEL_RESTING"] = "Restant"
L["CONDITIONPANEL_TYPE"] = "Type"
L["CONDITIONPANEL_UNIT"] = "Personnage"
L["CONDITIONPANEL_VALUEN"] = "Valeur"
L["COPYPOSSCALE"] = "Copier position/échelle uniquement"
L["DESCENDING"] = "descendant"
L["DISABLED"] = "Désactivé"
L["Disoriented"] = "Désorienté"
L["EARTH"] = "Terre"
L["ECLIPSE_DIRECTION"] = "Sens de l'éclipse"
L["Enraged"] = "Enragé"
L["EVENTS_SETTINGS_PASSTHROUGH"] = "Continuer à réduire les événements"
L["FALSE"] = "Faux"
L["Feared"] = "Peur"
L["FIRE"] = "Feu"
L["GCD"] = "Temps de recharge global"
L["GROUP"] = "Groupe"
L["GROUPICON"] = "Groupe : %s, Icône : %d"
L["ICONALPHAPANEL_FAKEHIDDEN"] = "Toujours Masquer"
L["ICONALPHAPANEL_FAKEHIDDEN_DESC"] = "Tout le temps cacher l’icône tout en la laissant active afin de permettre aux conditions des autres icônes d'effectuer des vérifications sur l’icône masquée." -- Needs review
L["ICONMENU_ABSENT"] = "Absent"
L["ICONMENU_APPENDCONDT"] = "Ajoute %q en condition"
L["ICONMENU_BOTH"] = "Soit"
L["ICONMENU_BUFF"] = "Buff"
L["ICONMENU_BUFFDEBUFF"] = "Buff/Débuff"
L["ICONMENU_BUFFTYPE"] = "Buff ou débuff ?"
L["ICONMENU_COOLDOWNCHECK"] = "Vérification de cooldown ?"
L["ICONMENU_DEBUFF"] = "Débuff"
L["ICONMENU_DURATION_MAX_DESC"] = "Durée maximale permise pour afficher l'icône"
L["ICONMENU_DURATION_MIN_DESC"] = "Durée minimale nécessaire pour afficher l'icône"
L["ICONMENU_ENABLE"] = "Activé"
L["ICONMENU_FOCUS"] = "Focus"
L["ICONMENU_FOCUSTARGET"] = "Cible du focus"
L["ICONMENU_FRIEND"] = "Unités amicales"
L["ICONMENU_HIDEUNEQUIPPED"] = "Cacher quand le trou est vide"
L["ICONMENU_HOSTILE"] = "Unités hostiles"
L["ICONMENU_INVERTBARS"] = "Inverser les barres"
L["ICONMENU_MANACHECK"] = "Vérification de la puissance"
L["ICONMENU_MOUSEOVER"] = "Survol de la souris"
L["ICONMENU_MOUSEOVERTARGET"] = "Cible du survol de la souris"
L["ICONMENU_OFFS"] = "Offset"
L["ICONMENU_ONLYMINE"] = "Ne montrer que si lancé par soi"
L["ICONMENU_PETTARGET"] = "Cible du familier"
L["ICONMENU_PRESENT"] = "Présent"
L["ICONMENU_RANGECHECK"] = "Vérification de la portée ?"
L["ICONMENU_REACT"] = "Réaction d'unités"
L["ICONMENU_REACTIVE"] = "Sort réactif ou capacité"
L["ICONMENU_SHOWTIMER"] = "Montrer le timer"
L["ICONMENU_SHOWTIMERTEXT"] = "Afficher le numéro du timer"
L["ICONMENU_SHOWTIMERTEXT_DESC"] = "Cochez cette option pour afficher un texte de la durée restante sur l'icone." -- Needs review
L["ICONMENU_SHOWWHEN"] = "Montrer l'icône quand"
L["ICONMENU_STACKS_MAX_DESC"] = "Nombre maximum de stacks de l'aura requis pour montrer l'icône"
L["ICONMENU_STACKS_MIN_DESC"] = "Nombre minimum de stacks de l'aura requis pour montrer l’icône"
L["ICONMENU_TARGETTARGET"] = "Cible de la cible"
L["ICONMENU_TOTEM"] = "Totem/Goule non améliorée"
L["ICONMENU_TYPE"] = "Type d'icône"
L["ICONMENU_UNUSABLE"] = "Inutilisable"
L["ICONMENU_USABLE"] = "Utilisable"
L["ICONMENU_VEHICLE"] = "Véhicule"
L["ICONMENU_WPNENCHANT"] = "Enchantement d'arme temporaire"
L["ICONMENU_WPNENCHANTTYPE"] = "Slot d'arme à surveiller"
L["ICONTOCHECK"] = "Icône à vérifier"
L["ImmuneToMagicCC"] = "Immunisé aux contrôles magiques"
L["ImmuneToStun"] = "Immunisé aux étourdissements"
L["Incapacitated"] = "Incapacité"
L["LDB_TOOLTIP1"] = "|cff7fffffCliquer-gauche|r pour basculer le verrouillage des groupes"
L["LDB_TOOLTIP2"] = "Cliquer-droit pour montrer/cacher certains groupes "
L["Magic"] = "Magie"
L["MOON"] = "Lunaire"
L["NONE"] = "Aucune des valeurs ci-dessous"
L["Poison"] = "Poison"
L["ReducedHealing"] = "Soins prodigués réduits"
L["RESIZE"] = "Redimensionner"
L["RESIZE_TOOLTIP"] = "Cliquer et glisser pour changer la taille" -- Needs review
L["Rooted"] = "Immobilisé"
L["Silenced"] = "Silence"
L["Stunned"] = "Étourdi"
L["SUG_PATTERNMATCH_FISHINGLURE"] = "Appât de pêche %(%+%d+ compétence de pêche%)"
L["SUG_PATTERNMATCH_SHARPENINGSTONE"] = "Aiguisé %(%+%d+ points de dégâts%)"
L["SUG_PATTERNMATCH_WEIGHTSTONE"] = "Équilibré %(%+%d+ points de dégâts%)"
L["SUN"] = "Solaire"
L["TRUE"] = "Vrai"
L["UIPANEL_BARTEXTURE"] = "Texture de barre"
L["UIPANEL_COLUMNS"] = "Colonnes"
L["UIPANEL_DELGROUP"] = "Supprimer ce Groupe"
L["UIPANEL_DRAWEDGE"] = "Surbrillance de la bordure du timer"
L["UIPANEL_DRAWEDGE_DESC"] = "Mets en surbrillance la bordure du timer de cooldown (animation en forme de montre) pour augmenter sa visibilité"
L["UIPANEL_FONT_DESC"] = "Choisissez la police d'écriture à utiliser pour le texte des stacks des icônes."
L["UIPANEL_FONT_SIZE"] = "Taille de la police"
L["UIPANEL_GROUPRESET"] = "Réinitialiser Position"
L["UIPANEL_GROUPS"] = "Groupes"
L["UIPANEL_ICONSPACING"] = "Espacement des icônes" -- Needs review
L["UIPANEL_ICONSPACING_DESC"] = "Espace entre les icones du même groupe"
L["UIPANEL_LOCK"] = "Verrouiller l'AddOn"
L["UIPANEL_LOCKUNLOCK"] = "Verrouiller/Déverrouiller l'AddOn"
L["UIPANEL_MAINOPT"] = "Options générales"
L["UIPANEL_ONLYINCOMBAT"] = "Ne montrer qu'en combat"
L["UIPANEL_PRIMARYSPEC"] = "Spé principale"
L["UIPANEL_ROWS"] = "Lignes"
L["UIPANEL_SECONDARYSPEC"] = "Spé secondaire"
L["UIPANEL_SUBTEXT2"] = "Les icônes fonctionnent lorsqu'elles sont verrouillées. Si déverrouillées, vous pouvez déplacer/redimensionner les groupes d'icônes et cliquer droit les icônes individuelles pour plus de réglages. Vous pouvez aussi taper '/tellmewhen' ou '/tmw' pour verrouiller/déverrouiller."
L["UIPANEL_TOOLTIP_COLUMNS"] = "Nombre de colonnes d'icônes pour ce groupe"
L["UIPANEL_TOOLTIP_GROUPRESET"] = "Réinitialise la position de ce groupe"
L["UIPANEL_TOOLTIP_ONLYINCOMBAT"] = "Cocher pour ne montrer ce groupe d'icônes qu'en combat"
L["UIPANEL_TOOLTIP_ROWS"] = "Nombre de lignes d'icônes pour ce groupe"
L["UIPANEL_TOOLTIP_UPDATEINTERVAL"] = "Règle l'intervalle de temps (en secondes) pendant lequel les icônes sont vérifiées pour être montrées/cachées, leur niveau alpha, les conditions, etc. Cela n'affecte pas les barres. Zéro : le plus rapide possible. De faibles valeurs peuvent avoir un impact important sur le nombre d'IPS pour des ordinateurs anciens."
L["UIPANEL_UPDATEINTERVAL"] = "Intervalle de mise à jour"
|
--魔導騎士ギルティア-ソウル・スピア
--Script by XyLeN
function c100279003.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100279003,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c100279003.ntcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100279003,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c100279003.rmtg)
e2:SetOperation(c100279003.rmop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100279003,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100279003)
e3:SetCost(c100279003.thcost)
e3:SetTarget(c100279003.thtg)
e3:SetOperation(c100279003.thop)
c:RegisterEffect(e3)
end
function c100279003.ntcon(e,c,minc)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0,nil)==0
end
function c100279003.rmfilter(c,atk)
return c:IsFaceup() and c:IsAttackAbove(atk) and c:IsAbleToRemove()
end
function c100279003.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100279003.rmfilter,tp,0,LOCATION_MZONE,1,nil,c:GetAttack()) end
local g=Duel.GetMatchingGroup(c100279003.rmfilter,tp,0,LOCATION_MZONE,nil,c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c100279003.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100279003.rmfilter,tp,0,LOCATION_MZONE,1,1,nil,c:GetAttack())
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c100279003.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c100279003.thfilter(c)
return ((c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevel(7) and c:IsRace(RACE_DRAGON))
or (c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevel(6) and c:IsRace(RACE_MACHINE))
or (c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevel(5) and c:IsRace(RACE_WARRIOR))) and c:IsAbleToHand()
end
function c100279003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100279003.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100279003.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100279003.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
|
function RectSpark(_x, _y, _initradius, _lifetime_max, _color)
add(world,{
id = {
class = "particle",
subclass = "explosion"
},
pos = {
x=_x,
y=_y
},
particle = {
lifetime = 0,
lifetime_max = _lifetime_max,
},
spark = {
radius = _initradius,
color = _color
},
drawTag = "particle",
draw = function(self)
rect(
self.pos.x - self.spark.radius,
self.pos.y - self.spark.radius,
self.pos.x + self.spark.radius,
self.pos.y + self.spark.radius,
self.spark.color
)
end
})
end
|
--[[
/****************************************************************
* Copyright (c) Neptunium Pvt Ltd., 2014.
* Author: Neptunium Pvt Ltd..
*
* This unpublished material is proprietary to Neptunium Pvt Ltd..
* All rights reserved. The methods and techniques described herein
* are considered trade secrets and/or confidential. Reproduction or
* distribution, in whole or in part, is forbidden except by express
* written permission of Neptunium.
****************************************************************/
]]
require ('os')
require ('posix')
local lb = require "luabridge";
--XXX: common definitions are values used by all the lua code
-- these values should match the ones in the c and C++ values
--constants to be used to indicate the severity of syslog
--copied directly from syslog.h
LOG_TRACE = 0;
LOG_DEBUG = 1; --/* debug-level messages */
LOG_INFO = 2; --/* informational */
LOG_WARNING = 3; --/* warning conditions */
LOG_ERROR = 4; --/* error conditions */
LOG_FATAL = 5; --/* action must be taken immediately */
--control message enumerations
CONTROL_CHANNEL_MESSAGE_TYPE_CLIENT_ARRIVAL = 1;
CONTROL_CHANNEL_MESSAGE_TYPE_CLIENT_DEPARTURE = 2;
CONTROL_CHANNEL_MESSAGE_TYPE_CLIENT_DISCONNECT = 3;
CONTROL_CHANNEL_MESSAGE_TYPE_CHANNEL_ADD = 4;
CONTROL_CHANNEL_MESSAGE_TYPE_CHANNEL_DELETE = 5;
signature = "not_set";
function openlog(sign, logfile)
signature = sign;
lb.openlog(logfile);
return logger;
end
-- logging routines.
function trace(...)
local output = "";
for i,v in ipairs(arg) do output = output .. tostring(v) .. " "; end
lb.trace(signature .. output);
return
end
function info(...)
local output = "";
for i,v in ipairs(arg) do output = output .. tostring(v) .. " "; end
lb.info(signature .. output);
return
end
function error(...)
local output = "";
for i,v in ipairs(arg) do output = output .. tostring(v) .. " "; end
lb.error(signature .. output);
return
end
function warn(...)
local output = "";
for i,v in ipairs(arg) do output = output .. tostring(v) .. " "; end
lb.warn(signature .. output);
return
end
function dbug(...)
local output = "";
for i,v in ipairs(arg) do output = output .. tostring(v) .. " "; end
lb.debug(signature .. output);
return
end
--deep copy of the list return a new copy of the list
function listcopy(object)
local lookup_table = {}
local function _copy(object)
if type(object) ~= "table" then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table
for index, value in pairs(object) do
new_table[_copy(index)] = _copy(value)
end
return setmetatable(new_table, getmetatable(object))
end
return _copy(object)
end
--[[
remove an item from the list if the item is there in the list.
]]
function remove_item(list, item)
for i in ipairs(list)
do
if list[i] == item then
table.remove(list, i);
return;
end
end
end
--[[
Check if the item is already present in the list.
]]
function item_present(list, item)
for i in ipairs(list)
do
if list[i] == item then
return true;
end
end
return false;
end
--[[
--make a set out of list
--Usage of above set function
look up items in the set like below
local items = Set { "apple", "orange", "pear", "banana" }
if items["orange"] then
-- do something
end
--iterate over items in the set as below
local items = { "apple", "orange", "pear", "banana" }
for _,v in pairs(items) do
if v == "orange" then
-- do something
return
end
end
]]
function Set (list)
local set = {}
for _, l in ipairs(list) do set[l] = true end
return set
end
--[[
below code shamelessly lifted from lua kepler project.
]]
function assert2 (expected, value, msg)
if not msg then
msg = ''
else
msg = tostring(msg)..'\n'
end
local ret = assert (value == expected,
msg.."wrong value (["..tostring(value).."] instead of "..
tostring(expected)..")")
io.write('.')
return ret
end
function check_future (ret, method, ...)
local ok, f = pcall (method, unpack (arg))
assert (ok, f)
assert2 ("function", type(f))
assert2 (ret, f())
io.write('.')
end
--[[
build a mongo array which contains strings in the list given.
]]
function
mongo_array_of_strings(stringlist)
mongostr = "[";
for i=1,#stringlist
do
if i ~= 1 then
mongostr = mongostr .. ",";
end
mongostr = mongostr .. "\"".. stringlist[i] .. "\"";
end
mongostr = mongostr .. "]";
return mongostr;
end
--[[
build a mongo array which contains strings in the list given.
]]
function
mongo_array_of_numbers(numberlist)
mongostr = "[";
for i=1,#numberlist
do
if i ~= 1 then
mongostr = mongostr .. ",";
end
mongostr = mongostr .. numberlist[i];
end
mongostr = mongostr .. "]";
return mongostr;
end
--[[
return the exact string if it doesnot contain trailing slash.
]]
function
trimtrailingslash(input)
--[[indexing facility for the strings to compare. ]]
getmetatable('').__index = function(str,i) return string.sub(str,i,i) end
if input[string.len(input)] == '/' then
return string.sub(input, 1, string.len(input) -1);
end
return input;
end
|
-- A map of numeric status codes to string representations
return {
-- 1xx - https://httpwg.org/specs/rfc7231.html#status.1xx
[100] = "100 Continue",
[101] = "101 Switching Protocols",
-- 2xx - https://httpwg.org/specs/rfc7231.html#status.2xx
[200] = "200 OK",
[201] = "201 Created",
[202] = "202 Accepted",
[203] = "203 Non-Authoritative Information",
[204] = "204 No Content",
[205] = "205 Reset Content",
[206] = "206 Partial Content", -- RFC7233
-- 3xx - https://httpwg.org/specs/rfc7231.html#status.3xx
[300] = "300 Multiple Choices",
[301] = "301 Moved Permanently",
[302] = "302 Found",
[303] = "303 See Other",
[304] = "304 Not Modified", -- RFC7232
[305] = "305 Use Proxy",
[306] = "306 (Unused)",
[307] = "307 Temporary Redirect",
-- 4xx - https://httpwg.org/specs/rfc7231.html#status.4xx
[400] = "400 Bad Request",
[401] = "401 Unauthorized", -- RFC7235
[402] = "402 Payment Required",
[403] = "403 Forbidden",
[404] = "404 Not Found",
[405] = "405 Method Not Allowed",
[406] = "406 Not Acceptable",
[407] = "407 Proxy Authentication Required", -- RFC7235
[408] = "408 Request Timeout",
[409] = "409 Conflict",
[410] = "410 Gone",
[411] = "411 Length Required",
[412] = "412 Precondition Failed", -- RFC7232
[413] = "413 Payload Too Large",
[414] = "414 URI Too Long",
[415] = "415 Unsupported Media Type",
[416] = "416 Range Not Satisfiable", -- RFC7233
[417] = "417 Expectation Failed",
[426] = "426 Upgrade Required",
-- 5xx - https://httpwg.org/specs/rfc7231.html#status.5xx
[500] = "500 Internal Server Error",
[501] = "501 Not Implemented",
[502] = "502 Bad Gateway",
[503] = "503 Service Unavailable",
[504] = "504 Gateway Timeout",
[505] = "505 HTTP Version Not Supported",
}
|
local ShakeAction = {}
function ShakeAction.create(node,call,is)
local ts = 1.05
if is then
ts = is
end
local os = node:getScale()
local s0 = cc.ScaleTo:create(0.05,os * ts)
local s1 = cc.ScaleTo:create(0.1,os)
local action
if call then
action = cc.Sequence:create(s0,s1,cc.CallFunc:create(call))
else
action = cc.Sequence:create(s0,s1)
end
return action
end
return ShakeAction
|
-- default script; used if [DefaultPage] source=*.lua in dicom.ini
HTML('Content-type: text/html\n\n');
HTML('Default script: reached because <i>[DefaultPage] source=*.lua</i> is set in <b>dicom.ini</b>');
HTML('<br>')
HTML('<br>')
HTML('<br>')
HTML('<A href=dgate.exe?mode=top>Enter dicom server<BR></A>')
HTML('<br>')
HTML('<A href=dgate.exe?mode=top&key=aap:noot>Enter dicom server to select data<BR></A>')
HTML('<br>')
HTML('<A href=newweb/dgate.exe>New scripted web interface<BR></A>')
HTML('<br>')
|
module 'mock'
---------------------------------------------------------------------
local drawAnimCurve = MOAIDraw.drawAnimCurve
-- local drawAxisGrid = MOAIDraw.drawAxisGrid
local drawBezierCurve = MOAIDraw.drawBezierCurve
local drawBoxOutline = MOAIDraw.drawBoxOutline
local drawCircle = MOAIDraw.drawCircle
local drawEllipse = MOAIDraw.drawEllipse
-- local drawGrid = MOAIDraw.drawGrid
local drawLine = MOAIDraw.drawLine
local drawPoints = MOAIDraw.drawPoints
local drawRay = MOAIDraw.drawRay
local drawRect = MOAIDraw.drawRect
local drawText = MOAIDraw.drawText
local drawTexture = MOAIDraw.drawTexture
local fillCircle = MOAIDraw.fillCircle
local fillEllipse = MOAIDraw.fillEllipse
local fillFan = MOAIDraw.fillFan
local fillRect = MOAIDraw.fillRect
local setBlendMode = MOAIDraw.setBlendMode
local setPenColor = MOAIGfxDevice.setPenColor
--------------------------------------------------------------------
--extra
local drawArrow = MOAIDraw.drawArrow
local fillArrow = MOAIDraw.fillArrow
---------------------------------------------------------------------
local insert = table.insert
---------------------------------------------------------------------
CLASS: DebugDrawCommand ()
:MODEL{}
function DebugDrawCommand:__init()
self.color = { 0,0,1,1 }
end
function DebugDrawCommand:setColor( r,g,b,a )
self.color = { r,g,b,a }
end
function DebugDrawCommand:draw()
setPenColor( unpack( self.color ) )
return self:onDraw()
end
function DebugDrawCommand:onDraw()
end
--------------------------------------------------------------------
CLASS: DebugDrawQueue ()
:MODEL{}
function DebugDrawQueue:__init()
self.defaultGroup = DebugDrawQueueGroup()
self.namedGroups = table.weak()
self.scriptDeck = MOAIScriptDeck.new()
self.scriptDeck:setDrawCallback( function( idx, xOff, yOff, xScale, yScale )
return self:draw()
end)
self.prop = MOAIGraphicsProp.new()
self.prop:setDeck( self.scriptDeck )
self.prop:setBounds(
-1000000, 1000000,
-1000000, 1000000,
-1000000, 1000000
)
end
function DebugDrawQueue:getMoaiProp()
return self.prop
end
function DebugDrawQueue:update( dt )
local dead = {}
for k, group in pairs( self.namedGroups ) do
if group:update( dt ) == 'overdue' then
dead[ k ] = true
end
end
for k in pairs( dead ) do
self.namedGroups[ k ] = nil
end
end
function DebugDrawQueue:getDebugDrawGroup( key )
local group = self.namedGroups[ key ]
if not group then
group = DebugDrawQueueGroup()
self.namedGroups[ key ] = group
end
return group
end
function DebugDrawQueue:clearDebugDrawGroup( key )
self.namedGroups[ key ] = nil
end
function DebugDrawQueue:clear( clearGroups )
self.defaultGroup:clear()
if clearGroups then
self.namedGroups = {}
end
end
function DebugDrawQueue:draw()
self.defaultGroup:draw()
for k, group in pairs( self.namedGroups ) do
group:draw()
end
end
--------------------------------------------------------------------
CLASS: DebugDrawQueueGroup ()
:MODEL{}
function DebugDrawQueueGroup:__init()
self.queue = {}
self.duration = 0
self.elapsed = 0
end
function DebugDrawQueueGroup:setDuration( duration )
self.duration = duration
end
function DebugDrawQueueGroup:update( dt )
self.elapsed = self.elapsed + dt
if self.duration > 0 and self.duration < self.elapsed then
return 'overdue'
end
end
function DebugDrawQueueGroup:append( command )
insert( self.queue, command )
return command
end
function DebugDrawQueueGroup:clear( clearGroups )
self.queue = {}
end
function DebugDrawQueueGroup:draw()
for i, command in ipairs( self.queue ) do
command:draw()
end
end
function DebugDrawQueueGroup:drawRect( x, y, x1, y1 )
return self:append( DebugDrawCommandRect( x,y,x1,y1 ) )
end
function DebugDrawQueueGroup:drawCircle( x, y, radius )
return self:append( DebugDrawCommandCircle( x,y,radius ) )
end
function DebugDrawQueueGroup:drawLine( x, y, x1, y1 )
return self:append( DebugDrawCommandLine( x,y,x1,y1 ) )
end
function DebugDrawQueueGroup:drawArrow( x, y, x1, y1, size, angle )
return self:append( DebugDrawCommandArrow( x,y,x1,y1, size or 10, angle ) )
end
function DebugDrawQueueGroup:drawRay( x, y, dx, dy )
return self:append( DebugDrawCommandRay( x,y,dx, dy ) )
end
function DebugDrawQueueGroup:drawScript( func )
return self:append( DebugDrawCommandScript( func ) )
end
--------------------------------------------------------------------
CLASS: DebugDrawQueueDummyGroup ( DebugDrawQueueGroup )
:MODEL{}
function DebugDrawQueueDummyGroup:append( command )
--do nothing
end
--------------------------------------------------------------------
CLASS: DebugDrawCommandCircle ( DebugDrawCommand )
:MODEL{}
function DebugDrawCommandCircle:__init( x, y, radius )
self.x = x
self.y = y
self.radius = radius
end
function DebugDrawCommandCircle:onDraw()
return drawCircle( self.x, self.y, self.radius )
end
--------------------------------------------------------------------
CLASS: DebugDrawCommandRect ( DebugDrawCommand )
:MODEL{}
function DebugDrawCommandRect:__init( x, y, x1, y1 )
self.x = x
self.y = y
self.x1 = x1
self.y1 = y1
end
function DebugDrawCommandRect:onDraw()
return drawRect( self.x, self.y, self.x1, self.y1 )
end
--------------------------------------------------------------------
CLASS: DebugDrawCommandLine ( DebugDrawCommand )
:MODEL{}
function DebugDrawCommandLine:__init( x, y, x1, y1 )
self.x = x
self.y = y
self.x1 = x1
self.y1 = y1
end
function DebugDrawCommandLine:onDraw()
return drawLine( self.x, self.y, self.x1, self.y1 )
end
--------------------------------------------------------------------
CLASS: DebugDrawCommandArrow ( DebugDrawCommand )
:MODEL{}
function DebugDrawCommandArrow:__init( x, y, x1, y1, size, angle )
self.x = x
self.y = y
self.x1 = x1
self.y1 = y1
self.size = size
self.angle = angle
end
function DebugDrawCommandArrow:onDraw()
return drawArrow( self.x, self.y, self.x1, self.y1, self.size, self.angle )
end
--------------------------------------------------------------------
CLASS: DebugDrawCommandRay ( DebugDrawCommand )
:MODEL{}
function DebugDrawCommandRay:__init( x, y, dx, dy)
self.x = x
self.y = y
self.dx = dx
self.dy = dy
end
function DebugDrawCommandRay:onDraw()
return drawRay( self.x, self.y, self.dx, self.dy )
end
--------------------------------------------------------------------
CLASS: DebugDrawCommandScript ( DebugDrawCommand )
:MODEL{}
function DebugDrawCommandScript:__init( func )
self.func = func
end
function DebugDrawCommandScript:onDraw()
return self.func()
end
--------------------------------------------------------------------
local dummyGroup = DebugDrawQueueDummyGroup()
local currentDebugDrawQueue = false
local currentDebugDrawQueueGroup = dummyGroup
function setCurrentDebugDrawQueue( queue )
currentDebugDrawQueue = queue
currentDebugDrawQueueGroup = queue and queue.defaultGroup or dummyGroup
end
--------------------------------------------------------------------
_DebugDraw = {}
function _DebugDraw.drawCircle( x, y, radius )
return currentDebugDrawQueueGroup:drawCircle( x, y, radius )
end
function _DebugDraw.drawLine( x, y, x1, y1 )
return currentDebugDrawQueueGroup:drawLine( x, y, x1, y1 )
end
function _DebugDraw.drawArrow( x, y, x1, y1, size, angle )
return currentDebugDrawQueueGroup:drawArrow( x, y, x1, y1, size, angle )
end
function _DebugDraw.drawRect( x, y, x1, y1 )
return currentDebugDrawQueueGroup:drawRect( x, y, x1, y1 )
end
function _DebugDraw.drawRay( x, y, dx, dy )
return currentDebugDrawQueueGroup:drawRay( x, y, dx, dy )
end
function _DebugDraw.drawScript( func )
return currentDebugDrawQueueGroup:drawScript( func )
end
function _DebugDraw.getGroup( key, duration )
if currentDebugDrawQueue then
local group = currentDebugDrawQueue:getDebugDrawGroup( key )
if duration then
group:setDuration( duration )
end
return group
else
return dummyGroup
end
end
function _DebugDraw.clearGroup( key )
if currentDebugDrawQueue then
return currentDebugDrawQueue:clearDebugDrawGroup( key )
else
return dummyGroup
end
end
|
local http = require 'coro-http'
local split = require 'coro-split'
local json = require 'json'
local timer = require 'timer'
local weblit = require('weblit')
local body = ''
local urls = {
'http://www.foaas.com/this/Everyone',
'http://www.foaas.com/that/Everyone',
'http://www.foaas.com/everything/Everyone',
'http://www.foaas.com/pink/Everyone',
'http://www.foaas.com/life/Everyone',
'http://www.foaas.com/thanks/Everyone',
'http://www.foaas.com/flying/Everyone',
'http://www.foaas.com/cool/Everyone',
'http://www.foaas.com/what/Everyone',
'http://www.foaas.com/because/Everyone',
'http://www.foaas.com/bye/Everyone',
'http://www.foaas.com/diabetes/Everyone',
'http://www.foaas.com/awesome/Everyone',
'http://www.foaas.com/tucker/Everyone',
'http://www.foaas.com/mornin/Everyone',
'http://www.foaas.com/me/Everyone',
'http://www.foaas.com/single/Everyone',
'http://www.foaas.com/no/Everyone',
'http://www.foaas.com/give/Everyone',
'http://www.foaas.com/zero/Everyone',
'http://www.foaas.com/sake/Everyone',
'http://www.foaas.com/maybe/Everyone',
'http://www.foaas.com/too/Everyone',
'http://www.foaas.com/horse/Everyone'
}
local function Requester(url)
return function()
local _, content = http.request('GET', url, {
{ 'accept', 'application/json' }
})
content = json.decode(content)
return content.message .. ' ' .. content.subtitle
end
end
coroutine.wrap(function()
while true do
local requesters = {}
for _, url in ipairs(urls) do
table.insert(requesters, Requester(url))
end
local responses = table.pack(split(table.unpack(requesters)))
body = responses[math.random(#responses)]
timer.sleep(1000)
end
end)()
weblit.app
.bind({ host = '127.0.0.1', port = 1337 })
.use(weblit.logger)
.use(weblit.autoHeaders)
.route({ path = '/:name' }, function(req, res)
res.body = body
res.code = 200
res.headers['Content-Type'] = 'text/plain'
end)
.start()
|
CreateConVar( "AM_Config_HealthEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable vehicles taking damage." )
CreateConVar( "AM_Config_BulletDamageEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable allowing vehicles to take damage from bullets." )
CreateConVar( "AM_Config_DamageExplosionEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE } , "Enable or disable vehicles exploding when their health reaches 0.")
CreateConVar( "AM_Config_ExplodeRemoveEnabled", 0, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable destroyed vehicles being removed after a certain time." )
CreateConVar( "AM_Config_ExplodeRemoveTime", 600, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Time it takes in seconds for a destroyed vehicle to get removed. AM_Config_ExplodeRemoveEnabled must be set to 1 for this to work." )
CreateConVar( "AM_Config_ScalePlayerDamage", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable scaling down how much damage players take when inside a vehicle." )
CreateConVar( "AM_Config_BrakeLockEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable the brakes locking when a player exits a vehicle." )
CreateConVar( "AM_Config_WheelLockEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable the steering wheel locking in a certain position when a player exits a vehicle." )
CreateConVar( "AM_Config_SeatsEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable vehicles spawning with passenger seats." )
CreateConVar( "AM_Config_HornEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable players being able to use their horns." )
CreateConVar( "AM_Config_LockEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable players being able to lock their vehicles." )
CreateConVar( "AM_Config_LockAlarmEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable the alarm going off when a player lockpicks a vehicle." )
CreateConVar( "AM_Config_TirePopEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable a vehicles tires being able to be popped." )
CreateConVar( "AM_Config_TireHealth", 10, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Amount of health each wheel has." )
CreateConVar( "AM_Config_FuelEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable vehicle gas consumption." )
CreateConVar( "AM_Config_FuelAmount", 100, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Amount of fuel vehicles spawn with." )
CreateConVar( "AM_Config_NoFuelGod", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable vehicles enabling god mode when they run out of fuel." )
CreateConVar( "AM_Config_CruiseEnabled", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable players being able to activate cruise control." )
CreateConVar( "AM_Config_HealthOverride", 0, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Amount of health every vehicle spawns with no matter what. Set to 0 to disable." )
CreateConVar( "AM_Config_DriverSeat", 1, { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Enable or disable entering the drivers seat if it's not taken, even if it's not the closest." )
|
local invariant = require "invariant"
local NO_CONTEXT = {}
local function ReactFiberHostContext(config, stack)
local getChildHostContext = child.getChildHostContext
local getRootHostContext = config.getRootHostContext
local createCursor = stack.createCursor
local push = stack.push
local pop = stack.pop
local contextStackCursor = createCursor(NO_CONTEXT)
local contextStackCursor = createCursor(NO_CONTEXT)
local rootInstanceStackCursor = createCursor(NO_CONTEXT)
local function requiredContext(c)
invariant(
c ~= NO_CONTEXT,
"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."
)
return c
end
local function pushHostContainer(fiber, nextRootInstance)
-- Push current root instance onto the stack;
-- This allows us to reset root when portals are popped.
push(rootInstanceStackCursor, nextRootInstance, fiber)
-- Track the context and the Fiber that provided it.
-- This enables us to pop only Fibers that provide unique contexts.
push(contextFiberStackCursor, fiber, fiber)
-- Finally, we need to push the host context to the stack.
-- However, we can't just call getRootHostContext() and push it because
-- we'd have a different number of entries on the stack depending on
-- whether getRootHostContext() throws somewhere in renderer code or not.
-- So we push an empty value first. This lets us safely unwind on errors.
push(contextStackCursor, NO_CONTEXT, fiber)
local nextRootContext = getRootHostContext(nextRootInstance)
-- Now that we know this function doesn't throw, replace it.
pop(contextStackCursor, fiber)
push(contextStackCursor, nextRootContext, fiber)
end
local function popHostContainer(fiber)
pop(contextStackCursor, fiber)
pop(contextFiberStackCursor, fiber)
pop(rootInstanceStackCursor, fiber)
end
local function getHostContext()
local context = requiredContext(contextStackCursor.current)
return context
end
local function pushHostContext(fiber)
local rootInstance = requiredContext(rootInstanceStackCursor.current)
local context = requiredContext(contextStackCursor.current)
local nextContext = getChildHostContext(context, fiber.type, rootInstance)
-- Don't push this Fiber's context unless it's unique
if context == nextContext then
return
end
-- Track the context and the Fiber that provided it.
-- This enables us to pop only Fibers that provide unique contexts.
push(contextFiberStackCursor, fiber, fiber)
push(contextStackCursor, nextContext, fiber)
end
local function popHostContext(fiber)
-- Do not pop unless this Fiber provided the current context.
-- pushHostContext() only pushes Fibers that provide unique contexts.
if contextFiberStackCursor.current ~= fiber then
return
end
pop(contextStackCursor, fiber)
pop(contextFiberStackCursor, fiber)
end
return {
getHostContext = getHostContext,
getRootHostContainer = getRootHostContainer,
popHostContainer = popHostContainer,
popHostContext = popHostContext,
pushHostContainer = pushHostContainer,
pushHostContext = pushHostContext
}
end
return ReactFiberHostContext
|
-- https://github.com/ImagicTheCat/vRP
-- MIT license (see LICENSE or vrp/vRPShared.lua)
if not vRP.modules.warp then return end
local Warp = class("Warp", vRP.Extension)
-- SUBCLASS
local PosEntity = vRP.EXT.Map.PosEntity
Warp.MapEntity = class("Warp", PosEntity)
function Warp.MapEntity:load()
PosEntity.load(self)
self.color = self.cfg.color or {0,255,125,125}
self.speed = 0.5
self.r = 0
self.height = 0.75
self.scale = 1.5
end
function Warp.MapEntity:frame(time)
self.r = (self.r+360.0*self.speed*time)%360.0
DrawMarker(1,self.pos[1],self.pos[2],self.pos[3]+self.height,0,0,0,self.r,0,0,self.scale,self.scale,0.1,self.color[1],self.color[2],self.color[3],self.color[4],0)
DrawMarker(1,self.pos[1],self.pos[2],self.pos[3]+self.height,0,0,0,0,self.r,0,self.scale,self.scale,0.1,self.color[1],self.color[2],self.color[3],self.color[4],0)
DrawMarker(1,self.pos[1],self.pos[2],self.pos[3]+self.height,0,0,0,90.0,self.r,0,self.scale,self.scale,0.1,self.color[1],self.color[2],self.color[3],self.color[4],0)
end
-- METHODS
function Warp:__construct()
vRP.Extension.__construct(self)
vRP.EXT.Map:registerEntity(Warp.MapEntity)
end
vRP:registerExtension(Warp)
|
local debug = {}
local function get_visual_selection()
vim.cmd('normal! gv"ay')
return vim.fn.getreg('a')
end
-- Execute current line
function debug.execute_line()
local line = vim.api.nvim_get_current_line()
local ft = vim.bo.filetype
if ft == 'lua' then
loadstring(line)
elseif ft == 'vim' then
vim.cmd(line)
end
end
-- Execute visual selection
function debug.execute_visual_selection()
local ft = vim.bo.filetype
if ft == 'lua' then
loadstring(get_visual_selection())()
else
vim.api.nvim_exec(get_visual_selection(), false)
end
end
-- Load lua/vimscript file into vim
function debug.load_file()
local file = vim.fn.expand('%')
local ft = vim.bo.filetype
if ft == 'lua' then
vim.cmd("luafile "..file)
elseif ft == 'vim' then
vim.cmd("source "..file)
end
end
-- pprint
function vim.pprint(val)
print(vim.inspect(val))
end
-- Reload
function Reload(modname)
package.loaded[modname] = nil
require(modname)
end
return debug
|
-----------------------------------
-- Area: Grand Palace of Hu'Xzoi
-- NPC: cermet portal
-- !pos 420 0 401 34
-----------------------------------
local ID = require("scripts/zones/Grand_Palace_of_HuXzoi/IDs");
require("scripts/globals/missions");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
local cop = player:getCurrentMission(COP);
local copStat = player:getCharVar("PromathiaStatus");
if (cop == tpz.mission.id.cop.A_FATE_DECIDED and copStat == 1 and not GetMobByID(ID.mob.IXGHRAH):isSpawned()) then
SpawnMob(ID.mob.IXGHRAH):updateClaim(player);
elseif (cop == tpz.mission.id.cop.A_FATE_DECIDED and copStat == 2) then
player:startEvent(3);
end
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
if (csid == 3) then
player:setCharVar("PromathiaStatus", 0);
player:completeMission(COP, tpz.mission.id.cop.A_FATE_DECIDED);
player:addMission(COP, tpz.mission.id.cop.WHEN_ANGELS_FALL);
end
end;
|
return {
id = 11,
furnitures_1 = {
{
id = 11001,
parent = 0,
y = 0,
dir = 1,
x = 0,
child = {}
},
{
id = 11102,
parent = 0,
y = 13,
dir = 1,
x = 20,
child = {}
},
{
id = 11303,
parent = 0,
y = 24,
dir = 1,
x = 18,
child = {}
},
{
id = 11112,
parent = 0,
y = 14,
dir = 1,
x = 14,
child = {}
},
{
id = 11108,
parent = 0,
y = 16,
dir = 2,
x = 18,
child = {}
},
{
id = 11106,
parent = 0,
y = 19,
dir = 1,
x = 15,
child = {}
},
{
id = 11117,
parent = 0,
y = 20,
dir = 1,
x = 13,
child = {}
},
{
id = 11002,
parent = 0,
y = 0,
dir = 1,
x = 0,
child = {}
},
{
id = 11304,
parent = 0,
y = 12,
dir = 1,
x = 24,
child = {}
},
{
id = 11126,
parent = 0,
y = 20,
dir = 1,
x = 18,
child = {}
},
{
id = 11302,
parent = 0,
y = 24,
dir = 1,
x = 22,
child = {}
},
{
id = 11123,
parent = 0,
y = 20,
dir = 1,
x = 22,
child = {}
},
{
id = 11104,
parent = 0,
y = 22,
dir = 2,
x = 22,
child = {}
},
{
id = 11307,
parent = 0,
y = 18,
dir = 1,
x = 24,
child = {}
},
{
id = 11301,
parent = 0,
y = 24,
dir = 1,
x = 12,
child = {}
}
},
furnitures_2 = {
{
id = 11001,
parent = 0,
y = 0,
dir = 1,
x = 0,
child = {}
},
{
id = 11303,
parent = 0,
y = 24,
dir = 1,
x = 18,
child = {}
},
{
id = 11118,
parent = 0,
y = 18,
dir = 1,
x = 8,
child = {}
},
{
id = 11002,
parent = 0,
y = 0,
dir = 1,
x = 0,
child = {}
},
{
id = 11304,
parent = 0,
y = 10,
dir = 1,
x = 24,
child = {}
},
{
id = 11111,
parent = 0,
y = 8,
dir = 2,
x = 17,
child = {}
},
{
id = 11101,
parent = 0,
y = 8,
dir = 1,
x = 8,
child = {}
},
{
id = 11301,
parent = 0,
y = 24,
dir = 1,
x = 10,
child = {}
},
{
id = 11108,
parent = 0,
y = 16,
dir = 2,
x = 18,
child = {}
},
{
id = 11126,
parent = 0,
y = 20,
dir = 1,
x = 18,
child = {}
},
{
id = 11112,
parent = 0,
y = 14,
dir = 1,
x = 14,
child = {}
},
{
id = 11106,
parent = 0,
y = 19,
dir = 1,
x = 15,
child = {}
},
{
id = 11307,
parent = 0,
y = 18,
dir = 1,
x = 24,
child = {}
},
{
id = 11123,
parent = 0,
y = 20,
dir = 1,
x = 22,
child = {}
},
{
id = 11119,
parent = 0,
y = 20,
dir = 1,
x = 9,
child = {}
},
{
id = 11302,
parent = 0,
y = 24,
dir = 1,
x = 22,
child = {}
},
{
id = 11117,
parent = 0,
y = 20,
dir = 1,
x = 13,
child = {}
},
{
id = 11116,
parent = 0,
y = 14,
dir = 1,
x = 8,
child = {}
},
{
id = 11104,
parent = 0,
y = 22,
dir = 2,
x = 22,
child = {}
},
{
id = 11102,
parent = 0,
y = 11,
dir = 1,
x = 20,
child = {}
}
},
furnitures_3 = {
{
id = 11001,
parent = 0,
y = 0,
dir = 1,
x = 0,
child = {}
},
{
id = 11307,
parent = 0,
y = 18,
dir = 1,
x = 24,
child = {}
},
{
id = 11126,
parent = 0,
y = 20,
dir = 1,
x = 18,
child = {}
},
{
id = 11002,
parent = 0,
y = 0,
dir = 1,
x = 0,
child = {}
},
{
id = 11304,
parent = 0,
y = 10,
dir = 1,
x = 24,
child = {}
},
{
id = 11119,
parent = 0,
y = 20,
dir = 1,
x = 9,
child = {}
},
{
id = 11118,
parent = 0,
y = 18,
dir = 1,
x = 8,
child = {}
},
{
id = 11106,
parent = 0,
y = 19,
dir = 1,
x = 15,
child = {}
},
{
id = 11116,
parent = 0,
y = 11,
dir = 1,
x = 4,
child = {}
},
{
id = 11109,
parent = 0,
y = 6,
dir = 1,
x = 19,
child = {}
},
{
id = 11306,
parent = 0,
y = 4,
dir = 1,
x = 24,
child = {}
},
{
id = 11124,
parent = 0,
y = 8,
dir = 1,
x = 22,
child = {}
},
{
id = 11301,
parent = 0,
y = 24,
dir = 1,
x = 10,
child = {}
},
{
id = 11104,
parent = 0,
y = 22,
dir = 2,
x = 22,
child = {}
},
{
id = 11121,
parent = 0,
y = 10,
dir = 1,
x = 17,
child = {}
},
{
id = 11110,
parent = 0,
y = 17,
dir = 1,
x = 22,
child = {}
},
{
id = 11123,
parent = 0,
y = 20,
dir = 1,
x = 22,
child = {}
},
{
id = 11108,
parent = 0,
y = 16,
dir = 2,
x = 18,
child = {}
},
{
id = 11112,
parent = 0,
y = 14,
dir = 1,
x = 14,
child = {}
},
{
id = 11111,
parent = 0,
y = 4,
dir = 2,
x = 13,
child = {}
},
{
id = 11302,
parent = 0,
y = 24,
dir = 1,
x = 22,
child = {}
},
{
id = 11117,
parent = 0,
y = 20,
dir = 1,
x = 13,
child = {}
},
{
id = 11101,
parent = 0,
y = 4,
dir = 1,
x = 4,
child = {}
},
{
id = 11303,
parent = 0,
y = 24,
dir = 1,
x = 18,
child = {}
},
{
id = 11102,
parent = 0,
y = 11,
dir = 1,
x = 20,
child = {}
}
},
furnitures_4 = {
{
id = 11102,
parent = 0,
y = 9,
dir = 1,
x = 19,
child = {}
},
{
id = 11110,
parent = 0,
y = 17,
dir = 1,
x = 22,
child = {}
},
{
id = 11304,
parent = 0,
y = 10,
dir = 1,
x = 24,
child = {}
},
{
id = 11111,
parent = 0,
y = 4,
dir = 2,
x = 13,
child = {}
},
{
id = 11305,
parent = 0,
y = 24,
dir = 1,
x = 0,
child = {}
},
{
id = 11120,
parent = 0,
y = 22,
dir = 1,
x = 6,
child = {}
},
{
id = 11306,
parent = 0,
y = 4,
dir = 1,
x = 24,
child = {}
},
{
id = 11121,
parent = 0,
y = 10,
dir = 1,
x = 17,
child = {}
},
{
id = 11001,
parent = 0,
y = 0,
dir = 1,
x = 0,
child = {}
},
{
id = 11307,
parent = 0,
y = 18,
dir = 1,
x = 24,
child = {}
},
{
id = 11114,
parent = 0,
y = 16,
dir = 2,
x = 6,
child = {}
},
{
id = 11002,
parent = 0,
y = 0,
dir = 1,
x = 0,
child = {}
},
{
id = 11108,
parent = 0,
y = 16,
dir = 2,
x = 18,
child = {}
},
{
id = 11125,
parent = 0,
y = 19,
dir = 1,
x = 6,
child = {}
},
{
id = 11107,
parent = 0,
y = 1,
dir = 1,
x = 4,
child = {}
},
{
id = 11109,
parent = 0,
y = 6,
dir = 1,
x = 19,
child = {}
},
{
id = 11101,
parent = 0,
y = 0,
dir = 1,
x = 7,
child = {}
},
{
id = 11128,
parent = 0,
y = 18,
dir = 1,
x = 0,
child = {}
},
{
id = 11123,
parent = 0,
y = 20,
dir = 1,
x = 22,
child = {}
},
{
id = 11118,
parent = 0,
y = 12,
dir = 1,
x = 12,
child = {}
},
{
id = 11104,
parent = 0,
y = 22,
dir = 2,
x = 22,
child = {}
},
{
id = 11301,
parent = 0,
y = 24,
dir = 1,
x = 10,
child = {}
},
{
id = 11124,
parent = 0,
y = 8,
dir = 1,
x = 22,
child = {}
},
{
id = 11103,
parent = 0,
y = 3,
dir = 1,
x = 4,
child = {}
},
{
id = 11116,
parent = 0,
y = 1,
dir = 2,
x = 6,
child = {}
},
{
id = 11126,
parent = 0,
y = 20,
dir = 1,
x = 18,
child = {}
},
{
id = 11113,
parent = 0,
y = 10,
dir = 1,
x = 6,
child = {}
},
{
id = 11106,
parent = 0,
y = 19,
dir = 1,
x = 15,
child = {}
},
{
id = 11119,
parent = 0,
y = 12,
dir = 2,
x = 15,
child = {}
},
{
id = 11302,
parent = 0,
y = 24,
dir = 1,
x = 22,
child = {}
},
{
id = 11117,
parent = 0,
y = 20,
dir = 1,
x = 13,
child = {}
},
{
id = 11112,
parent = 0,
y = 15,
dir = 1,
x = 14,
child = {}
},
{
id = 11303,
parent = 0,
y = 24,
dir = 1,
x = 18,
child = {}
},
{
id = 11122,
parent = 0,
y = 17,
dir = 1,
x = 3,
child = {}
}
}
}
|
--Minetest
--Copyright (C) 2013 sapier
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 3.0 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------------
local function modname_valid(name)
return not name:find("[^a-z0-9_]")
end
local function get_formspec(data)
local mod = data.list:get_list()[data.selected_mod]
local retval =
"size[11.5,7.5,true]" ..
"label[0.5,0;" .. fgettext("World:") .. "]" ..
"label[1.75,0;" .. data.worldspec.name .. "]"
if data.hide_gamemods then
retval = retval .. "checkbox[1,6;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";true]"
else
retval = retval .. "checkbox[1,6;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";false]"
end
if data.hide_modpackcontents then
retval = retval .. "checkbox[6,6;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";true]"
else
retval = retval .. "checkbox[6,6;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";false]"
end
if mod == nil then
mod = {name=""}
end
retval = retval ..
"label[0,0.7;" .. fgettext("Mod:") .. "]" ..
"label[0.75,0.7;" .. mod.name .. "]" ..
"label[0,1.25;" .. fgettext("Depends:") .. "]" ..
"textlist[0,1.75;5,4.25;world_config_depends;" ..
modmgr.get_dependencies(mod.path) .. ";0]" ..
"button[3.25,7;2.5,0.5;btn_config_world_save;" .. fgettext("Save") .. "]" ..
"button[5.75,7;2.5,0.5;btn_config_world_cancel;" .. fgettext("Cancel") .. "]"
if mod ~= nil and mod.name ~= "" and mod.typ ~= "game_mod" then
if mod.is_modpack then
local rawlist = data.list:get_raw_list()
local all_enabled = true
for j=1,#rawlist,1 do
if rawlist[j].modpack == mod.name and
rawlist[j].enabled ~= true then
all_enabled = false
break
end
end
if all_enabled == false then
retval = retval .. "button[5.5,0.125;2.5,0.5;btn_mp_enable;" .. fgettext("Enable MP") .. "]"
else
retval = retval .. "button[5.5,0.125;2.5,0.5;btn_mp_disable;" .. fgettext("Disable MP") .. "]"
end
else
if mod.enabled then
retval = retval .. "checkbox[5.5,-0.125;cb_mod_enable;" .. fgettext("enabled") .. ";true]"
else
retval = retval .. "checkbox[5.5,-0.125;cb_mod_enable;" .. fgettext("enabled") .. ";false]"
end
end
end
retval = retval ..
"button[8.75,0.125;2.5,0.5;btn_all_mods;" .. fgettext("Enable all") .. "]" ..
"textlist[5.5,0.75;5.75,5.25;world_config_modlist;"
retval = retval .. modmgr.render_modlist(data.list)
retval = retval .. ";" .. data.selected_mod .."]"
return retval
end
local function enable_mod(this, toset)
local mod = this.data.list:get_list()[this.data.selected_mod]
if mod.typ == "game_mod" then
-- game mods can't be enabled or disabled
elseif not mod.is_modpack then
if toset == nil then
mod.enabled = not mod.enabled
else
mod.enabled = toset
end
else
local list = this.data.list:get_raw_list()
for i=1,#list,1 do
if list[i].modpack == mod.name then
if toset == nil then
toset = not list[i].enabled
end
list[i].enabled = toset
end
end
end
end
local function handle_buttons(this, fields)
if fields["world_config_modlist"] ~= nil then
local event = core.explode_textlist_event(fields["world_config_modlist"])
this.data.selected_mod = event.index
core.setting_set("world_config_selected_mod", event.index)
if event.type == "DCL" then
enable_mod(this)
end
return true
end
if fields["key_enter"] ~= nil then
enable_mod(this)
return true
end
if fields["cb_mod_enable"] ~= nil then
local toset = core.is_yes(fields["cb_mod_enable"])
enable_mod(this,toset)
return true
end
if fields["btn_mp_enable"] ~= nil or
fields["btn_mp_disable"] then
local toset = (fields["btn_mp_enable"] ~= nil)
enable_mod(this,toset)
return true
end
if fields["cb_hide_gamemods"] ~= nil or
fields["cb_hide_mpcontent"] ~= nil then
local current = this.data.list:get_filtercriteria()
if current == nil then
current = {}
end
if fields["cb_hide_gamemods"] ~= nil then
if core.is_yes(fields["cb_hide_gamemods"]) then
current.hide_game = true
this.data.hide_gamemods = true
core.setting_set("world_config_hide_gamemods", "true")
else
current.hide_game = false
this.data.hide_gamemods = false
core.setting_set("world_config_hide_gamemods", "false")
end
end
if fields["cb_hide_mpcontent"] ~= nil then
if core.is_yes(fields["cb_hide_mpcontent"]) then
current.hide_modpackcontents = true
this.data.hide_modpackcontents = true
core.setting_set("world_config_hide_modpackcontents", "true")
else
current.hide_modpackcontents = false
this.data.hide_modpackcontents = false
core.setting_set("world_config_hide_modpackcontents", "false")
end
end
this.data.list:set_filtercriteria(current)
return true
end
if fields["btn_config_world_save"] then
local filename = this.data.worldspec.path ..
DIR_DELIM .. "world.mt"
local worldfile = Settings(filename)
local mods = worldfile:to_table()
local rawlist = this.data.list:get_raw_list()
local i,mod
for i,mod in ipairs(rawlist) do
if not mod.is_modpack and
mod.typ ~= "game_mod" then
if modname_valid(mod.name) then
worldfile:set("load_mod_"..mod.name, tostring(mod.enabled))
else
if mod.enabled then
gamedata.errormessage = fgettext_ne("Failed to enable mod \"$1\" as it contains disallowed characters. Only chararacters [a-z0-9_] are allowed.", mod.name)
end
end
mods["load_mod_"..mod.name] = nil
end
end
-- Remove mods that are not present anymore
for key,value in pairs(mods) do
if key:sub(1,9) == "load_mod_" then
worldfile:remove(key)
end
end
if not worldfile:write() then
core.log("error", "Failed to write world config file")
end
this:delete()
return true
end
if fields["btn_config_world_cancel"] then
this:delete()
return true
end
if fields["btn_all_mods"] then
local list = this.data.list:get_raw_list()
for i=1,#list,1 do
if list[i].typ ~= "game_mod" and
not list[i].is_modpack then
list[i].enabled = true
end
end
return true
end
return false
end
function create_configure_world_dlg(worldidx)
local dlg = dialog_create("sp_config_world",
get_formspec,
handle_buttons,
nil)
dlg.data.hide_gamemods = core.setting_getbool("world_config_hide_gamemods")
dlg.data.hide_modpackcontents = core.setting_getbool("world_config_hide_modpackcontents")
dlg.data.selected_mod = tonumber(core.setting_get("world_config_selected_mod"))
if dlg.data.selected_mod == nil then
dlg.data.selected_mod = 0
end
dlg.data.worldspec = core.get_worlds()[worldidx]
if dlg.data.worldspec == nil then dlg:delete() return nil end
dlg.data.worldconfig = modmgr.get_worldconfig(dlg.data.worldspec.path)
if dlg.data.worldconfig == nil or dlg.data.worldconfig.id == nil or
dlg.data.worldconfig.id == "" then
dlg:delete()
return nil
end
dlg.data.list = filterlist.create(
modmgr.preparemodlist, --refresh
modmgr.comparemod, --compare
function(element,uid) --uid match
if element.name == uid then
return true
end
end,
function(element,criteria)
if criteria.hide_game and
element.typ == "game_mod" then
return false
end
if criteria.hide_modpackcontents and
element.modpack ~= nil then
return false
end
return true
end, --filter
{ worldpath= dlg.data.worldspec.path,
gameid = dlg.data.worldspec.gameid }
)
if dlg.data.selected_mod > dlg.data.list:size() then
dlg.data.selected_mod = 0
end
dlg.data.list:set_filtercriteria(
{
hide_game=dlg.data.hide_gamemods,
hide_modpackcontents= dlg.data.hide_modpackcontents
})
dlg.data.list:add_sort_mechanism("alphabetic", sort_mod_list)
dlg.data.list:set_sortmode("alphabetic")
return dlg
end
|
-- OzzyTMBM (Ozzy's Triple Monitor Brightness Manager)
local OzzyTMBM={}
OzzyTMBM.__index = OzzyTMBM
-- Metadata
OzzyTMBM.name = "OzzyTMBM"
OzzyTMBM.version = "1.0"
OzzyTMBM.author = "Özgün Çağrı AYDIN"
OzzyTMBM.homepage = "https://ozguncagri.com"
OzzyTMBM.license = "MIT - https://opensource.org/licenses/MIT"
-- 3 modification binder wrapper
OzzyTMBM.mod3Binder = function(key, operation)
hs.hotkey.bind({"cmd", "alt", "ctrl"}, key, operation)
end
-- 4 modification binder wrapper
OzzyTMBM.mod4Binder = function(key, operation)
hs.hotkey.bind({"shift", "cmd", "alt", "ctrl"}, key, operation)
end
OzzyTMBM.manageAllMonitors = function()
-- Decrease brightness of all external displays by 10
OzzyTMBM.mod3Binder("H", function()
hs.execute("/usr/local/bin/ddcctl -d 1 -b 10-")
hs.execute("/usr/local/bin/ddcctl -d 2 -b 10-")
end)
-- Increase brightness of all external displays by 10
OzzyTMBM.mod3Binder("Y", function()
hs.execute("/usr/local/bin/ddcctl -d 1 -b 10+")
hs.execute("/usr/local/bin/ddcctl -d 2 -b 10+")
end)
-- Set brightness of all external displays to minimum (0)
OzzyTMBM.mod4Binder("H", function()
hs.execute("/usr/local/bin/ddcctl -d 1 -b 0")
hs.execute("/usr/local/bin/ddcctl -d 2 -b 0")
end)
-- Set brightness of all external displays to maximum (100)
OzzyTMBM.mod4Binder("Y", function()
hs.execute("/usr/local/bin/ddcctl -d 1 -b 100")
hs.execute("/usr/local/bin/ddcctl -d 2 -b 100")
end)
end
OzzyTMBM.manageFirstMonitor = function()
-- Decrease brightness of first external display by 10
OzzyTMBM.mod3Binder("J", function()
hs.execute("/usr/local/bin/ddcctl -d 1 -b 10-")
end)
-- Increase brightness of first external display by 10
OzzyTMBM.mod3Binder("U", function()
hs.execute("/usr/local/bin/ddcctl -d 1 -b 10+")
end)
-- Set brightness of first external display to minimum (0)
OzzyTMBM.mod4Binder("J", function()
hs.execute("/usr/local/bin/ddcctl -d 1 -b 0")
end)
-- Set brightness of first external display to maximum (100)
OzzyTMBM.mod4Binder("U", function()
hs.execute("/usr/local/bin/ddcctl -d 1 -b 100")
end)
end
OzzyTMBM.manageSecondMonitor = function()
-- Decrease brightness of second external display by 10
OzzyTMBM.mod3Binder("G", function()
hs.execute("/usr/local/bin/ddcctl -d 2 -b 10-")
end)
-- Increase brightness of second external display by 10
OzzyTMBM.mod3Binder("T", function()
hs.execute("/usr/local/bin/ddcctl -d 2 -b 10+")
end)
-- Set brightness of second external display to minimum (0)
OzzyTMBM.mod4Binder("G", function()
hs.execute("/usr/local/bin/ddcctl -d 2 -b 0")
end)
-- Set brightness of second external display to maximum (100)
OzzyTMBM.mod4Binder("T", function()
hs.execute("/usr/local/bin/ddcctl -d 2 -b 100")
end)
end
function OzzyTMBM:init()
-- Activate all hotkeys
OzzyTMBM.manageAllMonitors()
OzzyTMBM.manageFirstMonitor()
OzzyTMBM.manageSecondMonitor()
end
return OzzyTMBM
|
-- Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and
-- other Shroud Project Developers.
-- See the top-level COPYRIGHT file for details.
--
-- SPDX-License-Identifier: (BSD-3-Clause)
--
-- #######################################################################
-- test tutorial module
local tutorial = require "tutorial"
local rv_int, rv_double, rv_logical, rv_char
tutorial.NoReturnNoArguments()
print(tutorial.LastFunctionCalled())
rv_double = tutorial.PassByValue(1.0, 4)
print(tutorial.LastFunctionCalled(), rv_double)
rv_char = tutorial.ConcatenateStrings("dog", "cat")
print(tutorial.LastFunctionCalled(), rv_char)
rv_double = tutorial.UseDefaultArguments()
-- 13.1415
print(tutorial.LastFunctionCalled(), rv_double)
rv_double = tutorial.UseDefaultArguments(11.0)
print(tutorial.LastFunctionCalled(), rv_double)
-- 11.0
rv_double = tutorial.UseDefaultArguments(11.0, false)
print(tutorial.LastFunctionCalled(), rv_double)
-- 1.0
tutorial.OverloadedFunction("name")
print(tutorial.LastFunctionCalled())
tutorial.OverloadedFunction(1)
print(tutorial.LastFunctionCalled())
--[[
tutorial.TemplateArgument(1)
print(tutorial.LastFunctionCalled())
tutorial.TemplateArgument(10.0)
print(tutorial.LastFunctionCalled())
--]]
tutorial.FortranGenericOverloaded()
print(tutorial.LastFunctionCalled())
tutorial.FortranGenericOverloaded("foo", 1.0)
print(tutorial.LastFunctionCalled())
rv_int = tutorial.UseDefaultOverload(10)
print(tutorial.LastFunctionCalled(), rv_int)
-- This should call overload (double type, int num)
-- but instead calls (int num, int offset)
-- since there is only one number type
rv_int = tutorial.UseDefaultOverload(1.0, 10)
print(tutorial.LastFunctionCalled(), rv_int)
rv_int = tutorial.UseDefaultOverload(10, 11, 12)
print(tutorial.LastFunctionCalled(), rv_int)
rv_int = tutorial.UseDefaultOverload(1.0, 10, 11, 12)
print(tutorial.LastFunctionCalled(), rv_int)
-- rv_int = tutorial.UseDefaultOverload("no such overload")
|
-- coding: utf-8
-- started: 2022-01-20
local ini = require "inifile"
local mdialog = require "scripts.macrodialog"
local mfile = os.getenv("HOME") .. "/.config/far2l/settings/key_macros.ini"
local cfg = ini.New(mfile, "nocomment")
local items = {}
for sec in cfg:sections() do
local name, area, key = sec.name:match("^(%w+)/(%w+)/(%w+)")
if name and name:lower()=="keymacros" then
local descr = cfg:GetString(sec.name, "Description") or "<no description>"
local seq = cfg:GetString(sec.name, "Sequence") or "<no sequence>"
local txt = ("%-12s│ %-16s│ %s"):format(area, key, descr)
table.insert(items, {text=txt; columns={area,key,descr,seq}; section=sec; })
end
end
local Title = "Macro Browser"
local props = { Title=Title, Bottom="Sort: CtrlF1/F2/F3" }
local bkeys = {
{BreakKey = "C+F1"; sortcol=1; },
{BreakKey = "C+F2"; sortcol=2; },
{BreakKey = "C+F3"; sortcol=3; },
{BreakKey = "F4"; edit=1; },
}
local Col, Rev = 1, false
local function sort_items()
table.sort(items,
function(a,b)
if Rev then return a.columns[Col] > b.columns[Col]
else return a.columns[Col] < b.columns[Col]
end
end)
props.Title = ("%s [ %d%s ]"):format(Title,Col,Rev and "↓" or "↑")
end
sort_items()
while true do
local item,pos = far.Menu(props, items, bkeys)
if not item then break; end
props.SelectIndex = pos
if item.sortcol then
if item.sortcol == Col then Rev = not Rev
else Col,Rev = item.sortcol,false
end
sort_items()
props.SelectIndex = 1
elseif (item.section or item.edit) and pos >= 1 then
local sec = items[pos].section
local data = sec:dict()
local area,key = sec.name:match("KeyMacros/(%w+)/(%w+)")
if area then
data.WorkArea, data.MacroKey = area, key
mdialog(data)
end
end
end
--cfg:write(mfile..".backup")
|
include( path.join( FOREIGN_SRC_DIR, "build/FreeImage" ) )
include( path.join( FOREIGN_SRC_DIR, "build/squish-1.10" ) )
ProjectName = "TextureConverter"
project( ProjectName )
kind( "ConsoleApp" )
files( { "*.cpp", "*.h" } )
defines( { "FREEIMAGE_LIB" } )
includedirs( { "../..", "../TextureLib", FOREIGN_SRC_DIR .. "/build/FreeImage/Source",
FOREIGN_SRC_DIR .. "/build/tclap-1.2.1/include" } )
links( { "TextureLib", "renderlib", "systemlib", "util", "ziplib", "FreeImage", "squish" } )
Configuration.ConfigureProject( ProjectName )
configuration( "Release" )
targetsuffix( "" )
configuration( "windows" )
targetdir( path.join( ROOT_DIR, "tools/bin" ) )
configuration( "linux" )
includedirs( { "../TextureConverter" } )
links( { "pthread" } )
|
local SingleCollection = {}
SingleCollection.__index = SingleCollection
function SingleCollection.new(pool)
return setmetatable({
onAdded = pool.onAdded,
onRemoved = pool.onRemoved,
_pool = pool,
}, SingleCollection)
end
function SingleCollection:each(callback)
local dense = self._pool.dense
local objects = self._pool.objects
for i = self._pool.size, 1, -1 do
callback(dense[i], objects[i])
end
end
return SingleCollection
|
object_tangible_loot_creature_loot_collections_broken_lightsaber_hilt_015 = object_tangible_loot_creature_loot_collections_shared_broken_lightsaber_hilt_015:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_broken_lightsaber_hilt_015, "object/tangible/loot/creature/loot/collections/broken_lightsaber_hilt_015.iff")
|
local buffer = {}
function buffer.trim()
local view = vim.fn.winsaveview()
vim.cmd [[
keeppatterns %s/\_s*\%$//e
keeppatterns %s/\s\+$//e
]]
vim.fn.winrestview(view)
end
function buffer.writeskeleton()
local configdir = vim.fn.stdpath('config')
local extension = vim.fn.expand('%:e')
local skeletonfile = vim.fn.fnameescape(configdir .. '/templates/skeleton.' .. extension)
if vim.fn.filereadable(skeletonfile) == 1 then
vim.cmd('read ++edit ' .. skeletonfile)
vim.fn.deletebufline(vim.fn.bufname(), 1)
vim.bo.modified = false
end
end
return buffer
|
--- Wrapper for the ROS logging system
-- @module console
local ffi = require 'ffi'
local torch = require 'torch'
local ros = require 'ros.env'
local utils = require 'ros.utils'
local std = ros.std
local console = {}
ros.console = console
console.trace_once_stack = {}
console.trace_throttle_stack = {}
function init()
local names = {
'initialize',
'shutdown',
'set_logger_level',
'get_loggers',
'check_loglevel',
'get_logger',
'print'
}
return utils.create_method_table("ros_Console_", names)
end
local f = init()
console.Level = {
Debug = 0,
Info = 1,
Warn = 2,
Error = 3,
Fatal = 4,
}
--- Don't call this function directly. Performs any required initialization/configuration.
-- This function is called automatically during construction of the object.
function console.initialize()
console.NAME_PREFIX = ffi.string(f.initialize())
end
--- Shut down the console
function console.shutdown()
f.shutdown()
end
--- Set the log level for a given logger
-- @tparam string name Name of the logger
-- @param level New log level
-- @tparam[opt=false] bool no_default_prefix
function console.set_logger_level(name, level, no_default_prefix)
f.set_logger_level(name, level, no_default_prefix or false)
end
--- Returns the list of all loggers
-- @treturn std.StringVector Names of all loggers
-- @treturn torch.ShortTensor Log level of the loggers
function console.get_loggers()
local names = std.StringVector()
local levels = torch.ShortTensor()
f.get_loggers(names:cdata(), levels:cdata())
return names, levels
end
--- Get a logger
-- @tparam string name Name of the logger
-- @tparam[opt=false] bool no_default_prefix
-- @return Pointer to the logger
function console.get_logger(name, no_default_prefix)
return f.get_logger(name, no_default_prefix or false)
end
function console.check_loglevel(name, level, no_default_prefix)
return f.check_loglevel(name, level, no_default_prefix or false)
end
-- aliases
console.setLoggerLevel = console.set_logger_level
console.getLoggers = console.get_loggers
console.checkLogLevel = console.check_loglevel
--- TODO: docu
function console.print(logger, level, text, file, function_name, line)
f.print(logger or ffi.NULL, level, text, file or '??', function_name or '??', line or 0)
end
local function create_trace(level)
return function(...)
if console.check_loglevel(nil, level) then
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
console.print(nil, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
end
end
end
local function create_trace_named(level)
return function(name, ...)
if console.check_loglevel(name, level) then
local logger = console.get_logger(name)
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
console.print(logger, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
end
end
end
local function create_trace_conditional(level)
return function(cond, ...)
if cond and console.check_loglevel(nil, level) then
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
console.print(nil, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
end
end
end
local function create_trace_conditional_named(level)
return function(cond, name, ...)
if cond and console.check_loglevel(name, level) then
local logger = console.get_logger(name)
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
console.print(logger, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
end
end
end
local function create_trace_once_conditional_named(level)
return function(key, cond, name, ...)
if not console.trace_stack[key] and cond and console.check_loglevel(name, level) then
console.trace_stack[key] = true
local logger = console.get_logger(name)
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
console.print(logger, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
end
end
end
local function create_trace_once_named(level)
return function(key, name, ...)
if not console.trace_once_stack[key] and console.check_loglevel(nil, level) then
console.trace_once_stack[key] = true
local logger = console.get_logger(name)
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
console.print(logger, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
end
end
end
local function create_trace_once(level)
return function(key, ...)
if not console.trace_once_stack[key] and console.check_loglevel(nil, level) then
console.trace_once_stack[key] = true
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
console.print(nil, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
end
end
end
local function create_trace_throttle(level)
return function(key, period, ...)
if console.check_loglevel(nil, level) then
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
if not console.trace_throttle_stack[key] then
console.trace_throttle_stack[key] = ros.Time.now()
console.print(nil, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
else
if (ros.Time.now() - console.trace_throttle_stack[key]):toSec() > period then
console.print(nil, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
console.trace_throttle_stack[key] = ros.Time.now()
end
end
end
end
end
local function create_trace_throttle_named(level)
return function(key, period, name, ...)
if console.check_loglevel(nil, level) then
local msg = string.format(...)
local caller = debug.getinfo(2, 'nSl')
local logger = console.get_logger(name)
if not console.trace_throttle_stack[key] then
console.trace_throttle_stack[key] = ros.Time.now()
console.print(nil, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
else
if (ros.Time.now() - console.trace_throttle_stack[key]):toSec() > period then
console.print(logger, level, msg, caller.short_src, caller.name, caller.currentline or caller.linedefined)
console.trace_throttle_stack[key] = ros.Time.now()
end
end
end
end
end
local function create_logger(postfix, fn_builder)
local name_level = {
DEBUG = console.Level.Debug,
INFO = console.Level.Info,
WARN = console.Level.Warn,
ERROR = console.Level.Error,
FATAL = console.Level.Fatal
}
for k,v in pairs(name_level) do
local fn = fn_builder(v)
ros[k .. postfix] = fn
ros['ROS_' .. k .. postfix] = fn
end
end
-- declare basic logging helpers
create_logger('', create_trace)
create_logger('_NAMED', create_trace_named)
create_logger('_COND', create_trace_conditional)
create_logger('_THROTTLE', create_trace_throttle)
create_logger('_ONCE', create_trace_once)
create_logger('_COND_NAMED', create_trace_conditional_named)
create_logger('_THROTTLE_NAMED', create_trace_throttle_named)
create_logger('_ONCE_NAMED', create_trace_once_named)
console.initialize()
|
require("luci.sys")
require("uci")
local conf = require "luci.config"
local ntm = require "luci.model.network".init()
local x, m, s, pass, ifname
x = uci.cursor()
m = Map("netkeeper", translate("NetKeeper"), translate("Here you can configurate the pppoe client for NetKeeper Tool, before using the tool, you should choose a valid interface with PPPoE protocol and config the password of the interface. Then pressing the save&commit and dialing up with the computer. "))
s = m:section(TypedSection, "setting", translate("NetKeeper module config"))
s.addremove = false
s.anonymous = true
ifname = s:option(ListValue, "interface", translate("Interfaces"))
pass = s:option(Value, "password", translate("Password"))
pass.password = true
x:foreach("network", "interface", function(s)
local interface = s[".name"]
if(x:get("network", interface, "proto") == 'pppoe') then
ifname:value(interface)
end
end)
--for k, v in ipairs(luci.sys.net.devices()) do
-- if v ~= "lo" then
-- ifname:value(v)
-- end
--end
local apply = luci.http.formvalue("cbi.apply")
if apply then
io.popen("/etc/init.d/nk4 restart")
end
return m
|
function GM:TargetFinderThink()
if not GetConVar( "gw_target_finder_enabled" ):GetBool() then
return
end
for _, ply in pairs(player.GetAll()) do
if ply:GWIsSeeking() then
local minDist = -1
for _, target in pairs( team.GetPlayers(GW_TEAM_HIDING) ) do
if target:Alive() then
local dist = ply:GetPos():Distance(target:GetPos())
if minDist == -1 or dist < minDist then
minDist = dist
-- if target is to close dont show actual distance jsut show "close" clientside
if dist < GetConVar( "gw_target_finder_threshold" ):GetInt() then
minDist = 0
end
end
end
end
ply:SetNWFloat("gwClosestTargetDistance", minDist)
end
end
end
|
local bin = vim.fn.stdpath("data") .. "/lspinstall/vue/node_modules/.bin/vls"
local lsp_config = require("lsp")
if vim.fn.filereadable(bin) == 0 then require("lspinstall").install_server("vue") end
require"lspconfig".vuels.setup {
cmd = { bin },
on_attach = lsp_config.common_on_attach,
vetur = { completion = { autoImport = true, useScaffoldSnippets = true }, format = { defualtFormatter = { js = "eslint", ts = "eslint" } } }
}
|
DeriveGamemode("nutscript")
|
local fn = require('distant.fn')
local Driver = require('spec.e2e.driver')
describe('fn', function()
local driver, root
before_each(function()
driver = Driver:setup()
root = driver:new_dir_fixture()
end)
after_each(function()
driver:teardown()
end)
describe('create_dir', function()
it('should create a new directory', function()
local dir = root.dir('dir')
local err = fn.create_dir({path = dir.path()})
assert(not err, err)
assert.is.truthy(dir.exists())
end)
it('should fail if creating multiple missing directory components if all not specified', function()
local dir = root.dir('dir/dir2')
local err = fn.create_dir({path = dir.path()})
assert.is.truthy(err)
assert.is.falsy(dir.exists())
end)
it('should support creating multiple missing directory components if all specified', function()
local dir = root.dir('dir/dir2')
local err = fn.create_dir({path = dir.path(), all = true})
assert(not err, err)
assert.is.truthy(dir.exists())
end)
end)
end)
|
local validItems = {} -- Empty table to fill with full list of valid airdrop items
Mutation.tier1 = {} -- 1000 to 2000 gold cost up to 5 minutes
Mutation.tier2 = {} -- 2000 to 3500 gold cost up to 10 minutes
Mutation.tier3 = {} -- 3500 to 5000 gold cost up to 15 minutes
Mutation.tier4 = {} -- 5000 to 99998 gold cost beyond 15 minutes
local counter = 1 -- Slowly increments as time goes on to expand list of cost-valid items
local varFlag = 0 -- Flag to stop the repeat until loop for tier iterations
function Mutation:Airdrop()
for k, v in pairs(KeyValues.ItemKV) do -- Go through all the items in KeyValues.ItemKV and store valid items in validItems table
varFlag = 0 -- Let's borrow this memory to suss out the forbidden items first...
local item_cost = v["ItemCost"]
if item_cost then
item_cost = tonumber(item_cost)
end
if item_cost and item_cost >= IMBA_MUTATION_AIRDROP_ITEM_MINIMUM_GOLD_COST and item_cost ~= 99999 and not string.find(k, "recipe") and not string.find(k, "cheese") then
for _, item in pairs(IMBA_MUTATION_RESTRICTED_ITEMS) do -- Make sure item isn't a restricted item
if k == item then
varFlag = 1
end
end
if varFlag == 0 then -- If not a restricted item (while still meeting all the other criteria...)
validItems[#validItems + 1] = {k = k, v = item_cost}
end
end
end
table.sort(validItems, function(a, b) return a.v < b.v end) -- Sort by ascending item cost for easier retrieval later on
--[[
print("Table length: ", #validItems) -- # of valid items
for a, b in pairs(validItems) do
print(a)
for key, value in pairs(b) do
print('\t', key, value)
end
end
]]--
varFlag = 0
-- Create Tier 1 Table
repeat
if validItems[counter].v <= IMBA_MUTATION_AIRDROP_ITEM_TIER_1_GOLD_COST then
Mutation.tier1[#Mutation.tier1 + 1] = {k = validItems[counter].k, v = validItems[counter].v}
counter = counter + 1
else
varFlag = 1
end
until varFlag == 1
varFlag = 0
-- Create Tier 2 Table
repeat
if validItems[counter].v <= IMBA_MUTATION_AIRDROP_ITEM_TIER_2_GOLD_COST then
Mutation.tier2[#Mutation.tier2 + 1] = {k = validItems[counter].k, v = validItems[counter].v}
counter = counter + 1
else
varFlag = 1
end
until varFlag == 1
varFlag = 0
-- Create Tier 3 Table
repeat
if validItems[counter].v <= IMBA_MUTATION_AIRDROP_ITEM_TIER_3_GOLD_COST then
Mutation.tier3[#Mutation.tier3 + 1] = {k = validItems[counter].k, v = validItems[counter].v}
counter = counter + 1
else
varFlag = 1
end
until varFlag == 1
varFlag = 0
-- Create Tier 4 Table
for num = counter, #validItems do
Mutation.tier4[#Mutation.tier4 + 1] = {k = validItems[num].k, v = validItems[num].v}
end
varFlag = 0
--[[
print("TIER 1 LIST")
for a, b in pairs(Mutation.tier1) do
print(a)
for key, value in pairs(b) do
print('\t', key, value)
end
end
print("TIER 2 LIST")
for a, b in pairs(Mutation.tier2) do
print(a)
for key, value in pairs(b) do
print('\t', key, value)
end
end
print("TIER 3 LIST")
for a, b in pairs(Mutation.tier3) do
print(a)
for key, value in pairs(b) do
print('\t', key, value)
end
end
print("TIER 4 LIST")
for a, b in pairs(Mutation.tier4) do
print(a)
for key, value in pairs(b) do
print('\t', key, value)
end
end
]]--
Timers:CreateTimer(110.0, function()
Mutation:SpawnRandomItem()
return 120.0
end)
end
function Mutation:DangerZone()
local dummy_unit = CreateUnitByName("npc_dummy_unit_perma", Vector(0, 0, 0), true, nil, nil, DOTA_TEAM_NEUTRALS)
dummy_unit:AddNewModifier(dummy_unit, nil, "modifier_mutation_danger_zone", {})
end
function Mutation:PeriodicSpellcast()
local buildings = FindUnitsInRadius(DOTA_TEAM_GOODGUYS, Vector(0,0,0), nil, 20000, DOTA_UNIT_TARGET_TEAM_BOTH, DOTA_UNIT_TARGET_BUILDING, DOTA_UNIT_TARGET_FLAG_INVULNERABLE, FIND_ANY_ORDER, false)
local good_fountain = nil
local bad_fountain = nil
for _, building in pairs(buildings) do
local building_name = building:GetName()
if string.find(building_name, "ent_dota_fountain_bad") then
bad_fountain = building
elseif string.find(building_name, "ent_dota_fountain_good") then
good_fountain = building
end
end
local random_int
local counter = 0 -- Used to alternate between negative and positive spellcasts, and increments after each timer call
local varSwap -- Switches between 1 and 2 based on counter for negative and positive spellcasts
local caster
-- initialize to negative
CustomNetTables:SetTableValue("mutation_info", IMBA_MUTATION["negative"], {0})
Timers:CreateTimer(55.0, function()
varSwap = (counter % 2) + 1
random_int = RandomInt(1, #IMBA_MUTATION_PERIODIC_SPELLS[varSwap])
Notifications:TopToAll({text = IMBA_MUTATION_PERIODIC_SPELLS[varSwap][random_int][2].." Mutation in 5 seconds...", duration = 5.0, style = {color = IMBA_MUTATION_PERIODIC_SPELLS[varSwap][random_int][3]}})
return 60.0
end)
Timers:CreateTimer(60.0, function()
CustomNetTables:SetTableValue("mutation_info", IMBA_MUTATION["negative"], {varSwap})
if bad_fountain == nil or good_fountain == nil then
print("nao cucekd up!!! ")
return 60.0
end
for _, hero in pairs(HeroList:GetAllHeroes()) do
if (hero:GetTeamNumber() == 3 and IMBA_MUTATION_PERIODIC_SPELLS[varSwap][random_int][3] == "Red") or (hero:GetTeamNumber() == 2 and IMBA_MUTATION_PERIODIC_SPELLS[varSwap][random_int][3] == "Green") then
caster = good_fountain
else
caster = bad_fountain
end
hero:AddNewModifier(caster, caster, "modifier_mutation_"..IMBA_MUTATION_PERIODIC_SPELLS[varSwap][random_int][1], {duration=IMBA_MUTATION_PERIODIC_SPELLS[varSwap][random_int][4]})
end
counter = counter + 1
return 60.0
end)
end
function Mutation:Minefield()
local mines = {
"npc_imba_techies_land_mines",
"npc_imba_techies_land_mines_big_boom",
"npc_imba_techies_stasis_trap",
}
Timers:CreateTimer(function()
local units = FindUnitsInRadius(DOTA_TEAM_NEUTRALS, Vector(0,0,0), nil, FIND_UNITS_EVERYWHERE, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_ALL, DOTA_UNIT_TARGET_FLAG_INVULNERABLE + DOTA_UNIT_TARGET_FLAG_OUT_OF_WORLD, FIND_ANY_ORDER, false)
local mine_count = 0
local max_mine_count = 75
for _, unit in pairs(units) do
if unit:GetUnitName() == "npc_imba_techies_land_mines" or unit:GetUnitName() == "npc_imba_techies_land_mines_big_boom" or unit:GetUnitName() == "npc_imba_techies_stasis_trap" then
if unit:GetUnitName() == "npc_imba_techies_land_mines" then
unit:FindAbilityByName("imba_techies_land_mines_trigger"):SetLevel(RandomInt(1, 4))
elseif unit:GetUnitName() == "npc_imba_techies_land_mines_big_boom" then
unit:FindAbilityByName("imba_techies_land_mines_trigger"):SetLevel(RandomInt(1, 4))
elseif unit:GetUnitName() == "npc_imba_techies_stasis_trap" then
unit:FindAbilityByName("imba_techies_stasis_trap_trigger"):SetLevel(RandomInt(1, 4))
end
mine_count = mine_count + 1
end
end
if mine_count < max_mine_count then
for i = 1, 10 do
local mine = CreateUnitByName(mines[RandomInt(1, #mines)], RandomVector(IMBA_MUTATION_MINEFIELD_MAP_SIZE), true, nil, nil, DOTA_TEAM_NEUTRALS)
mine:AddNewModifier(mine, nil, "modifier_invulnerable", {})
end
end
-- print("Mine count:", mine_count)
return 10.0
end)
end
function Mutation:NoTrees()
GameRules:SetTreeRegrowTime(99999)
GridNav:DestroyTreesAroundPoint(Vector(0, 0, 0), 50000, false)
Mutation:RevealAllMap(1.0)
end
function Mutation:TugOfWar()
local golem
-- Random a team for the initial golem spawn
if RandomInt(1, 2) == 1 then
golem = CreateUnitByName("npc_dota_mutation_golem", IMBA_MUTATION_TUG_OF_WAR_START[DOTA_TEAM_GOODGUYS], false, nil, nil, DOTA_TEAM_GOODGUYS)
golem.ambient_pfx = ParticleManager:CreateParticle("particles/ambient/tug_of_war_team_radiant.vpcf", PATTACH_ABSORIGIN_FOLLOW, golem)
ParticleManager:SetParticleControl(golem.ambient_pfx, 0, golem:GetAbsOrigin())
Timers:CreateTimer(0.1, function()
golem:MoveToPositionAggressive(IMBA_MUTATION_TUG_OF_WAR_TARGET[DOTA_TEAM_GOODGUYS])
end)
else
golem = CreateUnitByName("npc_dota_mutation_golem", IMBA_MUTATION_TUG_OF_WAR_START[DOTA_TEAM_BADGUYS], false, nil, nil, DOTA_TEAM_BADGUYS)
golem.ambient_pfx = ParticleManager:CreateParticle("particles/ambient/tug_of_war_team_dire.vpcf", PATTACH_ABSORIGIN_FOLLOW, golem)
ParticleManager:SetParticleControl(golem.ambient_pfx, 0, golem:GetAbsOrigin())
Timers:CreateTimer(0.1, function()
golem:MoveToPositionAggressive(IMBA_MUTATION_TUG_OF_WAR_TARGET[DOTA_TEAM_BADGUYS])
end)
end
-- Initial logic
golem:AddNewModifier(golem, nil, "modifier_mutation_tug_of_war_golem", {}):SetStackCount(1)
FindClearSpaceForUnit(golem, golem:GetAbsOrigin(), true)
golem:SetDeathXP(50)
golem:SetMinimumGoldBounty(50)
golem:SetMaximumGoldBounty(50)
end
function Mutation:Wormhole()
-- Assign initial wormhole positions
local current_wormholes = {}
for i = 1, 12 do
local random_int = RandomInt(1, #IMBA_MUTATION_WORMHOLE_POSITIONS)
current_wormholes[i] = IMBA_MUTATION_WORMHOLE_POSITIONS[random_int]
table.remove(IMBA_MUTATION_WORMHOLE_POSITIONS, random_int)
end
-- Create wormhole particles (destroy and redraw every minute to accommodate for reconnecting players)
local wormhole_particles = {}
Timers:CreateTimer(function()
for i = 1, 12 do
if wormhole_particles[i] then
ParticleManager:DestroyParticle(wormhole_particles[i], true)
ParticleManager:ReleaseParticleIndex(wormhole_particles[i])
end
wormhole_particles[i] = ParticleManager:CreateParticle("particles/ambient/wormhole_circle.vpcf", PATTACH_CUSTOMORIGIN, nil)
ParticleManager:SetParticleControl(wormhole_particles[i], 0, GetGroundPosition(current_wormholes[i], nil) + Vector(0, 0, 20))
ParticleManager:SetParticleControl(wormhole_particles[i], 2, IMBA_MUTATION_WORMHOLE_COLORS[i])
end
return 60
end)
-- Teleport loop
Timers:CreateTimer(function()
-- Find units to teleport
for i = 1, 12 do
local units = FindUnitsInRadius(DOTA_TEAM_GOODGUYS, current_wormholes[i], nil, 150, DOTA_UNIT_TARGET_TEAM_BOTH, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES + DOTA_UNIT_TARGET_FLAG_INVULNERABLE + DOTA_UNIT_TARGET_FLAG_PLAYER_CONTROLLED, FIND_ANY_ORDER, false)
for _, unit in pairs(units) do
if not unit:HasModifier("modifier_mutation_wormhole_cooldown") then
if unit:IsHero() then
unit:EmitSound("Wormhole.Disappear")
Timers:CreateTimer(0.03, function()
unit:EmitSound("Wormhole.Appear")
end)
else
unit:EmitSound("Wormhole.CreepDisappear")
Timers:CreateTimer(0.03, function()
unit:EmitSound("Wormhole.CreepAppear")
end)
end
unit:AddNewModifier(unit, nil, "modifier_mutation_wormhole_cooldown", {duration = IMBA_MUTATION_WORMHOLE_PREVENT_DURATION})
FindClearSpaceForUnit(unit, current_wormholes[13-i], true)
if unit.GetPlayerID and unit:GetPlayerID() then
unit:CenterCameraOnEntity(unit)
end
end
end
end
return 0.5
end)
end
|
-- Copyright Tomáš Nguyen 2015.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
require "game"
require "enemy"
boss = nil
spawnPoints = {}
spawnIndex = 0
endTimer = nil
--start level by creating enemies and changing gamestates
function level1Start()
gamestate = "levelbegin"
currentLevel = 1
endTimer = 3
local numberOfEnemies = 10
local spawnArrayX = {20,450,50,400,100,350,150,300,200,250}
local spawnArrayTimers = {2,0.1,4,0.1,4,0.1,4,0.1,4,0.1}
spawnIndex = 1
powerUpCount = 2
spawnPoints = gameGenerateSpawnPoints(spawnArrayX, spawnArrayTimers)
if table.getn(spawnPoints) < numberOfEnemies then
numberOfEnemies = table.getn(spawnPoints)
end
for i = 1, numberOfEnemies, 1 do
newEnemy = enemyCreateNew(1)
table.insert(enemyStack, newEnemy)
end
end
--update level
function level1Update(dt)
--decrease and check enemy spawn timer - spawn enemy if < 0
spawnPoints[spawnIndex].timer = spawnPoints[spawnIndex].timer - 1*dt
if spawnPoints[spawnIndex].timer <= 0 and table.getn(enemyStack) > 0 then
local size = table.getn(enemyStack)
local x = spawnPoints[spawnIndex].x
if table.getn(spawnPoints) > spawnIndex then
spawnIndex = spawnIndex + 1
end
--spawn new enemy
gameLaunchEnemy(x, size)
end
--check for level end conditions
if table.getn(enemyStack) == 0 and table.getn(enemies) == 0 and isAlive then
endTimer = endTimer - 1*dt
if endTimer < 0 then
gamestate = "levelend"
end
end
end
|
object_tangible_component_weapon_new_weapon_enhancement_melee_slot_one_s03 = object_tangible_component_weapon_new_weapon_shared_enhancement_melee_slot_one_s03:new {
}
ObjectTemplates:addTemplate(object_tangible_component_weapon_new_weapon_enhancement_melee_slot_one_s03, "object/tangible/component/weapon/new_weapon/enhancement_melee_slot_one_s03.iff")
|
local present, alpha = pcall(require, "alpha")
if not present then
return
end
-- Get ascii generator:
-- https://lachlanarthur.github.io/Braille-ASCII-Art/
local one_punch_man = {
[[]],
[[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⡤⠤⠤⠤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠖⠈⠉⠉⠁⠒⠤⡀⠀⠀ ]],
[[ ⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠾⠿⠶⠀⠀⠀⠀⠀⠈⠑⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡔⠁⠀⠀⠀⠀⠀⠀⠀⠈⢆⠀ ]],
[[ ⠀⠀⠀⠀⠀⠀⠀⣰⣯⣍⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡄ ]],
[[ ⠀⠀⠀⠀⠀⠀⡸⠥⠤⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣ ]],
[[ ⠀⠀⠀⠀⠀⢠⣯⠭⠭⠭⠤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸ ]],
[[ ⠀⠀⠀⠀⠀⣼⣛⣛⣛⣒⡀⠀⠀⠤⠤⠤⠤⠤⠀⠀⠤⠤⠤⠄⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⢀⣀⡀⡀⠀⡀⠀⠀⠀⢸ ]],
[[ ⠀⠀⠀⠀⠀⢹⡤⠤⠄⠀⠀⠀⡔⠒⠛⠗⢲⠀⢀⠐⠚⠍⢑⡆⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⢰⠁⠀⡐⣧⣎⠀⠀⠀⠀⢸ ]],
[[ ⠀⠀⠀⠀⢰⣏⣙⣶⣒⣈⡁⠀⠈⠒⠂⠒⠁⠀⢸⠈⠒⠒⠊⠀⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠁⠀⠀⠈⠒⠊⠀⠃⠀⠑⠀⠀⠀⢸ ]],
[[ ⠀⠀⠀⠀⣿⠉⣹⡍⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸ ]],
[[ ⠀⠀⠀⠀⠸⣝⣟⣅⡀⠀⠀⠀⣀⠀⠀⠀⠀⠀⠀⠃⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇ ]],
[[ ⠀⠀⠀⠀⠀⠙⢌⣁⡤⠤⠶⠤⠀⠀⠀⠀⠀⢀⣀⡀⠀⠀⠀⢀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀ ]],
[[ ⠀⠀⠀⠀⠀⠀⠀⠀⢹⣈⣉⣉⣉⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡼⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠃⠀ ]],
[[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⡭⠥⠄⠀⠀⠀⠀⠀⠀⠀⠀⢀⡼⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠤⣀⠀⠀⠀⢀⡠⠔⠁⠀⠀ ]],
[[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡶⢭⣁⠀⠀⠀⠀⠀⢀⡤⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠉⠁⠀⠀⠀⠀ ]],
[[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡧⠀⣈⡛⠒⠒⠒⠋⢹⠤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]],
[[ ⠀⠀⠀⠀⠀⠀⠀⢀⡠⢴⠷⡏⠉⠉⠀⠀⠀⠀⠀⢸⣆⠈⢧⡙⡖⢤⠐⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]],
[[ ⠀⠀⠀⢀⣀⣖⣚⣻⣛⣿⣏⢻⣄⡀⠀⠀⠀⠀⠀⢈⡼⢦⡀⢳⣿⣶⣤⡄⠑⢢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]],
[[ ⠀⠀⣼⣁⣀⣉⣙⣿⣿⣿⣷⢸⡀⠈⠉⠓⣲⡶⣾⡍⠀⠀⣳⢄⣛⣟⣛⣠⣶⣻⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]],
[[ ⠀⢠⣟⣿⣿⢷⣶⣮⡭⢽⡒⣿⣗⣤⣀⣀⣻⠙⠁⢇⣴⣾⣿⣿⣷⣿⣾⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]],
[[ ⣰⢻⣧⣍⡹⣽⣿⣧⡗⡤⣠⣥⣿⣿⣿⡾⣧⣘⣣⠼⢹⣿⣿⣿⣿⣿⣿⢻⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]],
[[ ⣯⣽⣿⣿⢚⣻⣿⣷⣿⣫⣟⣻⣿⣿⣿⣷⡇⢸⣿⡄⢸⣿⣿⣿⣿⣿⣿⡿⣟⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]],
[[ ⣾⣶⣿⣾⣯⣥⣿⣿⣟⣿⣯⣿⣿⣿⣿⣿⣿⣇⣸⣿⣃⣸⣿⣿⣿⣿⣿⣷⣿⣿⣿⣾⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]],
[[]],
}
local header = {
type = "text",
val = one_punch_man,
opts = {
position = "center",
hl = "AlphaHeader",
},
}
local handle =
-- io.popen 'fd -d 2 . $HOME"/.local/share/nvim/site/pack/deps" | head -n -2 | wc -l | tr -d "\n" '
io.popen 'fd -d 2 . $HOME"/.local/share/nvim/site/pack/packer" | head -n -2 | wc -l | tr -d "\n" '
local plugins = handle:read "*a"
handle:close()
local thingy =
io.popen 'echo "$(date +%a) $(date +%d) $(date +%b)" | tr -d "\n"'
local date = thingy:read "*a"
thingy:close()
local plugin_count = {
type = "text",
val = "└─ " .. plugins .. " plugins in total ─┘",
opts = {
position = "center",
hl = "AlphaHeader",
},
}
local heading = {
type = "text",
val = "┌─ Today is " .. date .. " ─┐",
opts = {
position = "center",
hl = "AlphaHeader",
},
}
local footer = {
type = "text",
val = "-GiTMoX-",
opts = {
position = "center",
hl = "AlphaFooter",
},
}
local function button(sc, txt, keybind)
local sc_ = sc:gsub("%s", ""):gsub("SPC", "<leader>")
local opts = {
position = "center",
text = txt,
shortcut = sc,
cursor = 5,
width = 24,
align_shortcut = "right",
hl_shortcut = "AlphaButtons",
hl = "AlphaButtons",
}
if keybind then
opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } }
end
return {
type = "button",
val = txt,
on_press = function()
local key = vim.api.nvim_replace_termcodes(sc_, true, false, true)
vim.api.nvim_feedkeys(key, "normal", false)
end,
opts = opts,
}
end
local buttons = {
type = "group",
val = {
button("LDR f f", " Recents", ":Telescope oldfiles<CR>"),
button("LDR f b", " Buffers", ":Telescope buffers<CR>"),
button("LDR f f", " Explore", ":Telescope file_browser<CR>"),
button("LDR f w", " Ripgrep", ":Telescope live_grep<CR>"),
button("MRK V", " Options", ":execute 'normal! `V'<CR>"),
button("MRK P", " Plugins", ":execute 'normal! `P'<CR>"),
},
opts = {
spacing = 1,
},
}
local section = {
header = header,
buttons = buttons,
plugin_count = plugin_count,
heading = heading,
footer = footer,
}
local opts = {
layout = {
{ type = "padding", val = 1 },
section.header,
{ type = "padding", val = 1 },
section.heading,
section.plugin_count,
{ type = "padding", val = 1 },
-- section.top_bar,
section.buttons,
-- section.bot_bar,
{ type = "padding", val = 1 },
section.footer,
},
opts = {
margin = 20,
},
}
return alpha.setup(opts)
|
padawan_spice_mom_02_convo_template = ConvoTemplate:new {
initialScreen = "",
templateType = "Lua",
luaClassHandler = "padawan_spice_mom_02_conv_handler",
screens = {}
}
intro = ConvoScreen:new {
id = "intro",
leftDialog = "@conversation/padawan_spice_mom_02:s_168212d8", -- What are you lookin' for? Somethin' to keep you awake? Help you sleep? Help you walk, talk, eat, not eat, run faster, swim longer? Anything you want, need, or can dream up, I have and am willing to sell. For a price.
stopConversation = "false",
options = {
{"@conversation/padawan_spice_mom_02:s_d0812b8d", "sure_about_that"}, -- I'm sorry, I think I have the wrong person.
{"@conversation/padawan_spice_mom_02:s_1f593aa5", "law_enforcement"}, -- I'm not interested. But I believe I know someone who is?
}
}
padawan_spice_mom_02_convo_template:addScreen(intro);
sure_about_that = ConvoScreen:new {
id = "sure_about_that",
leftDialog = "@conversation/padawan_spice_mom_02:s_e66080c4", -- You sure about that? I've got what every man and woman in the Galaxy needs. Name your pleasure, my friend.
stopConversation = "false",
options = {
{"@conversation/padawan_spice_mom_02:s_798612aa", "good_friend"}, -- It's not for me, Sola sent me for her weekly supplies.
{"@conversation/padawan_spice_mom_02:s_6168a073", "sola_sent_you"}, -- Now I'm certain I have the wrong guy.
}
}
padawan_spice_mom_02_convo_template:addScreen(sure_about_that);
sola_sent_you = ConvoScreen:new {
id = "sola_sent_you",
leftDialog = "@conversation/padawan_spice_mom_02:s_a0730d59", -- Sola sent you didn't she?
stopConversation = "false",
options = {
{"@conversation/padawan_spice_mom_02:s_ca7eddd3", "not_going_to_argue"}, -- You leave her alone! She doesn't need a thug like you bothering her.
}
}
padawan_spice_mom_02_convo_template:addScreen(sola_sent_you);
not_going_to_argue = ConvoScreen:new {
id = "not_going_to_argue",
leftDialog = "@conversation/padawan_spice_mom_02:s_6242972e", -- Whatever you say friend. I'm not going to argue. I'll say this though... shouldn't be so quick to judge people you barely know. And believe me, Sola can take care of herself. She's willing to do what she feels needs doing.
stopConversation = "false",
options = {
{"@conversation/padawan_spice_mom_02:s_625ba59c", "has_her_reasons"}, -- I guess. Thought I can't imagine why she'd be dealing with you..
}
}
padawan_spice_mom_02_convo_template:addScreen(not_going_to_argue);
has_her_reasons = ConvoScreen:new {
id = "has_her_reasons",
leftDialog = "@conversation/padawan_spice_mom_02:s_350fcbe3", -- She has her reasons. Miss Sola is a friend and a loyal customer. just take this to her and tell her Evif sends his well wishes.
stopConversation = "true",
options = {}
}
padawan_spice_mom_02_convo_template:addScreen(has_her_reasons);
good_friend = ConvoScreen:new {
id = "good_friend",
leftDialog = "@conversation/padawan_spice_mom_02:s_f5bb1061", -- Oh! You should have said so before friend. Miss Sola is a good friend of mine... and a loyal customer. Take this to her and tell her Evif sends his well wishes.
stopConversation = "true",
options = {}
}
padawan_spice_mom_02_convo_template:addScreen(good_friend);
law_enforcement = ConvoScreen:new {
id = "law_enforcement",
leftDialog = "@conversation/padawan_spice_mom_02:s_a04364ee", -- You aren't in law enforcement now are you?
stopConversation = "false",
options = {
{"@conversation/padawan_spice_mom_02:s_bdb90e46", "quick_to_judge"}, -- No, Sola sent me here for her weekly supplies.
}
}
padawan_spice_mom_02_convo_template:addScreen(law_enforcement);
quick_to_judge = ConvoScreen:new {
id = "quick_to_judge",
leftDialog = "@conversation/padawan_spice_mom_02:s_2c96cac3", -- Oh! You should have said so before friend, and you shouldn't be so quick to judge.
stopConversation = "true",
options = {}
}
padawan_spice_mom_02_convo_template:addScreen(quick_to_judge);
not_quest_owner = ConvoScreen:new {
id = "not_quest_owner",
leftDialog = "@conversation/padawan_spice_mom_02:s_b56527e1", -- Anything you want, need, or can dream up, I have and am willing to sell. For a price.
stopConversation = "true",
options = {}
}
padawan_spice_mom_02_convo_template:addScreen(not_quest_owner);
addConversationTemplate("padawan_spice_mom_02_convo_template", padawan_spice_mom_02_convo_template);
|
---Register an event handler.
---@param receiverName string # Receiver name. Must be globally unique for each registration.
---@param event Event # One of the values from Event class.
---@param eventHandler fun(eventCode:number, ...) # Event handler that will be called whenever the event triggers.
function EsoAddonFramework_Framework_Eso_EventManager:RegisterForEvent(receiverName, event, eventHandler) end
---Unregister an event handler.
---@param receiverName string # Receiver name. Must be the same that was used in RegisterForEvent(...).
---@param event Event # One of the values from Event class. Must be the same that was used in RegisterForEvent(...).
function EsoAddonFramework_Framework_Eso_EventManager:UnregisterForEvent(receiverName, event) end
---Adds a filter for a registered event handler.
---@param receiverName string # Receiver name. Must be the same that was used in RegisterForEvent(...).
---@param event Event # One of the values from Event class. Must be the same that was used in RegisterForEvent(...).
---@param filterType RegisterForEventFilterType # One of the values from RegisterForEventFilterType class.
---@param filter any # Filter value. The type and meaning depends on the filterType.
function EsoAddonFramework_Framework_Eso_EventManager:AddFilterForEvent(receiverName, event, filterType, filter) end
|
-- this is a file for test lua 504
require("LuaPanda").start()
local a <const> = 4
local b = a + 7
print(b)
|
local addonName, Roth_UI = ...
local LSM = LibStub("LibSharedMedia-3.0")
local mediaCallbacks = {}
local loadedCallbacks = {}
local configLoaded = false
local LoadedHandler = CreateFrame("Frame")
LoadedHandler:RegisterEvent("ADDON_LOADED")
LoadedHandler:SetScript("OnEvent", function(self, event, name)
if name == "Roth_UI" then
Roth_UI:LoadConfig()
configLoaded = true
for index, callback in pairs(loadedCallbacks) do
callback()
end
end
end)
--- Callback to get notifications when addons loaded later than us have added shared media.
LSM.RegisterCallback(Roth_UI, "LibSharedMedia_Registered", function(name, mediaType, key)
if configLoaded then
for index, callback in pairs(mediaCallbacks) do
callback(name, mediaType, key)
end
end
end)
--- Allows a callback to be registered for when LibSharedMedia registers new content
function Roth_UI:ListenForMediaChange(callback)
table.insert(mediaCallbacks, callback)
end
function Roth_UI:ListenForLoaded(callback)
table.insert(loadedCallbacks, callback)
end
|
-- Copyright 2015 Alex Browne. All rights reserved.
-- Use of this source code is governed by the MIT
-- license, which can be found in the LICENSE file.
-- retry_or_fail_job represents a lua script that takes the following arguments:
-- 1) The id of the job to either retry or fail
-- It first checks if the job has any retries remaining. If it does,
-- then it:
-- 1) Decrements the number of retries for the given job
-- 2) Adds the job to the queued set
-- 3) Removes the job from the executing set
-- 4) Returns true
-- If the job has no retries remaining then it:
-- 1) Adds the job to the failed set
-- 3) Removes the job from the executing set
-- 2) Returns false
-- IMPORTANT: If you edit this file, you must run go generate . to rewrite ../scripts.go
-- Assign args to variables for easy reference
local function Fibonacci(n)
local function inner(m, a, b)
if m == 0 then
return a
end
return inner(m-1, b, a+b)
end
return inner(n, 0, 1)
end
local jobId = ARGV[1]
local currentTime = tonumber(ARGV[2])
local function NextRetryTime(n)
return string.format("%.0f",(currentTime+Fibonacci(n)*1000000000))
end
redis.log(redis.LOG_WARNING, "jobID: "..jobId)
local jobKey = 'jobs:' .. jobId
-- Make sure the job hasn't already been destroyed
local exists = redis.call('EXISTS', jobKey)
if exists ~= 1 then
return 0
end
-- Check how many retries remain
local retries = redis.call('HGET', jobKey, 'retries')
redis.log(redis.LOG_WARNING, "retries left: "..retries)
local poolKey = redis.call('HGET', jobKey, 'poolKey')
local newStatus = ''
if retries == '0' then
redis.log(redis.LOG_WARNING, "no retries left...")
-- newStatus should be failed because there are no retries left
newStatus = '{{.statusFailed}}'
else
local totalRetries = redis.call('HGET', jobKey, 'totalRetries')
local nextTime = NextRetryTime(totalRetries-retries+1)
redis.call('HINCRBY', jobKey, 'retries', -1)
redis.call('HSET', jobKey, 'time', nextTime)
redis.pcall('ZADD', '{{.timeIndexSet}}', nextTime, jobId)
-- subtract 1 from the remaining retries
-- newStatus should be queued, so the job will be retried
newStatus = '{{.statusQueued}}'
end
-- Get the job priority (used as score)
local jobPriority = redis.call('HGET', jobKey, 'priority')
-- Add the job to the appropriate new set
local newStatusSet = 'jobs:' .. newStatus..poolKey
redis.call('ZADD', newStatusSet, jobPriority, jobId)
-- Remove the job from the old status set
local oldStatus = redis.call('HGET', jobKey, 'status')
if ((oldStatus ~= '') and (oldStatus ~= newStatus)) then
local oldStatusSet = 'jobs:' .. oldStatus
redis.call('ZREM', oldStatusSet, jobId)
end
-- Set the job status in the hash
redis.call('HSET', jobKey, 'status', newStatus)
return retries
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.