content stringlengths 5 1.05M |
|---|
local augroup = vim.api.nvim_create_augroup
local auto_cmd = vim.api.nvim_create_autocmd
local group_general_settings = augroup("_general_settings", { clear = true })
-- Q to close
auto_cmd("FileType", {
command = "nnoremap <silent> <buffer> q :close<CR>",
pattern = { "qf", "help", "man", "lspinfo" },
group = group_general_settings,
})
-- Global formatoptions
auto_cmd("BufEnter", {
command = "set formatoptions=tcrnj",
group = group_general_settings,
})
|
include('organizer-lib')
function get_sets()
sets.JA = {}
sets.JA.Berserk = {body="Pumm. Lorica +1", back={ name="Cichol's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}}, feet="Agoge Calligae +1"}
sets.JA.Aggressor = {head="Pumm. Mask +1", body="Agoge Lorica +1"}
sets.JA.Warcry = {head="Agoge Mask +1"}
sets.JA['Blood Rage'] = {body="Boii Lorica +1"}
sets.JA['Mighty Strikes'] = {hands="Agoge Mufflers +1"}
sets.JA.Tomahawk = {ammo="Thr. Tomahawk",feet="Agoge Calligae +1"}
sets.JA.Provoke = sets.Enmity
sets.TP = {}
TP_mode = 'Acc'
sets.TP.Ragnarok = {main="Ragnarok"}
sets.TP.Ukonvasara = {main="Ukonvasara"}
sets.TP.Normal = {
sub="Bloodrain Strap",
ammo="Ginsen",
head="Flam. Zucchetto +1",
body="Flamma Korazin +1",
hands={ name="Odyssean Gauntlets", augments={'Attack+23','"Dbl.Atk."+5','STR+9','Accuracy+15',}},
legs="Jokushu Haidate",--{ name="Odyssean Cuisses", augments={'Attack+30','"Dbl.Atk."+5','AGI+6','Accuracy+10',}},
feet="Boii Calligae +1",
neck="Lissome Necklace",
waist="Windbuffet Belt +1",
left_ear="Telos Earring",
right_ear="Brutal Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back={ name="Cichol's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},
}
sets.TP.Acc = {
ammo="Seeth. Bomblet +1",
head="Flam. Zucchetto +1",
body="Flamma Korazin +1",
hands={ name="Odyssean Gauntlets", augments={'Attack+23','"Dbl.Atk."+5','STR+9','Accuracy+15',}},
legs="Jokushu Haidate",
feet="Flam. Gambieras +1",
neck="Combatant's Torque",
waist="Grunfeld Rope",
left_ear="Cessance Earring",
right_ear="Telos Earring",
left_ring="Ramuh Ring +1",
right_ring="Rajas Ring",
back={ name="Cichol's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},
}
sets.TP.DT = sets.DT
sets.Enmity = {
ammo="Iron Gobbet",
head="Pummeler's Mask +1",
body="Yorium Cuirass",
hands={ name="Yorium Gauntlets", augments={'Mag. Evasion+8','Enmity+10','Phys. dmg. taken -4%',}},
legs={ name="Odyssean Cuisses", augments={'Attack+9','Enmity+8',}},
feet={ name="Eschite Greaves", augments={'HP+80','Enmity+7','Phys. dmg. taken -4',}},
neck="Unmoving Collar +1",
waist="Goading Belt",
left_ear="Trux Earring",
right_ear="Pluto's Pearl",
left_ring="Eihwaz Ring",
right_ring="Provocare Ring",
back="Impassive Mantle",
}
sets.FC = {
ammo="Impatiens",
body={ name="Odyss. Chestplate", augments={'"Fast Cast"+6'}},
hands="Leyline Gloves",
feet={ name="Odyssean Greaves", augments={'Accuracy+17','"Fast Cast"+6','Attack+13',}},
neck="Orunmila's Torque",
left_ear="Loquac. Earring",
right_ear="Enchanter Earring +1",
left_ring="Rahab Ring",
right_ring="Weather. Ring +1",
}
sets.WS = {}
sets.WS['Raging Rush'] = {
sub="Bloodrain Strap",
ammo="Yetshila",
head={ name="Lustratio Cap +1", augments={'INT+35','STR+8','DEX+8',}},
body="Flamma Korazin +1",
hands={ name="Odyssean Gauntlets", augments={'Attack+23','"Dbl.Atk."+5','STR+9','Accuracy+15',}},
legs={ name="Valor. Hose", augments={'Accuracy+27','Crit. hit damage +5%','DEX+3',}},
feet={ name="Lustra. Leggings +1", augments={'HP+65','STR+15','DEX+15',}},
neck="Fotia Gorget",
waist="Metalsinger Belt",
left_ear="Brutal Earring",
right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +25',}},
left_ring="Begrudging Ring",
right_ring="Ifrit Ring +1",
back={ name="Cichol's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},
}
sets.WS["Ukko's Fury"] = {
sub="Bloodrain Strap",
ammo="Yetshila",
head={ name="Lustratio Cap +1", augments={'INT+35','STR+8','DEX+8',}},
body="Flamma Korazin +1",
hands={ name="Odyssean Gauntlets", augments={'Attack+23','"Dbl.Atk."+5','STR+9','Accuracy+15',}},
legs={ name="Valor. Hose", augments={'Accuracy+27','Crit. hit damage +5%','DEX+3',}},
feet={ name="Lustra. Leggings +1", augments={'HP+65','STR+15','DEX+15',}},
neck="Fotia Gorget",
waist="Windbuffet Belt +1",
left_ear="Brutal Earring",
right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +25',}},
left_ring="Begrudging Ring",
right_ring="Ifrit Ring +1",
back={ name="Cichol's Mantle", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}},
}
sets.WS["Fell Cleave"] = {
ammo="Seeth. Bomblet +1",
head={ name="Lustratio Cap +1", augments={'INT+35','STR+8','DEX+8',}},
body="Sulevia's Plate. +1",
hands={ name="Odyssean Gauntlets", augments={'Attack+23','"Dbl.Atk."+5','STR+9','Accuracy+15',}},
legs="Sulevi. Cuisses +1",
feet={ name="Lustra. Leggings +1", augments={'HP+65','STR+15','DEX+15',}},
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Ishvara Earring",
right_ear="Brutal Earring",
left_ring="Ifrit Ring +1",
right_ring="Rajas Ring",
back={ name="Cichol's Mantle", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}},
}
sets.WS.Resolution = {
ammo="Seeth. Bomblet +1",
head={ name="Argosy Celata +1", augments={'STR+12','DEX+12','Attack+20',}},
body="Flamma Korazin +1",
hands={ name="Argosy Mufflers +1", augments={'STR+12','DEX+12','Attack+20',}},
legs={ name="Argosy Breeches +1", augments={'STR+12','DEX+12','Attack+20',}},
feet={ name="Argosy Sollerets +1", augments={'STR+12','DEX+12','Attack+20',}},
neck="Fotia Gorget",
waist="Fotia Belt",
right_ear="Telos Earring",
left_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +25',}},
left_ring="Rajas Ring",
right_ring="Apate Ring",
back={ name="Cichol's Mantle", augments={'STR+20','Accuracy+20 Attack+20','"Dbl.Atk."+10',}},
Gavialis = S{'Lightsday','Earthsday','Windsday','Firesday','Lightningsday'},
}
sets.WS.Gavialis = {head="Gavialis Helm"}
sets.Idle = {
ammo="Staunch Tathlum",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +1",
hands={ name="Odyssean Gauntlets", augments={'Attack+29','Damage taken-4%','AGI+3',}},
legs="Sulevi. Cuisses +1",
feet="Hermes' Sandals +1",
neck="Loricate Torque +1",
waist="Flume Belt +1",
left_ear="Genmei Earring",
right_ear="Etiolation Earring",
left_ring={ name="Dark Ring", augments={'Breath dmg. taken -4%','Phys. dmg. taken -6%','Magic dmg. taken -5%',}},
right_ring="Defending Ring",
back="Impassive Mantle",
}
sets.DT = {
ammo="Staunch Tathlum",
head="Sulevia's Mask +1",
body="Sulevia's Plate. +1",
hands="Souveran Handschuhs +1",
legs="Sulevi. Cuisses +1",
feet={ name="Souveran Schuhs +1", augments={'HP+105','Enmity+9','Potency of "Cure" effect received +15%',}},
neck="Loricate Torque +1",
waist="Flume Belt +1",
left_ear="Genmei Earring",
right_ear="Etiolation Earring",
left_ring={ name="Dark Ring", augments={'Breath dmg. taken -4%','Phys. dmg. taken -6%','Magic dmg. taken -5%',}},
right_ring="Defending Ring",
back="Impassive Mantle",
}
sets.TP.DT = sets.DT
send_command('input /macro book 6;wait .1;input /macro set 2')
end
function precast(spell)
if spell.cast_time then
equip(sets.FC)
end
end
function midcast(spell)
if sets.JA[spell.english] then
equip(sets.JA[spell.english])
elseif sets.WS[spell.english] then
equip(sets.WS[spell.english])
if sets.WS[spell.english].Gavialis and sets.WS[spell.english].Gavialis[world.day] then
equip(sets.WS.Gavialis)
end
end
end
function aftercast(spell)
if player.status == 'Engaged' then
equip(sets.TP[TP_mode])
else
equip(sets.Idle)
end
end
function status_change(new,old)
if T{'Idle','Resting'}:contains(new) then
equip(sets.Idle)
elseif new == 'Engaged' then
equip(sets.TP[TP_mode])
end
end
function self_command(command)
if command == 'DT' then
equip(sets.DT)
elseif command == 'TP' then
if TP_mode=="Acc" then
TP_mode="Normal"
elseif TP_mode=="Normal" then
TP_mode="DT"
elseif TP_mode=="DT" then
TP_mode='Acc'
end
windower.add_to_chat('TP mode is now: '..TP_mode)
equip(sets.TP[TP_mode])
end
end |
ITEM.name = "Glenfiddich Whisky, 700ml"
ITEM.description = "A bottle with a clear golden yellow substance inside."
ITEM.longdesc = "Matured for at least 12 years in American and Spanish oak casks, this single malt Scotch whisky possesses Glenfiddich’s signature sweet and fruity essence, this single malt lingers with an aroma of pear and notes of butterscotch, cream and malt, dwelling on the palate with a subtle oak flavour. Glenfiddich 12 Year Old has been crafted to endure a long, smooth and mellow finish, ensuring it is always easily enjoyed."
ITEM.model = "models/weapons4/w_kona2.mdl"
ITEM.price = 3200
ITEM.width = 1
ITEM.height = 2
ITEM.weight = 0.230
ITEM.flatweight = 0.220
ITEM.thirst = -17
ITEM.quantity = 3
ITEM.isDrink = true
ITEM.alcohol = 20
ITEM.addictionStrongAlcohol = true
ITEM.sound = "stalkersound/inv_flask.mp3"
ITEM.img = ix.util.GetMaterial("vgui/hud/items/drink/spirit_3.png")
function ITEM:PopulateTooltipIndividual(tooltip)
ix.util.PropertyDesc(tooltip, "Strong Alcohol", Color(64, 224, 208))
end
ITEM:Hook("use", function(item)
item.player:EmitSound(item.sound or "items/battery_pickup.wav")
item.player:AddBuff("buff_radiationremoval", 10, { amount = 0.85 })
item.player:GetCharacter():SatisfyAddictions("ExpensiveAlcohol")
ix.chat.Send(item.player, "iteminternal", "takes a swig of their "..item.name..".", false)
end)
ITEM:DecideFunction()
|
-- BankFrame.lua
-- @Author : Dencer (tdaddon@163.com)
-- @Link : https://dengsir.github.io
-- @Date : 10/17/2019, 6:42:42 PM
---- LUA
local select = select
---- WOW
local CloseBankFrame = CloseBankFrame
---@type ns
local ns = select(2, ...)
local ContainerFrame = ns.UI.ContainerFrame
---@type tdBag2Bank
local BankFrame = ns.Addon:NewClass('UI.BankFrame', ContainerFrame)
function BankFrame:OnHide()
if not self.updatingManaged then
CloseBankFrame()
end
ContainerFrame.OnHide(self)
end
|
cpu = require('cpu'):new()
bit = require('bit')
function love.load(arg)
-- Load the rom specified by the first command line argument after the program name
cpu:read_rom(arg[2])
end
local dt2 = 0
function love.update(dt)
local opcode = cpu:read_instruction()
--print("0x" .. bit.tohex(cpu.program_counter-2, 3) .. " opcode: 0x" .. bit.tohex(opcode, 4))
cpu:run_instruction(opcode)
--cpu:print_state()
--cpu:dump_screen()
--cpu:print_keys()
--print("fps", 1/dt)
-- The cpu and delay timers should decrease by 1 at a rate of 60Hz
dt2 = dt2 + dt
if dt2 > 1/60 then
dt2 = 0
if cpu.delay_timer > 0 then
cpu.delay_timer = cpu.delay_timer - 1
end
if cpu.sound_timer > 0 then
cpu.sound_timer = cpu.sound_timer - 1
end
end
end
function love.draw()
local scale_x = 16
local scale_y = 16
for i=1,#cpu.screen_buffer do
local x = (i-1) % 64
local y = math.floor((i-1)/64)
local pixel = cpu.screen_buffer[i]
if pixel == 1 then
love.graphics.setColor(255,255,255)
else
love.graphics.setColor(0,0,0)
end
love.graphics.rectangle('fill', x*scale_x, y*scale_y, scale_x, scale_y)
end
end
function love.keypressed(key, scancode, isrepeat)
--print("--- Keypressed: ", key, scancode)
if key == '0' then
cpu:key_pressed(0x0)
elseif key == '1' then
cpu:key_pressed(0x1)
elseif key == '2' then
cpu:key_pressed(0x2)
elseif key == '3' then
cpu:key_pressed(0x3)
elseif key == '4' then
cpu:key_pressed(0x4)
elseif key == '5' then
cpu:key_pressed(0x5)
elseif key == '6' then
cpu:key_pressed(0x6)
elseif key == '7' then
cpu:key_pressed(0x7)
elseif key == '8' then
cpu:key_pressed(0x8)
elseif key == '9' then
cpu:key_pressed(0x9)
elseif key == 'a' then
cpu:key_pressed(0xa)
elseif key == 'b' then
cpu:key_pressed(0xb)
elseif key == 'c' then
cpu:key_pressed(0xc)
elseif key == 'd' then
cpu:key_pressed(0xd)
elseif key == 'e' then
cpu:key_pressed(0xe)
elseif key == 'f' then
cpu:key_pressed(0xf)
end
end
function love.keyreleased(key, scancode, isrepeat)
--print("--- Keyreleased: ", key, scancode)
if key == '0' then
cpu:key_released(0x0)
elseif key == '1' then
cpu:key_released(0x1)
elseif key == '2' then
cpu:key_released(0x2)
elseif key == '3' then
cpu:key_released(0x3)
elseif key == '4' then
cpu:key_released(0x4)
elseif key == '5' then
cpu:key_released(0x5)
elseif key == '6' then
cpu:key_released(0x6)
elseif key == '7' then
cpu:key_released(0x7)
elseif key == '8' then
cpu:key_released(0x8)
elseif key == '9' then
cpu:key_released(0x9)
elseif key == 'a' then
cpu:key_released(0xa)
elseif key == 'b' then
cpu:key_released(0xb)
elseif key == 'c' then
cpu:key_released(0xc)
elseif key == 'd' then
cpu:key_released(0xd)
elseif key == 'e' then
cpu:key_released(0xe)
elseif key == 'f' then
cpu:key_released(0xf)
end
end
|
require "source/utilities/queue"
-- TODO: is this a good name for this class?
CircularQueue = flower.class(Queue)
function CircularQueue:init(size, ...)
Queue.init(self, ...)
self.maxSize = size
end
function CircularQueue:push(...)
Queue.push(self, ...)
while self:size() > self.maxSize do
self:pop()
end
end |
require("utility")
if _VERSION ~= "Lua 5.1" then
loadstring = load
end
describe("serialize", function()
it("serializes a basic string", function()
local res = serialize('hello')
assert.equal('[[hello]]', res)
end)
it("serializes a string that includes ]]", function()
local res = serialize('he]]o')
assert.equal('[=[he]]o]=]', res)
end)
it("serializes an array of primitives", function()
local res = serialize({'hello', 'happy', 'people', 'everywhere', 42, false})
assert.equal('{[[hello]],[[happy]],[[people]],[[everywhere]],42,false}', res)
end)
it("serializes a pretty array", function()
local res = serialize({'hello', 'happy', 'people', 'everywhere', 42, false}, {pretty = true})
assert.equal([=[{
[[hello]],
[[happy]],
[[people]],
[[everywhere]],
42,
false
}]=], res)
end)
it("serializes a simple key value table", function()
local test_tbl = {foo='bar', [true]='candy', bar=42}
local res = serialize(test_tbl)
local res_tbl = loadstring_envcall("return " .. res)({})
assert.same(test_tbl, res_tbl)
end)
it("serializes a nested table", function()
local test_tbl = {foo='bar', bar={hello='world'}}
local res = serialize(test_tbl)
local res_tbl = loadstring_envcall("return " .. res)({})
assert.same(test_tbl, res_tbl)
end)
it("serializes a table with nested keys", function()
local test_tbl = {[{hello='world'}] = true, [1] = 'tree'}
local res = serialize(test_tbl)
local res_tbl = loadstring_envcall("return " .. res)({})
local found_tbl = false
for k, _ in pairs(res_tbl) do
if type(k) == 'table' then
assert.same({hello='world'}, k)
found_tbl = true
break
end
end
if not found_tbl then
assert("table key not found")
end
assert.equals(test_tbl[1], res_tbl[1])
end)
it("respects max_depth if set", function()
local test_tbl = {[{hello='world'}] = true, [1] = 'tree'}
local res = serialize(test_tbl, {max_depth=1})
assert.has.match('{...}', res, nil, true)
res = serialize(test_tbl, {max_depth=2})
assert.has_no.match('{...}', res, nil, true)
end)
it("detects cycles", function()
local test_tbl = {[{hello='world'}] = true, [1] = 'tree'}
test_tbl[2] = test_tbl
local res = serialize(test_tbl, {detect_cycles=true})
assert.has.match('<reference loop>', res, nil, true)
end)
it("doesn't report cycles with only max_depth", function()
local test_tbl = {[{hello='world'}] = true, [1] = 'tree'}
test_tbl[2] = test_tbl
local res = serialize(test_tbl, {max_depth=4})
assert.has_no.match('<reference loop>', res, nil, true)
assert.has.match('{...}', res, nil, true)
end)
end)
describe("array_join", function()
it("joins a basic array of numbers to a comma separated string", function()
local res = array_join({5,3,1,0})
assert.equals("5,3,1,0", res)
end)
it("joins a string array with custom separator", function()
local res = array_join({"a"," long"," hard","able"}," very")
assert.equals("a very long very hard veryable", res)
end)
it("converts a non-table to a string", function()
local res = array_join(1)
assert.equals("1", res)
end)
end)
|
local function lol(gfx)
local items = newItemList()
items:add(newEItem('score',17,18,gfx))
items:add(newEItem('score',38,15,gfx))
items:add(newEItem('shroom',47,15,gfx))
items:add(newEItem('goal',47,28,gfx))
items:add(newEItem('spawn',8,14,gfx))
items:add(newEItem('score',17,12,gfx))
items:add(newEItem('shroom',15,15,gfx))
local decs = {}
decs[1] = {2, 8, 15}
decs[2] = {2, 11, 15}
decs[3] = {2, 13, 15}
decs[4] = {2, 15, 15}
decs[5] = {2, 16, 12}
decs[6] = {2, 19, 12}
decs[7] = {2, 20, 14}
decs[8] = {2, 19, 18}
decs[9] = {2, 16, 18}
decs[10] = {2, 30, 14}
decs[11] = {2, 28, 15}
decs[12] = {2, 24, 15}
decs[13] = {2, 22, 15}
decs[14] = {2, 23, 22}
decs[15] = {2, 36, 15}
decs[16] = {2, 40, 15}
decs[17] = {2, 48, 15}
decs[18] = {2, 38, 10}
decs[19] = {2, 50, 10}
decs[20] = {2, 35, 10}
decs[21] = {2, 45, 28}
local nmys = {}
nmys[1] = {1, 25, 15}
nmys[2] = {1, 27, 15}
local lvl = {}
lvl[1] = {}
lvl[2] = {}
lvl[3] = {}
lvl[4] = {}
lvl[5] = {}
lvl[6] = {}
lvl[6][22] = 1
lvl[6][23] = 4
lvl[6][24] = 4
lvl[6][25] = 4
lvl[6][26] = 4
lvl[6][27] = 4
lvl[6][28] = 4
lvl[6][29] = 4
lvl[6][30] = 4
lvl[6][31] = 7
lvl[7] = {}
lvl[7][15] = 1
lvl[7][16] = 4
lvl[7][17] = 7
lvl[7][22] = 2
lvl[7][23] = 5
lvl[7][24] = 5
lvl[7][25] = 5
lvl[7][26] = 5
lvl[7][27] = 5
lvl[7][28] = 5
lvl[7][29] = 5
lvl[7][30] = 5
lvl[7][31] = 8
lvl[8] = {}
lvl[8][15] = 2
lvl[8][16] = 5
lvl[8][17] = 8
lvl[8][22] = 2
lvl[8][23] = 5
lvl[8][24] = 5
lvl[8][25] = 5
lvl[8][26] = 5
lvl[8][27] = 5
lvl[8][28] = 5
lvl[8][29] = 5
lvl[8][30] = 5
lvl[8][31] = 8
lvl[9] = {}
lvl[9][15] = 2
lvl[9][16] = 5
lvl[9][17] = 8
lvl[9][22] = 2
lvl[9][23] = 5
lvl[9][24] = 5
lvl[9][25] = 5
lvl[9][26] = 5
lvl[9][27] = 5
lvl[9][28] = 5
lvl[9][29] = 5
lvl[9][30] = 5
lvl[9][31] = 8
lvl[10] = {}
lvl[10][15] = 2
lvl[10][16] = 5
lvl[10][17] = 8
lvl[10][22] = 2
lvl[10][23] = 5
lvl[10][24] = 5
lvl[10][25] = 5
lvl[10][26] = 5
lvl[10][27] = 5
lvl[10][28] = 5
lvl[10][29] = 5
lvl[10][30] = 5
lvl[10][31] = 8
lvl[11] = {}
lvl[11][15] = 2
lvl[11][16] = 5
lvl[11][17] = 8
lvl[11][22] = 2
lvl[11][23] = 5
lvl[11][24] = 5
lvl[11][25] = 5
lvl[11][26] = 5
lvl[11][27] = 5
lvl[11][28] = 5
lvl[11][29] = 5
lvl[11][30] = 5
lvl[11][31] = 8
lvl[12] = {}
lvl[12][15] = 2
lvl[12][16] = 5
lvl[12][17] = 8
lvl[12][22] = 2
lvl[12][23] = 5
lvl[12][24] = 5
lvl[12][25] = 5
lvl[12][26] = 5
lvl[12][27] = 5
lvl[12][28] = 5
lvl[12][29] = 5
lvl[12][30] = 5
lvl[12][31] = 8
lvl[13] = {}
lvl[13][15] = 2
lvl[13][16] = 5
lvl[13][17] = 8
lvl[13][22] = 2
lvl[13][23] = 5
lvl[13][24] = 5
lvl[13][25] = 5
lvl[13][26] = 5
lvl[13][27] = 5
lvl[13][28] = 5
lvl[13][29] = 5
lvl[13][30] = 5
lvl[13][31] = 8
lvl[14] = {}
lvl[14][15] = 2
lvl[14][16] = 5
lvl[14][17] = 8
lvl[14][22] = 2
lvl[14][23] = 5
lvl[14][24] = 5
lvl[14][25] = 5
lvl[14][26] = 5
lvl[14][27] = 5
lvl[14][28] = 5
lvl[14][29] = 5
lvl[14][30] = 5
lvl[14][31] = 8
lvl[15] = {}
lvl[15][12] = 1
lvl[15][13] = 4
lvl[15][14] = 7
lvl[15][15] = 2
lvl[15][16] = 5
lvl[15][17] = 8
lvl[15][18] = 1
lvl[15][19] = 4
lvl[15][20] = 7
lvl[15][22] = 2
lvl[15][23] = 5
lvl[15][24] = 5
lvl[15][25] = 5
lvl[15][26] = 5
lvl[15][27] = 5
lvl[15][28] = 5
lvl[15][29] = 5
lvl[15][30] = 5
lvl[15][31] = 8
lvl[16] = {}
lvl[16][12] = 2
lvl[16][13] = 5
lvl[16][14] = 8
lvl[16][15] = 3
lvl[16][16] = 6
lvl[16][17] = 9
lvl[16][18] = 2
lvl[16][19] = 5
lvl[16][20] = 8
lvl[16][22] = 2
lvl[16][23] = 5
lvl[16][24] = 5
lvl[16][25] = 5
lvl[16][26] = 5
lvl[16][27] = 5
lvl[16][28] = 5
lvl[16][29] = 5
lvl[16][30] = 5
lvl[16][31] = 8
lvl[17] = {}
lvl[17][12] = 2
lvl[17][13] = 5
lvl[17][14] = 8
lvl[17][18] = 2
lvl[17][19] = 5
lvl[17][20] = 8
lvl[17][22] = 2
lvl[17][23] = 5
lvl[17][24] = 5
lvl[17][25] = 5
lvl[17][26] = 5
lvl[17][27] = 5
lvl[17][28] = 5
lvl[17][29] = 5
lvl[17][30] = 5
lvl[17][31] = 8
lvl[18] = {}
lvl[18][12] = 2
lvl[18][13] = 5
lvl[18][14] = 8
lvl[18][18] = 2
lvl[18][19] = 5
lvl[18][20] = 8
lvl[18][22] = 2
lvl[18][23] = 5
lvl[18][24] = 5
lvl[18][25] = 5
lvl[18][26] = 5
lvl[18][27] = 5
lvl[18][28] = 5
lvl[18][29] = 5
lvl[18][30] = 5
lvl[18][31] = 8
lvl[19] = {}
lvl[19][12] = 2
lvl[19][13] = 5
lvl[19][14] = 8
lvl[19][15] = 4
lvl[19][16] = 4
lvl[19][17] = 7
lvl[19][18] = 2
lvl[19][19] = 5
lvl[19][20] = 8
lvl[19][22] = 2
lvl[19][23] = 5
lvl[19][24] = 5
lvl[19][25] = 5
lvl[19][26] = 5
lvl[19][27] = 5
lvl[19][28] = 5
lvl[19][29] = 5
lvl[19][30] = 5
lvl[19][31] = 8
lvl[20] = {}
lvl[20][12] = 3
lvl[20][13] = 6
lvl[20][14] = 2
lvl[20][15] = 5
lvl[20][16] = 5
lvl[20][17] = 8
lvl[20][18] = 3
lvl[20][19] = 6
lvl[20][20] = 9
lvl[20][22] = 2
lvl[20][23] = 5
lvl[20][24] = 5
lvl[20][25] = 5
lvl[20][26] = 5
lvl[20][27] = 5
lvl[20][28] = 5
lvl[20][29] = 5
lvl[20][30] = 5
lvl[20][31] = 8
lvl[21] = {}
lvl[21][14] = 3
lvl[21][15] = 62
lvl[21][16] = 5
lvl[21][17] = 8
lvl[21][22] = 2
lvl[21][23] = 5
lvl[21][24] = 5
lvl[21][25] = 5
lvl[21][26] = 5
lvl[21][27] = 5
lvl[21][28] = 5
lvl[21][29] = 5
lvl[21][30] = 5
lvl[21][31] = 8
lvl[22] = {}
lvl[22][15] = 21
lvl[22][16] = 5
lvl[22][17] = 87
lvl[22][22] = 2
lvl[22][23] = 5
lvl[22][24] = 5
lvl[22][25] = 5
lvl[22][26] = 5
lvl[22][27] = 5
lvl[22][28] = 5
lvl[22][29] = 5
lvl[22][30] = 5
lvl[22][31] = 8
lvl[23] = {}
lvl[23][15] = 2
lvl[23][16] = 5
lvl[23][17] = 8
lvl[23][22] = 2
lvl[23][23] = 5
lvl[23][24] = 5
lvl[23][25] = 5
lvl[23][26] = 5
lvl[23][27] = 5
lvl[23][28] = 5
lvl[23][29] = 5
lvl[23][30] = 5
lvl[23][31] = 8
lvl[24] = {}
lvl[24][15] = 23
lvl[24][16] = 5
lvl[24][17] = 89
lvl[24][22] = 2
lvl[24][23] = 5
lvl[24][24] = 5
lvl[24][25] = 5
lvl[24][26] = 5
lvl[24][27] = 5
lvl[24][28] = 5
lvl[24][29] = 5
lvl[24][30] = 5
lvl[24][31] = 8
lvl[25] = {}
lvl[25][15] = 2
lvl[25][16] = 5
lvl[25][17] = 8
lvl[25][22] = 2
lvl[25][23] = 5
lvl[25][24] = 5
lvl[25][25] = 5
lvl[25][26] = 5
lvl[25][27] = 5
lvl[25][28] = 5
lvl[25][29] = 5
lvl[25][30] = 5
lvl[25][31] = 8
lvl[26] = {}
lvl[26][15] = 2
lvl[26][16] = 5
lvl[26][17] = 8
lvl[26][22] = 2
lvl[26][23] = 5
lvl[26][24] = 5
lvl[26][25] = 5
lvl[26][26] = 5
lvl[26][27] = 5
lvl[26][28] = 5
lvl[26][29] = 5
lvl[26][30] = 5
lvl[26][31] = 8
lvl[27] = {}
lvl[27][15] = 2
lvl[27][16] = 5
lvl[27][17] = 8
lvl[27][22] = 2
lvl[27][23] = 5
lvl[27][24] = 5
lvl[27][25] = 5
lvl[27][26] = 5
lvl[27][27] = 5
lvl[27][28] = 5
lvl[27][29] = 5
lvl[27][30] = 5
lvl[27][31] = 8
lvl[28] = {}
lvl[28][15] = 2
lvl[28][16] = 5
lvl[28][17] = 8
lvl[28][22] = 2
lvl[28][23] = 5
lvl[28][24] = 5
lvl[28][25] = 5
lvl[28][26] = 5
lvl[28][27] = 5
lvl[28][28] = 5
lvl[28][29] = 5
lvl[28][30] = 5
lvl[28][31] = 8
lvl[29] = {}
lvl[29][14] = 1
lvl[29][15] = 42
lvl[29][16] = 5
lvl[29][17] = 8
lvl[29][22] = 2
lvl[29][23] = 5
lvl[29][24] = 5
lvl[29][25] = 5
lvl[29][26] = 5
lvl[29][27] = 5
lvl[29][28] = 5
lvl[29][29] = 5
lvl[29][30] = 5
lvl[29][31] = 8
lvl[30] = {}
lvl[30][14] = 2
lvl[30][15] = 5
lvl[30][16] = 5
lvl[30][17] = 8
lvl[30][22] = 2
lvl[30][23] = 5
lvl[30][24] = 5
lvl[30][25] = 5
lvl[30][26] = 5
lvl[30][27] = 5
lvl[30][28] = 5
lvl[30][29] = 5
lvl[30][30] = 5
lvl[30][31] = 8
lvl[31] = {}
lvl[31][14] = 3
lvl[31][15] = 6
lvl[31][16] = 6
lvl[31][17] = 9
lvl[31][22] = 2
lvl[31][23] = 5
lvl[31][24] = 5
lvl[31][25] = 5
lvl[31][26] = 5
lvl[31][27] = 5
lvl[31][28] = 5
lvl[31][29] = 5
lvl[31][30] = 5
lvl[31][31] = 8
lvl[32] = {}
lvl[32][22] = 2
lvl[32][23] = 5
lvl[32][24] = 5
lvl[32][25] = 5
lvl[32][26] = 5
lvl[32][27] = 5
lvl[32][28] = 5
lvl[32][29] = 5
lvl[32][30] = 5
lvl[32][31] = 8
lvl[33] = {}
lvl[33][22] = 2
lvl[33][23] = 5
lvl[33][24] = 5
lvl[33][25] = 5
lvl[33][26] = 5
lvl[33][27] = 5
lvl[33][28] = 5
lvl[33][29] = 5
lvl[33][30] = 5
lvl[33][31] = 8
lvl[34] = {}
lvl[34][10] = 1
lvl[34][11] = 4
lvl[34][12] = 4
lvl[34][13] = 4
lvl[34][14] = 4
lvl[34][15] = 4
lvl[34][16] = 4
lvl[34][17] = 7
lvl[34][22] = 2
lvl[34][23] = 5
lvl[34][24] = 5
lvl[34][25] = 5
lvl[34][26] = 5
lvl[34][27] = 5
lvl[34][28] = 5
lvl[34][29] = 5
lvl[34][30] = 5
lvl[34][31] = 8
lvl[35] = {}
lvl[35][10] = 2
lvl[35][11] = 5
lvl[35][12] = 5
lvl[35][13] = 5
lvl[35][14] = 5
lvl[35][15] = 5
lvl[35][16] = 5
lvl[35][17] = 8
lvl[35][22] = 2
lvl[35][23] = 5
lvl[35][24] = 5
lvl[35][25] = 5
lvl[35][26] = 5
lvl[35][27] = 5
lvl[35][28] = 5
lvl[35][29] = 5
lvl[35][30] = 5
lvl[35][31] = 8
lvl[36] = {}
lvl[36][10] = 2
lvl[36][11] = 5
lvl[36][12] = 68
lvl[36][13] = 6
lvl[36][14] = 6
lvl[36][15] = 62
lvl[36][16] = 5
lvl[36][17] = 8
lvl[36][22] = 23
lvl[36][23] = 5
lvl[36][24] = 5
lvl[36][25] = 5
lvl[36][26] = 5
lvl[36][27] = 5
lvl[36][28] = 5
lvl[36][29] = 5
lvl[36][30] = 5
lvl[36][31] = 8
lvl[37] = {}
lvl[37][10] = 2
lvl[37][11] = 5
lvl[37][12] = 8
lvl[37][15] = 2
lvl[37][16] = 5
lvl[37][17] = 8
lvl[37][22] = 2
lvl[37][23] = 5
lvl[37][24] = 5
lvl[37][25] = 5
lvl[37][26] = 5
lvl[37][27] = 5
lvl[37][28] = 5
lvl[37][29] = 5
lvl[37][30] = 5
lvl[37][31] = 8
lvl[38] = {}
lvl[38][10] = 2
lvl[38][11] = 5
lvl[38][12] = 8
lvl[38][15] = 2
lvl[38][16] = 5
lvl[38][17] = 8
lvl[38][22] = 2
lvl[38][23] = 5
lvl[38][24] = 5
lvl[38][25] = 5
lvl[38][26] = 5
lvl[38][27] = 5
lvl[38][28] = 5
lvl[38][29] = 5
lvl[38][30] = 5
lvl[38][31] = 8
lvl[39] = {}
lvl[39][10] = 2
lvl[39][11] = 5
lvl[39][12] = 8
lvl[39][15] = 2
lvl[39][16] = 5
lvl[39][17] = 8
lvl[39][22] = 2
lvl[39][23] = 5
lvl[39][24] = 5
lvl[39][25] = 5
lvl[39][26] = 5
lvl[39][27] = 5
lvl[39][28] = 5
lvl[39][29] = 5
lvl[39][30] = 5
lvl[39][31] = 8
lvl[40] = {}
lvl[40][10] = 2
lvl[40][11] = 5
lvl[40][12] = 48
lvl[40][13] = 4
lvl[40][14] = 4
lvl[40][15] = 24
lvl[40][16] = 5
lvl[40][17] = 8
lvl[40][22] = 2
lvl[40][23] = 5
lvl[40][24] = 5
lvl[40][25] = 5
lvl[40][26] = 5
lvl[40][27] = 5
lvl[40][28] = 5
lvl[40][29] = 5
lvl[40][30] = 5
lvl[40][31] = 8
lvl[41] = {}
lvl[41][10] = 2
lvl[41][11] = 5
lvl[41][12] = 5
lvl[41][13] = 5
lvl[41][14] = 5
lvl[41][15] = 5
lvl[41][16] = 5
lvl[41][17] = 8
lvl[41][22] = 2
lvl[41][23] = 5
lvl[41][24] = 5
lvl[41][25] = 5
lvl[41][26] = 5
lvl[41][27] = 5
lvl[41][28] = 5
lvl[41][29] = 5
lvl[41][30] = 5
lvl[41][31] = 8
lvl[42] = {}
lvl[42][10] = 3
lvl[42][11] = 6
lvl[42][12] = 6
lvl[42][13] = 6
lvl[42][14] = 6
lvl[42][15] = 6
lvl[42][16] = 6
lvl[42][17] = 9
lvl[42][22] = 2
lvl[42][23] = 5
lvl[42][24] = 5
lvl[42][25] = 5
lvl[42][26] = 5
lvl[42][27] = 5
lvl[42][28] = 5
lvl[42][29] = 5
lvl[42][30] = 5
lvl[42][31] = 8
lvl[43] = {}
lvl[43][22] = 2
lvl[43][23] = 5
lvl[43][24] = 5
lvl[43][25] = 5
lvl[43][26] = 5
lvl[43][27] = 5
lvl[43][28] = 5
lvl[43][29] = 5
lvl[43][30] = 5
lvl[43][31] = 8
lvl[44] = {}
lvl[44][10] = 1
lvl[44][11] = 4
lvl[44][12] = 4
lvl[44][13] = 4
lvl[44][14] = 47
lvl[44][15] = 4
lvl[44][16] = 4
lvl[44][17] = 7
lvl[44][22] = 2
lvl[44][23] = 5
lvl[44][24] = 5
lvl[44][25] = 5
lvl[44][26] = 5
lvl[44][27] = 5
lvl[44][28] = 5
lvl[44][29] = 5
lvl[44][30] = 5
lvl[44][31] = 8
lvl[45] = {}
lvl[45][10] = 2
lvl[45][11] = 5
lvl[45][12] = 5
lvl[45][13] = 5
lvl[45][14] = 5
lvl[45][15] = 5
lvl[45][16] = 5
lvl[45][17] = 8
lvl[45][22] = 2
lvl[45][23] = 5
lvl[45][24] = 5
lvl[45][25] = 5
lvl[45][26] = 86
lvl[45][27] = 6
lvl[45][28] = 62
lvl[45][29] = 5
lvl[45][30] = 5
lvl[45][31] = 8
lvl[46] = {}
lvl[46][10] = 2
lvl[46][11] = 5
lvl[46][12] = 68
lvl[46][13] = 6
lvl[46][14] = 69
lvl[46][15] = 62
lvl[46][16] = 5
lvl[46][17] = 8
lvl[46][22] = 23
lvl[46][23] = 5
lvl[46][24] = 5
lvl[46][25] = 5
lvl[46][26] = 8
lvl[46][28] = 2
lvl[46][29] = 5
lvl[46][30] = 5
lvl[46][31] = 8
lvl[47] = {}
lvl[47][10] = 2
lvl[47][11] = 5
lvl[47][12] = 8
lvl[47][15] = 2
lvl[47][16] = 5
lvl[47][17] = 8
lvl[47][22] = 2
lvl[47][23] = 5
lvl[47][24] = 5
lvl[47][25] = 5
lvl[47][26] = 8
lvl[47][28] = 2
lvl[47][29] = 5
lvl[47][30] = 5
lvl[47][31] = 8
lvl[48] = {}
lvl[48][10] = 2
lvl[48][11] = 5
lvl[48][12] = 8
lvl[48][15] = 2
lvl[48][16] = 5
lvl[48][17] = 8
lvl[48][22] = 2
lvl[48][23] = 5
lvl[48][24] = 5
lvl[48][25] = 5
lvl[48][26] = 48
lvl[48][27] = 4
lvl[48][28] = 42
lvl[48][29] = 5
lvl[48][30] = 5
lvl[48][31] = 8
lvl[49] = {}
lvl[49][10] = 2
lvl[49][11] = 5
lvl[49][12] = 48
lvl[49][13] = 4
lvl[49][14] = 4
lvl[49][15] = 24
lvl[49][16] = 5
lvl[49][17] = 8
lvl[49][22] = 2
lvl[49][23] = 5
lvl[49][24] = 5
lvl[49][25] = 5
lvl[49][26] = 5
lvl[49][27] = 5
lvl[49][28] = 5
lvl[49][29] = 5
lvl[49][30] = 5
lvl[49][31] = 87
lvl[50] = {}
lvl[50][10] = 2
lvl[50][11] = 5
lvl[50][12] = 5
lvl[50][13] = 5
lvl[50][14] = 5
lvl[50][15] = 5
lvl[50][16] = 5
lvl[50][17] = 8
lvl[50][22] = 2
lvl[50][23] = 5
lvl[50][24] = 5
lvl[50][25] = 5
lvl[50][26] = 5
lvl[50][27] = 5
lvl[50][28] = 5
lvl[50][29] = 5
lvl[50][30] = 5
lvl[50][31] = 8
lvl[51] = {}
lvl[51][10] = 3
lvl[51][11] = 6
lvl[51][12] = 6
lvl[51][13] = 6
lvl[51][14] = 6
lvl[51][15] = 6
lvl[51][16] = 6
lvl[51][17] = 9
lvl[51][22] = 2
lvl[51][23] = 5
lvl[51][24] = 5
lvl[51][25] = 5
lvl[51][26] = 5
lvl[51][27] = 5
lvl[51][28] = 5
lvl[51][29] = 5
lvl[51][30] = 5
lvl[51][31] = 8
lvl[52] = {}
lvl[52][22] = 3
lvl[52][23] = 6
lvl[52][24] = 6
lvl[52][25] = 6
lvl[52][26] = 6
lvl[52][27] = 6
lvl[52][28] = 6
lvl[52][29] = 6
lvl[52][30] = 6
lvl[52][31] = 9
lvl[53] = {}
lvl[54] = {}
lvl[55] = {}
lvl[56] = {}
lvl[57] = {}
lvl[58] = {}
lvl[59] = {}
lvl[60] = {}
lvl[61] = {}
lvl[62] = {}
lvl[63] = {}
lvl[64] = {}
lvl[65] = {}
lvl[66] = {}
lvl[67] = {}
lvl[68] = {}
lvl[69] = {}
lvl[70] = {}
lvl[71] = {}
lvl[72] = {}
lvl[73] = {}
lvl[74] = {}
lvl[75] = {}
lvl[76] = {}
lvl[77] = {}
lvl[78] = {}
lvl[79] = {}
lvl[80] = {}
lvl[81] = {}
lvl[82] = {}
lvl[83] = {}
lvl[84] = {}
lvl[85] = {}
lvl[86] = {}
lvl[87] = {}
lvl[88] = {}
lvl[89] = {}
lvl[90] = {}
lvl[91] = {}
lvl[92] = {}
lvl[93] = {}
lvl[94] = {}
lvl[95] = {}
lvl[96] = {}
lvl[97] = {}
lvl[98] = {}
lvl[99] = {}
lvl[100] = {}
return lvl,items,decs,nmys
end
return lol |
function create(name, id)
local obj = {name = name, id = id}
function obj:SetName(name)
self.name = name
end
function obj:GetName()
return self.name
end
function obj:SetId(id)
self.id = id
end
function obj:GetId()
return self.id
end
return obj
end
local myCreate = create("sam",001)
for k, v in pairs(myCreate) do
print(k,"=>",v)
end
print("myCreate's name:", myCreate:GetName(), "myCreate's id:", myCreate:GetId())
myCreate:SetId(100)
myCreate:SetName("hello kity")
print("myCreate's name:",myCreate:GetName(), "myCreate's id:", myCreate:GetId())
local Student = {id=100, name="Tony"}
function Student:create(obj)
obj = obj or {}
setmetatable(obj, self)
self.__index = self
return obj
end
function Student:toString()
local s = "name:"..self.name .. " id:" .. self.id
return s
end
print(Student:toString())
student1 = Student:create({id=200,name="Tom"})
print(student1:toString()) |
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
function init_screen(screen)
-- Set up a vertical wibar for tasklist
screen.monocle_tasklist = awful.wibar({
position = "left",
screen = screen,
visible = false,
width = 200,
})
screen.monocle_tasklist:setup {
layout = wibox.layout.stack,
{
awful.widget.tasklist {
screen = screen,
filter = awful.widget.tasklist.filter.currenttags,
buttons = gears.table.join(
awful.button({}, 1, function (c)
c:emit_signal(
"request::activate",
"tasklist",
{ raise = true }
)
end),
awful.button({}, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({}, 5, function ()
awful.client.focus.byidx(-1)
end)
),
layout = wibox.layout.fixed.vertical(),
widget_template = {
{
{
id = "text_role",
widget = wibox.widget.textbox,
},
widget = wibox.container.margin,
top = 5,
bottom = 5,
},
id = "background_role",
widget = wibox.container.background,
},
},
widget = wibox.container.margin,
top = 50,
},
}
for _, t in ipairs(screen.tags) do
t.display_mono = true
local callback = function(tag)
screen.monocle_tasklist.visible = (tag.display_mono and tag.layout == awful.layout.suit.max)
end
t:connect_signal("property::selected", callback)
t:connect_signal("property::display_mono", callback)
t:connect_signal("property::layout", callback)
end
end
return {
init_screen = init_screen,
}
|
GLOBAL.setfenv(1, GLOBAL)
-- Fix active_item's stack-lost when swimming
local Inventory = require("components/inventory")
function Inventory:DropActiveItem()
if self.activeitem then
local active_item = self:DropItem(self.activeitem, true) -- Do whole stack
self:SetActiveItem(nil)
return active_item
end
end
|
---------------------------------------------------------------------------
--- This module has been moved to `ruled.client`
--
-- @author Julien Danjou <julien@danjou.info>
-- @copyright 2009 Julien Danjou
-- @module awful.rules
---------------------------------------------------------------------------
local gdebug = require("gears.debug")
return gdebug.deprecate_class(
require("ruled.client"),
"awful.rules",
"ruled.client",
{ deprecated_in = 5}
)
|
-- Written by Rabia Alhaffar in 5/September/2020
-- icecreamboy assets manager
function load_assets()
cone = rl.LoadTexture("resources/images/cone.png")
ball = rl.LoadTexture("resources/images/ball.png")
street = rl.LoadTexture("resources/images/street.png")
raylua = rl.LoadTexture("resources/images/raylua.png")
heart = rl.LoadTexture("resources/images/heart.png")
money_image = rl.LoadTexture("resources/images/money.png")
money_sound = rl.LoadSound("resources/audio/money.wav")
select_sound = rl.LoadSound("resources/audio/select.wav")
lose_sound = rl.LoadSound("resources/audio/lose.wav")
add_sound = rl.LoadSound("resources/audio/add.wav")
addball_sound = rl.LoadSound("resources/audio/select2.wav")
end
function unload_assets()
rl.UnloadTexture(cone)
rl.UnloadTexture(ball)
rl.UnloadTexture(street)
rl.UnloadTexture(raylua)
rl.UnloadTexture(heart)
rl.UnloadTexture(money_image)
rl.UnloadSound(money_sound)
rl.UnloadSound(select_sound)
rl.UnloadSound(lose_sound)
rl.UnloadSound(add_sound)
rl.UnloadTexture(man1.happy)
rl.UnloadTexture(man1.normal)
rl.UnloadTexture(man1.sad)
rl.UnloadTexture(girl1.happy)
rl.UnloadTexture(girl1.normal)
rl.UnloadTexture(girl1.sad)
rl.UnloadSound(addball_sound)
end |
local fn = require('distant.fn')
local Driver = require('spec.e2e.driver')
describe('fn', function()
local driver
before_each(function()
driver = Driver:setup()
end)
after_each(function()
driver:teardown()
end)
describe('system_info', function()
it('should report back information about remote machine', function()
local err, res = fn.system_info()
assert(not err, err)
-- TODO: Can we verify this any further? We'd need
-- to make assumptions about the remote machine
assert.is.truthy(res)
end)
end)
end)
|
local oldBuildDamageTypeRules = debug.getupvaluex(GetDamageByType, "BuildDamageTypeRules")
local kMachineGunStructureDamageScalar = 1.25
local function MultiplyFlameAble(target, attacker, doer, damage, armorFractionUsed, healthPerArmor, damageType)
if target.GetIsFlameAble and target:GetIsFlameAble(damageType) then
local multi = kFlameableMultiplier
if target.GetIsFlameableMultiplier then
-- multi = target:GetIsFlameableMultiplier()
-- Modify GetIsFlameableMultiplier call to pass the doer
multi = target:GetIsFlameableMultiplier(doer)
end
damage = damage * multi
end
return damage, armorFractionUsed, healthPerArmor
end
local function BuildDamageTypeRules()
oldBuildDamageTypeRules()
local oldMultiplyForMachineGun = kDamageTypeRules[kDamageType.MachineGun][1]
local function MultiplyForMachineGun(target, _, _, damage, armorFractionUsed, healthPerArmor, damageType)
if target.GetReceivesStructuralDamage and target:GetReceivesStructuralDamage(damageType) then
return damage * kMachineGunStructureDamageScalar, armorFractionUsed, healthPerArmor
else
return oldMultiplyForMachineGun(target, nil, nil, damage, armorFractionUsed, healthPerArmor)
end
end
kDamageTypeRules[kDamageType.Flame][1] = MultiplyFlameAble
kDamageTypeRules[kDamageType.MachineGun][1] = MultiplyForMachineGun
end
debug.setupvaluex(GetDamageByType, "BuildDamageTypeRules", BuildDamageTypeRules)
local function ApplyNeurotoxinHit(attacker, target, tickDamage, neuroLevel)
local dotMarker = CreateEntity(DotMarker.kMapName, target:GetOrigin(), attacker:GetTeamNumber())
dotMarker:SetTechId(kTechId.Neurotoxin)
dotMarker:SetDamageType(kDamageType.Gas)
dotMarker:SetLifeTime(1 + neuroLevel)
dotMarker:SetDamage(tickDamage)
dotMarker:SetRadius(0)
dotMarker:SetDamageIntervall(1)
dotMarker:SetDotMarkerType(DotMarker.kType.SingleTarget)
dotMarker:SetTargetEffectName("poison_dart_trail")
dotMarker:SetDeathIconIndex(kDeathMessageIcon.Neurotoxin)
dotMarker:SetIsAffectedByCrush(false)
dotMarker:SetOwner(attacker)
dotMarker:SetAttachToTarget(target, target:GetOrigin())
dotMarker:SetDestroyCondition(
function(self, target)
return not target:GetIsAlive()
end
)
end
--Utility function to apply chamber-upgraded modifications to alien damage
--Note: this should _always_ be called BEFORE damage-type specific modifications are done (i.e. Light vs Normal vs Structural, etc)
function NS2Gamerules_GetUpgradedAlienDamage( target, attacker, doer, damage, armorFractionUsed, _, damageType )
if not doer then return damage, armorFractionUsed end
local isAffectedByCrush = doer.GetIsAffectedByCrush and attacker:GetHasUpgrade( kTechId.Crush ) and doer:GetIsAffectedByCrush()
local isAffectedByVampirism = doer.GetVampiricLeechScalar and attacker:GetHasUpgrade( kTechId.Vampirism )
local isAffectedByFocus = doer.GetIsAffectedByFocus and attacker:GetHasUpgrade( kTechId.Focus ) and doer:GetIsAffectedByFocus()
local isAffectedByNeurotoxin = doer.GetIsAffectedByNeurotoxin and attacker:GetHasUpgrade(kTechId.Neurotoxin) and doer:GetIsAffectedByNeurotoxin()
if isAffectedByCrush then --Crush
local crushLevel = attacker:GetSpurLevel()
if crushLevel > 0 then
if target:isa("Exo") or target:isa("Exosuit") or target.GetReceivesStructuralDamage and target:GetReceivesStructuralDamage(damageType) then
damage = damage + ( damage * ( crushLevel * kAlienCrushDamagePercentByLevel ) )
elseif target:isa("Player") then
armorFractionUsed = kBaseArmorUseFraction + ( crushLevel * kAlienCrushDamagePercentByLevel )
end
end
end
if Server then
-- Vampirism
local targetValidForVamp = true
if target.GetCanVampirismBeUsedOn then
targetValidForVamp = target:GetCanVampirismBeUsedOn()
end
if isAffectedByVampirism and targetValidForVamp then
local vampirismLevel = attacker:GetShellLevel()
if vampirismLevel > 0 then
if attacker:GetIsHealable() and target:isa("Player") then
local scalar = doer:GetVampiricLeechScalar()
if scalar > 0 then
local focusBonus = 1
if isAffectedByFocus then
focusBonus = 1 + doer:GetFocusAttackCooldown()
end
local maxHealth = attacker:GetMaxHealth()
local leechedHealth = maxHealth * vampirismLevel * scalar * focusBonus
attacker:AddOverShield(leechedHealth)
end
end
end
end
-- Neurotoxin
local targetValid = target:isa("Player") and target:GetTeamNumber() ~= attacker:GetTeamNumber()
if isAffectedByNeurotoxin and targetValid then
local neuroLevel = attacker:GetVeilLevel()
local tickDamage = doer:GetNeurotoxinTickDamage()
if neuroLevel > 0 and tickDamage > 0 then
ApplyNeurotoxinHit(attacker, target, tickDamage, neuroLevel)
end
end
end
--!!!Note: if more than damage and armor fraction modified, be certain the calling-point of this function is updated
return damage, armorFractionUsed
end
local oldGetUpgradedDamage = NS2Gamerules_GetUpgradedDamage
function NS2Gamerules_GetUpgradedDamage(attacker, doer, damage, damageType, hitPoint)
if doer.kMapName == "swipe" and attacker:GetHasThreeHives() then
return damage * kAdvancedSwipeDamageScalar
end
return oldGetUpgradedDamage(attacker, doer, damage, damageType, hitPoint)
end
|
--Thanks to Blasteh for gmod update the fix and nifnat for spectate fix!
-- Send required files to client
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
-- Include needed files
include("shared.lua")
|
--xChair--
--[[
MODES
----------
DAMAGE = 'Q'
HAT THIEF = 'E'
BUILD = 'R'
EXPLODE = 'T'
TELEPORT = 'Z'
HEAL = 'H'
BOOST = 'F'
--]]
plr = game.Players.LocalPlayer
char = plr.Character
local mouse = plr:GetMouse()
mode = 'damage'
local human = char.Humanoid
char.Animate:Destroy()
running = false
human.Running:connect(function(speed)
if speed <= 0 then
running = false
else
running = true
end
end)
local function weldBetween(a, b)
local weld = Instance.new("ManualWeld")
weld.Part0 = a
weld.Part1 = b
weld.C0 = CFrame.new()
weld.C1 = b.CFrame:inverse() * a.CFrame
weld.Parent = a
return weld;
end
function takehats(char)
for i,v in pairs(char:GetChildren()) do
if v.ClassName == "Hat" then
v.Parent = game.Players.LocalPlayer.Character
end
end
end
char.Torso.Transparency = 1
--------------------------ARM 1-----------------------------------------
local rawc = char["Right Arm"]:clone()
char["Right Arm"]:Destroy()
rawc.Parent = char
local RAW = weldBetween(char.Torso, char["Right Arm"])
RAW.C1 = CFrame.new(-1.5, 0, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
--------------------------LEG 1-----------------------------------------
local rlwc = char["Right Leg"]:clone()
char["Right Leg"]:Destroy()
rlwc.Parent = char
local RLW = weldBetween(char.Torso, char["Right Leg"])
RLW.C1 = CFrame.new(-1.5, 0, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
--------------------------LEG 2-----------------------------------------
local llwc = char["Left Leg"]:clone()
char["Left Leg"]:Destroy()
llwc.Parent = char
local LLW = weldBetween(char.Torso, char["Left Leg"])
LLW.C1 = CFrame.new(-1.5, 0, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
----------------------------ARM 2---------------------------------------
local lawc = char["Left Arm"]:clone()
char["Left Arm"]:Destroy()
lawc.Parent = char
local LAW = weldBetween(char.Torso, char["Left Arm"])
LAW.C1 = CFrame.new(1.5, 0, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
-----------------------------HEAD----------------------------------
local heaw = weldBetween(char.Torso, char.Head)
-----------------------------------------------------------------------
Tween = function(Weld, Stop, Step,a)
ypcall(function()
local func = function()
local Start = Weld.C1
local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
local Stop = Stop
local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
for i = 0, 1, Step or .1 do
Weld.C1 = CFrame.new( (Start.p.X * (1 - i)) + (Stop.p.X * i),
(Start.p.Y * (1 - i)) + (Stop.p.Y * i),
(Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
(X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),
(Z1 * (1 - i)) + (Z2 * i) )
wait()
end
Weld.C1 = Stop
end
if a then coroutine.wrap(func)() else func() end
end)
end
local Seat = Instance.new("Part", char)
Seat:BreakJoints()
Seat.TopSurface = "Smooth"
Seat.Name = 'Seat'
Seat.BottomSurface = "Smooth"
Seat.FormFactor = "Custom" Seat.CanCollide = false
Seat.BrickColor = BrickColor.new("Medium stone grey")
Seat.Size = Vector3.new(3.71499968, 0.77700007, 3.04400015)
local Seatweld = Instance.new("ManualWeld")
Seatweld.Part0 = char["Torso"]
Seatweld.Part1 = Seat Seatweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Seatweld.C1 = CFrame.new(-0.436842084, 1.27730489, 0.478226662, 0.998842537, 0, 0.0480999425, 0, 1, 0, -0.0480999425, 0, 0.998842537)
Seatweld.Parent = char["Torso"]
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(0.568000019, 1.0990001, 0.495000124)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.54849625, -0.737998962, 1.29749203, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(0.568000019, 1.0990001, 0.50300014)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-1.5555079, -0.737998962, 1.26849937, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(0.788000047, 0.200000048, 3.19300008)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-1.38551331, -1.24449921, -0.0904994011, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(0.788000047, 0.200000048, 3.25000024)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.37048721, -1.24449921, -0.0620036125, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(3.60299969, 2.34500003, 0.918000042)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(0.0589904785, -1.5719986, -1.23900461, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(3.62799978, 0.34800005, 0.917999983)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(0.0454930663, -2.93249893, -1.23600054, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("SpecialMesh",Extra)
ExtraMesh.MeshId = ""
ExtraMesh.MeshType = Enum.MeshType.Torso ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("WedgePart", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(3.70700002, 0.75999999, 1.1500001)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(0.0117220879, -0.027305603, 2.04488182, 0.999991775, 0, 0.00417119637, 0, 1, 0, -0.00417116284, 0, 0.999991715)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(0.200000003, 0.921000123, 0.634000063)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.75548577, 0.794002533, 2.21600151, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(0.200000003, 0.921000123, 0.634000063)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-1.68250918, 0.794002533, 2.21599579, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(0.296999991, 0.22600013, 0.634000063)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.80398464, 1.14150238, 2.21599388, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(0.296999991, 0.22600013, 0.634000063)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-1.72101617, 1.14150238, 2.2159977, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(1.43400002, 0.232000113, 1.14300013)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.43379831, -1.95537186, 2.23299217, 0.0168066788, 0.999856353, 5.82076609e-010, -0.999856353, 0.0168066788, 6.33299351e-008, 0, 0, 1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Really black")
Extra.Size = Vector3.new(1.43400002, 0.232000113, 0.829000115)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.43379307, -2.00535631, 2.23299789, 0.0168066509, 0.999854743, 5.82076609e-010, -0.999854743, 0.0168066509, 6.33299351e-008, 0, 0, 1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(1.43400002, 0.200000003, 1.14300013)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.38780296, -1.85258067, -2.23299694, 0.0168067049, 0.999858499, 4.07453626e-010, 0.999858499, -0.0168067217, 8.94069672e-008, 8.94069672e-008, -1.46930046e-009, -1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Really black")
Extra.Size = Vector3.new(1.43400002, 0.200000003, 0.829000115)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.3878001, -1.90258074, -2.23299599, 0.0168067086, 0.999858558, 9.89530236e-010, 0.999858558, -0.0168067235, 1.2665987e-007, 8.94069672e-008, -1.46930046e-009, -1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(4.34100008, 0.573000073, 4.08699989)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-0.117188454, -2.12586164, -0.534004211, 0.016806718, 0.999858737, 5.82076609e-010, -0.999858737, 0.0168067198, -1.11758709e-008, 0, 0, 1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Really black")
Extra.Size = Vector3.new(4.34100008, 0.573000073, 3.773)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-0.11719501, -2.17586231, -0.534002304, 0.0168067198, 0.999858797, 5.82076609e-010, -0.999858797, 0.0168067198, 0, 0, 0, 1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Medium stone grey")
Extra.Size = Vector3.new(4.34100008, 0.573000073, 4.08699989)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-0.117194057, -2.01313376, 0.534003735, 0.0168067031, 0.999856472, 5.82076609e-010, 0.999856472, -0.0168066565, 5.21540642e-008, 8.94069672e-008, -1.46929091e-009, -1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Really black")
Extra.Size = Vector3.new(4.34100008, 0.573000073, 3.773)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-0.117191076, -2.0631218, 0.534003735, 0.0168067031, 0.999856532, 5.82076609e-010, 0.999856532, -0.0168066584, 5.21540642e-008, 8.94069672e-008, -1.46929091e-009, -1)
Extraweld.Parent = Extra
local ExtraMesh = Instance.new("CylinderMesh",Extra)
ExtraMesh.Name = "Mesh"
ExtraMesh.Offset = Vector3.new(0, 0, 0)
ExtraMesh.Scale = Vector3.new(1, 1, 1)
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Dark stone grey")
Extra.Size = Vector3.new(0.413999707, 0.394999981, 1.97000003)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(1.54100084, -2.53600311, -2.32900763, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Extra = Instance.new("Part", char)
Extra:BreakJoints()
Extra.TopSurface = "Smooth"
Extra.Name = 'Extra'
Extra.BottomSurface = "Smooth"
Extra.FormFactor = "Custom" Extra.CanCollide = false
Extra.BrickColor = BrickColor.new("Dark stone grey")
Extra.Size = Vector3.new(0.413999707, 0.394999981, 1.97000003)
local Extraweld = Instance.new("ManualWeld")
Extraweld.Part0 = Seat Extraweld.Part1 = Extra Extraweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.C1 = CFrame.new(-1.43300843, -2.53600311, -2.32900667, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Extraweld.Parent = Extra
local Sight1 = Instance.new("Part", char)
Sight1:BreakJoints()
Sight1.TopSurface = "Smooth"
Sight1.Name = 'Sight1'
Sight1.BottomSurface = "Smooth"
Sight1.FormFactor = "Custom" Sight1.CanCollide = false
Sight1.BrickColor = BrickColor.new("Really black")
Sight1.Size = Vector3.new(0.375999987, 1.13800001, 0.219000354)
local Sight1weld = Instance.new("ManualWeld")
Sight1weld.Part0 = Seat Sight1weld.Part1 = Sight1 Sight1weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Sight1weld.C1 = CFrame.new(0.0589828193, -3.94650269, 0.53849411, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Sight1weld.Parent = Sight1
local Pack = Instance.new("Part", char)
Pack:BreakJoints()
Pack.TopSurface = "Smooth"
Pack.Name = 'Pack'
Pack.BottomSurface = "Smooth"
Pack.FormFactor = "Custom" Pack.CanCollide = false
Pack.BrickColor = BrickColor.new("Really black")
Pack.Size = Vector3.new(2.5619998, 2.32999992, 0.987000108)
local Packweld = Instance.new("ManualWeld")
Packweld.Part0 = Seat Packweld.Part1 = Pack Packweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Packweld.C1 = CFrame.new(0.0589860976, -1.5644989, -1.83750725, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Packweld.Parent = Pack
local Sight = Instance.new("Part", char)
Sight:BreakJoints()
Sight.TopSurface = "Smooth"
Sight.Name = 'Sight'
Sight.BottomSurface = "Smooth"
Sight.FormFactor = "Custom" Sight.CanCollide = false
Sight.BrickColor = BrickColor.new("Really black")
Sight.Size = Vector3.new(0.94599998, 0.701999962, 0.219000354)
Sight.Transparency = 0.7
local Sightweld = Instance.new("ManualWeld")
Sightweld.Part0 = Seat Sightweld.Part1 = Sight Sightweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Sightweld.C1 = CFrame.new(-0.227016628, -3.22650146, 0.538492203, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Sightweld.Parent = Sight
local FakeTorso = Instance.new("Part", char)
FakeTorso:BreakJoints()
FakeTorso.TopSurface = "Smooth"
FakeTorso.Name = 'FakeTorso'
FakeTorso.BottomSurface = "Smooth"
FakeTorso.FormFactor = "Custom" FakeTorso.CanCollide = false
FakeTorso.BrickColor = BrickColor.new("Really black")
FakeTorso.Size = Vector3.new(2, 2, 1)
local FakeTorsoweld = Instance.new("ManualWeld")
FakeTorsoweld.Part0 = Seat FakeTorsoweld.Part1 = FakeTorso FakeTorsoweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
FakeTorsoweld.C1 = CFrame.new(0.0261787176, -1.84207273, 0.207453251, 0.999655664, 0.0114495121, -0.0235939212, -0.00555597525, 0.971703291, 0.236139566, 0.0256299879, -0.235926434, 0.971433282)
FakeTorsoweld.Parent = FakeTorso
local GunStable = Instance.new("Part", char)
GunStable:BreakJoints()
GunStable.TopSurface = "Smooth"
GunStable.Name = 'GunStable'
GunStable.BottomSurface = "Smooth"
GunStable.FormFactor = "Custom" GunStable.CanCollide = false
GunStable.BrickColor = BrickColor.new("Really black")
GunStable.Size = Vector3.new(0.45600003, 2.32999992, 0.370000124)
local GunStableweld = Instance.new("ManualWeld")
GunStableweld.Part0 = Seat GunStableweld.Part1 = GunStable GunStableweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
GunStableweld.C1 = CFrame.new(0.0589980781, -3.84950256, -2.08850527, 1, 0, 0, 0, 1, 0, 0, 0, 1)
GunStableweld.Parent = GunStable
local Boostpart = Instance.new("Part", char)
Boostpart:BreakJoints()
Boostpart.TopSurface = "Smooth"
Boostpart.Name = 'Boostpart'
Boostpart.BottomSurface = "Smooth"
Boostpart.FormFactor = "Custom" Boostpart.CanCollide = false
Boostpart.BrickColor = BrickColor.new("Really black")
Boostpart.Size = Vector3.new(0.413999707, 0.394999981, 0.200000003)
local Boostpartweld = Instance.new("ManualWeld")
Boostpartweld.Part0 = Seat Boostpartweld.Part1 = Boostpart Boostpartweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Boostpartweld.C1 = CFrame.new(-1.43300271, -2.53600311, -3.37199974, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Boostpartweld.Parent = Boostpart
local Boostpart2 = Instance.new("Part", char)
Boostpart2:BreakJoints()
Boostpart2.TopSurface = "Smooth"
Boostpart2.Name = 'Boostpart2'
Boostpart2.BottomSurface = "Smooth"
Boostpart2.FormFactor = "Custom" Boostpart2.CanCollide = false
Boostpart2.BrickColor = BrickColor.new("Really black")
Boostpart2.Size = Vector3.new(0.413999707, 0.394999981, 0.200000003)
local Boostpart2weld = Instance.new("ManualWeld")
Boostpart2weld.Part0 = Seat Boostpart2weld.Part1 = Boostpart2 Boostpart2weld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Boostpart2weld.C1 = CFrame.new(1.54098463, -2.53600311, -3.37200499, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Boostpart2weld.Parent = Boostpart2
local GunBarral = Instance.new("Part", char)
GunBarral:BreakJoints()
GunBarral.TopSurface = "Smooth"
GunBarral.Name = 'GunBarral'
GunBarral.BottomSurface = "Smooth"
GunBarral.FormFactor = "Custom" GunBarral.CanCollide = false
GunBarral.BrickColor = BrickColor.new("Really black")
GunBarral.Size = Vector3.new(0.375999987, 0.352999985, 4.88500023)
local GunBarralweld = Instance.new("ManualWeld")
GunBarralweld.Part0 = Seat GunBarralweld.Part1 = GunBarral GunBarralweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
GunBarralweld.C1 = CFrame.new(0.0589904487, -4.68700027, -0.35300684, 1, 0, 0, 0, 1, 0, 0, 0, 1)
GunBarralweld.Parent = GunBarral
local GunMag = Instance.new("Part", char)
GunMag:BreakJoints()
GunMag.TopSurface = "Smooth"
GunMag.Name = 'GunMag'
GunMag.BottomSurface = "Smooth"
GunMag.FormFactor = "Custom" GunMag.CanCollide = false
GunMag.BrickColor = BrickColor.new("Really black")
GunMag.Size = Vector3.new(0.824000001, 0.654999971, 0.892000139)
local GunMagweld = Instance.new("ManualWeld")
GunMagweld.Part0 = Seat GunMagweld.Part1 = GunMag GunMagweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
GunMagweld.C1 = CFrame.new(0.0589942634, -4.68700027, -2.34950876, 1, 0, 0, 0, 1, 0, 0, 0, 1)
GunMagweld.Parent = GunMag
local GunBlast = Instance.new("Part", char)
GunBlast:BreakJoints()
GunBlast.TopSurface = "Smooth"
GunBlast.Name = 'GunBlast'
GunBlast.BottomSurface = "Smooth"
GunBlast.FormFactor = "Custom" GunBlast.CanCollide = false
GunBlast.BrickColor = BrickColor.new("Really black")
GunBlast.Size = Vector3.new(0.941999972, 0.969999969, 0.200000003)
local GunBlastweld = Instance.new("ManualWeld")
GunBlastweld.Part0 = Seat GunBlastweld.Part1 = GunBlast GunBlastweld.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
GunBlastweld.C1 = CFrame.new(0.0589976311, -4.68700027, 1.98949432, 1, 0, 0, 0, 1, 0, 0, 0, 1)
GunBlastweld.Parent = GunBlast
------------------------------------------------------------------------------------------
Tween(heaw, CFrame.new(-0.413999856, -1.92999959, -0.210000008, 1, 0, 0, 0, 0.978148043, -0.207911745, 0, 0.207911745, 0.978148043) , .1, true)
Tween(RAW, CFrame.new(-1.87999964, 1.04999948, 1.06999934, 0.881515563, 0.241381884, 0.405797154, -0.467570841, 0.326720238, 0.821365237, 0.0656802952, -0.913782716, 0.400870949), .1, true)
Tween(LAW, CFrame.new(0.270001173, -1.18999922, -1.43999898, 0.788093567, 0.286842585, -0.544639528, -0.539656579, -0.103669383, -0.835481584, -0.296113938, 0.952355325, 0.0730953068), .1, true)
Tween(LLW,CFrame.new(0.120000415, -1.66999829, 0.400000453, 0.999980032, -0.00637814868, 0.000165756792, -0.000388266519, -0.0867659673, -0.996230364, 0.00636848854, 0.99620986, -0.0867666453) , .1, true)
Tween(RLW, CFrame.new(-1.03999949, 1.54999995, -0.25000003, 0.999847949, 0.00182427373, 0.0173568055, -0.0173860081, 0.190793589, 0.981477916, -0.00152108353, -0.981630087, 0.190796345), .1, true)
boosting = false
function boost()
if boosting == false then
boosting = true
human.WalkSpeed = 300
coroutine.resume(coroutine.create(function()
for i=1, 100 do
wait(0.05)
local p = Instance.new("Part", char)
p.Anchored = true
p.BrickColor = BrickColor.Random()
p.Transparency = 0
p.CanCollide = false
p.FormFactor = "Custom"
p.Name = 'Effect'
p.Size = Vector3.new(2, 2, 2)
p.CFrame = Boostpart.CFrame * CFrame.Angles(math.random(1,360),math.random(1,360),math.random(1,360))
coroutine.resume(coroutine.create(function()
for i=1, 10 do
p.Transparency = p.Transparency + 0.1
wait()
if i == 10 then
p:Destroy()
end
end
end))
end
end))
for i=1, 100 do
wait(0.05)
local p = Instance.new("Part", char)
p.Anchored = true
p.CanCollide = false
p.BrickColor = BrickColor.Random()
p.Transparency = 0
p.FormFactor = "Custom"
p.Name = 'Effect'
p.Size = Vector3.new(2, 2, 2)
p.CFrame = Boostpart2.CFrame * CFrame.Angles(math.random(1,360),math.random(1,360),math.random(1,360))
coroutine.resume(coroutine.create(function()
for i=1, 10 do
p.Transparency = p.Transparency + 0.1
wait()
if i == 10 then
p:Destroy()
end
end
end))
end
human.WalkSpeed = 16
wait(9)
boosting = false
end
end
mouse.KeyDown:connect(function(key)
if key == "f" then
boost()
elseif key == 'q' then
mode = "damage"
elseif key == "e" then
mode = "steel"
elseif key == 'r' then
mode = 'draw'
elseif key == 't' then
mode = 'explode'
elseif key == 'h' then
mode = 'heal'
elseif key == 'z' then
mode = 'tele'
end
end)
function shoot()
pcall(function()
local ray = Ray.new(GunBlast.CFrame.p, (mouse.Hit.p - GunBlast.CFrame.p).unit*400)
local hit, position = game.Workspace:FindPartOnRay(ray, char)
local humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid")
if mode == "damage" then
if humanoid and humanoid.Health ~= 0 then
if hit.Name == 'Head' or hit.Name == 'Handle' then
humanoid:TakeDamage(5000)
else
humanoid:TakeDamage(30)
end
end
elseif mode == "steel" then
if humanoid and humanoid.Health ~= 0 then
takehats(humanoid.Parent)
end
elseif mode == 'draw' then
local p = Instance.new("Part", workspace)
p.Anchored = true
p.Parent = char
p.CFrame = CFrame.new(mouse.Hit.X, mouse.Hit.Y + 0.1, mouse.Hit.Z)
elseif mode == 'explode' then
local p = Instance.new("Part", workspace)
p.Anchored = true
p.Parent = char
p.CFrame = CFrame.new(mouse.Hit.X, mouse.Hit.Y + 0.1, mouse.Hit.Z)
p.Transparency = 1
local ex = Instance.new("Explosion", p)
ex.Position = p.Position
elseif mode == 'tele' then
coroutine.resume(coroutine.create(function()
wait(0.1)
local p = Instance.new("Part", workspace)
p.Anchored = true
p.Parent = char
p.CFrame = CFrame.new(mouse.Hit.X, mouse.Hit.Y + 0.8, mouse.Hit.Z)
p.CanCollide = true
p.Transparency = 1
char.Torso.CFrame = p.CFrame
p:Destroy()
end))
elseif mode == 'heal' then
if humanoid and humanoid.Health ~= 0 then
humanoid.Health = humanoid.Health + 20
end
end
local distance = (position - GunBlast.CFrame.p).magnitude
local rayPart = Instance.new("Part", char)
rayPart.Name = "RayPart"
if mode == "damage" then
rayPart.BrickColor = BrickColor.new("Really red")
elseif mode == "steel" then
rayPart.BrickColor = BrickColor.new("Royal purple")
elseif mode == 'explode' then
rayPart.BrickColor = BrickColor.new("Bright blue")
elseif mode == 'heal' then
rayPart.BrickColor = BrickColor.new("Lime green")
elseif mode == 'tele' then
rayPart.BrickColor = BrickColor.new("Brown")
end
rayPart.Transparency = 0
rayPart.Anchored = true
rayPart.CanCollide = false
rayPart.TopSurface = Enum.SurfaceType.Smooth
rayPart.BottomSurface = Enum.SurfaceType.Smooth
rayPart.formFactor = Enum.FormFactor.Custom
rayPart.Size = Vector3.new(0.4, 0.4, distance)
rayPart.CFrame = CFrame.new(position, GunBlast.CFrame.p) * CFrame.new(0, 0, -distance/2)
local rp2 = Instance.new("Part", char)
rp2.Name = "RayPart"
rp2.BrickColor = BrickColor.new("White")
rp2.Transparency = 0
rp2.Anchored = true
rp2.CanCollide = false
rp2.TopSurface = Enum.SurfaceType.Smooth
rp2.BottomSurface = Enum.SurfaceType.Smooth
rp2.formFactor = Enum.FormFactor.Custom
rp2.Size = Vector3.new(0.1, 0.1, distance)
rp2.CFrame = CFrame.new(position, GunBlast.CFrame.p) * CFrame.new(0, 0, -distance/2)
coroutine.resume(coroutine.create(function()
for i=1, 10 do
rayPart.Transparency = rayPart.Transparency + 0.1
rp2.Transparency = rp2.Transparency + 0.1
wait()
if i == 10 then
rayPart:Destroy()
rp2:Destroy()
end
end
end))
end)
end
mouse.Button1Down:connect(function()
shoot()
end)
|
--[[
All this content is only propriety of otPokemon and use in anothers companys or otclient projects aren't autoryzed by his creator (Mock - matheus.mtb7@gmail.com)
Unauthorized use may cause an lawsuit.
:3
]]
Windowe = nil
topButton = nil
function init()
g_ui.importStyle('keys.otui')
connect(g_game, { onGameEnd = destroy })
Windowe = g_ui.createWidget('Jaaj', rootWidget)
end
function showLockedWindow()
Windowe = g_ui.createWidget('Jaaj', rootWidget)
end
function destroy()
if (Windowe) then
Windowe:destroy();
Windowe = nil;
end
end
function terminate()
destroy()
end
function sendPass()
local pass = Windowe:getChildById('pass'):getText()
g_game.talk("/lock "..pass..'')
terminate()
end
|
-- 9.1.0.39653
KethoWowpedia.dbc.battlepetspecies = {
[2] = {0, -1, 49},
[39] = {4055, 3, 2},
[40] = {10673, 2, 2},
[41] = {10674, 2, 2},
[42] = {10675, 0, 2},
[43] = {10676, 2, 2},
[44] = {10677, 2, 2},
[45] = {10678, 2, 2},
[46] = {10679, 2, 2},
[47] = {10680, 2, 2},
[49] = {10682, 0, 2},
[50] = {10683, 0, 2},
[51] = {10684, 2, 2},
[52] = {10685, 2, 2},
[55] = {10688, 2, 2},
[56] = {10695, 0, 2},
[57] = {10696, 0, 2},
[58] = {10697, 0, 2},
[59] = {10698, 0, 2},
[64] = {10703, 2, 2},
[65] = {10704, 2, 2},
[67] = {10706, 2, 2},
[68] = {10707, 2, 2},
[69] = {0, 4, 26},
[70] = {10709, 2, 2},
[72] = {10711, 2, 2},
[74] = {10713, 2, 2},
[75] = {10714, 2, 2},
[77] = {10716, 2, 2},
[78] = {10717, 2, 2},
[83] = {12243, 1, 18},
[84] = {13548, 1, 18},
[85] = {15048, 3, 2},
[86] = {15049, 3, 2},
[87] = {15067, 0, 2},
[89] = {15999, 0, 2050},
[90] = {16450, 0, 2},
[92] = {17707, 7, 82},
[93] = {17708, 7, 82},
[94] = {17709, 7, 82},
[95] = {19772, 3, 2},
[106] = {23811, 6, 18},
[107] = {24696, 7, 82},
[111] = {24988, 7, 16466},
[114] = {25162, 0, 2},
[115] = {172695, 3, 2},
[116] = {26010, 3, 2},
[117] = {26045, 6, 2},
[118] = {26529, 6, 2},
[119] = {26533, 6, 2},
[120] = {26541, 6, 2},
[121] = {27241, 7, 16466},
[122] = {27570, 6, 2},
[124] = {28505, 7, 16466},
[125] = {28738, 6, 2},
[126] = {28739, 6, 2},
[127] = {28740, 6, 2},
[128] = {28871, 6, 2},
[130] = {30156, 8, 2},
[131] = {32298, 7, 82},
[132] = {33050, 3, 2},
[136] = {35156, 2, 2},
[137] = {35239, 2, 2},
[138] = {35907, 2, 2},
[139] = {35909, 2, 2},
[140] = {35910, 2, 2},
[141] = {35911, 2, 2},
[142] = {36027, 2, 2},
[143] = {36028, 2, 2},
[144] = {36029, 2, 2},
[145] = {36031, 2, 2},
[146] = {36034, 0, 2},
[149] = {39181, 1, 18},
[153] = {39709, 6, 2},
[155] = {40405, 7, 16466},
[156] = {40549, 8, 2},
[157] = {40613, 6, 2},
[158] = {40614, 6, 2},
[159] = {40634, 6, 2},
[160] = {40990, 5, 82},
[162] = {42609, 6, 2},
[163] = {43697, 3, 2},
[164] = {43698, 3, 2},
[165] = {43918, 0, 2},
[166] = {44369, 6, 2},
[167] = {45082, 2, 2},
[168] = {45125, 8, 2},
[169] = {45127, 8, 2050},
[170] = {45174, 7, 82},
[171] = {45175, 7, 82},
[172] = {45890, 2, 2},
[173] = {46425, 3, 2},
[174] = {46426, 3, 2},
[175] = {46599, 0, 2},
[179] = {48406, 7, 16402},
[180] = {48408, 7, 16402},
[183] = {49964, 8, 2},
[186] = {51716, 2, 2},
[187] = {51851, 0, 16402},
[188] = {52615, 7, 82},
[189] = {53082, 7, 16466},
[190] = {53316, 2, 2},
[191] = {54187, 6, 2},
[192] = {55068, 7, 16466},
[193] = {59250, 3, 2},
[194] = {61348, 0, 2},
[195] = {61349, 0, 2},
[196] = {61350, 0, 2},
[197] = {61351, 0, 2},
[198] = {61357, 2, 2},
[199] = {61472, 5, 82},
[200] = {61725, 6, 2},
[201] = {61773, 6, 82},
[202] = {61855, 5, 16466},
[203] = {61991, 5, 82},
[204] = {62491, 2, 2},
[205] = {62508, 2, 2},
[206] = {62510, 2, 2},
[207] = {62513, 2, 2},
[209] = {62516, 2, 2},
[210] = {62542, 2, 2},
[211] = {62561, 3, 2},
[212] = {62562, 2, 2},
[213] = {62564, 2, 2},
[214] = {62609, 1, 659},
[215] = {62674, 2, 2},
[216] = {62746, 1, 403},
[217] = {63318, 7, 16466},
[218] = {63712, 2, 2050},
[220] = {65046, 1, 18},
[224] = {65358, 2, 2},
[225] = {65381, 6, 18},
[226] = {65382, 6, 18},
[227] = {65682, 7, 16466},
[228] = {66030, 7, 82},
[229] = {66096, 2, 2},
[231] = {66520, 7, 82},
[232] = {67413, 0, 2},
[233] = {67414, 0, 2},
[234] = {67415, 0, 2},
[235] = {67416, 0, 2},
[236] = {67417, 2, 2},
[237] = {67418, 0, 2},
[238] = {67419, 0, 2},
[239] = {67420, 0, 2},
[240] = {67527, 7, 16466},
[241] = {68767, 8, 2},
[242] = {68810, 8, 2},
[243] = {69002, 5, 16466},
[244] = {69452, 7, 82},
[245] = {69535, 9, 82},
[246] = {69536, 9, 82},
[247] = {69539, 7, 82},
[248] = {69541, 9, 82},
[249] = {69677, 9, 82},
[250] = {70613, 5, 82},
[251] = {71840, 6, 2},
[253] = {74932, 6, 2},
[254] = {75134, 2, 2},
[255] = {75613, 5, 82},
[256] = {75906, 9, 82},
[257] = {75936, -1, 34},
[258] = {78381, 7, 82},
[259] = {78683, 1, 18},
[260] = {78685, 1, 18},
[261] = {81937, 3, 2},
[262] = {82173, 3, 2},
[264] = {84263, 3, 2},
[265] = {84492, 5, 82},
[266] = {84752, 3, 2},
[267] = {93836, 3, 2},
[268] = {87344, 7, 82},
[270] = {89039, 2, 82},
[271] = {89472, 2, 2},
[272] = {89670, 2, 82},
[277] = {90523, 3, 2},
[278] = {90637, 0, 2},
[279] = {91343, 0, 2},
[280] = {92395, 2, 663},
[281] = {92396, 2, 407},
[282] = {92397, 2, 151},
[283] = {92398, 2, 151},
[285] = {93624, 8, 2},
[286] = {93739, 0, 2},
[287] = {93813, 1, 18},
[289] = {93817, 6, 2},
[291] = {93823, 1, 18},
[292] = {93837, 3, 2},
[293] = {93838, 0, 2},
[294] = {94070, 7, 82},
[296] = {95786, 9, 594},
[297] = {95787, 9, 82},
[298] = {95909, 9, 338},
[301] = {96571, 1, 18},
[302] = {96817, 8, 2},
[303] = {96819, 8, 2},
[306] = {97638, 2, 2},
[307] = {97779, 1, 18},
[308] = {98079, 6, 2},
[309] = {98571, 3, 2},
[310] = {98587, 3, 2},
[311] = {98736, 9, 2},
[316] = {99578, 9, 4178},
[317] = {99663, 2, 2},
[318] = {99668, 2, 2},
[319] = {100330, 6, 2},
[320] = {100576, 2, 82},
[321] = {100684, 6, 18},
[323] = {100970, 5, 82},
[325] = {101424, 5, 82},
[328] = {101493, 8, 2},
[329] = {101606, 7, 82},
[330] = {101733, 2, 2},
[331] = {101986, 1, 658},
[332] = {101989, 1, 402},
[333] = {102317, 8, 2},
[335] = {103074, 2, 2},
[336] = {103076, 2, 144},
[337] = {103125, 6, 2},
[338] = {103544, 2, 2},
[339] = {103549, 2, 2},
[340] = {103588, 3, 2},
[341] = {104047, 6, 2},
[342] = {104049, 6, 2},
[343] = {105122, 2, 2},
[344] = {105228, 2, 160},
[345] = {105229, 2, 160},
[346] = {105633, 7, 82},
[347] = {110029, 9, 82},
[348] = {112994, 8, 2},
[354] = {0, -1, 32},
[374] = {0, 4, 26},
[375] = {0, -1, 56},
[378] = {0, 4, 26},
[379] = {0, 4, 26},
[380] = {0, 4, 26},
[381] = {118414, 0, 2},
[382] = {231215, 0, 2},
[383] = {0, 4, 26},
[384] = {118419, -1, 32},
[385] = {0, 4, 26},
[386] = {0, 4, 24},
[387] = {0, 4, 26},
[388] = {0, 4, 26},
[389] = {0, 4, 26},
[390] = {0, -1, 160},
[391] = {0, 4, 26},
[392] = {0, 4, 26},
[393] = {0, 4, 26},
[394] = {0, -1, 58},
[395] = {0, 4, 26},
[396] = {0, 4, 26},
[397] = {0, 4, 26},
[398] = {0, 4, 26},
[399] = {0, 4, 26},
[400] = {0, 4, 26},
[401] = {0, 4, 26},
[402] = {0, 4, 26},
[403] = {0, 4, 26},
[404] = {0, 4, 26},
[405] = {0, 4, 26},
[406] = {0, 4, 26},
[407] = {0, 4, 26},
[408] = {0, 4, 26},
[409] = {0, 4, 26},
[410] = {0, 4, 26},
[411] = {0, 4, 26},
[412] = {0, 4, 26},
[414] = {0, 4, 24},
[415] = {0, 4, 26},
[416] = {0, 4, 26},
[417] = {0, 4, 26},
[418] = {0, 4, 26},
[419] = {0, 4, 26},
[420] = {0, 4, 26},
[421] = {0, 4, 26},
[422] = {0, 4, 26},
[423] = {0, 4, 26},
[424] = {0, 4, 26},
[425] = {0, 4, 26},
[427] = {0, 4, 26},
[428] = {0, 4, 26},
[429] = {0, 4, 26},
[430] = {0, 4, 26},
[431] = {0, 4, 26},
[432] = {0, 4, 24},
[433] = {0, 4, 26},
[434] = {0, 4, 160},
[437] = {0, 4, 26},
[438] = {0, 4, 26},
[439] = {0, 4, 26},
[440] = {0, 4, 26},
[441] = {0, 4, 26},
[442] = {0, 4, 26},
[443] = {0, 4, 26},
[444] = {0, -1, 56},
[445] = {0, 4, 26},
[446] = {0, 4, 26},
[447] = {0, 4, 26},
[448] = {0, 4, 26},
[449] = {0, 4, 26},
[450] = {0, 4, 26},
[452] = {0, 4, 26},
[453] = {0, 4, 26},
[454] = {0, 4, 26},
[455] = {0, 4, 26},
[456] = {0, 4, 26},
[457] = {0, 4, 26},
[458] = {0, 4, 26},
[459] = {0, 4, 26},
[460] = {0, 4, 26},
[461] = {0, 4, 26},
[462] = {89472, 2, 32},
[463] = {0, 4, 26},
[464] = {0, 4, 26},
[465] = {0, 4, 26},
[466] = {0, 4, 26},
[467] = {0, 4, 26},
[468] = {0, 4, 26},
[469] = {0, 4, 26},
[470] = {0, 4, 26},
[471] = {0, 4, 26},
[472] = {0, 4, 26},
[473] = {0, 4, 26},
[474] = {0, 4, 26},
[475] = {0, 4, 26},
[476] = {0, 4, 160},
[477] = {0, 4, 26},
[478] = {0, 4, 26},
[479] = {0, 4, 26},
[480] = {0, 4, 26},
[482] = {0, 4, 26},
[483] = {0, 4, 26},
[484] = {0, 4, 26},
[485] = {0, 4, 26},
[486] = {0, 4, 160},
[487] = {0, 4, 26},
[488] = {0, 4, 26},
[489] = {0, 4, 26},
[491] = {0, 4, 26},
[492] = {0, 4, 26},
[493] = {0, 4, 26},
[494] = {0, 4, 26},
[495] = {0, 4, 26},
[496] = {0, 4, 26},
[497] = {0, 4, 26},
[498] = {0, 4, 26},
[499] = {0, 4, 26},
[500] = {0, 4, 26},
[502] = {0, 4, 26},
[503] = {0, 4, 26},
[504] = {0, 4, 26},
[505] = {0, 4, 26},
[506] = {0, 4, 26},
[507] = {0, 4, 26},
[508] = {0, 4, 26},
[509] = {0, 4, 26},
[510] = {0, 4, 34},
[511] = {0, 4, 26},
[512] = {0, 4, 26},
[513] = {0, 4, 26},
[514] = {0, 4, 26},
[515] = {0, 4, 26},
[517] = {0, 4, 26},
[518] = {0, 4, 26},
[519] = {0, 4, 26},
[521] = {0, 4, 26},
[523] = {0, 4, 26},
[525] = {0, 4, 26},
[528] = {0, 4, 26},
[529] = {0, 4, 26},
[530] = {0, 4, 26},
[532] = {0, 4, 26},
[534] = {0, 4, 26},
[535] = {0, 4, 26},
[536] = {0, 4, 26},
[537] = {0, 4, 26},
[538] = {0, 4, 26},
[539] = {0, 4, 26},
[540] = {0, 4, 26},
[541] = {0, 4, 26},
[542] = {0, 4, 26},
[543] = {0, 4, 26},
[544] = {0, 4, 26},
[545] = {0, 4, 24},
[546] = {0, 4, 26},
[547] = {0, 4, 26},
[548] = {0, 4, 26},
[549] = {0, 4, 26},
[550] = {0, 4, 26},
[552] = {0, 4, 26},
[553] = {0, 4, 26},
[554] = {0, 4, 26},
[555] = {0, 4, 26},
[556] = {0, 4, 26},
[557] = {0, 4, 26},
[558] = {0, 4, 26},
[559] = {0, 4, 26},
[560] = {0, 4, 26},
[562] = {0, 4, 26},
[564] = {0, 4, 26},
[565] = {0, 4, 26},
[566] = {0, 4, 26},
[567] = {0, 4, 26},
[568] = {0, 4, 26},
[569] = {0, 4, 26},
[570] = {0, 4, 26},
[571] = {0, 4, 26},
[572] = {0, 4, 26},
[573] = {0, 4, 26},
[626] = {0, 4, 26},
[627] = {0, 4, 26},
[628] = {0, 4, 26},
[629] = {123212, 2, 2},
[630] = {123214, 2, 2},
[631] = {0, 4, 26},
[632] = {0, 4, 26},
[633] = {0, 4, 26},
[634] = {0, 4, 26},
[635] = {0, 4, 26},
[637] = {0, 4, 26},
[638] = {0, 4, 26},
[639] = {0, 4, 24},
[640] = {0, 4, 26},
[641] = {0, 4, 26},
[644] = {0, 4, 26},
[645] = {0, 4, 26},
[646] = {0, 4, 26},
[647] = {0, 4, 26},
[648] = {0, 4, 26},
[649] = {0, 4, 26},
[650] = {123778, 0, 2},
[652] = {124000, 2, 2},
[665] = {102353, 8, 2},
[666] = {249870, 5, 82},
[671] = {124660, 7, 82},
[675] = {0, 4, 26},
[677] = {0, 4, 26},
[678] = {0, 4, 26},
[679] = {0, 4, 26},
[680] = {0, 4, 26},
[699] = {0, 4, 26},
[702] = {0, 4, 26},
[703] = {0, 4, 26},
[705] = {0, 4, 58},
[706] = {0, 4, 26},
[707] = {0, 4, 26},
[708] = {0, 4, 26},
[709] = {0, 4, 26},
[710] = {0, 4, 26},
[711] = {0, 4, 26},
[712] = {0, 4, 26},
[713] = {0, 4, 26},
[714] = {0, 4, 26},
[715] = {0, 4, 58},
[716] = {0, 4, 26},
[717] = {0, 4, 26},
[718] = {0, 4, 26},
[722] = {0, 4, 26},
[723] = {0, 4, 26},
[724] = {0, 4, 26},
[725] = {0, 4, 26},
[726] = {0, 4, 26},
[727] = {0, 4, 26},
[728] = {0, 4, 26},
[729] = {0, 4, 26},
[730] = {0, 4, 26},
[731] = {0, 4, 26},
[732] = {0, 4, 26},
[733] = {0, 4, 26},
[737] = {0, 4, 26},
[739] = {0, 4, 26},
[740] = {0, 4, 26},
[741] = {0, 4, 26},
[742] = {0, 4, 26},
[743] = {0, 4, 26},
[744] = {0, 4, 26},
[745] = {0, 4, 26},
[746] = {0, 4, 26},
[747] = {0, 4, 26},
[748] = {0, 4, 26},
[749] = {0, 4, 26},
[750] = {0, 4, 26},
[751] = {0, 4, 26},
[752] = {0, 4, 26},
[753] = {0, 4, 26},
[754] = {0, 4, 26},
[755] = {0, 4, 26},
[756] = {0, 4, 26},
[757] = {23531, 7, 16466},
[758] = {23530, 7, 16466},
[792] = {127816, 2, 2},
[800] = {0, -1, 57},
[802] = {127813, -1, 18},
[817] = {0, 4, 26},
[818] = {0, 4, 26},
[819] = {0, 4, 26},
[820] = {127815, 4, 82},
[821] = {124152, 5, 82},
[823] = {0, 4, 26},
[824] = {0, -1, 56},
[825] = {0, -1, 56},
[826] = {0, -1, 56},
[827] = {0, -1, 56},
[828] = {0, -1, 56},
[829] = {0, -1, 56},
[830] = {0, -1, 56},
[831] = {0, -1, 56},
[832] = {0, -1, 56},
[833] = {0, -1, 56},
[834] = {126251, 0, 2},
[835] = {126247, 4, 82},
[836] = {126249, 0, 2},
[837] = {0, 4, 26},
[838] = {0, 4, 26},
[844] = {126885, 3, 2},
[845] = {120501, 3, 2},
[846] = {120507, 3, 2},
[847] = {122748, 1, 2},
[848] = {114090, 0, 2},
[849] = {127008, 3, 146},
[850] = {127006, 3, 146},
[851] = {0, 4, 26},
[855] = {130759, 5, 82},
[856] = {130726, 5, 82},
[868] = {131590, 1, 2},
[872] = {0, -1, 48},
[873] = {0, -1, 48},
[874] = {0, -1, 48},
[875] = {0, 1, 48},
[876] = {0, -1, 48},
[877] = {0, -1, 48},
[878] = {0, -1, 48},
[879] = {0, -1, 48},
[880] = {0, 4, 48},
[881] = {0, -1, 48},
[882] = {0, -1, 48},
[883] = {0, -1, 48},
[884] = {0, 2, 48},
[885] = {0, 4, 48},
[886] = {0, -1, 48},
[887] = {0, 0, 48},
[888] = {0, 7, 48},
[889] = {0, -1, 48},
[890] = {0, -1, 48},
[891] = {0, -1, 48},
[892] = {0, -1, 48},
[893] = {0, -1, 48},
[894] = {0, -1, 48},
[895] = {0, -1, 48},
[896] = {0, -1, 48},
[897] = {0, -1, 48},
[898] = {0, -1, 48},
[899] = {0, -1, 48},
[900] = {0, -1, 48},
[901] = {0, -1, 48},
[902] = {0, -1, 48},
[903] = {131650, 7, 82},
[904] = {0, -1, 48},
[905] = {0, -1, 48},
[906] = {0, 0, 48},
[907] = {0, -1, 48},
[908] = {0, 8, 48},
[909] = {0, -1, 48},
[911] = {0, -1, 48},
[912] = {0, -1, 48},
[913] = {0, -1, 48},
[915] = {0, -1, 48},
[916] = {0, -1, 48},
[917] = {0, -1, 48},
[921] = {0, -1, 48},
[922] = {0, 6, 48},
[923] = {0, -1, 48},
[924] = {0, -1, 48},
[925] = {0, -1, 48},
[926] = {0, 7, 48},
[927] = {0, 4, 48},
[928] = {0, -1, 48},
[929] = {0, 0, 48},
[931] = {0, -1, 48},
[932] = {0, -1, 48},
[933] = {0, -1, 48},
[934] = {0, -1, 48},
[935] = {0, -1, 48},
[936] = {0, 0, 48},
[937] = {0, 0, 48},
[938] = {0, 0, 48},
[939] = {0, 0, 48},
[941] = {0, -1, 48},
[942] = {0, -1, 48},
[943] = {0, -1, 48},
[944] = {0, -1, 48},
[945] = {0, -1, 48},
[946] = {0, 1, 48},
[947] = {0, 4, 48},
[948] = {0, 7, 48},
[949] = {0, 6, 48},
[950] = {0, -1, 48},
[951] = {0, 7, 48},
[952] = {0, 7, 48},
[953] = {0, -1, 48},
[954] = {0, 6, 48},
[955] = {0, -1, 48},
[956] = {0, -1, 48},
[957] = {0, -1, 48},
[958] = {0, -1, 48},
[959] = {0, 3, 48},
[960] = {0, 3, 48},
[961] = {0, 3, 48},
[962] = {0, 7, 48},
[963] = {0, -1, 48},
[964] = {0, 2, 48},
[965] = {0, -1, 48},
[966] = {0, -1, 48},
[967] = {0, -1, 48},
[968] = {0, -1, 48},
[969] = {0, 6, 48},
[970] = {0, -1, 48},
[971] = {0, -1, 48},
[972] = {0, 7, 48},
[973] = {0, 0, 48},
[974] = {0, -1, 48},
[975] = {0, -1, 48},
[976] = {0, -1, 48},
[977] = {0, 2, 48},
[978] = {0, -1, 48},
[979] = {0, 2, 48},
[980] = {0, -1, 48},
[981] = {0, -1, 48},
[982] = {0, -1, 48},
[983] = {0, 0, 48},
[984] = {0, -1, 48},
[985] = {0, -1, 48},
[986] = {0, -1, 48},
[987] = {0, -1, 48},
[988] = {0, -1, 48},
[989] = {0, -1, 48},
[990] = {0, -1, 48},
[991] = {0, -1, 48},
[992] = {0, -1, 48},
[993] = {0, -1, 48},
[994] = {0, 4, 48},
[995] = {0, 4, 48},
[996] = {0, 0, 48},
[997] = {0, 1, 48},
[998] = {0, -1, 48},
[999] = {0, 4, 48},
[1000] = {0, 4, 48},
[1001] = {0, 4, 48},
[1002] = {0, 4, 48},
[1003] = {0, 4, 48},
[1004] = {0, 0, 48},
[1005] = {0, 4, 48},
[1006] = {0, 6, 48},
[1007] = {0, 4, 48},
[1008] = {0, 0, 48},
[1009] = {0, 4, 48},
[1010] = {0, 4, 48},
[1011] = {0, 4, 48},
[1012] = {0, 4, 48},
[1013] = {0, 4, 26},
[1039] = {132574, 3, 2},
[1040] = {132580, 3, 2},
[1042] = {123784, 1, 26},
[1061] = {132762, 2, 2},
[1062] = {0, 4, 26},
[1063] = {132789, 0, 2},
[1065] = {0, 4, 48},
[1066] = {0, 4, 48},
[1067] = {0, 4, 48},
[1068] = {0, 4, 26},
[1073] = {28487, 0, 82},
[1117] = {134538, 9, 82},
[1124] = {134892, 1, 2},
[1125] = {134894, 1, 2},
[1126] = {134895, 1, 2},
[1127] = {132759, 7, 16466},
[1128] = {0, 4, 26},
[1129] = {0, 4, 1072},
[1130] = {0, 4, 48},
[1131] = {0, 4, 48},
[1132] = {0, 4, 48},
[1133] = {0, 4, 48},
[1134] = {0, 4, 48},
[1135] = {0, 4, 48},
[1136] = {0, 4, 48},
[1137] = {0, 4, 48},
[1138] = {0, 1, 48},
[1139] = {0, -1, 48},
[1140] = {0, -1, 48},
[1141] = {0, -1, 48},
[1142] = {135156, 2, 18},
[1143] = {135254, 0, 2},
[1144] = {135255, 0, 2},
[1145] = {135256, 5, 82},
[1146] = {135257, 0, 2},
[1147] = {135258, 0, 2},
[1149] = {135259, 0, 2},
[1150] = {135259, 0, 2},
[1151] = {135263, 0, 2},
[1152] = {135264, 0, 2},
[1153] = {135265, 0, 2},
[1154] = {135266, 0, 2},
[1155] = {135267, 0, 2},
[1156] = {135268, 0, 2},
[1157] = {0, 4, 26},
[1158] = {0, 4, 26},
[1159] = {0, 4, 26},
[1160] = {0, 4, 26},
[1161] = {0, 4, 26},
[1162] = {0, 4, 26},
[1163] = {0, 4, 26},
[1164] = {0, 4, 26},
[1165] = {0, 4, 26},
[1166] = {0, 4, 26},
[1167] = {0, 4, 26},
[1168] = {25018, 7, 16466},
[1174] = {136484, 8, 2},
[1175] = {0, 4, 26},
[1176] = {137568, 1, 82},
[1177] = {137977, 0, 2},
[1178] = {138082, 0, 2},
[1179] = {0, 4, 26},
[1180] = {138087, 0, 2},
[1181] = {0, 4, 26},
[1182] = {0, 4, 26},
[1183] = {138161, 0, 2},
[1184] = {138287, 5, 82},
[1185] = {138285, 1, 2},
[1187] = {0, 4, 1072},
[1188] = {0, 4, 1072},
[1189] = {0, 4, 1072},
[1190] = {0, 4, 1072},
[1191] = {0, 4, 1072},
[1192] = {0, 4, 1072},
[1193] = {0, 4, 1072},
[1194] = {0, 4, 1072},
[1195] = {0, 4, 1072},
[1196] = {138380, 1, 2},
[1197] = {138381, 1, 2},
[1198] = {138382, 1, 2},
[1200] = {138825, 0, 2},
[1201] = {138913, 0, 2},
[1202] = {139148, 0, 2},
[1204] = {138824, 3, 2},
[1205] = {139153, 0, 2},
[1206] = {139361, 3, 2},
[1207] = {139362, 3, 2},
[1208] = {139363, 3, 2},
[1209] = {139365, 3, 2},
[1211] = {139932, 0, 2},
[1212] = {139933, 0, 2},
[1213] = {139934, 0, 2},
[1226] = {141433, 0, 2},
[1227] = {141434, 0, 2},
[1228] = {141435, 0, 2},
[1229] = {141451, 0, 2},
[1230] = {141436, 0, 2},
[1231] = {141437, 0, 2},
[1232] = {141446, 0, 2},
[1233] = {141447, 0, 2},
[1234] = {141448, 0, 2},
[1235] = {141449, 0, 2},
[1236] = {141450, 5, 82},
[1237] = {141789, 2, 2},
[1238] = {0, 4, 26},
[1243] = {142028, 0, 2},
[1244] = {142029, 0, 2},
[1245] = {142030, 0, 2},
[1247] = {0, -1, 1072},
[1248] = {142880, 9, 82},
[1255] = {143637, 7, 82},
[1256] = {143703, 3, 2},
[1257] = {143732, 0, 34},
[1258] = {0, 2, 48},
[1259] = {0, -1, 48},
[1266] = {145696, 2, 82},
[1267] = {0, -1, 1072},
[1268] = {0, -1, 48},
[1269] = {0, -1, 48},
[1271] = {0, -1, 48},
[1276] = {144761, 0, 2},
[1277] = {0, -1, 48},
[1278] = {0, -1, 48},
[1279] = {0, -1, 48},
[1280] = {0, -1, 48},
[1281] = {0, -1, 48},
[1282] = {0, -1, 48},
[1283] = {0, -1, 48},
[1284] = {0, -1, 48},
[1285] = {0, -1, 48},
[1286] = {0, -1, 48},
[1287] = {0, -1, 48},
[1288] = {0, -1, 48},
[1289] = {0, -1, 48},
[1290] = {0, -1, 48},
[1291] = {0, -1, 48},
[1292] = {0, -1, 48},
[1293] = {0, -1, 48},
[1295] = {0, -1, 48},
[1296] = {0, -1, 48},
[1297] = {0, -1, 48},
[1298] = {0, -1, 48},
[1299] = {0, -1, 48},
[1300] = {0, -1, 48},
[1301] = {0, -1, 48},
[1303] = {145697, 2, 82},
[1304] = {145698, 2, 82},
[1305] = {145699, 2, 82},
[1311] = {0, -1, 1072},
[1317] = {0, -1, 1072},
[1319] = {0, -1, 1072},
[1320] = {147124, 0, 2},
[1321] = {0, 0, 2},
[1322] = {15048, 0, 2},
[1323] = {148046, 0, 2},
[1324] = {148068, 4, 26},
[1325] = {148069, 4, 26},
[1326] = {148065, 4, 26},
[1328] = {138161, 0, 2},
[1329] = {148051, 0, 2},
[1330] = {148052, 0, 2},
[1331] = {148058, 0, 2},
[1332] = {148059, 0, 2},
[1333] = {148060, 0, 2},
[1334] = {148061, 0, 2},
[1335] = {148551, 0, 2},
[1336] = {148063, 0, 2},
[1337] = {148066, 0, 2},
[1338] = {148067, 0, 2},
[1339] = {0, -1, 1072},
[1343] = {148373, 0, 2},
[1344] = {148427, 2, 2},
[1345] = {148527, 0, 2},
[1346] = {148530, 2, 2},
[1348] = {148552, 0, 2},
[1349] = {148567, 1, 2},
[1350] = {148684, 2, 146},
[1351] = {66175, 6, 2},
[1352] = {0, -1, 49},
[1354] = {0, -1, 1072},
[1363] = {149787, 9, 82},
[1364] = {149792, 7, 82},
[1365] = {149810, 7, 82},
[1384] = {170267, 5, 82},
[1385] = {0, 1, 2},
[1386] = {155748, 7, 82},
[1387] = {155838, 1, 2},
[1394] = {0, 1, 2},
[1395] = {25162, 3, 2},
[1396] = {159581, 2, 2},
[1400] = {0, -1, 48},
[1401] = {53082, -1, 48},
[1402] = {149810, -1, 34},
[1403] = {160403, 3, 2},
[1409] = {0, -1, 1074},
[1410] = {161522, -1, 32},
[1411] = {161643, 5, 82},
[1412] = {162135, 3, 2},
[1416] = {164212, 0, 2},
[1420] = {0, -1, 48},
[1423] = {0, -1, 34},
[1424] = {0, -1, 34},
[1426] = {166071, 3, 2},
[1427] = {0, 4, 26},
[1428] = {0, 0, 2},
[1429] = {167389, 2, 2},
[1430] = {167390, 2, 2},
[1431] = {167392, -1, 34},
[1432] = {167394, 3, 2},
[1433] = {167395, -1, 34},
[1434] = {167397, 1, 2},
[1435] = {0, 4, 26},
[1441] = {0, 4, 26},
[1442] = {0, 1, 2},
[1443] = {0, -1, 48},
[1444] = {0, -1, 50},
[1446] = {168668, 2, 2},
[1447] = {0, 4, 26},
[1448] = {168977, 3, 2},
[1449] = {169220, 2, 18},
[1450] = {169666, 2, 2},
[1451] = {169695, 5, 16466},
[1453] = {223110, 2, 2},
[1454] = {190036, 7, 82},
[1455] = {0, 4, 26},
[1456] = {0, 4, 26},
[1457] = {0, 4, 26},
[1458] = {170286, 2, 2},
[1462] = {0, 4, 26},
[1463] = {0, 4, 26},
[1464] = {0, 4, 26},
[1465] = {0, 4, 26},
[1466] = {190035, 9, 82},
[1467] = {170292, 0, 2},
[1468] = {0, 4, 26},
[1469] = {0, 4, 26},
[1470] = {0, 4, 26},
[1471] = {170285, 0, 2},
[1472] = {0, -1, 1072},
[1473] = {0, -1, 1122},
[1474] = {0, -1, 1072},
[1475] = {0, -1, 48},
[1476] = {0, -1, 48},
[1477] = {0, -1, 48},
[1478] = {170774, 0, 2},
[1479] = {0, -1, 50},
[1480] = {0, -1, 1074},
[1482] = {0, -1, 50},
[1483] = {0, -1, 50},
[1484] = {0, -1, 98},
[1485] = {0, -1, 50},
[1486] = {0, -1, 1074},
[1487] = {0, -1, 50},
[1488] = {0, -1, 50},
[1489] = {0, -1, 50},
[1490] = {0, -1, 50},
[1492] = {0, -1, 50},
[1493] = {0, -1, 50},
[1494] = {0, -1, 50},
[1495] = {170280, 3, 2},
[1496] = {0, -1, 50},
[1497] = {0, -1, 50},
[1498] = {0, -1, 50},
[1499] = {0, -1, 50},
[1500] = {0, -1, 50},
[1501] = {0, -1, 50},
[1502] = {0, -1, 50},
[1503] = {0, -1, 50},
[1504] = {0, -1, 50},
[1505] = {0, -1, 50},
[1506] = {0, -1, 50},
[1507] = {0, -1, 1074},
[1508] = {0, -1, 50},
[1509] = {0, -1, 50},
[1510] = {0, -1, 50},
[1511] = {132762, 2, 2},
[1514] = {171222, 6, 146},
[1515] = {170282, 0, 2},
[1516] = {171500, 2, 2},
[1517] = {171552, 6, 2},
[1518] = {171758, 6, 2},
[1519] = {0, -1, 1072},
[1521] = {171912, 6, 2},
[1523] = {171915, 6, 2},
[1524] = {170269, 0, 2},
[1530] = {170274, 3, 2},
[1531] = {172632, 3, 2},
[1532] = {170270, 1, 2},
[1533] = {172998, 0, 2},
[1536] = {173532, 0, 2},
[1537] = {173542, 0, 2},
[1538] = {173543, 0, 2},
[1539] = {173544, 0, 2},
[1540] = {173547, 0, 2},
[1541] = {170273, 0, 2},
[1542] = {170281, 2, 2},
[1543] = {177216, 0, 18},
[1544] = {170268, 0, 2},
[1545] = {170291, 1, 2},
[1546] = {170289, 5, 82},
[1547] = {0, -1, 50},
[1548] = {0, -1, 50},
[1549] = {0, -1, 50},
[1550] = {0, -1, 50},
[1552] = {0, -1, 50},
[1553] = {0, -1, 50},
[1554] = {0, -1, 50},
[1555] = {0, -1, 50},
[1556] = {0, -1, 50},
[1557] = {0, -1, 50},
[1558] = {0, -1, 50},
[1559] = {0, -1, 50},
[1560] = {0, -1, 50},
[1561] = {0, -1, 50},
[1562] = {0, -1, 50},
[1563] = {10699, 0, 2},
[1564] = {170272, 0, 2},
[1565] = {170288, 3, 2},
[1566] = {176137, 1, 2},
[1567] = {176140, 1, 2},
[1568] = {170279, 1, 2},
[1569] = {170276, 3, 2},
[1570] = {177227, 1, 2},
[1571] = {170287, 2, 2},
[1572] = {0, 4, 26},
[1573] = {0, 4, 26},
[1574] = {170277, 2, 66},
[1575] = {170271, 2, 2},
[1576] = {170275, 0, 2},
[1577] = {187384, 2, 2},
[1578] = {0, 4, 26},
[1579] = {0, 4, 26},
[1581] = {0, 4, 26},
[1582] = {0, 4, 26},
[1583] = {0, 4, 26},
[1586] = {0, 4, 26},
[1587] = {0, 4, 26},
[1588] = {187383, 2, 2},
[1589] = {0, 4, 26},
[1590] = {0, 4, 26},
[1591] = {0, 4, 26},
[1592] = {0, 4, 26},
[1593] = {0, 4, 26},
[1594] = {0, 4, 26},
[1595] = {0, 4, 26},
[1596] = {170283, 2, 2},
[1597] = {177215, 2, 2},
[1598] = {187376, 2, 2050},
[1599] = {0, 4, 26},
[1600] = {177238, 4, 2},
[1601] = {170278, 0, 2},
[1602] = {177234, 7, 82},
[1603] = {177232, 9, 82},
[1604] = {177220, 0, 210},
[1605] = {177233, 5, 82},
[1607] = {0, -1, 1072},
[1608] = {0, -1, 1122},
[1609] = {0, -1, 1072},
[1610] = {0, -1, 34},
[1615] = {0, 4, 26},
[1622] = {179811, 0, 2},
[1623] = {179830, 0, 2},
[1624] = {179831, 0, 2},
[1625] = {179832, 0, 2},
[1626] = {179833, 0, 2},
[1627] = {179834, 0, 2},
[1628] = {179835, 0, 2050},
[1629] = {179836, 0, 2},
[1631] = {179837, 0, 2},
[1632] = {179838, 0, 2},
[1633] = {179839, 0, 2},
[1634] = {179840, 0, 2},
[1635] = {179841, 5, 210},
[1636] = {179954, 5, 82},
[1637] = {0, -1, 50},
[1639] = {181086, 7, 82},
[1640] = {0, -1, 50},
[1641] = {0, -1, 48},
[1642] = {170272, -1, 34},
[1643] = {0, -1, 48},
[1644] = {0, -1, 32},
[1645] = {0, -1, 48},
[1646] = {0, -1, 32},
[1647] = {0, -1, 48},
[1648] = {0, -1, 48},
[1649] = {0, -1, 48},
[1651] = {0, -1, 48},
[1652] = {0, -1, 48},
[1653] = {0, -1, 48},
[1654] = {0, -1, 48},
[1655] = {177223, 4, 2},
[1656] = {177218, 4, 2},
[1660] = {184480, 1, 82},
[1661] = {184481, 2, 2},
[1662] = {184482, 0, 2},
[1663] = {187555, 0, 2},
[1664] = {185055, 4, 2},
[1665] = {185591, 2, 2},
[1666] = {185601, 2, 146},
[1671] = {0, -1, 9264},
[1672] = {187532, 0, 2},
[1673] = {0, -1, 9264},
[1674] = {0, -1, 9264},
[1675] = {0, -1, 9264},
[1676] = {0, -1, 9264},
[1677] = {0, -1, 9264},
[1678] = {0, -1, 9264},
[1679] = {0, -1, 9264},
[1680] = {0, -1, 9264},
[1681] = {0, -1, 9264},
[1682] = {0, -1, 9264},
[1683] = {0, -1, 9264},
[1684] = {0, -1, 9264},
[1685] = {0, -1, 9264},
[1686] = {0, -1, 9264},
[1687] = {188084, 0, 2},
[1688] = {188235, 2, 2},
[1690] = {189357, 0, 2},
[1691] = {190020, 7, 82},
[1692] = {190682, 2, 2},
[1693] = {190681, 2, 2},
[1699] = {191071, 3, 2},
[1700] = {191072, 3, 2},
[1701] = {191073, 3, 2},
[1705] = {186299, 1, 2},
[1706] = {191425, 1, 2},
[1708] = {0, 4, 26},
[1709] = {0, 4, 26},
[1710] = {0, 4, 26},
[1711] = {193680, 1, 2},
[1712] = {0, 4, 26},
[1713] = {0, 4, 26},
[1714] = {0, 4, 26},
[1715] = {194393, 2, 26},
[1716] = {210669, 2, 2},
[1717] = {210671, 2, 2},
[1718] = {210672, 4, 18},
[1719] = {210673, 0, 10},
[1720] = {193388, 1, 66},
[1721] = {193514, 0, 2},
[1722] = {210674, 4, 26},
[1723] = {210675, 0, 2},
[1725] = {191967, 6, 2},
[1726] = {0, 4, 26},
[1727] = {194357, 2, 2},
[1728] = {0, 4, 26},
[1729] = {0, 4, 26},
[1730] = {0, 6, 26},
[1731] = {0, 4, 26},
[1734] = {0, 4, 26},
[1735] = {0, 4, 26},
[1736] = {0, 4, 26},
[1737] = {0, 4, 26},
[1738] = {0, 4, 26},
[1739] = {0, 4, 26},
[1740] = {0, 6, 26},
[1741] = {0, 6, 26},
[1742] = {0, -1, 1072},
[1743] = {0, 4, 26},
[1744] = {0, 4, 26},
[1745] = {0, -1, 48},
[1746] = {0, -1, 48},
[1748] = {0, -1, 48},
[1749] = {0, 4, 26},
[1750] = {0, 4, 26},
[1751] = {193279, 0, 34},
[1752] = {193368, 0, 2},
[1753] = {193434, 0, 2},
[1754] = {210677, 2, 2},
[1755] = {194330, 2, 2},
[1756] = {210678, 4, 2},
[1757] = {210679, 4, 50},
[1758] = {210680, 4, 50},
[1759] = {210681, 4, 2},
[1760] = {194294, 2, 2},
[1761] = {0, 4, 26},
[1762] = {0, 4, 26},
[1763] = {0, 4, 26},
[1764] = {193572, 0, 2},
[1765] = {193589, 0, 2},
[1766] = {193588, 0, 2},
[1770] = {0, -1, 48},
[1771] = {0, -1, 48},
[1772] = {0, -1, 48},
[1773] = {0, 4, 26},
[1774] = {0, 4, 26},
[1775] = {0, 4, 26},
[1776] = {0, 4, 26},
[1777] = {193943, 0, 82},
[1778] = {0, 4, 26},
[1780] = {0, 4, 32},
[1781] = {0, 4, 32},
[1782] = {0, 0, 32},
[1787] = {0, -1, 32},
[1788] = {0, -1, 32},
[1789] = {0, -1, 32},
[1790] = {0, -1, 2080},
[1791] = {0, -1, 32},
[1792] = {0, -1, 32},
[1793] = {0, -1, 32},
[1794] = {0, -1, 32},
[1795] = {0, -1, 32},
[1796] = {0, -1, 32},
[1797] = {0, -1, 32},
[1798] = {0, -1, 32},
[1799] = {0, -1, 32},
[1800] = {0, -1, 32},
[1801] = {0, -1, 32},
[1802] = {195368, 0, 2},
[1803] = {195369, 0, 2},
[1804] = {195370, 0, 2},
[1805] = {210682, 2, 2},
[1806] = {210683, 0, 2},
[1807] = {0, 4, 26},
[1808] = {210691, 3, 2},
[1809] = {0, 4, 26},
[1810] = {0, 4, 26},
[1811] = {0, -1, 1072},
[1815] = {0, -1, 1072},
[1816] = {0, -1, 1072},
[1817] = {0, -1, 1072},
[1818] = {0, -1, 1072},
[1828] = {204148, 7, 82},
[1840] = {0, -1, 32},
[1841] = {0, -1, 32},
[1842] = {0, -1, 32},
[1843] = {0, -1, 9264},
[1846] = {0, -1, 32},
[1847] = {0, -1, 32},
[1848] = {0, -1, 32},
[1849] = {0, -1, 1056},
[1850] = {0, -1, 9248},
[1851] = {0, -1, 32},
[1852] = {0, -1, 32},
[1853] = {0, -1, 32},
[1855] = {0, 4, 1072},
[1857] = {0, 4, 32},
[1858] = {0, -1, 32},
[1859] = {0, 3, 32},
[1860] = {0, 4, 32},
[1861] = {0, 4, 32},
[1862] = {0, 0, 32},
[1863] = {0, 5, 32},
[1864] = {0, 5, 32},
[1865] = {0, 5, 32},
[1866] = {0, -1, 32},
[1867] = {0, -1, 32},
[1868] = {0, 4, 32},
[1869] = {0, 0, 32},
[1870] = {0, -1, 32},
[1871] = {0, -1, 32},
[1872] = {0, -1, 32},
[1873] = {0, -1, 32},
[1874] = {0, -1, 32},
[1875] = {0, -1, 32},
[1877] = {0, -1, 32},
[1878] = {0, -1, 32},
[1879] = {0, -1, 32},
[1880] = {0, -1, 1074},
[1881] = {0, 7, 1056},
[1882] = {0, 0, 1056},
[1883] = {0, 0, 1056},
[1884] = {210694, 2, 2},
[1885] = {210695, 2, 2},
[1886] = {210696, 3, 2},
[1887] = {210697, 3, 2},
[1888] = {210698, 2, 18},
[1889] = {210699, 4, 2},
[1890] = {210701, 2, 18},
[1891] = {0, 4, 9248},
[1892] = {0, 4, 32},
[1893] = {0, 4, 32},
[1894] = {0, 4, 32},
[1895] = {0, 4, 32},
[1896] = {0, 4, 32},
[1897] = {0, 4, 32},
[1898] = {0, 4, 32},
[1899] = {0, 4, 32},
[1903] = {0, 5, 82},
[1904] = {0, -1, 32},
[1905] = {0, -1, 32},
[1906] = {0, -1, 32},
[1907] = {215560, 0, 2},
[1911] = {217218, 2, 2},
[1912] = {0, 4, 26},
[1913] = {0, 4, 26},
[1914] = {0, 4, 26},
[1915] = {0, 4, 26},
[1917] = {0, 4, 26},
[1918] = {221684, 5, 594},
[1919] = {221683, 5, 338},
[1920] = {221906, 3, 2},
[1921] = {221907, 1, 2},
[1922] = {221908, 1, 2},
[1926] = {223027, 0, 2},
[1927] = {30152, 2, 66},
[1928] = {223339, 10, 66},
[1929] = {223359, 10, 66},
[1930] = {223409, 4, 82},
[1931] = {224403, 2, 2},
[1932] = {224536, 4, 18},
[1933] = {224786, 5, 82},
[1934] = {225200, 0, 2},
[1935] = {0, 4, 26},
[1936] = {225761, 9, 82},
[1937] = {226682, 1, 146},
[1938] = {226813, 5, 82},
[1939] = {227051, 7, 338},
[1940] = {227052, 7, 594},
[1941] = {227093, 4, 18},
[1943] = {227113, 6, 2},
[1949] = {0, 6, 2},
[1952] = {229090, 0, 2050},
[1953] = {229091, 0, 2},
[1954] = {229092, 0, 2},
[1955] = {229093, 0, 2},
[1956] = {229094, 0, 2},
[1957] = {229095, 0, 2},
[1958] = {229096, 0, 2050},
[1959] = {229097, 0, 2},
[1960] = {229098, 0, 2050},
[1961] = {229099, 0, 2},
[1962] = {229100, 0, 2050},
[1963] = {229101, 0, 2},
[1964] = {229102, 0, 2},
[1965] = {229103, 0, 2050},
[1966] = {229104, 0, 2},
[1967] = {229105, 0, 2},
[1968] = {229106, 0, 2},
[1969] = {229110, 1, 82},
[1971] = {0, -1, 48},
[1972] = {0, 0, 48},
[1973] = {0, -1, 48},
[1974] = {230073, 0, 82},
[1975] = {230074, 0, 82},
[1976] = {230075, 0, 82},
[1977] = {230076, 0, 82},
[1978] = {230443, 5, 722},
[1979] = {230444, 5, 466},
[1981] = {0, -1, 48},
[1982] = {0, -1, 48},
[1983] = {0, -1, 48},
[1984] = {231017, 0, 2},
[1987] = {0, -1, 48},
[1988] = {0, -1, 48},
[1989] = {0, -1, 48},
[1990] = {0, -1, 9264},
[1991] = {0, -1, 48},
[1992] = {0, -1, 48},
[1993] = {0, -1, 48},
[1994] = {0, -1, 9264},
[1995] = {0, -1, 48},
[1996] = {0, -1, 9264},
[1997] = {232867, 1, 18},
[1998] = {233331, 0, 2},
[1999] = {233333, 0, 2},
[2000] = {233335, 0, 2},
[2001] = {233647, 0, 2},
[2002] = {233649, 6, 2},
[2003] = {233650, 5, 82},
[2004] = {233805, 2, 82},
[2008] = {0, -1, 32},
[2009] = {0, 0, 32},
[2010] = {0, -1, 32},
[2011] = {0, 0, 32},
[2012] = {0, 0, 32},
[2013] = {0, 0, 32},
[2014] = {0, 0, 32},
[2015] = {0, 0, 32},
[2016] = {0, 0, 32},
[2017] = {234555, 2, 18},
[2018] = {234556, 2, 18},
[2022] = {236285, 2, 18},
[2023] = {0, -1, 48},
[2024] = {0, -1, 9264},
[2025] = {0, -1, 9264},
[2026] = {0, 7, 9264},
[2027] = {0, 0, 48},
[2028] = {0, -1, 9264},
[2031] = {0, -1, 1072},
[2032] = {0, 3, 1072},
[2033] = {0, 7, 1072},
[2035] = {237250, 2, 82},
[2036] = {237251, 2, 82},
[2037] = {237252, 2, 82},
[2038] = {0, 4, 48},
[2039] = {0, -1, 48},
[2040] = {0, 4, 48},
[2041] = {0, 2, 18},
[2042] = {240064, 0, 2},
[2046] = {240385, 0, 112},
[2047] = {240794, 2, 82},
[2048] = {241072, 0, 16416},
[3072] = {0, -1, 1072},
[2049] = {242047, 5, 82},
[2050] = {243136, 0, 2},
[2051] = {243499, 9, 82},
[3076] = {0, -1, 1072},
[3077] = {0, -1, 1072},
[3078] = {0, -1, 1072},
[3079] = {346260, 5, 82},
[3080] = {0, 4, 26},
[2057] = {0, 2, 18},
[2058] = {0, 2, 18},
[3083] = {0, 4, 26},
[2062] = {246105, 9, 82},
[2063] = {247123, 0, 2},
[2064] = {0, 5, 82},
[2065] = {247474, 0, 2},
[2066] = {0, -1, 48},
[2067] = {0, -1, 48},
[2068] = {0, -1, 48},
[2071] = {248025, 1, 2},
[2072] = {248240, 0, 2},
[3097] = {351636, 2, 2},
[3098] = {353206, 0, 2},
[3099] = {353230, 0, 2},
[2076] = {0, -1, 16408},
[2077] = {251191, 3, 2},
[2078] = {253788, 0, 2050},
[2079] = {253790, 0, 2},
[2080] = {253799, 0, 2},
[2081] = {253805, 0, 2},
[2082] = {253809, 0, 2},
[2083] = {253813, 0, 2},
[2084] = {253816, 0, 2},
[2085] = {253818, 0, 2},
[2086] = {253916, 0, 2},
[2087] = {253918, 0, 2},
[2088] = {253924, 0, 2},
[2089] = {253925, 0, 2},
[2090] = {253926, 0, 2},
[2091] = {253927, 0, 2},
[2092] = {253928, 0, 2},
[2093] = {253929, 5, 82},
[3118] = {0, 4, 26},
[2095] = {0, -1, 1072},
[2096] = {0, -1, 1072},
[2097] = {0, -1, 1072},
[2098] = {0, -1, 1072},
[2099] = {0, -1, 1072},
[2100] = {0, -1, 1072},
[2101] = {0, -1, 1072},
[2102] = {0, -1, 1072},
[2103] = {0, -1, 1072},
[2104] = {0, -1, 1072},
[2105] = {0, -1, 1072},
[2106] = {0, -1, 1072},
[2107] = {0, -1, 1072},
[2108] = {0, -1, 1072},
[2109] = {0, -1, 1072},
[2110] = {0, -1, 1072},
[2111] = {0, -1, 1072},
[2112] = {0, -1, 1072},
[2113] = {254255, 5, 82},
[2114] = {0, 6, 26},
[2115] = {254196, 2, 18},
[2116] = {254197, 2, 18},
[2117] = {254271, 3, 2},
[2118] = {254295, 0, 2},
[2119] = {254296, 0, 2},
[2120] = {254297, 0, 2},
[2121] = {254298, 3, 2},
[2122] = {0, 4, 26},
[2123] = {0, 4, 26},
[2124] = {0, 4, 26},
[2126] = {0, 4, 26},
[2127] = {0, 4, 26},
[2128] = {0, 4, 26},
[2129] = {0, 4, 26},
[2130] = {0, 4, 26},
[2131] = {0, 4, 26},
[2132] = {0, 4, 26},
[2133] = {0, 4, 26},
[2134] = {0, 4, 26},
[2135] = {254749, 0, 2050},
[2136] = {254763, 0, 146},
[2143] = {255702, 7, 82},
[2144] = {256010, 0, 32},
[2145] = {0, -1, 32},
[2146] = {257603, 0, 32},
[2157] = {259758, 1, 66},
[2158] = {0, 5, 82},
[2163] = {261755, 0, 2},
[2164] = {0, -1, 34},
[2165] = {264001, 0, 18},
[2184] = {272771, 9, 82},
[2185] = {272772, 9, 82},
[2186] = {273159, 0, 2},
[2187] = {273184, 0, 2},
[2188] = {273195, 1, 2},
[2189] = {273215, 2, 2},
[2190] = {273839, 1, 2},
[2192] = {273869, 1, 2},
[2193] = {0, -1, 32},
[2194] = {0, -1, 32},
[2195] = {0, -1, 32},
[2196] = {274202, 1, 2},
[2197] = {274348, 3, 2},
[2198] = {274353, 4, 2},
[2199] = {274380, 3, 2},
[2200] = {0, 1, 33824},
[2201] = {274760, 3, 2},
[2202] = {274776, 5, 82},
[2203] = {0, -1, 32},
[2204] = {0, -1, 32},
[2205] = {0, -1, 32},
[2206] = {0, -1, 32},
[2208] = {0, -1, 32},
[2209] = {0, -1, 32},
[2210] = {0, -1, 32},
[2211] = {0, -1, 32},
[2212] = {0, -1, 32},
[2213] = {0, -1, 32},
[2214] = {0, -1, 32},
[2215] = {0, -1, 32},
[2220] = {0, -1, 32},
[2221] = {0, -1, 32},
[2222] = {0, -1, 32},
[2223] = {0, -1, 32},
[2225] = {0, -1, 32},
[2226] = {0, -1, 32},
[2227] = {0, -1, 32},
[2228] = {0, -1, 32},
[2229] = {0, 1, 32},
[2230] = {0, -1, 33824},
[2231] = {0, -1, 32},
[2232] = {0, -1, 32},
[2233] = {0, -1, 32},
[2330] = {0, -1, 32},
[2332] = {0, -1, 32},
[2333] = {0, -1, 32},
[2334] = {0, -1, 32},
[2335] = {0, -1, 32},
[2336] = {0, -1, 32},
[2337] = {0, -1, 33826},
[2338] = {0, -1, 32},
[2339] = {0, -1, 32},
[2340] = {0, -1, 32},
[2341] = {0, -1, 32},
[2343] = {0, -1, 32},
[2344] = {0, -1, 32},
[2345] = {0, -1, 32},
[2346] = {0, -1, 32},
[2347] = {0, -1, 32},
[2349] = {0, -1, 1072},
[2350] = {0, -1, 1072},
[2352] = {277461, 4, 82},
[2353] = {0, -1, 32},
[2354] = {0, -1, 32},
[2355] = {0, -1, 32},
[2356] = {0, -1, 33826},
[2357] = {0, -1, 32},
[2358] = {0, -1, 32},
[2359] = {0, -1, 32},
[2360] = {0, -1, 32},
[2361] = {0, -1, 32},
[2363] = {0, -1, 32},
[2364] = {0, -1, 32},
[2365] = {0, -1, 32},
[2366] = {0, -1, 32},
[2367] = {0, -1, 33824},
[2368] = {0, -1, 32},
[2370] = {0, -1, 32},
[2371] = {0, -1, 32},
[2372] = {0, 4, 26},
[2373] = {0, 4, 26},
[2374] = {0, 4, 26},
[2375] = {0, 4, 26},
[2376] = {0, 4, 26},
[2377] = {0, 4, 26},
[2378] = {0, 4, 26},
[2379] = {0, 4, 26},
[2380] = {0, 4, 26},
[2381] = {0, 4, 26},
[2382] = {0, 4, 26},
[2383] = {0, 4, 26},
[2384] = {0, 4, 26},
[2385] = {0, 4, 26},
[2386] = {0, 4, 26},
[2387] = {0, 4, 26},
[2388] = {0, 4, 26},
[2389] = {0, 4, 26},
[2390] = {0, 4, 26},
[2392] = {0, 4, 26},
[2393] = {0, 4, 26},
[2394] = {0, 4, 26},
[2395] = {0, 4, 26},
[2397] = {0, 4, 26},
[2398] = {0, 4, 26},
[2399] = {0, 4, 26},
[2400] = {0, 4, 26},
[2401] = {279129, 5, 82},
[2402] = {279171, 5, 82},
[2403] = {279205, 2, 2},
[2404] = {279206, 2, 2},
[2405] = {279207, 2, 2},
[2406] = {279208, 2, 2},
[2407] = {279209, 2, 2},
[2408] = {279210, 2, 2},
[2409] = {279211, 2, 2},
[2410] = {279212, 2, 2},
[2411] = {279213, 0, 2},
[2412] = {279214, 2, 2},
[2413] = {279215, 2, 2},
[2414] = {279216, 2, 2},
[2415] = {279217, 2, 2},
[2416] = {279218, 2, 2},
[2417] = {279219, 2, 2},
[2418] = {279220, 2, 2},
[2419] = {279221, 2, 2},
[2420] = {279224, 2, 2},
[2421] = {279225, 4, 2},
[2422] = {279226, 4, 2},
[2423] = {279227, 4, 2},
[2424] = {279228, 2, 2},
[2425] = {279230, 4, 2},
[2426] = {279231, 4, 2},
[2427] = {279232, 2, 2},
[2428] = {279233, 2, 2},
[2429] = {279234, 2, 2},
[2430] = {279433, 2, 18},
[2431] = {279576, 5, 82},
[2432] = {279631, 0, 2},
[2433] = {279638, 0, 2},
[2434] = {279643, 0, 2},
[2435] = {279657, 0, 2},
[2436] = {279686, 0, 2},
[2437] = {279723, 0, 2},
[2438] = {279724, 0, 2},
[2439] = {279365, 2, 2},
[2440] = {279929, 0, 2},
[2441] = {279930, 0, 2},
[2442] = {280157, 5, 82},
[2443] = {280185, 2, 514},
[2444] = {280188, 2, 258},
[2445] = {177244, 0, 2},
[2446] = {177237, 0, 2},
[2447] = {177236, 0, 2},
[2448] = {177235, 0, 2},
[2449] = {177231, 0, 2},
[2450] = {177230, 0, 2},
[2451] = {280332, 0, 2},
[2452] = {177241, 0, 2},
[2453] = {280335, 0, 2},
[2454] = {280336, 0, 2},
[2455] = {177243, 0, 2},
[2456] = {177242, 0, 2},
[2457] = {280337, 0, 2},
[2458] = {280334, 0, 2},
[2459] = {280333, 0, 2},
[2460] = {280338, 0, 2},
[2461] = {177239, 0, 2},
[2462] = {177240, 0, 2},
[2463] = {177229, 0, 2},
[2464] = {177228, 0, 2},
[2465] = {177222, 0, 2},
[2466] = {177225, 0, 2},
[2467] = {177221, 0, 2},
[2468] = {177224, 0, 2},
[2469] = {177226, 0, 2},
[2471] = {177219, 0, 2},
[2472] = {177217, 0, 2},
[2473] = {280331, 0, 2},
[2474] = {280617, 3, 2},
[2475] = {280619, 3, 2},
[2476] = {280618, 3, 2},
[2477] = {279435, 3, 2},
[2478] = {280728, 5, 594},
[2479] = {280727, 5, 338},
[2480] = {281878, 0, 34},
[2481] = {0, -1, 33840},
[2482] = {283744, 2, 144},
[2483] = {283741, 2, 144},
[2484] = {283740, 2, 144},
[2485] = {0, -1, 32},
[2486] = {0, -1, 32},
[2487] = {0, -1, 32},
[2488] = {0, -1, 1056},
[2489] = {0, -1, 32},
[2490] = {0, -1, 32},
[2492] = {0, -1, 32},
[2493] = {0, -1, 32},
[2494] = {0, -1, 32},
[2495] = {0, -1, 1056},
[2496] = {0, -1, 32},
[2497] = {0, -1, 1056},
[2498] = {0, -1, 1056},
[2499] = {0, -1, 1056},
[2500] = {0, -1, 32},
[2501] = {0, -1, 1056},
[2502] = {0, -1, 32},
[2503] = {0, -1, 32},
[2504] = {0, -1, 32},
[2525] = {285843, 0, 2},
[2526] = {286474, 1, 2},
[2527] = {286483, 0, 2},
[2528] = {286484, 0, 2},
[2529] = {286482, 0, 2},
[2530] = {286514, 3, 2},
[2531] = {286574, 2, 2},
[2532] = {286576, 2, 2},
[2533] = {286582, 2, 2},
[2534] = {286790, 5, 82},
[2535] = {286837, 5, 82},
[2537] = {0, 4, 26},
[2538] = {287997, 0, 2},
[2539] = {288006, 2, 2},
[2540] = {288009, 2, 2},
[2541] = {288054, -1, 34},
[2544] = {288486, 0, 2},
[2545] = {288582, 0, 2},
[2546] = {288592, 0, 2},
[2547] = {288595, 0, 2},
[2548] = {288597, 0, 2},
[2549] = {288598, 0, 2},
[2550] = {288600, 0, 2},
[2551] = {288867, 0, 2},
[2552] = {288868, 2, 2},
[2553] = {288870, 0, 2},
[2554] = {288875, 0, 2},
[2555] = {288890, 2, 2},
[2556] = {288889, 0, 2},
[2557] = {288895, 0, 2},
[2558] = {288901, 0, 2},
[2559] = {288910, 0, 2},
[2560] = {288914, 0, 2},
[2561] = {288916, 0, 2},
[2562] = {288919, 2, 2},
[2563] = {289359, 1, 2},
[2564] = {289604, 0, 2},
[2565] = {289605, 0, 2},
[2566] = {289606, 0, 2},
[2567] = {289622, 0, 2},
[2568] = {289629, 0, 2},
[2569] = {289633, 0, 2},
[2575] = {291203, 1, 2},
[2576] = {291214, 1, 2},
[2577] = {291215, 1, 2},
[2578] = {291223, 1, 2},
[2579] = {291513, 0, 2},
[2580] = {291515, 0, 2},
[2581] = {291517, 0, 2},
[2582] = {291533, 0, 2},
[2583] = {291537, 0, 2},
[2584] = {291537, 0, 2},
[2585] = {291548, 0, 2},
[2586] = {291549, 0, 2},
[2587] = {291553, 0, 2},
[2589] = {291556, 0, 2},
[2590] = {291560, 0, 2},
[2591] = {291561, 5, 82},
[2592] = {0, -1, 1056},
[2593] = {0, -1, 32},
[2594] = {0, -1, 32},
[2595] = {0, -1, 32},
[2596] = {0, -1, 32},
[2597] = {0, -1, 32},
[2598] = {0, -1, 32},
[2599] = {0, -1, 32},
[2600] = {0, -1, 32},
[2601] = {0, -1, 32},
[2602] = {0, -1, 1056},
[2603] = {0, -1, 1056},
[2605] = {0, -1, 32},
[2606] = {0, -1, 32},
[2607] = {0, -1, 32},
[2608] = {0, -1, 1056},
[2609] = {0, -1, 32},
[2611] = {0, -1, 32},
[2612] = {0, -1, 1056},
[2613] = {0, -1, 1056},
[2621] = {294206, 6, 82},
[2622] = {294211, 6, 82},
[2623] = {294231, 9, 82},
[2638] = {300387, 5, 82},
[2645] = {0, 4, 26},
[2646] = {0, 4, 26},
[2647] = {0, 4, 26},
[2648] = {0, 4, 26},
[2649] = {0, 4, 26},
[2650] = {0, 4, 26},
[2651] = {0, 4, 26},
[2652] = {0, 4, 26},
[2653] = {0, 4, 26},
[2657] = {0, 4, 26},
[2658] = {0, 4, 26},
[2659] = {0, 4, 26},
[2660] = {0, 4, 26},
[2661] = {0, 4, 26},
[2662] = {0, 4, 26},
[2663] = {0, 4, 26},
[2664] = {0, 4, 26},
[2665] = {0, 4, 26},
[2666] = {0, 4, 26},
[2667] = {0, 4, 26},
[2668] = {0, 4, 26},
[2669] = {0, 4, 26},
[2670] = {0, 4, 26},
[2671] = {0, 4, 26},
[2672] = {0, 4, 26},
[2673] = {0, 4, 26},
[2674] = {0, 4, 26},
[2675] = {0, 4, 26},
[2676] = {0, 4, 26},
[2677] = {0, 4, 26},
[2678] = {0, 4, 26},
[2680] = {301015, 0, 2},
[2681] = {301042, 0, 2},
[2682] = {301043, 0, 2},
[2683] = {301020, 5, 82},
[2684] = {301021, 0, 2},
[2685] = {301022, 1, 2},
[2686] = {301023, 2, 2},
[2687] = {301024, 1, 18},
[2688] = {301025, 1, 18},
[2689] = {301026, 0, 2},
[2690] = {301027, 0, 2},
[2691] = {301028, 2, 2},
[2692] = {301029, 0, 2},
[2693] = {301030, 0, 2},
[2694] = {301031, 0, 2},
[2695] = {301032, 0, 2},
[2696] = {301033, 0, 2},
[2697] = {301034, 0, 2},
[2698] = {301035, 2, 2},
[2699] = {301036, 2, 2},
[2700] = {301037, 0, 2},
[2701] = {301038, 0, 2},
[2702] = {301039, 0, 2},
[2703] = {301040, 0, 2},
[2704] = {301041, 0, 2},
[2706] = {301044, 0, 2},
[2707] = {301045, 0, 2},
[2708] = {301046, 0, 2},
[2709] = {301047, 0, 2},
[2710] = {301048, 2, 2},
[2711] = {301049, 0, 2},
[2712] = {301050, 0, 2},
[2713] = {301051, 2, 2},
[2714] = {301052, 0, 2},
[2715] = {301053, 0, 2},
[2716] = {301054, 3, 2},
[2717] = {301055, 3, 2},
[2718] = {301056, 0, 2},
[2719] = {301136, 0, 2},
[2720] = {301137, 0, 2},
[2721] = {301162, 1, 2},
[2723] = {0, -1, 33840},
[2724] = {0, -1, 33840},
[2725] = {0, -1, 33840},
[2726] = {0, -1, 33840},
[2727] = {0, -1, 33840},
[2728] = {0, -1, 33840},
[2729] = {0, -1, 33840},
[2730] = {0, -1, 33840},
[2731] = {0, -1, 33840},
[2732] = {0, -1, 33840},
[2733] = {0, -1, 33840},
[2734] = {0, -1, 33840},
[2735] = {0, -1, 33840},
[2736] = {0, -1, 33840},
[2737] = {0, -1, 33840},
[2738] = {0, -1, 33840},
[2739] = {0, -1, 33840},
[2740] = {0, -1, 33840},
[2741] = {0, -1, 33840},
[2742] = {0, -1, 33840},
[3158] = {0, 3, 32},
[3156] = {0, -1, 32},
[2747] = {301985, 2, 82},
[2748] = {301992, 2, 82},
[2749] = {301996, 2, 82},
[2750] = {302003, 2, 82},
[2751] = {0, -1, 32},
[2752] = {0, -1, 32},
[2753] = {303023, 0, 2},
[2754] = {300367, 0, 2},
[2755] = {300934, 0, 2},
[2756] = {303608, 0, 2},
[2757] = {294275, 0, 2},
[2758] = {294278, 0, 2},
[3155] = {0, -1, 48},
[2760] = {294276, 0, 2},
[2761] = {294277, 0, 2},
[2762] = {294279, 0, 2},
[2763] = {294280, 0, 2},
[3141] = {0, 4, 26},
[2765] = {294274, 0, 2},
[2766] = {303784, 0, 2},
[2767] = {303899, 5, 2130},
[2768] = {0, -1, 34},
[2769] = {0, -1, 34},
[2770] = {0, -1, 34},
[2771] = {0, -1, 32},
[2772] = {0, -1, 34},
[3140] = {353666, 0, 2},
[2774] = {0, -1, 34},
[3139] = {0, 4, 26},
[2776] = {307264, 7, 16466},
[2777] = {307654, 7, 338},
[2778] = {307655, 7, 594},
[2779] = {308067, 7, 82},
[2780] = {308369, 9, 16466},
[3138] = {353665, 2, 2},
[3137] = {353664, 0, 2},
[3136] = {353663, 0, 2},
[3135] = {0, 4, 26},
[3134] = {0, 4, 26},
[3133] = {353661, 0, 2},
[3132] = {353659, 5, 82},
[3131] = {353658, 0, 2},
[3130] = {353656, 0, 2},
[3129] = {353649, 0, 2},
[3128] = {353648, 0, 2},
[2792] = {309516, 0, 2},
[2793] = {309519, 0, 2},
[2794] = {309522, 0, 2},
[2795] = {311289, 0, 82},
[2796] = {312029, 4, 2},
[2797] = {312030, 2, 2},
[2798] = {312833, 1, 2},
[2799] = {0, -1, 34},
[2800] = {0, -1, 34},
[2801] = {0, -1, 34},
[2802] = {0, -1, 34},
[2803] = {0, -1, 34},
[2804] = {0, -1, 34},
[2805] = {0, -1, 34},
[2806] = {0, -1, 34},
[2807] = {0, -1, 34},
[2808] = {0, -1, 34},
[2809] = {0, -1, 34},
[2810] = {0, -1, 34},
[2811] = {0, -1, 34},
[2812] = {0, -1, 34},
[3127] = {353645, 0, 2},
[2814] = {0, -1, 1058},
[2815] = {0, -1, 1058},
[2816] = {0, -1, 1058},
[2817] = {0, -1, 1058},
[2818] = {0, -1, 1058},
[2819] = {0, -1, 1058},
[2820] = {0, -1, 1058},
[2821] = {0, -1, 1058},
[2822] = {0, -1, 1058},
[2823] = {0, -1, 1058},
[3126] = {0, 4, 26},
[3125] = {353644, 0, 2},
[3124] = {0, 4, 26},
[3123] = {0, 4, 26},
[3122] = {353639, 0, 2},
[3121] = {353638, 0, 2},
[3120] = {0, 4, 26},
[3119] = {0, 4, 26},
[2832] = {315221, 0, 2},
[2833] = {315225, 0, 2},
[2834] = {315229, 0, 2},
[2835] = {315231, 0, 2},
[2836] = {315270, 0, 2},
[2837] = {315285, 0, 2},
[2838] = {315290, 0, 2},
[2839] = {315297, 0, 2},
[2840] = {315298, 0, 2},
[2841] = {315301, 0, 2},
[2842] = {315302, 0, 2},
[2843] = {315303, 0, 2},
[2844] = {315304, 5, 82},
[2845] = {315339, 0, 66},
[2846] = {315353, 0, 2},
[2847] = {315355, 0, 2},
[2848] = {315360, 0, 2},
[2849] = {315363, 2, 2},
[2850] = {315367, 0, 2},
[2851] = {315370, 0, 2},
[2852] = {315371, 0, 2},
[2853] = {315372, 2, 2},
[2854] = {0, -1, 33826},
[2855] = {0, -1, 33826},
[2856] = {0, -1, 33826},
[2857] = {0, -1, 33826},
[2858] = {0, -1, 33826},
[2859] = {0, -1, 33826},
[2860] = {0, -1, 33826},
[2861] = {0, -1, 33826},
[3117] = {353570, 0, 2},
[2863] = {0, 4, 26},
[2864] = {0, 4, 26},
[2865] = {0, 4, 26},
[2866] = {0, 4, 26},
[2867] = {0, 4, 26},
[2868] = {316629, 2, 18},
[2869] = {316628, 2, 18},
[2870] = {316627, 2, 18},
[2871] = {0, -1, 32},
[2872] = {318300, 1, 18},
[3116] = {353569, 0, 2},
[3115] = {0, 4, 26},
[3114] = {353529, 0, 2},
[3113] = {353528, 0, 2},
[3112] = {0, 4, 26},
[2878] = {318876, 1, 82},
[3111] = {0, 4, 26},
[3110] = {353525, 0, 2},
[3109] = {0, 4, 26},
[3108] = {0, 4, 26},
[3106] = {353458, 2, 2},
[3105] = {353457, 2, 2},
[2885] = {0, 3, 32},
[2886] = {0, -1, 32},
[2887] = {0, -1, 48},
[2888] = {329900, 1, 82},
[2889] = {330997, 3, 2},
[3104] = {353456, 2, 2},
[2891] = {333794, 0, 2},
[2892] = {333796, 0, 2},
[2893] = {333797, 0, 2},
[2894] = {333800, 0, 2},
[2895] = {0, 4, 26},
[2896] = {333799, 0, 2},
[2897] = {333795, 0, 2},
[2898] = {333802, 0, 2},
[2899] = {333804, 2, 2},
[2900] = {333819, 1, 2},
[2901] = {333803, 0, 2},
[2902] = {0, 4, 26},
[2903] = {333865, 0, 2},
[2904] = {333868, 2, 2},
[2905] = {334160, 0, 2},
[3103] = {353451, 0, 2},
[2907] = {334159, 0, 2},
[2908] = {334158, 0, 2},
[2909] = {334157, 0, 2},
[2910] = {334156, 2, 2},
[2911] = {334155, 0, 2},
[2912] = {334154, 2, 2},
[2913] = {334153, 1, 2},
[2914] = {334151, 1, 2},
[2915] = {334150, 2, 2},
[2916] = {334149, 0, 2},
[2917] = {334146, 2, 2},
[2918] = {334145, 1, 2},
[2919] = {0, 4, 26},
[2920] = {334143, 0, 2},
[2921] = {334142, 0, 2},
[2922] = {334141, 0, 2},
[2923] = {334139, 2, 2},
[2924] = {0, 4, 26},
[2925] = {334789, 0, 2},
[2926] = {0, 4, 26},
[2927] = {0, 4, 26},
[2928] = {334987, 1, 2},
[2929] = {0, 4, 26},
[2930] = {0, 4, 26},
[2931] = {334798, 2, 2},
[2932] = {335050, 0, 2},
[2933] = {334796, 2, 2},
[2934] = {335053, 2, 2},
[2935] = {335056, 0, 2},
[2936] = {0, 4, 26},
[2937] = {0, 4, 26},
[2938] = {335076, 0, 2},
[2939] = {0, 4, 26},
[2940] = {335083, 0, 2},
[2941] = {335085, 2, 2},
[2942] = {335087, 0, 2},
[2943] = {0, 4, 26},
[2944] = {335698, 0, 2},
[2945] = {335753, 2, 2},
[2946] = {335755, 0, 2},
[2947] = {335762, 0, 2},
[2948] = {335764, 0, 2},
[2949] = {335765, 0, 2},
[2950] = {0, 4, 26},
[3102] = {0, 4, 26},
[2952] = {335966, 0, 2},
[2953] = {335969, 0, 2},
[2954] = {335972, 2, 2},
[2955] = {335974, 0, 2},
[2956] = {335977, 0, 2},
[2957] = {335979, 0, 2},
[2958] = {335980, 2, 2},
[2959] = {336020, 0, 2},
[2960] = {336021, 0, 2},
[2961] = {336022, 0, 2},
[2962] = {336024, 2, 2},
[2963] = {336030, 2, 2},
[2964] = {336031, 0, 2},
[2965] = {336311, 2, 2},
[2966] = {337031, 2, 16466},
[2967] = {337694, 1, 16466},
[2968] = {0, -1, 33826},
[2969] = {0, -1, 32802},
[2970] = {0, -1, 32802},
[2971] = {0, -1, 32802},
[2972] = {0, -1, 32802},
[2973] = {0, -1, 32802},
[2974] = {0, -1, 32802},
[2975] = {0, -1, 32802},
[2976] = {0, -1, 32802},
[2977] = {0, -1, 32802},
[2978] = {0, -1, 33826},
[2979] = {0, -1, 33826},
[2980] = {0, -1, 32802},
[2981] = {0, -1, 32802},
[2982] = {0, -1, 32802},
[2983] = {0, -1, 32802},
[2984] = {0, -1, 32802},
[2985] = {0, -1, 32802},
[2986] = {0, -1, 32802},
[2987] = {0, -1, 32802},
[2988] = {0, -1, 32802},
[2989] = {0, -1, 32802},
[2990] = {0, -1, 32802},
[2991] = {0, -1, 32802},
[2992] = {0, -1, 32802},
[2993] = {0, -1, 32802},
[2994] = {0, -1, 32802},
[3101] = {353450, 5, 2},
[2996] = {0, -1, 33826},
[3100] = {353442, 2, 2},
[2998] = {0, -1, 33826},
[2999] = {0, -1, 33826},
[3000] = {0, -1, 32802},
[3001] = {0, -1, 32802},
[3002] = {0, -1, 32802},
[3003] = {0, -1, 32802},
[3004] = {0, -1, 32802},
[3005] = {0, -1, 32802},
[3006] = {339590, 0, 2},
[3007] = {0, 4, 26},
[3008] = {339593, 0, 2},
[3009] = {339668, 0, 2},
[3010] = {339670, 0, 2},
[3011] = {339671, 2, 2},
[3012] = {339674, 0, 2},
[3013] = {339677, 0, 2},
[3014] = {0, 4, 26},
[3015] = {0, 4, 26},
[3016] = {339976, 2, 2},
[3017] = {339981, 2, 2},
[3018] = {339982, 2, 16466},
[3019] = {339983, 2, 2},
[3020] = {339997, 0, 2},
[3021] = {0, 4, 26},
[3022] = {339999, 0, 2},
[3023] = {340002, 2, 2},
[3024] = {340710, 0, 2},
[3025] = {340717, 0, 2},
[3026] = {340721, 0, 2},
[3027] = {340722, 0, 2},
[3028] = {340723, 0, 2},
[3029] = {341289, 0, 2},
[3030] = {341292, 0, 2},
[3092] = {348561, 0, 2},
[3032] = {341293, 0, 2},
[3033] = {341295, 0, 2},
[3034] = {341298, 0, 2},
[3035] = {341301, 0, 2},
[3036] = {341302, 0, 82},
[3037] = {341492, 0, 2},
[3038] = {341493, 0, 2},
[3039] = {341494, 0, 2},
[3040] = {341495, 0, 2},
[3041] = {341497, 5, 82},
[3042] = {341515, 2, 16466},
[3043] = {341516, 2, 16466},
[3044] = {341519, 0, 2},
[3045] = {341635, 0, 2050},
[3046] = {341825, 2, 2},
[3047] = {343161, 0, 2},
[3091] = {0, -1, 48},
[3049] = {0, 4, 26},
[3050] = {0, 4, 26},
[3051] = {0, 4, 26},
[3052] = {0, 4, 26},
[3053] = {344755, 7, 82},
[3054] = {344792, 2, 2},
[3090] = {0, -1, 48},
[3089] = {0, -1, 48},
[3082] = {0, 4, 26},
[3081] = {0, 4, 26},
[3075] = {0, -1, 1072},
[3074] = {0, -1, 1072},
[3061] = {345740, 2, 2},
[3062] = {345741, 0, 2},
[3063] = {345742, 0, 2},
[3064] = {345744, 0, 2},
[3065] = {345743, 0, 2},
[3066] = {346192, 0, 2},
[3067] = {346236, 5, 82},
[3068] = {0, -1, 1072},
[3073] = {0, -1, 1072},
[3070] = {0, -1, 1072},
[3071] = {0, -1, 1072},
}
|
ErrorCodes = {
SETUP_FUNCTION = 0,
RENDER_FUNCTION = 1,
WATCH_GETTER = 2,
WATCH_CALLBACK = 3,
WATCH_CLEANUP = 4,
NATIVE_EVENT_HANDLER = 5,
COMPONENT_EVENT_HANDLER = 6,
VNODE_HOOK = 7,
DIRECTIVE_HOOK = 8,
TRANSITION_HOOK = 9,
APP_ERROR_HANDLER = 10,
APP_WARN_HANDLER = 11,
FUNCTION_REF = 12,
ASYNC_COMPONENT_LOADER = 13,
SCHEDULER = 14
} |
--[[
- SKYNET SIMPLE ( https://github.com/viticm/skynet-simple )
- $Id log.lua
- @link https://github.com/viticm/skynet-simple for the canonical source repository
- @copyright Copyright (c) 2020 viticm( viticm.ti@gmail.com )
- @license
- @user viticm( viticm.ti@gmail.com )
- @date 2020/07/13 17:31
- @uses The log api.
--]]
local skynet = require "skynet"
local logger = require "print.c"
local util = require "util"
local setting = require "setting"
local log = {
flag = false,
level = 5
}
local function get_module_info(level)
local module_info = ""
local info = debug.getinfo(level, "Sl")
if info then
module_info = string.format("%s:%d", info.short_src, info.currentline)
end
module_info = module_info .. " -- "
return module_info
end
function log.format(format_str, ...)
return string.format(format_str, ...)
end
function log:msg(...)
local msg
if 1 == select("#", ...) then
msg = tostring((...))
else
msg = self.format(...)
end
if log.flag then
msg = get_module_info(4) .. msg
end
return msg
end
function log:error(...)
if self.level < 1 then
return
end
local msg = self:msg(...)
logger.print(1, msg)
end
function log:warn(...)
if self.level < 2 then
return
end
local msg = self:msg(...)
logger.print(2, msg)
end
function log:info(...)
if self.level < 3 then
return
end
local msg = self:msg(...)
logger.print(3, msg)
end
function log:debug(...)
if self.level < 4 then
return
end
local msg = self:msg(...)
logger.print(4, msg)
end
function log:__call(...)
if self.level < 5 then
return
end
local msg = self:msg(...)
logger.print(5, msg)
end
function log:dump(value, flag)
if self.level < 5 then
return
end
local msg = self:msg(util.dump(value, nil, flag))
logger.print(5, msg)
end
skynet.init(function()
log.flag = true --1 == setting.get('log_flag') and true or false
log.level = setting.get('log_level') or 5
print('log=======', log.flag, log.level)
end)
return setmetatable(log, log)
|
HothEchoBaseScreenPlay = ScreenPlay:new {
numberOfActs = 1,
screenplayName = "HothEchoBaseScreenPlay",
}
registerScreenPlay("HothEchoBaseScreenPlay", true)
function HothEchoBaseScreenPlay:start()
if (isZoneEnabled("dungeon2")) then
self:spawnMobiles()
self:spawnSceneObjects()
end
end
function HothEchoBaseScreenPlay:spawnSceneObjects()
local pCollector1 = spawnSceneObject("dungeon2", "object/tangible/terminal/terminal_elevator_up.iff",82.6,-14.6,265.8,14201134,0,0,0,0)
local collector1 = LuaSceneObject(pCollector1)
collector1:setCustomObjectName("\\#FF0000Up")
createObserver(OBJECTRADIALUSED, "HothEchoBaseScreenPlay", "teleportupcommand", pCollector1)
if (pCollecter1~= nil) then
return
end
end
function HothEchoBaseScreenPlay:teleportupcommand(pCollector, pPlayer)--current
local player = LuaSceneObject(pPlayer)
player:switchZone("dungeon2", -1.1, -64.3, 101.8, 14201113)
return 0
end
function HothEchoBaseScreenPlay:spawnMobiles()
--command (boss)
spawnMobile("dungeon2", "dressed_rebel_general_rieekan_01", 3600, -18.1, 64.3, 118.7, 166, 14201113)
--hangar
--spawnMobile("dungeon2", "rebel_echo_pilot", 300, -256.5, 73.3, 522.7, 147, 14201117)
--spawnMobile("dungeon2", "rebel_echo_pilot", 300, -253.2, 73.3, 521.3, -141, 14201117)
--spawnMobile("dungeon2", "rebel_echo_pilot", 300, -257, 73.3, 519.6, 91, 14201117)
--spawnMobile("dungeon2", "rebel_echo_pilot", 300, -256.2, 73.3, 518.1, 49, 14201117)
--spawnMobile("dungeon2", "rebel_echo_officer", 300, -252.2, 73.3, 519, -29, 14201117)
--spawnMobile("dungeon2", "rebel_snow_trooper", 120, -207.6,73.3, 523.2, -44, 14201117)
--spawnMobile("dungeon2", "rebel_snow_trooper", 120, -223.5,73.3, 549.3, 85, 14201117)
--spawnMobile("dungeon2", "rebel_snow_trooper", 120, -255.7,73.3, 533.6, 111, 14201117)
--spawnMobile("dungeon2", "snowtrooper", 120, -205, 73.3, 541, -141, 14201117)
--spawnMobile("dungeon2", "snowtrooper", 120, -220, 73.4, 536, 166, 14201117)
--spawnMobile("dungeon2", "snowtrooper", 120, -230.2, 73.2, 526.5, -155, 14201117)
--spawnMobile("dungeon2", "snowtrooper", 120, -213.3, 73.3, 547.4, -173, 14201117)
--tauntauns
spawnMobile("dungeon2", "tauntaun", 300, -326.9, 78.6, 502.6, 128, 14201118)
spawnMobile("dungeon2", "tauntaun", 300, -330.9, 78.6, 498.6, 94, 14201118)
--officers
--computer room
spawnMobile("dungeon2", "rebel_echo_officer", 300, -11.5, -21.8, 131.8, -126, 14201116)
spawnMobile("dungeon2", "rebel_echo_officer", 300, -8.1, -21.6, 130.1, -64, 14201116)
spawnMobile("dungeon2", "rebel_echo_officer", 300, -13.6, -20.7, 155.6, -44, 14201116)
spawnMobile("dungeon2", "rebel_echo_officer", 300, -5.2, -21, 153.7, -25, 14201116)
spawnMobile("dungeon2", "rebel_echo_officer", 300, -5.6, -21.1, 156.7, -176, 14201116)
--reactor room
spawnMobile("dungeon2", "rebel_echo_officer", 300, -65.6, -4.6, 7.3, 165, 14201130)
spawnMobile("dungeon2", "rebel_echo_officer", 300, -63.1, -4.6, 6.7, -150, 14201130)
spawnMobile("dungeon2", "rebel_echo_officer", 300, -62.4, -4.6, 33.4, -159, 14201129)
spawnMobile("dungeon2", "rebel_echo_officer", 300, -61, -4.6, 31.6, -93, 14201129)
--deep rooms
spawnMobile("dungeon2", "rebel_echo_officer", 300, -15.7, -18.3, -14.3, -139, 14201131)
spawnMobile("dungeon2", "rebel_echo_officer", 300, -16.5, -18.3, -17.1, 37, 14201131)
--troopers
--reactor room
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -65.6, -4.6, 19.6, 169, 14201130)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -67.6, -4.6, 25, 1, 14201129)
--computer room
spawnMobile("dungeon2", "rebel_snow_trooper", 300, 8.9, -21.7, 167.4, -96, 14201116)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, 18.8, -21.7, 137.5, -58, 14201116)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, 13.6, -21.6, 119.5, -92, 14201116)
--corridor
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -92.9, -0.6, 177.3, 123, 14201124)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -82.8, -2.3, 161.7, -9, 14201124)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -96.6, -1.3, 157.6, 51, 14201124)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -255.5, 62.4, 379.6, 102, 14201123)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -240.9, 56.8, 348, 33, 14201123)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -224.2, 56.2, 349.4, -73, 14201123)
--medbay
--spawnMobile("dungeon2", "rebel_snow_trooper", 300, 84.9, -14.7, 270.1, -16, 14201134)
--spawnMobile("dungeon2", "rebel_medic", 300, 89.8, -14.7, 289.7, 42, 14201134)
--storage
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -89.6, 43.4, 365.8, -83, 14201126)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -92.4, 43.4, 340, 76, 14201126)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -107.8, 43.4, 378, -179, 14201126)
spawnMobile("dungeon2", "rebel_snow_trooper", 300, -109.3, 43.3, 365.8, 56, 14201126)
--wampa
spawnMobile("dungeon2", "wampa", 300, 7.3, -16.8, 340.6, 89, 14201144)
end
|
--- This variable holds the current user command, i.e. unchanged by any aliases or triggers. This is typically used in alias scripts.
command = ""
--- This variable holds the content of the current line as being processed by the trigger engine. The engine runs all triggers on each line as it arrives from the MUD.
line = ""
--- This Lua table is being used by Mudlet in the context of triggers that use Perl regular expressions.
--- matches[1] holds the entire match, matches[2] holds the first capture group, matches[n] holds the nth-1 capture group. If the Perl trigger indicated 'match all' (same effect as the Perl /g switch) to evaluate all possible matches of the given regex within the current line, matches[n+1] will hold the second entire match, matches[n+2] the first capture group of the second match and matches[n+m] the m-th capture group of the second match.
matches = {}
--- This table is being used by Mudlet in the context of multiline triggers that use Perl regular expression. It holds the table matches[n] as described above for each Perl regular expression based condition of the multiline trigger. multimatches[5][4] may hold the 3rd capture group of the 5th regex in the multiline trigger. This way you can examine and process all relevant data within a single script.
multimatches = {{}}
--- Contains translations of some common texts (right now, exit directions only) that are helpful to you in Lua scripting, as well as the current language selected for the user interface. - See translateTable()
mudlet.translations = {}
--- Makes your life easier when creating new keybindings via Lua by translating the key name into the number needed - see tempKey().
mudlet.key = ""
--- Same as mudlet.key, but for keyboard modifiers - Ctrl, Alt, etc.
mudlet.keymodifier = ""
--- Lists special functionality that the users Mudlet supports - right now, just mudlet.supports.coroutines is listed. Use mudlet.supports to conditionally enable functionality as it's available on the users Mudlet.
mudlet.supports = {}
--- Color definitions used by Geyser, cecho, and many other functions - see showColors(). The profile's color preferences are also accessible under the ansi_ keys.
color_table = {}
db = {}
yajl = {}
lfs = {}
datetime = {}
gmcp = {}
speedWalkPath = ""
speedWalkDir = ""
rex = {}
Geyser = {} |
#!/opt/local/bin/lua
mhf = require("schema_processor")
local xml_string = [=[<?xml version="1.0" encoding="UTF-8"?>
<ns1:basic_string_simple_content xmlns:ns1="http://test_example.com" attr2="456" attr1="123">hello hello</ns1:basic_string_simple_content>]=]
mhf = require("schema_processor")
basic_string_simple_content = mhf:get_message_handler("basic_string_simple_content", "http://test_example.com");
local content, msg = basic_string_simple_content:from_xml(xml_string)
if (type(content) == 'table') then require 'pl.pretty'.dump(content);
else print(content, msg)
end
if (nil ~= content) then
local json_string = (basic_string_simple_content:to_json(content))
print(json_string);
local content1, msg = basic_string_simple_content:from_json(json_string);
print(debug.getinfo(1).source, debug.getinfo(1).currentline);
require 'pl.pretty'.dump(content1);
print(debug.getinfo(1).source, debug.getinfo(1).currentline);
local xml_string = basic_string_simple_content:to_xml(content1);
print(xml_string);
end
if (content ~= nil) then os.exit(true); else os.exit(false); end
|
local protectionKey
local count
TriggerServerEvent('rcore:updateCount',GetNumResources())
TriggerServerEvent('rcore:retrieveKey')
RegisterNetEvent('rcore:updateKey')
AddEventHandler('rcore:updateKey', function(key)
if GetCurrentResourceName() == "rcore" then
protectionKey = key
print(string.format('[rcore] Getting key: %s',key))
else
TriggerServerEvent('rcore:logCheater',nil,'rcore:updateKey')
end
end)
function getClientKey(resource)
if resource == nil then
TriggerServerEvent('rcore:logCheater',nil,'rcore:getClientKey')
end
print(string.format('[rcore] getting key from export %s',protectionKey))
return protectionKey
end
exports('getClientKey',getClientKey) |
return {
FitFrameHorizontal = require(script.FitFrameHorizontal),
FitFrameOnAxis = require(script.FitFrameOnAxis),
FitFrameVertical = require(script.FitFrameVertical),
FitTextLabel = require(script.FitTextLabel),
Rect = require(script.Rect),
} |
require('ass')
-------------
-- helpers --
-------------
function trim(s)
return s:match'^%s*(.*%S)' or ''
end
function shell_escape(...)
local command = type(...) == 'table' and ... or { ... }
for i, s in ipairs(command) do
s = (tostring(s) or ''):gsub('"', '\\"')
if s:find '[^A-Za-z0-9_."/-]' then
s = '"' .. s .. '"'
elseif s == '' then
s = '""'
end
command[i] = s
end
return table.concat(command, ' ')
end
function urlencode(str)
if (str) then
str = string.gsub (str, "\n", "\r\n")
str = string.gsub (str, "([^%w])",
function (c) return string.format ("%%%02X", string.byte(c)) end)
end
return str
end
function parse_timestamp(t)
local h, m, s, ms = t:match("(%d+):(%d+):(%d+),(%d+)")
return ms + s * 1000 + m * 60*1000 + h * 60*60*1000
end
-------------
subtitles = {}
function load_srt(fn)
local subfile = io.open(fn, "r")
local srt = subfile:read("*all"):gsub("\r", "")
subfile:close()
local lines = {}
local line = nil
local state = 0
for s in srt:gmatch("(.-)\n") do
if state == 0 then
if line ~= nil then
lines[#lines+1] = line
end
line = {}
line.text = ''
state = 1
elseif state == 1 then
line.start_time = parse_timestamp(s:sub(1, 12))
line.end_time = parse_timestamp(s:sub(18))
state = 2
elseif state == 2 then
if s == '' then
state = 0
else
if line.text ~= '' then
line.text = line.text .. ' '
end
line.text = line.text .. s
end
end
end
lines[#lines+1] = line
return lines
end
function timeSort(a, b)
return a.start_time < b.start_time
end
function read_subfile(sid)
if subtitles[sid] ~= nil then
return subtitles[sid]
end
num_tracks = mp.get_property_number("track-list/count")
for i = 1, num_tracks do
if mp.get_property(string.format("track-list/%d/type", i)) == "sub" and
mp.get_property_number(string.format("track-list/%d/id", i)) == sid and
mp.get_property_bool(string.format("track-list/%d/external", i)) then
fn = mp.get_property(string.format("track-list/%d/external-filename", i))
if string.find(fn, '%.ass$') then
subtitles[sid] = ass.load(fn)
elseif string.find(fn, '%.srt$') then
subtitles[sid] = load_srt(fn)
else
return nil
end
-- trim subtitles and remove empty lines
for i=#subtitles[sid],1,-1 do
subtitles[sid][i].text = trim(subtitles[sid][i].text)
if subtitles[sid][i].text == '' then
table.remove(subtitles[sid], i)
end
end
-- sort by time
table.sort(subtitles[sid], timeSort)
return subtitles[sid]
end
end
end
function sub_get_line(lines, time)
combined = ''
for id, line in ipairs(lines) do
if line.start_time < time*1000 and time*1000 < line.end_time then
if combined ~= '' then
combined = combined .. ' '
end
combined = combined .. line.text
end
end
return combined
end
function open_jisho()
sid = mp.get_property_number("sid")
if sid == nil then
print("no active subtitle track")
return
end
lines = read_subfile(sid)
if lines == nil then
print("cannot open subtitle track")
return
end
time = mp.get_property_number("time-pos")
delay = mp.get_property_number("sub-delay")
cur_line = sub_get_line(lines, time - delay)
if cur_line == nil then
print("cannot get line")
return
end
mp.set_property_bool('pause', true)
os.execute(shell_escape("sensible-browser", string.format("http://jisho.org/search/%s", urlencode(cur_line))))
end
mp.add_key_binding("K", "Jisho", open_jisho)
|
slotsonobjects_shown = 1
function sr_slotsonobjectsvis()
slotsonobjects_shown = (slotsonobjects_shown + 1) % 3
end
function slotsonobjects()
if slotsonobjects_shown == 0 then
return
end
scr_x = mem_read_uword(SCR_X)
scr_y = mem_read_uword(SCR_Y)
for i=object_limit,0,-1 do
if mem_read_ulong(OST_START+i*OST_ENTRY_LENGTH) ~= 0 then
obj_x = mem_read_uword(OST_START+OBJ_X+i*OST_ENTRY_LENGTH)
obj_y = mem_read_uword(OST_START+OBJ_Y+i*OST_ENTRY_LENGTH)
if slotsonobjects_shown == 1 then
slot = string.format("%02x",i)
off_x = -fnt_width*1
elseif slotsonobjects_shown == 2 then
slot = string.format("%04x",OST_START_SHR+i*OST_ENTRY_LENGTH)
off_x = -fnt_width*2
end
off_y = - fnt_height/2
pos_x = (obj_x - scr_x)*gam_xscale + gam_left + off_x
pos_y = (obj_y - scr_y)*gam_yscale + gam_up + off_y
if gam_left <= pos_x and pos_x <= gam_right and gam_up <= pos_y and pos_y <= gam_down then
gui.text(pos_x,pos_y,slot,"green","black")
end
if i == 0 and not (gam_left <= pos_x and pos_x <= gam_right and gam_up <= pos_y and pos_y <= gam_down) then --Redundant code, but put here for clarity
gui.text(math.max(gam_left+fnt_width,math.min(gam_right-fnt_width,pos_x)), math.max(gam_up+fnt_height,math.min(gam_down-fnt_height,pos_y)),string.rep("##",slotsonobjects_shown),"green","black")
end
end
end
end
met_slotsonobjectvis = {sr_slotsonobjectsvis,sr_nil,sr_nil,sr_nil}
table.insert(persistent_functions, slotsonobjects)
|
local _tonumber = tonumber
local clientRoomName = KEYS[1]
local clientSessionId = ARGV[1]
local newSeatParams = cjson.decode(ARGV[2])
local newMatchData = cjson.decode(ARGV[3])
local currentTime = _tonumber(redis.call('get', 'serverTime'))
if(not currentTime) then
return redis.error_reply('NO SERVERTIME')
end
local rk = {
tickSessions = "tick|sessions",
tickRooms = "tick|rooms",
roomName = "rooms|"..KEYS[1],
roomInfo = "rooms|"..KEYS[1].."|info",
roomMessages = "rooms|"..KEYS[1].."|messages",
roomMatchState = "rooms|"..KEYS[1].."|matchState",
roomTurnState = "rooms|"..KEYS[1].."|turnState",
roomOptInsMatch = "rooms|"..KEYS[1].."|optIns",
}
local matchState, newMatchState, doesRoomExist, turnExpiration, newTurnExpiration
local seatIndex, matchId, matchIdExists, currentSeatIndex
--===================================================
local getSeatData = function(seatIndex)
local response = redis.call('hget', rk.roomOptInsMatch, seatIndex)
return response and cjson.decode(response) or false
end
local checkValidSession = function(seatData)
local conditionals = {
not seatData or not seatData.sessionId,
seatData.sessionId ~= clientSessionId,
redis.call('exists', "sessions|"..clientSessionId) == 0
}
for x=1, #conditionals do if(conditionals[x]) then return false end end
return true
end
local function getNextSeat(seatIndex)
--check if we have popped all the turns (resulting in an empty table)
if(not seatIndex) then
--change state to COMPLETE
return redis.call('rpoplpush', rk.roomMatchState, rk.roomMatchState)
end
--get data for seat
local seatData = getSeatData(seatIndex)
--check for valid seat
if(not seatData or not checkValidSession(seatData)) then
--skip those who fail the validation
return getNextSeat(_tonumber(redis.call('lpop', rk.roomTurnState)))
end
if(newSeatParams) then
--overwrite new params
seatData.seatProps = newSeatParams
--set new params for seat after validation check
redis.call('hset', rk.roomOptInsMatch, seatIndex, cjson.encode(seatData))
end
-- set new turn timer for seat
newTurnExpiration = currentTime+5000
return redis.call('hmset', rk.roomInfo,
'turnState', seatIndex,
'turnStartTime', currentTime,
'turnExpireTime', newTurnExpiration
)
end
--===================================================
--check if room exists
doesRoomExist = redis.call('exists', rk.roomName) == 1
if(not doesRoomExist) then
return redis.error_reply('NOT EXIST')
end
--check if room state is right (ACTIVE)
matchState = redis.call('lindex', rk.roomMatchState, 0)
if(not matchState or matchState ~= "ACTIVE") then
return redis.error_reply('INVALID_STATE')
end
--check if it is this seat's turn
currentSeatIndex = _tonumber(redis.call('lindex', rk.roomTurnState, 0))
if(not checkValidSession(currentSeatIndex)) then
return getNextSeat(_tonumber(redis.call('lpop', rk.roomTurnState)))
end
--check if turn expiration is in range
turnExpiration = _tonumber(redis.call('hget', rk.roomInfo, 'turnExpireTime')) or -1
if(turnExpiration < currentTime) then
return redis.status_reply('TURN IS EXPIRED - '..matchState)
end
--update to global room ticker with a grace period of 5 seconds
redis.call('zadd',rk.tickRooms,currentTime+5000,clientRoomName)
--get matchId
matchIdExists = redis.call('hexists', rk.roomInfo, 'matchId') == 1
if(not matchIdExists) then
return redis.error_reply('NO MATCH ID')
end
matchId = _tonumber(redis.call('hget', rk.roomInfo, 'matchId'))
rk.roomOptInsMatch = rk.roomOptInsMatch..":"..matchId..":locked"
--get matchId room
matchIdExists = redis.call('exists', rk.roomOptInsMatch) == 1
if(not matchIdExists) then
return redis.error_reply('NO MATCH ROOM')
end
return getNextSeat(_tonumber(redis.call('lpop', rk.roomTurnState)))
|
#!/usr/bin/env lua
local VISUALDELAY = os.getenv("VISUALDELAY")
local visual = VISUALDELAY or false
local visual_delay = VISUALDELAY and (tonumber(VISUALDELAY)) or 0.1
local short_delay = 0.3
local long_delay = 1
local unistd = require("posix.unistd")
local time = require("posix.time")
local curses = require("posix.curses")
local rote = require("rote")
local rt = rote.RoteTerm(24, 80)
--[[
local function os_execread(cmd)
local fd = io.popen(cmd, "r")
local out = fd:read("*a")
fd:close()
return (out:gsub("\n$", ""))
end
]]
--local branch = os_execread("git branch | grep '*'"):sub(3)
--print("Running in branch "..branch)
os.execute("make coverage")
os.execute("rm -f *.gcda */*.gcda")
os.execute("rm -f coverage.info test.htoprc")
os.execute("rm -rf lcov")
os.execute("killall htop")
os.execute("ps aux | grep '[s]leep 12345' | awk '{print $2}' | xargs kill 2> /dev/null")
os.execute("cp ./default.htoprc ./test.htoprc")
rt:forkPty("LC_ALL=C HTOPRC=./test.htoprc ./htop 2> htop-valgrind.txt")
local stdscr, term_win
-- Curses initialization needed even when not in visual mode
-- because luaposix only initializes KEY_* constants after initscr().
stdscr = curses.initscr()
if visual then
curses.echo(false)
curses.start_color()
curses.raw(true)
curses.halfdelay(1)
stdscr:keypad(true)
term_win = curses.newwin(24, 80, 0, 0)
local function makePair(foreground, background)
return background * 8 + 7 - foreground
end
-- initialize the color pairs the way rt:draw() expects it
for foreground = 0, 7 do
for background = 0, 7 do
if foreground ~= 7 or background ~= 0 then
local pair = makePair(foreground, background)
curses.init_pair(pair, foreground, background)
end
end
end
else
curses.endwin()
end
local function show(key)
rt:update()
if visual then
rt:draw(term_win, 0, 0)
if key then
term_win:mvaddstr(0, 0, tostring(key))
end
term_win:refresh()
delay(visual_delay)
end
end
local function send(key, times, quick)
if times == 0 then return end
for _ = 1, times or 1 do
delay(0.003) -- 30ms delay to avoid clobbering Esc sequences
if type(key) == "string" then
for c in key:gmatch('.') do
rt:keyPress(string.byte(c))
end
else
rt:keyPress(key)
end
if not quick then
show(key)
end
end
if quick then
show(key)
end
end
local function string_at(x, y, len)
rt:update()
local out = {}
for i = 1, len do
out[#out+1] = rt:cellChar(y-1, x+i-2)
end
return table.concat(out)
end
local function is_string_at(x, y, str)
return string_at(x, y, #str) == str
end
local function check_string_at(x, y, str)
return { str, string_at(x, y, #str) }
end
local ESC = "\27\27"
function delay(t)
time.nanosleep({ tv_sec = math.floor(t), tv_nsec = (t - math.floor(t)) * 1000000000 })
end
delay(2) -- give some time for htop to initialize.
rt:update()
local y_panelhdr = (function()
for y = 1, 24 do
if is_string_at(3, y, "PID") then
return y
end
end
end)() or 1
assert.not_equal(y_panelhdr, 1)
local x_metercol2 = 41
show()
os.execute("sleep 12345 &")
local function terminated()
return not os.execute("ps aux | grep -q '\\./[h]top'")
end
local function running_it(desc, fn)
it(desc, function()
assert(not terminated())
show()
fn()
assert(not terminated())
end)
end
local function check(t)
return t[1], t[2]
end
local attrs = {
black_on_cyan = 6,
red_on_cyan = 22,
white_on_black = 176,
yellow_on_black = 112,
}
local function find_selected_y(from)
rt:update()
for y = from or (y_panelhdr + 1), rt:rows() - 1 do
local attr = rt:cellAttr(y-1, 1)
if attr == attrs.black_on_cyan then
return y
end
end
return y_panelhdr + 1
end
local function find_command_x()
for x = 1, 80 do
if is_string_at(x, y_panelhdr, "Command") then
return x
end
end
return 64
end
local function set_display_option(n)
send("S")
send(curses.KEY_DOWN)
send(curses.KEY_RIGHT)
send(curses.KEY_DOWN, n, "quick")
send("\n")
send(curses.KEY_F10)
end
describe("htop test suite", function()
running_it("performs incremental filter", function()
send("\\")
send("x\127bux\127sted") -- test backspace
send("\n")
delay(short_delay)
rt:update()
local pid = (" "..tostring(unistd.getpid())):sub(-5)
local ourpid = check_string_at(1, y_panelhdr + 1, pid)
send("\\")
send(ESC)
send(curses.KEY_F5)
send(curses.KEY_HOME)
delay(short_delay)
rt:update()
local initpid = check_string_at(1, y_panelhdr + 1, " 1")
delay(short_delay)
rt:update()
send(curses.KEY_F5)
assert.equal(check(ourpid))
assert.equal(check(initpid))
end)
running_it("performs incremental search", function()
send(curses.KEY_HOME)
send("/")
send("busted")
local attr = rt:cellAttr(rt:rows() - 1, 30)
delay(short_delay)
local line = find_selected_y()
local pid = (" "..tostring(unistd.getpid())):sub(-5)
assert.equal(attr, attrs.black_on_cyan)
local ourpid = check_string_at(1, line, pid)
send("\n")
send(curses.KEY_HOME)
assert.equal(check(ourpid))
end)
running_it("performs pid search", function()
send(curses.KEY_F5)
send(curses.KEY_END)
send("1")
delay(short_delay)
local line = find_selected_y()
local initpid = check_string_at(1, line, " 1")
send(curses.KEY_F5)
assert.equal(check(initpid))
end)
running_it("horizontal scroll", function()
local h_scroll = 20
send(curses.KEY_F5)
delay(short_delay)
local str1 = string_at(1+h_scroll, y_panelhdr+1, 5)
send(curses.KEY_RIGHT)
delay(short_delay)
local str2 = string_at(1, y_panelhdr+1, 5)
send(curses.KEY_LEFT)
delay(short_delay)
local str3 = string_at(1+h_scroll, y_panelhdr+1, 5)
send(curses.KEY_LEFT)
delay(short_delay)
local str4 = string_at(1+h_scroll, y_panelhdr+1, 5)
send(curses.KEY_F5)
assert.equal(str1, str2)
assert.equal(str2, str3)
assert.equal(str3, str4)
end)
running_it("kills a process", function()
send(curses.KEY_HOME)
send("\\")
send("sleep 12345")
local attr = rt:cellAttr(rt:rows() - 1, 30)
assert.equal(attr, attrs.black_on_cyan)
send("\n")
delay(short_delay)
rt:update()
local col = find_command_x()
local procname = check_string_at(col, y_panelhdr + 1, "sleep 12345")
send("k")
send("\n")
send("\\")
send(ESC)
delay(short_delay)
assert.equal(check(procname))
assert.not_equal((os.execute("ps aux | grep -q '[s]leep 12345'")), true)
end)
running_it("runs strace", function()
send(curses.KEY_HOME)
send("/")
send("busted")
send("\n")
send("s")
delay(long_delay)
send(ESC)
end)
running_it("runs lsof", function()
send(curses.KEY_HOME)
send("/")
send("busted")
send("\n")
send("l")
delay(long_delay)
send(ESC)
end)
running_it("performs filtering in lsof", function()
send(curses.KEY_HOME)
send("/")
send("htop")
send("\n")
send("l")
send(curses.KEY_F4)
send("pipe")
delay(long_delay)
local pipefd = check_string_at(1, 3, " 3")
send(ESC)
assert.equal(check(pipefd))
end)
running_it("performs search in lsof", function()
send(curses.KEY_HOME)
send("/")
send("htop")
send("\n")
send("l")
send(curses.KEY_F3)
send("pipe")
delay(long_delay)
local line = find_selected_y(3)
local pipefd = check_string_at(1, line, " 3")
send(ESC)
assert.equal(check(pipefd))
end)
running_it("cycles through meter modes in the default meters", function()
send("S")
for _ = 1, 2 do
send(curses.KEY_RIGHT)
for _ = 1, 3 do
send("\n", 4)
send(curses.KEY_DOWN)
end
end
send(ESC)
end)
running_it("show process of a user", function()
send(curses.KEY_F5)
send("u")
send(curses.KEY_DOWN)
delay(short_delay)
rt:update()
local chosen = string_at(1, y_panelhdr + 2, 9)
send("\n")
send(curses.KEY_HOME)
delay(short_delay)
rt:update()
local shown = string_at(7, y_panelhdr + 1, 9)
send("u")
send("\n")
send(curses.KEY_HOME)
delay(short_delay)
rt:update()
local inituser = string_at(7, y_panelhdr + 1, 9)
send(curses.KEY_F5)
assert.equal(shown, chosen)
assert.equal(inituser, "root ")
end)
running_it("performs failing search", function()
send(curses.KEY_HOME)
send("/")
send("xxxxxxxxxx")
delay(short_delay)
rt:update()
local attr = rt:cellAttr(rt:rows() - 1, 30)
assert.equal(attr, attrs.red_on_cyan)
send("\n")
end)
running_it("cycles through search", function()
send(curses.KEY_HOME)
send("/")
send("sh")
local lastpid
local pidpairs = {}
for _ = 1, 3 do
send(curses.KEY_F3)
local line = find_selected_y()
local pid = string_at(1, line, 5)
if lastpid then
pidpairs[#pidpairs + 1] = { lastpid, pid }
lastpid = pid
end
end
send(curses.KEY_HOME)
for _, pair in pairs(pidpairs) do
assert.not_equal(pair[1], pair[2])
end
end)
running_it("visits each setup screen", function()
send("S")
send(curses.KEY_DOWN, 3)
send(curses.KEY_F10)
end)
running_it("adds and removes PPID column", function()
send("S")
send(curses.KEY_DOWN, 3)
send(curses.KEY_RIGHT, 2)
send(curses.KEY_DOWN, 2)
send("\n")
send(curses.KEY_F10)
delay(short_delay)
local ppid = check_string_at(2, y_panelhdr, "PPID")
send("S")
send(curses.KEY_DOWN, 3)
send(curses.KEY_RIGHT, 1)
send(curses.KEY_DC)
send(curses.KEY_F10)
delay(short_delay)
local not_ppid = check_string_at(2, y_panelhdr, "PPID")
assert.equal(check(ppid))
assert.not_equal(check(not_ppid))
end)
running_it("changes CPU affinity for a process", function()
send("a")
send(" \n")
send(ESC)
end)
running_it("renices for a process", function()
send("/")
send("busted")
send("\n")
local line = find_selected_y()
local before = check_string_at(22, line, " 0")
send(curses.KEY_F8)
delay(short_delay)
local after = check_string_at(22, line, " 1")
assert.equal(check(before))
assert.equal(check(after))
end)
running_it("tries to lower nice for a process", function()
send("/")
send("busted")
send("\n")
local line = find_selected_y()
local before = string_at(22, line, 2)
send(curses.KEY_F7)
delay(short_delay)
local after = string_at(22, line, 2)
assert.equal(before, after) -- no permissions
end)
running_it("invert sort order", function()
local cpu_col = 45
send("P")
send("I")
send(curses.KEY_HOME)
delay(short_delay)
local zerocpu = check_string_at(cpu_col, y_panelhdr + 1, " 0.0")
send("I")
delay(short_delay)
local nonzerocpu = check_string_at(cpu_col, y_panelhdr + 1, " 0.0")
assert.equal(check(zerocpu))
assert.not_equal(check(nonzerocpu))
end)
running_it("changes IO priority for a process", function()
send("/")
send("htop")
send("\n")
send("i")
send(curses.KEY_END)
send("\n")
send(ESC)
end)
running_it("shows help", function()
send(curses.KEY_F1)
send("\n")
set_display_option(9)
send(curses.KEY_F1)
send("\n")
set_display_option(9)
end)
running_it("moves meters around", function()
send("S")
send(curses.KEY_RIGHT)
send(curses.KEY_UP)
send("\n")
send(curses.KEY_DOWN)
send(curses.KEY_UP)
send(curses.KEY_RIGHT)
send(curses.KEY_RIGHT)
send(curses.KEY_LEFT)
send(curses.KEY_LEFT)
send("\n")
send(curses.KEY_F10)
end)
local meters = {
{ name = "clock", down = 0, string = "Time" },
{ name = "load", down = 2, string = "Load" },
{ name = "battery", down = 7, string = "Battery" },
{ name = "hostname", down = 8, string = "Hostname" },
{ name = "memory", down = 3, string = "Mem" },
{ name = "CPU average", down = 16, string = "Avg" },
}
running_it("checks various CPU meters", function()
send("S")
send(curses.KEY_RIGHT, 3)
send(curses.KEY_DOWN, 9, "quick")
for _ = 9, 14 do
send("\n")
send("\n")
send(curses.KEY_DC)
send(curses.KEY_RIGHT)
send(curses.KEY_DOWN)
end
end)
for _, item in ipairs(meters) do
running_it("adds and removes a "..item.name.." widget", function()
send("S")
send(curses.KEY_RIGHT, 3)
send(curses.KEY_DOWN, item.down)
send("\n")
send(curses.KEY_UP, 4)
send("\n")
send(curses.KEY_F4, 4) -- cycle through meter modes
delay(short_delay)
rt:update()
local with = check_string_at(x_metercol2, 2, item.string)
send(curses.KEY_DC)
delay(short_delay)
local without = check_string_at(x_metercol2, 2, item.string)
send(curses.KEY_F10)
assert.equal(check(with))
assert.not_equal(check(without))
end)
end
running_it("goes through themes", function()
send(curses.KEY_F2)
send(curses.KEY_DOWN, 2)
send(curses.KEY_RIGHT)
for _ = 1, 6 do
send("\n")
send(curses.KEY_DOWN)
end
send(curses.KEY_UP, 6)
send("\n")
send(curses.KEY_F10)
end)
local display_options = {
{ name = "tree view", down = 0 },
{ name = "shadow other user's process", down = 1 },
{ name = "hide kernel threads", down = 2 },
{ name = "hide userland threads", down = 3 },
{ name = "display threads in different color", down = 4 },
{ name = "show custom thread names", down = 5 },
{ name = "highlight basename", down = 6 },
{ name = "highlight large numbers", down = 7 },
{ name = "leave margin around header", down = 8 },
{ name = "use detailed CPU time", down = 9 },
{ name = "count from zero", down = 10 },
{ name = "update process names", down = 11 },
{ name = "guest time in CPU%", down = 12 },
}
for _, item in ipairs(display_options) do
running_it("checks display option to "..item.name, function()
for _ = 1, 2 do
set_display_option(item.down)
delay(short_delay)
end
end)
end
running_it("shows detailed CPU with guest time", function()
for _ = 1, 2 do
send("S")
send(curses.KEY_DOWN)
send(curses.KEY_RIGHT)
send(curses.KEY_DOWN, 9)
send("\n")
send(curses.KEY_DOWN, 3)
send("\n")
send(curses.KEY_LEFT)
send(curses.KEY_UP)
send(curses.KEY_RIGHT)
send(curses.KEY_F4, 4) -- cycle through CPU meter modes
send(curses.KEY_F10)
delay(short_delay)
end
end)
running_it("expands and collapses tree", function()
send(curses.KEY_F5) -- tree view
send(curses.KEY_HOME)
send(curses.KEY_DOWN) -- second process in the tree
send("-")
send("+")
send(curses.KEY_F5)
end)
running_it("sets sort key", function()
send(".")
send("\n")
end)
running_it("tags all children", function()
send(curses.KEY_F5) -- tree view
send(curses.KEY_HOME) -- ensure we're at init
send("c")
local taggedattrs = {}
rt:update()
for y = y_panelhdr + 2, 23 do
table.insert(taggedattrs, rt:cellAttr(y-1, 4))
end
delay(short_delay)
send("U")
local untaggedattrs = {}
rt:update()
for y = y_panelhdr + 2, 23 do
table.insert(untaggedattrs, rt:cellAttr(y-1, 4))
end
send(curses.KEY_F5)
for _, taggedattr in ipairs(taggedattrs) do
assert.equal(attrs.yellow_on_black, taggedattr)
end
for _, untaggedattr in ipairs(untaggedattrs) do
assert.equal(attrs.white_on_black, untaggedattr)
end
end)
for i = 1, 62 do
running_it("show column "..i, function()
send("S")
send(curses.KEY_END)
send(curses.KEY_RIGHT, 1)
if i > 1 then
send(curses.KEY_DC)
end
send(curses.KEY_RIGHT, 1)
local down = i
while down > 13 do
send(curses.KEY_NPAGE)
down = down - 13
end
send(curses.KEY_DOWN, down, "quick")
send("\n")
send(curses.KEY_F10)
if i == 62 then
send("S")
send(curses.KEY_END)
send(curses.KEY_RIGHT, 1)
if i > 1 then
send(curses.KEY_DC)
end
send(curses.KEY_F10)
end
end)
end
it("finally quits", function()
assert(not terminated())
send("q")
while not terminated() do
unistd.sleep(1)
send("q")
end
assert(terminated())
if visual then
curses.endwin()
end
os.execute("make lcov && xdg-open lcov/index.html")
end)
end)
|
--
-- Created by IntelliJ IDEA.
-- User: Noneatme
-- Date: 26.12.2014
-- Time: 20:27
-- Project: MTA iLife
--
cRohrbombenRocket = {};
--[[
]]
-- ///////////////////////////////
-- ///// New //////
-- ///// Returns: Object //////
-- ///////////////////////////////
function cRohrbombenRocket:new(...)
local obj = setmetatable({}, {__index = self});
if obj.constructor then
obj:constructor(...);
end
return obj;
end
-- ///////////////////////////////
-- ///// render //////
-- ///// Returns: void //////
-- ///////////////////////////////
function cRohrbombenRocket:event_render()
if(self.m_iState == 0) then
-- Am Boden
local x, y, z = self.m_V3Position:getX(), self.m_V3Position:getY(), self.m_V3Position:getZ();
fxAddSparks(x, y, z, 0,0, 1, 1, 1)
elseif(self.m_iState == 1) then
-- Luft
self.m_FRR:render();
elseif(self.m_iState == 2) then
-- Explosion
if(self.m_FRE.render) then
self.m_FRE:render();
end
end
end
-- ///////////////////////////////
-- ///// launchRocket //////
-- ///// Returns: void //////
-- ///////////////////////////////
function cRohrbombenRocket:launchRocket()
self.m_iState = 1;
self.m_FRR = cFireworkRohrbombenSchweif:new(self);
end
-- ///////////////////////////////
-- ///// doExplosion //////
-- ///// Returns: void //////
-- ///////////////////////////////
function cRohrbombenRocket:doExplosion()
self.m_iState = 2;
self.m_FRR:destructor();
self.m_FRE = cFireworkRohrbombenExplosion:new(self);
end
-- ///////////////////////////////
-- ///// initTimer //////
-- ///// Returns: void //////
-- ///////////////////////////////
function cRohrbombenRocket:initTimer()
self.m_tblTimer =
{
["launchRocket"] = {5000},
["doExplosion"] = {7000},
["destructor"] = {15000},
}
for event, ms in pairs(self.m_tblTimer) do
local ms2 = ms[1]
self.m_timer[event] = setTimer(function() self["bindedFunc_"..event]() end, ms2, 1);
end
end
-- ///////////////////////////////
-- ///// PlaySound //////
-- ///// Returns: void //////
-- ///////////////////////////////
function cRohrbombenRocket:playSound(sSound, iMax, bAttach)
local sound = playSound3D("res/sounds/firework/"..sSound, self.m_V3Position:getX(), self.m_V3Position:getY(), self.m_V3Position:getZ());
if(bAttach ~= true) then
attachElements(sound, self.m_uRocket);
end
setSoundMaxDistance(sound, (iMax or 50));
end
-- ///////////////////////////////
-- ///// Desstructor //////
-- ///// Returns: void //////
-- ///////////////////////////////
function cRohrbombenRocket:constructor(iX, iY, iZ)
-- Klassenvariablen --
self.m_V3Position = Vector3(iX, iY, iZ);
self.m_uRocket = createVehicle(594, iX, iY, iZ-1);
setElementFrozen(self.m_uRocket, true);
setElementAlpha(self.m_uRocket, 0)
self.m_uAbschuss = createObject(3675, iX, iY+0.25, iZ-2, 0, 180, 0);
setObjectScale(self.m_uAbschuss, 0.3);
setElementCollisionsEnabled(self.m_uAbschuss, false);
self.m_FRR = false; --cRohrbombenRocketSchweif:new(self);
self.m_FRE = false; --cRohrbombenRocketExplosion:new(self);
self.m_bLaunched = false;
self.m_iState = 0; -- am Boden
self.m_tblTimer = {};
self.m_timer = {};
-- Funktionen --
self.m_funcRender = function(...) self:event_render(...) end
self.bindedFunc_launchRocket = function(...) self:launchRocket() end
self.bindedFunc_doExplosion = function(...) self:doExplosion() end
self.bindedFunc_destructor = function(...) self:destructor() end
self:initTimer();
-- Events --
addEventHandler("onClientRender", getRootElement(), self.m_funcRender);
end
-- ///////////////////////////////
-- ///// deStructor //////
-- ///// Returns: void //////
-- ///////////////////////////////
function cRohrbombenRocket:destructor()
self.m_FRE:destructor()
self.m_FRR:destructor();
destroyElement(self.m_uRocket);
destroyElement(self.m_uAbschuss, true);
removeEventHandler("onClientRender", getRootElement(), self.m_funcRender);
end
-- EVENT HANDLER --
|
local playsession = {
{"HardcoreRocco", {337918}},
{"TheWickedMaster", {431592}},
{"Unwichtig", {421786}},
{"Brender", {364590}},
{"manstro011", {431387}},
{"andrekoul", {397919}},
{"TXL_PLAYZ", {188031}},
{"Jooey14", {426823}},
{"hyunbeen", {5691}},
{"dorpdorp", {319187}},
{"Clythoris", {417744}},
{"VincentMonster", {206586}},
{"Roeno1997", {239464}},
{"IAmTog", {347798}},
{"JuanMore", {368460}},
{"Lastaustralian", {425814}},
{"seeyorise", {419636}},
{"Aldnoah5566", {32033}},
{"epmonk", {247382}},
{"Cheeseftw", {396387}},
{"Nikkichu", {390154}},
{"marcohald", {9045}},
{"zumti", {3184}},
{"vedolv", {384772}},
{"IamTzu", {383603}},
{"1234tv", {51979}},
{"nizzy", {6127}},
{"Achskelmos", {351628}},
{"Falcon6", {18465}},
{"Mrog_163", {108269}},
{"durztok", {89929}},
{"lethal_dark", {3898}},
{"demon_453", {202016}},
{"JamieHolding", {211159}},
{"KickassLee", {236373}},
{"Preizhour", {282174}},
{"Bokrug", {7228}},
{"Junior_Kz", {5717}},
{"Miltion", {66448}},
{"I_dream_of_corn", {64659}},
{"RainSolid", {228900}},
{"thisisjack", {6195}},
{"aniche", {91927}},
{"deadpoetic6", {4412}},
{"Roxen", {6189}},
{"ayahuasca23", {188788}},
{"ksb4145", {114816}},
{"Reyand", {91228}},
{"Rayeth", {8218}},
{"firstandlast", {145818}},
{"Whassup", {7677}},
{"AIRZYC", {64099}},
{"Raijin-Kizuku", {137406}},
{"RashiNerha", {30899}},
{"abnoeh", {5150}},
{"facere", {21105}},
{"minipini55", {62863}},
{"grundle", {85526}},
{"vvictor", {1855}},
{"Giatros", {62742}},
{"timocb", {44071}},
{"tjql9856", {17945}},
{"beranabus", {24889}},
{"putinss", {7369}},
{"mewmew", {2938}}
}
return playsession |
----------------------------------------------------------------------------------------------------
-- Creator Tools LUA Mapping Utilities File
----------------------------------------------------------------------------------------------------
-- Author: Native Instruments
-- Written by: Yaron Eshkar
-- Modified: April 23, 2021
--
-- This file includes useful functions for usage in Creator Tools Lua scripts.
--
-- Simply include this line in any script (if running a script from another location that users this file,
-- make sure to point to the correct path):
-- local ctMap = require("CtMap")
--
-- Then you can simply call any function like:
-- ctMap.test_function()
--
-- It is also possible of course to copy entire specific functions from this list directly into your script.
-- In that case remove the CtMap part from the function name, and then simply call it normally like:
-- test_function()
--
local root_path = filesystem.parentPath(scriptPath)
package.path = root_path .. "/?.lua;" .. package.path
local ctUtil = require("Modules.CtUtil")
-- Just a separator for printing to the console.
local dash_sep = "------------------------------------------------------------"
local CtMap = {}
--- Test Function.
-- Takes no arguments, prints to console when called.
function CtMap.test_function()
-- Show that the class import and test function executes by printing a line.
print("Test function called")
end
--- Creates a sample map for Kontakt.
-- Generic sample map function that takes many argument and applies the resulting map to the Kontakt mapping editor.
-- @tparam table sample_paths_table table containing the paths to the sample files.
-- @tparam table sample_tokens_table table containing the tokens contained in the name of each sample file.
-- @tparam string playback_mode sets the playback mode for the created groups. Can be one of:
--
-- dfd
--
-- sampler
--
-- wavetable
--
-- tone_machine
--
-- time_machine
--
-- time_machine_2
--
-- time_machine_pro
--
-- beat_machine
--
-- s1200
--
-- mp60
-- @tparam int sample_name_location the expected location of the sample name token in the sample_tokens_table.
-- @tparam int signal_name_location the expected location of the signal name token in the sample_tokens_table.
-- @tparam int articulation_location the expected location of the articulation token in the sample_tokens_table.
-- @tparam int round_robin_location the expected location of the round robin token in the sample_tokens_table.
-- @tparam bool root_detect if set to true, root will be detected using MIR. When set to false, root will be set manually by the relvent variables.
-- @tparam int root_location the expected location of the root note token in the sample_tokens_table.
--
-- Set to 0 to use the default value, set to -1 to not set the parameter at all.
-- @tparam bool key_confine when set to true, the zone low key, high key will be the same as the root key.
-- @tparam int low_key_location the expected location of the low key token in the sample_tokens_table.
--
-- Set to 0 to use the default value, set to -1 to not set the parameter at all.
-- @tparam int high_key_location the expected location of the high key token in the sample_tokens_table.
--
-- Set to 0 to use the default value, set to -1 to not set the parameter at all.
-- @tparam bool vel_confine if set to true, low vel and high vel will be set to the default parameters.
-- @tparam int low_vel_location the expected location of the low vel token in the sample_tokens_table.
--
-- Set to 0 to use the default value, set to -1 to not set the parameter at all.
-- @tparam int high_vel_location the expected location of the high vel token in the sample_tokens_table.
--
-- Set to 0 to use the default value, set to -1 to not set the parameter at all.
-- @tparam int set_loop
--
-- 0: No loop.
--
-- 1: Turn on the first loop of the sample in mode 1.
--
-- 2: Turn on the first loop of the sample in mode 1 and set the loop parameters by reading the loop points from the file.
--
-- 3: Turn on the first loop of the sample in mode 1 and set the loop parameters by using MIR loop detection.
-- @tparam int loop_xfade anything greater than 0 sets the xfade to the given value.
-- @tparam int default_root_value the default root value to use if explicity told too or if an error is encountered parsing the token.
-- @tparam int default_low_key_value the default low key value to use if explicity told too or if an error is encountered parsing the token.
-- @tparam int default_high_key_value the default high key value to use if explicity told too or if an error is encountered parsing the token.
-- @tparam int default_low_vel_value the default low vel value to use if explicity told too or if an error is encountered parsing the token.
-- @tparam int default_high_vel_value the default high vel value to use if explicity told too or if an error is encountered parsing the token.
-- @tparam bool verbose_mode when true, prints the results of the mapping operation to console.
-- @tparam bool fix_tune When true MIR is used to fine tune each sample to the nearest note.
-- @tparam bool reset_groups If this value is greater than -1, the created groups will be a deep copy of this value's group slot instead of empty groups.
-- @treturn bool
function CtMap.create_mapping(sample_paths_table,sample_tokens_table,playback_mode,sample_name_location,signal_name_location,articulation_location,round_robin_location,root_detect,root_location,key_confine,low_key_location,high_key_location,vel_confine,low_vel_location,high_vel_location,set_loop,loop_xfade,default_root_value,default_low_key_value,default_high_key_value,default_low_vel_value,default_high_vel_value,verbose_mode,fix_tune,reset_groups)
if verbose_mode == nil then verbose_mode = true end
if reset_groups == nil then reset_groups = -1 end
-- Set the playback mode.
if playback_mode == "dfd" then playback_mode = PlaybackMode.DirectFromDisk
elseif playback_mode == "sampler" then playback_mode = PlaybackMode.Sampler
elseif playback_mode == "wavetable" then playback_mode = PlaybackMode.Wavetable
elseif playback_mode == "tone_machine" then playback_mode = PlaybackMode.ToneMachine
elseif playback_mode == "time_machine" then playback_mode = PlaybackMode.TimeMachine
elseif playback_mode == "time_machine_2" then playback_mode = PlaybackMode.TimeMachine2
elseif playback_mode == "time_machine_pro" then playback_mode = PlaybackMode.TimeMachinePro
elseif playback_mode == "beat_machine" then playback_mode = PlaybackMode.BeatMachine
elseif playback_mode == "s1200" then playback_mode = PlaybackMode.S1200Machine
elseif playback_mode == "mp60" then playback_mode = PlaybackMode.MP60Machine
end
if verbose_mode then print("Group mode: "..playback_mode) end
-- Checks that a proposed zone value is in the right range.
local function check_zone_value(token_value,token_type)
local token_types = {"Root","Low Key","High Key","Low Vel","High Vel"}
local default_values = {default_root_value,default_low_key_value,default_high_key_value,default_low_vel_value,default_high_vel_value}
-- Check that the value is valid and in range.
if ctUtil.is_in_range(token_value,0,127) then
if verbose_mode then print(token_types[token_type].." set: " .. token_value) end
else
token_value = default_values[token_type]
if verbose_mode then print("ERROR: ".. token_types[token_type] .." OUT OF RANGE , SET TO: " .. token_value) end
error_flag = true
end
return token_value
end
-- Table with note names.
local note_names = {
"C-2","C#-2","D-2","D#-2","E-2","F-2","F#-2","G-2","G#-2","A-2","A#-2","B-2",
"C-1","C#-1","D-1","D#-1","E-1","F-1","F#-1","G-1","G#-1","A-1","A#-1","B-1",
"C0","C#0","D0","D#0","E0","F0","F#0","G0","G#0","A0","A#0","B0",
"C1","C#1","D1","D#1","E1","F1","F#1","G1","G#1","A1","A#1","B1",
"C2","C#2","D2","D#2","E2","F2","F#2","G2","G#2","A2","A#2","B2",
"C3","C#3","D3","D#3","E3","F3","F#3","G3","G#3","A3","A#3","B3",
"C4","C#4","D4","D#4","E4","F4","F#4","G4","G#4","A4","A#4","B4",
"C5","C#5","D5","D#5","E5","F5","F#5","G5","G#5","A5","A#5","B5",
"C6","C#6","D6","D#6","E6","F6","F#6","G6","G#6","A6","A#6","B6",
"C7","C#7","D7","D#7","E7","F7","F#7","G7","G#7","A7","A#7","B7",
"C8","C#8","D8","D#8","E8","F8","F#8","G8","G#8"
}
-- Create the mapping.
-- Initialize a table to fill with the group names.
local groups_list = {}
-- Variable for easier indexing.
local x = 1
-- Variable for the token values
local token_value
-- Loop through all the sample paths and map each sample according to the tokens.
for index, file in next,sample_paths_table do
-- Initialize a variable for the current group name.
local curent_group_name
if verbose_mode then print(dash_sep) end
-- Set the proposed group name based on the tokens.
-- If there is a sample name token, add that to the proposed name.
if sample_name_location > 0 then
if sample_tokens_table[index][sample_name_location] ~= nil then
print("Sample name found: "..sample_tokens_table[index][sample_name_location])
curent_group_name = sample_tokens_table[index][sample_name_location]
else
if verbose_mode then print("ERROR: Sample name token set but not found") end
error_flag = true
end
end
-- If there is a signal name token, add that to the proposed name.
if signal_name_location > 0 then
if sample_tokens_table[index][signal_name_location] ~= nil then
print("Signal name found: "..sample_tokens_table[index][signal_name_location])
curent_group_name = curent_group_name.."_"..sample_tokens_table[index][signal_name_location]
else
if verbose_mode then print("ERROR: Signal name token set but not found") end
error_flag = true
end
end
-- If there is an articulation name token, add that to the proposed name.
if articulation_location > 0 then
if sample_tokens_table[index][articulation_location] ~= nil then
print("Articulation name found: "..sample_tokens_table[index][articulation_location])
curent_group_name = curent_group_name.."_"..sample_tokens_table[index][articulation_location]
else
if verbose_mode then print("ERROR: Articulation name token set but not found") end
error_flag = true
end
end
-- If there is a round robin name token, add that to the proposed name.
if round_robin_location > 0 then
if sample_tokens_table[index][round_robin_location] ~= nil then
print("sample name is: "..sample_tokens_table[index][sample_name_location])
curent_group_name = curent_group_name.."_"..sample_tokens_table[index][round_robin_location]
else
if verbose_mode then print("ERROR: Round robin name token set but not found") end
error_flag = true
end
end
if curent_group_name == nil then curent_group_name = "Group"..x end
-- Print the proposed group name.
if verbose_mode then print ("Group name: "..curent_group_name) end
-- Initialize the zone variable.
local z = Zone()
-- If a group for this name exists, put the sample in that group. Otherwise create a group for that name.
if ctUtil.table_value_check(groups_list,curent_group_name) == true then
local temp_group_index = ctUtil.table_value_index(groups_list,curent_group_name)
-- Add a zone for each sample.
instrument.groups[temp_group_index].zones:add(z)
if verbose_mode then print("Group exists. Sample put in group #"..temp_group_index) end
else
-- Initialize a new group.
local g
-- If told to copy a group, copy that one.
if reset_groups > -1 then
instrument.groups:insert(x,instrument.groups[reset_groups])
g = instrument.groups[x]
-- Create a new group.
else
g = Group()
-- Set playback mode
g.playbackMode = playback_mode
-- Add the group to the instrument.
instrument.groups:add(g)
end
-- Add a zone for each sample.
g.zones:add(z)
-- Name the group.
g.name = curent_group_name
-- Add the name to the list.
groups_list[x] = curent_group_name
if verbose_mode then print("Group created: "..groups_list[x]) end
-- Increment the group list index.
x = x + 1
end
-- Set the zone root key.
-- If MIR Detection is on, override token setting and perform MIR pitch detect
if root_detect then
token_value = ctUtil.round_num(mir.detectPitch(file))
if verbose_mode then print("MIR Pitch detected as: " .. token_value) end
token_value = check_zone_value(token_value,1)
z.rootKey = token_value
else
if root_location == 0 then
z.rootKey = default_root_value
elseif root_location > 0 then
if sample_tokens_table[index][root_location] then
if ctUtil.table_value_index(note_names,sample_tokens_table[index][root_location]) == nil then
-- Remove non numerical characters from the token.
token_value = tonumber(sample_tokens_table[index][root_location]:match('%d[%d.,]*'))
else
-- Check for the index value of the note string
token_value = tonumber(ctUtil.table_value_index(note_names,sample_tokens_table[index][root_location]))-1
end
else
token_value = -1
end
token_value = check_zone_value(token_value,1)
z.rootKey = token_value
end
end
-- Check if key confine is on.
if key_confine then
z.keyRange.low = z.rootKey
z.keyRange.high = z.rootKey
else
if low_key_location == 0 then
z.keyRange.low = default_low_key_value
-- Set the zone low key.
elseif low_key_location > 0 then
if sample_tokens_table[index][low_key_location] then
if ctUtil.table_value_index(note_names,sample_tokens_table[index][low_key_location]) == nil then
-- Remove non numerical characters from the token.
token_value = tonumber(sample_tokens_table[index][low_key_location]:match('%d[%d.,]*'))
else
-- Check for the index value of the note string
token_value = tonumber(ctUtil.table_value_index(note_names,sample_tokens_table[index][low_key_location]))-1
end
else
token_value = -1
end
token_value = check_zone_value(token_value,2)
z.keyRange.low = token_value
end
-- Set the zone high key.
if high_key_location == 0 then
z.keyRange.high = default_high_key_value
elseif high_key_location > 0 then
if sample_tokens_table[index][high_key_location] then
if ctUtil.table_value_index(note_names,sample_tokens_table[index][high_key_location]) == nil then
-- Remove non numerical characters from the token.
token_value = tonumber(sample_tokens_table[index][high_key_location]:match('%d[%d.,]*'))
else
-- Check for the index value of the note string
token_value = tonumber(ctUtil.table_value_index(note_names,sample_tokens_table[index][high_key_location]))-1
end
else
token_value = -1
end
token_value = check_zone_value(token_value,3)
z.keyRange.high = token_value
end
end
-- Check if velocity confine is on.
if vel_confine then
z.velocityRange.low = default_low_vel_value
z.velocityRange.high = default_high_vel_value
else
if low_vel_location == 0 then
z.velocityRange.low = default_low_vel_value
elseif low_vel_location > 0 then
if sample_tokens_table[index][low_vel_location] then
-- Remove non numerical characters from the token.
token_value = tonumber(sample_tokens_table[index][low_vel_location]:match('%d[%d.,]*'))
else
token_value = -1
end
token_value = check_zone_value(token_value,4)
z.velocityRange.low = token_value
end
-- Set the zone high velocity.
if high_vel_location == 0 then
z.velocityRange.high = default_high_vel_value
elseif high_vel_location > 0 then
if sample_tokens_table[index][high_vel_location] then
-- Remove non numerical characters from the token.
token_value = tonumber(sample_tokens_table[index][high_vel_location]:match('%d[%d.,]*'))
else
token_value = -1
end
token_value = check_zone_value(token_value,5)
z.velocityRange.high = token_value
end
end
-- Turn on the loop for the zone if required.
if set_loop>0 then
z.loops:resize(1)
z.loops[0].mode = 1
if set_loop>1 then
local loop_start = {}
local loop_end = {}
local loop_length
if set_loop==2 then
local file_reader = wav.create_context(file, "r")
local original_loop_count = file_reader.get_loop_count()
if original_loop_count == 1 then
loop_start = file_reader.get_loop_start()
loop_end = file_reader.get_loop_end()
if verbose_mode then print("Loop Start: "..loop_start[1]) end
if verbose_mode then print("Loop Length: "..loop_end[1] - loop_start[1]) end
z.loops[0].start = loop_start[1]
loop_length = loop_end[1] - loop_start[1]
else
if verbose_mode then print("ERROR: Loop not found, finding best loop") end
loop_start[1],loop_end[1] = mir.findLoop(file)
loop_length = loop_end[1] - loop_start[1]
if verbose_mode then print("Loop start: "..loop_start[1].." Loop length: "..loop_length) end
error_flag = true
end
elseif set_loop>2 then
if verbose_mode then print("Finding loop points...") end
if set_loop==3 then -- default
loop_start[1],loop_end[1] = mir.findLoop(file)
loop_length = loop_end[1] - loop_start[1]
elseif set_loop==4 then -- settings for type?
loop_start[1],loop_end[1] = mir.findLoop(file)
loop_length = loop_end[1] - loop_start[1]
elseif set_loop==5 then -- settings for type?
loop_start[1],loop_end[1] = mir.findLoop(file)
loop_length = loop_end[1] - loop_start[1]
end
if verbose_mode then print("Loop start: "..loop_start[1].." Loop length: "..loop_length) end
end
z.loops[0].start = loop_start[1]
z.loops[0].length = loop_length
if loop_xfade>0 then z.loops[0].xfade = loop_xfade end
end
end
if fix_tune then
local cur_pitch = mir.detectPitch(file)
z.tune = ctUtil.round_num(cur_pitch)-cur_pitch
end
-- Populate the zone with a sample from our table.
z.file = file
end
-- Fix wrong group indexing annoyance.
instrument.groups:remove(0)
return true
end
--- Simple mapper that maps each sample to its own group.
-- All parameters except sample_paths table are optional.
-- @tparam table sample_paths_table
-- @tparam int root_key
-- @tparam int low_key
-- @tparam int high_key
-- @tparam int low_vel
-- @tparam int high_vel
-- @tparam bool set_loop
-- @tparam int loop_xfade
-- @tparam bool verbose_mode
-- @treturn bool
function CtMap.simplest_mapper_groups(sample_paths_table,set_loop,loop_xfade,root_key,low_key,high_key,low_vel,high_vel,verbose_mode)
if set_loop == nil then set_loop = false end
if loop_xfade == nil then loop_xfade = 20 end
if root_key == nil then root_key = 60 end
if low_key == nil then low_key = 0 end
if high_key == nil then high_key = 127 end
if low_vel == nil then low_vel = 0 end
if high_vel == nil then high_vel = 127 end
if verbose_mode == nil then verbose_mode = true end
for index, file in pairs(sample_paths_table) do
instrument.groups:insert(#instrument.groups,instrument.groups[0])
local g = instrument.groups[#instrument.groups-1]
-- Name the group.
g.name = "group ".. index
local z = Zone()
g.zones:add(z)
z.rootKey = root_key
z.keyRange.low = low_key
z.keyRange.high = high_key
z.velocityRange.low = low_vel
z.velocityRange.high = high_vel
if set_loop then
local loop_start,loop_end = mir.findLoop(file)
local loop_length = loop_end - loop_start
z.loops:resize(1)
z.loops[0].mode = 1
z.loops[0].start = loop_start
z.loops[0].length = loop_length
z.loops[0].xfade = loop_xfade
if verbose_mode then print("Loop start: "..loop_start.." Loop length: "..loop_length) end
end
-- Populate the zone with a sample from our table.
z.file = file
end
-- Fix wrong group indexing annoyance.
instrument.groups:remove(0)
if verbose_mode then print("Mapping complete, no errors") end
return true
end
--- Simple mapper that maps each sample to one key confined zone.
-- All parameters except sample_paths table are optional.
-- @tparam table sample_paths_table
-- @tparam int root_key
-- @tparam int low_vel
-- @tparam int high_vel
-- @tparam bool set_loop
-- @tparam int loop_xfade
-- @tparam bool verbose_mode
-- @treturn bool
function CtMap.simplest_mapper_zones(sample_paths_table,set_loop,loop_xfade,root_key,low_vel,high_vel,verbose_mode)
if set_loop == nil then set_loop = false end
if loop_xfade == nil then loop_xfade = 20 end
if root_key == nil then root_key = 60 end
if low_vel == nil then low_vel = 0 end
if high_vel == nil then high_vel = 127 end
if verbose_mode == nil then verbose_mode = true end
for index, file in pairs(sample_paths_table) do
local g = instrument.groups[#instrument.groups-1]
local z = Zone()
g.zones:add(z)
z.rootKey = root_key
z.keyRange.low = root_key
z.keyRange.high = root_key
z.velocityRange.low = low_vel
z.velocityRange.high = high_vel
if set_loop then
local loop_start,loop_end = mir.findLoop(file)
local loop_length = loop_end - loop_start
z.loops:resize(1)
z.loops[0].mode = 1
z.loops[0].start = loop_start
z.loops[0].length = loop_length
z.loops[0].xfade = loop_xfade
if verbose_mode then print("Loop start: "..loop_start.." Loop length: "..loop_length) end
end
-- Populate the zone with a sample from our table.
z.file = file
root_key = root_key + 1
end
if verbose_mode then print("Mapping complete, no errors") end
return true
end
--- Report map status.
-- Report success or mapping with errors.
-- @tparam bool error_flag determines whether to print a sucess or an error message.
-- @treturn bool
function CtMap.mapping_report(error_flag)
if error_flag == true then
print("Mapping complete but with zone parsing errors, see log...")
return false
else
print("Mapping complete, no errors")
return true
end
end
-- return the CtMap object.
return CtMap
|
require 'gnuplot'
n = 0
local file1 = io.open("./Results/reward.txt")
if file1 then
for line in file1:lines() do
n = n+1
end
end
file1:close()
m = 0
local file1 = io.open("./Results/conv1.txt")
if file1 then
for line in file1:lines() do
m = m+1
end
end
file1:close()
m = m-1
local file1 = io.open("./Results/reward.txt")
local file2 = io.open("./Results/TD.txt")
local file3 = io.open("./Results/vavg.txt")
local file4 = io.open("./Results/conv1.txt")
local file5 = io.open("./Results/conv2.txt")
local file6 = io.open("./Results/conv3.txt")
local file7 = io.open("./Results/lin1.txt")
local file8 = io.open("./Results/lin2.txt")
i = 1
conv1_norm = torch.Tensor(m/4-1)
conv1_norm_max = torch.Tensor(m/4-1)
conv1_grad = torch.Tensor(m/4-1)
conv1_grad_max = torch.Tensor(m/4-1)
if file4 then
for line in file4:lines() do
if i == 1 then
print(i)
elseif i == m-4 then
break
elseif i % 4 == 2 then
conv1_norm[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 3 then
conv1_norm_max[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 0 then
conv1_grad[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 1 then
conv1_grad_max[math.floor(i/4)+1] = tonumber(line)
end
i = i+1
end
end
gnuplot.pngfigure('./Results/tmp/conv1.png')
gnuplot.title('conv 1 over training')
gnuplot.plot({'Norm',conv1_norm},{'Grad',conv1_grad})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
gnuplot.pngfigure('./Results/tmp/conv1_max.png')
gnuplot.title('conv 1 max over training')
gnuplot.plot({'Max norm',conv1_norm_max},{'Max grad',conv1_grad_max})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
i = 1
conv2_norm = torch.Tensor(m/4-1)
conv2_norm_max = torch.Tensor(m/4-1)
conv2_grad = torch.Tensor(m/4-1)
conv2_grad_max = torch.Tensor(m/4-1)
if file5 then
for line in file5:lines() do
if i == 1 then
print(i)
elseif i == m-4 then
break
elseif i % 4 == 2 then
conv2_norm[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 3 then
conv2_norm_max[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 0 then
conv2_grad[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 1 then
conv2_grad_max[math.floor(i/4)+1] = tonumber(line)
end
i = i+1
end
end
gnuplot.pngfigure('./Results/tmp/conv2.png')
gnuplot.title('conv 2 over training')
gnuplot.plot({'Norm',conv2_norm},{'Grad',conv2_grad})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
gnuplot.pngfigure('./Results/tmp/conv2_max.png')
gnuplot.title('conv 2 max over training')
gnuplot.plot({'Max norm',conv2_norm_max},{'Max grad',conv2_grad_max})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
i = 1
conv3_norm = torch.Tensor(m/4-1)
conv3_norm_max = torch.Tensor(m/4-1)
conv3_grad = torch.Tensor(m/4-1)
conv3_grad_max = torch.Tensor(m/4-1)
if file6 then
for line in file6:lines() do
if i == 1 then
print(i)
elseif i == m-4 then
break
elseif i % 4 == 2 then
conv3_norm[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 3 then
conv3_norm_max[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 0 then
conv3_grad[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 1 then
conv3_grad_max[math.floor(i/4)+1] = tonumber(line)
end
i = i+1
end
end
gnuplot.pngfigure('./Results/tmp/conv3.png')
gnuplot.title('conv 3 over training')
gnuplot.plot({'Norm',conv3_norm},{'Grad',conv3_grad})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
gnuplot.pngfigure('./Results/tmp/conv3_max.png')
gnuplot.title('conv 3 max over training')
gnuplot.plot({'Max norm',conv3_norm_max},{'Max grad',conv3_grad_max})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
i = 1
lin1_norm = torch.Tensor(m/4-1)
lin1_norm_max = torch.Tensor(m/4-1)
lin1_grad = torch.Tensor(m/4-1)
lin1_grad_max = torch.Tensor(m/4-1)
if file7 then
for line in file7:lines() do
if i == 1 then
print(i)
elseif i == m-4 then
break
elseif i % 4 == 2 then
lin1_norm[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 3 then
lin1_norm_max[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 0 then
lin1_grad[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 1 then
lin1_grad_max[math.floor(i/4)+1] = tonumber(line)
end
i = i+1
end
end
gnuplot.pngfigure('./Results/tmp/lin1.png')
gnuplot.title('lin1 over training')
gnuplot.plot({'Norm',lin1_norm},{'Grad',lin1_grad})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
gnuplot.pngfigure('./Results/tmp/lin1_max.png')
gnuplot.title('lin1 max over training')
gnuplot.plot({'Max norm',lin1_norm_max},{'Max grad',lin1_grad_max})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
i = 1
lin2_norm = torch.Tensor(m/4-1)
lin2_norm_max = torch.Tensor(m/4-1)
lin2_grad = torch.Tensor(m/4-1)
lin2_grad_max = torch.Tensor(m/4-1)
if file8 then
for line in file8:lines() do
if i == 1 then
print(i)
elseif i == m-4 then
break
elseif i % 4 == 2 then
lin2_norm[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 3 then
lin2_norm_max[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 0 then
lin2_grad[math.floor(i/4)+1] = tonumber(line)
elseif i % 4 == 1 then
lin2_grad_max[math.floor(i/4)+1] = tonumber(line)
end
i = i+1
end
end
gnuplot.pngfigure('./Results/tmp/lin2.png')
gnuplot.title('lin2 over training')
gnuplot.plot({'Norm',lin2_norm},{'Grad',lin2_grad})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
gnuplot.pngfigure('./Results/tmp/lin2_max.png')
gnuplot.title('lin2 max over training')
gnuplot.plot({'Max norm',lin2_norm_max},{'Max grad',lin2_grad_max})
gnuplot.xlabel('Training epochs')
gnuplot.movelegend('left','top')
gnuplot.plotflush()
i = 1
x = torch.Tensor(n)
if file1 then
for line in file1:lines() do
x[i] = tonumber(line)
i = i+1
end
end
i = 1
y = torch.Tensor(n)
if file2 then
for line in file2:lines() do
y[i] = tonumber(line)
i = i+1
end
end
i = 1
z = torch.Tensor(n)
if file3 then
for line in file3:lines() do
z[i] = tonumber(line)
z[i] = z[i]/y[i]
i = i+1
end
end
gnuplot.pngfigure('./Results/tmp/reward.png')
gnuplot.title('reward over testing')
gnuplot.plot(x)
gnuplot.plotflush()
gnuplot.pngfigure('./Results/tmp/vavg.png')
gnuplot.title('vavg over testing')
gnuplot.plot(y)
gnuplot.plotflush()
gnuplot.pngfigure('./Results/tmp/TD_Error.png')
gnuplot.title('Normalized TD error over testing')
gnuplot.plot(z)
gnuplot.plotflush()
|
resource_type 'gametype' { name = 'GTARP' }
client_script 'client.lua' |
require "innerInterpreter"
local dataStack,returnStack={},{}
local makePush=function(t) return function(v) table.insert(t,v) end end
local makePop =function(t) return function() return table.remove(t) end end
DS={Push=makePush(dataStack), Pop=makePop(dataStack)}
RS={Push=makePush(returnStack), Pop=makePop(returnStack)}
local execWord=function(inWordName) innerInterpreter({Dict[inWordName]}) end
local action={};
action.interpret={number=DS.Push, string=execWord}
action.compile ={
number=function(inValue) local ins=table.insert
ins(NewWord.param,Dict["lit"]); ins(NewWord.param,inValue)
end,
string=function(inWordName)
if Dict[inWordName].immediate then execWord(inWordName)
else table.insert(NewWord.param,Dict[inWordName]) end
end
}
function GetToken() local token
token,scanPos=string.match(Line,"^([ \t]*)()", scanPos)
token,scanPos=string.match(Line,"^([^ \t]*)()",scanPos)
return token~="" and token or nil -- token!="" ? token : nil
end
Mode="interpret"
outerInterpreter=function(inLine)
Line=inLine; scanPos=1; local token=GetToken()
while token do local tokVal = Dict[token] and token or tonumber(token)
if tokVal then action[Mode][type(tokVal)](tokVal); token=GetToken()
else return token end
end
return nil
end
|
local K, C, L, _ = unpack(select(2, ...))
local print = print
local CreateFrame = CreateFrame
local IsAddOnLoaded = IsAddOnLoaded
-- Remind people to delete old KkthnxUI_Filger
local Reminder_EventFrame = CreateFrame("Frame")
if IsAddOnLoaded("KkthnxUI_Filger") then
Reminder_EventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
Reminder_EventFrame:SetScript("OnEvent",
function(self, event, ...)
print("|cffff3300".."Please, delete KkthnxUI_Filger, it is now built-in.".."|r")
end)
end
-- Fuck off CLC_DK. Quit hiding shit without peoples permission
if K.Class == "DEATHKNIGHT" then
local Runebar = CreateFrame("Frame")
if IsAddOnLoaded("CLC_DK") then
Runebar:RegisterEvent("ADDON_LOADED")
Runebar:SetScript("OnEvent",
function(self, event, addon)
-- print("event:"..event)
RuneFrame:Show()
if (addon == "CLC_DK") then
self:UnRegisterEvent('ADDON_LOADED')
end
end)
end
end |
local L = BigWigs:NewBossLocale("The Arcway Trash", "deDE")
if not L then return end
if L then
L.anomaly = "Arkananomalie"
L.shade = "Warpschemen"
L.wraith = "Verdorrtes Managespenst"
L.blade = "Teufelsklinge der Zornwächter"
L.chaosbringer = "Chaosbringer der Eredar"
end
|
local alien_tint = { r = 0.8, g = 0.4, b = 0.8, a = 0.8 }
-- ### SOLAR PANEL ### --
local alien_solarpanel = util.table.deepcopy(data.raw["solar-panel"]["solar-panel"])
alien_solarpanel.name = "alien-solarpanel"
alien_solarpanel.icons = { { icon = "__base__/graphics/icons/solar-panel.png", tint = { r = 0.8, g = 0.4, b = 0.8, a = 0.8 } } }
alien_solarpanel.minable.result = "alien-solarpanel"
alien_solarpanel.fast_replaceable_group = "solar-panel"
alien_solarpanel.production = "150kW"
alien_solarpanel.picture.layers[1].hr_version.tint = alien_tint
alien_solarpanel.picture.layers[1].tint = alien_tint
alien_solarpanel.picture.layers[2].hr_version.tint = alien_tint
alien_solarpanel.picture.layers[2].tint = alien_tint
data:extend({ alien_solarpanel })
-- ### MINING DRILL ### --
local alien_drill = util.table.deepcopy(data.raw["mining-drill"]["electric-mining-drill"])
alien_drill.name = "alien-mining-drill"
alien_drill.icons = { { icon = "__base__/graphics/icons/electric-mining-drill.png", tint = { r = 0.8, g = 0.4, b = 0.8, a = 0.8 } } }
alien_drill.minable.result = "alien-mining-drill"
alien_drill.fast_replaceable_group = "mining-drill"
alien_drill.mining_speed = 1.5
alien_drill.energy_usage = "200kW"
alien_drill.resource_searching_radius = 3.49
alien_drill.module_specification.module_slots = 4
alien_drill.graphics_set.animation.north.layers[1].tint = alien_tint
alien_drill.graphics_set.animation.north.layers[1].hr_version.tint = alien_tint
alien_drill.graphics_set.animation.east.layers[1].tint = alien_tint
alien_drill.graphics_set.animation.east.layers[1].hr_version.tint = alien_tint
alien_drill.graphics_set.animation.south.layers[1].tint = alien_tint
alien_drill.graphics_set.animation.south.layers[1].hr_version.tint = alien_tint
alien_drill.graphics_set.animation.west.layers[1].tint = alien_tint
alien_drill.graphics_set.animation.west.layers[1].hr_version.tint = alien_tint
alien_drill.graphics_set.working_visualisations[3].north_animation.layers[1].tint = alien_tint
alien_drill.graphics_set.working_visualisations[3].north_animation.layers[1].hr_version.tint = alien_tint
alien_drill.graphics_set.working_visualisations[3].east_animation.layers[1].tint = alien_tint
alien_drill.graphics_set.working_visualisations[3].east_animation.layers[1].hr_version.tint = alien_tint
alien_drill.graphics_set.working_visualisations[3].south_animation.layers[1].tint = alien_tint
alien_drill.graphics_set.working_visualisations[3].south_animation.layers[1].hr_version.tint = alien_tint
alien_drill.graphics_set.working_visualisations[3].west_animation.layers[1].tint = alien_tint
alien_drill.graphics_set.working_visualisations[3].west_animation.layers[1].hr_version.tint = alien_tint
alien_drill.wet_mining_graphics_set.animation.north.layers[1].tint = alien_tint
alien_drill.wet_mining_graphics_set.animation.north.layers[1].hr_version.tint = alien_tint
alien_drill.wet_mining_graphics_set.animation.east.layers[1].tint = alien_tint
alien_drill.wet_mining_graphics_set.animation.east.layers[1].hr_version.tint = alien_tint
alien_drill.wet_mining_graphics_set.animation.south.layers[1].tint = alien_tint
alien_drill.wet_mining_graphics_set.animation.south.layers[1].hr_version.tint = alien_tint
alien_drill.wet_mining_graphics_set.animation.west.layers[1].tint = alien_tint
alien_drill.wet_mining_graphics_set.animation.west.layers[1].hr_version.tint = alien_tint
alien_drill.wet_mining_graphics_set.working_visualisations[3].north_animation.layers[1].tint = alien_tint
alien_drill.wet_mining_graphics_set.working_visualisations[3].north_animation.layers[1].hr_version.tint = alien_tint
alien_drill.wet_mining_graphics_set.working_visualisations[3].east_animation.layers[1].tint = alien_tint
alien_drill.wet_mining_graphics_set.working_visualisations[3].east_animation.layers[1].hr_version.tint = alien_tint
alien_drill.wet_mining_graphics_set.working_visualisations[3].south_animation.layers[1].tint = alien_tint
alien_drill.wet_mining_graphics_set.working_visualisations[3].south_animation.layers[1].hr_version.tint = alien_tint
alien_drill.wet_mining_graphics_set.working_visualisations[3].west_animation.layers[1].tint = alien_tint
alien_drill.wet_mining_graphics_set.working_visualisations[3].west_animation.layers[1].hr_version.tint = alien_tint
data:extend({ alien_drill })
if not data.raw["solar-panel"]["solar-panel"].fast_replaceable_group then
data.raw["solar-panel"]["solar-panel"].fast_replaceable_group = "solar-panel"
else
local group_name = data.raw["solar-panel"]["solar-panel"].fast_replaceable_group
data.raw["solar-panel"]["alien-solarpanel"].fast_replaceable_group = group_name
end
if data.raw["solar-panel"]["solar-panel"].next_upgrade == nil then
data.raw["solar-panel"]["solar-panel"].next_upgrade = "alien-solarpanel"
end
-- #### ALIEN ACCUMULATOR #### --
local alien_accumulator = util.table.deepcopy(data.raw["accumulator"]["accumulator"])
alien_accumulator.name = "alien-accumulator"
alien_accumulator.icons = { { icon = "__base__/graphics/icons/accumulator.png", tint = { r = 0.8, g = 0.4, b = 0.8, a = 0.8 } } }
alien_accumulator.minable.result = "alien-accumulator"
alien_accumulator.fast_replaceable_group = "accumulator"
alien_accumulator.energy_source.buffer_capacity = "15MJ"
alien_accumulator.energy_source.input_flow_limit = "1MW"
alien_accumulator.energy_source.output_flow_limit = "1MW"
alien_accumulator.picture.layers[1].tint = alien_tint
alien_accumulator.picture.layers[1].hr_version.tint = alien_tint
alien_accumulator.charge_animation.layers[1].layers[1].tint = alien_tint
alien_accumulator.charge_animation.layers[1].layers[1].hr_version.tint = alien_tint
alien_accumulator.discharge_animation.layers[1].layers[1].tint = alien_tint
alien_accumulator.discharge_animation.layers[1].layers[1].hr_version.tint = alien_tint
data:extend({ alien_accumulator })
if not data.raw["accumulator"]["accumulator"].fast_replaceable_group then
data.raw["accumulator"]["accumulator"].fast_replaceable_group = "accumulator"
else
local group_name = data.raw["accumulator"]["accumulator"].fast_replaceable_group
data.raw["accumulator"]["alien-accumulator"].fast_replaceable_group = group_name
end
if data.raw["accumulator"]["accumulator"].next_upgrade == nil then
data.raw["accumulator"]["accumulator"].next_upgrade = "alien-accumulator"
end
-- ### STEAM ENGINE ### --
local alien_engine = util.table.deepcopy(data.raw["generator"]["steam-engine"])
alien_engine.name = "alien-steam-engine"
alien_engine.icons = { { icon = "__base__/graphics/icons/steam-engine.png", tint = { r = 0.8, g = 0.4, b = 0.8, a = 0.8 } } }
alien_engine.minable.result = "alien-steam-engine"
alien_engine.effectivity = 2
alien_engine.max_health = 600
alien_engine.horizontal_animation.layers[1].tint = alien_tint
alien_engine.horizontal_animation.layers[1].hr_version.tint = alien_tint
alien_engine.vertical_animation.layers[1].tint = alien_tint
alien_engine.vertical_animation.layers[1].hr_version.tint = alien_tint
data:extend({ alien_engine })
if data.raw["generator"]["steam-engine"].next_upgrade == nil then
data.raw["generator"]["steam-engine"].next_upgrade = "alien-steam-engine"
end
-- ### Gun Turret ### --
local alien_gun_turret = util.table.deepcopy(data.raw["ammo-turret"]["gun-turret"])
alien_gun_turret.name = "alien-gun-turret"
alien_gun_turret.icons = { { icon = "__base__/graphics/icons/gun-turret.png", tint = { r = 0.8, g = 0.4, b = 0.8, a = 0.8 } } }
alien_gun_turret.minable.result = "alien-gun-turret"
alien_gun_turret.max_health = 650
alien_gun_turret.base_picture.layers[1].tint = alien_tint
alien_gun_turret.base_picture.layers[1].hr_version.tint = alien_tint
alien_gun_turret.base_picture.layers[2].tint = alien_tint
alien_gun_turret.base_picture.layers[2].hr_version.tint = alien_tint
alien_gun_turret.attack_parameters.range = 30
data:extend({ alien_gun_turret }) |
-- RS485 communication interface parameters
BAUD_RATE = 9600
DATA_BITS = 8
PARITY = 'N'
STOP_BITS = 2
function main()
local result = rs485.init(BAUD_RATE, DATA_BITS, PARITY, STOP_BITS)
if result ~= 0 then
enapter.log("RS485 init failed: "..rs485.err_to_str(result))
end
scheduler.add(30000, send_properties)
scheduler.add(1000, send_telemetry)
end
function send_properties()
enapter.send_properties({ vendor = "Crowcon", model = "Xgard Bright" })
end
function send_telemetry()
local ADDRESS = 1
local telemetry = {}
local alerts = {}
local status = "ok"
local data, result = modbus.read_holdings(ADDRESS, 1000, 2, 1000)
if data then
telemetry["h2_concentration"] = tofloat(data)
else
enapter.log("Error reading Modbus: "..modbus.err_to_str(result), "error", true)
status = "read_error"
alerts = "communication_failed"
end
telemetry["alerts"] = alerts
telemetry["status"] = status
enapter.send_telemetry(telemetry)
end
function tofloat(register)
local raw_str = string.pack("BBBB", register[1]>>8, register[1]&0xff, register[2]>>8, register[2]&0xff)
return string.unpack(">f", raw_str)
end
main()
|
-- syntools.lua
-- Generic Lua syntax tools.
local table = loadLibrary("table")
local syntools = {}
syntools.symbols = {} do
syntools.symbols.identFirst = table.lookupify {
'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y',
'z', 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X',
'Y', 'Z', '_',
}
syntools.symbols.ident = table.lookupify {
'0', '1', '2', '3', '4',
'4', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y',
'z', 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X',
'Y', 'Z', '_',
}
syntools.symbols.numbers = table.lookupify {
'0', '1', '2', '3', '4',
'4', '6', '7', '8', '9',
}
syntools.symbols.escapes = table.lookupify {
'\a', '\b', '\f', '\n', '\r',
'\v'
}
syntools.symbols.escapeMap = table.lookupify {
'a', 'b', 'f', 'n', 'r',
'v'
}
end
function syntools.isValidVar(name)
local c = string.sub(name, 1, 1)
if not syntools.symbols.identFirst[c] or syntools.symbols.numbers[c] then
return false
end
for i = 2, #name do
if not syntools.symbols.ident[string.sub(name, i, i)] then
return false
end
end
return true
end
function syntools.serializeString(str)
return string.gsub(string.format("%q", str), ".", function(c)
if syntools.symbols.escapes[c] then
return syntools.symbols.escapeMap[syntools.symbols.escapes[c]]
end
return c
end)
end
function syntools.getInstancePath(inst) -- Because GetFullName is trash.
local path = ""
repeat
if syntools.isValidVar(inst.name) then
path = string.format(".%s%s", inst.name, path)
else
path = string.format("[%s]%s", syntools.serializeString(inst.name), path)
end
inst = inst.Parent
until inst == nil or inst.Parent == game -- There's two cases: The root is going to be either DataModel (game) or nil.
if inst == workspace then -- game:GetService("Workspace") is just weird.
return "workspace"..path
elseif inst == nil then
return "Nil("..string.sub(path, 2)..")"
end
return "game:GetService(\""..inst.ClassName.."\")"..path
end
function syntools.serialize(value)
local vType = typeof(value)
if vType == "nil" then
return vType
elseif vType == "string" then
return syntools.serializeString(value)
elseif vType == "number" then
if math.floor(value) ~= value then
value = string.format("%.2f", value)
if string.sub(value, -3) == ".00" then
value = string.sub(value, 1, -4)
else
value = tostring(value)
end
end
if value == "inf" then
value = "math.huge"
elseif value == "-inf" then
return "-math.huge"
elseif value == "-nan(ind)" then -- Doesn't apply with Synapse's VM for some reason...interesting.
return "1/0" -- undefined
elseif value == "-0" then
return "0" -- bruh
end
return value
elseif vType == "boolean" then
return tostring(value)
elseif vType == "userdata" then
local addr = tonumber(string.split(tostring(value), ": 0x")[2], 16)
return string.format("Userdata(0x%x)", addr)
elseif vType == "table" then
return syntools.serializeTable(value)
elseif vType == "function" then
local name = debug.getinfo(value).name
return string.format("Function(%s)", syntools.serializeString((name == "") and "anonymous function" or name))
elseif vType == "Instance" then
return syntools.getInstancePath(value)
elseif vType == "Vector2" then
return string.format("Vector2.new(%s, %s)", syntools.serialize(value.X), syntools.serialize(value.Y))
elseif vType == "Vector2int16" then
return string.format("Vector2int16.new(%s, %s)", syntools.serialize(value.X), syntools.serialize(value.Y))
elseif vType == "Vector3" then
return string.format("Vector3.new(%s, %s, %s)", syntools.serialize(value.X), syntools.serialize(value.Y), syntools.serialize(value.Z))
elseif vType == "Vector3int16" then
return string.format("Vector3int16.new(%s, %s, %s)", syntools.serialize(value.X), syntools.serialize(value.Y), syntools.serialize(value.Z))
elseif vType == "CFrame" then
local rX, rY, rZ = value:ToOrientation()
if rX == 0 and rY == 0 and rZ == 0 then
return string.format("CFrame.new(%s, %s, %s)", syntools.serialize(value.X), syntools.serialize(value.Y), syntools.serialize(value.Z))
end
return string.format("CFrame.new(%s, %s, %s) * CFrame.Angles(math.rad(%s), math.rad(%s), math.rad(%s))",
syntools.serialize(value.X), syntools.serialize(value.Y), syntools.serialize(value.Z),
syntools.serialize(math.deg(rX)), syntools.serialize(math.deg(rY)), syntools.serialize(math.deg(rZ))
)
elseif vType == "UDim" then
return string.format("UDim.new(%s, %s)", syntools.serialize(value.Scale), syntools.serialize(value.Offset))
elseif vType == "UDim2" then
return string.format("UDim2.new(%s, %s, %s, %s)", syntools.serialize(value.X.Scale), syntools.serialize(value.X.Offset), syntools.serialize(value.Y.Scale), syntools.serialize(value.Y.Offset))
elseif vType == "BrickColor" then
return string.format("BrickColor.new(%q)", value.name)
elseif vType == "Color3" then
return string.format("Color3.fromRGB(%s, %s, %s)", syntools.serialize(value.R * 0xFF), syntools.serialize(value.G * 0xFF), syntools.serialize(value.B * 0xFF))
elseif vType == "DateTime" then
return string.format("DateTime.fromIsoDate(%q)", value:ToIsoDate())
--local utc = value:ToUniversalTime()
--return "DateTime.fromUniversalTime("..utc.Year..", "..utc.Month..", "..utc.Day..", "..utc.Hour..", "..utc.Minute..", "..utc.Second..", "..utc.Millisecond..")"
elseif vType == "Enums" then
return "Enum"
elseif vType == "Enum" then
return string.format("Enum.%s", tostring(value))
elseif vType == "EnumItem" then
return tostring(value)
elseif vType == "Ray" then
return string.format("Ray.new(%s, %s)", syntools.serialize(value.Origin), syntools.serialize(value.Direction))
elseif vType == "RBXScriptSignal" then -- Possible guess functionality??
return string.format("Signal(%q)", string.split(tostring(value), " ")[2])
elseif vType == "RBXScriptConnection" then -- Maybe scan GC for relative connections?
return "Connection()"
elseif vType == "Region3" then -- I'm failing to do simple math so ill just put fuzzy here.
return string.format("FuzzyRegion3(%s, %s) --[[ Center, Area ]]", syntools.serialize(value.CFrame), syntools.serialize(value.Size))
end
return string.format("unk(\"%s\", %s)", vType, syntools.serializeString(tostring(value)))
end
function syntools.serializeTable(t, depth, cache)
if not depth then
cache = {}
depth = 0
end
local tab = string.rep(" ", depth)
local tab2, tblDump = " "..tab, "{\n"
for k, v in pairs(t) do
local key = (type(k) ~= "table") and syntools.serialize(k) or string.format("table(%q)", tostring(k))
if type(v) == "table" then
if table.find(cache, v) then
tblDump = tblDump..string.format("%s[%s] = CyclicTable(%q),\n", tab2, key, tostring(v))
continue;
end
cache[#cache + 1] = v
tblDump = tblDump..string.format("%s[%s] = %s,\n", tab2, key, syntools.serializeTable(v, depth + 1, cache))
continue;
end
tblDump = tblDump..string.format("%s[%s] = %s,\n", tab2, key, syntools.serialize(v))
end
return tblDump..tab.."}"
end
function syntools.serializeUnpacked(...)
local Serialized = ""
for _, o in ipairs({...}) do
Serialized = Serialized..syntools.serialize(o)..", "
end
return string.sub(Serialized, 1, -3)
end
return syntools
|
return {'ibuprofen'} |
-- control.lua
-- Mar 2019
-- Oarc's Separated Spawn Scenario
--
-- I wanted to create a scenario that allows you to spawn in separate locations
-- From there, I ended up adding a bunch of other minor/major features
--
-- Credit:
-- Tags - Taken from WOGs scenario
-- Rocket Silo - Taken from Frontier as an idea
--
-- Feel free to re-use anything you want. It would be nice to give me credit
-- if you can.
-- To keep the scenario more manageable (for myself) I have done the following:
-- 1. Keep all event calls in control.lua (here)
-- 2. Put all config options in config.lua and provided an example-config.lua file too.
-- 3. Put other stuff into their own files where possible.
-- 4. Put all other files into lib folder
-- 5. Provided an examples folder for example/recommended map gen settings
-- Generic Utility Includes
require("lib/oarc_utils")
-- Other soft-mod type features.
require("lib/frontier_silo")
require("lib/tag")
require("lib/game_opts")
require("lib/player_list")
require("lib/rocket_launch")
require("lib/admin_commands")
require("lib/regrowth_map")
-- For Philip. I currently do not use this and need to add proper support for
-- commands like this in the future.
-- require("lib/rgcommand")
-- require("lib/helper_commands")
-- Main Configuration File
require("config")
-- Save all config settings to global table.
require("lib/oarc_global_cfg.lua")
-- Scenario Specific Includes
require("lib/separate_spawns")
require("lib/separate_spawns_guis")
require("lib/oarc_gui_tabs")
-- compatibility with mods
require("compat/factoriomaps")
-- Create a new surface so we can modify map settings at the start.
GAME_SURFACE_NAME="oarc"
-- I'm reverting my decision to turn the regrowth thing into a mod.
remote.add_interface("oarc_regrowth",
{area_offlimits_chunkpos = MarkAreaSafeGivenChunkPos,
area_offlimits_tilepos = MarkAreaSafeGivenTilePos,
area_removal_tilepos = MarkAreaForRemoval,
trigger_immediate_cleanup = TriggerCleanup,
add_surface = RegrowthAddSurface})
commands.add_command("trigger-map-cleanup",
"Force immediate removal of all expired chunks (unused chunk removal mod)",
ForceRemoveChunksCmd)
--------------------------------------------------------------------------------
-- ALL EVENT HANLDERS ARE HERE IN ONE PLACE!
--------------------------------------------------------------------------------
----------------------------------------
-- On Init - only runs once the first
-- time the game starts
----------------------------------------
script.on_init(function(event)
-- FIRST
InitOarcConfig()
-- Regrowth (always init so we can enable during play.)
RegrowthInit()
-- Create new game surface
CreateGameSurface()
-- MUST be before other stuff, but after surface creation.
InitSpawnGlobalsAndForces()
-- Frontier Silo Area Generation
if (global.ocfg.frontier_rocket_silo) then
SpawnSilosAndGenerateSiloAreas()
end
-- Everyone do the shuffle. Helps avoid always starting at the same location.
global.vanillaSpawns = FYShuffle(global.vanillaSpawns)
log("Vanilla spawns:")
log(serpent.block(global.vanillaSpawns))
Compat.handle_factoriomaps()
end)
script.on_load(function()
Compat.handle_factoriomaps()
end)
----------------------------------------
-- Rocket launch event
-- Used for end game win conditions / unlocking late game stuff
----------------------------------------
script.on_event(defines.events.on_rocket_launched, function(event)
if global.ocfg.frontier_rocket_silo then
RocketLaunchEvent(event)
end
end)
----------------------------------------
-- Chunk Generation
----------------------------------------
script.on_event(defines.events.on_chunk_generated, function(event)
if global.ocfg.enable_regrowth then
RegrowthChunkGenerate(event)
end
if global.ocfg.enable_undecorator then
UndecorateOnChunkGenerate(event)
end
if global.ocfg.frontier_rocket_silo then
GenerateRocketSiloChunk(event)
end
SeparateSpawnsGenerateChunk(event)
CreateHoldingPen(event.surface, event.area, 16, 32)
end)
----------------------------------------
-- Gui Click
----------------------------------------
script.on_event(defines.events.on_gui_click, function(event)
-- Don't interfere with other mod related stuff.
if (event.element.get_mod() ~= nil) then return end
if global.ocfg.enable_tags then
TagGuiClick(event)
end
if global.ocfg.enable_player_list then
PlayerListGuiClick(event)
end
WelcomeTextGuiClick(event)
SpawnOptsGuiClick(event)
SpawnCtrlGuiClick(event)
SharedSpwnOptsGuiClick(event)
BuddySpawnOptsGuiClick(event)
BuddySpawnWaitMenuClick(event)
BuddySpawnRequestMenuClick(event)
SharedSpawnJoinWaitMenuClick(event)
ClickOarcGuiButton(event)
GameOptionsGuiClick(event)
end)
script.on_event(defines.events.on_gui_checked_state_changed, function (event)
SpawnOptsRadioSelect(event)
SpawnCtrlGuiOptionsSelect(event)
end)
script.on_event(defines.events.on_gui_selected_tab_changed, function (event)
TabChangeOarcGui(event)
end)
----------------------------------------
-- Player Events
----------------------------------------
script.on_event(defines.events.on_player_joined_game, function(event)
PlayerJoinedMessages(event)
ServerWriteFile("player_events", game.players[event.player_index].name .. " joined the game." .. "\n")
end)
script.on_event(defines.events.on_player_created, function(event)
local player = game.players[event.player_index]
-- Move the player to the game surface immediately.
player.teleport({x=0,y=0}, GAME_SURFACE_NAME)
if global.ocfg.enable_long_reach then
GivePlayerLongReach(player)
end
SeparateSpawnsPlayerCreated(event.player_index)
InitOarcGuiTabs(player)
end)
script.on_event(defines.events.on_player_respawned, function(event)
SeparateSpawnsPlayerRespawned(event)
PlayerRespawnItems(event)
if global.ocfg.enable_long_reach then
GivePlayerLongReach(game.players[event.player_index])
end
end)
script.on_event(defines.events.on_player_left_game, function(event)
ServerWriteFile("player_events", game.players[event.player_index].name .. " left the game." .. "\n")
FindUnusedSpawns(game.players[event.player_index], true)
end)
----------------------------------------
-- On BUILD entity. Don't forget on_robot_built_entity too!
----------------------------------------
script.on_event(defines.events.on_built_entity, function(event)
if global.ocfg.enable_autofill then
Autofill(event)
end
if global.ocfg.enable_regrowth then
local s_index = event.created_entity.surface.index
if (global.rg[s_index] == nil) then return end
remote.call("oarc_regrowth",
"area_offlimits_tilepos",
s_index,
event.created_entity.position,
2)
end
if ENABLE_ANTI_GRIEFING then
SetItemBlueprintTimeToLive(event)
end
if global.ocfg.frontier_rocket_silo then
BuildSiloAttempt(event)
end
end)
----------------------------------------
-- On script_raised_built. This should help catch mods that
-- place items that don't count as player_built and robot_built.
-- Specifically FARL.
----------------------------------------
script.on_event(defines.events.script_raised_built, function(event)
if global.ocfg.enable_regrowth then
local s_index = event.entity.surface.index
if (global.rg[s_index] == nil) then return end
remote.call("oarc_regrowth",
"area_offlimits_tilepos",
s_index,
event.entity.position,
2)
end
end)
----------------------------------------
-- On tick events. Stuff that needs to happen at regular intervals.
-- Delayed events, delayed spawns, ...
----------------------------------------
script.on_event(defines.events.on_tick, function(event)
if global.ocfg.enable_regrowth then
RegrowthOnTick()
RegrowthForceRemovalOnTick()
end
DelayedSpawnOnTick()
if global.ocfg.frontier_rocket_silo then
DelayedSiloCreationOnTick(game.surfaces[GAME_SURFACE_NAME])
end
end)
script.on_event(defines.events.on_sector_scanned, function (event)
if global.ocfg.enable_regrowth then
RegrowthSectorScan(event)
end
end)
-- script.on_event(defines.events.on_sector_scanned, function (event)
-- end)
----------------------------------------
--
----------------------------------------
script.on_event(defines.events.on_robot_built_entity, function (event)
if global.ocfg.enable_regrowth then
local s_index = event.created_entity.surface.index
if (global.rg[s_index] == nil) then return end
remote.call("oarc_regrowth",
"area_offlimits_tilepos",
s_index,
event.created_entity.position,
2)
end
if global.ocfg.frontier_rocket_silo then
BuildSiloAttempt(event)
end
end)
script.on_event(defines.events.on_player_built_tile, function (event)
if global.ocfg.enable_regrowth then
local s_index = event.surface_index
if (global.rg[s_index] == nil) then return end
for k,v in pairs(event.tiles) do
remote.call("oarc_regrowth",
"area_offlimits_tilepos",
s_index,
v.position,
2)
end
end
end)
----------------------------------------
-- Shared chat, so you don't have to type /s
-- But you do lose your player colors across forces.
----------------------------------------
script.on_event(defines.events.on_console_chat, function(event)
if (event.player_index) then
ServerWriteFile("server_chat", game.players[event.player_index].name .. ": " .. event.message .. "\n")
end
if (global.ocfg.enable_shared_chat) then
if (event.player_index ~= nil) then
ShareChatBetweenForces(game.players[event.player_index], event.message)
end
end
end)
----------------------------------------
-- On Research Finished
-- This is where you can permanently remove researched techs
----------------------------------------
script.on_event(defines.events.on_research_finished, function(event)
-- Never allows players to build rocket-silos in "frontier" mode.
if global.ocfg.frontier_rocket_silo and not global.ocfg.frontier_allow_build then
RemoveRecipe(event.research.force, "rocket-silo")
end
if global.ocfg.lock_goodies_rocket_launch and
(not global.satellite_sent or not global.satellite_sent[event.research.force.name]) then
RemoveRecipe(event.research.force, "productivity-module-3")
RemoveRecipe(event.research.force, "speed-module-3")
end
if global.ocfg.enable_loaders then
EnableLoaders(event)
end
end)
----------------------------------------
-- On Entity Spawned and On Biter Base Built
-- This is where I modify biter spawning based on location and other factors.
----------------------------------------
script.on_event(defines.events.on_entity_spawned, function(event)
if (global.ocfg.modified_enemy_spawning) then
ModifyEnemySpawnsNearPlayerStartingAreas(event)
end
end)
script.on_event(defines.events.on_biter_base_built, function(event)
if (global.ocfg.modified_enemy_spawning) then
ModifyEnemySpawnsNearPlayerStartingAreas(event)
end
end)
----------------------------------------
-- On Corpse Timed Out
-- Save player's stuff so they don't lose it if they can't get to the corpse fast enough.
----------------------------------------
script.on_event(defines.events.on_character_corpse_expired, function(event)
DropGravestoneChestFromCorpse(event.corpse)
end)
|
require "Common.define"
require "Common.globe"
LuaTest2 = {};
local this = LuaTest2;
local GameObject = UnityEngine.GameObject;
function LuaTest2:awake(obj)
print("这是LuaTest2");
StartCoroutine(function() this:loadIE(); end);
end
--协成
function LuaTest2:loadIE()
--找到物体,修改值
local go = GameObject.Find("Canvas/Button/Text");
print(go);
--获取该物体的组件
local text = go:GetComponent(typeof(UnityEngine.UI.Text));
text.text = "Lua脚本修改的";
Yield(0);
Yield(null);
WaitForFixedUpdate();
WaitForSeconds(1);
print("11");
WaitForSeconds(1);
print("22");
local x = 1;
while x<10 do
WaitForSeconds(1);
print(x);
x = x+1;
text.text = "周忠年0000:"..x;
end
for i=1,10 do
WaitForSeconds(1);
print(i);
text.text = "周忠年3333:"..i;
end
end
function LuaTest2.Init(object)
this:awake(object);
end
return LuaTest2; |
local result = redis.call('SETNX', KEYS[1], ARGV[1])
if tonumber(result) == 1 then
redis.call('EXPIRE', KEYS[1], ARGV[2])
end
return tostring(result) |
local function testSpawnRegion()
if IsValid(sregion) then sregion:Remove() end
if IsValid(sponent) then sponent:Remove() end
local pos = player.GetAll()[1]:GetEyeTrace().HitPos
sregion = ents.Create("fite_spawnregion")
sregion:SetPos(pos)
sregion:Spawn()
sponent = ents.Create("prop_physics")
sponent:SetPos(pos + Vector(0,0,16))
sponent:SetModel("models/weapons/w_rif_galil.mdl")
sponent:Spawn()
sponent.IsAvailableTo = function(ent, ply) return true end
sregion:BindToSpawn(sponent)
sregion:SetSpawnVolume(FITENITE.SpawnVolume.FloorCylinder())
end
local function testFlag()
if IsValid(sregion) then sregion:Remove() end
if IsValid(fiteflag) then fiteflag:Remove() end
local trace = player.GetAll()[1]:GetEyeTrace()
local pos = trace.HitPos
//local norm = trace.HitNormal
sregion = ents.Create("fite_spawnregion")
sregion:SetPos(pos)
sregion:Spawn()
fiteflag = ents.Create("fite_flag")
fiteflag:SetPos(pos)
fiteflag:SetAngles(Angle(0,0,0))
fiteflag:Spawn()
fiteflag.IsAvailableTo = function(ent, ply) return ply:Team() == ent.Team end
sregion:BindToSpawn(fiteflag)
sregion:SetSpawnVolume(FITENITE.SpawnVolume.FloorCylinder())
end
testFlag() |
local flake = require 'flake'
local ops = require 'operatorBuilders'
local list = require 'list'
local testDirs = list:new {
'directory',
'copyToSelf',
}
local builds = testDirs:map(flake.importBuild)
local function main(ps)
return builds:map(function(bld) return bld.main(ps) end)
end
local function clean(ps)
return builds:map(function(bld) return bld.clean(ps) end)
end
return {
main = main,
clean = clean,
}
|
local path = require 'lib.path'
local sqlite = require 'lsqlite3complete'
local Logs = require 'lib.logs'
local i18n = require 'i18n'
local fun = require 'lib.fun'
---Reads data from a card database (.cdb file)
local DataFetcher = {}
---@alias CardData table<string, string|number>
local ESC_REPL = {['<'] = '<', ['>'] = '>', ['&'] = '&'}
local ESC_CHAR = '[' .. table.concat(fun.iter(ESC_REPL):totable()) .. ']'
---Returns a copy of a string with escaped characters that could conflitct
---with Pango markup. (Pango is the text rendering lib used by vips)
---@param text string
---@return string
local function escape(text) return (text:gsub(ESC_CHAR, ESC_REPL)) end
local VALID_EXT = {jpg = true, png = true, jpeg = true}
---Checks if a file extension is a valid image extension.
---@param ext string
---@return boolean
local function is_valid_ext(ext)
return ext and VALID_EXT[ext:lower()]
end
---Reads a folder looking for image files and returns a table whose keys are
---the image name without the extension (i.e., card id), and whose values are
---the whole image file path.
---@param fp string
---@return string[]
local function get_images(fp)
Logs.assert(fp and fp ~= '', i18n 'compose.data_fetcher.no_img_folder')
return fun.iter(path.each(fp .. path.DIR_SEP))
:map(function(f)
local id, ext = path.basename(f):match('^(%d*)%.(.-)$')
if not (id and is_valid_ext(ext)) then return false end
return id, f
end):tomap()
end
---Retrieves custom table column names from .cdb
---@param cdb Database
---@return table<string,boolean>
local function get_custom_cols(cdb)
return fun.iter(cdb:nrows 'PRAGMA table_info(custom)')
:map(function(col) return col.name, true end)
:tomap()
end
local SELECT_TEMPLATE = 'SELECT * FROM %s WHERE id IN (%s)'
---Reads data from a card database (.cdb file), looking for ids
---that match those of the images found previously on a folder.
---@param cdbfp string path to a .cdb file
---@param imgs table<string,string>
---@return CardData[] cards
local function read_cdb(cdbfp, imgs)
local cdb = sqlite.open(cdbfp)
Logs.assert(cdb and cdb:isopen(), i18n 'compose.data_fetcher.closed_db')
local ids = table.concat(fun.iter(imgs):totable(), ',')
local sql = SELECT_TEMPLATE:format('texts NATURAL JOIN datas', ids)
local s, cards = pcall(function()
local custom_cols = get_custom_cols(cdb)
local cards = {}
for row in cdb:nrows(sql) do
row.id = tostring(row.id)
row.art = imgs[row.id]
row.name = escape(row.name or '')
row.desc = escape(row.desc or '')
cards[row.id] = row
end
if next(custom_cols) then
for row in cdb:nrows(SELECT_TEMPLATE:format('custom', ids)) do
for col in pairs(custom_cols) do
local id, v = tostring(row.id), row[col]
cards[id][col] = type(v) == 'string' and escape(v) or v
end
end
end
cdb:close()
return cards
end)
Logs.assert(s, i18n 'compose.data_fetcher.read_db_fail', s and '' or cards)
cards = fun.iter(cards):map(function(_, c) return c end):totable()
return table.sort(cards, function(a, b) return a.id < b.id end)
end
---Reads data from a card database (.cdb file)
---@param imgfolder string
---@param cdbfp string
---@return CardData[] cards
function DataFetcher.get(imgfolder, cdbfp)
local imgs = get_images(imgfolder)
local cards = read_cdb(cdbfp, imgs)
return cards
end
return DataFetcher
|
local config = {
[10000000] = {
type_id = 10000000, name = [[道具1]], icon = 10000000, type = 1,
},
}
return config |
local awful = require 'awful'
local bling = require 'modules.bling'
awful.layout.layouts = {
awful.layout.suit.floating,
awful.layout.suit.tile,
awful.layout.suit.spiral.dwindle,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
-- awful.layout.suit.tile.left,
-- awful.layout.suit.tile.bottom,
-- awful.layout.suit.tile.top,
-- awful.layout.suit.fair,
-- awful.layout.suit.fair.horizontal,
-- awful.layout.suit.spiral,
-- awful.layout.suit.max,
-- awful.layout.suit.corner.nw,
-- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se,
}
require 'conf.autostart'
terminal = 'tym'
terminalname = terminal:gsub('^%l', string.upper)
editor = os.getenv 'EDITOR' or 'nvim'
editorname = 'Neovim'
editorcmd = terminal .. ' -e ' .. editor
musicplayer = 'cmus'
playername = musicplayer:gsub('^%l', string.upper)
musiccmd = terminal .. ' -e ' .. musicplayer
browsername = 'Google Chrome'
browsercmd = 'google-chrome'
modkey = 'Mod4'
altkey = 'Mod1'
shift = 'Shift'
control = 'Control'
bling.signal.playerctl.enable {
backend = 'playerctl_lib',
update_on_activity = true
}
require 'conf.keys'
require 'conf.signals'
|
hour_str = {"sat", "sata"} |
-- Copyright (C) Asseco Poland SA
--[[ -------------------------------------------------
Plugin Description:
Copying JWT Key from request body to Authorization header.
Supported Content-Type: x-www-form-urlencoded.
Plugin Params:
- config.cloning_field - field name in body with JWT Key
- config.header_overwrite - overwrite existing Authorization header
--]]
local typedefs = require "kong.db.schema.typedefs"
return {
name = "asseco-jwt-cloner",
fields = {
{ protocols = typedefs.protocols_http },
{ config = {
type = "record",
fields = {
{ cloning_field = { type = "string" }},
{ header_overwrite = { type = "boolean", default = true }},
}
}
}
}
}
|
project "Sandbox"
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
staticruntime "on"
targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")
files
{
"./**.h",
"./**.cpp"
}
includedirs
{
"%{wks.location}/src/external/spdlog/include",
"%{wks.location}/src/emerald",
"%{wks.location}/src/external",
"%{IncludeDir.glm}",
}
links
{
"Emerald"
}
filter "system:windows"
systemversion "latest"
filter "system:linux"
links
{
"GLFW",
"Glad",
"ImGui",
"GL",
"GLU",
"X11",
"dl",
"pthread"
}
filter "system:macosx"
links
{
"GLFW",
"Glad",
"ImGui",
"pthread"
}
linkoptions { "-framework OpenGL -framework Cocoa -framework IOKit -framework CoreFoundation" }
filter "configurations:Debug"
defines "EM_DEBUG"
runtime "Debug"
symbols "on"
filter "configurations:Release"
defines "EM_RELEASE"
runtime "Release"
optimize "on"
filter "configurations:Dist"
defines "EM_DIST"
runtime "Release"
optimize "on"
|
-- module: Application window actions
local m = {}
-- App/window actions are defined in appactions.lua
local A = require('appactions')
-- table for converting events to strings when debugging
local DEBUG = {
[0] = 'launching',
[1] = 'launched',
[2] = 'terminated',
[3] = 'hidden',
[4] = 'unhidden',
[5] = 'activated',
[6] = 'deactivated',
}
local watcher = nil
-- Get audio libraries
local audio = require 'hs.audiodevice'
-- appwatcher callback
local function watch(appName, eventType, appObject)
-- print('watch(', appName, ', ', eventType, ', ', appObject, ')')
-- see config.appwindows for rule configuration
if m.cfg.rules[appName] then
local function hasNoMainWindow() return appObject:mainWindow() == nil end
for _,rule in ipairs(m.cfg.rules[appName]) do
-- if the current event matches one of our rules for this app,
-- take the action defined by the rule.
if rule.evt == eventType then
if rule.act == A.fullscreen then
-- set the main window to fullscreen
hs.timer.waitWhile(hasNoMainWindow, function()
appObject:mainWindow():setFullScreen(true)
end)
elseif rule.act == A.maximize then
-- maximize the main window
hs.timer.waitWhile(hasNoMainWindow, function()
appObject:mainWindow():maximize()
end)
elseif rule.act == A.toFront then
-- bring the application windows to the front
appObject:selectMenuItem({'Window', 'Bring All to Front'})
elseif rule.act == A.videoLightOn then
-- Call HA to turn on video lighting
hs.loadSpoon("Keychain")
hatoken = spoon.Keychain:getItem{
label = 'hassio_hammerspoon'
}['password']
hs.http.doRequest(
'https://hassio.lapseofthought.com:8123/api/services/light/turn_on',
'POST',
'{"entity_id":"light.dan_video_light","brightness_pct":"100","color_name":"white"}',
{
['Content-type'] = 'application-json',
['Authorization'] = 'Bearer ' .. hatoken
}
)
-- set volulme to 80%, saving the old level
local audioDev = audio.defaultOutputDevice()
m.saveVolume = audioDev:volume()
audioDev:setVolume(80)
elseif rule.act == A.videoLightOff then
-- Call HA to turn off video lighting
hs.loadSpoon("Keychain")
hatoken = spoon.Keychain:getItem{
label = 'hassio_hammerspoon'
}['password']
hs.http.doRequest(
'https://hassio.lapseofthought.com:8123/api/services/light/turn_off',
'POST',
'{"entity_id":"light.dan_video_light"}',
{
['Content-type'] = 'application-json',
['Authorization'] = 'Bearer ' .. hatoken
}
)
-- restore volume to the prior level
local audioDev = audio.defaultOutputDevice()
if m.saveVolume then
audioDev:setVolume(m.saveVolume)
end
elseif rule.act == A.fullVolume then
-- set volulme to 80%, saving the old level
local audioDev = audio.defaultOutputDevice()
m.saveVolume = audioDev:volume()
audioDev:setVolume(80)
elseif rule.act == A.restoreVolume then
-- restore volume to the prior level
local audioDev = audio.defaultOutputDevice()
if m.saveVolume then
audioDev:setVolume(m.saveVolume)
end
elseif rule.act == A.iTermZoomIn then
hs.eventtap.keyStroke({"cmd", "shift"}, "=")
elseif rule.act == A.iTermZoomOut then
hs.eventtap.keyStroke({"cmd"}, "-")
elseif rule.act == A.debug then
-- print some debugging information about the app and events
print(
'appName:', appName,
', bundleID:', appObject:bundleID(),
', eventType:', DEBUG[eventType])
m.log.d(
'appName:', appName,
', bundleID:', appObject:bundleID(),
', eventType:', DEBUG[eventType]
)
end
end
end
end
end
function m.start()
watcher = hs.application.watcher.new(watch)
watcher:start()
end
function m.stop()
watcher:stop()
watcher = nil
end
return m
|
--クリスタルクリアウィング・シンクロ・ドラゴン
--Scripted by mallu11
function c100425004.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSynchroType,TYPE_SYNCHRO),aux.NonTuner(Card.IsSetCard,0xff),1,1)
c:EnableReviveLimit()
--immue
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100425004,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c100425004.imcon)
e1:SetOperation(c100425004.imop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100425004,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c100425004.discon)
e2:SetTarget(c100425004.distg)
e2:SetOperation(c100425004.disop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100425004,2))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c100425004.thcon)
e3:SetTarget(c100425004.thtg)
e3:SetOperation(c100425004.thop)
c:RegisterEffect(e3)
end
c100425004.material_type=TYPE_SYNCHRO
function c100425004.imcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and aux.dscon()
end
function c100425004.imop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
if rc:IsRelateToEffect(re) and rc:IsControler(1-tp) and rc:GetBaseAttack()>0 then
local atk=rc:GetBaseAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100425004,3))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(c100425004.efilter)
c:RegisterEffect(e2)
end
end
function c100425004.efilter(e,te)
return te:IsActivated() and te:IsActiveType(TYPE_MONSTER) and te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function c100425004.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c100425004.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c100425004.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c100425004.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO) and rp==1-tp and c:IsPreviousControler(tp)
end
function c100425004.thfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToHand()
end
function c100425004.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100425004.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100425004.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100425004.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
|
sudo={180191663,207213049,158955285}
|
-- デフォルト歌詞の設定
defaultlyrics = "la"
setdefaultlyrics = "la"
motiontype = {}
--[[
motiontype[1]: ノート追加場所
0: メインノートグループの後ろ
1: トラックの一番後ろ
]]
motiontype[1] = 1
Q = SV.QUARTER
function getClientInfo()
return {
name = SV:T("Move Back Lyrics"),
category = "Lyrics",
author = "Yukikazari",
versionNumber = 1,
minEditorVersion = 0x010008
}
end
function getTranslations(langCode)
if langCode == "ja-jp" then
return {
{"Move Back Lyrics", "歌詞を後ろに移動する"},
{"error", "エラー"},
{"selected note couldn't find out in Track", "選択されたノートがトラック上で見つかりません"}
}
end
end
function getVowel()
--[[
直前の母音拾って設定する歌詞変更しようと思ったけど
これいる?ってなったので必要そうなら作る
]]
end
function main()
Project = SV:getProject()
MV = SV:getMainEditor()
Track = MV:getCurrentTrack()
local TSS = MV:getSelection()
local Notes = TSS:getSelectedNotes()
if #Notes == 0 then
SV:finish()
return
end
local nOnset = Notes[1]:getOnset()
local nidx = -1
local NG = Track:getGroupReference(1):getTarget()
local maxnidx = NG:getNumNotes()
for i = 1, maxnidx do
if NG:getNote(i):getOnset() == nOnset then
nidx = i
break
end
end
if nidx == -1 then
SV:showMessageBox(SV:T("error"), SV:T("selected note couldn't find out in Track"))
SV:finish()
return
end
local lyrics = {}
for i=nidx, maxnidx do
lyrics[#lyrics+1] = NG:getNote(i):getLyrics()
end
local ly = setdefaultlyrics
for i = 1, #Notes do
Notes[i]:setLyrics(ly)
end
nidx = nidx + #Notes
local i = 1
local jump = 0
local last = NG:getNote(NG:getNumNotes()):getEnd()
if motiontype[1] == 1 and Track:getNumGroups() > 1 then
for i=2, Track:getNumGroups() do
local l = Track:getGroupReference(i):getEnd()
if l > last then
last = l
end
end
end
while i <= #lyrics do
if lyrics[i] ~= defaultlyrics or i <= #Notes then
if nidx <= maxnidx then
NG:getNote(nidx):setLyrics(lyrics[i])
else
local note = SV:create("Note")
note:setTimeRange(last, Q)
note:setLyrics(lyrics[i])
note:setPitch(60)
NG:addNote(note)
last = last + Q
end
nidx = nidx + 1
else
jump = jump + 1
end
i = i + 1
if jump >= #Notes then
break
end
end
SV:finish()
end |
local settings = require './settings'
local Embed = require 'embed-constructor'
return function(msg)
local embed = Embed()
:setTitle 'Error :x:'
:setColor 'red'
:setDescription(msg)
:setFooter(settings.footer)
:setTimestamp()
:finish();
return embed
end |
print("**************************toLua调用CSharp中的ref和out方法*************")
--toLua和Xlua中对ref和out函数的使用基本类似
--通过多返回值形式进行处理
--如果 是out和ref函数
--第一个返回值 是函数的默认返回值
--之后的返回值 就是ref 和 out对应的结果 从左到右 一一对应
local obj = Lesson5()
print(obj:RefFun(10,0,0,1))
local a,b,c = obj:RefFun(10,0,0,1)
print("a:" .. a)
print("b:" .. b)
print("c:" .. c)
--out 类型参数在toLua中不能省略 在XLua中可以省略
print(obj:OutFun(20,nil,nil,30)) --200 20 30
print(obj:OutFun(20,2,1,30))--200 20 30
local a1,b1,c1 = obj:OutFun(20,nil,nil,30)
print("a1:" .. a1)
print("b1:" .. b1)
print("c1:" .. c1)
print(obj:RefOutFun(20,nil,45))--300 200 400
local a2,b2,c2 = obj:RefOutFun(20,nil,45)
print("a2:" .. a1)
print("b2:" .. b1)
print("c2:" .. c1)
--在toLua中使用ref和out中 最好使用out |
-- luacheck: max line length 150
local sys = require'sys'
local nvim = require'nvim'
-- local split = require'tools'.strings.split
local iregex = require'tools'.strings.iregex
local executable = require'tools'.files.executable
local is_file = require'tools'.files.is_file
local writefile = require'tools'.files.writefile
local normalize_path = require'tools'.files.normalize_path
local realpath = require'tools'.files.realpath
local basename = require'tools'.files.basename
local read_json = require'tools'.files.read_json
local echomsg = require'tools'.messages.echomsg
local echoerr = require'tools'.messages.echoerr
-- local set_autocmd = nvim.autocmds.set_autocmd
local set_abbr = nvim.abbrs.set_abbr
local set_command = nvim.commands.set_command
local set_mapping = nvim.mappings.set_mapping
local get_mapping = nvim.mappings.get_mapping
local has = nvim.has
local plugins = nvim.plugins
local noremap = {noremap = true}
local noremap_silent = {noremap = true, silent = true}
if nvim.g.mapleader == nil then
nvim.g.mapleader = ' '
end
if executable('svn') then
set_command{
lhs = 'SVNstatus',
rhs = "execute('!svn status ' . <q-args>)",
args = {nargs='*', force = true}
}
set_command{
lhs = 'SVN',
rhs = "execute('!svn ' . <q-args>)",
args = {complete='file', nargs='+', force = true}
}
set_command{
lhs = 'SVNupdate',
rhs = "execute('!svn update ' . <q-args>)",
args = {complete='file', nargs='*', force = true}
}
end
if plugins["vim-bbye"] == nil then
set_mapping{
mode = 'n',
lhs = '<leader>d',
rhs = function()
require'tools'.buffers.delete()
end,
}
end
if plugins["vim-indexed-search"] == nil then
-- set_mapping{ mode = 'n', lhs = '*', rhs = '*zz' }
-- set_mapping{ mode = 'n', lhs = '#', rhs = '#zz' }
set_mapping{
mode = 'n',
lhs = 'n',
rhs = "<cmd>call mappings#NiceNext('n')<cr>",
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = 'N',
rhs = "<cmd>call mappings#NiceNext('N')<cr>",
args = noremap_silent
}
end
if plugins["vim-unimpaired"] == nil then
set_mapping{
mode = 'n',
lhs = '[Q',
rhs = ':<C-U>cfirst<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = ']Q',
rhs = ':<C-U>clast<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '[q',
rhs = ':<C-U>exe "".(v:count ? v:count : "")."cprevious"<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = ']q',
rhs = ':<C-U>exe "".(v:count ? v:count : "")."cnext"<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '[L',
rhs = ':<C-U>lfirst<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = ']L',
rhs = ':<C-U>llast<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '[l',
rhs = ':<C-U>exe "".(v:count ? v:count : "")."lprevious"<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = ']l',
rhs = ':<C-U>exe "".(v:count ? v:count : "")."lnext"<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '[B',
rhs = ':<C-U>bfirst<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = ']B',
rhs = ':<C-U>blast<CR>zvzz',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '[b',
rhs = ':<C-U>exe "".(v:count ? v:count : "")."bprevious"<CR>',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = ']b',
rhs = ':<C-U>exe "".(v:count ? v:count : "")."bnext"<CR>',
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = ']<Space>',
rhs = [[:<C-U>lua require'tools'.helpers.add_nl(true)<CR>]],
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '[<Space>',
rhs = [[:<C-U>lua require'tools'.helpers.add_nl(false)<CR>]],
args = noremap_silent,
}
set_mapping{
mode = 'n',
lhs = ']e',
rhs = [[:<C-U>lua require'tools'.helpers.move_line(true)<CR>]],
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '[e',
rhs = [[:<C-U>lua require'tools'.helpers.move_line(false)<CR>]],
args = noremap_silent,
}
end
if plugins["vim-vinegar"] == nil and plugins["nerdtree"] == nil then
set_mapping{ mode = 'n', lhs = '-', rhs = '<cmd>Explore<CR>' }
end
if plugins["vim-eunuch"] == nil then
set_command{
lhs = 'MoveFile',
rhs = function(new_path, bang)
local current_path = nvim.fn.expand('%:p')
local is_dir = require'tools'.files.is_dir
if is_file(current_path) and is_dir(new_path) then
new_path = new_path .. '/' .. nvim.fn.fnamemodify(current_path, ':t')
end
require'tools'.files.rename(current_path, new_path, bang)
end,
args = {force = true, bang = true, nargs = 1, complete = 'file'}
}
set_command{
lhs = 'RenameFile',
rhs = function(args, bang)
local current_path = nvim.fn.expand('%:p')
local current_dir = nvim.fn.expand('%:h')
require'tools'.files.rename(current_path, current_dir..'/'..args, bang)
end,
args = {force = true, bang = true, nargs = 1, complete = 'file'}
}
set_command{
lhs = 'Mkdir',
rhs = function(args)
nvim.fn.mkdir(nvim.fn.fnameescape(args), 'p')
end,
args = {force = true, nargs = 1, complete = 'dir'}
}
set_command{
lhs = 'RemoveFile',
rhs = function(args, bang)
local current_buffer = nvim.fn.expand('%')
local target = args ~= '' and args or current_buffer
require'tools'.files.delete(nvim.fn.fnamemodify(target, ":p"), bang)
end,
args = {force = true, bang = true, nargs = '?', complete = 'file'}
}
end
if has('nvim-0.5') then
set_command {
lhs = 'Grep',
rhs = function(args)
require'settings.functions'.send_grep_job(args)
end,
args = {nargs = '+', force = true}
}
set_mapping{
mode = 'n',
lhs = 'gs',
rhs = '<cmd>set opfunc=neovim#grep<CR>g@',
args = noremap_silent,
}
set_mapping{
mode = 'v',
lhs = 'gs',
rhs = ':<C-U>call neovim#grep(visualmode(), v:true)<CR>',
args = noremap_silent,
}
set_mapping{
mode = 'n',
lhs = 'gss',
rhs = function()
require'settings.functions'.send_grep_job(nvim.fn.expand('<cword>'))
end,
args = noremap_silent,
}
set_command {
lhs = 'Make',
rhs = function(args)
local ok, val = pcall(nvim.buf.get_option, 0, 'makeprg')
local cmd = ok and val or vim.o.makeprg
if cmd:sub(#cmd, #cmd) == '%' then
cmd = cmd:gsub('%%', vim.fn.expand('%'))
end
cmd = cmd .. args
local make_win = nvim.get_current_win()
require'jobs'.send_job{
cmd = cmd,
qf = {
-- open = false,
loc = true,
win = make_win,
jump = true,
context = 'AsyncMake',
title = cmd,
},
opts = {
on_exit = function(jobid, rc, _)
local jobs = require'jobs'.jobs
local streams = jobs[jobid].streams or {}
local stdout = streams.stdout or {}
local stderr = streams.stderr or {}
if #stdout > 0 or #stderr > 0 then
local lines
if #streams.stderr > 0 then
lines = streams.stderr
else
lines = streams.stdout
end
local qf_opts = jobs[jobid].qf or {}
qf_opts.lines = lines
require'tools'.helpers.dump_to_qf(qf_opts)
else
if rc == 0 then
echomsg('Everything seems fine! ')
else
echoerr('Make failed !, exited with error code '..rc)
end
nvim.fn.setloclist(make_win, {}, 'r')
end
end
},
}
end,
args = {nargs = '*', force = true}
}
end
set_mapping{ mode = 'n', lhs = ',', rhs = ':', args = noremap }
set_mapping{ mode = 'x', lhs = ',', rhs = ':', args = noremap }
set_mapping{ mode = 'n', lhs = 'Y', rhs = 'y$', args = noremap }
set_mapping{ mode = 'x', lhs = '$', rhs = '$h', args = noremap }
set_mapping{ mode = 'n', lhs = 'Q', rhs = 'o<ESC>', args = noremap }
set_mapping{ mode = 'n', lhs = 'J', rhs = 'm`J``', args = noremap }
set_mapping{ mode = 'i', lhs = 'jj', rhs = '<ESC>' }
set_mapping{ mode = 'x', lhs = '<BS>', rhs = '<ESC>', args = noremap }
set_mapping{
mode = 'n',
lhs = '<BS>',
rhs = function()
local ok, _ = pcall(nvim.ex.pop)
if not ok then
local key = nvim.replace_termcodes("<C-o>", true, false, true)
nvim.feedkeys(key, 'n', true)
-- local jumps
-- ok, jumps = pcall(nvim.exec, 'jumps', true)
-- if ok and #jumps > 0 then
-- jumps = vim.split(jumps, '\n')
-- table.remove(jumps, 1)
-- table.remove(jumps, #jumps)
-- local current_jump
-- for i=1,#jumps do
-- local jump = vim.trim(jumps[i]);
-- jump = split(jump, ' ');
-- if jump[1] == 0 then
-- current_jump = i;
-- end
-- jumps[i] = jump;
-- end
-- if current_jump > 1 then
-- local current_buf = nvim.win.get_buf(0)
-- local jump_buf = jumps[current_jump - 1][4]
-- if current_buf ~= jump_buf then
-- if not nvim.buf.is_valid(jump_buf) or not nvim.buf.is_loaded(jump_buf) then
-- nvim.ex.edit(jump_buf)
-- end
-- end
-- nvim.win.set_cursor(0, jumps[current_jump - 1][2], jumps[current_jump - 1][3])
-- end
-- end
end
end,
args = noremap_silent,
}
set_mapping{
mode = 'i',
lhs = '<TAB>',
rhs = [[<C-R>=mappings#tab()<CR>]],
args = noremap_silent,
}
set_mapping{
mode = 'i',
lhs = '<S-TAB>',
rhs = [[<C-R>=mappings#shifttab()<CR>]],
args = noremap_silent,
}
set_mapping{
mode = 'i',
lhs = '<CR>',
rhs = [[<C-R>=mappings#enter()<CR>]],
args = noremap_silent,
}
-- TODO: Check for GUIs
if sys.name == 'windows' then
set_mapping{
mode = 'n',
lhs = '<C-h>',
rhs = '<cmd>call mappings#bs()<CR>',
args = noremap_silent,
}
set_mapping{
mode = 'x',
lhs = '<C-h>',
rhs = '<cmd><ESC>',
args = noremap,
}
if not nvim.g.started_by_firenvim then
set_mapping{
mode = 'n',
lhs = '<C-z>',
rhs = '<nop>',
args = noremap,
}
end
else
set_command{
lhs = 'Chmod',
rhs = function(mode)
local filename = nvim.fn.expand('%')
local files = require'tools'.files
if not mode:match('^%d+$') then
require'tools'.messages.echoerr('Not a valid permissions mode: '..mode)
return
end
if files.is_file(filename) then
files.chmod(filename, mode)
end
end,
args = {nargs=1, force=true}
}
end
if not get_mapping{ mode = 'n', lhs = '<C-L>' } then
set_mapping{
mode = 'n',
lhs = '<C-L>',
rhs = '<cmd>nohlsearch|diffupdate<CR>',
args = noremap_silent,
}
end
if executable('powershell') then
set_command{
lhs = 'PowershellToggle',
rhs = 'call windows#toggle_powershell()',
args = {force=true}
}
end
set_mapping{
mode = 'i',
lhs = '<C-U>',
rhs = '<C-G>u<C-U>',
args = noremap,
}
if not has('nvim-0.5') then
set_mapping{
mode = 'n',
lhs = '<C-w>o',
rhs = '<cmd>diffoff!<BAR>only<CR>',
args =noremap,
}
set_mapping{
mode = 'n',
lhs = '<C-w><C-o>',
rhs = '<cmd>diffoff!<BAR>only<CR>',
args = noremap,
}
end
set_mapping{
mode = 'n',
lhs = '<S-tab>',
rhs = '<C-o>',
args = noremap,
}
set_mapping{
mode = 'x',
lhs = '<',
rhs = '<gv',
args = noremap,
}
set_mapping{
mode = 'x',
lhs = '>',
rhs = '>gv',
args = noremap,
}
set_mapping{
mode = 'n',
lhs = 'j',
rhs = [[v:count ? (v:count >= 3 ? "m'" . v:count : '') . 'j' : 'gj']],
args = {noremap = true, expr = true},
}
set_mapping{
mode = 'n',
lhs = 'k',
rhs = [[v:count ? (v:count >= 3 ? "m'" . v:count : '') . 'k' : 'gk']],
args = {noremap = true, expr = true},
}
set_mapping{
mode = 'n',
lhs = '<leader><leader>e',
rhs = '<cmd>echo expand("%")<CR>',
args = noremap,
}
-- set_mapping{
-- mode = 'n',
-- lhs = '<leader>c',
-- rhs = '<cmd>pclose<CR>',
-- args = noremap,
-- }
set_mapping{
mode = 'n',
lhs = 'i',
rhs = function()
local current_line = nvim.fn.line('.')
local last_line = nvim.fn.line('$')
local buftype = nvim.bo.buftype
if #nvim.fn.getline('.') == 0 and last_line ~= current_line and buftype ~= 'terminal' then
return '"_ddO'
end
return 'i'
end,
args = {noremap = true, expr = true},
}
set_mapping{ mode = 'n', lhs = 'c*', rhs = 'm`*``cgn', args = noremap }
set_mapping{ mode = 'n', lhs = 'c#', rhs = 'm`#``cgN', args = noremap }
set_mapping{ mode = 'n', lhs = 'cg*', rhs = 'm`g*``cgn', args = noremap }
set_mapping{ mode = 'n', lhs = 'cg#', rhs = 'm`#``cgN', args = noremap }
set_mapping{ mode = 'x', lhs = 'c', rhs = [["cy/<C-r>c<CR>Ncgn]], args = noremap }
set_mapping{ mode = 'n', lhs = '¿', rhs = '`', args = noremap }
set_mapping{ mode = 'x', lhs = '¿', rhs = '`', args = noremap }
set_mapping{ mode = 'n', lhs = '¿¿', rhs = '``', args = noremap }
set_mapping{ mode = 'x', lhs = '¿¿', rhs = '``', args = noremap }
set_mapping{ mode = 'n', lhs = '¡', rhs = '^', args = noremap }
set_mapping{ mode = 'x', lhs = '¡', rhs = '^', args = noremap }
-- set_mapping{ mode = 'n', lhs = '<leader>w', rhs = '<cmd>update<CR>', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>p', rhs = '<C-^>', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>x', rhs = '<cmd>%!xxd<CR>', args = noremap }
set_mapping{
mode = 'n',
lhs = '<leader>q',
rhs = function()
local tabs = nvim.list_tabpages()
local wins = nvim.tab.list_wins(0)
if #wins > 1 and nvim.fn.expand('%') ~= '[Command Line]' then
nvim.win.hide(0)
elseif #tabs > 1 then
nvim.ex['tabclose!']()
else
nvim.exec('quit!', false)
end
end,
args = noremap_silent,
}
set_mapping{ mode = 'n', lhs = '<leader>h', rhs = '<C-w>h', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>j', rhs = '<C-w>j', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>k', rhs = '<C-w>k', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>l', rhs = '<C-w>l', args = noremap }
-- set_mapping{ mode = 'n', lhs = '<leader>b', rhs = '<C-w>b', args = noremap }
-- set_mapping{ mode = 'n', lhs = '<leader>t', rhs = '<C-w>t', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>e', rhs = '<C-w>=', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>1', rhs = '1gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>2', rhs = '2gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>3', rhs = '3gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>4', rhs = '4gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>5', rhs = '5gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>6', rhs = '6gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>7', rhs = '7gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>8', rhs = '8gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>9', rhs = '9gt', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader>0', rhs = '<cmd>tablast<CR>', args = noremap }
set_mapping{ mode = 'n', lhs = '<leader><leader>n', rhs = '<cmd>tabnew<CR>', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>1', rhs = '<ESC>1gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>2', rhs = '<ESC>2gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>3', rhs = '<ESC>3gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>4', rhs = '<ESC>4gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>5', rhs = '<ESC>5gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>6', rhs = '<ESC>6gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>7', rhs = '<ESC>7gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>8', rhs = '<ESC>8gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>9', rhs = '<ESC>9gt', args = noremap }
set_mapping{ mode = 'x', lhs = '<leader>0', rhs = '<ESC>:tablast<CR>', args = noremap }
-- Fucking Typos
set_abbr{ mode = 'c', lhs = 'Gti', rhs = 'Git' }
set_abbr{ mode = 'c', lhs = 'W' , rhs = 'w' }
set_abbr{ mode = 'c', lhs = 'Q' , rhs = 'q' }
set_abbr{ mode = 'c', lhs = 'q1' , rhs = 'q!' }
set_abbr{ mode = 'c', lhs = 'qa1', rhs = 'qa!' }
set_abbr{ mode = 'c', lhs = 'w1' , rhs = 'w!' }
set_abbr{ mode = 'c', lhs = 'wA!', rhs = 'wa!' }
set_abbr{ mode = 'c', lhs = 'wa1', rhs = 'wa!' }
set_abbr{ mode = 'c', lhs = 'Qa1', rhs = 'qa!' }
set_abbr{ mode = 'c', lhs = 'Qa!', rhs = 'qa!' }
set_abbr{ mode = 'c', lhs = 'QA!', rhs = 'qa!' }
set_mapping{ mode = 'c', lhs = '<C-n>', rhs = '<down>', args = noremap }
set_mapping{ mode = 'c', lhs = '<C-p>', rhs = '<up>', args = noremap }
set_mapping{
mode = 'c',
lhs = '<C-r><C-w>',
rhs = "<C-r>=escape(expand('<cword>'), '#')<CR>",
args = noremap
}
set_mapping{ mode = 'n', lhs = '&', rhs = '<cmd>&&<CR>', args = noremap }
set_mapping{ mode = 'x', lhs = '&', rhs = '<cmd>&&<CR>', args = noremap }
set_mapping{ mode = 'n', lhs = '/', rhs = 'ms/', args = noremap }
set_mapping{ mode = 'n', lhs = 'g/', rhs = 'ms/\\v', args = noremap }
set_mapping{ mode = 'n', lhs = '0', rhs = '^', args = noremap }
set_mapping{ mode = 'n', lhs = '^', rhs = '0', args = noremap }
set_mapping{ mode = 'n', lhs = 'gV', rhs = '`[v`]', args = noremap }
set_mapping{ mode = 't', lhs = '<ESC>', rhs = '<C-\\><C-n>', args = noremap }
-- set_mapping{ mode = 'n', lhs = '<A-s>', rhs = '<C-w>s', args = noremap }
-- set_mapping{ mode = 'n', lhs = '<A-v>', rhs = '<C-w>v', args = noremap }
set_command{
lhs = 'Terminal',
rhs = function(cmd)
-- local split = nvim.o.splitbelow == true and 'botright' or 'topleft'
local is_empty = (cmd == nil or #cmd == 0) and true or false
local shell
if not is_empty then
shell = cmd
elseif sys.name == 'windows' then
if iregex(nvim.o.shell, [[^cmd\(\.exe\)\?$]]) then
shell = 'powershell -noexit -executionpolicy bypass '
else
shell = nvim.o.shell
end
else
shell = nvim.fn.fnamemodify(nvim.env.SHELL or '', ':t')
if iregex(shell, [[\(t\)\?csh]]) then
shell = executable('zsh') and 'zsh' or (executable('bash') and 'bash' or shell)
end
end
local win = require("floating").window()
nvim.ex.edit('term://'..shell)
nvim.win.set_option(win, 'number', false)
nvim.win.set_option(win, 'relativenumber', false)
if is_empty then
nvim.ex.startinsert()
end
end,
args = {nargs='?', force=true}
}
set_command{
lhs = 'RelativeNumbersToggle',
rhs = 'set relativenumber! relativenumber?',
args = {force=true}
}
set_command{
lhs = 'MouseToggle',
rhs = 'call mappings#ToggleMouse()',
args = {force=true}
}
set_command{
lhs = 'ArrowsToggle',
rhs = 'call mappings#ToggleArrows()',
args = {force=true}
}
set_command{
lhs = 'BufKill',
rhs = 'call mappings#BufKill(<bang>0)',
args = {bang = true,
force = true}
}
set_command{
lhs = 'BufClean',
rhs = 'call mappings#BufClean(<bang>0)',
args = {bang = true,
force = true}
}
set_command{
lhs = 'ModifiableToggle',
rhs = 'setlocal modifiable! modifiable?',
args = {force=true}
}
set_command{
lhs = 'CursorLineToggle',
rhs = 'setlocal cursorline! cursorline?',
args = {force=true}
}
set_command{
lhs = 'ScrollBindToggle',
rhs = 'setlocal scrollbind! scrollbind?',
args = {force=true}
}
set_command{
lhs = 'HlSearchToggle',
rhs = 'setlocal hlsearch! hlsearch?',
args = {force=true}
}
set_command{
lhs = 'NumbersToggle',
rhs = 'setlocal number! number?',
args = {force=true}
}
set_command{
lhs = 'SpellToggle',
rhs = 'setlocal spell! spell?',
args = {force=true}
}
set_command{
lhs = 'WrapToggle',
rhs = 'setlocal wrap! wrap?',
args = {force=true}
}
set_command{
lhs = 'VerboseToggle',
rhs = 'let &verbose=!&verbose | echo "Verbose " . &verbose',
args = {force=true}
}
set_command{
lhs = 'TrimToggle',
rhs = function ()
if not nvim.b.trim then
print('Trim')
else
print('NoTrim')
end
nvim.b.trim = not nvim.b.trim
end,
args = {force=true}
}
set_command{
lhs = 'GonvimSettngs',
rhs = "execute('edit ~/.gonvim/setting.toml')",
args = {nargs='*', force = true}
}
set_command{
lhs = 'FileType',
rhs = "call mappings#SetFileData('filetype', <q-args>, 'text')",
args = {nargs='?', complete='filetype', force = true}
}
set_command{
lhs = 'FileFormat',
rhs = "call mappings#SetFileData('fileformat', <q-args>, 'unix')",
args = {nargs='?', complete='customlist,mappings#format', force = true}
}
set_command{
lhs = 'SpellLang',
rhs = 'lua require"tools".helpers.spelllangs(<q-args>)',
args = {force = true, nargs = '?', complete = 'customlist,mappings#spells'}
}
set_command{
lhs = 'ConncallLevel',
rhs = "call mappings#ConncallLevel(expand(<q-args>))",
args = {nargs='?', force = true}
}
set_command{
lhs = 'Qopen',
rhs = "execute((&splitbelow) ? 'botright' : 'topleft' ) . ' copen ' . expand(<q-args>)",
args = {nargs='?', force = true}
}
set_mapping{
mode = 'n',
lhs = '=l',
rhs = [[<cmd>lua require'tools'.helpers.toggle_qf('loc')<CR>]],
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '=q',
rhs = [[<cmd>lua require'tools'.helpers.toggle_qf('qf')<CR>]],
args = noremap_silent
}
set_mapping{
mode = 'n',
lhs = '<leader><leader>p',
rhs = function()
if nvim.t.swap_window == nil then
nvim.t.swap_window = 1
nvim.t.swap_cursor = nvim.win.get_cursor(0)
nvim.t.swap_base_tab = nvim.tab.get_number(0)
nvim.t.swap_base_win = nvim.tab.get_win(0)
nvim.t.swap_base_buf = nvim.win.get_buf(0)
else
local swap_new_tab = nvim.tab.get_number(0)
local swap_new_win = nvim.tab.get_win(0)
local swap_new_buf = nvim.win.get_buf(0)
if swap_new_tab == nvim.t.swap_base_tab and
swap_new_win ~= nvim.t.swap_base_win and
swap_new_buf ~= nvim.t.swap_base_buf
then
nvim.win.set_buf(0, nvim.t.swap_base_buf)
nvim.win.set_buf(nvim.t.swap_base_win, swap_new_buf)
nvim.win.set_cursor(0, nvim.t.swap_cursor)
nvim.ex['normal!']('zz')
end
nvim.t.swap_window = nil
nvim.t.swap_cursor = nil
nvim.t.swap_base_tab = nil
nvim.t.swap_base_win = nil
nvim.t.swap_base_buf = nil
end
end,
args = noremap_silent
}
-- TODO: make this a "true" zoom and use <C-w>o wincmd
set_mapping{
mode = 'n',
lhs = '<C-w>z',
rhs = function()
nvim.t.zoom = not nvim.t.zoom
if nvim.t.zoom then
nvim.t.windows = nvim.fn.winrestcmd()
nvim.ex.wincmd('_')
nvim.ex.wincmd('|')
nvim.ex['normal!']('zz')
else
nvim.command(nvim.t.windows)
nvim.t.zoom = nil
nvim.t.windows = nil
end
end,
args = noremap_silent
}
-- TODO: Support Rsync
if executable('scp') then
local function convert_path(path, send, host)
path = realpath(normalize_path(path))
local remote_path = './'
local paths = {}
local hosts = {}
local projects = {}
local path_json = normalize_path('~/.config/remotes/paths.json')
if is_file(path_json) then
local configs = read_json(path_json) or {}
hosts = configs.hosts or {}
paths = hosts[host] or configs.paths or {}
projects = configs.projects or {}
end
local project = path:match('projects/([%w%d%.-_]+)')
if not project then
for short,full in pairs(projects) do
if short ~= 'default' and path:match('/('..short..')[%w%d%.-_]*') then
project = full
break
end
end
if not project then
project = nvim.env.PROJECT or projects.default or 'mike'
end
end
for loc,remote in pairs(paths) do
if loc:match('%%PROJECT') then
loc = loc:gsub('%%PROJECT', project)
end
loc = normalize_path(loc)
if path:match(loc) then
local tail = path:gsub(loc, '')
if remote:match('%%PROJECT') then
remote = remote:gsub('%%PROJECT', project)
end
remote_path = remote .. '/' .. tail
break
end
end
if not send and remote_path == './' then
remote_path = remote_path .. basename(path)
end
return remote_path
end
local function remote_cmd(host, send)
local filename = nvim.fn.expand('%')
local virtual_filename
if filename:match('^[%w%d_]+://') then
if filename:match('^fugitive://') then
filename = filename:gsub('%.git/+%d+/+', '')
end
filename = filename:gsub('^[%w%d_]+://', '')
virtual_filename = nvim.fn.tempname()
end
assert(is_file(filename), 'Not a regular file '..filename)
if virtual_filename and send then
writefile(virtual_filename, nvim.buf.get_lines(0, 0, -1, true))
end
local remote_path = ('%s:%s'):format(host, convert_path(filename, send, host))
local rcmd = [[scp -r "%s" "%s"]]
if send then
rcmd = rcmd:format(virtual_filename or filename, remote_path)
else
rcmd = rcmd:format(remote_path, virtual_filename or filename)
end
return rcmd
end
local function get_host(host)
if not host or host == '' then
host = nvim.fn.input('Enter hostname > ', '', 'customlist,neovim#ssh_hosts_completion')
assert(type(host) == 'string' and host ~= '', 'Invalid hostname')
end
return host
end
set_command{
lhs = 'SendFile',
rhs = function(host)
host = get_host(host)
local cmd = remote_cmd(host, true)
require'jobs'.send_job{
cmd = cmd,
opts = {
pty = true,
},
}
end,
args = {
nargs = '*',
force = true,
complete = 'customlist,neovim#ssh_hosts_completion'
}
}
set_command{
lhs = 'GetFile',
rhs = function(host)
host = get_host(host)
local cmd = remote_cmd(host, false)
require'jobs'.send_job{
cmd = cmd,
opts = {
pty = true,
},
}
end,
args = {
nargs = '*',
force = true,
complete = 'customlist,neovim#ssh_hosts_completion'
}
}
set_mapping{
mode = 'n',
lhs = '<leader><leader>s',
rhs = '<cmd>SendFile<CR>',
args = {noremap = true, silent = true},
}
set_mapping{
mode = 'n',
lhs = '<leader><leader>g',
rhs = '<cmd>GetFile<CR>',
args = {noremap = true, silent = true},
}
end
local scratchs = {}
set_command{
lhs = 'Scratch',
rhs = function(ft)
ft = (ft and ft ~= '') and ft or nvim.bo.filetype
scratchs[ft] = scratchs[ft] or nvim.fn.tempname()
local buf = nvim.fn.bufnr(scratchs[ft], true)
if ft and ft ~= '' then
nvim.buf.set_option(buf, 'filetype', ft)
end
nvim.buf.set_option(buf, 'bufhidden', 'hide')
local wins = nvim.tab.list_wins(0)
local scratch_win
for _,win in pairs(wins) do
if nvim.win.get_buf(win) == buf then
scratch_win = win
break
end
end
if not scratch_win then
scratch_win = nvim.open_win(
buf,
true,
{relative='editor', width=1, height=1, row=1, col=1}
)
end
nvim.set_current_win(scratch_win)
nvim.ex.wincmd('K')
end,
args = {
nargs = '?',
force = true,
complete = 'filetype'
}
}
if executable('cscope') then
local function cscope(cword, action)
local actions = {
definition = 'find g',
callers = 'find c',
file = 'find f',
text = 'find t',
}
cword = (cword and cword ~= '') and cword or nvim.fn.expand('<cword>')
action = actions[action] or 'g'
nvim.ex.cscope(action..' '..cword)
end
set_command{
lhs = 'CDefinition',
rhs = function(cword)
cscope(cword, 'definition')
end,
args = {nargs='?', force = true}
}
set_command{
lhs = 'CCallers',
rhs = function(cword)
cscope(cword, 'callers')
end,
args = {nargs='?', force = true}
}
set_command{
lhs = 'CFile',
rhs = function(cword)
cscope(cword, 'file')
end,
args = {complete='file', nargs='?', force = true}
}
set_command{
lhs = 'CText',
rhs = function(cword)
cscope(cword, 'text')
end,
args = {nargs='?', force = true}
}
end
if has('nvim-0.5') and not plugins['vim-commentary'] then
set_mapping{
mode = 'n',
lhs = 'gc',
rhs = '<cmd>set opfunc=neovim#comment<CR>g@',
args = noremap_silent,
}
set_mapping{
mode = 'v',
lhs = 'gc',
rhs = ':<C-U>call neovim#comment(visualmode(), v:true)<CR>',
args = noremap_silent,
}
set_mapping{
mode = 'n',
lhs = 'gcc',
rhs = function()
local cursor = nvim.win.get_cursor(0)
require'settings.functions'.toggle_comments(cursor[1] - 1, cursor[1])
nvim.win.set_cursor(0, cursor)
end,
args = noremap_silent,
}
end
set_command{
lhs = 'ClearQf',
rhs = function()
nvim.fn.setqflist({}, 'r')
end,
args = {force=true}
}
set_command{
lhs = 'ClearLoc',
rhs = function()
nvim.fn.setloclist(nvim.get_current_win(), {}, 'r')
end,
args = {force=true}
}
pcall(require, 'host/mappings')
return true
|
--[[
█▀▀█ █░░█ █▀▀█ █▀▀ █▀▀▄ ░▀░ █░█ █▀▀ ▀▀█▀▀ █░░█ █▀▀▄ ░▀░ █▀▀█
█░░█ █▀▀█ █░░█ █▀▀ █░░█ ▀█▀ ▄▀▄ ▀▀█ ░░█░░ █░░█ █░░█ ▀█▀ █░░█
█▀▀▀ ▀░░▀ ▀▀▀▀ ▀▀▀ ▀░░▀ ▀▀▀ ▀░▀ ▀▀▀ ░░▀░░ ░▀▀▀ ▀▀▀░ ▀▀▀ ▀▀▀▀
PROGRAMADOR: BYBLACKDEATH
]]--
resource_manifest_version "44febabe-d386-4d18-afbe-5e627f4af937"
name 'PhoenixStudio - Sistema de parilla'
description 'Sistema de cocina para bares y con trabajo'
author 'ByBlackDeath'
version 'v2.5'
client_script {
'@es_extended/locale.lua',
'config.lua',
'cl_cooking.lua',
}
server_scripts {
'@es_extended/locale.lua',
'config.lua',
'server.lua'
}
dependencies {
'es_extended',
'esx_addonaccount',
'skinchanger',
'esx_skin'
} |
local Deque = require 'Deque'
local cases = {
length = function()
local self = Deque()
self:enqueue( 'a' )
self:push( 'b' )
self:pushhead( 'c' )
self:pushtail( 'd' )
return #self == 4 and self:len() == 4
end,
enq_deq = function()
local self = Deque()
self:enqueue( 'a' )
self:enqueue( 'b' )
self:enqueue( 'c' )
self:enqueue( 'd' )
return self:dequeue() == 'a' and self:dequeue() == 'b' and self:dequeue() == 'c' and self:dequeue() == 'd'
end,
aliases = function()
local self = Deque{'a','b'}
self:push('c')
self:pushhead('d')
self:pushtail('e')
self:enqueue('f')
self:shift('g')
return self:peekhead() == 'g' and self:peektail() == 'e' and self:peek() == 'e' and self:len() == 7 and self:pop() == 'e' and self:pophead() == 'g' and self:poptail() == 'c' and self:dequeue() == 'b' and self:unshift() == 'f' and self:pophead() == 'd' and self:len() == 1 and self:pop() == 'a' and self:empty()
end,
stack = function()
local self = Deque()
local out = {}
for i = 1, 1000 do
if math.random() < 0.5 or self:empty() then
table.insert( out, math.random() )
self:push( out[#out] )
else
local v = table.remove( out )
if self:pop() ~= v then
return false
end
end
end
return true
end,
queue = function()
local self = Deque()
local out = {}
for i = 1, 1000 do
if math.random() < 0.5 or self:empty() then
table.insert( out, math.random() )
self:enqueue( out[#out] )
else
local v = table.remove( out, 1 )
if self:dequeue() ~= v then
return false
end
end
end
return true
end,
pusharray = function()
local self = Deque.new{'e'}
self:pusharray{ 'a', 'b','c','d'}
return self:dequeue() == 'd' and self:dequeue() == 'c' and self:dequeue() == 'b' and self:dequeue() == 'a'
end,
new = function()
local self = Deque{ 'a', 'b','c','d'}
return self:dequeue() == 'd' and self:dequeue() == 'c' and self:dequeue() == 'b' and self:dequeue() == 'a'
end,
empty = function()
local self = Deque{ 'a', 'b','c','d'}
local self2 = Deque.new()
return not self:empty() and self:dequeue() == 'd' and self:dequeue() == 'c' and self:dequeue() == 'b' and self:dequeue() == 'a'and self:empty() and self2:empty()
end,
peek = function()
local self = Deque.new{ 'a', 'b', 'c', 'd' }
return self:peek() == 'd' and self:dequeue() == 'd' and self:peek() == self:dequeue()
end,
simulation = function()
local items = {}
local self = Deque()
for i = 1, 1000 do
if #items == 0 or math.random() < 0.5 then
local item = math.random()
if math.random() < 0.5 then
table.insert( items, item )
self:push( item )
else
table.insert( items, 1, item )
self:enqueue( item )
end
else
if math.random() < 0.5 then
local item = self:dequeue()
if item ~= table.remove( items ) then
return false
end
else
local item = self:pop()
if item ~= table.remove( items ) then
return false
end
end
end
end
return true
end,
}
local function runCases( cs )
local count, passed = 0, 0
for name, case in pairs( cs ) do
count = count + 1
local pass = case()
if pass then
passed = passed + 1
end
print( name, '=>', pass and 'OK' or 'FAIL' )
end
local failed = count - passed
print( 'Summary:')
print( 'Passed:', passed )
print( 'Failed:', failed )
return passed, failed
end
print( 'Testing deque' )
local passed, failed = runCases( cases )
if failed > 0 then
error( 'Failed tests: ' .. failed )
else
print( 'All passed' )
end
|
-- trail_flame
return {
["trail_flame"] = {
fakelight = {
air = false,
class = [[CSimpleGroundFlash]],
count = 4,
ground = true,
water = false,
properties = {
colormap = [[1 0.5 0.25 1 0 0 0 0.1]],
size = [[25 r-5]],
sizegrowth = [[2 r-3]],
texture = [[groundflash]],
ttl = [[9 r4 r-4]],
},
},
smoke = {
air = true,
class = [[CSimpleParticleSystem]],
count = 1,
ground = true,
water = false,
properties = {
airdrag = 1,
colormap = [[0.7 0.7 1 .01 0.85 0.5 0.73 .01 0.96 .3 0.05 .008 0 0 0 0.01]],
directional = true,
emitrot = 0,
emitrotspread = 0,
emitvector = [[dir]],
gravity = [[0, 0, 0]],
numparticles = 3,
particlelife = 8,
particlelifespread = 4,
particlesize = 4,
particlesizespread = 2,
particlespeed = 1.1,
particlespeedspread = 0.2,
pos = [[0, 0, 0]],
sizegrowth = [[0.6 r.35]],
sizemod = 1.0,
texture = [[flashside2]],
useairlos = false,
},
},
},
}
|
-- explosion_huge_tesla_base
-- explosion_huge_gok
-- explosion_hugelight_gok
return {
["explosion_gok"] = {
smoke = {
air = true,
class = [[CSimpleParticleSystem]],
count = 2,
ground = true,
water = true,
properties = {
airdrag = 1,
colormap = [[0 0 0 0 0.78 0.07 0.57 .1 0.5 0.2 0.4 .8 .05 .05 .05 0.7 0 0 0 0.01]],
directional = true,
emitrot = 30,
emitrotspread = [[0 r-360 r360]],
emitvector = [[0, 1, 0]],
gravity = [[0, 0 r.15, 0]],
numparticles = 1,
particlelife = 20,
particlelifespread = 10,
particlesize = 1,
particlesizespread = 8,
particlespeed = 0,
particlespeedspread = 0,
pos = [[0 r-10 r10, 5 r20, 0 r-10 r10]],
sizegrowth = [[0.50 r1.6 r-1.6]],
sizemod = 1.0,
texture = [[GenericSmokeCloud1]],
useairlos = true,
},
},
explosionquick = {
air = true,
class = [[CSimpleParticleSystem]],
count = 4,
ground = true,
water = false,
properties = {
airdrag = 1,
colormap = [[0 0 0 0 0.78 0.08 0.58 .01 0.75 .15 0.45 .01 0 0 0 0.01]],
directional = true,
emitrot = 0,
emitrotspread = 360,
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 2,
particlelife = 8,
particlelifespread = 3,
particlesize = 1,
particlesizespread = 20,
particlespeed = [[0 r0.2 i-0.05]],
particlespeedspread = 0.35,
pos = [[0 r-12 r12, 16 r-5 r5, 0 r-12 r12]],
sizegrowth = [[3 r2 r-2]],
sizemod = 0.8,
texture = [[explo]],
useairlos = true,
},
},
explosionring = {
air = true,
class = [[CSimpleParticleSystem]],
count = 1,
ground = true,
water = false,
properties = {
airdrag = 1,
colormap = [[0 0 0 0 0.78 0.08 0.55 .1 0.78 0.08 0.55 .8 .05 .05 .05 0.7 0 0 0 0.01]],
directional = true,
emitrot = 70,
emitrotspread = 15,
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 25,
particlelife = 12,
particlelifespread = 20,
particlesize = 0.8,
particlesizespread = 25,
particlespeed = [[1 r-2 r2 i-0.3]],
particlespeedspread = 5,
pos = [[0 r-2 r2, 8, 0 r-2 r2]],
sizegrowth = [[0.50 r-.50]],
sizemod = 0.8,
texture = [[SmokeOrange]],
useairlos = true,
},
},
},
["explosion_huge_gok"] = {
explosionball = {
air = true,
class = [[CSimpleParticleSystem]],
count = 1,
ground = true,
water = false,
properties = {
airdrag = 1,
colormap = [[0 0 0 0 0.78 0.07 0.57 .1 0.5 0.2 0.4 .8 .05 .05 .05 0.7 0 0 0 0.01]],
directional = true,
emitrot = 30,
emitrotspread = [[0 r-360 r360]],
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 15,
particlelife = 14,
particlelifespread = 30,
particlesize = 4,
particlesizespread = 14,
particlespeed = [[0 r3 i-0.05]],
particlespeedspread = 1.5,
pos = [[0 r-10 r10, 5 r20, 0 r-10 r10]],
sizegrowth = [[0.50 r1.6]],
sizemod = 1.0,
texture = [[GenericSmokeCloud1]],
useairlos = true,
},
},
explosionquick = {
air = true,
class = [[CSimpleParticleSystem]],
count = 6,
ground = true,
water = false,
properties = {
airdrag = 1,
colormap = [[0 0 0 0 0.78 0.08 0.58 .01 0.75 .15 0.45 .01 0 0 0 0.01]],
directional = true,
emitrot = 0,
emitrotspread = 360,
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 2,
particlelife = 8,
particlelifespread = 3,
particlesize = 1,
particlesizespread = 20,
particlespeed = [[0 r0.2 i-0.05]],
particlespeedspread = 0.35,
pos = [[0 r-12 r12, 16 r-5 r5, 0 r-12 r12]],
sizegrowth = [[3 r2 r-2]],
sizemod = 1.0,
texture = [[explo]],
useairlos = true,
},
},
explosionring = {
air = true,
class = [[CSimpleParticleSystem]],
count = 1,
ground = true,
water = false,
properties = {
airdrag = 1,
colormap = [[0 0 0 0 0.78 0.08 0.55 .1 0.78 0.08 0.55 .8 .05 .05 .05 0.7 0 0 0 0.01]],
directional = true,
emitrot = 90,
emitrotspread = 20,
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 30,
particlelife = 14,
particlelifespread = 25,
particlesize = 1,
particlesizespread = 30,
particlespeed = [[1 r-2 r2 i-0.3]],
particlespeedspread = 5,
pos = [[0 r-2 r2, 8, 0 r-2 r2]],
sizegrowth = [[0.50 r-.50]],
sizemod = 1.0,
texture = [[SmokeOrange]],
useairlos = true,
},
},
explosionwaterquick = {
air = false,
class = [[CSimpleParticleSystem]],
count = 6,
ground = false,
water = true,
properties = {
airdrag = 1,
colormap = [[0 0 0 0 0.78 0.08 0.55 .8 0.05 0.6 0.75 .8 0 0 0 0.01]],
directional = true,
emitrot = 0,
emitrotspread = 360,
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 12,
particlelife = 8,
particlelifespread = 12,
particlesize = 1,
particlesizespread = 30,
particlespeed = [[0 r0.2 i-0.05]],
particlespeedspread = 5,
pos = [[0 s1 r-20 r20, 16 r-5 r5, 0 s1 r-20 r20]],
sizegrowth = [[3 r2 r-2]],
sizemod = 1.0,
texture = [[GenericSmokeCloud1]],
useairlos = true,
},
},
fakering = {
air = false,
class = [[CSimpleGroundFlash]],
count = 4,
ground = true,
water = false,
properties = {
colormap = [[1 0.65 1 1 0 0 0 0.1]],
size = 70,
sizegrowth = [[3 r3]],
texture = [[groundring]],
ttl = [[80 r-4 r4]],
},
},
spark = {
air = true,
class = [[CSimpleParticleSystem]],
count = 1,
ground = true,
water = false,
properties = {
airdrag = 1,
colormap = [[0.78 0.08 0.58 .01 0.6 0.0 0.4 0.008 0 0 0 0.01]],
directional = true,
emitrot = 0,
emitrotspread = [[0 r-360 r360]],
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 50,
particlelife = 8,
particlelifespread = 20,
particlesize = 1,
particlesizespread = 20,
particlespeed = 5,
particlespeedspread = 3,
pos = [[0, 18, 0]],
sizegrowth = [[0.0 r.05]],
sizemod = 1.0,
texture = [[Plasma]],
useairlos = true,
},
},
spark2 = {
air = true,
class = [[CSimpleParticleSystem]],
count = 1,
ground = true,
water = false,
properties = {
airdrag = 1,
colormap = [[0.78 0.08 0.58 .01 0.5 0.09 0.35 .008 0 0 0 0.01]],
directional = true,
emitrot = 30,
emitrotspread = [[60 r30 r-30]],
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 50,
particlelife = 8,
particlelifespread = 20,
particlesize = 1,
particlesizespread = 20,
particlespeed = 5,
particlespeedspread = 3,
pos = [[0, 18, 0]],
sizegrowth = [[0.0 r.05]],
sizemod = 1.0,
texture = [[Plasma]],
useairlos = true,
},
},
waterball = {
air = false,
class = [[CSimpleParticleSystem]],
count = 1,
ground = false,
water = true,
properties = {
airdrag = 1,
colormap = [[0 0 0 0 0.78 0.08 0.55 .1 0.95 0.25 0.65 .8 0 0 0 0.01]],
directional = true,
emitrot = 30,
emitrotspread = 40,
emitvector = [[0, 1, 0]],
gravity = [[0, 0, 0]],
numparticles = 50,
particlelife = 30,
particlelifespread = 30,
particlesize = 5,
particlesizespread = 20,
particlespeed = [[0 r3 i-0.05]],
particlespeedspread = 1.5,
pos = [[0 r-10 r10, 5 r20, 0 r-10 r10]],
sizegrowth = [[0.50 r1.6 r-1.6]],
sizemod = 1.0,
texture = [[GenericSmokeCloud1]],
useairlos = true,
},
},
waterexplosion = {
air = false,
class = [[CSimpleParticleSystem]],
count = 1,
ground = false,
water = true,
properties = {
airdrag = 1,
colormap = [[1 1 1 1 1 1 0.8 1 0 0 0 0.01]],
directional = false,
emitrot = 10,
emitrotspread = 40,
emitvector = [[0,1,0]],
gravity = [[0, -.25 r-0.25, 0]],
numparticles = 50,
particlelife = 180,
particlelifespread = 90,
particlesize = 1,
particlesizespread = 20,
particlespeed = [[3 i-0.25]],
particlespeedspread = 10,
pos = [[0, 18, 0]],
sizegrowth = 0.35,
sizemod = 1.0,
texture = [[Bombsmoke]],
useairlos = true,
},
},
},
}
|
function clamp(low, n, high) return math.min(math.max(n, low), high) end
function create() end
function update(dt)
-- general stuff
local speed = 5.0 * dt
local mouseSpeed = 35.0 * dt
local object = GameEntity.new(current_entity())
local transformation = object.transformation
local front = vec3MulScalar(transformation.front, speed)
if keyboard_buttonPressed(Button.W) then
transformation.position = transformation.position - front
end
if keyboard_buttonPressed(Button.S) then
transformation.position = transformation.position + front
end
local frontUpCross = vec3MulScalar(transformation.frontUpCross, speed)
if keyboard_buttonPressed(Button.A) then
transformation.position = transformation.position + frontUpCross
end
if keyboard_buttonPressed(Button.D) then
transformation.position = transformation.position - frontUpCross
end
-- mouse handling
local mouseX = mouse_getRawMouseX()
local mouseY = mouse_getRawMouseY()
-- rotation.x is a pitch
-- rotation.y is a yaw
-- thats why we use mouseX in rotation.y and mouseY in rotation.x
transformation.rotation.x = transformation.rotation.x + mouseY * mouseSpeed
transformation.rotation.y = transformation.rotation.y + mouseX * mouseSpeed
object.transformation = transformation
end
|
-- this whole mod is just a thin wrapper around https://github.com/davidm/lua-matrix
local mod_path = minetest.get_modpath(minetest.get_current_modname())
complex = dofile(mod_path .. "/complex.lua")
-- that's it
|
require "nanovg"
local vg = require "vg"
local fontIcons,fontNormal,fontBold
local ICON_SEARCH = 0x1F50D
local ICON_CIRCLED_CROSS = 0x2716
local ICON_CHEVRON_RIGHT = 0xE75E
local ICON_CHECK = 0x2713
local ICON_LOGIN = 0xE740
local ICON_TRASH = 0xE729
local function clampf(a, mn, mx)
return a < mn and mn or (a > mx and mx or a)
end
local data = {images={}}
eventFunction("init",function()
print("init..")
fontIcons = vg.createFont("icons","fonts/entypo.ttf")
fontNormal = vg.createFont("sans","fonts/Roboto-Regular.ttf")
fontBold = vg.createFont("sans-bold","fonts/Roboto-Bold.ttf")
for i=0,12-1 do
local file = string.format("images/image%d.jpg",i+1)
data.images[i] = vg.createImage(file, 0)
if data.images[i] == 0 then
print(string.format("Could not load %s.\n", file))
return -1
end
end
end)
eventFunction("release",function()
print("release")
end)
local mx,my
mx = 0
my = 0
eventFunction("input",function(e,pt)
if e==3 then
mx = pt.x
my = pt.y
end
end)
local function drawWindow(title,x,y,w,h)
local cornerRadius = 3.0;
vg.save()
--window
vg.beginPath()
vg.roundedRect(x,y,w,h,cornerRadius)
vg.fillColor(vg.rgba(28,30,34,192))
vg.fill()
--drop shadow
vg.beginPath()
vg.rect(x-10,y-10,w+20,h+30)
vg.roundedRect(x,y,w,h,cornerRadius)
vg.pathWinding(vg.NVG_HOLE)
vg.fillPaint(vg.boxGradient(x,y+2, w,h, cornerRadius*2, 10, vg.rgba(0,0,0,128), vg.rgba(0,0,0,0)))
vg.fill()
--header
vg.beginPath()
vg.roundedRect(x+1,y+1, w-2,30, cornerRadius-1)
vg.fillPaint(vg.linearGradient(x,y,x,y+15, vg.rgba(255,255,255,8), vg.rgba(0,0,0,16)))
vg.fill()
vg.beginPath()
vg.path{vg.MOVETO,x+0.5,y+0.5+30,vg.LINETO,x+0.5+w-1,y+0.5+30}
vg.strokeColor(vg.rgba(0,0,0,32))
vg.stroke()
vg.fontSize(18)
vg.fontFace("sans-bold")
vg.textAlign(vg.NVG_ALIGN_CENTER+vg.NVG_ALIGN_MIDDLE)
vg.fontBlur(2)
vg.fillColor(vg.rgba(0,0,0,128))
vg.text(x+w/2,y+16+1,title)
vg.fontBlur(0)
vg.fillColor(vg.rgba(220,220,220,160))
vg.text(x+w/2,y+16,title)
vg.restore()
end
local function drawSearchBox(text, x, y, w, h)
local bg
local cornerRadius = h/2-1
--Edit
bg = vg.boxGradient(x,y+1.5, w,h, h/2,5, vg.rgba(0,0,0,16), vg.rgba(0,0,0,92))
vg.beginPath()
vg.roundedRect(x,y,w,h,cornerRadius)
vg.fillPaint(bg)
vg.fill()
vg.fontSize(h*1.3)
vg.fontFace("icons")
vg.fillColor(vg.rgba(255,255,255,64))
vg.textAlign(vg.NVG_ALIGN_CENTER+vg.NVG_ALIGN_MIDDLE)
vg.text(x+h*0.55, y+h*0.55, vg.cpToUTF8(ICON_SEARCH))
vg.fontSize(20)
vg.fontFace("sans")
vg.fillColor(vg.rgba(255,255,255,32))
vg.textAlign(vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_MIDDLE)
vg.text(x+h*1.05,y+h*0.5,text)
vg.fontSize(h*1.3)
vg.fontFace("icons")
vg.fillColor(vg.rgba(255,255,255,32))
vg.textAlign(vg.NVG_ALIGN_CENTER+vg.NVG_ALIGN_MIDDLE)
vg.text(x+w-h*0.55, y+h*0.55, vg.cpToUTF8(ICON_CIRCLED_CROSS))
end
local function drawDropDown(text, x, y, w, h)
local bg
local cornerRadius = 4
bg = vg.linearGradient(x,y,x,y+h, vg.rgba(255,255,255,16), vg.rgba(0,0,0,16))
vg.beginPath()
vg.roundedRect(x+1,y+1, w-2,h-2, cornerRadius-1)
vg.fillPaint(bg)
vg.fill()
vg.beginPath()
vg.roundedRect(x+0.5,y+0.5, w-1,h-1, cornerRadius-0.5)
vg.strokeColor(vg.rgba(0,0,0,48))
vg.stroke()
vg.fontSize(20)
vg.fontFace("sans")
vg.fillColor(vg.rgba(255,255,255,160))
vg.textAlign(vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_MIDDLE)
vg.text(x+h*0.3,y+h*0.5,text)
vg.fontSize(h*1.3)
vg.fontFace("icons")
vg.fillColor(vg.rgba(255,255,255,64))
vg.textAlign(vg.NVG_ALIGN_CENTER+vg.NVG_ALIGN_MIDDLE)
vg.text(x+w-h*0.5, y+h*0.5, vg.cpToUTF8(ICON_CHEVRON_RIGHT))
end
local function drawEyes(x, y, w, h, mx, my, t)
local gloss, bg
local ex = w *0.23
local ey = h * 0.5
local lx = x + ex
local ly = y + ey
local rx = x + w - ex
local ry = y + ey
local dx,dy,d
local br
local blink = 1 - math.pow(math.sin(t*0.5),200)*0.8
if ex<ey then
br = ex*0.5
else
br = ey*0.5
end
bg = vg.linearGradient(x,y+h*0.5,x+w*0.1,y+h, vg.rgba(0,0,0,32), vg.rgba(0,0,0,16))
vg.beginPath()
vg.ellipse(lx+3.0,ly+16.0, ex,ey)
vg.ellipse(rx+3.0,ry+16.0, ex,ey)
vg.fillPaint(bg)
vg.fill()
bg = vg.linearGradient(x,y+h*0.25,x+w*0.1,y+h, vg.rgba(220,220,220,255), vg.rgba(128,128,128,255))
vg.beginPath()
vg.ellipse(lx,ly, ex,ey)
vg.ellipse(rx,ry, ex,ey)
vg.fillPaint(bg)
vg.fill()
dx = (mx - rx) / (ex * 10)
dy = (my - ry) / (ey * 10)
d = math.sqrt(dx*dx+dy*dy)
if d > 1.0 then
dx = dx/d
dy = dy/d
end
dx = dx*ex*0.4
dy = dy*ey*0.5
vg.beginPath()
vg.ellipse(lx+dx,ly+dy+ey*0.25*(1-blink), br,br*blink)
vg.fillColor(vg.rgba(32,32,32,255))
vg.fill()
dx = (mx - rx) / (ex * 10)
dy = (my - ry) / (ey * 10)
d = math.sqrt(dx*dx+dy*dy)
if d > 1.0 then
dx = dx/d
dy = dy/d
end
dx = dx*ex*0.4
dy = dy*ey*0.5
vg.beginPath()
vg.ellipse(rx+dx,ry+dy+ey*0.25*(1-blink), br,br*blink)
vg.fillColor(vg.rgba(32,32,32,255))
vg.fill()
gloss = vg.radialGradient(lx-ex*0.25,ly-ey*0.5, ex*0.1,ex*0.75, vg.rgba(255,255,255,128), vg.rgba(255,255,255,0))
vg.beginPath()
vg.ellipse(lx,ly, ex,ey)
vg.fillPaint(gloss)
vg.fill()
gloss = vg.radialGradient(rx-ex*0.25,ry-ey*0.5, ex*0.1,ex*0.75, vg.rgba(255,255,255,128), vg.rgba(255,255,255,0))
vg.beginPath()
vg.ellipse(rx,ry, ex,ey)
vg.fillPaint(gloss)
vg.fill()
end
local function drawParagraph(x, y, width, height, mx, my)
local rows
local glyphs
local text = "This is longer chunk of text.\n \n Would have used lorem ipsum but she was busy jumping over the lazy dog with the fox and all the men who came to the aid of the party."
local nrows, i, nglyphs, j, lnum
local lineh
local caretx, px
local bounds={}
local a
local gx,gy
local gutter = 0
gx = 0
gy = 0
lnum = 0
vg.save()
vg.fontSize( 18.0)
vg.fontFace( "sans")
vg.textAlign( vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_TOP)
_,_,lineh = vg.textMetrics()
-- The text break API can be used to fill a large buffer of rows,
-- or to iterate over the text just few lines (or just one) at a time.
-- The "next" variable of the last returned item tells where to continue.
rows = vg.textBreakLines(text,width,10)
if rows and #rows > 0 then
nrows = #rows
for i=1,nrows do
local row = rows[i]
local hit = mx > x and mx < (x+width) and my >= y and my < (y+lineh)
vg.beginPath()
vg.fillColor(vg.rgba(255,255,255,(hit and 64 or 16)))
vg.rect(x, y, row.width, lineh)
vg.fill()
vg.fillColor(vg.rgba(255,255,255,255))
vg.text(x,y,string.sub(text,row.head,row.tail))
if hit then
caretx = (mx < x+row.width/2) and x or x+row.width
px = x
glyphs = vg.textGlyphPositions( x, y, string.sub(text,row.head,row.tail))
nglyphs = #glyphs
for j=1,nglyphs do
local x0 = glyphs[j].x
local x1 = (j+1 < nglyphs) and glyphs[j+1].x or x+row.width
local gx = x0 * 0.3 + x1 * 0.7
if mx >= px and mx < gx then
caretx = glyphs[j].x
end
px = gx
end
vg.beginPath()
vg.fillColor( vg.rgba(255,192,0,255))
vg.rect( caretx, y, 1, lineh)
vg.fill()
gutter = lnum+1
gx = x - 10
gy = y + lineh/2
end
lnum=lnum+1
y = y+lineh
end
-- Keep going...
start = rows[nrows-1].next
end
if gutter then
local txt = tonumber(gutter)
vg.fontSize( 13.0)
vg.textAlign( vg.NVG_ALIGN_RIGHT+vg.NVG_ALIGN_MIDDLE)
_,bounds[0],bounds[1],bounds[2],bounds[3] = vg.textBounds( gx,gy, txt)
vg.beginPath()
vg.fillColor(vg.rgba(255,192,0,255))
vg.roundedRect( bounds[0]-4,bounds[1]-2, (bounds[2]-bounds[0])+8, (bounds[3]-bounds[1])+4, ((bounds[3]-bounds[1])+4)/2-1)
vg.fill()
vg.fillColor( vg.rgba(32,32,32,255))
vg.text( gx,gy, txt, nil)
end
y = y+20.0
vg.fontSize( 13.0)
vg.textAlign( vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_TOP)
vg.textLineHeight( 1.2)
bounds[0],bounds[1],bounds[2],bounds[3] = vg.textBoxBounds( x,y, 150, "Hover your mouse over the text to see calculated caret position.")
-- Fade the tooltip out when close to it.
gx = math.abs((mx - (bounds[0]+bounds[2])*0.5) / (bounds[0] - bounds[2]))
gy = math.abs((my - (bounds[1]+bounds[3])*0.5) / (bounds[1] - bounds[3]))
a = math.max(gx, gy) - 0.5
a = clampf(a, 0, 1)
vg.globalAlpha(a)
vg.beginPath()
vg.fillColor(vg.rgba(220,220,220,255))
vg.roundedRect( bounds[0]-2,bounds[1]-2, (bounds[2]-bounds[0])+4, (bounds[3]-bounds[1])+4, 3)
px = ((bounds[2]+bounds[0])/2)
vg.path{vg.MOVETO,px,bounds[1] - 10,
vg.LINETO,px+7,bounds[1]+1,
vg.LINETO,px-7,bounds[1]+1}
vg.fill()
vg.fillColor(vg.rgba(0,0,0,220))
vg.textBox(x,y,150,"Hover your mouse over the text to see calculated caret position.")
vg.restore()
end
local function drawGraph(x, y, w, h, t)
local bg
local samples = {}
local sx={}
local sy={}
local dx = w/5.0
local i
samples[0] = (1+math.sin(t*1.2345+math.cos(t*0.33457)*0.44))*0.5
samples[1] = (1+math.sin(t*0.68363+math.cos(t*1.3)*1.55))*0.5
samples[2] = (1+math.sin(t*1.1642+math.cos(t*0.33457)*1.24))*0.5
samples[3] = (1+math.sin(t*0.56345+math.cos(t*1.63)*0.14))*0.5
samples[4] = (1+math.sin(t*1.6245+math.cos(t*0.254)*0.3))*0.5
samples[5] = (1+math.sin(t*0.345+math.cos(t*0.03)*0.6))*0.5
for i=0,6-1 do
sx[i] = x+i*dx
sy[i] = y+h*samples[i]*0.8
end
-- Graph background
bg = vg.linearGradient( x,y,x,y+h, vg.rgba(0,160,192,0), vg.rgba(0,160,192,64))
vg.beginPath()
vg.path{vg.MOVETO,sx[0], sy[0]}
for i=1,6-1 do
vg.path{vg.BEZIERTO,sx[i-1]+dx*0.5,sy[i-1], sx[i]-dx*0.5,sy[i], sx[i],sy[i]}
end
vg.path{vg.LINETO,x+w, y+h,
vg.LINETO,x, y+h}
vg.fillPaint( bg)
vg.fill()
-- Graph line
vg.beginPath()
vg.path{vg.MOVETO,sx[0], sy[0]+2}
for i=1,6-1 do
vg.path{vg.BEZIERTO,sx[i-1]+dx*0.5,sy[i-1]+2, sx[i]-dx*0.5,sy[i]+2, sx[i],sy[i]+2}
end
vg.strokeColor( vg.rgba(0,0,0,32))
vg.strokeWidth( 3.0)
vg.stroke()
vg.beginPath()
vg.path{vg.MOVETO,sx[0], sy[0]}
for i=1,6-1 do
vg.path{vg.BEZIERTO,sx[i-1]+dx*0.5,sy[i-1], sx[i]-dx*0.5,sy[i], sx[i],sy[i]}
end
vg.strokeColor( vg.rgba(0,160,192,255))
vg.strokeWidth( 3.0)
vg.stroke()
-- Graph sample pos
for i=0,6-1 do
bg = vg.radialGradient( sx[i],sy[i]+2, 3.0,8.0, vg.rgba(0,0,0,32), vg.rgba(0,0,0,0))
vg.beginPath()
vg.rect( sx[i]-10, sy[i]-10+2, 20,20)
vg.fillPaint( bg)
vg.fill()
end
vg.beginPath()
for i=0,6-1 do
vg.circle( sx[i], sy[i], 4.0)
end
vg.fillColor( vg.rgba(0,160,192,255))
vg.fill()
vg.beginPath()
for i=0,6-1 do
vg.circle( sx[i], sy[i], 2.0)
end
vg.fillColor( vg.rgba(220,220,220,255))
vg.fill()
vg.strokeWidth( 1.0)
end
local function drawColorwheel(x, y, w, h, t)
local i
local r0, r1, ax,ay, bx,by, cx,cy, aeps, r
local hue = math.sin(t * 0.12)
local paint
vg.save()
cx = x + w*0.5
cy = y + h*0.5
if w < h then
r1 = w*0.5-5
else
r1 = h*0.5-5
end
r0 = r1 - 20
aeps = 0.5 / r1
for i=0 ,6 do
local a0 = i / 6.0 * math.pi * 2.0 - aeps
local a1 = (i+1.0) / 6.0 * math.pi * 2.0 + aeps
vg.beginPath()
vg.arc(cx,cy, r0, a0, a1, vg.NVG_CW)
vg.arc(cx,cy, r1, a1, a0, vg.NVG_CCW)
vg.closePath()
ax = cx + math.cos(a0) * (r0+r1)*0.5
ay = cy + math.sin(a0) * (r0+r1)*0.5
bx = cx + math.cos(a1) * (r0+r1)*0.5
by = cy + math.sin(a1) * (r0+r1)*0.5
paint = vg.linearGradient(ax,ay, bx,by, vg.hsla(a0/(math.pi*2),1.0,0.55,255), vg.hsla(a1/(math.pi*2),1.0,0.55,255))
vg.fillPaint(paint)
vg.fill()
end
vg.beginPath()
vg.circle(cx,cy, r0-0.5)
vg.circle(cx,cy, r1+0.5)
vg.strokeColor(vg.rgba(0,0,0,64))
vg.strokeWidth(1.0)
vg.stroke()
--Selector
vg.save()
vg.translate(cx,cy)
vg.rotate(hue*math.pi*2)
-- Marker on
vg.strokeWidth(2.0)
vg.beginPath()
vg.rect(r0-1,-3,r1-r0+2,6)
vg.strokeColor(vg.rgba(255,255,255,192))
vg.stroke()
paint = vg.boxGradient(r0-3,-5,r1-r0+6,10, 2,4, vg.rgba(0,0,0,128), vg.rgba(0,0,0,0))
vg.beginPath()
vg.rect(r0-2-10,-4-10,r1-r0+4+20,8+20)
vg.rect(r0-2,-4,r1-r0+4,8)
vg.pathWinding(vg.NVG_HOLE)
vg.fillPaint(paint)
vg.fill()
-- Center triangle
r = r0 - 6
ax = math.cos(120.0/180.0*math.pi) * r
ay = math.sin(120.0/180.0*math.pi) * r
bx = math.cos(-120.0/180.0*math.pi) * r
by = math.sin(-120.0/180.0*math.pi) * r
vg.beginPath()
vg.path{vg.MOVETO,r,0,
vg.LINETO,ax,ay,
vg.LINETO,bx,by,
vg.CLOSE}
paint = vg.linearGradient(r,0, ax,ay, vg.hsla(hue,1.0,0.5,255), vg.rgba(255,255,255,255))
vg.fillPaint(paint)
vg.fill()
paint = vg.linearGradient((r+ax)*0.5,(0+ay)*0.5, bx,by, vg.rgba(0,0,0,0), vg.rgba(0,0,0,255))
vg.fillPaint(paint)
vg.fill()
vg.strokeColor(vg.rgba(0,0,0,64))
vg.stroke()
-- Select circle on triangle
ax = math.cos(120.0/180.0*math.pi) * r*0.3
ay = math.sin(120.0/180.0*math.pi) * r*0.4
vg.strokeWidth(2.0)
vg.beginPath()
vg.circle(ax,ay,5)
vg.strokeColor(vg.rgba(255,255,255,192))
vg.stroke()
paint = vg.radialGradient(ax,ay, 7,9, vg.rgba(0,0,0,64), vg.rgba(0,0,0,0))
vg.beginPath()
vg.rect(ax-20,ay-20,40,40)
vg.circle(ax,ay,7)
vg.pathWinding(vg.NVG_HOLE)
vg.fillPaint(paint)
vg.fill()
vg.restore()
vg.restore()
end
local function drawLines(x, y, w, h, t)
local i, j
local pad = 5.0
local s = w/9.0 - pad*2
local pts, fx, fy
pts = {}
local joins = {vg.NVG_MITER, vg.NVG_ROUND, vg.NVG_BEVEL}
local caps = {vg.NVG_BUTT, vg.NVG_ROUND, vg.NVG_SQUARE}
-- NVG_NOTUSED(h)
vg.save()
pts[0] = -s*0.25 + math.cos(t*0.3) * s*0.5
pts[1] = math.sin(t*0.3) * s*0.5
pts[2] = -s*0.25
pts[3] = 0
pts[4] = s*0.25
pts[5] = 0
pts[6] = s*0.25 + math.cos(-t*0.3) * s*0.5
pts[7] = math.sin(-t*0.3) * s*0.5
for i=1,3 do
for j=1,3 do
fx = x + s*0.5 + ((i-1)*3+j-1)/9.0*w + pad
fy = y - s*0.5 + pad
vg.lineCap( caps[i])
vg.lineJoin( joins[j])
vg.strokeWidth( s*0.3)
vg.strokeColor( vg.rgba(0,0,0,160))
vg.beginPath()
vg.path{vg.MOVETO,fx+pts[0], fy+pts[1],
vg.LINETO,fx+pts[2], fy+pts[3],
vg.LINETO,fx+pts[4], fy+pts[5],
vg.LINETO,fx+pts[6], fy+pts[7]}
vg.stroke()
vg.lineCap( vg.NVG_BUTT)
vg.lineJoin( vg.NVG_BEVEL)
vg.strokeWidth( 1.0)
vg.strokeColor( vg.rgba(0,192,255,255))
vg.beginPath()
vg.path{vg.MOVETO,fx+pts[0], fy+pts[1],
vg.LINETO,fx+pts[2], fy+pts[3],
vg.LINETO,fx+pts[4], fy+pts[5],
vg.LINETO,fx+pts[6], fy+pts[7]}
vg.stroke()
end
end
vg.restore()
end
local function drawWidths(x, y, width)
local i;
vg.save()
vg.strokeColor( vg.rgba(0,0,0,255))
for i = 1,20 do
local w = (i+0.5)*0.1
vg.strokeWidth(w)
vg.beginPath()
vg.path{vg.MOVETO,x,y,vg.LINETO,x+width,y+width*0.3}
vg.stroke()
y = y+10
end
vg.restore()
end
local function drawCaps(x, y, width)
local i
local caps = {vg.NVG_BUTT, vg.NVG_ROUND, vg.NVG_SQUARE}
local lineWidth = 8.0
vg.save()
vg.beginPath()
vg.rect( x-lineWidth/2, y, width+lineWidth, 40)
vg.fillColor( vg.rgba(255,255,255,32))
vg.fill()
vg.beginPath()
vg.rect( x, y, width, 40)
vg.fillColor( vg.rgba(255,255,255,32))
vg.fill()
vg.strokeWidth( lineWidth)
for i = 1,3 do
vg.lineCap( caps[i])
vg.strokeColor( vg.rgba(0,0,0,255))
vg.beginPath()
vg.path{vg.MOVETO,x, y + (i-1)*10 + 5,vg.LINETO,x+width, y + (i-1)*10 + 5}
vg.stroke()
end
vg.restore()
end
local function drawScissor(x, y, t)
vg.save()
-- Draw first rect and set scissor to it's area.
vg.translate(x, y)
vg.rotate( vg.degToRad(5))
vg.beginPath()
vg.rect( -20,-20,60,40)
vg.fillColor( vg.rgba(255,0,0,255))
vg.fill()
vg.scissor( -20,-20,60,40)
-- Draw second rectangle with offset and rotation.
vg.translate(40,0)
vg.rotate( t)
-- Draw the intended second rectangle without any scissoring.
vg.save()
vg.resetScissor(vg)
vg.beginPath()
vg.rect( -20,-10,60,30)
vg.fillColor( vg.rgba(255,128,0,64))
vg.fill()
vg.restore()
-- Draw second rectangle with combined scissoring.
vg.intersectScissor(-20,-10,60,30)
vg.beginPath()
vg.rect( -20,-10,60,30)
vg.fillColor( vg.rgba(255,128,0,255))
vg.fill()
vg.restore()
end
local function drawLabel(text, x, y, w, h)
vg.fontSize( 18.0)
vg.fontFace( "sans")
vg.fillColor( vg.rgba(255,255,255,128))
vg.textAlign(vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_MIDDLE)
vg.text( x,y+h*0.5,text)
end
local function drawEditBoxBase(x, y, w, h)
local bg
-- Edit
bg = vg.boxGradient( x+1,y+1+1.5, w-2,h-2, 3,4, vg.rgba(255,255,255,32), vg.rgba(32,32,32,32))
vg.beginPath()
vg.roundedRect( x+1,y+1, w-2,h-2, 4-1)
vg.fillPaint( bg)
vg.fill()
vg.beginPath()
vg.roundedRect( x+0.5,y+0.5, w-1,h-1, 4-0.5)
vg.strokeColor( vg.rgba(0,0,0,48))
vg.stroke()
end
local function drawEditBox(text, x, y, w, h)
drawEditBoxBase(x,y, w,h)
vg.fontSize( 20.0)
vg.fontFace( "sans")
vg.fillColor( vg.rgba(255,255,255,64))
vg.textAlign(vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_MIDDLE)
vg.text(x+h*0.3,y+h*0.5,text)
end
local function drawCheckBox(text, x, y, w, h)
local bg;
vg.fontSize( 18.0)
vg.fontFace( "sans")
vg.fillColor( vg.rgba(255,255,255,160))
vg.textAlign(vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_MIDDLE)
vg.text( x+28,y+h*0.5,text)
bg = vg.boxGradient( x+1,y+(h*0.5)-9+1, 18,18, 3,3, vg.rgba(0,0,0,32), vg.rgba(0,0,0,92))
vg.beginPath()
vg.roundedRect( x+1,y+(h*0.5)-9, 18,18, 3)
vg.fillPaint( bg)
vg.fill()
vg.fontSize( 40)
vg.fontFace( "icons")
vg.fillColor( vg.rgba(255,255,255,128))
vg.textAlign(vg.NVG_ALIGN_CENTER+vg.NVG_ALIGN_MIDDLE)
vg.text( x+9+2, y+h*0.5,vg.cpToUTF8(ICON_CHECK))
end
local function isBlack(col)
return col
end
local function drawButton(preicon, text, x, y, w, h, col)
local bg
local cornerRadius = 4.0
local tw = 0
local iw = 0
bg = vg.linearGradient( x,y,x,y+h, vg.rgba(255,255,255,isBlack(col) and 16 or 32), vg.rgba(0,0,0,isBlack(col) and 16 or 32))
vg.beginPath()
vg.roundedRect( x+1,y+1, w-2,h-2, cornerRadius-1)
if not isBlack(col) then
vg.fillColor( col)
vg.fill()
end
vg.fillPaint( bg)
vg.fill()
vg.beginPath()
vg.roundedRect( x+0.5,y+0.5, w-1,h-1, cornerRadius-0.5)
vg.strokeColor( vg.rgba(0,0,0,48))
vg.stroke()
vg.fontSize( 20.0)
vg.fontFace( "sans-bold")
tw = vg.textBounds( 0,0, text)
if preicon ~= 0 then
vg.fontSize( h*1.3)
vg.fontFace( "icons")
iw = vg.textBounds( 0,0, vg.cpToUTF8(preicon))
iw = iw+h*0.15
end
if preicon ~= 0 then
vg.fontSize( h*1.3)
vg.fontFace( "icons")
vg.fillColor( vg.rgba(255,255,255,96))
vg.textAlign(vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_MIDDLE)
vg.text( x+w*0.5-tw*0.5-iw*0.75, y+h*0.5, vg.cpToUTF8(preicon))
end
vg.fontSize( 20.0)
vg.fontFace( "sans-bold")
vg.textAlign(vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_MIDDLE)
vg.fillColor( vg.rgba(0,0,0,160))
vg.text( x+w*0.5-tw*0.5+iw*0.25,y+h*0.5-1,text)
vg.fillColor( vg.rgba(255,255,255,160))
vg.text( x+w*0.5-tw*0.5+iw*0.25,y+h*0.5,text)
end
local function drawSpinner( cx, cy, r, t)
local a0 = 0.0 + t*6
local a1 = math.pi + t*6
local r0 = r
local r1 = r * 0.75
local ax,ay, bx,by
local paint
vg.save()
vg.beginPath()
vg.arc(cx,cy, r0, a0, a1, vg.NVG_CW)
vg.arc(cx,cy, r1, a1, a0, vg.NVG_CCW)
vg.closePath()
ax = cx + math.cos(a0) * (r0+r1)*0.5
ay = cy + math.sin(a0) * (r0+r1)*0.5
bx = cx + math.cos(a1) * (r0+r1)*0.5
by = cy + math.sin(a1) * (r0+r1)*0.5
paint = vg.linearGradient(ax,ay, bx,by, vg.rgba(0,0,0,0), vg.rgba(0,0,0,128))
vg.fillPaint(paint)
vg.fill()
vg.restore()
end
local function drawThumbnails(x, y, w, h, images, nimages, t)
local cornerRadius = 3.0
local shadowPaint, imgPaint, fadePaint
local ix,iy,iw,ih
local thumb = 60.0
local arry = 30.5
local imgw, imgh
local stackh = (nimages/2) * (thumb+10) + 10
local i
local u = (1+math.cos(t*0.5))*0.5
local u2 = (1-math.cos(t*0.2))*0.5
local scrollh, dv
vg.save()
-- nvgClearState(vg)
-- Drop shadow
shadowPaint = vg.boxGradient( x,y+4, w,h, cornerRadius*2, 20, vg.rgba(0,0,0,128), vg.rgba(0,0,0,0))
vg.beginPath()
vg.rect( x-10,y-10, w+20,h+30)
vg.roundedRect( x,y, w,h, cornerRadius)
vg.pathWinding( vg.NVG_HOLE)
vg.fillPaint( shadowPaint)
vg.fill()
-- Window
vg.beginPath()
vg.roundedRect( x,y, w,h, cornerRadius)
vg.path{vg.MOVETO,x-10,y+arry,
vg.LINETO,x+1,y+arry-11,
vg.LINETO,x+1,y+arry+11}
vg.fillColor( vg.rgba(200,200,200,255))
vg.fill()
vg.save()
vg.scissor( x,y,w,h)
vg.translate( 0, -(stackh - h)*u)
dv = 1.0 / (nimages-1)
for i = 0,nimages-1 do
local tx, ty, v, a
tx = x+10
ty = y+10
tx = tx+(i%2) * (thumb+10)
ty = ty+(i/2) * (thumb+10)
imgw,imgh =vg.imageSize( images[i] )
if imgw < imgh then
iw = thumb;
ih = iw * imgh/imgw;
ix = 0;
iy = -(ih-thumb)*0.5
else
ih = thumb;
iw = ih * imgw/imgh;
ix = -(iw-thumb)*0.5
iy = 0;
end
v = i * dv
a = clampf((u2-v) / dv, 0, 1)
if a < 1.0 then
drawSpinner(tx+thumb/2,ty+thumb/2, thumb*0.25, t)
end
imgPaint = vg.imagePattern( tx+ix, ty+iy, iw,ih, 0.0/180.0*math.pi, images[i], a)
vg.beginPath()
vg.roundedRect( tx,ty, thumb,thumb, 5)
vg.fillPaint( imgPaint)
vg.fill()
shadowPaint = vg.boxGradient( tx-1,ty, thumb+2,thumb+2, 5, 3, vg.rgba(0,0,0,128), vg.rgba(0,0,0,0))
vg.beginPath()
vg.rect( tx-5,ty-5, thumb+10,thumb+10)
vg.roundedRect( tx,ty, thumb,thumb, 6)
vg.pathWinding( vg.NVG_HOLE)
vg.fillPaint( shadowPaint)
vg.fill()
vg.beginPath()
vg.roundedRect( tx+0.5,ty+0.5, thumb-1,thumb-1, 4-0.5)
vg.strokeWidth(1.0)
vg.strokeColor( vg.rgba(255,255,255,192))
vg.stroke()
end
vg.restore()
-- Hide fades
fadePaint = vg.linearGradient( x,y,x,y+6, vg.rgba(200,200,200,255), vg.rgba(200,200,200,0))
vg.beginPath()
vg.rect( x+4,y,w-8,6)
vg.fillPaint( fadePaint)
vg.fill()
fadePaint = vg.linearGradient( x,y+h,x,y+h-6, vg.rgba(200,200,200,255), vg.rgba(200,200,200,0))
vg.beginPath()
vg.rect( x+4,y+h-6,w-8,6)
vg.fillPaint( fadePaint)
vg.fill()
-- Scroll bar
shadowPaint = vg.boxGradient( x+w-12+1,y+4+1, 8,h-8, 3,4, vg.rgba(0,0,0,32), vg.rgba(0,0,0,92))
vg.beginPath()
vg.roundedRect( x+w-12,y+4, 8,h-8, 3)
vg.fillPaint( shadowPaint)
-- vg.fillColor( vg.rgba(255,0,0,128))
vg.fill()
scrollh = (h/stackh) * (h-8)
shadowPaint = vg.boxGradient( x+w-12-1,y+4+(h-8-scrollh)*u-1, 8,scrollh, 3,4, vg.rgba(220,220,220,255), vg.rgba(128,128,128,255))
vg.beginPath()
vg.roundedRect( x+w-12+1,y+4+1 + (h-8-scrollh)*u, 8-2,scrollh-2, 2)
vg.fillPaint( shadowPaint)
-- vg.fillColor( vg.rgba(0,0,0,128))
vg.fill()
vg.restore()
end
local function drawSlider(pos, x, y, w, h)
local bg, knob
local cy = y+(h*0.5)
local kr = (h*0.25)
vg.save()
-- nvgClearState(vg);
-- Slot
bg = vg.boxGradient(x,cy-2+1, w,4, 2,2, vg.rgba(0,0,0,32), vg.rgba(0,0,0,128))
vg.beginPath()
vg.roundedRect( x,cy-2, w,4, 2)
vg.fillPaint(bg)
vg.fill()
-- Knob Shadow
bg = vg.radialGradient(x+(pos*w),cy+1, kr-3,kr+3, vg.rgba(0,0,0,64), vg.rgba(0,0,0,0))
vg.beginPath()
vg.rect(x+(pos*w)-kr-5,cy-kr-5,kr*2+5+5,kr*2+5+5+3)
vg.circle(x+(pos*w),cy, kr)
vg.pathWinding(vg.NVG_HOLE)
vg.fillPaint(bg)
vg.fill()
-- Knob
knob = vg.linearGradient( x,cy-kr,x,cy+kr, vg.rgba(255,255,255,16), vg.rgba(0,0,0,16))
vg.beginPath()
vg.circle( x+(pos*w),cy, kr-1)
vg.fillColor(vg.rgba(40,43,48,255))
vg.fill()
vg.fillPaint(knob)
vg.fill()
vg.beginPath()
vg.circle(x+(pos*w),cy, kr-0.5)
vg.strokeColor(vg.rgba(0,0,0,92))
vg.stroke()
vg.restore()
end
local function drawEditBoxNum(text, units,x, y, w, h)
local uw
drawEditBoxBase( x,y, w,h)
uw = vg.textBounds(0,0, units)
vg.fontSize(18.0)
vg.fontFace("sans")
vg.fillColor(vg.rgba(255,255,255,64))
vg.textAlign(vg.NVG_ALIGN_RIGHT+vg.NVG_ALIGN_MIDDLE)
vg.text(x+w-h*0.3,y+h*0.5,units)
vg.fontSize(20.0)
vg.fontFace("sans")
vg.fillColor(vg.rgba(255,255,255,128))
vg.textAlign(vg.NVG_ALIGN_RIGHT+vg.NVG_ALIGN_MIDDLE)
vg.text(x+w-uw-h*0.5,y+h*0.5,text)
end
local function drawCheckBox(text, x, y, w, h)
local bg
vg.fontSize(18.0)
vg.fontFace("sans")
vg.fillColor(vg.rgba(255,255,255,160))
vg.textAlign(vg.NVG_ALIGN_LEFT+vg.NVG_ALIGN_MIDDLE)
vg.text(x+28,y+h*0.5,text)
bg = vg.boxGradient( x+1,y+(h*0.5)-9+1, 18,18, 3,3, vg.rgba(0,0,0,32), vg.rgba(0,0,0,92))
vg.beginPath()
vg.roundedRect(x+1,y+(h*0.5)-9, 18,18, 3)
vg.fillPaint(bg)
vg.fill()
vg.fontSize(40)
vg.fontFace("icons")
vg.fillColor(vg.rgba(255,255,255,128))
vg.textAlign(vg.NVG_ALIGN_CENTER+vg.NVG_ALIGN_MIDDLE)
vg.text(x+9+2, y+h*0.5, vg.cpToUTF8(ICON_CHECK))
end
local fps_count = 0
local fps_acc = 0
local fps = 0
local t = 0
eventFunction("loop",function(dt)
local w,h = screenSize()
local x,y
local width,height
t = t+dt
width = w
height = h
vg.beginNanoVG(w,h)
vg.beginFrame(w,h,1)
if fps_count < 300 then
fps_acc = fps_acc+dt
fps_count = fps_count+1
else
fps = math.floor(fps_count/(fps_acc+dt))
fps_count = 0
fps_acc = 0
end
vg.fontSize(32)
vg.fontFace("sans")
vg.fillColor(vg.rgbaf(1,1,1,1))
vg.text(32,32,tostring(fps))
drawEyes(width - 250, 50, 150, 100, mx, my, t)
drawParagraph(width - 450, 50, 150, 100, mx, my)
drawGraph(0, height/2, width, height/2, t)
drawColorwheel(width - 300, height - 300, 250, 250, t)
--Line joints
drawLines(120, height-50, 600, 50, t)
--Line caps
drawWidths(10, 50, 30)
--Line caps
drawCaps(10, 300, 30)
drawScissor(50, height-80, t)
--Widgets
drawWindow("Widgets `n Stuff", 50, 50, 300, 400)
x = 60
y = 95
drawSearchBox("Search", x,y,280,25)
y = y+40
drawDropDown("Effects", x,y,280,28)
popy = y + 14
y = y+45
-- Form
drawLabel("Login", x,y, 280,20)
y = y+25
drawEditBox("Email", x,y, 280,28)
y = y+35
drawEditBox("Password", x,y, 280,28)
y = y+38
drawCheckBox("Remember me", x,y, 140,28)
drawButton(ICON_LOGIN, "Sign in", x+138, y, 140, 28, vg.rgba(0,96,128,255))
y = y+45
-- Slider
drawLabel("Diameter", x,y, 280,20)
y = y+25
drawEditBoxNum("123.00", "px", x+180,y, 100,28)
drawSlider(0.4, x,y, 170,28)
y = y+55
drawButton(ICON_TRASH, "Delete", x, y, 160, 28, vg.rgba(128,16,8,255))
drawButton(0, "Cancel", x+170, y, 110, 28, vg.rgba(0,0,0,0))
-- Thumbnails box
drawThumbnails(365, popy-30, 160, 300, data.images, 12, t)
vg.endFrame()
end)
|
apo = require('actor_post_office')
p = print
function a1(self_addr, a, b, c)
print("a1", self_addr, a, b, c)
while true do
x, y, z = apo.recv()
p("a1 recv'ed ", x, y, z)
end
end
a1_addr = apo.spawn(a1, 111, 222, 333)
apo.send(a1_addr, 1, 2, 3)
apo.send(a1_addr, 2, 3, 4)
------------------------------------------
function a2(self_addr)
print("a2", self_addr)
while true do
times = apo.recv()
for i = 1, times do
apo.send(self_addr, -1)
end
while times > 0 do
delta = apo.recv()
p("a2 countdown ", times)
times = times + delta
end
p("a2 down to zero!")
end
end
a2_addr = apo.spawn(a2)
apo.send(a2_addr, 5)
------------------------------------------
function a3(self_addr)
print("a3", self_addr)
times = apo.recv()
p("a3 times", times)
apo.send(a2_addr, times)
a3(self_addr)
end
a3_addr = apo.spawn(a3)
apo.send(a3_addr, 5)
apo.send(a3_addr, 6)
------------------------------------------
function a4(self_addr, name)
print("a4", self_addr)
while true do
times = apo.recv()
a4_child = apo.spawn(a3)
apo.send(a4_child, times)
end
end
a4_addr = apo.spawn(a4, "mary")
apo.send(a4_addr, 3)
apo.send(a4_addr, 2)
------------------------------------------
apo.loop_until_empty()
p("DONE")
|
--[[
strefy bez dm
@author Jakub 'XJMLN' Starzak <jack@pszmta.pl
@package PSZMTA.psz-strefy
@copyright Jakub 'XJMLN' Starzak <jack@pszmta.pl>
Nie mozesz uzywac tego skryptu bez mojej zgody. Napisz - byc moze sie zgodze na uzycie.
]]--
local strefy = {
{1637.84,1283.94,9.65,80,36.25,25,int=0,vw=0}, -- LV spawn
{2420.06,-1722.36,11.28,120.75,93.75,55,int=0,vw=0}, -- LS Grove
-- {-727.38,930.76,11,60,60,25,int=0,vw=0}, -- TR Rancho
{-2446.19,-639.73,128.45,78,75.75,30,int=0,vw=0}, -- SF Miss Hill
{163.69,-1902.29,-2.83,195,121.75,45.75,int=0,vw=0}, -- LS Plaża
{2403.96,-18.33,25.21,50,50,33.25,int=0,vw=0}, -- Szpital PC
{-57.38,-321.75,-4.07,75,79.75,50,int=0,vw=0}, -- Remiza BB
{-2096.07,-280.79,33.57,85.25,190,50,int=0,vw=0}, -- Tor Gokart SF
{2232.38,2418.10,-4.5,103.5,90.5,53.25,int=0,vw=0}, -- Komisariat policji AP
{2265.99,-1231.95,-21.75,55.25,48,13.25,int=1,vw=8}, -- Int Szpital
--{1971.34,-1787.15,11.96,49,25,14.75,int=0,vw=0}, -- LS Mechanik
{1848.01,2402.21,19.58,27.75,30.5,4.75,int=42,vw=1}, -- AFK zone
--{-2169.91, 874.5, 76.23,48.75, 105, 100, int=0,vw=0}, -- sf spawn
{470, -34.84, 998.92,38.75,38.5,8.5, int=17, vw=0}, -- LS alhambra
{ 1747.35, -1594.0, 1732.4,70.25,68.75,31, int=0, vw=231}, -- AJ
-- {-3086.24,-3364.54,-21,10000,10000,10000,int=0,vw=2430}, -- Eventowa mapka
{-294.48, 2576.64, 53.70, 100.5,58.5,18.75, int=0, vw=0}, -- LP spawn
{2617.24, 1163.43, 9.57,60.25,79.75,50, int=0, vw=0},
{ 363.28430175781, 2315.7409667969, 1888.5668945313,25,17,25,int=10, vw=0}, -- int kosciol LS
-- {-275.33, 2574.75, 70.04, 36.75,40.75,5.75,int=85, vw=666 }, -- bar int LP
--{-213.57, 2595.30, 61.66,9.25, 6, 6.75, int=11, vw=432}, -- kibel meski
--{-213.57, 2595.30, 61.66,9.25, 6, 6.75, int=10, vw=431}, -- kibel damski
--{276.96,102.86,11.84,120,120,120, int=52, vw=21}, -- arena ztp
--{ -1555.02, 900.41, 5.78,23.75,45,38, int=0,vw=0}, -- choinka sf
{3044.45, 10.45, 10, 150, 120, 150, int=12, vw=121},
{1235.66,-1009.97,1068.85,30,20,50,int=5, vw=10}, -- kosciol sf
{ -2100.16796875, 1332.5531005859, 4.5153656005859,43,105,23.75,int=0, vw=0},
}
for i,v in ipairs(strefy) do
v.strefa = createColCuboid(v[1],v[2],v[3],v[4],v[5],v[6])
setElementInterior(v.strefa,v.int)
setElementDimension(v.strefa,v.vw)
setElementData(v.strefa,"strefa",i)
end
local function isAdminInEvZones(plr)
local ev = {
{0,2430}, -- ev mapa
{52,21}, -- aztp
{12,121}, -- add
}
for i, v in pairs(ev) do
if getElementDimension(plr) == v[2] and getElementInterior(plr) == v[1] then return true else return false end
end
end
local function getcpoint(el)
if (isElementWithinAColShape(el)) then return true else return false end
end
setTimer(function()
if (not isCursorShowing()) then
local level = getElementData(localPlayer,"level") or 0
if (getElementData(localPlayer,"strefa:nodm")) and (getcpoint(localPlayer)) then
toggleControl("fire",false)
toggleControl("aim_weapon",false)
if (level and level>0) then
toggleControl("aim_weapon",true)
end
elseif (getElementData(localPlayer,"strefa:nodm")) and (not getcpoint(localPlayer)) then
toggleControl("fire",true)
toggleControl("aim_weapon",true)
setElementData(localPlayer,"strefa:nodm",false)
elseif (not getElementData(localPlayer,"strefa:nodm")) and (getcpoint(localPlayer)) then
setElementData(localPlayer,"strefa:nodm",true)
toggleControl('fire',false)
toggleControl('aim_weapon',false)
if (level and level>0) then
toggleControl("aim_weapon",true)
end
end
end
end,1000,0)
function isElementWithinAColShape(element)
element = element or localPlayer or getLocalPlayer()
if element or isElement(element)then
for _,colshape in ipairs(getElementsByType("colshape"))do
if (getElementData(colshape,'strefa')) then
if isElementWithinColShape(element,colshape) then
return true
end
end
end
end
return false
end
function onTakeDamage(attacker, weapon, bodypart)
if getElementData(source,"strefa:nodm") then
cancelEvent()
end
end
addEventHandler("onClientPlayerDamage",getLocalPlayer(),onTakeDamage)
function onPlayerKilled(target)
if getElementData(target,"strefa:nodm") then
cancelEvent()
end
end
addEventHandler("onClientPlayerStealthKill",getLocalPlayer(),onPlayerKilled)
function onPlayerColHit(theElement,matchingDimension)
if (getElementData(source,'strefa')) then
if (not matchingDimension) or getElementInterior(theElement)~=getElementInterior(source) then return end
if (getElementType(theElement)=='player') then
if theElement~=getLocalPlayer() then return end
toggleControl("fire",false)
toggleControl("aim_weapon",false)
setElementData(theElement,"strefa:nodm",true)
elseif (getElementType(theElement) == "vehicle") then
local occu = getVehicleOccupants(theElement) or {}
for i,v in pairs(occu) do
if (v and getElementType(v) == "player") then
if v ~= getLocalPlayer() then return end
toggleControl("fire",false)
toggleControl("aim_weapon",false)
setElementData(v,"strefa:nodm",true)
end
end
end
end
end
addEventHandler('onClientColShapeHit',resourceRoot,onPlayerColHit)
function onPlayerColLeave(theElement,matchingDimension)
if (getElementData(source,'strefa')) then
if (not matchingDimension) or getElementInterior(theElement)~=getElementInterior(source) then return end
if (getElementType(theElement)=='player') then
if theElement~=getLocalPlayer() then return end
toggleControl("fire",true)
toggleControl("aim_weapon",true)
triggerServerEvent('onPlayerColLeave',theElement)
elseif (getElementType(theElement) == "vehicle") then
local occu = getVehicleOccupants(theElement) or {}
for i,v in pairs(occu) do
if (v and getElementType(v) == "player") then
if v ~= getLocalPlayer() then return end
toggleControl("fire",true)
toggleControl("aim_weapon",true)
triggerServerEvent('onPlayerColLeave',v)
end
end
end
end
end
addEventHandler('onClientColShapeLeave',resourceRoot,onPlayerColLeave)
function admin_CollisionDamage(attacker, weapon, bodypart, loss)
if attacker and weapon == 38 and getElementDimension(attacker) == 2430 and getElementDimension(source) == 2430 then return end
if attacker and weapon == 38 and getElementDimension(attacker) == 21 and getElementDimension(source) == 21 and getElementInterior(attacker) == 52 and getElementInterior(source) == 52 then return end
if attacker and getElementDimension(attacker) == 2430 and getElementDimension(source) == 2430 then
cancelEvent()
elseif getElementDimension(source) == 2430 then
cancelEvent()
elseif attacker and getElementDimension(attacker) == 21 and getElementDimension(source) == 21 and getElementInterior(attacker) == 52 and getElementInterior(source) == 52 then
cancelEvent()
elseif getElementDimension(source) == 21 and getElementInterior(source) == 52 then
cancelEvent()
end
end
addEventHandler('onClientPlayerDamage',getLocalPlayer(),admin_CollisionDamage) |
--[[
- SKYNET SIMPLE ( https://github.com/viticm/skynet-simple )
- $Id init.lua
- @link https://github.com/viticm/skynet-simple for the canonical source repository
- @copyright Copyright (c) 2020 viticm( viticm.ti@gmail.com )
- @license
- @user viticm( viticm.ti@gmail.com )
- @date 2020/09/07 19:25
- @uses The map class.
--]]
local skynet = require 'skynet'
local log = require 'log'
local player = require 'map.player'
local monster = require 'map.monster'
local e_error = require 'enum.error'
local cfg = require 'cfg'
local aoi = require 'map.aoi'
local type = type
local pairs = pairs
local string = string
local table = table
local math = math
local setmetatable = setmetatable
local print = print
-- Data.
-------------------------------------------------------------------------------
local _M = {}
package.loaded[...] = _M
if setfenv and type(setfenv) == 'function' then
setfenv(1, _M) -- Lua 5.1
else
_ENV = _M -- Lua 5.2+
end
-- API.
-------------------------------------------------------------------------------
function new(conf)
local t = {
id = conf.id,
objs = {}, -- All object hash.
players = {}, -- All player object hash.
monsters = {},
npcs = {},
loop = 0,
}
return setmetatable(t, { __index = _M })
end
function init(self)
local map_cfg = self:get_cfg()
-- AOI.
local aoi_args = {}
aoi_args.width = map_cfg.width
aoi_args.height = map_cfg.height
aoi_args.view = map_cfg.view
self.aoi = aoi.new(aoi_args)
-- Other objs create from config.
-- Create test monster.
for i = 1, 10 do
print('create monster', i)
local x = math.random(1, map_cfg.width)
local y = math.random(1, map_cfg.height)
self:add_monster({ id = 1, x = x, y = y })
end
end
-- Add a object.
-- @param table obj
-- @param mixed args
function add(self, obj, args)
args = args or {}
local aoi_id = self.aoi:unit_new({ x = obj.x, y = obj.y, id = obj.id })
print('aoi_id=================', aoi_id)
args.aoi_id = aoi_id
obj:init(args)
self.objs[obj.id] = obj
if obj:is_player() then
self.players[obj.id] = obj
elseif obj:is_npc() then
self.npcs[obj.id] = obj
elseif obj:is_monster() then
self.monsters[obj.id] = obj
end
-- Appear.
local name, msg = obj:pack_appear()
obj:send_around(name, msg)
end
-- Get a object.
function get(self, id)
return self.objs[id]
end
-- Remove a object.
function remove(self, id)
local obj = self.objs[id]
if not obj then return end
if obj:is_player() then
self.players[obj.id] = nil
elseif obj:is_npc() then
self.npcs[obj.id] = nil
elseif obj:is_monster() then
self.monsters[obj.id] = nil
end
-- Disappear.
local name, msg = obj:pack_disappear()
obj:send_around(name, msg)
self.objs[id] = nil
self.aoi:unit_del(id)
end
-- The enter.
-- @param mixed args The enter args.
-- @return number
function enter(self, args)
local id = args.id
if not id then
log:warn('enter not found player id')
return e_error.invalid_operation
end
local obj = self:get(id)
if not obj then
args.map = self
obj = player.new(args)
self:add(obj, args)
else -- Some update.
obj.fd = args.fd
end
log:info('map enter[%s] success', id)
return e_error.none
end
function get_cfg(self)
return cfg.get('map')[self.id]
end
-- Add a monster to map.
-- @param table conf The monster config.
-- @return mixed
function add_monster(self, conf)
print('the require_ex===================', require_ex)
local mcfg = cfg.get_row('monster', conf.id)
if not mcfg then
log:warn('add_monster can not find the config from: %d', conf.id)
return
end
conf.cfg = mcfg
local obj = monster.new(conf)
obj.x = conf.x
obj.y = conf.y
self:add(obj, conf)
log:debug('add_monster: %d|%d to [%d, %d]', conf.id, obj.id, obj.x, obj.y)
return obj
end
-- Update self logic.
function update(self)
self.loop = self.loop + 1
if 0 == self.loop % 5 then
local monsters = self.monsters
for _, et in pairs(monsters) do
et:update()
end
end
end
-- Exit a map object.
function exit(self)
self.exited = true
end
|
-- Snippets
--[[
Textadept stores its built-in snippets in the global variable "snippets".
I don't want to erase those. Instead I want to _add_ to them, overwriting
defaults where necessary.
Also here (scroll down): Key Chains
--]]
-- a function to insert user defined snippets into the global snippets
function merge_snippets(global_snippets, user_snippets)
for k,v in pairs(user_snippets) do
global_snippets[k] = v
end
end
-- Fields for dynamic snippets
require("snippets/dynamic-snippets")
--- ##########################################################################
--- # General Snippets
--- ##########################################################################
usersnippets = {
['file'] = '%<buffer.filename>',
['projdir'] = '%<io.get_project_root()>', -- Project dir
['today'] = os.date("%Y-%m-%d", os.time()),
-- A snippet to speed up the notation of snippets (Mind. Blown.)
['sn'] = '[\'%1(trigger)\']\t\t= \'%2(expanded)\',\n%0',
['fence'] = '-- ' .. string.rep('#', 75),
['ldots'] = '…',
['...'] = '…',
['commit'] = '%1(type)(%2(scope)): %3(subject)\n\n%4(body)\n\n%0(footer)',
-- Specific stuff I frequently use in my German academic texts
['beh'] = 'Behindertenpädagogik',
['FAB'] = 'Fachkraft zur Arbeits- und Berufsförderung',
['FABs'] = 'Fachkräfte zur Arbeits- und Berufsförderung',
['FFK'] = 'Fähigkeiten, Fertigkeiten, Kenntnisse',
['SQ'] = 'Schlüsselqualifikation',
['HO'] = 'Handlungsorientierung',
['ho'] = 'handlungsorientiert',
['Reha'] = 'Rehabilitation',
['Part'] = 'Partizipation',
['anfuu'] = '„%0“',
['anfuo'] = '“',
['mmb'] = 'Menschen mit Behinderung',
['mml'] = 'Menschen mit Lernschwierigkeiten',
['sozr'] = 'sozialraumorientiert',
['Sozr'] = 'Sozialraumorientierung',
['wfbm'] = 'Werkstatt für behinderte Menschen',
['EV'] = 'Eingangsverfahren',
['BBB'] = 'Berufsbildungsbereich',
['AB'] = 'Arbeitsbereich',
['Täo'] = 'Tätikeitsorientiert',
['täo'] = 'tätigkeitsorientiert',
['Apo'] = 'Arbeitsplatzorientiert',
['apo'] = 'arbeitsplatzorientiert',
['Bfo'] = 'Berufsfeldorientiert',
['bfo'] = 'berufsfeldorientiert',
['Bbo'] = 'Berufsbildorientiert',
['bbo'] = 'berufsbildorientiert',
['qg'] = 'Qualifizierung',
['qo'] = 'Qualifikation',
['sdb'] = 'sonderpädagogischer Förderbedarf',
['fd'] = 'familienentlastender Dienst',
['zizek'] = 'Žižek',
['!='] = '≠',
['ungefähr'] = '≈',
['entspricht'] = '≙',
['Ant'] = 'Anthropologie',
}
-- Add user defined snippets to the preconfigured ones, overwriting, if
-- necessary
merge_snippets(snippets, usersnippets)
--- # Markdown Snippets
snippets.markdown = {
-- Headers.
['h1'] = '# ',
['h2'] = '## ',
['h3'] = '### ',
['h4'] = '#### ',
['h5'] = '##### ',
['h6'] = '###### ',
--Links
link = '[%1(Link)](%0(http://example.net/))',
--Clickable link.
clink = '<%0(http://example.com/)>',
--Reference-style link.
rlink = '[%1(example)][%0(ref)]',
id = '[%1(ref)]: %0(http://example.com/)',
-- Code.
c = '`%0`',
-- Codeblock
cb = '```%0\n```',
--python
cbp = '```{.python .numberLines}\n%0\n```',
-- Image.
img = ')',
-- Zettel boilerplate
zet = "---\ntitle: '%1(title)'\nauthor: Stefan Thesing\nkeywords: [%2(keyword)]\nfollowups: []\nlang: de\n...\n\n# %0(section1)\n\n\n[//]: # (Links)",
-- Changelog block
cl = "## [Unreleased]\n### Added\n### Changed\n%0\n### Deprecated\n### Removed\n### Fixed\n### Security\n",
['cite'] = '[@%1(source) %2(page)]%0',
['zit'] = '>„%1(Quote)“\n([@%2(source) %3(page)])%0',
['vgl'] = '(vgl. [@%1(source) %2(page)])%0',
-- Latex in Markdown (for Zettels)
['enq'] = '\\enquote{%1}',
['lcite'] = '\\cite[S.\\,%2(page)]{%1(source)}',
['lzit'] = '\\begin{quote}\n\t\\enquote{%1(Quote)}\n\t\\parencite[S.\\,%3(page)]{%2(source)}\n\\end{quote}',
--- blockquotes for laws
['rzit'] = '\\begin{quote}\n\t\\enquote{%1(Quote)}\n\t(§\\,%2(source))\n\\citereset{}\n\\end{quote}',
['parencite'] = '\\parencite[S.\\,%2(page)]{%1(source)}',
['textcite'] = '\\textcite[S.\\,%2(page)]{%1(source)}',
--- \citeauthor{key}
['aut'] = '\\citeauthor{%0}',
--- aut as a dynamic snippet
['daut'] = '\\citeauthor{' .. dynsn.fields.current_author .. '} ',
--- \citetitle{key}
['citetitle'] = '\\citetitle{%0}',
--- \citeyear [ prenote ][ postnote ]{ key }
['citeyear'] = '\\citeyear{%0}',
--- \fullcite{ key}
['citereset'] = '\\citereset{%0}',
--- one of them usually followed by a citation.
['lvgl'] = '(vgl. \\cite[S.\\,%2(page)]{%1(source)})',
-- current_author ist defined in dynamic snippets. It's usually a bibtex key
['ca'] = dynsn.fields.current_author,
-- semantic annotations; repurposing the fenced_div extenstion of pandoc
['ann'] = "::: {#%1(kind) note=\"%2(note)\"}\n%0(annotated-content)\n:::\n",
['anm'] = "::: {#%1(kind) note=\"%2(note)\"}\n%0(annotated-content)\n:::\n",
}
--- # LaTeX Snippets
snippets.latex = {
-- Sections etc.
['chap'] = '\\chapter{%1(title)}\\label{chap:%2(label)}',
['sec'] = '\\section{%1(title)}\\label{sec:%2(label)}',
['sub'] = '\\subsection{%1(title)}\\label{subsec:%2(label)}',
['subsub'] = '\\subsubsection{%1(title)}\\label{subsubsec:%2(label)}',
['par'] = '\\paragraph{%1(title)} ~\\',
-- starred variants
['chaps'] = '\\chapter*{%1(title)}\\label{chap:%2(label)}',
['secs'] = '\\section*{%1(title)}\\label{sec:%2(label)}',
['subs'] = '\\subsection*{%1(title)}\\label{subsec:%2(label)}',
['subsubs'] = '\\subsubsection*{%1(title)}\\label{subsubsec:%2(label)}',
['pars'] = '\\paragraph*{%1(title)} ~\\',
-- Environments
--- first, generics
['begin'] = '\\begin{%1(type)}\n\t%3( )\n\\end{%1}\n%0',
['item'] = '\\item %0',
['desitem'] = '\\item[%1(des)] %0(item)',
['ditem'] = '\\item[%1(des)] %0(item)',
--- next, the classics, with a tightlist-option (see below)
['itemize'] = '\\begin{itemize}%1(\\tightlist)\n\t\\item %0(item)\n\\end{itemize}\n',
['enum'] = '\\begin{enumerate}%1(\\tightlist)\n\t\\item %0(item)\n\\end{enumerate}\n',
['enumerate'] = '\\begin{enumerate}%1(\\tightlist)\n\t\\item %0(item)\n\\end{enumerate}\n',
['description'] = '\\begin{description}%1(\\tightlist)\n\t\\item[%2(des)] %0(item)\n\\end{description}\n',
['des'] = '\\begin{description}%1(\\tightlist)\n\t\\item[%2(des)] %0(item)\n\\end{description}\n',
-- the tightlist command from pandoc, definition for the document's preamble
['tl'] = '\\providecommand{\\tightlist}{\\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}',
-- For Beamer Presentations
['frame'] = '\\begin{frame}{%1(title)}\n\t%0(content)\n\\end{frame}\n',
--- skeleton of my most frequently used table
['table'] = '\\begin{table}[hb]\n\t\\begin{tabularx}{\\textwidth}{|l|X|}\n\t\\hline\n\t\\rowcolor{lightgray}\n\t%1(Header Column1) & %2(Header Column2)\\\\ \\hline\n\t%5(Row1Col1)& %6(Row1Col2)\\\\ \\hline\n\t%7(Row2Col1) & %8(Row2Col2)\\\\ \\hline\n\t\\end{tabularx}\n\t\\caption {%3(Caption)}\n\t\\label{tab:%4(label)}\n\\end{table}',
-- Figure
['fig'] = '\\begin{figure}[h]\n\t\\centering\n\t\\includegraphics[width=\\textwidth]{%1(file)}\n\t\\caption{%2(caption)}\n\t\\label{fig:%3(label)}\n\\end{figure}\n',
['abb'] = '\\begin{figure}[h]\n\t\\centering\n\t\\includegraphics[width=\\textwidth]{%1(file)}\n\t\\caption{%2(caption)}\n\t\\label{fig:%3(label)}\n\\end{figure}\n',
-- Arrows
['uparrow'] = '$\\uparrow $',
['Uparrow'] = '$\\Uparrow $',
['downarrow'] = '$\\downarrow $',
['Downarrow'] = '$\\Downarrow $',
['rightarrow'] = '$\\rightarrow $',
['Rightarrow'] = '$\\Rightarrow $',
['leftarrow'] = '$\\leftarrow $',
['Leftarrow'] = '$\\Leftarrow $',
-- In-Document References
['ref'] = '\\ref{%0}',
['page'] = '\\pageref{%0}',
['name'] = '\\nameref{%0}',
-- Quoting, using csquotes
['enq'] = '\\enquote{%1}',
--- blockquotes
--['zit'] = '\\begin{quote}\n\t\\enquote{%1(Quote)}\n\t\\parencite[S.\\,%3(page)]{%2(source)}\n\\end{quote}',
['zit'] = '\\begin{quote}\n\t\\enquote{%1(Quote)}\n\t\\parencite[%3(S_wenn_f._o._Anm.)]{%2(source)}\n\\end{quote}\n',
-- Springer zit
['szit'] = '\\begin{quotation}\n\t%1(Quote)\n\t\\parencite[%3(S_wenn_f._o._Anm.)]{%2(source)}\n\\end{quotation}\n',
['vgl'] = '(vgl. \\cite[%2(S_wenn_f._o._Anm.)]{%1(source)})',
['S'] = 'S.\\,%0\\,f.',
['s'] = 'S.\\,%0\\,f.',
--- blockquotes for laws
['rzit'] = '\\begin{quote}\n\t\\enquote{%1(Quote)}\n\t(§\\,%2(source))\n\\citereset{}\n\\end{quote}\n',
-- Biblatex citation commands
['cite'] = '\\cite[%2(S_wenn_f._o._Anm.)]{%1(source)}',
['parencite'] = '\\parencite[%2(S_wenn_f._o._Anm.)]{%1(source)}',
['textcite'] = '\\textcite[%2(S_wenn_f._o._Anm.)]{%1(source)}',
--- \citeauthor{key}
['aut'] = '\\citeauthor{%0}',
--- aut as a dynamic snippet
['daut'] = '\\citeauthor{' .. dynsn.fields.current_author .. '} ',
--- \citetitle{key}
['citetitle'] = '\\citetitle{%0}',
--- \citetitle* [ prenote ][ postnote ]{ key }
['citefulltitle'] = '\\citetitle*{%0}',
['citetitle*'] = '\\citetitle*{%0}',
--- \citeyear [ prenote ][ postnote ]{ key }
['citeyear'] = '\\citeyear{%0}',
['cy'] = '\\citeyear{%0}',
--- \fullcite{ key}
['fullcite'] = '\\fullcite{%0}',
--- \citereset{}
['citereset'] = '\\citereset{%0}',
['cr'] = '\\citereset{%0}',
-- Some abbreviations frequently used in German academia
['oä'] = 'o.\\,ä. ',
['uä'] = 'u.\\,ä. ',
['ua'] = 'u.\\,a. ',
['va'] = 'v.\\,a. ',
['zb'] = 'z.\\,B. ',
['dh'] = 'd.\\,h. ',
['uu'] = 'u.\\,U. ',
['me'] = 'm.\\,E. ',
['mE'] = 'm.\\,E. ',
-- Misc
['emph'] = '\\emph{%0}',
['bf'] = '\\textbf{%0}',
['bs'] = '\\bigskip{}',
['fn'] = '\\footnote{\n%%Footnote\n%0\n%%End Footnote\n}',
['ma'] = '\\marginpar{%0}',
['rn'] = '\\marginpar{%0}',
['secframe'] = '\\sectionframe{}\n%0',
-- a Comment Box I use in my excerpts
['anm'] = '\\begin{mdframed}[backgroundcolor=gray!20,roundcorner=8pt]\n\t\\textbf{Anm. ' .. dynsn.fields.user_initials .. ':} %0\n\\end{mdframed}',
-- a horizontal line
['line'] = '\\hrulefill\n%0',
-- current_author ist defined in dynamic snippets. It's usually a bibtex key
['ca'] = dynsn.fields.current_author,
}
snippets.rust = {
['p'] = 'println!("%0");',
['fn'] = "fn %1(name)(%2(&self)) %3(-> %4(type) ){%0}\n// TODO test this",
['ttt'] = '// TODO test this',
}
--- ########################################################################
--- # Key Chains
--- ########################################################################
keys['ctrl+1'] = {
-- Geman gendering
g = function() buffer.add_text("\\_innen") end,
-- vulgar fractions
['2'] = function() buffer.add_text("½") end,
['3'] = function() buffer.add_text("⅓") end,
['4'] = function() buffer.add_text("¼") end,
['5'] = function() buffer.add_text("⅕") end,
['6'] = function() buffer.add_text("⅙") end,
}
keys['ctrl+2'] = {
-- German Quotation marks
up = function() buffer.add_text("“") end,
down = function() buffer.add_text("„") end,
left = function() buffer.add_text("»") end,
right = function() buffer.add_text("«") end,
-- vulgar fractions
['3'] = function() buffer.add_text("⅔") end,
}
keys['ctrl+3'] = {
-- vulgar fractions
['4'] = function() buffer.add_text("¾") end,
}
|
-- Generated by CSharp.lua Compiler
local System = System
local SlipeMtaDefinitions
local SystemNumerics
System.import(function (out)
SlipeMtaDefinitions = Slipe.MtaDefinitions
SystemNumerics = System.Numerics
end)
System.namespace("Slipe.Client.Dx", function (namespace)
-- <summary>
-- Class representing a texture or shader
-- </summary>
namespace.class("Material", function (namespace)
local getMaterialElement, getMaterialSize, getVolumeSize
getMaterialElement = function (this)
return this.materialElement
end
getMaterialSize = function (this)
local result = SlipeMtaDefinitions.MtaClient.DxGetMaterialSize(this.materialElement)
return SystemNumerics.Vector2(result[1], result[2])
end
getVolumeSize = function (this)
local result = SlipeMtaDefinitions.MtaClient.DxGetMaterialSize(this.materialElement)
return SystemNumerics.Vector3(result[1], result[2], result[3])
end
return {
getMaterialElement = getMaterialElement,
getMaterialSize = getMaterialSize,
getVolumeSize = getVolumeSize,
__metadata__ = function (out)
return {
fields = {
{ "materialElement", 0x3, out.Slipe.MtaDefinitions.MtaElement }
},
properties = {
{ "MaterialElement", 0x206, out.Slipe.MtaDefinitions.MtaElement, getMaterialElement },
{ "MaterialSize", 0x206, System.Numerics.Vector2, getMaterialSize },
{ "VolumeSize", 0x206, System.Numerics.Vector3, getVolumeSize }
},
class = { 0x6 }
}
end
}
end)
end)
|
function f8Pressed()
local name = getBufferName()
newBuffer()
setBufferName("error")
print2(getErrorText())
print2("")
print2("")
print2([[do]])
print2([[ closeBuffer()]])
print2([[ switchToBuffer("]] .. name .. [[")]])
print2([[end]])
edSetPosition(0)
clearError()
end
function f9Pressed()
newBuffer()
print2(getTraceText())
clearTrace()
end
|
--------------------------------
-- @module Liquid
-- @extend Grid3DAction
-- @parent_module cc
---@class cc.Liquid:cc.Grid3DAction
local Liquid = {}
cc.Liquid = Liquid
--------------------------------
--- brief Set the amplitude rate of the effect.
--- param amplitudeRate The value of amplitude rate will be set.
---@param amplitudeRate number
---@return cc.Liquid
function Liquid:setAmplitudeRate(amplitudeRate)
end
--------------------------------
--- brief Initializes the action with amplitude, grid size, waves count and duration.
--- param duration Specify the duration of the Liquid action. It's a value in seconds.
--- param gridSize Specify the size of the grid.
--- param waves Specify the waves count of the Liquid action.
--- param amplitude Specify the amplitude of the Liquid action.
--- return If the initialization success, return true; otherwise, return false.
---@param duration number
---@param gridSize size_table
---@param waves number
---@param amplitude number
---@return boolean
function Liquid:initWithDuration(duration, gridSize, waves, amplitude)
end
--------------------------------
--- brief Get the amplitude of the effect.
--- return Return the amplitude of the effect.
---@return number
function Liquid:getAmplitude()
end
--------------------------------
--- brief Get the amplitude rate of the effect.
--- return Return the amplitude rate of the effect.
---@return number
function Liquid:getAmplitudeRate()
end
--------------------------------
--- brief Set the amplitude to the effect.
--- param amplitude The value of amplitude will be set.
---@param amplitude number
---@return cc.Liquid
function Liquid:setAmplitude(amplitude)
end
--------------------------------
--- brief Create the action with amplitude, grid size, waves count and duration.
--- param duration Specify the duration of the Liquid action. It's a value in seconds.
--- param gridSize Specify the size of the grid.
--- param waves Specify the waves count of the Liquid action.
--- param amplitude Specify the amplitude of the Liquid action.
--- return If the creation success, return a pointer of Liquid action; otherwise, return nil.
---@param duration number
---@param gridSize size_table
---@param waves number
---@param amplitude number
---@return cc.Liquid
function Liquid:create(duration, gridSize, waves, amplitude)
end
--------------------------------
---
---@return cc.Liquid
function Liquid:clone()
end
--------------------------------
---
---@param time number
---@return cc.Liquid
function Liquid:update(time)
end
--------------------------------
---
---@return cc.Liquid
function Liquid:Liquid()
end
return nil
|
SellOMatic_Destroy = LibStub("AceAddon-3.0"):NewAddon("SellOMatic_Destroy", "AceEvent-3.0", "AceConsole-3.0");
local SellOMatic = _G.SellOMatic;
local item_tooltip = LibStub("LibGratuity-3.0");
local L = LibStub("AceLocale-3.0"):GetLocale("SellOMatic");
local function getOption(info)
return (info.arg and SellOMatic.db.profile[info.arg] or SellOMatic.db.profile[info[#info]]);
end;
local function setOption(info, value)
local key = info.arg or info[#info];
SellOMatic.db.profile[key] = value;
end;
local destroy_options = {
type = "group",
name = L["Destroy Options"],
args = {
destroy_intro = {
name = L["If you can see this, Destroy module is loaded"],
type = "description",
fontSize = "medium",
order = 1,
},
destroy_header = {
name = L["Destroy Commands"],
type = "header",
order = 2,
},
destroy_commands = {
name = "|cffffd700/som destroy|r "..L["destroy all junk items in your backpack"].."|n"..
"|cffffd700/som destroy x|r "..L["destroy x junk items, where x is the number of items to destroy"],
type = "description",
fontSize = "medium",
order = 3,
},
},
}
local destroy_list,item_count,fram,item_string,_
function SellOMatic_Destroy:OnInitialize()
LibStub("AceConfig-3.0"):RegisterOptionsTable("SellOMatic_Destroy", destroy_options);
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("SellOMatic_Destroy", L["Destroy Options"], "Sell-O-Matic");
end;
function SellOMatic_Destroy:OnEnable()
destroy_list = {};
item_count = 0;
fram = {};
item_string = "";
end;
function SellOMatic:DestroyJunk()
SellOMatic_Destroy:FindJunk();
local num = #destroy_list;
SellOMatic_Destroy:SetItemString(num);
SellOMatic_Destroy:ShowDestroyFrame(num);
end;
function SellOMatic_Destroy:FindJunk()
local bag, slot, name, itemName, itemRarity, itemStackCount, itemSellPrice;
for bag = 0,NUM_BAG_SLOTS,1 do
for slot = 1, GetContainerNumSlots(bag), 1 do
name = GetContainerItemLink(bag,slot);
if name ~= nil and string.find(name, "Hitem") ~= nil then
itemName, _, itemRarity, _, _, _, _, itemStackCount, _, _, itemSellPrice = GetItemInfo(name);
if itemRarity == 0 then
if itemStackCount > 1 then
itemSellPrice = itemSellPrice * GetItemCount(itemName);
end;
SellOMatic_Destroy:SetJunkList(itemName,itemSellPrice);
end;
end;
end;
end;
end;
function SellOMatic_Destroy:DestroyJunk()
local bag, slot, name, itemName, itemLink, itemRarity;
local num = 0;
for bag = 0,NUM_BAG_SLOTS,1 do
for slot = 1, GetContainerNumSlots(bag), 1 do
name = GetContainerItemLink(bag,slot);
if name ~= nil and string.find(name, "Hitem") ~= nil then
itemName, itemLink, itemRarity = GetItemInfo(name);
if itemRarity == 0 then
if SellOMatic_Destroy:CheckJunkList(itemName) then
-- Destroy Item
PickupContainerItem(bag,slot);
DeleteCursorItem();
if SellOMatic.db.profile.showFullInfo == "1-FULL" then SellOMatic:Print(L["Destroying"]..": "..itemName) end;
num = num + 1;
end;
end;
end;
end;
end;
SellOMatic:Print(num.." "..L["item(s) destroyed"]);
end;
function SellOMatic_Destroy:CheckJunkList(item)
local i;
for i=1, #destroy_list, 1 do
if destroy_list[i][1] == item then
return 1;
end;
end;
return 0;
end;
function SellOMatic_Destroy:ShortJunk()
local itemSellPriceX,itemSellPriceY,x,y;
local z = { "", 0 };
for x=1, #destroy_list-1, 1 do
for y=x+1, #destroy_list, 1 do
if destroy_list[x][2] > destroy_list[y][2] then
z = destroy_list[x];
destroy_list[x] = destroy_list[y];
destroy_list[y] = z;
end;
end;
end;
end;
function SellOMatic_Destroy:DestroyItem(item)
local bag, slot, name, itemName;
local found = 0;
for bag = 0,NUM_BAG_SLOTS,1 do
for slot = 1, GetContainerNumSlots(bag), 1 do
if found == 0 then
name = GetContainerItemLink(bag,slot);
if name ~= nil and string.find(name, "Hitem") ~= nil then
itemName = GetItemInfo(name);
if item == itemName then
found = 1;
-- Destroy item
PickupContainerItem(bag,slot);
DeleteCursorItem();
if SellOMatic.db.profile.showFullInfo == "1-FULL" then SellOMatic:Print(L["Destroying"]..": "..item) end;
end;
end;
end;
end;
end;
end;
function SellOMatic:ScanXJunk(num)
local x;
SellOMatic_Destroy:FindJunk();
SellOMatic_Destroy:ShortJunk();
num = tonumber(num);
if num > #destroy_list then num = #destroy_list end;
SellOMatic_Destroy:SetItemString(num);
SellOMatic_Destroy:ShowDestroyFrame(num);
end;
function SellOMatic_Destroy:DestroyXJunk(num)
local x;
for x=1, num, 1 do
SellOMatic_Destroy:DestroyItem(destroy_list[x][1]);
end;
SellOMatic_Destroy:ClearJunkList();
SellOMatic:Print(num.." "..L["item(s) destroyed"]);
end;
function SellOMatic_Destroy:SetJunkList(item,price)
destroy_list[#destroy_list+1] = {item,price};
end;
function SellOMatic_Destroy:ShowJunkList(num)
local i;
for i=1, #destroy_list, 1 do
if num ~= nil and num >= i then
SellOMatic:Print(destroy_list[i][1]);
elseif num == nil then
SellOMatic:Print(destroy_list[i][1]);
end;
end;
end;
function SellOMatic_Destroy:ClearJunkList()
destroy_list = {};
end;
function SellOMatic:GetItemCount()
return item_count;
end;
function SellOMatic_Destroy:CreateDestroyWindow()
fram.DestroyFrame = CreateFrame("Frame","SOMDestroyFrame",UIParent);
local dFrame = fram.DestroyFrame;
dFrame:ClearAllPoints();
dFrame:SetPoint("CENTER",UIParent,"TOP",0,-200);
dFrame:SetHeight(100);
dFrame:SetWidth(300);
dFrame:SetFrameStrata("FULLSCREEN_DIALOG");
dFrame:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", tile = true,
insets = { left = 10, right = 10, top = 10, bottom = 10 }
});
dFrame:SetBackdropBorderColor(1.0,1.0,1.0);
dFrame:SetBackdropColor(0.1,0.1,0.1);
dFrame.Text = dFrame:CreateFontString(nil,"OVERLAY","GameFontNormal");
dFrame.Text:SetPoint("CENTER",dFrame,"TOP",0,-30);
dFrame.Text:SetText(item_string);
dFrame.YesButton = CreateFrame("Button",nil,dFrame,"OptionsButtonTemplate");
dFrame.YesButton:SetPoint("CENTER",dFrame,"BOTTOM",-90,30);
dFrame.YesButton:SetText(L["Yes"]);
dFrame.NoButton = CreateFrame("Button",nil,dFrame,"OptionsButtonTemplate");
dFrame.NoButton:SetPoint("CENTER",dFrame,"BOTTOM",90,30);
dFrame.NoButton:SetScript("OnClick", function()
SellOMatic_Destroy:ClearJunkList();
dFrame:Hide();
end);
dFrame.NoButton:SetText(L["No"]);
dFrame.ShowButton = CreateFrame("Button",nil,dFrame,"OptionsButtonTemplate");
dFrame.ShowButton:SetPoint("CENTER",dFrame,"BOTTOM",0,30);
dFrame.ShowButton:SetText(L["Show"]);
dFrame:Hide();
end;
function SellOMatic_Destroy:ShowDestroyFrame(num)
if fram.DestroyFrame == nil then SellOMatic_Destroy:CreateDestroyWindow() end;
fram.DestroyFrame.Text:SetText(item_string);
fram.DestroyFrame.YesButton:SetScript("OnClick", function()
SellOMatic_Destroy:DestroyXJunk(num)
fram.DestroyFrame:Hide();
end);
fram.DestroyFrame.ShowButton:SetScript("OnClick", function()
SellOMatic_Destroy:ShowJunkList(num);
end);
fram.DestroyFrame:Show();
end;
function SellOMatic_Destroy:SetItemString(num)
item_string = L["Delete"].." "..num.." "..L["item(s) from inventory?"];
end;
|
ITEM.name = "Duct Tape"
ITEM.description = "itemDuctTapeDesc"
ITEM.price = 12
ITEM.model = "models/mosi/fallout4/props/junk/ducttape.mdl" |
if GetBot():IsInvulnerable() or not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return;
end
local ability_item_usage_generic = dofile( GetScriptDirectory().."/ability_item_usage_generic" )
local utils = require(GetScriptDirectory() .. "/util")
local mutil = require(GetScriptDirectory() .. "/MyUtility")
local role = require(GetScriptDirectory() .. "/RoleUtility");
function AbilityLevelUpThink()
ability_item_usage_generic.AbilityLevelUpThink();
end
function BuybackUsageThink()
ability_item_usage_generic.BuybackUsageThink();
end
function CourierUsageThink()
ability_item_usage_generic.CourierUsageThink();
end
function ItemUsageThink()
ability_item_usage_generic.ItemUsageThink()
end
local npcBot = GetBot();
local abilityQ = nil;
local abilityW = nil;
local abilityE = nil;
local abilityE2 = nil;
local abilityR = nil;
local ItemGC = nil;
local castQDesire = 0;
local castWDesire = 0;
local castEDesire = 0;
local castE2Desire = 0;
local castRDesire = 0;
function AbilityUsageThink()
if mutil.CanNotUseAbility(npcBot) then return end
if abilityQ == nil then abilityQ = npcBot:GetAbilityByName( "bane_enfeeble" ) end
if abilityW == nil then abilityW = npcBot:GetAbilityByName( "bane_brain_sap" ) end
if abilityE == nil then abilityE = npcBot:GetAbilityByName( "bane_nightmare" ) end
if abilityE2 == nil then abilityE2 = npcBot:GetAbilityByName( "bane_nightmare_end" ) end
if abilityR == nil then abilityR = npcBot:GetAbilityByName( "bane_fiends_grip" ) end
ItemGC = mutil.GetComboItem(npcBot, 'item_glimmer_cape')
castQDesire, castQTarget = ConsiderQ();
castWDesire, castWTarget = ConsiderW();
castEDesire, castETarget = ConsiderE();
castE2Desire = ConsiderE2();
castRDesire, castRTarget = ConsiderR();
if ItemGC ~= nil and ItemGC:IsFullyCastable() and castRDesire > 0 then
npcBot:Action_UseAbilityOnEntity( ItemGC, npcBot );
return;
end
if ( castRDesire > 0 )
then
npcBot:Action_UseAbilityOnEntity( abilityR, castRTarget );
return;
end
if ( castEDesire > 0 )
then
npcBot:Action_UseAbilityOnEntity( abilityE, castETarget );
return;
end
if ( castWDesire > 0 )
then
npcBot:Action_UseAbilityOnEntity( abilityW, castWTarget );
return;
end
if ( castQDesire > 0 )
then
npcBot:Action_UseAbilityOnEntity( abilityQ, castQTarget );
return;
end
if ( castE2Desire > 0 )
then
npcBot:Action_UseAbility( abilityE2 );
return;
end
end
function ConsiderQ()
-- Make sure it's castable
if ( not abilityQ:IsFullyCastable() ) then
return BOT_ACTION_DESIRE_NONE, 0;
end
-- Get some of its values
local nCastRange = abilityQ:GetCastRange( );
local nCastPoint = abilityQ:GetCastPoint( );
local nManaCost = abilityQ:GetManaCost( );
local tableNearbyEnemyHeroes = npcBot:GetNearbyHeroes( nCastRange+200, true, BOT_MODE_NONE );
-- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently
if mutil.IsRetreating(npcBot)
then
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcBot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) and mutil.CanCastOnNonMagicImmune(npcEnemy) )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
end
if mutil.IsInTeamFight(npcBot, 1200)
then
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcEnemy:IsHero() and role.IsCarry(npcEnemy:GetUnitName()) and mutil.CanCastOnMagicImmune(npcEnemy)
and not mutil.StillHasModifier(npcEnemy, 'modifier_bane_enfeeble') )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
end
if mutil.AllowedToSpam(npcBot, nManaCost)
then
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcEnemy:IsHero() and mutil.CanCastOnNonMagicImmune(npcEnemy) and role.IsCarry(npcEnemy:GetUnitName())
and not mutil.StillHasModifier(npcEnemy, 'modifier_bane_enfeeble') )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
end
-- If we're going after someone
if mutil.IsGoingOnSomeone(npcBot)
then
local npcTarget = npcBot:GetTarget();
if mutil.IsValidTarget(npcTarget) and role.IsCarry(npcTarget:GetUnitName()) and mutil.CanCastOnNonMagicImmune(npcTarget)
and mutil.IsInRange(npcTarget, npcBot, nCastRange + 200) and not mutil.StillHasModifier(npcTarget, 'modifier_bane_enfeeble')
then
return BOT_ACTION_DESIRE_HIGH, npcTarget;
end
end
return BOT_ACTION_DESIRE_NONE, 0;
end
function ConsiderW()
-- Make sure it's castable
if ( not abilityW:IsFullyCastable() ) then
return BOT_ACTION_DESIRE_NONE, 0;
end
-- Get some of its values
local nCastRange = abilityW:GetCastRange();
local nDamage = abilityW:GetSpecialValueInt('brain_sap_damage');
local nCastPoint = abilityW:GetCastPoint( );
local nManaCost = abilityW:GetManaCost( );
local tableNearbyEnemyHeroes = npcBot:GetNearbyHeroes( nCastRange+200, true, BOT_MODE_NONE );
-- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently
if mutil.IsRetreating(npcBot)
then
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcBot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) and mutil.CanCastOnNonMagicImmune(npcEnemy) )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
end
if mutil.IsInTeamFight(npcBot, 1200) and npcBot:GetMaxHealth() - npcBot:GetHealth() > nDamage
then
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( mutil.CanCastOnMagicImmune(npcEnemy) and mutil.CanKillTarget(npcEnemy, nDamage, DAMAGE_TYPE_PURE ) )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
end
-- If we're going after someone
if mutil.IsGoingOnSomeone(npcBot) and npcBot:GetMaxHealth() - npcBot:GetHealth() > nDamage
then
local npcTarget = npcBot:GetTarget();
if mutil.IsValidTarget(npcTarget) and mutil.CanCastOnNonMagicImmune(npcTarget)and mutil.IsInRange(npcTarget, npcBot, nCastRange + 200)
then
return BOT_ACTION_DESIRE_HIGH, npcTarget;
end
end
return BOT_ACTION_DESIRE_NONE, 0;
end
function ConsiderE()
-- Make sure it's castable
if ( not abilityE:IsFullyCastable() or abilityE:IsHidden() ) then
return BOT_ACTION_DESIRE_NONE, 0;
end
-- Get some of its values
local nCastRange = abilityE:GetCastRange();
local nDamage = abilityE:GetSpecialValueFloat('duration')*abilityE:GetAbilityDamage();
local nCastPoint = abilityE:GetCastPoint( );
local nManaCost = abilityE:GetManaCost( );
local tableNearbyEnemyHeroes = npcBot:GetNearbyHeroes( nCastRange+200, true, BOT_MODE_NONE );
if mutil.IsProjectileIncoming(npcBot, 300)
then
return BOT_ACTION_DESIRE_HIGH, npcBot;
end
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcEnemy:IsChanneling() and mutil.CanCastOnNonMagicImmune(npcEnemy) )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
-- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently
if mutil.IsRetreating(npcBot)
then
if npcBot:GetHealth() < nDamage then
return BOT_ACTION_DESIRE_HIGH, npcBot;
end
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcBot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) and mutil.CanCastOnNonMagicImmune(npcEnemy) and not mutil.IsDisabled(true, npcEnemy) )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
end
if mutil.IsInTeamFight(npcBot, 1200)
then
local npcTarget = npcBot:GetTarget();
if mutil.IsValidTarget(npcTarget) and #tableNearbyEnemyHeroes == 2
then
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcEnemy ~= npcTarget and mutil.CanCastOnMagicImmune(npcEnemy) and not mutil.IsDisabled(true, npcEnemy) )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
end
end
-- If we're going after someone
if mutil.IsGoingOnSomeone(npcBot)
then
local npcTarget = npcBot:GetTarget();
if mutil.IsValidTarget(npcTarget) and mutil.CanCastOnNonMagicImmune(npcTarget)and mutil.IsInRange(npcTarget, npcBot, nCastRange + 200) and not mutil.IsDisabled(true, npcTarget)
then
local allies = npcTarget:GetNearbyHeroes( nCastRange-200, true, BOT_MODE_NONE );
local enemies = npcTarget:GetNearbyHeroes( nCastRange-200, false, BOT_MODE_NONE );
if ( allies == nil or #allies == 1 ) and #enemies == 1
then
return BOT_ACTION_DESIRE_HIGH, npcTarget;
end
end
end
return BOT_ACTION_DESIRE_NONE, 0;
end
function ConsiderE2()
-- Make sure it's castable
if ( not abilityE2:IsFullyCastable() or abilityE2:IsHidden() ) then
return BOT_ACTION_DESIRE_NONE;
end
local tableNearbyAllyHeroes = npcBot:GetNearbyHeroes( 1200, false, BOT_MODE_NONE );
for _,npcAlly in pairs( tableNearbyAllyHeroes )
do
if ( mutil.StillHasModifier(npcAlly, 'modifier_bane_nightmare') )
then
return BOT_ACTION_DESIRE_HIGH;
end
end
if mutil.IsGoingOnSomeone(npcBot)
then
local npcTarget = npcBot:GetTarget();
if mutil.IsValidTarget(npcTarget) and mutil.IsInRange(npcTarget, npcBot, 1000) and mutil.StillHasModifier(npcTarget, 'modifier_bane_nightmare')
then
local allies = npcTarget:GetNearbyHeroes( 600, true, BOT_MODE_NONE );
local enemies = npcTarget:GetNearbyHeroes( 800, false, BOT_MODE_NONE );
if ( #allies >= 2 and #enemies == 1 )
then
return BOT_ACTION_DESIRE_HIGH;
end
end
end
return BOT_ACTION_DESIRE_NONE;
end
function ConsiderR()
-- Make sure it's castable
if ( not abilityR:IsFullyCastable() ) then
return BOT_ACTION_DESIRE_NONE, 0;
end
-- Get some of its values
local nCastRange = abilityR:GetCastRange();
local nDamage = abilityR:GetSpecialValueFloat('fiend_grip_duration')*abilityE:GetSpecialValueInt('fiend_grip_damage');
local nCastPoint = abilityR:GetCastPoint( );
local nManaCost = abilityR:GetManaCost( );
if npcBot:HasScepter() then
nDamage = abilityR:GetSpecialValueFloat('fiend_grip_duration_scepter')*abilityR:GetSpecialValueInt('fiend_grip_damage_scepter');
end
local tableNearbyEnemyHeroes = npcBot:GetNearbyHeroes( nCastRange+200, true, BOT_MODE_NONE );
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcEnemy:IsChanneling() and mutil.CanCastOnMagicImmune(npcEnemy) )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
-- If we're seriously retreating, see if we can land a stun on someone who's damaged us recently
if mutil.IsRetreating(npcBot) and tableNearbyEnemyHeroes[1] ~=nil
then
local tableNearbyAllyHeroes = tableNearbyEnemyHeroes[1]:GetNearbyHeroes( nCastRange-200, true, BOT_MODE_NONE );
if tableNearbyAllyHeroes ~= nil and #tableNearbyAllyHeroes >= 2
then
return BOT_ACTION_DESIRE_HIGH, tableNearbyEnemyHeroes[1];
end
end
if mutil.IsInTeamFight(npcBot, 1200)
then
for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
do
if ( npcEnemy:IsHero() and role.IsCarry(npcEnemy:GetUnitName()) and mutil.CanCastOnMagicImmune(npcEnemy) and not mutil.IsDisabled(true, npcEnemy) )
then
return BOT_ACTION_DESIRE_HIGH, npcEnemy;
end
end
end
-- If we're going after someone
if mutil.IsGoingOnSomeone(npcBot)
then
local npcTarget = npcBot:GetTarget();
if mutil.IsValidTarget(npcTarget) and mutil.CanCastOnNonMagicImmune(npcTarget)and mutil.IsInRange(npcTarget, npcBot, nCastRange + 200) and not mutil.IsDisabled(true, npcTarget)
then
local allies = npcTarget:GetNearbyHeroes( nCastRange-200, true, BOT_MODE_NONE );
if ( allies ~= nil and #allies >= 2 )
then
return BOT_ACTION_DESIRE_HIGH, npcTarget;
end
end
end
return BOT_ACTION_DESIRE_NONE, 0;
end
|
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
client_script "clientHospital.lua"
server_script "serverHospital.lua" |
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf/protobuf"
module('FirstPassStageInfo_pb')
FIRSTPASSSTAGEINFO = protobuf.Descriptor();
local FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD = protobuf.FieldDescriptor();
local FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD = protobuf.FieldDescriptor();
local FIRSTPASSSTAGEINFO_RANK_FIELD = protobuf.FieldDescriptor();
local FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD = protobuf.FieldDescriptor();
local FIRSTPASSSTAGEINFO_TOTALRANK_FIELD = protobuf.FieldDescriptor();
local FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD = protobuf.FieldDescriptor();
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.name = "firstPassID"
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.full_name = ".KKSG.FirstPassStageInfo.firstPassID"
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.number = 1
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.index = 0
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.label = 1
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.has_default_value = false
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.default_value = 0
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.type = 5
FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD.cpp_type = 1
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.name = "isGetReward"
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.full_name = ".KKSG.FirstPassStageInfo.isGetReward"
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.number = 2
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.index = 1
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.label = 1
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.has_default_value = false
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.default_value = false
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.type = 8
FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD.cpp_type = 7
FIRSTPASSSTAGEINFO_RANK_FIELD.name = "rank"
FIRSTPASSSTAGEINFO_RANK_FIELD.full_name = ".KKSG.FirstPassStageInfo.rank"
FIRSTPASSSTAGEINFO_RANK_FIELD.number = 3
FIRSTPASSSTAGEINFO_RANK_FIELD.index = 2
FIRSTPASSSTAGEINFO_RANK_FIELD.label = 1
FIRSTPASSSTAGEINFO_RANK_FIELD.has_default_value = false
FIRSTPASSSTAGEINFO_RANK_FIELD.default_value = 0
FIRSTPASSSTAGEINFO_RANK_FIELD.type = 5
FIRSTPASSSTAGEINFO_RANK_FIELD.cpp_type = 1
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.name = "hasCommended"
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.full_name = ".KKSG.FirstPassStageInfo.hasCommended"
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.number = 4
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.index = 3
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.label = 1
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.has_default_value = false
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.default_value = false
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.type = 8
FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD.cpp_type = 7
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.name = "totalRank"
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.full_name = ".KKSG.FirstPassStageInfo.totalRank"
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.number = 5
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.index = 4
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.label = 1
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.has_default_value = false
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.default_value = 0
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.type = 5
FIRSTPASSSTAGEINFO_TOTALRANK_FIELD.cpp_type = 1
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.name = "commendedStarLevels"
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.full_name = ".KKSG.FirstPassStageInfo.commendedStarLevels"
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.number = 6
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.index = 5
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.label = 3
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.has_default_value = false
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.default_value = {}
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.type = 13
FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD.cpp_type = 3
FIRSTPASSSTAGEINFO.name = "FirstPassStageInfo"
FIRSTPASSSTAGEINFO.full_name = ".KKSG.FirstPassStageInfo"
FIRSTPASSSTAGEINFO.nested_types = {}
FIRSTPASSSTAGEINFO.enum_types = {}
FIRSTPASSSTAGEINFO.fields = {FIRSTPASSSTAGEINFO_FIRSTPASSID_FIELD, FIRSTPASSSTAGEINFO_ISGETREWARD_FIELD, FIRSTPASSSTAGEINFO_RANK_FIELD, FIRSTPASSSTAGEINFO_HASCOMMENDED_FIELD, FIRSTPASSSTAGEINFO_TOTALRANK_FIELD, FIRSTPASSSTAGEINFO_COMMENDEDSTARLEVELS_FIELD}
FIRSTPASSSTAGEINFO.is_extendable = false
FIRSTPASSSTAGEINFO.extensions = {}
FirstPassStageInfo = protobuf.Message(FIRSTPASSSTAGEINFO)
|
-- ======================================================================
-- Shuttle Search
-- Advent of Code 2020 Day 13 -- Eric Wastl -- https://adventofcode.com
--
-- lua implementation by Dr. Dean Earl Wright III
-- ======================================================================
-- ======================================================================
-- b u s . l u a
-- ======================================================================
-- Bus for the Advent of Code 2020 Day 13 puzzle
-- ----------------------------------------------------------------------
-- local
-- ----------------------------------------------------------------------
local Bus = { part2=false, bid=0, offset=0 }
-- ----------------------------------------------------------------------
-- constants
-- ----------------------------------------------------------------------
-- ======================================================================
-- Bus
-- ======================================================================
function Bus:Bus (o)
-- Object for Shuttle Search
-- 1. Set the initial values
o = o or {}
o.part2 = o.part2 or false
o.bid = o.bid or 0
o.offset = o.offset or 0
-- 2. Create the object metatable
self.__index = self
setmetatable(o, self)
return o
end
function Bus:next_departure(time)
-- Return the next time the bus departs after specified time
time = time or 0
local delta = time % self.bid
if delta == 0 then
return time
end
return time + self.bid - delta
end
-- ----------------------------------------------------------------------
-- module initialization
-- ----------------------------------------------------------------------
return Bus
-- ======================================================================
-- end b u s . l u a end
-- ======================================================================
|
require("runtime-core/src/h")
require("runtime-core/src/vnode")
describe('renderer: h', function()
test('type only', function()
expect(h('div')):toMatchObject(createVNode('div'))
end
)
test('type + props', function()
expect(h('div', {id='foo'})):toMatchObject(createVNode('div', {id='foo'}))
end
)
test('type + omit props', function()
expect(h('div', {'foo'})):toMatchObject(createVNode('div', nil, {'foo'}))
local Component = {template='<br />'}
local slot = function()
end
expect(h(Component, slot)):toMatchObject(createVNode(Component, nil, slot))
local vnode = h('div')
expect(h('div', vnode)):toMatchObject(createVNode('div', nil, {vnode}))
expect(h('div', 'foo')):toMatchObject(createVNode('div', nil, 'foo'))
end
)
test('type + props + children', function()
expect(h('div', {}, {'foo'})):toMatchObject(createVNode('div', {}, {'foo'}))
local slots = {}
expect(h('div', {}, slots)):toMatchObject(createVNode('div', {}, slots))
local Component = {template='<br />'}
expect(h(Component, {}, slots)):toMatchObject(createVNode(Component, {}, slots))
local slot = function()
end
expect(h(Component, {}, slot)):toMatchObject(createVNode(Component, {}, slot))
local vnode = h('div')
expect(h('div', {}, vnode)):toMatchObject(createVNode('div', {}, {vnode}))
expect(h('div', {}, 'foo')):toMatchObject(createVNode('div', {}, 'foo'))
end
)
test('named slots with null props', function()
local Component = {template='<br />'}
local slot = function()
end
expect(h(Component, nil, {foo=slot})):toMatchObject(createVNode(Component, nil, {foo=slot}))
end
)
end
) |
woodworking = {
craft = function(player, npc, speech)
local t = {
graphic = convertGraphic(npc.look, "monster"),
color = npc.lookColor
}
player.npcGraphic = t.graphic
player.npcColor = t.color
player.dialogType = 0
player.lastClick = npc.ID
if speech == "wood" then
local choices = {
"Melee Weapons",
"Arrows",
"Weaving Tools",
"Water jug"
}
local titem = {graphic = convertGraphic(723, "item"), color = 0}
local choice = player:menuSeq(
"What would you like to craft?",
choices,
{}
)
local woodlevel = crafting.getSkillLevel(player, "woodworking")
local rand = math.random(1, 10)
if choice == 1 then
local craftable = {}
if crafting.checkSkillLevel(player, "woodworking", "novice") then
table.insert(craftable, "Wooden sword")
end
if crafting.checkSkillLevel(player, "woodworking", "apprentice") then
table.insert(craftable, "Viperhead woodsaber")
end
if crafting.checkSkillLevel(player, "woodworking", "accomplished") then
table.insert(craftable, "Viperhead woodsword")
end
if crafting.checkSkillLevel(player, "woodworking", "adept") then
table.insert(craftable, "Oaken sword")
end
if crafting.checkSkillLevel(player, "woodworking", "talented") then
table.insert(craftable, "Oaken blade")
end
if crafting.checkSkillLevel(player, "woodworking", "expert") then
table.insert(craftable, "Juk-do")
end
if crafting.checkSkillLevel(player, "woodworking", "grandmaster") then
table.insert(craftable, "Wooden blade")
end
if woodlevel == "novice" then
if player:hasItem("ginko_wood", 2) == true then
player:removeItem("ginko_wood", 2)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player:addItem("supple_wooden_sword", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
elseif (rand == 2) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
else
player:addItem("wooden_sword", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:dialogSeq(
{
titem,
"You need 2 units of Ginko Wood to make this."
},
0
)
return
end
else
local weaponChoice = player:menuSeq(
"What would you like to craft?",
craftable,
{}
)
if weaponChoice == 1 then
if player:hasItem("ginko_wood", 2) == true then
player:removeItem("ginko_wood", 2)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player:addItem("supple_wooden_sword", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
elseif (rand == 2) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
else
player:addItem("wooden_sword", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:dialogSeq(
{
titem,
"You need 2 units of Ginko Wood to make this."
},
0
)
return
end
end
if weaponChoice == 2 then
if player:hasItem("ginko_wood", 2) == true then
player:removeItem("ginko_wood", 2)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player:addItem("supple_viperhead_woodsaber", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
elseif (rand == 2) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
else
player:addItem("viperhead_woodsaber", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:dialogSeq(
{
titem,
"You need 2 units of Ginko Wood to make this."
},
0
)
return
end
end
if weaponChoice == 3 then
if player:hasItem("ginko_wood", 3) == true then
player:removeItem("ginko_wood", 3)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player:addItem("supple_viperhead_woodsword", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
elseif (rand == 2) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
else
player:addItem("viperhead_woodsword", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:dialogSeq(
{
titem,
"You need 3 units of Ginko Wood to make this."
},
0
)
return
end
end
if weaponChoice == 4 then
if player:hasItem("ginko_wood", 3) == true then
player:removeItem("ginko_wood", 3)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player:addItem("supple_oaken_sword", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
elseif (rand == 2) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
else
player:addItem("oaken_sword", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:dialogSeq(
{
titem,
"You need 3 units of Ginko Wood to make this."
},
0
)
return
end
end
if weaponChoice == 5 then
if player:hasItem("ginko_wood", 4) == true then
player:removeItem("ginko_wood", 4)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player:addItem("supple_oaken_blade", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
elseif (rand == 2) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
else
player:addItem("oaken_blade", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:dialogSeq(
{
titem,
"You need 4 units of Ginko Wood to make this."
},
0
)
return
end
end
if weaponChoice == 6 then
if player.registry["juk_do_cooldown"] > os.time() then
player:dialogSeq(
{
t,
"Ah, the Juk-do! This is a masterful weapon that takes TIME to create! You need to wait a while before you can attempt another. ((6 hour cooldown))"
},
1
)
return
end
if player:hasItem("ginko_wood", 20) == true then
player:removeItem("ginko_wood", 20)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player.registry["juk_do_cooldown"] = os.time() + 21600
-- 6 hours
player:addItem("elegant_juk_do", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
elseif (rand == 2) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
else
player.registry["juk_do_cooldown"] = os.time() + 21600
-- 6 hours
player:addItem("juk_do", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:dialogSeq(
{
titem,
"You need 20 units of Ginko Wood to make this."
},
0
)
return
end
end
if weaponChoice == 7 then
if player:hasItem("ginko_wood", 6) == true then
player:removeItem("ginko_wood", 6)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player:addItem("supple_wooden_blade", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
elseif (rand == 2) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
else
player:addItem("wooden_blade", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(2, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:dialogSeq(
{
titem,
"You need 6 units of Ginko Wood to make this."
},
0
)
return
end
end
end
elseif choice == 2 then
local craftable = {}
if crafting.checkSkillLevel(player, "woodworking", "novice") then
table.insert(craftable, "spring_quiver")
end
if crafting.checkSkillLevel(player, "woodworking", "apprentice") then
table.insert(craftable, "summer_quiver")
end
if crafting.checkSkillLevel(player, "woodworking", "accomplished") then
table.insert(craftable, "autumn_quiver")
end
if crafting.checkSkillLevel(player, "woodworking", "adept") then
table.insert(craftable, "winter_quiver")
end
if crafting.checkSkillLevel(player, "woodworking", "talented") then
table.insert(craftable, "ancient_quiver")
end
if crafting.checkSkillLevel(player, "woodworking", "skilled") then
table.insert(craftable, "blood_quiver")
end
if crafting.checkSkillLevel(player, "woodworking", "expert") then
table.insert(craftable, "earth_quiver")
end
if crafting.checkSkillLevel(player, "woodworking", "master") then
table.insert(craftable, "star_quiver")
end
if player:hasItem("ginko_wood", 5) == true then
player:removeItem("ginko_wood", 5)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (rand == 1) then
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(312, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
return
else
player:addItem(craftable[math.random(1, #craftable)], 1)
player:dialogSeq(
{
{
graphic = convertGraphic(312, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
return
end
else
player:dialogSeq(
{titem, "You need 5 units of Ginko Wood to make this."},
0
)
return
end
elseif choice == 3 then
local success = false
if woodlevel == "novice" then
local rand = math.random(1, 100)
if rand > 50 then
success = true
end
end
if woodlevel == "apprentice" then
local rand = math.random(1, 100)
if rand > 46 then
success = true
end
end
if woodlevel == "accomplished" then
local rand = math.random(1, 100)
if rand > 42 then
success = true
end
end
if woodlevel == "adept" then
local rand = math.random(1, 100)
if rand > 38 then
success = true
end
end
if woodlevel == "talented" then
local rand = math.random(1, 100)
if rand > 34 then
success = true
end
end
if woodlevel == "skilled" then
local rand = math.random(1, 100)
if rand > 30 then
success = true
end
end
if woodlevel == "expert" then
local rand = math.random(1, 100)
if rand > 26 then
success = true
end
end
if woodlevel == "master" then
local rand = math.random(1, 100)
if rand > 22 then
success = true
end
end
if woodlevel == "grandmaster" then
local rand = math.random(1, 100)
if rand > 18 then
success = true
end
end
if woodlevel == "champion" then
local rand = math.random(1, 100)
if rand > 15 then
success = true
end
end
if woodlevel == "legend" then
local rand = math.random(1, 100)
if rand > 12 then
success = true
end
end
if player:hasItem("ginko_wood", 1) == true then
player:removeItem("ginko_wood", 1)
crafting.skillChanceIncrease(
player,
NPC("Splinter"),
"woodworking"
)
if (success == true) then
local rand = math.random(1, 10)
if rand == 1 then
player:addItem("fine_weaving_tools", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(36, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
else
player:addItem("weaving_tools", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(36, "item"),
color = 0
},
"Your efforts were successful!"
},
0
)
end
else
player:addItem("wood_scraps", 1)
player:dialogSeq(
{
{
graphic = convertGraphic(36, "item"),
color = 0
},
"Your efforts were unsuccessful."
},
0
)
return
end
else
player:dialogSeq(
{titem, "You need 1 units of Ginko Wood to make this."},
0
)
return
end
--[[
elseif choice == 4 then
itemSuccess = {"empty_water_jug","empty_water_jug"}
matsAmts = 2
]]
--
end
return
elseif speech == "scraps" or speech == "scrap" then
local titem = {graphic = convertGraphic(723, "item"), color = 0}
if player:hasItem("wood_scraps", 4) ~= true then
player:dialogSeq(
{
titem,
"Had you enough scraps, you might be able to salvage something."
},
0
)
return
end
local roll = math.random(1, 3)
player:removeItem("wood_scraps", 4)
if roll ~= 1 then
player:dialogSeq({titem, "No luck this time."}, 0)
return
end
player:addItem("ginko_wood", 1)
return
end
end
}
|
local S = minetest.get_translator("homedecor_foyer")
homedecor.register("coatrack_wallmount", {
tiles = { homedecor.plain_wood },
inventory_image = "homedecor_coatrack_wallmount_inv.png",
description = S("Wall-mounted coat rack"),
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.375, 0, 0.4375, 0.375, 0.14, 0.5}, -- NodeBox1
{-0.3025, 0.0475, 0.375, -0.26, 0.09, 0.4375}, -- NodeBox2
{0.26, 0.0475, 0.375, 0.3025, 0.09, 0.4375}, -- NodeBox3
{0.0725, 0.0475, 0.375, 0.115, 0.09, 0.4375}, -- NodeBox4
{-0.115, 0.0475, 0.375, -0.0725, 0.09, 0.4375}, -- NodeBox5
{0.24, 0.025, 0.352697, 0.3225, 0.115, 0.375}, -- NodeBox6
{-0.3225, 0.025, 0.352697, -0.24, 0.115, 0.375}, -- NodeBox7
{-0.135, 0.025, 0.352697, -0.0525, 0.115, 0.375}, -- NodeBox8
{0.0525, 0.025, 0.352697, 0.135, 0.115, 0.375}, -- NodeBox9
}
},
})
homedecor.register("coat_tree", {
mesh = "homedecor_coatrack.obj",
tiles = {
homedecor.plain_wood,
"homedecor_generic_wood_old.png"
},
inventory_image = "homedecor_coatrack_inv.png",
description = S("Coat tree"),
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
expand = { top="placeholder" },
walkable = false,
selection_box = {
type = "fixed",
fixed = { -0.4, -0.5, -0.4, 0.4, 1.5, 0.4 }
},
on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil,
})
local mat_colors = {
{ "green", S("Green welcome mat") },
{ "brown", S("Brown welcome mat") },
{ "grey", S("Grey welcome mat") },
}
for _, mat in ipairs(mat_colors) do
local color, desc = unpack(mat)
homedecor.register("welcome_mat_"..color, {
description = desc,
tiles = {
"homedecor_welcome_mat_"..color..".png",
"homedecor_welcome_mat_bottom.png",
"homedecor_welcome_mat_"..color..".png",
},
groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.25},
}),
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.375, 0.5, -0.46875, 0.375 }
}
})
end
-- crafting
minetest.register_craft({
output = "homedecor:welcome_mat_grey 2",
recipe = {
{ "", "dye:black", "" },
{ "wool:grey", "wool:grey", "wool:grey" },
},
})
minetest.register_craft({
output = "homedecor:welcome_mat_brown 2",
recipe = {
{ "", "dye:black", "" },
{ "wool:brown", "wool:brown", "wool:brown" },
},
})
minetest.register_craft({
output = "homedecor:welcome_mat_green 2",
recipe = {
{ "", "dye:white", "" },
{ "wool:dark_green", "wool:dark_green", "wool:dark_green" },
},
})
minetest.register_craft({
output = "homedecor:welcome_mat_green 2",
recipe = {
{ "", "dye:white", "" },
{ "dye:black", "dye:black", "dye:black" },
{ "wool:green", "wool:green", "wool:green" },
},
})
minetest.register_craft( {
output = "homedecor:coat_tree",
recipe = {
{ "group:stick", "group:stick", "group:stick" },
{ "", "group:stick", "" },
{ "", "group:wood", "" }
},
})
minetest.register_craft( {
output = "homedecor:coatrack_wallmount",
recipe = {
{ "group:stick", "homedecor:curtainrod_wood", "group:stick" },
},
})
|
return {'erlangs','erlings','erlecomse'} |
ts_vehicles_common.register_tank_compatibility = function(vehicle)
ts_vehicles.register_compatibility(vehicle, "ts_vehicles_common:gasoline_tank", {})
ts_vehicles.register_compatibility(vehicle, "ts_vehicles_common:hydrogen_tank", {})
ts_vehicles.register_compatibility(vehicle, "ts_vehicles_common:battery", {})
end
ts_vehicles_common.register_aux_tank_compatibility = function(vehicle)
ts_vehicles.register_compatibility(vehicle, "ts_vehicles_common:auxiliary_gasoline_tank", {})
ts_vehicles.register_compatibility(vehicle, "ts_vehicles_common:auxiliary_hydrogen_tank", {})
ts_vehicles.register_compatibility(vehicle, "ts_vehicles_common:auxiliary_battery", {})
end
ts_vehicles.register_part("ts_vehicles_common:gasoline_tank", {
inventory_image = "ts_vehicles_common_gasoline_tank.png",
description = "Gasoline Tank",
gasoline_capacity = 70,
groups = { main_tank = 1, }
})
minetest.register_craft({
output = "ts_vehicles_common:gasoline_tank",
recipe = {
{"ts_vehicles_common:composite_material", "ts_vehicles_common:composite_material", "ts_vehicles_common:composite_material"},
{"techage:ta3_pipeS", "", "ts_vehicles_common:composite_material"},
{"ts_vehicles_common:composite_material", "techage:ta3_pipeS", "ts_vehicles_common:composite_material"},
},
})
ts_vehicles.register_part("ts_vehicles_common:hydrogen_tank", {
inventory_image = "ts_vehicles_common_hydrogen_tank.png",
description = "Hydrogen Tank",
hydrogen_capacity = 500,
groups = { main_tank = 1, }
})
minetest.register_craft({
output = "ts_vehicles_common:hydrogen_tank",
recipe = {
{"techage:ta4_carbon_fiber", "techage:canister_epoxy", "techage:ta4_carbon_fiber"},
{"techage:ta3_pipeS", "ts_vehicles_common:composite_material", "techage:ta3_pipeS"},
{"techage:ta4_carbon_fiber", "techage:canister_epoxy", "techage:ta4_carbon_fiber"},
},
replacements = {
{"techage:canister_epoxy", "techage:ta3_canister_empty"},
{"techage:canister_epoxy", "techage:ta3_canister_empty"}
}
})
ts_vehicles.register_part("ts_vehicles_common:battery", {
inventory_image = "ts_vehicles_common_battery.png",
description = "Battery",
electricity_capacity = 1000,
groups = { main_tank = 1, }
})
minetest.register_craft({
output = "ts_vehicles_common:battery",
recipe = {
{"default:copperblock", "default:tinblock", "ts_vehicles_common:composite_material"},
{"ts_vehicles_common:composite_material", "default:copperblock", "default:tinblock"},
{"default:copperblock", "default:tinblock", "ts_vehicles_common:composite_material"},
},
}) |
-- luacheck: globals GetLocale GetAddOnMetadata
if (GetLocale() == "zhCN") then
rggm = rggm or {}
rggm.L = {}
rggm.L["addon_name"] = "GearMenu"
-- console
rggm.L["help"] = "|cFFFFC300(%s)|r: 输入 |cFFFFC300/rggm|r 或 |cFFFFC300/gearmenu|r 打开选项列表"
rggm.L["opt"] = "|cFFFFC300opt|r - 显示设置菜单"
rggm.L["reload"] = "|cFFFFC300reload|r - 重置UI"
rggm.L["info_title"] = "|cFF00FFB0GearMenu:|r"
rggm.L["invalid_argument"] = "参数无效"
-- about
rggm.L["author"] = "Author: Michael Wiesendanger"
rggm.L["email"] = "E-Mail: michael.wiesendanger@gmail.com"
rggm.L["version"] = "Version: " .. GetAddOnMetadata(RGGM_CONSTANTS.ADDON_NAME, "Version")
rggm.L["issues"] = "Issues: https://github.com/RagedUnicorn/wow-classic-gearmenu/issues"
-- general
rggm.L["general_category_name"] = "一般"
rggm.L["general_title"] = "一般配置"
rggm.L["enable_tooltips"] = "鼠标提示"
rggm.L["enable_tooltips_tooltip"] = "悬停物品时是否显示工具提示"
rggm.L["enable_simple_tooltips"] = "简单鼠标提示"
rggm.L["enable_simple_tooltips_tooltip"] = "仅显示当前悬停项的标题 而不是完整的工具提示"
rggm.L["enable_fast_press"] = "启动快速按键"
rggm.L["enable_fast_press_tooltip"] = "允许在按键下压时触发操作而不是在按键抬起时触发操作"
rggm.L["enable_drag_and_drop"] = "启用可拖动"
rggm.L["enable_drag_and_drop_tooltip"] = "启用可拖动物品"
rggm.L["enable_unequip_slot"] = "启用取消装备插槽"
rggm.L["enable_unequip_slot_tooltip"] = "允许将一个空插槽添加到changeMenu。这样可以更轻松地取消装备"
rggm.L["filter_item_quality"] = "过滤物品品质:"
rggm.L["item_quality_poor"] = "灰色"
rggm.L["item_quality_common"] = "白色"
rggm.L["item_quality_uncommon"] = "绿色"
rggm.L["item_quality_rare"] = "蓝色"
rggm.L["item_quality_epic"] = "紫色"
rggm.L["item_quality_legendary"] = "橙色"
-- quickchange
rggm.L["quick_change_category_name"] = "快速更换"
rggm.L["quick_change_title"] = "快速更换"
rggm.L["quick_change_slider_title"] = "延迟(秒)"
rggm.L["quick_change_slider_tooltip"] = "为快速更换规则实际发生的时间设置延迟。 "
.. "对于提供buff的物品,延迟通常应设置为buff的持续时间"
rggm.L["quick_change_slider_unit"] = "秒"
rggm.L["quick_change_add_rule"] = "添加"
rggm.L["quick_change_remove_rule"] = "移除"
rggm.L["quick_change_invalid_rule"] = "不能在相同物品间切换"
rggm.L["quick_change_unable_to_remove_rule"] = "无法删除规则-请先选择要删除的规则"
rggm.L["quick_change_unable_to_add_rule_from"] = "无法添加新规则-缺少“From”项"
rggm.L["quick_change_unable_to_add_rule_to"] = "无法添加新规则-缺少'To'项"
rggm.L["quick_change_unable_to_add_rule_duplicate"] = "无法添加新规则-此物品的规则已存在"
-- trinketMenu
rggm.L["trinket_menu_category_name"] = "TrinketMenu"
rggm.L["trinket_menu_title"] = "Trinket Menu Configuration"
rggm.L["enable_trinket_menu"] = "Enable TrinketMenu"
rggm.L["enable_trinket_menu_tooltip"] = "Whether to enable and show TrinketMenu or not"
rggm.L["window_lock_trinket_menu"] = "Lock TrinketMenu"
rggm.L["window_lock_trinket_menu_tooltip"] = "Prevents TrinketMenu frame from being moved"
rggm.L["shoow_cooldowns_trinket_menu"] = "Show Cooldowns"
rggm.L["shoow_cooldowns_trinket_menu_tooltip"] = "Display a cooldown for all itemslots"
rggm.L["trinket_menu_column_amount_slider_title"] = "Columns"
rggm.L["trinket_menu_column_amount_slider_tooltip"] = "The amount of columns to use in the TrinketMenu"
rggm.L["trinket_menu_slot_size_slider_title"] = "Slot Size"
rggm.L["trinket_menu_slot_size_slider_tooltip"] = "The size of a slot in the TrinketMenu"
-- slot translations
rggm.L["slot_name_head"] = "头"
rggm.L["slot_name_neck"] = "项链"
rggm.L["slot_name_shoulders"] = "肩膀"
rggm.L["slot_name_chest"] = "胸"
rggm.L["slot_name_waist"] = "腰"
rggm.L["slot_name_legs"] = "腿"
rggm.L["slot_name_feet"] = "脚"
rggm.L["slot_name_wrist"] = "腕"
rggm.L["slot_name_hands"] = "手"
rggm.L["slot_name_upper_finger"] = "手指1"
rggm.L["slot_name_lower_finger"] = "手指2"
rggm.L["slot_name_finger"] = "手指"
rggm.L["slot_name_upper_trinket"] = "饰品1"
rggm.L["slot_name_lower_trinket"] = "饰品2"
rggm.L["slot_name_trinket"] = "饰品"
rggm.L["slot_name_back"] = "披风"
rggm.L["slot_name_main_hand"] = "主手"
rggm.L["slot_name_off_hand"] = "副手"
rggm.L["slot_name_ranged"] = "远程"
rggm.L["slot_name_ammo"] = "弹药"
-- gearbar
rggm.L["gear_bar_configuration_category_name"] = "装备条"
rggm.L["gear_bar_configuration_panel_text"] = "装备条配置"
rggm.L["gear_bar_configuration_add_gearbar"] = "创建新的装备条"
rggm.L["gear_bar_choose_name"] = "为新的装备条选择一个名称"
rggm.L["gear_bar_choose_name_accept_button"] = "接受"
rggm.L["gear_bar_choose_name_cancel_button"] = "取消"
rggm.L["gear_bar_remove_button"] = "移除装备条"
rggm.L["gear_bar_confirm_delete"] = "你真的想要删除这个装备条吗?"
rggm.L["gear_bar_confirm_delete_yes_button"] = "是"
rggm.L["gear_bar_confirm_delete_no_button"] = "否"
rggm.L["gear_bar_max_amount_of_gear_bars_reached"] =
"你达到了最大值 " .. RGGM_CONSTANTS.MAX_GEAR_BARS .. " 装备条"
-- gearbar options
rggm.L["window_lock_gear_bar"] = "锁定装备条"
rggm.L["window_lock_gear_bar_tooltip"] = "防止装备条移动"
rggm.L["show_keybindings"] = "显示快捷键"
rggm.L["show_keybindings_tooltip"] = "显示装备物品上的按键绑定"
rggm.L["show_cooldowns"] = "显示冷却计时"
rggm.L["show_cooldowns_tooltip"] = "所有装备槽上显示冷却计时"
rggm.L["gear_slot_size_slider_title"] = "齿槽大小"
rggm.L["gear_slot_size_slider_tooltip"] = "修改齿槽的大小"
rggm.L["change_slot_size_slider_title"] = "备选齿槽大小"
rggm.L["change_slot_size_slider_tooltip"] = "修改备选齿槽的大小"
rggm.L["gear_bar_max_amount_of_gear_slots_reached"] =
"你达到了最大值 " .. RGGM_CONSTANTS.MAX_GEAR_BAR_SLOTS .. " 装备条"
-- add/remove slots
rggm.L["gear_bar_configuration_add_gearslot"] = "添加装备条"
rggm.L["gear_bar_configuration_remove_gearslot"] = "-"
rggm.L["gear_bar_configuration_delete_gearbar"] = "删除装备条"
-- gearbar scrollmenu
rggm.L["gear_bar_configuration_key_binding_button"] = "设置/取消设置 按键绑定"
rggm.L["gear_bar_configuration_key_binding_not_set"] = "没有绑定按键设置"
rggm.L["gear_bar_configuration_key_binding_dialog"] = "设置按键绑定为: "
rggm.L["gear_bar_configuration_key_binding_dialog_initial"] = "(按下要使用或离开的键绑定 "
.. "留空解开绑定)"
rggm.L["gear_bar_configuration_key_binding_dialog_accept"] = "接受"
rggm.L["gear_bar_configuration_key_binding_dialog_cancel"] = "取消"
rggm.L["gear_bar_configuration_key_binding_override_dialog"] = "绑定的按键已在使用中,你想重新绑定吗?"
rggm.L["gear_bar_configuration_key_binding_dialog_override_yes"] = "是"
rggm.L["gear_bar_configuration_key_binding_dialog_override_no"] = "否"
rggm.L["gear_bar_configuration_key_binding_user_error"] = "设置新的按键绑定失败"
-- macro bridge user errors
rggm.L["unable_to_find_equipslot"] = "无法为物品Id找到匹配的槽位 %s"
rggm.L["unable_to_find_item"] = "无法为物品Id找到指定的物品信息 %s"
end
|
----
-- xl/Sound.lua
--
-- A sound engine for Reverie. That's really all there is to it.
----
local Timer = require "hump.timer"
-- Constant specifying how long to fade out the music
local MUSIC_FADE_TIME = 2
local effectsPath = "assets/sfx/"
local musicPath = "assets/music/"
local effects = {}
local music = {}
local currentMusic = nil
local Sound = {}
local function createPath( prefix, name )
return prefix .. name
end
----
-- Play a sound effect.
-- @param {string} name - name of the asset. This should be in the folder
-- "assets/sfx/"
----
function Sound.playFX( name )
local path = createPath( effectsPath, name )
if not effects[path] then
effects[path] = love.audio.newSource( path, "static" )
end
love.audio.play( effects[path] )
end
----
-- Cuts off the music.
-- This is an internal function.
----
local function musicHardStop()
if currentMusic then
currentMusic:stop()
currentMusic = nil
end
end
----
-- Fade out the music over MUSIC_FADE_TIME seconds. Once the fade is finished
-- run after().
-- This is an internal function.
----
local function fadeMusicOut( after )
-- see hump.timer
local function done()
musicHardStop()
if after then
after()
end
end
local volume = { 1.0 }
Timer.tween( MUSIC_FADE_TIME, volume, { 0.0 }, "linear" )
Timer.do_for( MUSIC_FADE_TIME, function ()
currentMusic:setVolume( volume[1] )
end, done)
end
----
-- Fade out the current background music.
----
function Sound.stopMusic()
if currentMusic and currentMusic:isPlaying() then
fadeMusicOut( nil )
end
end
----
-- Access the current background music
-- @return the current background music or nil
----
function Sound.getMusic()
return currentMusic
end
----
-- Plays background music. If there is already background music playing that
-- will be faded out before the new music starts playing. If {name} is nil
-- then the current music will be faded out and stopped.
-- @param {string} name - name of the music to play. This file should be in
-- "assets/music/"
----
function Sound.playMusic( name )
assert( name, "Music name cannot be nil" )
local path = createPath( musicPath, name )
if not music[path] then
music[path] = love.audio.newSource( path, "stream" )
music[path]:setLooping( true )
end
local m = music[path]
-- Using this function we can play the music the same way no matter
-- how we go about it.
local function playIt()
currentMusic = m
m:setVolume( 1.0 )
m:play()
end
if currentMusic and currentMusic:isPlaying() then
fadeMusicOut( playIt )
else
playIt()
end
end
function Sound.get( name )
return effects[name] or music[name]
end
return Sound |
-- This Source Code Form is subject to the terms of the MIT License
-- Copyright 2016 Frédéric VANNIÈRE <f.vanniere@planet-work.com>
--[[
# Syslog Basic Decoder Module
## Decoder Configuration Table
```lua
-- template (string) - The 'template' configuration string from rsyslog.conf
-- see http://rsyslog-5-8-6-doc.neocities.org/rsyslog_conf_templates.html
-- Default:
-- template = "<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%" -- RSYSLOG_TraditionalForwardFormat
```
## Functions
### decode
Decode and inject the resulting message
*Arguments*
- data (string) - syslog message
- default_headers (optional table) - Heka message table containing the default
header values to use, if they are not populated by the decoder. If 'Fields'
is specified it should be in the hashed based format see:
http://mozilla-services.github.io/lua_sandbox/heka/message.html
*Return*
- (nil, string) or throws an error on invalid data or an inject message failure
- nil - if the decode was successful
- string - error message if the decode failed (e.g. no match)
--]]
-- Imports
local syslog = require "lpeg.syslog"
local syslog_message = require "lpeg.syslog_message"
local syslog_parser = require"lpeg.syslog_parser"
local clf = require "lpeg.common_log_format"
local dt = require "lpeg.date_time"
local io = require"io"
local circular_buffer = require "circular_buffer"
local pw = require"pwlib"
local os = require"os"
local geoip = require"geoip"
local geoip_country = require 'geoip.country'
local geoip_country_filename = "/usr/share/GeoIP/GeoIP.dat"
local geoip_countryv6_filename = "/usr/share/GeoIP/GeoIPv6.dat"
local geoip_country_lookup = geoip_country.open(geoip_country_filename,geoip.MEMORY_CACHE)
local geoip_country_lookup6 = geoip_country.open(geoip_countryv6_filename,geoip.MEMORY_CACHE,geoip.COUNTRY_V6)
local template = read_config("syslog_template") or "<%PRI%>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% %msg%"
local grammar = syslog.build_rsyslog_grammar(template)
-- invalid structured data due to longer sd-name than allowed by RFC (UUID=36 > 32), msg containts structured data + msg
local msg_grammar = syslog_parser.get_prog_grammar("syslog_structured_data")
local pairs = pairs
local ipairs = ipairs
local type = type
local tonumber = tonumber
local pcall = pcall
local string = string
local inject_message = inject_message
local debug = debug
local msg = {}
local loghost_id = read_config("loghost_id") or '34200'
local flood_cb = circular_buffer.new(1440, 1, 120)
local M = {}
setfenv(1, M) -- Remove external access to contain everything in the module
function decode(data)
local fields = grammar:match(data)
if not fields then return "parse failed: " .. data end
local fields_msg = msg_grammar:match(fields.msg)
if not fields_msg then return "struct data parse failed for " .. fields.msg end
fields.msg = fields_msg[2].msg
structured_data = fields_msg[1]
-- debug("FIELDS", fields)
-- tenant_id@pw = structured_data.id
if fields.pri then
msg.Severity = fields.pri.severity
fields.syslogfacility = fields.pri.facility
fields.pri = nil
else
msg.Severity = fields.syslogseverity or fields["syslogseverity-text"]
or fields.syslogpriority or fields["syslogpriority-text"]
fields.syslogseverity = nil
fields["syslogseverity-text"] = nil
fields.syslogpriority = nil
fields["syslogpriority-text"] = nil
end
if fields.syslogtag then
fields.programname = fields.syslogtag.programname
msg.Pid = tonumber(fields.syslogtag.pid)
fields.syslogtag = nil
end
msg.Hostname = fields.hostname or fields.source
fields.hostname = nil
fields.source = nil
msg.Payload = fields.msg
fields.msg = nil
msg.Fields = {}
msg.Fields.message = msg.Payload
-- add Tenant
tenant, tenant_id = pw.get_tenant(msg.Hostname)
if tenant_id then
--[[
if not string.find(tenant_id .. "@" .. loghost_id, structured_data) then
pwlib.debug("[syslog_decoder] bad tenant_id from " .. msg.Hostname)
--return 0
end
]]--
end
msg.Fields.tenant = tenant
msg.Fields.appname = fields['app-name']
msg.Pid = tonumber(fields['procid'])
msg.Type = 'syslog'
msg.Logger = 'syslog'
msg.Timestamp = os.date("%Y-%m-%dT%H:%M:%S%z",fields.timestamp/1e9)
msg.EnvVersion = 1
msg.Fields.timestamp = msg.Timestamp
-- Parse data from Application
if msg.Payload:sub(1,4) == 'pam_' then
app_grammar = syslog_message.get_wildcard_grammar('PAM')
else
app_grammar = syslog_parser.get_prog_grammar(msg.Fields.appname)
end
if app_grammar == nil then
app_grammar = syslog_message.get_prog_grammar(msg.Fields.appname)
end
local apache_cf = '$http_host $remote_addr - $remote_user [$time_local] "$request_method $request_uri $server_protocol" $status $bytes_sent "$http_referer" "$http_user_agent"'
if msg.Fields.appname == "nginx-access" then
if msg.Payload:sub(-1,-1) == '"' then
nginx_cf = apache_cf
else
nginx_cf = apache_cf .. ' $request_time'
end
app_grammar = clf.build_nginx_grammar(nginx_cf)
elseif msg.Fields.appname == "apache-access" then
app_grammar = clf.build_nginx_grammar(apache_cf)
end
-- No need to parse named/bind
if msg.Fields.appname == 'named' then app_grammar = nil end
-- Flood protection
if msg.Fields.appname == "php" then
local x = string.match(msg.Payload,"] PHP .*")
if x ~= nil then
hash = pw.hash(x)
--flood_cb:
end
end
exclude_fields = {1,2,3,4,5,6,7,
'cron_detail','cron_event',
'remoteAddr2',
'eximRouter','eximTls','eximRemoteRes','eximTransport',
'eximBounce','eximLogMsg','eximMailto',
'nginx_connection','nginx_tid','apache_module','phpErrDetails',
'ftp_args','ftp_cwd','ftp_message',
'mail_machinename', 'mail_session','mailto'
}
if app_grammar then
newfields = app_grammar:match(msg.Payload)
if newfields == nil then
msg.Fields.hs_error = "Parser error"
--pw.debug("Failed to parse for " .. msg.Fields.appname .. ': '.. msg.Payload)
else
--debug("FIELDS", newfields)
for k, v in pairs(newfields) do
for i,x in ipairs(exclude_fields) do
if k == x then v = nil end
end
if k == "remote_addr" then
k = "remoteAddr"
v = v.value
elseif k == 1 or k == 2 then v = nil
elseif k == "http_user_agent" then k = "http_userAgent"
elseif k == "status" then k = "http_status"
elseif k == "bytes_sent" then k = "http_outBytes"; v = v.value
elseif k == "request_time" then k = "http_requestTime"; v = v.value
elseif k == "server_protocol" then k = "http_protocol"
elseif k == "request_method" then k = "http_method"
elseif k == "request_uri" then k = "http_uri"
elseif k == "remote_user" and v == "-" then v = ""; k = "http_remoteUser"
elseif k == "remote_user" then k = "http_remoteUser"
elseif k == "pid" then msg.Pid = v ; v = nil
elseif k == "php_severity" then msg.Fields.appname = 'php'
elseif k == "cron_username" then k = 'user'
elseif k == "user_name" then k = 'user'
elseif k == "eximUser" then k = 'user'
end
if k == "timestamp" then
if msg.Fields.appname == "apache-error"
or msg.Fields.appname == "php"
or msg.Fields.appname == "exim"
or msg.Fields.appname == "nginx-error" then
v = pw.ts_to_datetime_cest(v,msg.Hostname)
else
v = pw.ts_to_datetime(v,msg.Hostname)
end
elseif k == "time" then
v = pw.ts_to_datetime(v,msg.Hostname)
k = "timestamp"
end
msg.Fields[k] = v
end
end
else
--debug("No grammar for " .. msg.Fields.appname)
end
msg.Timestamp = msg.Fields.timestamp
msg.Fields.message = msg.Payload
msg.Payload = nil
-- add User
if msg.Fields.user == nil then
if msg.Fields.host then
msg.Fields.vhost, msg.Fields.user = pw.get_user_vhost_from_host(msg.Fields.host, tenant)
elseif msg.Fields.uid then
msg.Fields.user = pw.get_user_from_uid(msg.Fields.uid, tenant)
elseif msg.Fields.filename then
local x = string.match(msg.Fields.filename, "/home/([a-z0-9_-.]*)/")
msg.Fields.user = x
end
if msg.Fields.user == nil and msg.Fields.mail_login ~= nil then
msg.Fields.user = pw.get_user_from_login(msg.Fields.mail_login, tenant)
elseif msg.Fields.user == nil and msg.Fields.ftp_login ~= nil then
msg.Fields.user = pw.get_user_from_login(msg.Fields.ftp_login, tenant)
end
end
-- add Vhost
if msg.Fields.http_host then
-- Cleanup fields
if msg.Fields.http_remoteUser == "" then msg.Fields.http_remoteUser = nil end
if msg.Fields.http_referer == "-" then msg.Fields.http_referer = "" end
msg.Fields.http_vhost, user2 = pw.get_user_vhost_from_host(msg.Fields.http_host,tenant)
if msg.Fields.user and user2 ~= msg.Fields.user then
msg.Fields.hs_error = "Bad user"
--pw.debug("Error : bad USER from logs " .. user2 .. " ~= " .. msg.Fields.user .. ": " .. msg.Fields.message)
end
if msg.Fields.user == nil then
msg.Fields.user = user2
end
end
-- add Country
if msg.Fields.remoteAddr and string.len(msg.Fields.remoteAddr) > 7 then
msg.Fields.remoteCountry = pw.getCountry(msg.Fields.remoteAddr)
end
if msg == nil then
pw.debug("ERROR, empty message")
else
err = pcall(inject_message,msg)
if err then
--OK
else
pw.debug("ERROR, NIL for "..msg.Fields.message)
end
end
end
return M
|
-- NoticeForRecord.lua
-- Author:Demon
-- Date:2016/3/8
-- Last modification:
-- Description:
-- Note:
local newObjectCaseRecordNotice = require(ViewPath .. "hall/newObjectCase/newObjectCaseRecordNotice");
require("common/IPopDialogManager");
local hallLayerBaseWithName = require("hall/widget/hallLayerBaseWithName")
local NoticeForRecord = class(hallLayerBaseWithName,false);
NoticeForRecord.s_layerName = "case_congratulation";
NoticeForRecord.ctor = function(self,p_data,p_clientType)
local __layout = require(ViewPath .. "hall/newObjectCase/newObjectCaseRecordNotice");
super(self,__layout,nil,NoticeForRecord.s_layerName );
self:declareLayoutVar(ViewPath.."hall/newObjectCase/newObjectCaseRecordNotice".."_layout_var");
self.m_data = p_data;
--数据补全
self.m_data.name = self.m_data.name or self.m_data.prizeName;
if self.m_data.prizeImage == "" or self.m_data.prizeImage == nil then
if type(self.m_data.boxItemID) == 'number' then
local propInfo = RechargeDataInterface.getInstance():getGoodInfoByTypeIdWithMap(tonumber(self.m_data.boxItemID));
propInfo = table.verify(propInfo); --后台很有可能没有配清所有的物品
--icon补全
self.m_data.prizeImage = propInfo.item_icon or "";
end
end
self.m_clientType = p_clientType ;
--如果数据源不是来自记录,,应该补全数据
if not self.m_data.status then
if self.m_clientType == BagTypeAdapter.s_offline then
self.m_data.status = "已领奖";
elseif self.m_clientType == BagTypeAdapter.s_onlineEntity then
self.m_data.status = "审核中";
elseif self.m_clientType == BagTypeAdapter.s_onlineVirtual then
self.m_data.status = "充值中";
end
end
self:setFillParent(true, true);
self:addToRoot();
self:getHandle();
self:init();
self:setListenBackEvent(true);
end
NoticeForRecord.dtor = function(self)
ImageCache.getInstance():cleanRef(self);
end
--得到相关句柄
NoticeForRecord.getHandle = function(self)
self:getComponent();
self:runUiAction(UiAnimConfig.ACTION.BEGIN, self.mm_ImageBack);
end
NoticeForRecord.init = function(self)
--充值失败
if self.m_data.status == "已退还" then
self:__failInit();
else
self:__successInit();
end
self:__initDes();
local __commonFunction = require("hall/backpack/commonFunction/commonFunction");
local __phoneWidget = __commonFunction.createClientPhoneWidget();
if not __phoneWidget then
self.mm_View_clientPhone:setVisible(false);
else
self.mm_View_phoneNumber:addChild(__phoneWidget);
local __w,__ = __phoneWidget:getSize();
self.mm_phoneLogo:setPos(__w+5 ,nil);
end
end
NoticeForRecord.__failInit = function(self)
self.mm_Image_tittle:setVisible(false);
self.mm_Image_tittle__fail:setVisible(true);
self.mm_Image_succes:setVisible(false);
self.mm_ImageFail:setVisible(true);
self.mm_Button_share_circle:setVisible(false);
self.mm_Button_share_friend:setVisible(false);
self.mm_describeFrame:setPos(nil,160);
self.mm_Text_fail_name:setText(self.m_data.name);
ImageCache.getInstance():request(self.m_data.prizeImage,self,self.onFailGetImage);
end
NoticeForRecord.__successInit = function(self)
local __prefix = "恭喜获得";
if self.m_clientType == BagTypeAdapter.s_shard then
self.mm_Image_tittle:setVisible(false);
self.mm_Image_tittle_shard:setVisible(true);
__prefix = "恭喜合成"
end
local __string = __prefix..self.m_data.name;
self.mm_Text_congratulation:setText(__string);
ImageCache.getInstance():request(self.m_data.prizeImage,self,self.onGetImage);
ImageCache.getInstance():request(self.m_data.twoDimensionCode,self,self.onGetImage2);
end
NoticeForRecord.__initDes = function(self)
if self.m_clientType == BagTypeAdapter.s_offline then
if self.m_data.status == "已领奖" then
self.mm_TextView_des:setText("奖品已领取,祝游戏愉快!");
end
elseif self.m_clientType == BagTypeAdapter.s_shard then
self.mm_TextView_des:setText("合成成功,祝游戏愉快!");
elseif self.m_clientType == BagTypeAdapter.s_onlineEntity then
if self.m_data.status == "已发货" then
self.mm_TextView_des:setVisible(false);
self.mm_View_forOrder:setVisible(true);
self.mm_Text_company:setText("承运公司:"..self.m_data.company);
local _tips = string.format("#ca26c40#u%s",""..self.m_data.oddNum);
local __w,__h = self.mm_View_orderFrame:getSize();
local richText = new(RichText,_tips, __w, __h, kAlignBottomLeft, nil, 20,nil,nil,nil,true);
richText:setAlign(kAlignBottomLeft);
self.mm_View_orderFrame:addChild(richText);
elseif self.m_data.status == "审核中" then
self.mm_TextView_des:setText("您的资料已提交,通过审核后,我们将在3个工作日内为您发货");
end
elseif self.m_clientType == BagTypeAdapter.s_onlineVirtual then
if self.m_data.status == "已退还" then
self.mm_TextView_des:setText("由于运营商原因未充值成功,已通过私信退还话费券,请注意查收。");
elseif self.m_data.status == "充值中" then
self.mm_TextView_des:setText("运营商充值到帐可能有延迟,请耐心等待。若7个工作日仍未充值成功将返回话费券。");
elseif self.m_data.status == "已充值" then
self.mm_TextView_des:setText("充值已成功,运营商充值到帐可能有延迟,请留意到帐短信。");
end
end
end
NoticeForRecord.onFailGetImage = function(self,url,imagePath)
local icon = UIFactory.createImage(imagePath);
if icon then
self.m_imagePrizeDownloadOk = true;
local w,h = self.mm_Image_icon_fail:getSize();
local iconW , iconH = icon:getSize();
local scaleW = iconW>iconH and w or h*iconW/iconH;
local scaleH = iconW>iconH and w*iconH/iconW or h;
icon:setSize(scaleW,scaleH);
icon:setAlign(kAlignCenter);
self.mm_Image_icon_fail:addChild(icon);
end
end
NoticeForRecord.onGetImage = function(self,url,imagePath)
local icon = UIFactory.createImage(imagePath);
if icon then
self.m_imagePrizeDownloadOk = true;
local w,h = self.mm_View_icon_bg:getSize();
local iconW , iconH = icon:getSize();
local scaleW = iconW>iconH and w or h*iconW/iconH;
local scaleH = iconW>iconH and w*iconH/iconW or h;
icon:setSize(scaleW,scaleH);
icon:setAlign(kAlignCenter);
self.mm_View_icon_bg:addChild(icon);
end
end
NoticeForRecord.onGetImage2 = function(self,url,imagePath)
if type(imagePath) == 'string' and imagePath ~= "" then
self.m_imageTowCodeDownloadOk = true;
end
end
NoticeForRecord.oncloseBtnClick = function(self)
self:close();
end
--调用打电话系统
NoticeForRecord.onBindToCallPhone = function(self,finger_action,x,y,drawing_id_first,drawing_id_current, event_time)
if finger_action == kFingerUp then
BackpackDataInterface.getInstance():callHotline();
end
end
NoticeForRecord.onBindToCopyOrder = function(self,finger_action,x,y,drawing_id_first,drawing_id_current, event_time)
if finger_action == kFingerUp then
local orderNumber = tostring(self.m_data.oddNum) or "";
PasswordDataInterface.getInstance():setTextToClipboard(orderNumber);
Toast.getInstance():showText("运单号已复制", 50, 30, kAlignLeft, "", 24, 200, 175, 110);
end
end
NoticeForRecord.onBindToCircle = function(self)
if self.m_imagePrizeDownloadOk and self.m_imageTowCodeDownloadOk then
local __wnd = LayerManagerIsolater.getInstance():show("case_Share_Result",self.m_data);
local __shareImagePath = __wnd:createShareImage();
delete(__wnd);
if not string.isEmpty(__shareImagePath) then
Clock.instance():schedule_once(function()
WeixinShareUtil.getInstance():weixinSendImage(__shareImagePath, true);
end, 1);
end
end
end
NoticeForRecord.onBindToShareFried = function(self)
if self.m_imagePrizeDownloadOk and self.m_imageTowCodeDownloadOk then
local __wnd = LayerManagerIsolater.getInstance():show("case_Share_Result",self.m_data);
local __shareImagePath = __wnd:createShareImage();
delete(__wnd);
if not string.isEmpty(__shareImagePath) then
Clock.instance():schedule_once(function()
WeixinShareUtil.getInstance():weixinSendImage(__shareImagePath, false);
end, 1);
end
end
end
return NoticeForRecord;
|
AddCSLuaFile()
DEFINE_BASECLASS("drivable_gun_ar2")
ENT.Base = "drivable_gun_ar2"
ENT.Author = "TankNut"
ENT.Model = Model("models/weapons/w_smg1.mdl")
ENT.HoldType = "smg1"
ENT.FireRate = 60 / 800
ENT.Spread = 5
function ENT:DoFire()
if CurTime() - self:GetLastFire() < self.FireRate then
return
end
self:SetLastFire(CurTime())
local ed = EffectData()
ed:SetEntity(self)
ed:SetOrigin(self:WorldSpaceCenter())
ed:SetAttachment(1)
ed:SetScale(1)
util.Effect("drivable_muzzleflash_smg", ed)
self:EmitSound("Weapon_SMG1.NPC_Single")
local spread = self:GetSpread()
local parent = self:GetParent()
self:FireBullets({
Attacker = parent.Player,
Damage = 4,
TracerName = "Tracer",
Dir = parent:GetAimAngle():Forward(),
Spread = Vector(spread, spread, spread),
Src = parent:GetShootPos(),
IgnoreEntity = parent
})
parent:SetLayerCycle(2, 0)
end |
require('gitsigns').setup {
-- signs config
current_line_blame = false, --enable to see the person that made the last change.
current_line_blame_opts = {
virt_text_pos = 'right_align'
}
}
|
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local B = E:GetModule('Blizzard')
local Skins = E:GetModule('Skins')
local _G = _G
local CreateFrame = CreateFrame
local IsAddOnLoaded = IsAddOnLoaded
function B:Initialize()
self.Initialized = true
self:EnhanceColorPicker()
self:KillBlizzard()
self:AlertMovers()
self:PositionCaptureBar()
self:PositionDurabilityFrame()
self:PositionGMFrames()
self:SkinBlizzTimers()
self:PositionVehicleFrame()
self:PositionTalkingHead()
self:Handle_LevelUpDisplay_BossBanner()
self:Handle_UIWidgets()
self:GarrisonDropDown()
if not IsAddOnLoaded("DugisGuideViewerZ") then
self:MoveObjectiveFrame()
end
if not IsAddOnLoaded("SimplePowerBar") then
self:PositionAltPowerBar()
self:SkinAltPowerBar()
end
E:CreateMover(_G.LossOfControlFrame, 'LossControlMover', L["Loss Control Icon"])
-- Quick Join Bug
CreateFrame("Frame"):SetScript("OnUpdate", function()
if _G.LFRBrowseFrame.timeToClear then
_G.LFRBrowseFrame.timeToClear = nil
end
end)
-- MicroButton Talent Alert
local TalentMicroButtonAlert = _G.TalentMicroButtonAlert
if TalentMicroButtonAlert then -- why do we need to check this?
if E.global.general.showMissingTalentAlert then
TalentMicroButtonAlert:ClearAllPoints()
TalentMicroButtonAlert:Point("CENTER", E.UIParent, "TOP", 0, -75)
TalentMicroButtonAlert:StripTextures()
TalentMicroButtonAlert.Arrow:Hide()
TalentMicroButtonAlert.Text:FontTemplate()
TalentMicroButtonAlert:CreateBackdrop("Transparent")
Skins:HandleCloseButton(TalentMicroButtonAlert.CloseButton)
TalentMicroButtonAlert.tex = TalentMicroButtonAlert:CreateTexture(nil, "OVERLAY")
TalentMicroButtonAlert.tex:Point("RIGHT", -10, 0)
TalentMicroButtonAlert.tex:SetTexture("Interface\\DialogFrame\\UI-Dialog-Icon-AlertNew")
TalentMicroButtonAlert.tex:Size(32, 32)
else
TalentMicroButtonAlert:Kill() -- Kill it, because then the blizz default will show
end
end
end
local function InitializeCallback()
B:Initialize()
end
E:RegisterModule(B:GetName(), InitializeCallback)
|
--[[
LuCI - Lua Configuration Interface
Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
]]--
local fs = require "nixio.fs"
local nw = require "luci.model.network"
local fw = require "luci.model.firewall"
local uci = require "luci.model.uci".cursor()
local http = require "luci.http"
local iw = luci.sys.wifi.getiwinfo(http.formvalue("device"))
local has_firewall = fs.access("/etc/config/firewall")
if not iw then
luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless"))
return
end
m = SimpleForm("network", translate("Join Network: Settings"))
m.cancel = translate("Back to scan results")
m.reset = false
function m.on_cancel()
local dev = http.formvalue("device")
http.redirect(luci.dispatcher.build_url(
dev and "admin/network/wireless_join?device=" .. dev
or "admin/network/wireless"
))
end
nw.init(uci)
fw.init(uci)
m.hidden = {
device = http.formvalue("device"),
join = http.formvalue("join"),
channel = http.formvalue("channel"),
mode = http.formvalue("mode"),
bssid = http.formvalue("bssid"),
wep = http.formvalue("wep"),
wpa_suites = http.formvalue("wpa_suites"),
wpa_version = http.formvalue("wpa_version")
}
if iw and iw.mbssid_support then
replace = m:field(Flag, "replace", translate("Replace wireless configuration"),
translate("An additional network will be created if you leave this unchecked."))
function replace.cfgvalue() return "1" end
else
replace = m:field(DummyValue, "replace", translate("Replace wireless configuration"))
replace.default = translate("The hardware is not multi-SSID capable and existing " ..
"configuration will be replaced if you proceed.")
function replace.formvalue() return "1" end
end
if http.formvalue("wep") == "1" then
key = m:field(Value, "key", translate("WEP passphrase"),
translate("Specify the secret encryption key here."))
key.password = true
key.datatype = "wepkey"
elseif (tonumber(m.hidden.wpa_version) or 0) > 0 and
(m.hidden.wpa_suites == "PSK" or m.hidden.wpa_suites == "PSK2")
then
key = m:field(Value, "key", translate("WPA passphrase"),
translate("Specify the secret encryption key here."))
key.password = true
key.datatype = "wpakey"
--m.hidden.wpa_suite = (tonumber(http.formvalue("wpa_version")) or 0) >= 2 and "psk2" or "psk"
end
newnet = m:field(Value, "_netname_new", translate("Name of the new network"),
translate("The allowed characters are: <code>A-Z</code>, <code>a-z</code>, " ..
"<code>0-9</code> and <code>_</code>"
))
newnet.default = m.hidden.mode == "Ad-Hoc" and "mesh" or "wwan"
newnet.datatype = "uciname"
if has_firewall then
fwzone = m:field(Value, "_fwzone",
translate("Create / Assign firewall-zone"),
translate("Choose the firewall zone you want to assign to this interface. Select <em>unspecified</em> to remove the interface from the associated zone or fill out the <em>create</em> field to define a new zone and attach the interface to it."))
fwzone.template = "cbi/firewall_zonelist"
fwzone.default = m.hidden.mode == "Ad-Hoc" and "mesh" or "wan"
end
function newnet.parse(self, section)
local net, zone
if has_firewall then
local zval = fwzone:formvalue(section)
zone = fw:get_zone(zval)
if not zone and zval == '-' then
zval = m:formvalue(fwzone:cbid(section) .. ".newzone")
if zval and #zval > 0 then
zone = fw:add_zone(zval)
end
end
end
local wdev = nw:get_wifidev(m.hidden.device)
wdev:set("disabled", false)
wdev:set("channel", m.hidden.channel)
if replace:formvalue(section) then
local n
for _, n in ipairs(wdev:get_wifinets()) do
wdev:del_wifinet(n)
end
end
local wconf = {
device = m.hidden.device,
ssid = m.hidden.join,
mode = (m.hidden.mode == "Ad-Hoc" and "adhoc" or "sta")
}
if m.hidden.wep == "1" then
wconf.encryption = "wep-open"
wconf.key = "1"
wconf.key1 = key and key:formvalue(section) or ""
elseif (tonumber(m.hidden.wpa_version) or 0) > 0 then
wconf.encryption = (tonumber(m.hidden.wpa_version) or 0) >= 2 and "psk2" or "psk"
wconf.key = key and key:formvalue(section) or ""
else
wconf.encryption = "none"
end
if wconf.mode == "adhoc" then
wconf.bssid = m.hidden.bssid
end
local value = self:formvalue(section)
net = nw:add_network(value, { proto = "dhcp" })
if not net then
self.error = { [section] = "missing" }
else
wconf.network = net:name()
local wnet = wdev:add_wifinet(wconf)
if wnet then
if zone then
fw:del_network(net:name())
zone:add_network(net:name())
end
uci:save("wireless")
uci:save("network")
uci:save("firewall")
luci.http.redirect(wnet:adminlink())
end
end
end
if has_firewall then
function fwzone.cfgvalue(self, section)
self.iface = section
local z = fw:get_zone_by_network(section)
return z and z:name()
end
end
return m
|
local t = Def.ActorFrame {};
t[#t+1] = StandardDecorationFromFileOptional("BackgroundFrame","BackgroundFrame");
return t |
local Roact = require(game.ReplicatedStorage.Roact)
local TweenService = game:GetService("TweenService")
local UpdateAlert = Roact.Component:extend("UpdateAlert")
local fade = TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
function UpdateAlert:init()
self.updateRef = Roact.createRef()
self:setState({
updating = true,
})
end
function UpdateAlert:render()
return Roact.createElement("ImageLabel", {
Name = "UpdateAlert",
BackgroundTransparency = 1,
Position = UDim2.new(0, 20, 0, -50),
Size = UDim2.new(0, 343, 0, 217),
AnchorPoint = Vector2.new(0, 0),
Image = self.state.updating and "rbxassetid://3606598190" or "rbxassetid://3606598062",
[Roact.Ref] = self.updateRef,
})
end
function UpdateAlert:didMount()
TweenService:Create(self.updateRef.current, fade, {Position = UDim2.new(0, 20, 0, 35)}):Play()
self.running = true
spawn(function()
while self.running do
self:setState(function(state)
return {
updating = self.props.updating:getValue()
}
end)
wait(0.5)
end
end)
end
function UpdateAlert:willUnmount()
self.running = false
end
return UpdateAlert |
object_tangible_component_weapon_new_weapon_enhancement_melee_slot_two_s07 = object_tangible_component_weapon_new_weapon_shared_enhancement_melee_slot_two_s07:new {
}
ObjectTemplates:addTemplate(object_tangible_component_weapon_new_weapon_enhancement_melee_slot_two_s07, "object/tangible/component/weapon/new_weapon/enhancement_melee_slot_two_s07.iff")
|
module("luci.controller.autoupdate",package.seeall)
function index()
entry({"admin","system","autoupdate"},cbi("autoupdate"),_("AutoUpdate"),99)
end
|
client_scripts {
"mapmanager_shared.lua",
"mapmanager_client.lua"
}
server_scripts {
"mapmanager_shared.lua",
"mapmanager_server.lua"
}
fx_version 'adamant'
games { 'gta5', 'rdr3' }
server_export "getCurrentGameType"
server_export "getCurrentMap"
server_export "changeGameType"
server_export "changeMap"
server_export "doesMapSupportGameType"
server_export "getMaps"
server_export "roundEnded"
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.' |
local skynet = require 'skynet'
return {
get = function(self)
local get = ngx.req.get_uri_args()
local ioe_data = skynet.call(".upgrader", "lua", "latest_version", "freeioe", true)
assert(ioe_data)
local skynet_data = skynet.call(".upgrader", "lua", "latest_version", "skynet", true)
assert(skynet_data)
local ret = {
ioe = ioe_data,
skynet = skynet_data,
}
lwf.json(self, ret)
end,
}
|
gl.setup(400, 400)
function readln()
return coroutine.yield()
end
if not N.clients then
N.clients = {}
end
node.event("connect", function(client)
local handler = coroutine.wrap(echo)
N.clients[client] = handler
handler(function(...)
node.client_write(client, ...)
end)
end)
node.event("input", function(line, client)
N.clients[client](line)
end)
node.event("disconnect", function(client)
N.clients[client] = nil
end)
function echo(print)
print("I will repeat everything you send me")
while true do
local line = readln()
print(line)
end
end
util.auto_loader(_G)
function node.render()
gl.clear(1,1,1,1)
util.draw_correct(blue_macaw, 0, 0, WIDTH, HEIGHT)
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.